text:
@class ComGoogleCommonCacheCacheBuilder;
@class ComGoogleCommonCacheLocalCache_StrengthEnum;
@class JavaLangBoolean;
@class JavaLangInteger;
@class JavaLangLong;
@class JavaUtilConcurrentTimeUnitEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec : NSObject {
 @public
  JavaLangInteger *initialCapacity_;
  JavaLangLong *maximumSize_;
  JavaLangLong *maximumWeight_;
  JavaLangInteger *concurrencyLevel_;
  ComGoogleCommonCacheLocalCache_StrengthEnum *keyStrength_;
  ComGoogleCommonCacheLocalCache_StrengthEnum *valueStrength_;
  JavaLangBoolean *recordStats_;
  jlong writeExpirationDuration_;
  JavaUtilConcurrentTimeUnitEnum *writeExpirationTimeUnit_;
  jlong accessExpirationDuration_;
  JavaUtilConcurrentTimeUnitEnum *accessExpirationTimeUnit_;
  jlong refreshDuration_;
  JavaUtilConcurrentTimeUnitEnum *refreshTimeUnit_;
}

#pragma mark Public

+ (ComGoogleCommonCacheCacheBuilderSpec *)disableCaching;

- (jboolean)isEqual:(id)obj;

- (NSUInteger)hash;

+ (ComGoogleCommonCacheCacheBuilderSpec *)parseWithNSString:(NSString *)cacheBuilderSpecification;

- (NSString *)toParsableString;

- (NSString *)description;

#pragma mark Package-Private

- (ComGoogleCommonCacheCacheBuilder *)toCacheBuilder;

@end

J2OBJC_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec)

J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, initialCapacity_, JavaLangInteger *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, maximumSize_, JavaLangLong *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, maximumWeight_, JavaLangLong *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, concurrencyLevel_, JavaLangInteger *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, keyStrength_, ComGoogleCommonCacheLocalCache_StrengthEnum *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, valueStrength_, ComGoogleCommonCacheLocalCache_StrengthEnum *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, recordStats_, JavaLangBoolean *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, writeExpirationTimeUnit_, JavaUtilConcurrentTimeUnitEnum *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, accessExpirationTimeUnit_, JavaUtilConcurrentTimeUnitEnum *)
J2OBJC_FIELD_SETTER(ComGoogleCommonCacheCacheBuilderSpec, refreshTimeUnit_, JavaUtilConcurrentTimeUnitEnum *)

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec *ComGoogleCommonCacheCacheBuilderSpec_parseWithNSString_(NSString *cacheBuilderSpecification);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec *ComGoogleCommonCacheCacheBuilderSpec_disableCaching();

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_ValueParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_ValueParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_ValueParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@protocol ComGoogleCommonCacheCacheBuilderSpec_ValueParser < NSObject, JavaObject >

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_ValueParser)

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_ValueParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_IntegerParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_IntegerParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_IntegerParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_IntegerParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

#pragma mark Protected

- (void)parseIntegerWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withInt:(jint)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_IntegerParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_IntegerParser_init(ComGoogleCommonCacheCacheBuilderSpec_IntegerParser *self);

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_IntegerParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_LongParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_LongParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_LongParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_LongParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

#pragma mark Protected

- (void)parseLongWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                 withLong:(jlong)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_LongParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_LongParser_init(ComGoogleCommonCacheCacheBuilderSpec_LongParser *self);

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_LongParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser : ComGoogleCommonCacheCacheBuilderSpec_IntegerParser

#pragma mark Protected

- (void)parseIntegerWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withInt:(jint)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser_init(ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser *new_ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_InitialCapacityParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser : ComGoogleCommonCacheCacheBuilderSpec_LongParser

#pragma mark Protected

- (void)parseLongWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                 withLong:(jlong)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser_init(ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser *new_ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_MaximumSizeParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser : ComGoogleCommonCacheCacheBuilderSpec_LongParser

#pragma mark Protected

- (void)parseLongWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                 withLong:(jlong)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser_init(ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser *new_ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_MaximumWeightParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser : ComGoogleCommonCacheCacheBuilderSpec_IntegerParser

#pragma mark Protected

- (void)parseIntegerWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withInt:(jint)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser_init(ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser *new_ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_ConcurrencyLevelParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class ComGoogleCommonCacheLocalCache_StrengthEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (instancetype)initWithComGoogleCommonCacheLocalCache_StrengthEnum:(ComGoogleCommonCacheLocalCache_StrengthEnum *)strength;

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser_initWithComGoogleCommonCacheLocalCache_StrengthEnum_(ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser *self, ComGoogleCommonCacheLocalCache_StrengthEnum *strength);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser *new_ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser_initWithComGoogleCommonCacheLocalCache_StrengthEnum_(ComGoogleCommonCacheLocalCache_StrengthEnum *strength) NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_KeyStrengthParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class ComGoogleCommonCacheLocalCache_StrengthEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (instancetype)initWithComGoogleCommonCacheLocalCache_StrengthEnum:(ComGoogleCommonCacheLocalCache_StrengthEnum *)strength;

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser_initWithComGoogleCommonCacheLocalCache_StrengthEnum_(ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser *self, ComGoogleCommonCacheLocalCache_StrengthEnum *strength);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser *new_ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser_initWithComGoogleCommonCacheLocalCache_StrengthEnum_(ComGoogleCommonCacheLocalCache_StrengthEnum *strength) NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_ValueStrengthParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser_

@class ComGoogleCommonCacheCacheBuilderSpec;

@interface ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser_init(ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser *new_ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_RecordStatsParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_DurationParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_DurationParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_DurationParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class JavaUtilConcurrentTimeUnitEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_DurationParser : NSObject < ComGoogleCommonCacheCacheBuilderSpec_ValueParser >

#pragma mark Public

- (void)parseWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                         withNSString:(NSString *)key
                                         withNSString:(NSString *)value;

#pragma mark Protected

- (void)parseDurationWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withLong:(jlong)duration
                           withJavaUtilConcurrentTimeUnitEnum:(JavaUtilConcurrentTimeUnitEnum *)unit;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_DurationParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_DurationParser_init(ComGoogleCommonCacheCacheBuilderSpec_DurationParser *self);

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_DurationParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class JavaUtilConcurrentTimeUnitEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser : ComGoogleCommonCacheCacheBuilderSpec_DurationParser

#pragma mark Protected

- (void)parseDurationWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withLong:(jlong)duration
                           withJavaUtilConcurrentTimeUnitEnum:(JavaUtilConcurrentTimeUnitEnum *)unit;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser_init(ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser *new_ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_AccessDurationParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class JavaUtilConcurrentTimeUnitEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser : ComGoogleCommonCacheCacheBuilderSpec_DurationParser

#pragma mark Protected

- (void)parseDurationWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withLong:(jlong)duration
                           withJavaUtilConcurrentTimeUnitEnum:(JavaUtilConcurrentTimeUnitEnum *)unit;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser_init(ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser *new_ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_WriteDurationParser)

#endif

#if !defined (_ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser_) && (ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL || ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser_INCLUDE)
#define _ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser_

@class ComGoogleCommonCacheCacheBuilderSpec;
@class JavaUtilConcurrentTimeUnitEnum;

@interface ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser : ComGoogleCommonCacheCacheBuilderSpec_DurationParser

#pragma mark Protected

- (void)parseDurationWithComGoogleCommonCacheCacheBuilderSpec:(ComGoogleCommonCacheCacheBuilderSpec *)spec
                                                     withLong:(jlong)duration
                           withJavaUtilConcurrentTimeUnitEnum:(JavaUtilConcurrentTimeUnitEnum *)unit;

#pragma mark Package-Private

- (instancetype)init;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser)

FOUNDATION_EXPORT void ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser_init(ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser *self);

FOUNDATION_EXPORT ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser *new_ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser_init() NS_RETURNS_RETAINED;

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheCacheBuilderSpec_RefreshDurationParser)

#endif

#pragma pop_macro("ComGoogleCommonCacheCacheBuilderSpec_INCLUDE_ALL")


text:
using System;
using System.ComponentModel;
using ModMyFactory.MVVM;

namespace ModMyFactory.Web
{
    sealed class FactorioOnlineVersion : NotifyPropertyChangedBase
    {
        bool downloadable;

        public Version Version { get; }

        public string VersionModifier { get; }

        public Uri DownloadUrl { get; }

        public bool Downloadable
        {
            get { return downloadable; }
            set
            {
                if (value != downloadable)
                {
                    downloadable = true;
                    OnPropertyChanged(new PropertyChangedEventArgs(nameof(Downloadable)));
                }
            }
        }

        public FactorioOnlineVersion(Version version, string versionModifier)
        {
            Version = version;
            VersionModifier = versionModifier;

            string versionString = version.ToString(3);
            int startIndex = versionModifier.IndexOf('(') + 1;
            int endIndex = versionModifier.IndexOf(')');
            string modifierUrlPart = versionModifier.Substring(startIndex, endIndex - startIndex);
            string platformString = Environment.Is64BitOperatingSystem ? "win64-manual" : "win32-manual";
            DownloadUrl = new Uri($"https://www.factorio.com/get-download/{versionString}/{modifierUrlPart}/{platformString}");
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
CLASS({
  package: 'foam.ui.md',
  name: 'DetailView',
  extendsModel: 'foam.ui.md.BaseDetailView',
  traits: [ 'foam.ui.md.ToolbarViewTrait' ],
});


text:
function out = gason( in )
% Convert between JSON strings and corresponding JSON objects.
%
% This parser is based on Gason written and maintained by Ivan Vashchaev:
%                 https://github.com/vivkin/gason
% Gason is a "lightweight and fast JSON parser for C++". Please see the
% above link for license information and additional details about Gason.
%
% Given a JSON string, gason calls the C++ parser and converts the output
% into an appropriate Matlab structure. As the parsing is performed in mex
% the resulting parser is blazingly fast. Large JSON structs (100MB+) take
% only a few seconds to parse (compared to hours for pure Matlab parsers).
%
% Given a JSON object, gason calls the C++ encoder to convert the object
% back into a JSON string representation. Nearly any Matlab struct, cell
% array, or numeric array represent a valid JSON object. Note that gason()
% can be used to go both from JSON string to JSON object and back.
%
% Gason requires C++11 to compile (for GCC this requires version 4.7 or
% later). The following command compiles the parser (may require tweaking):
%   mex('CXXFLAGS=\$CXXFLAGS -std=c++11 -Wall','-largeArrayDims',...
%     'private/gasonMex.cpp','private/gason.cpp','-outdir','private');
% Note the use of the "-std=c++11" flag. A number of precompiled binaries
% are included, please do not contact us for help with compiling.
%
% Note that by default JSON arrays that contain only numbers are stored as
% regular Matlab arrays. Likewise, JSON arrays that contain only objects of
% the same type are stored as Matlab struct arrays. This is much faster and
% can use considerably less memory than always using Matlab cell arrays.
%
% USAGE
%  object = gason( string )
%  string = gason( object )
%
% INPUTS/OUTPUTS
%  string     - JSON string
%  object     - JSON object
%
% EXAMPLE
%  o = struct('first',{'piotr','ty'},'last',{'dollar','lin'})
%  s = gason( o ) % convert JSON object -> JSON string
%  p = gason( s ) % convert JSON string -> JSON object
%
% See also
%
% Microsoft COCO Toolbox.      version 2.0
% Data, paper, and tutorials available at:  http://mscoco.org/
% Code written by Piotr Dollar and Tsung-Yi Lin, 2015.
% Licensed under the Simplified BSD License [see coco/license.txt]

out = gasonMex( in );


text:
package org.cactoos.io;

import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;

/**
 * Test case for {@link LoggingInput}.
 *
 * @author Fabricio Cabral (fabriciofx@gmail.com)
 * @version $Id$
 * @since 0.29
 * @checkstyle JavadocMethodCheck (500 lines)
 */
@SuppressWarnings(
    {
        "PMD.MoreThanOneLogger",
        "PMD.AvoidDuplicateLiterals"
    }
)
public final class LoggingInputTest {

    @Test
    public void logReadFromDeadInput() throws IOException {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new DeadInput(),
                "dead input",
                logger
            )
        ).intValue();
        MatcherAssert.assertThat(
            "Can't log zero byte read from dead input",
            logger.toString(),
            Matchers.containsString("Read 0 byte(s) from dead input in")
        );
    }

    @Test
    public void logReadFromOneByte() throws IOException {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new InputOf("a"),
                "memory",
                logger
            )
        ).intValue();
        MatcherAssert.assertThat(
            "Can't log one byte read from memory",
            logger.toString(),
            Matchers.containsString("Read 1 byte(s) from memory in")
        );
    }

    @Test
    public void logReadFromText() throws IOException {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new InputOf("Hello, товарищ!"),
                "memory",
                logger
            )
        ).intValue();
        MatcherAssert.assertThat(
            "Can't log 22 bytes read from memory",
            logger.toString(),
            Matchers.containsString("Read 22 byte(s) from memory in")
        );
    }

    @Test
    public void logReadFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new ResourceOf("org/cactoos/large-text.txt"),
                "text file",
                logger
            )
        ).intValue();
        MatcherAssert.assertThat(
            "Can't log 74536 bytes read from text file",
            logger.toString(),
            Matchers.allOf(
                Matchers.not(
                    Matchers.containsString("Read 16384 byte(s) from text file")
                ),
                Matchers.containsString("Read 74536 byte(s) from text file in"),
                Matchers.containsString("Closed input stream from text file")
            )
        );
    }

    @Test
    public void logAllFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger(Level.WARNING);
        new LengthOf(
            new LoggingInput(
                new ResourceOf("org/cactoos/large-text.txt"),
                "text file",
                logger
            )
        ).intValue();
        MatcherAssert.assertThat(
            "Can't log all read and close operations from text file",
            logger.toString(),
            Matchers.allOf(
                Matchers.containsString("Read 16384 byte(s) from text file"),
                Matchers.containsString("Read 32768 byte(s) from text file"),
                Matchers.containsString("Read 49152 byte(s) from text file"),
                Matchers.containsString("Read 65536 byte(s) from text file"),
                Matchers.containsString("Read 74536 byte(s) from text file"),
                Matchers.containsString("Closed input stream from text file")
            )
        );
    }

    @Test
    public void logSkipFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        // @checkstyle MagicNumber (1 line)
        ).stream().skip(100);
        MatcherAssert.assertThat(
            "Can't log skip from text file",
            logger.toString(),
            Matchers.containsString("Skipped 100 byte(s) from text file.")
        );
    }

    @Test
    public void logAvailableFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream().available();
        MatcherAssert.assertThat(
            "Can't log avaliable byte(s) from text file",
            logger.toString(),
            Matchers.containsString(
                "There is(are) 74536 byte(s) available from text file"
            )
        );
    }

    @Test
    public void logResetFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger();
        final InputStream input = new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream();
        // @checkstyle MagicNumber (1 line)
        input.mark(150);
        input.reset();
        MatcherAssert.assertThat(
            "Can't log mark and reset from text file",
            logger.toString(),
            Matchers.allOf(
                Matchers.containsString("Marked position 150 from text file"),
                Matchers.containsString("Reset input stream from text file")
            )
        );
    }

    @Test
    public void logMarkSupportedFromLargeTextFile() throws IOException {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream().markSupported();
        MatcherAssert.assertThat(
            "Can't log mark and reset are not supported from text file",
            logger.toString(),
            Matchers.containsString(
                "Mark and reset are supported from text file"
            )
        );
    }

    @Test
    public void logIntoCreatedLogger() {
        final FakeHandler handler = new FakeHandler();
        final String logger = "my source";
        Logger.getLogger(logger).addHandler(handler);
        try {
            new LengthOf(
                new LoggingInput(
                    new InputOf("Hi there"),
                    logger
                )
            ).intValue();
            MatcherAssert.assertThat(
                "",
                handler.toString(),
                Matchers.containsString("Read 8 byte(s)")
            );
        } finally {
            Logger.getGlobal().removeHandler(handler);
        }
    }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Anal. Mus. nac. B. Aires, Ser. 2 6: 296 (1899)

#### Original name
Dothidella lilloana Speg., 1898

### Remarks
null


text:
Installation
============

There are currently two ways to install **Gthnk**:

1. Run it inside a Docker image
2. Install as a python package

Docker Image
------------

Use Docker to run **Gthnk** with all files stored locally in ``~/.gthnk``.

::

    docker run -d --rm \
        --name gthnk-server \
        -p 1620:1620 \
        -e TZ=America/Toronto \
        -v ~/.gthnk:/home/gthnk/.gthnk \
        iandennismiller/gthnk

The default text file where you will record journal entries is ``~/.gthnk/journal.txt``.

If you want to store your files somewhere other than ``~/.gthnk`` then update the ``-v`` argument:

::

        -v /opt/somewhere-else:/home/gthnk/.gthnk \

If you want to use a port other than 1620, update the ``-p`` argument:

::

        -p 5000:1620 \

Python Installation
-------------------

**Gthnk** also installs as a python package - but the Docker method is strongly recommended.

Every system is different but python installation looks like this:

::

    git clone https://github.com/iandennismiller/gthnk.git
    cd gthnk
    pip3 install --user ./src/gthnk
    gthnk-config-init.py ~/.gthnk/gthnk.conf ~/.gthnk
    gthnk init_db
    gthnk user_add -u "gthnk" -p "gthnk"
    gthnk runserver

The Gthnk server is now available at http://localhost:5000 in your browser.

System integration
^^^^^^^^^^^^^^^^^^

Gthnk can be integrated with the operating system to launch automatically.
System integration is partially supported on MacOS and Windows:

::

    src/scripts/gthnk do_install

Next Steps
----------

Now check out :doc:`/user/using-the-journal` to learn techniques for actually getting stuff done with **Gthnk**.


text:
ingredientsList = [];
directionsList = [];

Template.recipenew.onCreated(function () {
    this.ingredients = new ReactiveVar();
    this.directions = new ReactiveVar();
});

Template.recipenew.helpers({
    ingredients(){
        return Template.instance().ingredients.get();
    },
    directions(){
        return Template.instance().directions.get();
    }
});

Template.recipenew.events({
    'click .js-add-directions': () => {
        event.preventDefault();
        directionsList.push($('.js-add-directions-input').val());
        $('.js-add-directions-input').val(' ');
        Template.instance().directions.set(directionsList);

    },
    'click .js-add-ingredients': () => {
        event.preventDefault();
        ingredientsList.push($('.js-add-ingredients-input').val());

        $('.js-add-ingredients-input').val(' ');
        Template.instance().ingredients.set(ingredientsList);
    },
});


text:
package com.newsenglish.gary.myapplication.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.DisplayMetrics;
import android.util.Log;

import com.newsenglish.gary.myapplication.db.BbcNews;
import com.newsenglish.gary.myapplication.db.LocalEnglish;
import com.newsenglish.gary.myapplication.db.NewsWord;
import com.newsenglish.gary.myapplication.db.SixMin;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;

import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

import static com.newsenglish.gary.myapplication.preferences.Preferences.TAB_TYPE_BBCNEWS;
import static com.newsenglish.gary.myapplication.preferences.Preferences.TAB_TYPE_LOCALENGLISH;
import static com.newsenglish.gary.myapplication.preferences.Preferences.TAB_TYPE_NEWSWORD;
import static com.newsenglish.gary.myapplication.preferences.Preferences.TAB_TYPE_SIXMIN;

/**
 * Created by Gary on 2017/8/24.
 */

public class Utils {

    //解析xml
    public static boolean parseXmlWithPull(String str, int type) {
        if (!str.isEmpty()) {
            try {
                XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
                XmlPullParser xmlPullParser = factory.newPullParser();
                xmlPullParser.setInput(new StringReader(str));
                int eventType = xmlPullParser.getEventType();
                String title = "";
                String pic = "";
                String url = "";
                String time = "";
                String readcount = "";
                String mp3 = "";
                while (eventType != XmlPullParser.END_DOCUMENT) {
                    String nodeName = xmlPullParser.getName();
                    switch (eventType) {
                        case XmlPullParser.START_TAG: {
                            if ("Title_cn".equals(nodeName)) {
                                title = xmlPullParser.nextText();
                            } else if ("Sound".equals(nodeName)) {
                                mp3 = xmlPullParser.nextText();
                            } else if ("Url".equals(nodeName)) {
                                url = xmlPullParser.nextText();
                            } else if ("Pic".equals(nodeName)) {
                                pic = xmlPullParser.nextText();
                            } else if ("CreatTime".equals(nodeName)) {
                                time = xmlPullParser.nextText();
                            } else if ("ReadCount".equals(nodeName)) {
                                readcount = xmlPullParser.nextText();
                            }

                        }
                        break;
                        case XmlPullParser.END_TAG: {
                            if ("Bbctitle".equals(nodeName)) {
                                switch (type) {
                                    case TAB_TYPE_SIXMIN: {
                                        SixMin six = new SixMin();
                                        six.setTitle(title);
                                        six.setUrl(url);
                                        six.setPic(pic);
                                        six.setTime(time);
                                        six.setReadCount(readcount);
                                        six.setMp3(mp3);
                                        six.save();
                                    }
                                    break;
                                    case TAB_TYPE_LOCALENGLISH: {
                                        LocalEnglish english = new LocalEnglish();
                                        english.setTitle(title);
                                        english.setUrl(url);
                                        english.setPic(pic);
                                        english.setTime(time);
                                        english.setReadCount(readcount);
                                        english.setMp3(mp3);
                                        english.save();
                                    }
                                    break;
                                    case TAB_TYPE_BBCNEWS: {
                                        BbcNews news = new BbcNews();
                                        news.setTitle(title);
                                        news.setUrl(url);
                                        news.setPic(pic);
                                        news.setTime(time);
                                        news.setReadCount(readcount);
                                        news.setMp3(mp3);
                                        news.save();
                                    }
                                    break;
                                    case TAB_TYPE_NEWSWORD: {
                                        NewsWord word = new NewsWord();
                                        word.setTitle(title);
                                        word.setUrl(url);
                                        word.setPic(pic);
                                        word.setTime(time);
                                        word.setReadCount(readcount);
                                        word.setReadCount(readcount);
                                        word.save();
                                    }
                                    break;
                                }

                            }
                        }
                        break;
                        default:
                            break;
                    }
                    eventType = xmlPullParser.next();
                }
                return true;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return false;
    }

    //分割日期字符
    public static String fenge(String str) {
        String[] arr = str.split("\\s+");
        return arr[0];
    }

    /**
     * 检查当前网络是否可用
     *
     * @return
     */
    @SuppressWarnings("deprecation")
    public static boolean isNetworkAvailable(Context activity) {
        //得到应用上下文
        Context context = activity.getApplicationContext();
        // 获取手机所有连接管理对象(包括对wi-fi,net等连接的管理)  notificationManager /alarmManager
        ConnectivityManager connectivityManager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);

        if (connectivityManager == null) {
            return false;
        } else {
            // 获取NetworkInfo对象
            NetworkInfo[] networkInfo = connectivityManager.getAllNetworkInfo();

            if (networkInfo != null && networkInfo.length > 0) {
                for (int i = 0; i < networkInfo.length; i++) {
                    // 判断当前网络状态是否为连接状态
                    if (networkInfo[i].getState() == NetworkInfo.State.CONNECTED) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    /**
     * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
     */
    public static int dip2px(Context context, float dpValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dpValue * scale + 0.5f);
    }

    /**
     * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
     */
    public static int px2dip(Context context, float pxValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (pxValue / scale + 0.5f);
    }
}


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

namespace MineProtocol.net.Events
{
	public class MinecraftEventArgs :EventArgs
	{
	}
}


text:
package com.example.androidx.media;

import android.app.PendingIntent;
import android.net.Uri;
import android.util.Log;

import androidx.mediarouter.media.MediaItemStatus;
import androidx.mediarouter.media.MediaSessionStatus;

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

/**
 * SessionManager manages a media session as a queue. It supports common
 * queuing behaviors such as enqueue/remove of media items, pause/resume/stop,
 * etc.
 *
 * Actual playback of a single media item is abstracted into a Player interface,
 * and is handled outside this class.
 */
public class SessionManager implements Player.Callback {
    private static final String TAG = "SessionManager";
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);

    private String mName;
    private int mSessionId;
    private int mItemId;
    private boolean mPaused;
    private boolean mSessionValid;
    private Player mPlayer;
    private Callback mCallback;
    private List<PlaylistItem> mPlaylist = new ArrayList<PlaylistItem>();

    public SessionManager(String name) {
        mName = name;
    }

    public boolean isPaused() {
        return hasSession() && mPaused;
    }

    public boolean hasSession() {
        return mSessionValid;
    }

    public String getSessionId() {
        return mSessionValid ? Integer.toString(mSessionId) : null;
    }

    public PlaylistItem getCurrentItem() {
        return mPlaylist.isEmpty() ? null : mPlaylist.get(0);
    }

    // Returns the cached playlist (note this is not responsible for updating it)
    public List<PlaylistItem> getPlaylist() {
        return mPlaylist;
    }

    // Updates the playlist asynchronously, calls onPlaylistReady() when finished.
    public void updateStatus() {
        if (DEBUG) {
            log("updateStatus");
        }
        checkPlayer();
        // update the statistics first, so that the stats string is valid when
        // onPlaylistReady() gets called in the end
        mPlayer.takeSnapshot();

        if (mPlaylist.isEmpty()) {
            // If queue is empty, don't forget to call onPlaylistReady()!
            onPlaylistReady();
        } else if (mPlayer.isQueuingSupported()) {
            // If player supports queuing, get status of each item. Player is
            // responsible to call onPlaylistReady() after last getStatus().
            // (update=1 requires player to callback onPlaylistReady())
            for (int i = 0; i < mPlaylist.size(); i++) {
                PlaylistItem item = mPlaylist.get(i);
                mPlayer.getStatus(item, (i == mPlaylist.size() - 1) /* update */);
            }
        } else {
            // Otherwise, only need to get status for current item. Player is
            // responsible to call onPlaylistReady() when finished.
            mPlayer.getStatus(getCurrentItem(), true /* update */);
        }
    }

    public PlaylistItem add(String title, Uri uri, String mime) {
        return add(title, uri, mime, 0, null);
    }

    public PlaylistItem add(String title, Uri uri, String mime, long startPosition,
            PendingIntent receiver) {
        if (DEBUG) {
            log("add: title=" + title + ", uri=" + uri + ", receiver=" + receiver);
        }
        // create new session if needed
        startSession();
        checkPlayerAndSession();

        // append new item with initial status PLAYBACK_STATE_PENDING
        PlaylistItem item = new PlaylistItem(Integer.toString(mSessionId),
                Integer.toString(mItemId), title, uri, mime, receiver);
        item.setPosition(startPosition);
        mPlaylist.add(item);
        mItemId++;

        // if player supports queuing, enqueue the item now
        if (mPlayer.isQueuingSupported()) {
            mPlayer.enqueue(item);
        }
        updatePlaybackState();
        return item;
    }

    public PlaylistItem remove(String iid) {
        if (DEBUG) {
            log("remove: iid=" + iid);
        }
        checkPlayerAndSession();
        return removeItem(iid, MediaItemStatus.PLAYBACK_STATE_CANCELED);
    }

    public PlaylistItem seek(String iid, long pos) {
        if (DEBUG) {
            log("seek: iid=" + iid +", pos=" + pos);
        }
        checkPlayerAndSession();
        // seeking on pending items are not yet supported
        checkItemCurrent(iid);

        PlaylistItem item = getCurrentItem();
        if (pos != item.getPosition()) {
            item.setPosition(pos);
            if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
                    || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
                mPlayer.seek(item);
            }
        }
        return item;
    }

    public PlaylistItem getStatus(String iid) {
        checkPlayerAndSession();

        // This should only be called for local player. Remote player is
        // asynchronous, need to use updateStatus() instead.
        if (mPlayer.isRemotePlayback()) {
            throw new IllegalStateException(
                    "getStatus should not be called on remote player!");
        }

        for (PlaylistItem item : mPlaylist) {
            if (item.getItemId().equals(iid)) {
                if (item == getCurrentItem()) {
                    mPlayer.getStatus(item, false);
                }
                return item;
            }
        }
        return null;
    }

    public void pause() {
        if (DEBUG) {
            log("pause");
        }
        if (!mSessionValid) {
            return;
        }
        checkPlayer();
        mPaused = true;
        updatePlaybackState();
    }

    public void resume() {
        if (DEBUG) {
            log("resume");
        }
        if (!mSessionValid) {
            return;
        }
        checkPlayer();
        mPaused = false;
        updatePlaybackState();
    }

    public void stop() {
        if (DEBUG) {
            log("stop");
        }
        if (!mSessionValid) {
            return;
        }
        checkPlayer();
        mPlayer.stop();
        mPlaylist.clear();
        mPaused = false;
        updateStatus();
    }

    public String startSession() {
        if (!mSessionValid) {
            mSessionId++;
            mItemId = 0;
            mPaused = false;
            mSessionValid = true;
            return Integer.toString(mSessionId);
        }
        return null;
    }

    public boolean endSession() {
        if (mSessionValid) {
            mSessionValid = false;
            return true;
        }
        return false;
    }

    void syncWithManager(SessionManager manager) {
        manager.updateStatus();
        mSessionId = manager.mSessionId;
        mItemId = manager.mItemId;
        mPaused = manager.mPaused;
        mSessionValid = manager.mSessionValid;
        mPlaylist = new ArrayList<>();
        for (PlaylistItem item : manager.mPlaylist) {
            mPlaylist.add(new PlaylistItem(item));
        }
        if (mPlaylist.size() > 0) {
            PlaylistItem firstItem = mPlaylist.get(0);
            firstItem.setState(MediaItemStatus.PLAYBACK_STATE_PENDING);
        }
        updatePlaybackState();
    }

    MediaSessionStatus getSessionStatus(String sid) {
        int sessionState = (sid != null && sid.equals(Integer.toString(mSessionId))) ?
                MediaSessionStatus.SESSION_STATE_ACTIVE :
                    MediaSessionStatus.SESSION_STATE_INVALIDATED;

        return new MediaSessionStatus.Builder(sessionState)
                .setQueuePaused(mPaused)
                .build();
    }

    // Suspend the playback manager. Put the current item back into PENDING
    // state, and remember the current playback position. Called when switching
    // to a different player (route).
    public void suspend(long pos) {
        for (PlaylistItem item : mPlaylist) {
            item.setRemoteItemId(null);
            item.setDuration(0);
        }
        PlaylistItem item = getCurrentItem();
        if (DEBUG) {
            log("suspend: item=" + item + ", pos=" + pos);
        }
        if (item != null) {
            if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
                    || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
                item.setState(MediaItemStatus.PLAYBACK_STATE_PENDING);
                item.setPosition(pos);
            }
        }
    }

    // Unsuspend the playback manager. Restart playback on new player (route).
    // This will resume playback of current item. Furthermore, if the new player
    // supports queuing, playlist will be re-established on the remote player.
    public void unsuspend() {
        if (DEBUG) {
            log("unsuspend");
        }
        if (mPlayer.isQueuingSupported()) {
            for (PlaylistItem item : mPlaylist) {
                mPlayer.enqueue(item);
            }
        }
        updatePlaybackState();
    }

    // Player.Callback
    @Override
    public void onError() {
        finishItem(true);
    }

    @Override
    public void onCompletion() {
        finishItem(false);
    }

    @Override
    public void onPlaylistChanged() {
        // Playlist has changed, update the cached playlist
        updateStatus();
    }

    @Override
    public void onPlaylistReady() {
        // Notify activity to update Ui
        if (mCallback != null) {
            mCallback.onStatusChanged();
        }
    }

    private void log(String message) {
        Log.d(TAG, mName + ": " + message);
    }

    private void checkPlayer() {
        if (mPlayer == null) {
            throw new IllegalStateException("Player not set!");
        }
    }

    private void checkSession() {
        if (!mSessionValid) {
            throw new IllegalStateException("Session not set!");
        }
    }

    private void checkPlayerAndSession() {
        checkPlayer();
        checkSession();
    }

    private void checkItemCurrent(String iid) {
        PlaylistItem item = getCurrentItem();
        if (item == null || !item.getItemId().equals(iid)) {
            throw new IllegalArgumentException("Item is not current!");
        }
    }

    private void updatePlaybackState() {
        PlaylistItem item = getCurrentItem();
        if (item != null) {
            if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PENDING) {
                item.setState(mPaused ? MediaItemStatus.PLAYBACK_STATE_PAUSED
                        : MediaItemStatus.PLAYBACK_STATE_PLAYING);
                if (!mPlayer.isQueuingSupported()) {
                    mPlayer.play(item);
                }
            } else if (mPaused && item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING) {
                mPlayer.pause();
                item.setState(MediaItemStatus.PLAYBACK_STATE_PAUSED);
            } else if (!mPaused && item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
                mPlayer.resume();
                item.setState(MediaItemStatus.PLAYBACK_STATE_PLAYING);
            }
            // notify client that item playback status has changed
            if (mCallback != null) {
                mCallback.onItemChanged(item);
            }
        } else {
            mPlayer.initMediaSession();
        }
        updateStatus();
    }

    private PlaylistItem removeItem(String iid, int state) {
        checkPlayerAndSession();
        List<PlaylistItem> queue =
                new ArrayList<PlaylistItem>(mPlaylist.size());
        PlaylistItem found = null;
        for (PlaylistItem item : mPlaylist) {
            if (iid.equals(item.getItemId())) {
                if (mPlayer.isQueuingSupported()) {
                    mPlayer.remove(item.getRemoteItemId());
                } else if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
                        || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED){
                    mPlayer.stop();
                }
                item.setState(state);
                found = item;
                // notify client that item is now removed
                if (mCallback != null) {
                    mCallback.onItemChanged(found);
                }
            } else {
                queue.add(item);
            }
        }
        if (found != null) {
            mPlaylist = queue;
            updatePlaybackState();
        } else {
            log("item not found");
        }
        return found;
    }

    private void finishItem(boolean error) {
        PlaylistItem item = getCurrentItem();
        if (item != null) {
            removeItem(item.getItemId(), error ?
                    MediaItemStatus.PLAYBACK_STATE_ERROR :
                        MediaItemStatus.PLAYBACK_STATE_FINISHED);
            updateStatus();
        }
    }

    // set the Player that this playback manager will interact with
    public void setPlayer(Player player) {
        mPlayer = player;
        checkPlayer();
        mPlayer.setCallback(this);
    }

    // provide a callback interface to tell the UI when significant state changes occur
    public void setCallback(Callback callback) {
        mCallback = callback;
    }

    @Override
    public String toString() {
        String result = "Media Queue: ";
        if (!mPlaylist.isEmpty()) {
            for (PlaylistItem item : mPlaylist) {
                result += "\n" + item.toString();
            }
        } else {
            result += "<empty>";
        }
        return result;
    }

    public interface Callback {
        void onStatusChanged();
        void onItemChanged(PlaylistItem item);
    }
}


text:
#import "MSGraphServiceFetchers.h"
#import "core/core.h"

@implementation MSGraphServiceEventMessageFetcher

@synthesize operations = _operations;

- (instancetype)initWithUrl:(NSString *)urlComponent parent:(id<MSOrcExecutable>)parent {

    if (self = [super initWithUrl:urlComponent parent:parent asClass:[MSGraphServiceEventMessage class]]) {

		_operations = [[MSGraphServiceEventMessageOperations alloc] initOperationWithUrl:urlComponent parent:parent];
    }

    return self;
}

- (void)update:(id)entity callback:(void (^)(MSGraphServiceEventMessage *eventMessage, MSOrcError *e))callback {

	return [super update:entity callback:callback];
}

- (void)delete:(void (^)(int status, MSOrcError *e))callback {

	return [super deleteWithCallback:callback];
}

- (MSGraphServiceEventMessageFetcher *)addCustomParametersWithName:(NSString *)name value:(id)value {
    [super addCustomParametersWithName:name value:value];

    return self;
}

- (MSGraphServiceEventMessageFetcher *)addCustomHeaderWithName:(NSString *)name value:(NSString *)value {
    [super addCustomHeaderWithName:name value:value];

    return self;
}

- (MSGraphServiceEventMessageFetcher *)select:(NSString *)params {
    [super select:params];

    return self;
}

- (MSGraphServiceEventMessageFetcher *)expand:(NSString *)value {
    [super expand:value];

    return self;
}

- (void) readWithCallback:(void (^)(MSGraphServiceEventMessage *eventMessage, MSOrcError *error))callback {
    [super readWithCallback:^(id response, MSOrcError *error) {
        callback(response, error);
    }];
}

- (MSGraphServiceEventFetcher *)event {

	 return [[MSGraphServiceEventFetcher alloc] initWithUrl:@"event" parent:self asClass:[MSGraphServiceEvent class]];
}

@end


text:
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Dicas para programação de desenvolvimento de softwares{%endblock%}

{% block content %}

{% include 'left-sidebar.html' %}

			{% include 'feat-last-posts.html' %}

			{% include 'feat-cat-1.html' %}

			{% include 'feat-cat-2.html' %}

			{% include 'feat-cat-3.html' %}

{% include 'post-sidebar.html' %}

{% endblock %}


text:
/* ###
 * IP: GHIDRA
 *
 * 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 ghidra.framework.client;

import java.awt.Component;
import java.io.*;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.security.InvalidKeyException;

import javax.security.auth.callback.*;

import ghidra.framework.remote.AnonymousCallback;
import ghidra.framework.remote.SSHSignatureCallback;
import ghidra.framework.remote.security.SSHKeyManager;
import ghidra.net.ApplicationKeyManagerFactory;
import ghidra.util.Msg;

/**
 * HeadlessClientAuthenticator provides the ability to install a Ghidra Server
 * authenticator needed when operating in a headless mode.
 */
public class HeadlessClientAuthenticator implements ClientAuthenticator {

	private final static char[] BADPASSWORD = "".toCharArray();

	private static Object sshPrivateKey;
	private static String userID = ClientUtil.getUserName(); // default username
	private static boolean passwordPromptAlowed;

	private Authenticator authenticator = new Authenticator() {
		@Override
		protected PasswordAuthentication getPasswordAuthentication() {
			Msg.debug(this, "PasswordAuthentication requested for " + getRequestingURL());
			String prompt = getRequestingPrompt();
			if (prompt == null) {
				String host = getRequestingHost();
				prompt = (host != null ? (host + " ") : "") + "(" + userID + ") Password:";
			}
			return new PasswordAuthentication(userID, getPassword(null, prompt));
		}
	};

	HeadlessClientAuthenticator() {
	}

	@Override
	public Authenticator getAuthenticator() {
		return authenticator;
	}

	/**
	 * Install headless client authenticator for Ghidra Server
	 * @param username optional username to be used with a Ghidra Server which
	 * allows username to be specified
	 * @param keystorePath optional PKI or SSH keystore path.  May also be specified
	 * as resource path for SSH key.
	 * @param allowPasswordPrompt if true the user may be prompted for passwords
	 * via the console (stdin).  Please note that the Java console will echo
	 * the password entry to the terminal which may be undesirable.
	 * @throws IOException if error occurs while opening specified keystorePath
	 */
	public static void installHeadlessClientAuthenticator(String username, String keystorePath,
			boolean allowPasswordPrompt) throws IOException {
		passwordPromptAlowed = allowPasswordPrompt;
		if (username != null) {
			userID = username;
		}

		// clear existing key store settings
		sshPrivateKey = null;

		HeadlessClientAuthenticator authenticator = new HeadlessClientAuthenticator();
		ClientUtil.setClientAuthenticator(authenticator);

		if (keystorePath != null) {
			File keyfile = new File(keystorePath);
			if (!keyfile.exists()) {
				// If keystorePath file not found - try accessing as SSH key resource stream
				// InputStream keyIn = ResourceManager.getResourceAsStream(keystorePath);
				try (InputStream keyIn =
					HeadlessClientAuthenticator.class.getResourceAsStream(keystorePath)) {
					if (keyIn != null) {
						try {
							sshPrivateKey = SSHKeyManager.getSSHPrivateKey(keyIn);
							Msg.info(HeadlessClientAuthenticator.class,
								"Loaded SSH key: " + keystorePath);
							return;
						}
						catch (Exception e) {
							Msg.error(HeadlessClientAuthenticator.class,
								"Failed to open keystore for SSH use: " + keystorePath, e);
							throw new IOException("Failed to parse keystore: " + keystorePath);
						}
					}
				}
				Msg.error(HeadlessClientAuthenticator.class, "Keystore not found: " + keystorePath);
				throw new FileNotFoundException("Keystore not found: " + keystorePath);
			}

			boolean success = false;
			try {
				sshPrivateKey = SSHKeyManager.getSSHPrivateKey(keyfile);
				success = true;
				Msg.info(HeadlessClientAuthenticator.class, "Loaded SSH key: " + keystorePath);
			}
			catch (InvalidKeyException e) { // keyfile is not a valid SSH provate key format
				// does not appear to be an SSH private key - try PKI keystore parse
				if (ApplicationKeyManagerFactory.setKeyStore(keystorePath, false)) {
					success = true;
					Msg.info(HeadlessClientAuthenticator.class,
						"Loaded PKI keystore: " + keystorePath);
				}
			}
			catch (IOException e) { // SSH key parse failure only
				Msg.error(HeadlessClientAuthenticator.class,
					"Failed to open keystore for SSH use: " + keystorePath, e);
			}
			if (!success) {
				throw new IOException("Failed to parse keystore: " + keystorePath);
			}
		}
		else {
			sshPrivateKey = null;
		}
	}

	private char[] getPassword(String usage, String prompt) {

		if (!passwordPromptAlowed) {
			Msg.warn(this, "Headless client not configured to supply required password");
			return BADPASSWORD;
		}

		char[] password = null;
		int c;
		try {

			String passwordPrompt = "";
			if (usage != null) {
				passwordPrompt += usage;
				passwordPrompt += "\n";
			}

			if (prompt == null) {
				prompt = "Password:";
			}

			// With the new GhidraClassLoader/GhidraLauncher it should be possible to get a Console
			// object, which allow masking of passwords.
			Console cons = System.console();

			if (cons != null) {
				passwordPrompt += prompt + " ";
				password = cons.readPassword(passwordPrompt);
			}
			else {
				// Couldn't get console instance, passwords will be in the clear
				passwordPrompt += "*** WARNING! Password entry will NOT be masked ***\n" + prompt;

				System.out.print(passwordPrompt);

				while (true) {
					c = System.in.read();
					if (c <= 0 || (Character.isWhitespace((char) c) && c != ' ')) {
						break;
					}
					if (password == null) {
						password = new char[1];
					}
					else {
						char[] newPass = new char[password.length + 1];
						for (int i = 0; i < password.length; i++) {
							newPass[i] = password[i];
							password[i] = 0;
						}
						password = newPass;
					}
					password[password.length - 1] = (char) c;
				}
			}
		}
		catch (IOException e) {
			Msg.error(this, "Error reading standard-input for password", e);
		}
		return password;
	}

	@Override
	public char[] getNewPassword(Component parent, String serverInfo, String username) {
		throw new UnsupportedOperationException("Server password change not permitted");
	}

	@Override
	public boolean processPasswordCallbacks(String title, String serverType, String serverName,
			NameCallback nameCb, PasswordCallback passCb, ChoiceCallback choiceCb,
			AnonymousCallback anonymousCb, String loginError) {
		if (anonymousCb != null && !passwordPromptAlowed) {
			// Assume that login error will not occur with anonymous login
			anonymousCb.setAnonymousAccessRequested(true);
			return true;
		}
		if (choiceCb != null) {
			choiceCb.setSelectedIndex(1);
		}
		if (nameCb != null && userID != null) {
			nameCb.setName(userID);
		}
		String usage = null;
		if (serverName != null) {
			usage = serverType + ": " + serverName;
		}
		char[] password = getPassword(usage, passCb.getPrompt());
		passCb.setPassword(password);
		return password != null;
	}

	@Override
	public boolean promptForReconnect(Component parent, String message) {
		// assumes connection attempt was immediately done when this
		// ClientAuthenticator was installed
		return false;
	}

	@Override
	public char[] getKeyStorePassword(String keystorePath, boolean passwordError) {
		if (passwordError) {
			if (passwordPromptAlowed) {
				Msg.error(this, "Incorrect keystore password specified: " + keystorePath);
			}
			else {
				Msg.error(this,
					"Keystore password required but password entry has been disabled: " +
						keystorePath);
			}
			return null;
		}
		return getPassword("Certificate keystore: " + keystorePath, "Keystore password: ");
	}

	@Override
	public boolean processSSHSignatureCallbacks(String serverName, NameCallback nameCb,
			SSHSignatureCallback sshCb) {
		if (sshPrivateKey == null) {
			return false;
		}
		if (nameCb != null) {
			nameCb.setName(userID);
		}
		try {
			sshCb.sign(sshPrivateKey);
			return true;
		}
		catch (IOException e) {
			Msg.error(this, "Failed to authenticate with SSH private key", e);
		}
		return false;
	}

	@Override
	public boolean isSSHKeyAvailable() {
		return sshPrivateKey != null;
	}

}


text:
<!DOCTYPE html>

Test that position 'static' or 'relative' for ::backdrop computes to 'absolute'.
The test passes if there is a single green box.


text:
<resources>
    <string name="loading">加载中...</string>
    <string name="load_more_complete">加载成功</string>
    <string name="load_more_error">加载更多失败,点击重试</string>
    <string name="load_more_no_data">没有更多数据了</string>
</resources>


text:
Gitlab::Seeder.quiet do
  conversational_development_index_metric = ConversationalDevelopmentIndex::Metric.new(
    leader_issues: 10.2,
    instance_issues: 3.2,

    leader_notes: 25.3,
    instance_notes: 23.2,

    leader_milestones: 16.2,
    instance_milestones: 5.5,

    leader_boards: 5.2,
    instance_boards: 3.2,

    leader_merge_requests: 5.2,
    instance_merge_requests: 3.2,

    leader_ci_pipelines: 25.1,
    instance_ci_pipelines: 21.3,

    leader_environments: 3.3,
    instance_environments: 2.2,

    leader_deployments: 41.3,
    instance_deployments: 15.2,

    leader_projects_prometheus_active: 0.31,
    instance_projects_prometheus_active: 0.30,

    leader_service_desk_issues: 15.8,
    instance_service_desk_issues: 15.1
  )

  if conversational_development_index_metric.save
    print '.'
  else
    puts conversational_development_index_metric.errors.full_messages
    print 'F'
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<!-- splitted from ./en/functions/ps.xml, last change in rev 1.12 -->
<refentry xml:id="function.ps-open-image" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>ps_open_image</refname>
  <refpurpose>Reads an image for later placement</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>int</type><methodname>ps_open_image</methodname>
   <methodparam><type>resource</type><parameter>psdoc</parameter></methodparam>
   <methodparam><type>string</type><parameter>type</parameter></methodparam>
   <methodparam><type>string</type><parameter>source</parameter></methodparam>
   <methodparam><type>string</type><parameter>data</parameter></methodparam>
   <methodparam><type>int</type><parameter>lenght</parameter></methodparam>
   <methodparam><type>int</type><parameter>width</parameter></methodparam>
   <methodparam><type>int</type><parameter>height</parameter></methodparam>
   <methodparam><type>int</type><parameter>components</parameter></methodparam>
   <methodparam><type>int</type><parameter>bpc</parameter></methodparam>
   <methodparam><type>string</type><parameter>params</parameter></methodparam>
  </methodsynopsis>
   <para>
    Reads an image which is already available in memory. The parameter
    <parameter>source</parameter> is currently not evaluated and assumed to be
    <literal>memory</literal>. The image data is a sequence of pixels starting
    in th upper left corner and ending in the lower right corner. Each pixel
    consists of <parameter>components</parameter> color components, and each
    component has <parameter>bpc</parameter> bits.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>psdoc</parameter></term>
     <listitem>
      <para>
       Resource identifier of the postscript file
       as returned by <function>ps_new</function>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>type</parameter></term>
     <listitem>
      <para>
       The type of the image. Possible values are <literal>png</literal>,
       <literal>jpeg</literal>, or <literal>eps</literal>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>source</parameter></term>
     <listitem>
      <para>
       Not used.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>data</parameter></term>
     <listitem>
      <para>
       The image data.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>length</parameter></term>
     <listitem>
      <para>
       The length of the image data.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>width</parameter></term>
     <listitem>
      <para>
       The width of the image.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>height</parameter></term>
     <listitem>
      <para>
       The height of the image.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>components</parameter></term>
     <listitem>
      <para>
       The number of components for each pixel. This can be
       1 (gray scale images), 3 (rgb images), or 4 (cmyk, rgba images).
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>bpc</parameter></term>
     <listitem>
      <para>
       Number of bits per component (quite often 8).
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>params</parameter></term>
     <listitem>
      <para>
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns identifier of image or zero in case of an error. The identifier is
   a positive number greater than 0.
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>ps_open_image_file</function></member>
    <member><function>ps_place_image</function></member>
    <member><function>ps_close_image</function></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
pub mod stream {
    pub enum Stream<T:Owned> { send(T, ::stream::server::Stream<T>), }
    pub mod server {
        use core::option;
        use core::pipes;

        pub impl<T:Owned> Stream<T> {
            pub fn recv() -> extern fn(v: Stream<T>) -> ::stream::Stream<T> {
              // resolve really should report just one error here.
              // Change the test case when it changes.
              pub fn recv(pipe: Stream<T>) -> ::stream::Stream<T> { //~ ERROR attempt to use a type argument out of scope
                //~^ ERROR use of undeclared type name
                //~^^ ERROR attempt to use a type argument out of scope
                //~^^^ ERROR use of undeclared type name
                    pipes::recv(pipe).unwrap()
                }
                recv
            }
        }

        pub type Stream<T:Owned> = pipes::RecvPacket<::stream::Stream<T>>;
    }
}

fn main() {}


text:
/**
 * Server-side methods related to users.
 */
Meteor.methods({
    /**
     * Retrieves a list of all users in the system with a compact user profile (not exposing any security related data)
     * @returns {Array} - a list of compact user objects
     */
    allUsers: function() {
        var userList = Meteor.users.find().fetch();

        var result = new Array();
        userList.forEach(function(user) {
            result.push({
                name: user.profile.name,
                email: user.emails[0].address,
                accessLevel: user.profile.accessLevel,
                _id: user._id
            });
        });

        return result;
    },

    /**
     * Search for a user by their profile.name using a case-insensitive search for "*search*" - the intended use-case
     * is a suggest search / user find input field.
     *
     * @param search - the search term
     * @returns {Array} - a list of matching users names
     */
    searchUser: function(search) {
        var result = []
        Meteor.users.find({
            'profile.name': new RegExp(search, 'i')
        }).forEach(function(user) {
            result.push(user.profile.name);
        });
        return result;
    },

    /**
     * Returns a user that matches the given name. Only the id, username, emails and the profile are returned.
     * @param name - the profile name of the user
     * @returns {*} - a compact user object or undefined if the profile name cannot be resolved.
     */
    checkUserName: function(name) {
        return Meteor.users.findOne({ 'profile.name': name }, { _id: 1, profile: 1, username: 1, emails: 1});
    },

    /**
     * Returns a user for a given ID. Only the profile, email and ID are returned
     * @param id - the ID of the user to retrieve
     * @returns {*} - a compact user object or null.
     */
    resolveUser: function(id) {
        var user = Meteor.users.findOne(id);
        if (user === undefined) {
            return null;
        }
        else {
            return {
                profile: user.profile,
                email: user.emails[0].address,
                _id: user._id
            };
        }
    }
});


text:
namespace loader {
class LynxLoader : public base::RefCountPtr<LynxLoader> {
 public:
    enum FileType {
        MAIN_FILE,
        SCRIPT_FILE,
    };
    LynxLoader() {}
    virtual ~LynxLoader() {}
    virtual void Load(const std::string& url, int type) { }
    virtual void Flush() {}

 private:
    DISALLOW_COPY_AND_ASSIGN(LynxLoader);
};
}  // namespace loader

#endif  // LYNX_LOADER_LOADER_H_


text:
<?php

namespace Sirprize\Rest\ResponseHandler;

class SimpleXml extends \Sirprize\Rest\ResponseHandler
{

	protected $_simpleXml = null;

	public function load(\Zend_Http_Response $httpResponse)
    {
		$this->_reset();

		if($httpResponse->getBody())
		{
			set_error_handler(array($this, 'handleLoadErrors'));
			$this->_simpleXml = simplexml_load_string($httpResponse->getBody());
			restore_error_handler();
		}

		$this->_httpResponse = $httpResponse;
    	return $this;
    }

	public function getSimpleXml()
    {
    	return $this->_simpleXml;
    }

}


text:
package slog

import (
	"bytes"
	"encoding/base64"
	"fmt"
	"net/smtp"
	"os"
	"strings"
	"sync"
	"time"
)

type PlainTextEmailHandler struct {
	sync.Mutex
	SMTPServer            string
	SMTPUsername          string
	SMTPPassword          string
	Sender                string
	Receivers             []string
	Subject               string
	ContentFormatter      MultiEventFormatter
	AggregationTimeWindow time.Duration
	eventChan             chan *Event
}

func (handler *PlainTextEmailHandler) Handle(event *Event) {
	handler.Lock()
	defer handler.Unlock()
	if handler.eventChan == nil {
		handler.eventChan = make(chan *Event, 16)
		go handler.aggregateEvents()
	}
	handler.eventChan <- event
}

func (handler *PlainTextEmailHandler) aggregateEvents() {
	events := make([]*Event, 0, 16)
	for {
		events = events[:0]
		event := <-handler.eventChan
		events = append(events, event)
		ticker := time.NewTicker(handler.AggregationTimeWindow)
	AggregationLoop:
		for {
			select {
			case event := <-handler.eventChan:
				events = append(events, event)
			case <-ticker.C:
				ticker.Stop()
				break AggregationLoop
			}
		}
		var buffer bytes.Buffer
		fmt.Fprintf(&buffer, "From: %s\r\n", handler.Sender)
		fmt.Fprintf(&buffer, "To: %s\r\n", strings.Join(handler.Receivers, ","))
		fmt.Fprintf(&buffer, "Subject: %s\r\n",
			"=?utf-8?B?"+base64.StdEncoding.EncodeToString([]byte(handler.Subject))+"?=")
		buffer.WriteString("Content-Type: text/plain; charset=UTF-8\r\n\r\n")
		body, err := handler.ContentFormatter.FormatEvents(events)
		if err != nil {
			fmt.Fprintln(os.Stderr, "format email body fail:", err.Error())
			continue
		}
		buffer.Write(body)
		smtpHost := strings.Split(handler.SMTPServer, ":")[0]
		auth := smtp.PlainAuth("", handler.SMTPUsername, handler.SMTPPassword, smtpHost)
		if err := smtp.SendMail(handler.SMTPServer, auth, handler.Sender, handler.Receivers, buffer.Bytes()); err != nil {
			fmt.Fprintln(os.Stderr, "send mail fail:", err.Error())
		}
	}
}


text:
/*
 *       Filename:  tt.cpp
 *    Description:
 *         Author:  Wenzheng Jiang , jwzh.hi@gmail.com
 */
#include <assert.h>
#include <iostream>
#include "db.h"

using namespace std;

int main(int argc,char * argv[])
{
	leveldb::DB* db;
	leveldb::Options options;
	options.create_if_missing = true;
	std::string dbpath = "testdb";
	leveldb::Status status = leveldb::DB::Open(options, dbpath, &db);
	assert(status.ok());
	std::string key1 = "lyc";
	std::string key2 = "liyc7711@gamil.com";
	cout<<"Open db OK"<<std::endl;

	std::string value;
	leveldb::Status s ;
	s = db->Put(leveldb::WriteOptions(), key1, key2);/*key1和key2作为一对key-value对插入*/
	s = db->Get(leveldb::ReadOptions(), key1, &value);/*根据key返回对应的value值*/

	cout<<value<<std::endl;
	delete db;/*删除数据库*/

	return 0;
}


text:
<link href="<?=base_url();?>contents/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" media="all"/>
<link href="<?=base_url();?>contents/css/dataTables.tableTools.min.css" rel="stylesheet" type="text/css" media="all"/>
    <?php
    $date = new DateTime('Tomorrow'); ?>

Booking Status - South Indian Lunch

                        South Indian Lunch Booking for <?php echo($date->format('l, F dS, Y')); ?>

                        #
                        Name
                        Student Id
                        Booking Time

    <?php
                $i=0;
                if($users)
                {
                    foreach($users as $row){
                        $i++;
                        echo "
";
                            echo "$i	";
                            echo "".htmlspecialchars($row['user_name'])."	";
                            echo "".htmlspecialchars($row['user_sccode'])."	";
                            echo "".htmlspecialchars(date("h:i:s A", strtotime($row['timestamp'])))."	";
                        echo "
";
                    }
                }

                ?>


text:
require 'spec_helper'

describe Formvalidator::Lite do
  it 'has a version number' do
    expect(Formvalidator::Lite::VERSION).not_to be nil
  end

  it 'does something useful' do
    expect(false).to eq(true)
  end
end


text:
namespace ui {

////////////////////////////////////////////////////////////////////////////////
// Event

// static
scoped_ptr<Event> Event::Clone(const Event& event) {
  if (event.IsKeyEvent()) {
    return scoped_ptr<Event>(new KeyEvent(static_cast<const KeyEvent&>(event)));
  }

  if (event.IsMouseEvent()) {
    if (event.IsMouseWheelEvent()) {
      return scoped_ptr<Event>(
          new MouseWheelEvent(static_cast<const MouseWheelEvent&>(event)));
    }

    return scoped_ptr<Event>(
        new MouseEvent(static_cast<const MouseEvent&>(event)));
  }

  if (event.IsTouchEvent()) {
    return scoped_ptr<Event>(
        new TouchEvent(static_cast<const TouchEvent&>(event)));
  }

  if (event.IsGestureEvent()) {
    return scoped_ptr<Event>(
        new GestureEvent(static_cast<const GestureEvent&>(event)));
  }

  if (event.IsScrollEvent()) {
    return scoped_ptr<Event>(
        new ScrollEvent(static_cast<const ScrollEvent&>(event)));
  }

  return scoped_ptr<Event>(new Event(event));
}

Event::~Event() {
}

GestureEvent* Event::AsGestureEvent() {
  CHECK(IsGestureEvent());
  return static_cast<GestureEvent*>(this);
}

const GestureEvent* Event::AsGestureEvent() const {
  CHECK(IsGestureEvent());
  return static_cast<const GestureEvent*>(this);
}

void Event::StopPropagation() {
  // TODO(sad): Re-enable these checks once View uses dispatcher to dispatch
  // events.
  // CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH);
  CHECK(cancelable_);
  result_ = static_cast<EventResult>(result_ | ER_CONSUMED);
}

void Event::SetHandled() {
  // TODO(sad): Re-enable these checks once View uses dispatcher to dispatch
  // events.
  // CHECK(phase_ != EP_PREDISPATCH && phase_ != EP_POSTDISPATCH);
  CHECK(cancelable_);
  result_ = static_cast<EventResult>(result_ | ER_HANDLED);
}

Event::Event()
    : type_(ET_UNKNOWN),
      time_stamp_(base::TimeDelta()),
      flags_(EF_NONE),
      cancelable_(true),
      target_(NULL),
      phase_(EP_PREDISPATCH),
      result_(ER_UNHANDLED),
      source_device_id_(ED_UNKNOWN_DEVICE) {
}

Event::Event(EventType type, base::TimeDelta time_stamp, int flags)
    : type_(type),
      time_stamp_(time_stamp),
      flags_(flags),
      cancelable_(true),
      target_(NULL),
      phase_(EP_PREDISPATCH),
      result_(ER_UNHANDLED),
      source_device_id_(ED_UNKNOWN_DEVICE) {
}

Event::Event(const Event& copy)
    : type_(copy.type_),
      time_stamp_(copy.time_stamp_),
      latency_(copy.latency_),
      flags_(copy.flags_),
      cancelable_(true),
      target_(NULL),
      phase_(EP_PREDISPATCH),
      result_(ER_UNHANDLED),
      source_device_id_(copy.source_device_id_) {
}

void Event::SetType(EventType type) {
  type_ = type;
}

////////////////////////////////////////////////////////////////////////////////
// CancelModeEvent

CancelModeEvent::CancelModeEvent()
    : Event(ET_CANCEL_MODE, base::TimeDelta(), 0) {
  set_cancelable(false);
}

CancelModeEvent::~CancelModeEvent() {
}

////////////////////////////////////////////////////////////////////////////////
// LocatedEvent

LocatedEvent::LocatedEvent() : Event() {
}

LocatedEvent::~LocatedEvent() {
}

LocatedEvent::LocatedEvent(EventType type,
                           const gfx::PointF& location,
                           const gfx::PointF& root_location,
                           base::TimeDelta time_stamp,
                           int flags)
    : Event(type, time_stamp, flags),
      location_(location),
      root_location_(root_location) {
}

void LocatedEvent::UpdateForRootTransform(
    const gfx::Transform& reversed_root_transform) {
  // Transform has to be done at root level.
  gfx::Point3F p(location_);
  reversed_root_transform.TransformPoint(&p);
  location_ = p.AsPointF();
  root_location_ = location_;
}

////////////////////////////////////////////////////////////////////////////////
// MouseEvent

MouseEvent::MouseEvent() : LocatedEvent(), changed_button_flags_(0) {
}

MouseEvent::MouseEvent(EventType type,
                       const gfx::PointF& location,
                       const gfx::PointF& root_location,
                       int flags,
                       int changed_button_flags)
    : LocatedEvent(type, location, root_location, EventTimeForNow(), flags),
      changed_button_flags_(changed_button_flags) {
  if (this->type() == ET_MOUSE_MOVED && IsAnyButton())
    SetType(ET_MOUSE_DRAGGED);
}

// static
bool MouseEvent::IsRepeatedClickEvent(
    const MouseEvent& event1,
    const MouseEvent& event2) {
  // These values match the Windows defaults.
  static const int kDoubleClickTimeMS = 500;
  static const int kDoubleClickWidth = 4;
  static const int kDoubleClickHeight = 4;

  if (event1.type() != ET_MOUSE_PRESSED ||
      event2.type() != ET_MOUSE_PRESSED)
    return false;

  // Compare flags, but ignore EF_IS_DOUBLE_CLICK to allow triple clicks.
  if ((event1.flags() & ~EF_IS_DOUBLE_CLICK) !=
      (event2.flags() & ~EF_IS_DOUBLE_CLICK))
    return false;

  base::TimeDelta time_difference = event2.time_stamp() - event1.time_stamp();

  if (time_difference.InMilliseconds() > kDoubleClickTimeMS)
    return false;

  if (std::abs(event2.x() - event1.x()) > kDoubleClickWidth / 2)
    return false;

  if (std::abs(event2.y() - event1.y()) > kDoubleClickHeight / 2)
    return false;

  return true;
}

int MouseEvent::GetClickCount() const {
  if (type() != ET_MOUSE_PRESSED && type() != ET_MOUSE_RELEASED)
    return 0;

  if (flags() & EF_IS_TRIPLE_CLICK)
    return 3;
  else if (flags() & EF_IS_DOUBLE_CLICK)
    return 2;
  else
    return 1;
}

void MouseEvent::SetClickCount(int click_count) {
  if (type() != ET_MOUSE_PRESSED && type() != ET_MOUSE_RELEASED)
    return;

  DCHECK(click_count > 0);
  DCHECK(click_count <= 3);

  int f = flags();
  switch (click_count) {
    case 1:
      f &= ~EF_IS_DOUBLE_CLICK;
      f &= ~EF_IS_TRIPLE_CLICK;
      break;
    case 2:
      f |= EF_IS_DOUBLE_CLICK;
      f &= ~EF_IS_TRIPLE_CLICK;
      break;
    case 3:
      f &= ~EF_IS_DOUBLE_CLICK;
      f |= EF_IS_TRIPLE_CLICK;
      break;
  }
  set_flags(f);
}

////////////////////////////////////////////////////////////////////////////////
// MouseWheelEvent

MouseWheelEvent::MouseWheelEvent() : MouseEvent(), offset_() {
}

MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event)
    : MouseEvent(scroll_event),
      offset_(gfx::ToRoundedInt(scroll_event.x_offset()),
              gfx::ToRoundedInt(scroll_event.y_offset())) {
  SetType(ET_MOUSEWHEEL);
}

MouseWheelEvent::MouseWheelEvent(const MouseEvent& mouse_event,
                                 int x_offset,
                                 int y_offset)
    : MouseEvent(mouse_event), offset_(x_offset, y_offset) {
  DCHECK(type() == ET_MOUSEWHEEL);
}

MouseWheelEvent::MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event)
    : MouseEvent(mouse_wheel_event),
      offset_(mouse_wheel_event.offset()) {
  DCHECK(type() == ET_MOUSEWHEEL);
}

MouseWheelEvent::MouseWheelEvent(const gfx::Vector2d& offset,
                                 const gfx::PointF& location,
                                 const gfx::PointF& root_location,
                                 int flags,
                                 int changed_button_flags)
    : MouseEvent(ui::ET_MOUSEWHEEL, location, root_location, flags,
                 changed_button_flags),
      offset_(offset) {
}

// This value matches GTK+ wheel scroll amount.
const int MouseWheelEvent::kWheelDelta = 53;

void MouseWheelEvent::UpdateForRootTransform(
    const gfx::Transform& inverted_root_transform) {
  LocatedEvent::UpdateForRootTransform(inverted_root_transform);
  gfx::DecomposedTransform decomp;
  bool success = gfx::DecomposeTransform(&decomp, inverted_root_transform);
  DCHECK(success);
  if (decomp.scale[0]) {
    offset_.set_x(
        gfx::ToRoundedInt(SkMScalarToFloat(offset_.x() * decomp.scale[0])));
  }
  if (decomp.scale[1]) {
    offset_.set_y(
        gfx::ToRoundedInt(SkMScalarToFloat(offset_.y() * decomp.scale[1])));
  }
}

////////////////////////////////////////////////////////////////////////////////
// TouchEvent

TouchEvent::TouchEvent()
    : LocatedEvent(),
      touch_id_(0),
      radius_x_(0),
      radius_y_(0),
      rotation_angle_(0),
      force_(0) {
}

TouchEvent::TouchEvent(EventType type,
                       const gfx::PointF& location,
                       int touch_id,
                       base::TimeDelta time_stamp)
    : LocatedEvent(type, location, location, time_stamp, 0),
      touch_id_(touch_id),
      radius_x_(0.0f),
      radius_y_(0.0f),
      rotation_angle_(0.0f),
      force_(0.0f) {
  latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
}

TouchEvent::TouchEvent(EventType type,
                       const gfx::PointF& location,
                       int flags,
                       int touch_id,
                       base::TimeDelta time_stamp,
                       float radius_x,
                       float radius_y,
                       float angle,
                       float force)
    : LocatedEvent(type, location, location, time_stamp, flags),
      touch_id_(touch_id),
      radius_x_(radius_x),
      radius_y_(radius_y),
      rotation_angle_(angle),
      force_(force) {
  latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
}

TouchEvent::~TouchEvent() {
}

void TouchEvent::UpdateForRootTransform(
    const gfx::Transform& inverted_root_transform) {
  LocatedEvent::UpdateForRootTransform(inverted_root_transform);
  gfx::DecomposedTransform decomp;
  bool success = gfx::DecomposeTransform(&decomp, inverted_root_transform);
  DCHECK(success);
  if (decomp.scale[0])
    radius_x_ *= decomp.scale[0];
  if (decomp.scale[1])
    radius_y_ *= decomp.scale[1];
}

////////////////////////////////////////////////////////////////////////////////
// KeyEvent

KeyEvent::KeyEvent()
    : Event(),
      key_code_(VKEY_UNKNOWN),
      code_(),
      is_char_(false),
      platform_keycode_(0),
      character_(0) {
}

KeyEvent::KeyEvent(EventType type,
                   KeyboardCode key_code,
                   int flags)
    : Event(type, EventTimeForNow(), flags),
      key_code_(key_code),
      is_char_(false),
      platform_keycode_(0),
      character_() {
}

KeyEvent::KeyEvent(EventType type,
                   KeyboardCode key_code,
                   const std::string& code,
                   int flags)
    : Event(type, EventTimeForNow(), flags),
      key_code_(key_code),
      code_(code),
      is_char_(false),
      platform_keycode_(0),
      character_(0) {
}

KeyEvent::KeyEvent(base::char16 character, KeyboardCode key_code, int flags)
    : Event(ET_KEY_PRESSED, EventTimeForNow(), flags),
      key_code_(key_code),
      code_(""),
      is_char_(true),
      platform_keycode_(0),
      character_(character) {
}

KeyEvent::KeyEvent(const KeyEvent& rhs)
    : Event(rhs),
      key_code_(rhs.key_code_),
      code_(rhs.code_),
      is_char_(rhs.is_char_),
      platform_keycode_(rhs.platform_keycode_),
      character_(rhs.character_) {
  if (rhs.extended_key_event_data_)
    extended_key_event_data_.reset(rhs.extended_key_event_data_->Clone());
}

KeyEvent& KeyEvent::operator=(const KeyEvent& rhs) {
  if (this != &rhs) {
    Event::operator=(rhs);
    key_code_ = rhs.key_code_;
    code_ = rhs.code_;
    is_char_ = rhs.is_char_;
    platform_keycode_ = rhs.platform_keycode_;
    character_ = rhs.character_;

    if (rhs.extended_key_event_data_)
      extended_key_event_data_.reset(rhs.extended_key_event_data_->Clone());
  }
  return *this;
}

KeyEvent::~KeyEvent() {}

void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) {
  extended_key_event_data_ = data.Pass();
}

base::char16 KeyEvent::GetCharacter() const {
  if (is_char_ || character_)
    return character_;

  // TODO(kpschoedel): streamline these cases after settling Ozone
  // positional coding.
#if defined(USE_X11)
  character_ = GetCharacterFromKeyCode(key_code_, flags());
  return character_;
#else
  return GetCharacterFromKeyCode(key_code_, flags());
#endif
}

base::char16 KeyEvent::GetText() const {
  if ((flags() & EF_CONTROL_DOWN) != 0) {
    return GetControlCharacterForKeycode(key_code_,
                                         (flags() & EF_SHIFT_DOWN) != 0);
  }
  return GetUnmodifiedText();
}

base::char16 KeyEvent::GetUnmodifiedText() const {
  if (!is_char_ && (key_code_ == VKEY_RETURN))
    return '\r';
  return GetCharacter();
}

bool KeyEvent::IsUnicodeKeyCode() const {
  return false;
}

void KeyEvent::NormalizeFlags() {
  int mask = 0;
  switch (key_code()) {
    case VKEY_CONTROL:
      mask = EF_CONTROL_DOWN;
      break;
    case VKEY_SHIFT:
      mask = EF_SHIFT_DOWN;
      break;
    case VKEY_MENU:
      mask = EF_ALT_DOWN;
      break;
    case VKEY_CAPITAL:
      mask = EF_CAPS_LOCK_DOWN;
      break;
    default:
      return;
  }
  if (type() == ET_KEY_PRESSED)
    set_flags(flags() | mask);
  else
    set_flags(flags() & ~mask);
}

bool KeyEvent::IsTranslated() const {
  switch (type()) {
    case ET_KEY_PRESSED:
    case ET_KEY_RELEASED:
      return false;
    case ET_TRANSLATED_KEY_PRESS:
    case ET_TRANSLATED_KEY_RELEASE:
      return true;
    default:
      NOTREACHED();
      return false;
  }
}

void KeyEvent::SetTranslated(bool translated) {
  switch (type()) {
    case ET_KEY_PRESSED:
    case ET_TRANSLATED_KEY_PRESS:
      SetType(translated ? ET_TRANSLATED_KEY_PRESS : ET_KEY_PRESSED);
      break;
    case ET_KEY_RELEASED:
    case ET_TRANSLATED_KEY_RELEASE:
      SetType(translated ? ET_TRANSLATED_KEY_RELEASE : ET_KEY_RELEASED);
      break;
    default:
      NOTREACHED();
  }
}

bool KeyEvent::IsRightSideKey() const {
  switch (key_code_) {
    case VKEY_CONTROL:
    case VKEY_SHIFT:
    case VKEY_MENU:
    case VKEY_LWIN:
#if defined(USE_X11)
      // Under X11, setting code_ requires platform-dependent information, and
      // currently assumes that X keycodes are based on Linux evdev keycodes.
      // In certain test environments this is not the case, and code_ is not
      // set accurately, so we need a different mechanism. Fortunately X11 key
      // mapping preserves the left-right distinction, so testing keysyms works
      // if the value is available (as it is for all X11 native-based events).
      if (platform_keycode_) {
        return (platform_keycode_ == XK_Shift_R) ||
               (platform_keycode_ == XK_Control_R) ||
               (platform_keycode_ == XK_Alt_R) ||
               (platform_keycode_ == XK_Meta_R) ||
               (platform_keycode_ == XK_Super_R) ||
               (platform_keycode_ == XK_Hyper_R);
      }
      // Fall through to the generic code if we have no platform_keycode_.
      // Under X11, this must be a synthetic event, so we can require that
      // code_ be set correctly.
#endif
      return ((code_.size() > 5) &&
              (code_.compare(code_.size() - 5, 5, "Right", 5)) == 0);
    default:
      return false;
  }
}

KeyboardCode KeyEvent::GetLocatedWindowsKeyboardCode() const {
  switch (key_code_) {
    case VKEY_SHIFT:
      return IsRightSideKey() ? VKEY_RSHIFT : VKEY_LSHIFT;
    case VKEY_CONTROL:
      return IsRightSideKey() ? VKEY_RCONTROL : VKEY_LCONTROL;
    case VKEY_MENU:
      return IsRightSideKey() ? VKEY_RMENU : VKEY_LMENU;
    case VKEY_LWIN:
      return IsRightSideKey() ? VKEY_RWIN : VKEY_LWIN;
    // TODO(kpschoedel): EF_NUMPAD_KEY is present only on X11. Currently this
    // function is only called on X11. Likely the tests here will be replaced
    // with a DOM-based code enumeration test in the course of Ozone
    // platform-indpendent key event work.
    case VKEY_0:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD0 : VKEY_0;
    case VKEY_1:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD1 : VKEY_1;
    case VKEY_2:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD2 : VKEY_2;
    case VKEY_3:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD3 : VKEY_3;
    case VKEY_4:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD4 : VKEY_4;
    case VKEY_5:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD5 : VKEY_5;
    case VKEY_6:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD6 : VKEY_6;
    case VKEY_7:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD7 : VKEY_7;
    case VKEY_8:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD8 : VKEY_8;
    case VKEY_9:
      return (flags() & EF_NUMPAD_KEY) ? VKEY_NUMPAD9 : VKEY_9;
    default:
      return key_code_;
  }
}

uint16 KeyEvent::GetConflatedWindowsKeyCode() const {
  if (is_char_)
    return character_;
  return key_code_;
}

////////////////////////////////////////////////////////////////////////////////
// ScrollEvent

ScrollEvent::ScrollEvent() : MouseEvent() {
}

ScrollEvent::ScrollEvent(EventType type,
                         const gfx::PointF& location,
                         base::TimeDelta time_stamp,
                         int flags,
                         float x_offset,
                         float y_offset,
                         float x_offset_ordinal,
                         float y_offset_ordinal,
                         int finger_count)
    : MouseEvent(type, location, location, flags, 0),
      x_offset_(x_offset),
      y_offset_(y_offset),
      x_offset_ordinal_(x_offset_ordinal),
      y_offset_ordinal_(y_offset_ordinal),
      finger_count_(finger_count) {
  set_time_stamp(time_stamp);
  CHECK(IsScrollEvent());
}

void ScrollEvent::Scale(const float factor) {
  x_offset_ *= factor;
  y_offset_ *= factor;
  x_offset_ordinal_ *= factor;
  y_offset_ordinal_ *= factor;
}

////////////////////////////////////////////////////////////////////////////////
// GestureEvent

GestureEvent::GestureEvent(float x,
                           float y,
                           int flags,
                           base::TimeDelta time_stamp,
                           const GestureEventDetails& details)
    : LocatedEvent(details.type(),
                   gfx::PointF(x, y),
                   gfx::PointF(x, y),
                   time_stamp,
                   flags | EF_FROM_TOUCH),
      details_(details) {
}

GestureEvent::~GestureEvent() {
}

}  // namespace ui


text: #include "../../../../Platform/chromium/public/WebAudioDevice.h"