text
stringlengths 10
99.9k
| meta
dict |
|---|---|
///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///
/// Auto-generated by Stone, do not modify.
///
#import <Foundation/Foundation.h>
#import "DBSerializableProtocol.h"
@class DBTEAMPOLICIESSharedFolderJoinPolicy;
NS_ASSUME_NONNULL_BEGIN
#pragma mark - API Object
///
/// The `SharedFolderJoinPolicy` union.
///
/// Policy governing which shared folders a team member can join.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBTEAMPOLICIESSharedFolderJoinPolicy : NSObject <DBSerializable, NSCopying>
#pragma mark - Instance fields
/// The `DBTEAMPOLICIESSharedFolderJoinPolicyTag` enum type represents the
/// possible tag states with which the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// union can exist.
typedef NS_CLOSED_ENUM(NSInteger, DBTEAMPOLICIESSharedFolderJoinPolicyTag){
/// Team members can only join folders shared by teammates.
DBTEAMPOLICIESSharedFolderJoinPolicyFromTeamOnly,
/// Team members can join any shared folder, including those shared by users
/// outside the team.
DBTEAMPOLICIESSharedFolderJoinPolicyFromAnyone,
/// (no description).
DBTEAMPOLICIESSharedFolderJoinPolicyOther,
};
/// Represents the union's current tag state.
@property (nonatomic, readonly) DBTEAMPOLICIESSharedFolderJoinPolicyTag tag;
#pragma mark - Constructors
///
/// Initializes union class with tag state of "from_team_only".
///
/// Description of the "from_team_only" tag state: Team members can only join
/// folders shared by teammates.
///
/// @return An initialized instance.
///
- (instancetype)initWithFromTeamOnly;
///
/// Initializes union class with tag state of "from_anyone".
///
/// Description of the "from_anyone" tag state: Team members can join any shared
/// folder, including those shared by users outside the team.
///
/// @return An initialized instance.
///
- (instancetype)initWithFromAnyone;
///
/// Initializes union class with tag state of "other".
///
/// @return An initialized instance.
///
- (instancetype)initWithOther;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark - Tag state methods
///
/// Retrieves whether the union's current tag state has value "from_team_only".
///
/// @return Whether the union's current tag state has value "from_team_only".
///
- (BOOL)isFromTeamOnly;
///
/// Retrieves whether the union's current tag state has value "from_anyone".
///
/// @return Whether the union's current tag state has value "from_anyone".
///
- (BOOL)isFromAnyone;
///
/// Retrieves whether the union's current tag state has value "other".
///
/// @return Whether the union's current tag state has value "other".
///
- (BOOL)isOther;
///
/// Retrieves string value of union's current tag state.
///
/// @return A human-readable string representing the union's current tag state.
///
- (NSString *)tagName;
@end
#pragma mark - Serializer Object
///
/// The serialization class for the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// union.
///
@interface DBTEAMPOLICIESSharedFolderJoinPolicySerializer : NSObject
///
/// Serializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances.
///
/// @param instance An instance of the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// API object.
///
/// @return A json-compatible dictionary representation of the
/// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMPOLICIESSharedFolderJoinPolicy *)instance;
///
/// Deserializes `DBTEAMPOLICIESSharedFolderJoinPolicy` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBTEAMPOLICIESSharedFolderJoinPolicy` API object.
///
/// @return An instantiation of the `DBTEAMPOLICIESSharedFolderJoinPolicy`
/// object.
///
+ (DBTEAMPOLICIESSharedFolderJoinPolicy *)deserialize:(NSDictionary<NSString *, id> *)dict;
@end
NS_ASSUME_NONNULL_END
|
{
"pile_set_name": "Github"
}
|
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#include "Demo.h"
#ifndef VCZH_DEBUG_NO_REFLECTION
#include "GacUIReflection.h"
#endif
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
/***********************************************************************
Reflection
***********************************************************************/
namespace vl
{
namespace reflection
{
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
DECL_TYPE_INFO(::demo::MainWindow)
DECL_TYPE_INFO(::demo::MainWindowConstructor)
#endif
extern bool LoadDemoTypes();
}
}
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
--- sandbox/linux/BUILD.gn.orig 2019-04-08 08:18:26 UTC
+++ sandbox/linux/BUILD.gn
@@ -12,12 +12,12 @@ if (is_android) {
}
declare_args() {
- compile_suid_client = is_linux
+ compile_suid_client = is_linux && !is_bsd
- compile_credentials = is_linux
+ compile_credentials = is_linux && !is_bsd
# On Android, use plain GTest.
- use_base_test_suite = is_linux
+ use_base_test_suite = is_linux && !is_bsd
}
if (is_nacl_nonsfi) {
@@ -379,7 +379,7 @@ component("sandbox_services") {
public_deps += [ ":sandbox_services_headers" ]
}
- if (is_nacl_nonsfi) {
+ if (is_nacl_nonsfi || is_bsd) {
cflags = [ "-fgnu-inline-asm" ]
sources -= [
@@ -387,6 +387,8 @@ component("sandbox_services") {
"services/init_process_reaper.h",
"services/scoped_process.cc",
"services/scoped_process.h",
+ "services/syscall_wrappers.cc",
+ "services/syscall_wrappers.h",
"services/yama.cc",
"services/yama.h",
"syscall_broker/broker_channel.cc",
@@ -405,6 +407,10 @@ component("sandbox_services") {
"syscall_broker/broker_process.h",
"syscall_broker/broker_simple_message.cc",
"syscall_broker/broker_simple_message.h",
+ ]
+ sources += [
+ "services/libc_interceptor.cc",
+ "services/libc_interceptor.h",
]
} else if (!is_android) {
sources += [
|
{
"pile_set_name": "Github"
}
|
.theme-dusk,.theme-midnight {
.hljs {
display: block;
overflow-x: auto;
background: #232323;
color: #e6e1dc;
}
.hljs-comment,
.hljs-quote {
color: #bc9458;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag {
color: #c26230;
}
.hljs-string,
.hljs-number,
.hljs-regexp,
.hljs-variable,
.hljs-template-variable {
color: #a5c261;
}
.hljs-subst {
color: #519f50;
}
.hljs-tag,
.hljs-name {
color: #e8bf6a;
}
.hljs-type {
color: #da4939;
}
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-attr,
.hljs-link {
color: #6d9cbe;
}
.hljs-params {
color: #d0d0ff;
}
.hljs-attribute {
color: #cda869;
}
.hljs-meta {
color: #9b859d;
}
.hljs-title,
.hljs-section {
color: #ffc66d;
}
.hljs-addition {
background-color: #144212;
color: #e6e1dc;
display: inline-block;
width: 100%;
}
.hljs-deletion {
background-color: #600;
color: #e6e1dc;
display: inline-block;
width: 100%;
}
.hljs-selector-class {
color: #9b703f;
}
.hljs-selector-id {
color: #8b98ab;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-link {
text-decoration: underline;
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
#define CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
#include <boost/graph/adjacency_list.hpp>
boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
boost::no_property, boost::no_property,
boost::property<boost::graph_name_t, std::string>>
create_empty_directed_graph_with_graph_name() noexcept;
#endif // CREATE_EMPTY_DIRECTED_GRAPH_WITH_GRAPH_NAME_H
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.stanbol.entityhub.web.reader;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.Provider;
import org.apache.clerezza.commons.rdf.Graph;
import org.apache.clerezza.commons.rdf.BlankNodeOrIRI;
import org.apache.clerezza.commons.rdf.Triple;
import org.apache.clerezza.commons.rdf.IRI;
import org.apache.clerezza.rdf.core.serializedform.Parser;
import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.stanbol.commons.indexedgraph.IndexedGraph;
import org.apache.stanbol.entityhub.jersey.utils.JerseyUtils;
import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils;
import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils.RequestData;
import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;
import org.apache.stanbol.entityhub.servicesapi.model.Representation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provides support for reading Representation form Requests. This implementation
* supports all RDF supports as well as {@link MediaType#APPLICATION_FORM_URLENCODED}
* - in case the data are sent from an HTML form - and
* {@link MediaType#MULTIPART_FORM_DATA} - mime encoded data.
* In case of an HTML form the encoding need to be specified by the parameter
* "encoding" for the entity data the parameters "entity" or "content" can be
* used.
* @author Rupert Westenthaler
*
*/
@Component
@Service(Object.class)
@Property(name="javax.ws.rs", boolValue=true)
@Provider
@Consumes({ //First the data types directly supported for parsing representations
MediaType.APPLICATION_JSON, SupportedFormat.N3, SupportedFormat.N_TRIPLE,
SupportedFormat.RDF_XML, SupportedFormat.TURTLE, SupportedFormat.X_TURTLE,
SupportedFormat.RDF_JSON,
//finally this also supports sending the data as form and mime multipart
MediaType.APPLICATION_FORM_URLENCODED,
MediaType.MULTIPART_FORM_DATA})
public class RepresentationReader implements MessageBodyReader<Map<String,Representation>> {
private static final Logger log = LoggerFactory.getLogger(RepresentationReader.class);
public static final Set<String> supportedMediaTypes;
private static final MediaType DEFAULT_ACCEPTED_MEDIA_TYPE = MediaType.TEXT_PLAIN_TYPE;
static {
Set<String> types = new HashSet<String>();
//ensure everything is lower case
types.add(MediaType.APPLICATION_JSON.toLowerCase());
types.add(SupportedFormat.N3.toLowerCase());
types.add(SupportedFormat.N_TRIPLE.toLowerCase());
types.add(SupportedFormat.RDF_JSON.toLowerCase());
types.add(SupportedFormat.RDF_XML.toLowerCase());
types.add(SupportedFormat.TURTLE.toLowerCase());
types.add(SupportedFormat.X_TURTLE.toLowerCase());
supportedMediaTypes = Collections.unmodifiableSet(types);
}
@Reference
private Parser parser;
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
String mediaTypeWithoutParameter =
mediaType.getType().toLowerCase()+'/'+
mediaType.getSubtype().toLowerCase();
log.debug("isreadable: [genericType: {}| mediaType {}]",
genericType,mediaTypeWithoutParameter);
//second the media type
boolean mediaTypeOK = (//the MimeTypes of Representations
supportedMediaTypes.contains(mediaTypeWithoutParameter) ||
//as well as URL encoded
MediaType.APPLICATION_FORM_URLENCODED.equals(mediaTypeWithoutParameter) ||
//and mime multipart
MediaType.MULTIPART_FORM_DATA.equals(mediaTypeWithoutParameter));
boolean typeOk = JerseyUtils.testParameterizedType(Map.class,
new Class[]{String.class,Representation.class}, genericType);
log.debug("type is {} for {} against Map<String,Representation>",
typeOk ? "compatible" : "incompatible" ,genericType);
return typeOk && mediaTypeOK;
}
@Override
public Map<String,Representation> readFrom(Class<Map<String,Representation>> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> httpHeaders,
InputStream entityStream) throws IOException, WebApplicationException {
log.info("Read Representations from Request Data");
long start = System.currentTimeMillis();
//(1) get the charset and the acceptedMediaType
String charset = "UTF-8";
if(mediaType.getParameters().containsKey("charset")){
charset = mediaType.getParameters().get("charset");
}
MediaType acceptedMediaType = getAcceptedMediaType(httpHeaders);
log.info("readFrom: mediaType {} | accepted {} | charset {}",
new Object[]{mediaType,acceptedMediaType,charset});
// (2) read the Content from the request (this needs to deal with
// MediaType.APPLICATION_FORM_URLENCODED_TYPE and
// MediaType.MULTIPART_FORM_DATA_TYPE requests!
RequestData content;
if(mediaType.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) {
try {
content = MessageBodyReaderUtils.formForm(entityStream, charset,
"encoding",Arrays.asList("entity","content"));
} catch (IllegalArgumentException e) {
log.info("Bad Request: {}",e);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(e.toString()).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
if(content.getMediaType() == null){
String message = String.format(
"Missing parameter %s used to specify the media type" +
"(supported values: %s",
"encoding",supportedMediaTypes);
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
if(!isSupported(content.getMediaType())){
String message = String.format(
"Unsupported Content-Type specified by parameter " +
"encoding=%s (supported: %s)",
content.getMediaType().toString(),supportedMediaTypes);
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).
entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
} else if(mediaType.isCompatible(MediaType.MULTIPART_FORM_DATA_TYPE)){
log.info("read from MimeMultipart");
List<RequestData> contents;
try {
contents = MessageBodyReaderUtils.fromMultipart(entityStream, mediaType);
} catch (IllegalArgumentException e) {
log.info("Bad Request: {}",e.toString());
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(e.toString()).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
if(contents.isEmpty()){
String message = "Request does not contain any Mime BodyParts.";
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
} else if(contents.size()>1){
//print warnings about ignored parts
log.warn("{} Request contains more than one Parts: others than " +
"the first will be ignored",
MediaType.MULTIPART_FORM_DATA_TYPE);
for(int i=1;i<contents.size();i++){
RequestData ignored = contents.get(i);
log.warn(" ignore Content {}: Name {}| MediaType {}",
new Object[] {i+1,ignored.getName(),ignored.getMediaType()});
}
}
content = contents.get(0);
if(content.getMediaType() == null){
String message = String.format(
"MediaType not specified for mime body part for file %s. " +
"The media type must be one of the supported values: %s",
content.getName(), supportedMediaTypes);
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
if(!isSupported(content.getMediaType())){
String message = String.format(
"Unsupported Content-Type %s specified for mime body part " +
"for file %s (supported: %s)",
content.getMediaType(),content.getName(),supportedMediaTypes);
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).
entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
} else {
content = new RequestData(mediaType, null, entityStream);
}
long readingCompleted = System.currentTimeMillis();
log.info(" ... reading request data {}ms",readingCompleted-start);
Map<String,Representation> parsed = parseFromContent(content,acceptedMediaType);
long parsingCompleted = System.currentTimeMillis();
log.info(" ... parsing data {}ms",parsingCompleted-readingCompleted);
return parsed;
}
public Map<String,Representation> parseFromContent(RequestData content, MediaType acceptedMediaType){
// (3) Parse the Representtion(s) form the entity stream
if(content.getMediaType().isCompatible(MediaType.APPLICATION_JSON_TYPE)){
//parse from json
throw new UnsupportedOperationException("Parsing of JSON not yet implemented :(");
} else if(isSupported(content.getMediaType())){ //from RDF serialisation
RdfValueFactory valueFactory = RdfValueFactory.getInstance();
Map<String,Representation> representations = new HashMap<String,Representation>();
Set<BlankNodeOrIRI> processed = new HashSet<BlankNodeOrIRI>();
Graph graph = new IndexedGraph();
try {
parser.parse(graph,content.getEntityStream(), content.getMediaType().toString());
} catch (UnsupportedParsingFormatException e) {
//String acceptedMediaType = httpHeaders.getFirst("Accept");
//throw an internal server Error, because we check in
//isReadable(..) for supported types and still we get here a
//unsupported format -> therefore it looks like an configuration
//error the server (e.g. a missing Bundle with the required bundle)
String message = "Unable to create the Parser for the supported format"
+content.getMediaType()+" ("+e+")";
log.error(message,e);
throw new WebApplicationException(
Response.status(Status.INTERNAL_SERVER_ERROR).
entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
} catch (RuntimeException e){
//NOTE: Clerezza seams not to provide specific exceptions on
// parsing errors. Hence the catch for all RuntimeException
String message = "Unable to parse the provided RDF data (format: "
+content.getMediaType()+", message: "+e.getMessage()+")";
log.error(message,e);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).
entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
for(Iterator<Triple> st = graph.iterator();st.hasNext();){
BlankNodeOrIRI resource = st.next().getSubject();
if(resource instanceof IRI && processed.add(resource)){
//build a new representation
representations.put(((IRI)resource).getUnicodeString(),
valueFactory.createRdfRepresentation((IRI)resource, graph));
}
}
return representations;
} else { //unsupported media type
String message = String.format(
"Parsed Content-Type '%s' is not one of the supported %s",
content.getMediaType(),supportedMediaTypes);
log.info("Bad Request: {}",message);
throw new WebApplicationException(
Response.status(Status.BAD_REQUEST).
entity(message).
header(HttpHeaders.ACCEPT, acceptedMediaType).build());
}
}
/**
* Internally used to get the accepted media type used when returning
* {@link WebApplicationException}s.
* @param httpHeaders
* @param acceptedMediaType
* @return
*/
private static MediaType getAcceptedMediaType(MultivaluedMap<String,String> httpHeaders) {
MediaType acceptedMediaType;
String acceptedMediaTypeString = httpHeaders.getFirst("Accept");
if(acceptedMediaTypeString != null){
try {
acceptedMediaType = MediaType.valueOf(acceptedMediaTypeString);
if(acceptedMediaType.isWildcardType()){
acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE;
}
} catch (IllegalArgumentException e) {
acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE;
}
} else {
acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE;
}
return acceptedMediaType;
}
/**
* Converts the type and the subtype of the parsed media type to the
* string representation as stored in {@link #supportedMediaTypes} and than
* checks if the parsed media type is contained in this list.
* @param mediaType the MediaType instance to check
* @return <code>true</code> if the parsed media type is not
* <code>null</code> and supported.
*/
private boolean isSupported(MediaType mediaType){
return mediaType == null ? false : supportedMediaTypes.contains(
mediaType.getType().toLowerCase()+'/'+
mediaType.getSubtype().toLowerCase());
}
}
|
{
"pile_set_name": "Github"
}
|
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
#define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/prior.hpp>
# include <boost/mpl/apply_wrap.hpp>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/unrolling.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/config/eti.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/inc.hpp>
namespace boost { namespace mpl { namespace aux {
// forward declaration
template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
# define BOOST_PP_ITERATION_PARAMS_1 \
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
# include BOOST_PP_ITERATE()
// implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
struct advance_backward
{
template< typename Iterator > struct apply
{
typedef typename apply_wrap1<
advance_backward<BOOST_MPL_LIMIT_UNROLLING>
, Iterator
>::type chunk_result_;
typedef typename apply_wrap1<
advance_backward<(
(N - BOOST_MPL_LIMIT_UNROLLING) < 0
? 0
: N - BOOST_MPL_LIMIT_UNROLLING
)>
, chunk_result_
>::type type;
};
};
}}}
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
///// iteration, depth == 1
// For gcc 4.4 compatability, we must include the
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
#else // BOOST_PP_IS_ITERATING
#if BOOST_PP_ITERATION_DEPTH() == 1
#define i_ BOOST_PP_FRAME_ITERATION(1)
template<>
struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
{
template< typename Iterator > struct apply
{
typedef Iterator iter0;
#if i_ > 0
# define BOOST_PP_ITERATION_PARAMS_2 \
(3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
# include BOOST_PP_ITERATE()
#endif
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
};
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
/// ETI workaround
template<> struct apply<int>
{
typedef int type;
};
#endif
};
#undef i_
///// iteration, depth == 2
#elif BOOST_PP_ITERATION_DEPTH() == 2
# define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
# define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
# undef AUX778076_ITER_1
# undef AUX778076_ITER_0
#endif // BOOST_PP_ITERATION_DEPTH()
#endif // BOOST_PP_IS_ITERATING
|
{
"pile_set_name": "Github"
}
|
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.vcs.impl
import com.intellij.ProjectTopics
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.service
import com.intellij.openapi.extensions.ExtensionNotApplicableException
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.ModuleListener
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.rootManager
import com.intellij.openapi.roots.ModuleRootEvent
import com.intellij.openapi.roots.ModuleRootListener
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.vcs.AbstractVcs
import com.intellij.openapi.vcs.ProjectLevelVcsManager
import com.intellij.openapi.vcs.VcsDirectoryMapping
import com.intellij.openapi.vfs.VirtualFile
internal class ModuleVcsDetector(private val project: Project) {
private val vcsManager by lazy(LazyThreadSafetyMode.NONE) {
(ProjectLevelVcsManager.getInstance(project) as ProjectLevelVcsManagerImpl)
}
internal class MyPostStartUpActivity : StartupActivity.DumbAware {
init {
if (ApplicationManager.getApplication().isUnitTestMode) {
throw ExtensionNotApplicableException.INSTANCE
}
}
override fun runActivity(project: Project) {
val vcsDetector = project.service<ModuleVcsDetector>()
val listener = vcsDetector.MyModulesListener()
val busConnection = project.messageBus.connect()
busConnection.subscribe(ProjectTopics.MODULES, listener)
busConnection.subscribe(ProjectTopics.PROJECT_ROOTS, listener)
if (vcsDetector.vcsManager.needAutodetectMappings()) {
vcsDetector.autoDetectVcsMappings(true)
}
}
}
private inner class MyModulesListener : ModuleRootListener, ModuleListener {
private val myMappingsForRemovedModules: MutableList<VcsDirectoryMapping> = mutableListOf()
override fun beforeRootsChange(event: ModuleRootEvent) {
myMappingsForRemovedModules.clear()
}
override fun rootsChanged(event: ModuleRootEvent) {
myMappingsForRemovedModules.forEach { mapping -> vcsManager.removeDirectoryMapping(mapping) }
// the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically
// on start etc (look inside)
if (vcsManager.needAutodetectMappings()) {
autoDetectVcsMappings(false)
}
}
override fun moduleAdded(project: Project, module: Module) {
myMappingsForRemovedModules.removeAll(getMappings(module))
autoDetectModuleVcsMapping(module)
}
override fun beforeModuleRemoved(project: Project, module: Module) {
myMappingsForRemovedModules.addAll(getMappings(module))
}
}
private fun autoDetectVcsMappings(tryMapPieces: Boolean) {
if (vcsManager.haveDefaultMapping() != null) return
val usedVcses = mutableSetOf<AbstractVcs?>()
val detectedRoots = mutableSetOf<Pair<VirtualFile, AbstractVcs>>()
val roots = ModuleManager.getInstance(project).modules.flatMap { it.rootManager.contentRoots.asIterable() }.distinct()
for (root in roots) {
val moduleVcs = vcsManager.findVersioningVcs(root)
if (moduleVcs != null) {
detectedRoots.add(Pair(root, moduleVcs))
}
usedVcses.add(moduleVcs) // put 'null' for unmapped module
}
val commonVcs = usedVcses.singleOrNull()
if (commonVcs != null) {
// Remove existing mappings that will duplicate added <Project> mapping.
val rootPaths = roots.map { it.path }.toSet()
val additionalMappings = vcsManager.directoryMappings.filter { it.directory !in rootPaths }
vcsManager.setAutoDirectoryMappings(additionalMappings + VcsDirectoryMapping.createDefault(commonVcs.name))
}
else if (tryMapPieces) {
val newMappings = detectedRoots.map { (root, vcs) -> VcsDirectoryMapping(root.path, vcs.name) }
vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings)
}
}
private fun autoDetectModuleVcsMapping(module: Module) {
if (vcsManager.haveDefaultMapping() != null) return
val newMappings = mutableListOf<VcsDirectoryMapping>()
for (file in module.rootManager.contentRoots) {
val vcs = vcsManager.findVersioningVcs(file)
if (vcs != null && vcs !== vcsManager.getVcsFor(file)) {
newMappings.add(VcsDirectoryMapping(file.path, vcs.name))
}
}
if (newMappings.isNotEmpty()) {
vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings)
}
}
private fun getMappings(module: Module): List<VcsDirectoryMapping> {
return module.rootManager.contentRoots
.mapNotNull { root -> vcsManager.directoryMappings.firstOrNull { it.directory == root.path } }
}
}
|
{
"pile_set_name": "Github"
}
|
package io.gitlab.arturbosch.detekt.generator.collection
import io.gitlab.arturbosch.detekt.api.DetektVisitor
import io.gitlab.arturbosch.detekt.generator.collection.exception.InvalidDocumentationException
import io.gitlab.arturbosch.detekt.rules.isOverride
import org.jetbrains.kotlin.psi.KtCallExpression
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtReferenceExpression
import org.jetbrains.kotlin.psi.KtSuperTypeList
import org.jetbrains.kotlin.psi.KtValueArgumentList
import org.jetbrains.kotlin.psi.psiUtil.containingClass
import org.jetbrains.kotlin.psi.psiUtil.referenceExpression
data class MultiRule(
val name: String,
val rules: List<String> = listOf()
) {
operator fun contains(ruleName: String) = ruleName in this.rules
}
private val multiRule = io.gitlab.arturbosch.detekt.api.MultiRule::class.simpleName ?: ""
class MultiRuleCollector : Collector<MultiRule> {
override val items = mutableListOf<MultiRule>()
override fun visit(file: KtFile) {
val visitor = MultiRuleVisitor()
file.accept(visitor)
if (visitor.containsMultiRule) {
items.add(visitor.getMultiRule())
}
}
}
class MultiRuleVisitor : DetektVisitor() {
val containsMultiRule
get() = classesMap.any { it.value }
private var classesMap = mutableMapOf<String, Boolean>()
private var name = ""
private val rulesVisitor = RuleListVisitor()
private val properties: MutableMap<String, String> = mutableMapOf()
fun getMultiRule(): MultiRule {
val rules = mutableListOf<String>()
val ruleProperties = rulesVisitor.ruleProperties
.mapNotNull { properties[it] }
rules.addAll(ruleProperties)
rules.addAll(rulesVisitor.ruleNames)
if (name.isEmpty()) {
throw InvalidDocumentationException("MultiRule without name found.")
}
if (rules.isEmpty()) {
throw InvalidDocumentationException("MultiRule $name contains no rules.")
}
return MultiRule(name, rules)
}
override fun visitSuperTypeList(list: KtSuperTypeList) {
val isMultiRule = list.entries
?.mapNotNull { it.typeAsUserType?.referencedName }
?.any { it == multiRule } ?: false
val containingClass = list.containingClass()
val className = containingClass?.name
if (containingClass != null && className != null && !classesMap.containsKey(className)) {
classesMap[className] = isMultiRule
}
super.visitSuperTypeList(list)
}
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
super.visitClassOrObject(classOrObject)
if (classesMap[classOrObject.name] != true) {
return
}
name = classOrObject.name?.trim() ?: ""
}
override fun visitProperty(property: KtProperty) {
super.visitProperty(property)
if (classesMap[property.containingClass()?.name] != true) {
return
}
if (property.isOverride() && property.name != null && property.name == "rules") {
property.accept(rulesVisitor)
} else {
val name = property.name
val initializer = property.initializer?.referenceExpression()?.text
if (name != null && initializer != null) {
properties[name] = initializer
}
}
}
}
class RuleListVisitor : DetektVisitor() {
var ruleNames: MutableSet<String> = mutableSetOf()
private set
var ruleProperties: MutableSet<String> = mutableSetOf()
private set
override fun visitValueArgumentList(list: KtValueArgumentList) {
super.visitValueArgumentList(list)
val argumentExpressions = list.arguments.map { it.getArgumentExpression() }
// Call Expression = Constructor of rule
ruleNames.addAll(argumentExpressions
.filterIsInstance<KtCallExpression>()
.map { it.calleeExpression?.text ?: "" })
// Reference Expression = variable we need to search for
ruleProperties.addAll(argumentExpressions
.filterIsInstance<KtReferenceExpression>()
.map { it.text ?: "" })
}
}
|
{
"pile_set_name": "Github"
}
|
package tk.woppo.sunday.model;
import android.database.Cursor;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.util.HashMap;
import tk.woppo.sunday.dao.WeatherDataHelper;
import tk.woppo.sunday.dao.WeatherTodayDataHelper;
/**
* Created by Ho on 2014/7/4.
*/
public class WeatherTodayModel extends BaseModel {
private static final HashMap<String, WeatherTodayModel> CACHE = new HashMap<String, WeatherTodayModel>();
/** 城市ID */
@SerializedName("cityid")
public String id;
/** 城市名称 */
@SerializedName("city")
public String cityName;
/** 温度 */
public String temp;
/** 天气 */
public String weather;
/** 风向 */
@SerializedName("WD")
public String wind;
/** 风力 */
@SerializedName("WS")
public String ws;
/** 湿度 */
@SerializedName("SD")
public String sd;
/** 发布时间 */
public String time;
private static void addToCache(WeatherTodayModel model) {
CACHE.put(model.id, model);
}
private static WeatherTodayModel getFromCache(String id) {
return CACHE.get(id);
}
public static WeatherTodayModel fromJson(String json) {
return new Gson().fromJson(json, WeatherTodayModel.class);
}
public static WeatherTodayModel fromCursor(Cursor cursor) {
String id = cursor.getString(cursor.getColumnIndex(WeatherDataHelper.WeatherDBInfo.ID));
WeatherTodayModel model = getFromCache(id);
if (model != null) {
return model;
}
model = new Gson().fromJson(cursor.getString(cursor.getColumnIndex(WeatherTodayDataHelper.WeatherTodayDBInfo.JSON)), WeatherTodayModel.class);
addToCache(model);
return model;
}
public static class WeatherTodayRequestData {
public WeatherTodayModel weatherinfo;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#import "SimpleDBMissingParameterException.h"
@implementation SimpleDBMissingParameterException
@synthesize boxUsage;
-(id)initWithMessage:(NSString *)theMessage
{
if (self = [super initWithMessage:theMessage]) {
}
return self;
}
-(void)setPropertiesWithException:(AmazonServiceException *)theException
{
[super setPropertiesWithException:theException];
if ([theException.additionalFields valueForKey:@"BoxUsage"] != nil) {
self.boxUsage = [AmazonSDKUtil convertStringToNumber:[theException.additionalFields valueForKey:@"BoxUsage"]];
}
}
-(NSString *)description
{
NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256];
[buffer appendString:@"{"];
[buffer appendString:[[[NSString alloc] initWithFormat:@"BoxUsage: %@,", boxUsage] autorelease]];
[buffer appendString:[super description]];
[buffer appendString:@"}"];
return [buffer autorelease];
}
-(void)dealloc
{
[boxUsage release];
[super dealloc];
}
@end
|
{
"pile_set_name": "Github"
}
|
package network
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// VpnSitesClient is the network Client
type VpnSitesClient struct {
BaseClient
}
// NewVpnSitesClient creates an instance of the VpnSitesClient client.
func NewVpnSitesClient(subscriptionID string) VpnSitesClient {
return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client.
func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient {
return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being created or updated.
// vpnSiteParameters - parameters supplied to create or update VpnSite.
func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithJSON(vpnSiteParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a VpnSite.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being deleted.
func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get retrieves the details of a VPNsite.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being retrieved.
func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSite, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Get")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists all the VpnSites in a subscription.
func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List")
defer func() {
sc := -1
if result.lvsr.Response.Response != nil {
sc = result.lvsr.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.lvsr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure sending request")
return
}
result.lvsr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client VpnSitesClient) listNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) {
req, err := lastResults.listVpnSitesResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client VpnSitesClient) ListComplete(ctx context.Context) (result ListVpnSitesResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List")
defer func() {
sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.page, err = client.List(ctx)
return
}
// ListByResourceGroup lists all the vpnSites in a resource group.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup")
defer func() {
sc := -1
if result.lvsr.Response.Response != nil {
sc = result.lvsr.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.lvsr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result.lvsr, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
func (client VpnSitesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) {
req, err := lastResults.listVpnSitesResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client VpnSitesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup")
defer func() {
sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
return
}
// UpdateTags updates VpnSite tags.
// Parameters:
// resourceGroupName - the resource group name of the VpnSite.
// vpnSiteName - the name of the VpnSite being updated.
// vpnSiteParameters - parameters supplied to update VpnSite tags.
func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (result VpnSitesUpdateTagsFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.UpdateTags")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure preparing request")
return
}
result, err = client.UpdateTagsSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", result.Response(), "Failure sending request")
return
}
return
}
// UpdateTagsPreparer prepares the UpdateTags request.
func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vpnSiteName": autorest.Encode("path", vpnSiteName),
}
const APIVersion = "2018-10-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters),
autorest.WithJSON(vpnSiteParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error.
func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSitesUpdateTagsFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateTagsResponder handles the response to the UpdateTags request. The method always
// closes the http.Response Body.
func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"Dinda",
"Dilolo"
],
"DAY": [
"Lumingu",
"Nkodya",
"Nd\u00e0ay\u00e0",
"Ndang\u00f9",
"Nj\u00f2wa",
"Ng\u00f2vya",
"Lubingu"
],
"MONTH": [
"Ciongo",
"L\u00f9ishi",
"Lus\u00f2lo",
"M\u00f9uy\u00e0",
"Lum\u00f9ng\u00f9l\u00f9",
"Lufuimi",
"Kab\u00e0l\u00e0sh\u00ecp\u00f9",
"L\u00f9sh\u00eck\u00e0",
"Lutongolo",
"Lung\u00f9di",
"Kasw\u00e8k\u00e8s\u00e8",
"Cisw\u00e0"
],
"SHORTDAY": [
"Lum",
"Nko",
"Ndy",
"Ndg",
"Njw",
"Ngv",
"Lub"
],
"SHORTMONTH": [
"Cio",
"Lui",
"Lus",
"Muu",
"Lum",
"Luf",
"Kab",
"Lush",
"Lut",
"Lun",
"Kas",
"Cis"
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "d/M/y HH:mm",
"shortDate": "d/M/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "FrCD",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a4",
"posPre": "",
"posSuf": "\u00a4"
}
]
},
"id": "lu-cd",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
package com.android.inputmethodcommon;
class InputMethodSettingsInterface {
}
class InputMethodSettingsImpl {
int mContext;
int mImi;
int mImm;
int mSubtypeEnablerIcon;
int mSubtypeEnablerIconRes;
int mSubtypeEnablerTitle;
int mSubtypeEnablerTitleRes;
int mInputMethodSettingsCategoryTitle;
int mInputMethodSettingsCategoryTitleRes;
int mSubtypeEnablerPreference;
}
class InputMethodSettingsFragment {
int mSettings;
}
class InputMethodSettingsActivity {
int mSettings;
}
|
{
"pile_set_name": "Github"
}
|
/*#######################################################
* Copyright (c) 2014 Jeff Martin
* Copyright (c) 2015 Pedro Lafuente
* Copyright (c) 2017-2019 Gregor Santner
*
* Licensed under the MIT license.
* You can get a copy of the license text here:
* https://opensource.org/licenses/MIT
###########################################################*/
package other.writeily.ui;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import net.gsantner.markor.R;
import net.gsantner.markor.util.AppSettings;
import java.io.Serializable;
public class WrConfirmDialog extends DialogFragment {
public static final String FRAGMENT_TAG = "WrConfirmDialog";
private static final String EXTRA_TITLE = "EXTRA_TITLE";
private static final String EXTRA_MESSAGE = "EXTRA_MESSAGE";
public static final String EXTRA_DATA = "EXTRA_DATA";
private Serializable _data;
private ConfirmDialogCallback[] _callbacks;
private String _summary;
public static WrConfirmDialog newInstance(String title, String message,
Serializable data, ConfirmDialogCallback... callbacks) {
WrConfirmDialog confirmDialog = new WrConfirmDialog();
Bundle args = new Bundle();
args.putSerializable(EXTRA_DATA, data);
args.putString(EXTRA_TITLE, title);
args.putString(EXTRA_MESSAGE, message);
confirmDialog.setArguments(args);
confirmDialog.setCallbacks(callbacks);
return confirmDialog;
}
public void setCallbacks(ConfirmDialogCallback[] callbacks) {
_callbacks = callbacks;
}
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
String title = getArguments().getString(EXTRA_TITLE);
String message = getArguments().getString(EXTRA_MESSAGE);
_data = getArguments().getSerializable(EXTRA_DATA);
AlertDialog.Builder dialogBuilder;
boolean darkTheme = AppSettings.get().isDarkThemeEnabled();
dialogBuilder = new AlertDialog.Builder(getActivity(), darkTheme ?
R.style.Theme_AppCompat_Dialog : R.style.Theme_AppCompat_Light_Dialog);
dialogBuilder.setTitle(title);
if (!TextUtils.isEmpty(message)) {
dialogBuilder.setMessage(message);
}
dialogBuilder.setPositiveButton(getString(android.R.string.ok), (dialog, which) -> {
if (_callbacks != null) {
for (ConfirmDialogCallback cdc : _callbacks) {
if (cdc != null) {
cdc.onConfirmDialogAnswer(true, _data);
}
}
}
});
dialogBuilder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> {
dialog.dismiss();
for (ConfirmDialogCallback cdc : _callbacks) {
cdc.onConfirmDialogAnswer(false, _data);
}
});
return dialogBuilder.show();
}
public interface ConfirmDialogCallback {
void onConfirmDialogAnswer(boolean confirmed, Serializable data);
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2004-present Facebook. All Rights Reserved.
#include "SamplingProfilerJniMethod.h"
#include <JavaScriptCore/JSProfilerPrivate.h>
#include <jschelpers/JSCHelpers.h>
#include <jni.h>
#include <string>
using namespace facebook::jni;
namespace facebook {
namespace react {
/* static */ jni::local_ref<SamplingProfilerJniMethod::jhybriddata>
SamplingProfilerJniMethod::initHybrid(jni::alias_ref<jclass>,
jlong javaScriptContext) {
return makeCxxInstance(javaScriptContext);
}
/* static */ void SamplingProfilerJniMethod::registerNatives() {
registerHybrid(
{makeNativeMethod("initHybrid", SamplingProfilerJniMethod::initHybrid),
makeNativeMethod("poke", SamplingProfilerJniMethod::poke)});
}
SamplingProfilerJniMethod::SamplingProfilerJniMethod(jlong javaScriptContext) {
context_ = reinterpret_cast<JSGlobalContextRef>(javaScriptContext);
}
void SamplingProfilerJniMethod::poke(
jni::alias_ref<JSPackagerClientResponder::javaobject> responder) {
if (!JSC_JSSamplingProfilerEnabled(context_)) {
responder->error("The JSSamplingProfiler is disabled. See this "
"https://fburl.com/u4lw7xeq for some help");
return;
}
JSValueRef jsResult = JSC_JSPokeSamplingProfiler(context_);
if (JSC_JSValueGetType(context_, jsResult) == kJSTypeNull) {
responder->respond("started");
} else {
JSStringRef resultStrRef = JSValueToStringCopy(context_, jsResult, nullptr);
size_t length = JSStringGetLength(resultStrRef);
char buffer[length + 1];
JSStringGetUTF8CString(resultStrRef, buffer, length + 1);
JSStringRelease(resultStrRef);
responder->respond(buffer);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
def extractStartlingSurprisesAtEveryStep(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'bu bu jing xin' in item['tags']:
return buildReleaseMessageWithType(item, 'Bu Bu Jing Xin', vol, chp, frag=frag, postfix=postfix)
return False
|
{
"pile_set_name": "Github"
}
|
'use strict';
var dbm;
var type;
var seed;
/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};
exports.up = function (db) {
return Promise.all([
db.runSql('UPDATE office SET name = \'Office of Brazil and Southern Cone (WHA/BSC)\' where name=\'Office of Brail and Southern Cone (WHA/BSC)\''),
db.runSql('UPDATE office SET name = \'U.S. Embassy La Paz\' where name=\'U.S. Embassy LaPaz\''),
]);
};
exports.down = function (db) {
return Promise.all([
db.runSql('UPDATE office SET name = \'Office of Brail and Southern Cone (WHA/BSC)\' where name=\'Office of Brazil and Southern Cone (WHA/BSC)\''),
db.runSql('UPDATE office SET name = \'U.S. Embassy LaPaz\' where name=\'U.S. Embassy La Paz\''),
]);
};
|
{
"pile_set_name": "Github"
}
|
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
mojom = "//url/mojo/url.mojom"
public_headers = [ "//url/gurl.h" ]
traits_headers = [ "//url/mojo/url_gurl_struct_traits.h" ]
deps = [
"//url",
]
type_mappings = [ "url.mojom.Url=GURL" ]
|
{
"pile_set_name": "Github"
}
|
package org.basex.query.func.validate;
import org.basex.query.*;
import org.basex.query.func.*;
import org.basex.query.value.item.*;
import org.basex.util.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-20, BSD License
* @author Christian Gruen
*/
public final class ValidateXsdProcessor extends StandardFunc {
@Override
public Item item(final QueryContext qc, final InputInfo ii) {
return Str.get(ValidateXsd.IMPL[ValidateXsd.OFFSET + 1]);
}
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -emit-llvm -triple i386-apple-macosx10.7.2 < %s | FileCheck %s
// The preferred alignment for a long long on x86-32 is 8; make sure the
// alloca for x uses that alignment.
int test (long long x) {
return (int)x;
}
// CHECK-LABEL: define i32 @test
// CHECK: alloca i64, align 8
// Make sure we honor the aligned attribute.
struct X { int x,y,z,a; };
int test2(struct X x __attribute((aligned(16)))) {
return x.z;
}
// CHECK-LABEL: define i32 @test2
// CHECK: alloca %struct._Z1X, align 16
|
{
"pile_set_name": "Github"
}
|
export const environment = {
production: true
};
|
{
"pile_set_name": "Github"
}
|
import { Component, Inject, Input } from '@angular/core';
import { MediaObserver } from '@angular/flex-layout';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { API_BASE_URL } from '../../app.tokens';
import { Product } from '../../shared/services';
@Component({
selector: 'nga-product-suggestion',
styleUrls: [ './product-suggestion.component.scss' ],
templateUrl: './product-suggestion.component.html'
})
export class ProductSuggestionComponent {
@Input() products: Product[];
readonly columns$: Observable<number>;
readonly breakpointsToColumnsNumber = new Map([
[ 'xs', 2 ],
[ 'sm', 3 ],
[ 'md', 5 ],
[ 'lg', 2 ],
[ 'xl', 3 ],
]);
constructor(
@Inject(API_BASE_URL) private readonly baseUrl: string,
private readonly media: MediaObserver
) {
// If the initial screen size is xs ObservableMedia doesn't emit an event
// In the older versions of flex-layout we used ObservableMedia, which is deprecated.
// Use MediaObserver instead
this.columns$ = this.media.media$
.pipe(
map(mc => <number>this.breakpointsToColumnsNumber.get(mc.mqAlias)),
startWith(3)
);
}
urlFor(product: Product): string {
return `${this.baseUrl}/${product.imageUrl}`;
}
}
|
{
"pile_set_name": "Github"
}
|
package org.jetbrains.dokka.base.transformers.documentables
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
import org.jetbrains.dokka.transformers.documentation.perPackageOptions
import org.jetbrains.dokka.transformers.documentation.source
import org.jetbrains.dokka.transformers.documentation.sourceSet
import java.io.File
class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer {
override fun invoke(modules: List<DModule>): List<DModule> {
return modules.mapNotNull(::filterModule)
}
private fun filterModule(module: DModule): DModule? {
val packages = module.packages.mapNotNull { pkg -> filterPackage(pkg) }
return when {
packages == module.packages -> module
packages.isEmpty() -> null
else -> module.copy(packages = packages)
}
}
private fun filterPackage(pkg: DPackage): DPackage? {
val options = perPackageOptions(pkg)
if (options?.suppress == true) {
return null
}
val filteredChildren = pkg.children.filterNot(::isSuppressed)
return when {
filteredChildren == pkg.children -> pkg
filteredChildren.isEmpty() -> null
else -> pkg.copy(
functions = filteredChildren.filterIsInstance<DFunction>(),
classlikes = filteredChildren.filterIsInstance<DClasslike>(),
typealiases = filteredChildren.filterIsInstance<DTypeAlias>(),
properties = filteredChildren.filterIsInstance<DProperty>()
)
}
}
private fun isSuppressed(documentable: Documentable): Boolean {
if (documentable !is WithSources) return false
val sourceFile = File(source(documentable).path).absoluteFile
return sourceSet(documentable).suppressedFiles.any { suppressedFile ->
sourceFile.startsWith(suppressedFile.absoluteFile)
}
}
}
|
{
"pile_set_name": "Github"
}
|
if (global.GENTLY) require = GENTLY.hijack(require);
var crypto = require('crypto');
var fs = require('fs');
var util = require('util'),
path = require('path'),
File = require('./file'),
MultipartParser = require('./multipart_parser').MultipartParser,
QuerystringParser = require('./querystring_parser').QuerystringParser,
OctetParser = require('./octet_parser').OctetParser,
JSONParser = require('./json_parser').JSONParser,
StringDecoder = require('string_decoder').StringDecoder,
EventEmitter = require('events').EventEmitter,
Stream = require('stream').Stream,
os = require('os');
function IncomingForm(opts) {
if (!(this instanceof IncomingForm)) return new IncomingForm(opts);
EventEmitter.call(this);
opts=opts||{};
this.error = null;
this.ended = false;
this.maxFields = opts.maxFields || 1000;
this.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024;
this.keepExtensions = opts.keepExtensions || false;
this.uploadDir = opts.uploadDir || os.tmpDir();
this.encoding = opts.encoding || 'utf-8';
this.headers = null;
this.type = null;
this.hash = opts.hash || false;
this.multiples = opts.multiples || false;
this.bytesReceived = null;
this.bytesExpected = null;
this._parser = null;
this._flushing = 0;
this._fieldsSize = 0;
this.openedFiles = [];
return this;
}
util.inherits(IncomingForm, EventEmitter);
exports.IncomingForm = IncomingForm;
IncomingForm.prototype.parse = function(req, cb) {
this.pause = function() {
try {
req.pause();
} catch (err) {
// the stream was destroyed
if (!this.ended) {
// before it was completed, crash & burn
this._error(err);
}
return false;
}
return true;
};
this.resume = function() {
try {
req.resume();
} catch (err) {
// the stream was destroyed
if (!this.ended) {
// before it was completed, crash & burn
this._error(err);
}
return false;
}
return true;
};
// Setup callback first, so we don't miss anything from data events emitted
// immediately.
if (cb) {
var fields = {}, files = {};
this
.on('field', function(name, value) {
fields[name] = value;
})
.on('file', function(name, file) {
if (this.multiples) {
if (files[name]) {
if (!Array.isArray(files[name])) {
files[name] = [files[name]];
}
files[name].push(file);
} else {
files[name] = file;
}
} else {
files[name] = file;
}
})
.on('error', function(err) {
cb(err, fields, files);
})
.on('end', function() {
cb(null, fields, files);
});
}
// Parse headers and setup the parser, ready to start listening for data.
this.writeHeaders(req.headers);
// Start listening for data.
var self = this;
req
.on('error', function(err) {
self._error(err);
})
.on('aborted', function() {
self.emit('aborted');
self._error(new Error('Request aborted'));
})
.on('data', function(buffer) {
self.write(buffer);
})
.on('end', function() {
if (self.error) {
return;
}
var err = self._parser.end();
if (err) {
self._error(err);
}
});
return this;
};
IncomingForm.prototype.writeHeaders = function(headers) {
this.headers = headers;
this._parseContentLength();
this._parseContentType();
};
IncomingForm.prototype.write = function(buffer) {
if (this.error) {
return;
}
if (!this._parser) {
this._error(new Error('uninitialized parser'));
return;
}
this.bytesReceived += buffer.length;
this.emit('progress', this.bytesReceived, this.bytesExpected);
var bytesParsed = this._parser.write(buffer);
if (bytesParsed !== buffer.length) {
this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed'));
}
return bytesParsed;
};
IncomingForm.prototype.pause = function() {
// this does nothing, unless overwritten in IncomingForm.parse
return false;
};
IncomingForm.prototype.resume = function() {
// this does nothing, unless overwritten in IncomingForm.parse
return false;
};
IncomingForm.prototype.onPart = function(part) {
// this method can be overwritten by the user
this.handlePart(part);
};
IncomingForm.prototype.handlePart = function(part) {
var self = this;
if (part.filename === undefined) {
var value = ''
, decoder = new StringDecoder(this.encoding);
part.on('data', function(buffer) {
self._fieldsSize += buffer.length;
if (self._fieldsSize > self.maxFieldsSize) {
self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data'));
return;
}
value += decoder.write(buffer);
});
part.on('end', function() {
self.emit('field', part.name, value);
});
return;
}
this._flushing++;
var file = new File({
path: this._uploadPath(part.filename),
name: part.filename,
type: part.mime,
hash: self.hash
});
this.emit('fileBegin', part.name, file);
file.open();
this.openedFiles.push(file);
part.on('data', function(buffer) {
if (buffer.length == 0) {
return;
}
self.pause();
file.write(buffer, function() {
self.resume();
});
});
part.on('end', function() {
file.end(function() {
self._flushing--;
self.emit('file', part.name, file);
self._maybeEnd();
});
});
};
function dummyParser(self) {
return {
end: function () {
self.ended = true;
self._maybeEnd();
return null;
}
};
}
IncomingForm.prototype._parseContentType = function() {
if (this.bytesExpected === 0) {
this._parser = dummyParser(this);
return;
}
if (!this.headers['content-type']) {
this._error(new Error('bad content-type header, no content-type'));
return;
}
if (this.headers['content-type'].match(/octet-stream/i)) {
this._initOctetStream();
return;
}
if (this.headers['content-type'].match(/urlencoded/i)) {
this._initUrlencoded();
return;
}
if (this.headers['content-type'].match(/multipart/i)) {
var m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i);
if (m) {
this._initMultipart(m[1] || m[2]);
} else {
this._error(new Error('bad content-type header, no multipart boundary'));
}
return;
}
if (this.headers['content-type'].match(/json/i)) {
this._initJSONencoded();
return;
}
this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type']));
};
IncomingForm.prototype._error = function(err) {
if (this.error || this.ended) {
return;
}
this.error = err;
this.emit('error', err);
if (Array.isArray(this.openedFiles)) {
this.openedFiles.forEach(function(file) {
file._writeStream.destroy();
setTimeout(fs.unlink, 0, file.path, function(error) { });
});
}
};
IncomingForm.prototype._parseContentLength = function() {
this.bytesReceived = 0;
if (this.headers['content-length']) {
this.bytesExpected = parseInt(this.headers['content-length'], 10);
} else if (this.headers['transfer-encoding'] === undefined) {
this.bytesExpected = 0;
}
if (this.bytesExpected !== null) {
this.emit('progress', this.bytesReceived, this.bytesExpected);
}
};
IncomingForm.prototype._newParser = function() {
return new MultipartParser();
};
IncomingForm.prototype._initMultipart = function(boundary) {
this.type = 'multipart';
var parser = new MultipartParser(),
self = this,
headerField,
headerValue,
part;
parser.initWithBoundary(boundary);
parser.onPartBegin = function() {
part = new Stream();
part.readable = true;
part.headers = {};
part.name = null;
part.filename = null;
part.mime = null;
part.transferEncoding = 'binary';
part.transferBuffer = '';
headerField = '';
headerValue = '';
};
parser.onHeaderField = function(b, start, end) {
headerField += b.toString(self.encoding, start, end);
};
parser.onHeaderValue = function(b, start, end) {
headerValue += b.toString(self.encoding, start, end);
};
parser.onHeaderEnd = function() {
headerField = headerField.toLowerCase();
part.headers[headerField] = headerValue;
var m = headerValue.match(/\bname="([^"]+)"/i);
if (headerField == 'content-disposition') {
if (m) {
part.name = m[1];
}
part.filename = self._fileName(headerValue);
} else if (headerField == 'content-type') {
part.mime = headerValue;
} else if (headerField == 'content-transfer-encoding') {
part.transferEncoding = headerValue.toLowerCase();
}
headerField = '';
headerValue = '';
};
parser.onHeadersEnd = function() {
switch(part.transferEncoding){
case 'binary':
case '7bit':
case '8bit':
parser.onPartData = function(b, start, end) {
part.emit('data', b.slice(start, end));
};
parser.onPartEnd = function() {
part.emit('end');
};
break;
case 'base64':
parser.onPartData = function(b, start, end) {
part.transferBuffer += b.slice(start, end).toString('ascii');
/*
four bytes (chars) in base64 converts to three bytes in binary
encoding. So we should always work with a number of bytes that
can be divided by 4, it will result in a number of buytes that
can be divided vy 3.
*/
var offset = parseInt(part.transferBuffer.length / 4, 10) * 4;
part.emit('data', new Buffer(part.transferBuffer.substring(0, offset), 'base64'));
part.transferBuffer = part.transferBuffer.substring(offset);
};
parser.onPartEnd = function() {
part.emit('data', new Buffer(part.transferBuffer, 'base64'));
part.emit('end');
};
break;
default:
return self._error(new Error('unknown transfer-encoding'));
}
self.onPart(part);
};
parser.onEnd = function() {
self.ended = true;
self._maybeEnd();
};
this._parser = parser;
};
IncomingForm.prototype._fileName = function(headerValue) {
var m = headerValue.match(/\bfilename="(.*?)"($|; )/i);
if (!m) return;
var filename = m[1].substr(m[1].lastIndexOf('\\') + 1);
filename = filename.replace(/%22/g, '"');
filename = filename.replace(/&#([\d]{4});/g, function(m, code) {
return String.fromCharCode(code);
});
return filename;
};
IncomingForm.prototype._initUrlencoded = function() {
this.type = 'urlencoded';
var parser = new QuerystringParser(this.maxFields)
, self = this;
parser.onField = function(key, val) {
self.emit('field', key, val);
};
parser.onEnd = function() {
self.ended = true;
self._maybeEnd();
};
this._parser = parser;
};
IncomingForm.prototype._initOctetStream = function() {
this.type = 'octet-stream';
var filename = this.headers['x-file-name'];
var mime = this.headers['content-type'];
var file = new File({
path: this._uploadPath(filename),
name: filename,
type: mime
});
this.emit('fileBegin', filename, file);
file.open();
this._flushing++;
var self = this;
self._parser = new OctetParser();
//Keep track of writes that haven't finished so we don't emit the file before it's done being written
var outstandingWrites = 0;
self._parser.on('data', function(buffer){
self.pause();
outstandingWrites++;
file.write(buffer, function() {
outstandingWrites--;
self.resume();
if(self.ended){
self._parser.emit('doneWritingFile');
}
});
});
self._parser.on('end', function(){
self._flushing--;
self.ended = true;
var done = function(){
file.end(function() {
self.emit('file', 'file', file);
self._maybeEnd();
});
};
if(outstandingWrites === 0){
done();
} else {
self._parser.once('doneWritingFile', done);
}
});
};
IncomingForm.prototype._initJSONencoded = function() {
this.type = 'json';
var parser = new JSONParser()
, self = this;
if (this.bytesExpected) {
parser.initWithLength(this.bytesExpected);
}
parser.onField = function(key, val) {
self.emit('field', key, val);
};
parser.onEnd = function() {
self.ended = true;
self._maybeEnd();
};
this._parser = parser;
};
IncomingForm.prototype._uploadPath = function(filename) {
var name = 'upload_';
var buf = crypto.randomBytes(16);
for (var i = 0; i < buf.length; ++i) {
name += ('0' + buf[i].toString(16)).slice(-2);
}
if (this.keepExtensions) {
var ext = path.extname(filename);
ext = ext.replace(/(\.[a-z0-9]+).*/i, '$1');
name += ext;
}
return path.join(this.uploadDir, name);
};
IncomingForm.prototype._maybeEnd = function() {
if (!this.ended || this._flushing || this.error) {
return;
}
this.emit('end');
};
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_REF_H
#define EIGEN_REF_H
namespace Eigen {
template<typename Derived> class RefBase;
template<typename PlainObjectType, int Options = 0,
typename StrideType = typename internal::conditional<PlainObjectType::IsVectorAtCompileTime,InnerStride<1>,OuterStride<> >::type > class Ref;
/** \class Ref
* \ingroup Core_Module
*
* \brief A matrix or vector expression mapping an existing expressions
*
* \tparam PlainObjectType the equivalent matrix type of the mapped data
* \tparam Options specifies whether the pointer is \c #Aligned, or \c #Unaligned.
* The default is \c #Unaligned.
* \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1),
* but accept a variable outer stride (leading dimension).
* This can be overridden by specifying strides.
* The type passed here must be a specialization of the Stride template, see examples below.
*
* This class permits to write non template functions taking Eigen's object as parameters while limiting the number of copies.
* A Ref<> object can represent either a const expression or a l-value:
* \code
* // in-out argument:
* void foo1(Ref<VectorXf> x);
*
* // read-only const argument:
* void foo2(const Ref<const VectorXf>& x);
* \endcode
*
* In the in-out case, the input argument must satisfies the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered.
* By default, a Ref<VectorXf> can reference any dense vector expression of float having a contiguous memory layout.
* Likewise, a Ref<MatrixXf> can reference any column major dense matrix expression of float whose column's elements are contiguously stored with
* the possibility to have a constant space inbetween each column, i.e.: the inner stride mmust be equal to 1, but the outer-stride (or leading dimension),
* can be greater than the number of rows.
*
* In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function.
* Here are some examples:
* \code
* MatrixXf A;
* VectorXf a;
* foo1(a.head()); // OK
* foo1(A.col()); // OK
* foo1(A.row()); // compilation error because here innerstride!=1
* foo2(A.row()); // The row is copied into a contiguous temporary
* foo2(2*a); // The expression is evaluated into a temporary
* foo2(A.col().segment(2,4)); // No temporary
* \endcode
*
* The range of inputs that can be referenced without temporary can be enlarged using the last two template parameter.
* Here is an example accepting an innerstride!=1:
* \code
* // in-out argument:
* void foo3(Ref<VectorXf,0,InnerStride<> > x);
* foo3(A.row()); // OK
* \endcode
* The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involved more
* expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overloads internally calling a
* template function, e.g.:
* \code
* // in the .h:
* void foo(const Ref<MatrixXf>& A);
* void foo(const Ref<MatrixXf,0,Stride<> >& A);
*
* // in the .cpp:
* template<typename TypeOfA> void foo_impl(const TypeOfA& A) {
* ... // crazy code goes here
* }
* void foo(const Ref<MatrixXf>& A) { foo_impl(A); }
* void foo(const Ref<MatrixXf,0,Stride<> >& A) { foo_impl(A); }
* \endcode
*
*
* \sa PlainObjectBase::Map(), \ref TopicStorageOrders
*/
namespace internal {
template<typename _PlainObjectType, int _Options, typename _StrideType>
struct traits<Ref<_PlainObjectType, _Options, _StrideType> >
: public traits<Map<_PlainObjectType, _Options, _StrideType> >
{
typedef _PlainObjectType PlainObjectType;
typedef _StrideType StrideType;
enum {
Options = _Options,
Flags = traits<Map<_PlainObjectType, _Options, _StrideType> >::Flags | NestByRefBit
};
template<typename Derived> struct match {
enum {
HasDirectAccess = internal::has_direct_access<Derived>::ret,
StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)),
InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic)
|| int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime)
|| (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1),
OuterStrideMatch = Derived::IsVectorAtCompileTime
|| int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime),
AlignmentMatch = (_Options!=Aligned) || ((PlainObjectType::Flags&AlignedBit)==0) || ((traits<Derived>::Flags&AlignedBit)==AlignedBit),
MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch
};
typedef typename internal::conditional<MatchAtCompileTime,internal::true_type,internal::false_type>::type type;
};
};
template<typename Derived>
struct traits<RefBase<Derived> > : public traits<Derived> {};
}
template<typename Derived> class RefBase
: public MapBase<Derived>
{
typedef typename internal::traits<Derived>::PlainObjectType PlainObjectType;
typedef typename internal::traits<Derived>::StrideType StrideType;
public:
typedef MapBase<Derived> Base;
EIGEN_DENSE_PUBLIC_INTERFACE(RefBase)
inline Index innerStride() const
{
return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
}
inline Index outerStride() const
{
return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
: IsVectorAtCompileTime ? this->size()
: int(Flags)&RowMajorBit ? this->cols()
: this->rows();
}
RefBase()
: Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime),
// Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values:
m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime,
StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime)
{}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase)
protected:
typedef Stride<StrideType::OuterStrideAtCompileTime,StrideType::InnerStrideAtCompileTime> StrideBase;
template<typename Expression>
void construct(Expression& expr)
{
if(PlainObjectType::RowsAtCompileTime==1)
{
eigen_assert(expr.rows()==1 || expr.cols()==1);
::new (static_cast<Base*>(this)) Base(expr.data(), 1, expr.size());
}
else if(PlainObjectType::ColsAtCompileTime==1)
{
eigen_assert(expr.rows()==1 || expr.cols()==1);
::new (static_cast<Base*>(this)) Base(expr.data(), expr.size(), 1);
}
else
::new (static_cast<Base*>(this)) Base(expr.data(), expr.rows(), expr.cols());
::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(),
StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
}
StrideBase m_stride;
};
template<typename PlainObjectType, int Options, typename StrideType> class Ref
: public RefBase<Ref<PlainObjectType, Options, StrideType> >
{
typedef internal::traits<Ref> Traits;
public:
typedef RefBase<Ref> Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename Derived>
inline Ref(PlainObjectBase<Derived>& expr,
typename internal::enable_if<bool(Traits::template match<Derived>::MatchAtCompileTime),Derived>::type* = 0)
{
Base::construct(expr);
}
template<typename Derived>
inline Ref(const DenseBase<Derived>& expr,
typename internal::enable_if<bool(internal::is_lvalue<Derived>::value&&bool(Traits::template match<Derived>::MatchAtCompileTime)),Derived>::type* = 0,
int = Derived::ThisConstantIsPrivateInPlainObjectBase)
#else
template<typename Derived>
inline Ref(DenseBase<Derived>& expr)
#endif
{
Base::construct(expr.const_cast_derived());
}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref)
};
// this is the const ref version
template<typename TPlainObjectType, int Options, typename StrideType> class Ref<const TPlainObjectType, Options, StrideType>
: public RefBase<Ref<const TPlainObjectType, Options, StrideType> >
{
typedef internal::traits<Ref> Traits;
public:
typedef RefBase<Ref> Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
template<typename Derived>
inline Ref(const DenseBase<Derived>& expr)
{
// std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << "," << match_helper<Derived>::InnerStrideMatch << "\n";
// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n";
// std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n";
construct(expr.derived(), typename Traits::template match<Derived>::type());
}
protected:
template<typename Expression>
void construct(const Expression& expr,internal::true_type)
{
Base::construct(expr);
}
template<typename Expression>
void construct(const Expression& expr, internal::false_type)
{
m_object.lazyAssign(expr);
Base::construct(m_object);
}
protected:
TPlainObjectType m_object;
};
} // end namespace Eigen
#endif // EIGEN_REF_H
|
{
"pile_set_name": "Github"
}
|
<import src="../../../common/head.wxml"/>
<import src="../../../common/foot.wxml"/>
<view class="container">
<template is="head" data="{{title: 'sendMessage'}}"/>
<view class="page-body">
<view class="weui-cells__title">发送内容(以下字段可自由适配)</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">实例字段</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入"></input>
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">实例字段</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入"></input>
</view>
</view>
</view>
<view class="weui-cells">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">跳转链接</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" type="text" placeholder="请输入" value="{{shareData.path}}"></input>
</view>
</view>
</view>
<view class="btn-area">
<button type="primary">发送模板消息</button>
</view>
</view>
<template is="foot"/>
</view>
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2005-2006 The Trustees of Indiana University.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Authors: Douglas Gregor
// Andrew Lumsdaine
#ifndef BOOST_GRAPH_DETAIL_REMOTE_UPDATE_SET_HPP
#define BOOST_GRAPH_DETAIL_REMOTE_UPDATE_SET_HPP
#ifndef BOOST_GRAPH_USE_MPI
#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
#endif
#include <boost/graph/parallel/process_group.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <vector>
#include <boost/assert.hpp>
#include <boost/optional.hpp>
#include <queue>
namespace boost { namespace graph { namespace detail {
template<typename ProcessGroup>
void do_synchronize(ProcessGroup& pg)
{
using boost::parallel::synchronize;
synchronize(pg);
}
struct remote_set_queued {};
struct remote_set_immediate {};
template<typename ProcessGroup>
class remote_set_semantics
{
BOOST_STATIC_CONSTANT
(bool,
queued = (is_convertible<
typename ProcessGroup::communication_category,
boost::parallel::bsp_process_group_tag>::value));
public:
typedef typename mpl::if_c<queued,
remote_set_queued,
remote_set_immediate>::type type;
};
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap,
typename Semantics = typename remote_set_semantics<ProcessGroup>::type>
class remote_update_set;
/**********************************************************************
* Remote updating set that queues messages until synchronization *
**********************************************************************/
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap>
class remote_update_set<Derived, ProcessGroup, Value, OwnerMap,
remote_set_queued>
{
typedef typename property_traits<OwnerMap>::key_type Key;
typedef std::vector<std::pair<Key, Value> > Updates;
typedef typename Updates::size_type updates_size_type;
typedef typename Updates::value_type updates_pair_type;
public:
private:
typedef typename ProcessGroup::process_id_type process_id_type;
enum message_kind {
/** Message containing the number of updates that will be sent in
* a msg_updates message that will immediately follow. This
* message will contain a single value of type
* updates_size_type.
*/
msg_num_updates,
/** Contains (key, value) pairs with all of the updates from a
* particular source. The number of updates is variable, but will
* be provided in a msg_num_updates message that immediately
* preceeds this message.
*
*/
msg_updates
};
struct handle_messages
{
explicit
handle_messages(remote_update_set* self, const ProcessGroup& pg)
: self(self), update_sizes(num_processes(pg), 0) { }
void operator()(process_id_type source, int tag)
{
switch(tag) {
case msg_num_updates:
{
// Receive the # of updates
updates_size_type num_updates;
receive(self->process_group, source, tag, num_updates);
update_sizes[source] = num_updates;
}
break;
case msg_updates:
{
updates_size_type num_updates = update_sizes[source];
BOOST_ASSERT(num_updates);
// Receive the actual updates
std::vector<updates_pair_type> updates(num_updates);
receive(self->process_group, source, msg_updates, &updates[0],
num_updates);
// Send updates to derived "receive_update" member
Derived* derived = static_cast<Derived*>(self);
for (updates_size_type u = 0; u < num_updates; ++u)
derived->receive_update(source, updates[u].first, updates[u].second);
update_sizes[source] = 0;
}
break;
};
}
private:
remote_update_set* self;
std::vector<updates_size_type> update_sizes;
};
friend struct handle_messages;
protected:
remote_update_set(const ProcessGroup& pg, const OwnerMap& owner)
: process_group(pg, handle_messages(this, pg)),
updates(num_processes(pg)), owner(owner) {
}
void update(const Key& key, const Value& value)
{
if (get(owner, key) == process_id(process_group)) {
Derived* derived = static_cast<Derived*>(this);
derived->receive_update(get(owner, key), key, value);
}
else {
updates[get(owner, key)].push_back(std::make_pair(key, value));
}
}
void collect() { }
void synchronize()
{
// Emit all updates and then remove them
process_id_type num_processes = updates.size();
for (process_id_type p = 0; p < num_processes; ++p) {
if (!updates[p].empty()) {
send(process_group, p, msg_num_updates, updates[p].size());
send(process_group, p, msg_updates,
&updates[p].front(), updates[p].size());
updates[p].clear();
}
}
do_synchronize(process_group);
}
ProcessGroup process_group;
private:
std::vector<Updates> updates;
OwnerMap owner;
};
/**********************************************************************
* Remote updating set that sends messages immediately *
**********************************************************************/
template<typename Derived, typename ProcessGroup, typename Value,
typename OwnerMap>
class remote_update_set<Derived, ProcessGroup, Value, OwnerMap,
remote_set_immediate>
{
typedef typename property_traits<OwnerMap>::key_type Key;
typedef std::pair<Key, Value> update_pair_type;
typedef typename std::vector<update_pair_type>::size_type updates_size_type;
public:
typedef typename ProcessGroup::process_id_type process_id_type;
private:
enum message_kind {
/** Contains a (key, value) pair that will be updated. */
msg_update
};
struct handle_messages
{
explicit handle_messages(remote_update_set* self, const ProcessGroup& pg)
: self(self)
{ update_sizes.resize(num_processes(pg), 0); }
void operator()(process_id_type source, int tag)
{
// Receive the # of updates
BOOST_ASSERT(tag == msg_update);
update_pair_type update;
receive(self->process_group, source, tag, update);
// Send update to derived "receive_update" member
Derived* derived = static_cast<Derived*>(self);
derived->receive_update(source, update.first, update.second);
}
private:
std::vector<updates_size_type> update_sizes;
remote_update_set* self;
};
friend struct handle_messages;
protected:
remote_update_set(const ProcessGroup& pg, const OwnerMap& owner)
: process_group(pg, handle_messages(this, pg)), owner(owner) { }
void update(const Key& key, const Value& value)
{
if (get(owner, key) == process_id(process_group)) {
Derived* derived = static_cast<Derived*>(this);
derived->receive_update(get(owner, key), key, value);
}
else
send(process_group, get(owner, key), msg_update,
update_pair_type(key, value));
}
void collect()
{
typedef std::pair<process_id_type, int> probe_type;
handle_messages handler(this, process_group);
while (optional<probe_type> stp = probe(process_group))
if (stp->second == msg_update) handler(stp->first, stp->second);
}
void synchronize()
{
do_synchronize(process_group);
}
ProcessGroup process_group;
OwnerMap owner;
};
} } } // end namespace boost::graph::detail
#endif // BOOST_GRAPH_DETAIL_REMOTE_UPDATE_SET_HPP
|
{
"pile_set_name": "Github"
}
|
package com.tencent.mm.ui.chatting;
import android.view.View;
import android.view.ViewStub;
import android.view.animation.AnimationUtils;
import android.widget.ListView;
import com.tencent.mm.e.a.nq;
import com.tencent.mm.plugin.sight.encode.ui.ChattingSightContainerView.a;
import com.tencent.mm.sdk.c.a;
import com.tencent.mm.sdk.platformtools.ac;
import com.tencent.mm.ui.j;
import com.tencent.mm.ui.o;
final class ChattingUI$a$84$2
implements ChattingSightContainerView.a
{
View lBB = null;
ChattingUI$a$84$2(ChattingUI.a.84 param84) {}
public final void azd()
{
nq localnq = new nq();
avS.type = 6;
a.kug.y(localnq);
lBA.lAY.setRequestedOrientation(1);
lBA.lAY.Xk();
lBA.lAY.bkT();
lBA.lAY.blj();
if (lBB == null) {
lBB = ((ViewStub)lBA.lAY.findViewById(2131755932)).inflate();
}
lBB.setVisibility(0);
lBB.startAnimation(AnimationUtils.loadAnimation(lBA.lAY.kNN.kOg, 2130968612));
}
public final void onHide()
{
lBA.lAY.setRequestedOrientation(-1);
lBA.lAY.bkT();
if ((lBB != null) && (lBB.getVisibility() == 0))
{
lBB.setVisibility(8);
lBB.startAnimation(AnimationUtils.loadAnimation(lBA.lAY.kNN.kOg, 2130968613));
}
new ac().post(new Runnable()
{
public final void run()
{
nq localnq = new nq();
avS.type = 7;
avS.avT = ChattingUI.a.e(lBA.lAY).getFirstVisiblePosition();
avS.avU = ChattingUI.a.e(lBA.lAY).getLastVisiblePosition();
avS.avV = ChattingUI.a.e(lBA.lAY).getHeaderViewsCount();
a.kug.y(localnq);
}
});
}
}
/* Location:
* Qualified Name: com.tencent.mm.ui.chatting.ChattingUI.a.84.2
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
{
"pile_set_name": "Github"
}
|
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX ns: <http://example.org/ns#>
SELECT ?title ?price
{ ?x ns:price ?p .
?x ns:discount ?discount
BIND (?p*(1-?discount) AS ?price)
FILTER(?price < 20)
?x dc:title ?title .
}
|
{
"pile_set_name": "Github"
}
|
/*
* TupleTypeUtil.java
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2015-2019 Apple Inc. and the FoundationDB project authors
*
* 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 com.apple.foundationdb.record.metadata;
import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion;
import com.apple.foundationdb.tuple.Tuple;
import com.google.protobuf.ByteString;
import com.google.protobuf.Descriptors;
import com.google.protobuf.ProtocolMessageEnum;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* Utility class for dealing with {@link Tuple} types. In theory, these methods should live in
* {@link com.apple.foundationdb.tuple.TupleHelpers TupleHelpers} except that they use some Protobuf specific things
* like the {@link ByteString} class, and {@code TupleHelpers} is defined in the
* <a href="https://javadoc.io/doc/org.foundationdb/fdb-extensions/">fdb-extensions</a> sub-project
* which does not (and probably should not) take Protobuf as a dependency.
*/
class TupleTypeUtil {
@Nonnull
private static final BigInteger BIG_INT_MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
@Nonnull
private static final BigInteger BIG_INT_MIN_LONG = BigInteger.valueOf(Long.MIN_VALUE);
/**
* Normalize a list of values so that it can be checked for equality with other lists sharing
* the same {@link Tuple} representation. In other words, it should be the case that:
*
* <pre> {@code
* toTupleEquivalentValue(list1).equals(toTupleEquivalentValue)
* == Arrays.equals(Tuple.fromList(toTupleAppropriateList(list1)).pack(), Tuple.fromList(toTupleAppropriateList(list2)).pack())
* }</pre>
*
* <p>
* for any two lists {@code list1} and {@code list2}.
* </p>
*
* @param values the list of values to normalized
* @return a new list containing the normalized elements of {@code values}
*/
@Nonnull
static List<Object> toTupleEquivalentList(@Nonnull List<?> values) {
List<Object> tupleEquivalentList = new ArrayList<>(values.size());
for (Object o : values) {
tupleEquivalentList.add(toTupleEquivalentValue(o));
}
return tupleEquivalentList;
}
/**
* Normalize a value so that it compares equal to anything with the same {@link Tuple} representation.
* The value that is returned cannot necessarily be packed by a {@code Tuple} (for example,
* a <code>byte[]</code> is returned as a {@link ByteString}), but it does implement {@link Object#equals(Object)}
* and {@link Object#hashCode()}, so the value can be used in hash-based data structures like
* {@link java.util.HashSet HashSet}s and {@link java.util.HashMap HashMap}s. In other words, it should
* bethe case that:
*
* <pre> {@code
* Objects.equals(toTupleEquivalentValue(value1), toTupleEquivalentValue(value2))
* == Arrays.equals(Tuple.from(value1).pack(), Tuple.from(value2).pack())
* }</pre>
*
* <p>
* for any two values {@code value1} and {@code value2}.
* </p>
*
* <p>
* This will only return {@code null} if {@link #toTupleAppropriateValue(Object)} would return {@code null}
* on the same input. If the object is already in
* </p>
*
* @param obj the value to normalize
* @return a value that has the same representation when {@link Tuple}-encoded
*/
@Nullable
static Object toTupleEquivalentValue(@Nullable Object obj) {
if (obj == null || obj instanceof Key.Evaluated.NullStandin) {
return null;
} else if (obj instanceof List<?>) {
List<?> list = (List<?>)obj;
return toTupleEquivalentList(list);
} else if (obj instanceof Tuple) {
return toTupleEquivalentList(((Tuple)obj).getItems());
} else if (obj instanceof byte[]) {
return ByteString.copyFrom((byte[]) obj);
} else if ((obj instanceof Byte) || (obj instanceof Short) || (obj instanceof Integer)) {
return ((Number)obj).longValue();
} else if (obj instanceof BigInteger) {
BigInteger bigInt = (BigInteger)obj;
if (bigInt.compareTo(BIG_INT_MIN_LONG) > 0 && bigInt.compareTo(BIG_INT_MAX_LONG) < 0) {
return bigInt.longValue();
} else {
return bigInt;
}
} else if (obj instanceof ProtocolMessageEnum) {
return (long)((ProtocolMessageEnum)obj).getNumber();
} else if (obj instanceof Descriptors.EnumValueDescriptor) {
return (long)((Descriptors.EnumValueDescriptor)obj).getNumber();
} else if (obj instanceof FDBRecordVersion) {
return ((FDBRecordVersion)obj).toVersionstamp(false);
} else {
return obj;
}
}
/**
* Convert a list of values into items that can all be stored within a {@link Tuple}.
*
* @param values a list of values
* @return a new list with {@link Tuple}-encodable versions of the elements of {@code values}
*/
@Nonnull
static List<Object> toTupleAppropriateList(@Nonnull List<?> values) {
List<Object> tupleAppropriateList = new ArrayList<>(values.size());
for (Object o : values) {
tupleAppropriateList.add(toTupleAppropriateValue(o));
}
return tupleAppropriateList;
}
/**
* Convert a value into a type that can be stored within a {@link Tuple}.
*
* @param obj the value to convert
* @return the value converted to some {@link Tuple}-encodable type
*/
@Nullable
static Object toTupleAppropriateValue(@Nullable Object obj) {
if (obj instanceof Key.Evaluated.NullStandin) {
return null;
} else if (obj instanceof ByteString) {
return ((ByteString) obj).toByteArray();
} else if (obj instanceof List) {
return toTupleAppropriateList((List<?>) obj);
// Following two are both Internal.EnumLite, so could use that, too.
} else if (obj instanceof ProtocolMessageEnum) {
return ((ProtocolMessageEnum) obj).getNumber();
} else if (obj instanceof Descriptors.EnumValueDescriptor) {
return ((Descriptors.EnumValueDescriptor) obj).getNumber();
} else if (obj instanceof FDBRecordVersion) {
return ((FDBRecordVersion) obj).toVersionstamp(false);
} else {
return obj;
}
}
private TupleTypeUtil() {
}
}
|
{
"pile_set_name": "Github"
}
|
# coding=utf-8
import typing
from pyramid.config import Configurator
import transaction
from tracim_backend.app_models.contents import FOLDER_TYPE
from tracim_backend.app_models.contents import content_type_list
from tracim_backend.config import CFG
from tracim_backend.exceptions import ContentFilenameAlreadyUsedInFolder
from tracim_backend.exceptions import EmptyLabelNotAllowed
from tracim_backend.extensions import hapic
from tracim_backend.lib.core.content import ContentApi
from tracim_backend.lib.utils.authorization import ContentTypeChecker
from tracim_backend.lib.utils.authorization import check_right
from tracim_backend.lib.utils.authorization import is_contributor
from tracim_backend.lib.utils.authorization import is_reader
from tracim_backend.lib.utils.request import TracimRequest
from tracim_backend.lib.utils.utils import generate_documentation_swagger_tag
from tracim_backend.models.context_models import ContentInContext
from tracim_backend.models.context_models import RevisionInContext
from tracim_backend.models.revision_protection import new_revision
from tracim_backend.views.controllers import Controller
from tracim_backend.views.core_api.schemas import FolderContentModifySchema
from tracim_backend.views.core_api.schemas import NoContentSchema
from tracim_backend.views.core_api.schemas import SetContentStatusSchema
from tracim_backend.views.core_api.schemas import TextBasedContentSchema
from tracim_backend.views.core_api.schemas import TextBasedRevisionSchema
from tracim_backend.views.core_api.schemas import WorkspaceAndContentIdPathSchema
from tracim_backend.views.swagger_generic_section import SWAGGER_TAG__CONTENT_ENDPOINTS
try: # Python 3.5+
from http import HTTPStatus
except ImportError:
from http import client as HTTPStatus
SWAGGER_TAG__CONTENT_FOLDER_SECTION = "Folders"
SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS = generate_documentation_swagger_tag(
SWAGGER_TAG__CONTENT_ENDPOINTS, SWAGGER_TAG__CONTENT_FOLDER_SECTION
)
is_folder_content = ContentTypeChecker([FOLDER_TYPE])
class FolderController(Controller):
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_reader)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.output_body(TextBasedContentSchema())
def get_folder(self, context, request: TracimRequest, hapic_data=None) -> ContentInContext:
"""
Get folder info
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
return api.get_content_in_context(content)
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@hapic.handle_exception(EmptyLabelNotAllowed, HTTPStatus.BAD_REQUEST)
@hapic.handle_exception(ContentFilenameAlreadyUsedInFolder, HTTPStatus.BAD_REQUEST)
@check_right(is_contributor)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.input_body(FolderContentModifySchema())
@hapic.output_body(TextBasedContentSchema())
def update_folder(self, context, request: TracimRequest, hapic_data=None) -> ContentInContext:
"""
update folder
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
with new_revision(session=request.dbsession, tm=transaction.manager, content=content):
api.update_container_content(
item=content,
new_label=hapic_data.body.label,
new_content=hapic_data.body.raw_content,
allowed_content_type_slug_list=hapic_data.body.sub_content_types,
)
api.save(content)
api.execute_update_content_actions(content)
return api.get_content_in_context(content)
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_reader)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.output_body(TextBasedRevisionSchema(many=True))
def get_folder_revisions(
self, context, request: TracimRequest, hapic_data=None
) -> typing.List[RevisionInContext]:
"""
get folder revisions
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
revisions = content.revisions
return [api.get_revision_in_context(revision) for revision in revisions]
@hapic.with_api_doc(tags=[SWAGGER_TAG__CONTENT_FOLDER_ENDPOINTS])
@check_right(is_contributor)
@check_right(is_folder_content)
@hapic.input_path(WorkspaceAndContentIdPathSchema())
@hapic.input_body(SetContentStatusSchema())
@hapic.output_body(NoContentSchema(), default_http_code=HTTPStatus.NO_CONTENT)
def set_folder_status(self, context, request: TracimRequest, hapic_data=None) -> None:
"""
set folder status
"""
app_config = request.registry.settings["CFG"] # type: CFG
api = ContentApi(
show_archived=True,
show_deleted=True,
current_user=request.current_user,
session=request.dbsession,
config=app_config,
)
content = api.get_one(hapic_data.path.content_id, content_type=content_type_list.Any_SLUG)
with new_revision(session=request.dbsession, tm=transaction.manager, content=content):
api.set_status(content, hapic_data.body.status)
api.save(content)
api.execute_update_content_actions(content)
return
def bind(self, configurator: Configurator) -> None:
# Get folder
configurator.add_route(
"folder", "/workspaces/{workspace_id}/folders/{content_id}", request_method="GET"
)
configurator.add_view(self.get_folder, route_name="folder")
# update folder
configurator.add_route(
"update_folder", "/workspaces/{workspace_id}/folders/{content_id}", request_method="PUT"
)
configurator.add_view(self.update_folder, route_name="update_folder")
# get folder revisions
configurator.add_route(
"folder_revisions",
"/workspaces/{workspace_id}/folders/{content_id}/revisions",
request_method="GET",
)
configurator.add_view(self.get_folder_revisions, route_name="folder_revisions")
# get folder revisions
configurator.add_route(
"set_folder_status",
"/workspaces/{workspace_id}/folders/{content_id}/status",
request_method="PUT",
)
configurator.add_view(self.set_folder_status, route_name="set_folder_status")
|
{
"pile_set_name": "Github"
}
|
/** @file
Intel Processor Power Management ACPI Code.
Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "CpuPowerMgmt.h"
DefinitionBlock (
"CPU0PSD.aml",
"SSDT",
0x02,
"PmRef",
"Cpu0Psd",
0x3000
)
{
External(\PC00, IntObj)
External(\TCNT, FieldUnitObj)
External(\_SB.CFGD, FieldUnitObj)
External(\_SB.PR00, DeviceObj)
Scope(\_SB.PR00)
{
Name(HPSD,Package() // HW_ALL
{
Package() {5, // NumEntries. Current Value is 5.
0, // Revision. Current Value is 0.
0, // Domain.
0xFE, // Coordination type 0xFE = HW_ALL
0x80 // Number of processors.
}
})
Name(SPSD,Package() // SW_ALL
{
Package() {5, // NumEntries. Current Value is 5.
0, // Revision. Current Value is 0.
0, // Domain.
0xFC, // Coordination type 0xFC = SW_ALL
0x80 // Number of processors.
}
})
//
// The _PSD object provides information to the OSPM related
// to P-State coordination between processors in a multi-processor
// configurations.
//
Method(_PSD,0)
{
If (And(\_SB.CFGD, PPM_TURBO_BOOST_MAX)) // Intel Turbo Boost Max 3.0
{
Store (0, Index(DerefOf(Index(HPSD, 0)),2)) // Domain
Store (1, Index(DerefOf(Index(HPSD, 0)),4)) // Number of processors belonging to the domain.
} Else {
Store (TCNT, Index(DerefOf(Index(HPSD, 0)),4))
Store (TCNT, Index(DerefOf(Index(SPSD, 0)),4))
}
If(And(PC00,0x0800)) // If Hardware co-ordination of P states
{
Return(HPSD)
}
Return(SPSD)
}
} // End of Scope(\_SB.PR00)
} // End of Definition Block
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
type JobExpansion interface{}
|
{
"pile_set_name": "Github"
}
|
using System;
using ModuleManager.Progress;
namespace ModuleManager.Patches.PassSpecifiers
{
public class LegacyPassSpecifier : IPassSpecifier
{
public bool CheckNeeds(INeedsChecker needsChecker, IPatchProgress progress)
{
if (needsChecker == null) throw new ArgumentNullException(nameof(needsChecker));
if (progress == null) throw new ArgumentNullException(nameof(progress));
return true;
}
public string Descriptor => ":LEGACY (default)";
}
}
|
{
"pile_set_name": "Github"
}
|
require([
'gitbook'
], function (gitbook) {
gitbook.events.bind('page.change', function () {
mermaid.init();
});
});
|
{
"pile_set_name": "Github"
}
|
package de.peeeq.wurstscript.utils;
import de.peeeq.wurstscript.WLogger;
public class ExecutiontimeMeasure implements AutoCloseable {
private String message;
private long startTime;
public ExecutiontimeMeasure(String message) {
this.message = message;
this.startTime = System.currentTimeMillis();
}
@Override
public void close() {
long time = System.currentTimeMillis() - startTime;
WLogger.info("Executed " + message + " in " + time + "ms.");
}
}
|
{
"pile_set_name": "Github"
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by AsyncGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using NUnit.Framework;
using NHibernate.Criterion;
namespace NHibernate.Test.NHSpecificTest.NH2546
{
using System.Threading.Tasks;
[TestFixture]
public class SetCommandParameterSizesFalseFixtureAsync : BugTestCase
{
protected override bool AppliesTo(Dialect.Dialect dialect)
{
return dialect is Dialect.MsSql2008Dialect;
}
protected override void OnSetUp()
{
using (ISession session = Sfi.OpenSession())
{
session.Persist(new Student() { StringTypeWithLengthDefined = "Julian Maughan" });
session.Persist(new Student() { StringTypeWithLengthDefined = "Bill Clinton" });
session.Flush();
}
}
protected override void OnTearDown()
{
using (ISession session = Sfi.OpenSession())
{
session.CreateQuery("delete from Student").ExecuteUpdate();
session.Flush();
}
base.OnTearDown();
}
[Test]
public async Task LikeExpressionWithinDefinedTypeSizeAsync()
{
using (ISession session = Sfi.OpenSession())
{
ICriteria criteria = session
.CreateCriteria<Student>()
.Add(Restrictions.Like("StringTypeWithLengthDefined", "Julian%"));
IList<Student> list = await (criteria.ListAsync<Student>());
Assert.That(list.Count, Is.EqualTo(1));
}
}
[Test]
public async Task LikeExpressionExceedsDefinedTypeSizeAsync()
{
// In this case we are forcing the usage of LikeExpression class where the length of the associated property is ignored
using (ISession session = Sfi.OpenSession())
{
ICriteria criteria = session
.CreateCriteria<Student>()
.Add(Restrictions.Like("StringTypeWithLengthDefined", "[a-z][a-z][a-z]ian%", MatchMode.Exact, null));
IList<Student> list = await (criteria.ListAsync<Student>());
Assert.That(list.Count, Is.EqualTo(1));
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
goog.module('nested.exported.enums');
/** @const */
exports = {
/** @const @enum {string} */
A: {
A1: 'a1',
},
// The structure of the AST changes if this extra property is present.
B: 0,
};
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2019 Google Inc. All Rights Reserved.
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.
==============================================================================*/
import {Polygon} from '/lib/math/polygon2d.js';
import * as moduleInterface from '/lib/module_interface.js';
import * as moduleTicker from '/client/modules/module_ticker.js';
import * as network from '/client/network/network.js';
import * as peerNetwork from '/client/network/peer.js';
import {easyLog} from '/lib/log.js';
import assert from '/lib/assert.js';
import asset from '/client/asset/asset.js';
import conform from '/lib/conform.js';
import inject from '/lib/inject.js';
import * as stateManager from '/client/state/state_manager.js';
import {TitleCard} from '/client/title_card.js';
import * as time from '/client/util/time.js';
import {delay} from '/lib/promise.js';
function createNewContainer(name) {
var newContainer = document.createElement('div');
newContainer.className = 'container';
newContainer.id = 't-' + time.now();
newContainer.setAttribute('moduleName', name);
return newContainer;
}
export const FadeTransition = {
start(container) {
if (container) {
container.style.opacity = 0.001;
document.querySelector('#containers').appendChild(container);
}
},
async perform(oldModule, newModule, deadline) {
if (newModule.name == '_empty') {
// Fading out.. so fade *out* the *old* container.
oldModule.container.style.transition =
'opacity ' + time.until(deadline).toFixed(0) + 'ms';
oldModule.container.style.opacity = 0.0;
} else {
newModule.container.style.transition =
'opacity ' + time.until(deadline).toFixed(0) + 'ms';
newModule.container.style.opacity = 1.0;
}
// TODO(applmak): Maybe wait until css says that the transition is done?
await delay(time.until(deadline));
}
}
export class ClientModule {
constructor(name, path, config, titleCard, deadline, geo, transition) {
// The module name.
this.name = name;
// The path to the main file of this module.
this.path = path;
// The module config.
this.config = config;
// The title card instance for this module.
this.titleCard = titleCard;
// Absolute time when this module is supposed to be visible. Module will
// actually be faded in by deadline + 5000ms.
this.deadline = deadline;
// The wall geometry.
this.geo = geo;
// The transition to use to transition to this module.
this.transition = transition;
// The dom container for the module's content.
this.container = null;
// Module class instance.
this.instance = null;
// Network instance for this module.
this.network = null;
}
// Deserializes from the json serialized form of ModuleDef in the server.
static deserialize(bits) {
if (bits.module.name == '_empty') {
return ClientModule.newEmptyModule(bits.time);
}
return new ClientModule(
bits.module.name,
bits.module.path,
bits.module.config,
new TitleCard(bits.module.credit),
bits.time,
new Polygon(bits.geo),
FadeTransition,
);
}
static newEmptyModule(deadline = 0, transition = FadeTransition) {
return new ClientModule(
'_empty',
'',
{},
new TitleCard({}),
deadline,
new Polygon([{x: 0, y:0}]),
transition
);
}
// Extracted out for testing purposes.
static async loadPath(path) {
return await import(path);
}
async instantiate() {
this.container = createNewContainer(this.name);
if (!this.path) {
return;
}
const INSTANTIATION_ID =
`${this.geo.extents.serialize()}-${this.deadline}`;
this.network = network.forModule(INSTANTIATION_ID);
let openNetwork = this.network.open();
this.stateManager = stateManager.forModule(network, INSTANTIATION_ID);
const fakeEnv = {
asset,
debug: easyLog('wall:module:' + this.name),
game: undefined,
network: openNetwork,
titleCard: this.titleCard.getModuleAPI(),
state: this.stateManager.open(),
wallGeometry: this.geo,
peerNetwork,
assert,
};
try {
const {load} = await ClientModule.loadPath(this.path);
if (!load) {
throw new Error(`${this.name} did not export a 'load' function!`);
}
const {client} = inject(load, fakeEnv);
conform(client, moduleInterface.Client);
this.instance = new client(this.config);
} catch (e) {
// something went very wrong. Wind everything down.!
this.network.close();
this.network = null;
throw e;
}
}
// Returns true if module is still OK.
async willBeShownSoon() {
if (!this.path) {
return;
}
// Prep the container for transition.
// TODO(applmak): Move the transition smarts out of ClientModule.
this.transition.start(this.container);
try {
await this.instance.willBeShownSoon(this.container, this.deadline);
} catch(e) {
this.dispose();
throw e;
}
}
// Returns true if module is still OK.
beginTransitionIn(deadline) {
if (!this.path) {
return;
}
moduleTicker.add(this.name, this.instance);
try {
this.instance.beginFadeIn(deadline);
} catch (e) {
this.dispose();
throw e;
}
}
finishTransitionIn() {
if (!this.path) {
return;
}
this.titleCard.enter();
this.instance.finishFadeIn();
}
beginTransitionOut(deadline) {
if (!this.path) {
return;
}
this.titleCard.exit();
this.instance.beginFadeOut(deadline);
}
finishTransitionOut() {
if (!this.path) {
return;
}
this.instance.finishFadeOut();
}
async performTransition(otherModule, transitionFinishDeadline) {
await this.transition.perform(otherModule, this, transitionFinishDeadline);
}
dispose() {
if (this.container) {
this.container.remove();
this.container = null;
}
if (!this.path) {
return;
}
this.titleCard.exit(); // Just in case.
moduleTicker.remove(this.instance);
if (this.network) {
this.stateManager.close();
this.stateManager = null;
this.network.close();
this.network = null;
}
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Data.Entity.TestModels.ProviderAgnosticModel
{
using System;
public enum AllTypesEnum
{
EnumValue0 = 0,
EnumValue1 = 1,
EnumValue2 = 2,
EnumValue3 = 3,
};
public class AllTypes
{
public int Id { get; set; }
public bool BooleanProperty { get; set; }
public byte ByteProperty { get; set; }
public DateTime DateTimeProperty { get; set; }
public decimal DecimalProperty { get; set; }
public double DoubleProperty { get; set; }
public byte[] FixedLengthBinaryProperty { get; set; }
public string FixedLengthStringProperty { get; set; }
public string FixedLengthUnicodeStringProperty { get; set; }
public float FloatProperty { get; set; }
public Guid GuidProperty { get; set; }
public short Int16Property { get; set; }
public int Int32Property { get; set; }
public long Int64Property { get; set; }
public byte[] MaxLengthBinaryProperty { get; set; }
public string MaxLengthStringProperty { get; set; }
public string MaxLengthUnicodeStringProperty { get; set; }
public TimeSpan TimeSpanProperty { get; set; }
public string VariableLengthStringProperty { get; set; }
public byte[] VariableLengthBinaryProperty { get; set; }
public string VariableLengthUnicodeStringProperty { get; set; }
public AllTypesEnum EnumProperty { get; set; }
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
* more information.
*/
function page_manager_contact_user_page_manager_tasks() {
if (!module_exists('contact')) {
return;
}
return array(
// This is a 'page' task and will fall under the page admin UI
'task type' => 'page',
'title' => t('User contact'),
'admin title' => t('User contact'),
'admin description' => t('When enabled, this overrides the default Drupal behavior for displaying the user contact form at <em>user/%user/contact</em>. If no variant is selected, the default Drupal user contact form will be used.'),
'admin path' => 'user/%user/contact',
// Callback to add items to the page managertask administration form:
'task admin' => 'page_manager_contact_user_task_admin',
'hook menu alter' => 'page_manager_contact_user_menu_alter',
// This is task uses 'context' handlers and must implement these to give the
// handler data it needs.
'handler type' => 'context', // handler type -- misnamed
'get arguments' => 'page_manager_contact_user_get_arguments',
'get context placeholders' => 'page_manager_contact_user_get_contexts',
// Allow this to be enabled or disabled:
'disabled' => variable_get('page_manager_contact_user_disabled', TRUE),
'enable callback' => 'page_manager_contact_user_enable',
);
}
/**
* Callback defined by page_manager_contact_user_page_manager_tasks().
*
* Alter the user view input so that user view comes to us rather than the
* normal user view process.
*/
function page_manager_contact_user_menu_alter(&$items, $task) {
if (variable_get('page_manager_contact_user_disabled', TRUE)) {
return;
}
// Override the user view handler for our purpose.
if ($items['user/%user/contact']['page callback'] == 'contact_user_page' || variable_get('page_manager_override_anyway', FALSE)) {
$items['user/%user/contact']['page callback'] = 'page_manager_contact_user';
$items['user/%user/contact']['file path'] = $task['path'];
$items['user/%user/contact']['file'] = $task['file'];
}
else {
// automatically disable this task if it cannot be enabled.
variable_set('page_manager_contact_user_disabled', TRUE);
if (!empty($GLOBALS['page_manager_enabling_contact_user'])) {
drupal_set_message(t('Page manager module is unable to enable user/%user/contact because some other module already has overridden with %callback.', array('%callback' => $items['user/%user/contact']['page callback'])), 'error');
}
}
}
/**
* Entry point for our overridden user view.
*
* This function asks its assigned handlers who, if anyone, would like
* to run with it. If no one does, it passes through to Drupal core's
* user view, which is user_page_view().
*/
function page_manager_contact_user($account) {
// Load my task plugin:
$task = page_manager_get_task('contact_user');
// Load the account into a context.
ctools_include('context');
ctools_include('context-task-handler');
$contexts = ctools_context_handler_get_task_contexts($task, '', array($account));
$output = ctools_context_handler_render($task, '', $contexts, array($account->uid));
if ($output !== FALSE) {
return $output;
}
module_load_include('inc', 'contact', 'contact.pages');
$function = 'contact_user_page';
foreach (module_implements('page_manager_override') as $module) {
$call = $module . '_page_manager_override';
if (($rc = $call('contact_user')) && function_exists($rc)) {
$function = $rc;
break;
}
}
// Otherwise, fall back.
return $function($account);
}
/**
* Callback to get arguments provided by this task handler.
*
* Since this is the node view and there is no UI on the arguments, we
* create dummy arguments that contain the needed data.
*/
function page_manager_contact_user_get_arguments($task, $subtask_id) {
return array(
array(
'keyword' => 'user',
'identifier' => t('User being viewed'),
'id' => 1,
'name' => 'uid',
'settings' => array(),
),
);
}
/**
* Callback to get context placeholders provided by this handler.
*/
function page_manager_contact_user_get_contexts($task, $subtask_id) {
return ctools_context_get_placeholders_from_argument(page_manager_contact_user_get_arguments($task, $subtask_id));
}
/**
* Callback to enable/disable the page from the UI.
*/
function page_manager_contact_user_enable($cache, $status) {
variable_set('page_manager_contact_user_disabled', $status);
// Set a global flag so that the menu routine knows it needs
// to set a message if enabling cannot be done.
if (!$status) {
$GLOBALS['page_manager_enabling_contact_user'] = TRUE;
}
}
|
{
"pile_set_name": "Github"
}
|
// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: google/protobuf/unittest_proto3_arena.proto
//
// For information on using the generated types, please see the documenation:
// https://github.com/apple/swift-protobuf/
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import Foundation
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
enum Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf.Enum {
typealias RawValue = Int
case foreignZero // = 0
case foreignFoo // = 4
case foreignBar // = 5
case foreignBaz // = 6
case UNRECOGNIZED(Int)
init() {
self = .foreignZero
}
init?(rawValue: Int) {
switch rawValue {
case 0: self = .foreignZero
case 4: self = .foreignFoo
case 5: self = .foreignBar
case 6: self = .foreignBaz
default: self = .UNRECOGNIZED(rawValue)
}
}
var rawValue: Int {
switch self {
case .foreignZero: return 0
case .foreignFoo: return 4
case .foreignBar: return 5
case .foreignBaz: return 6
case .UNRECOGNIZED(let i): return i
}
}
}
#if swift(>=4.2)
extension Proto3ArenaUnittest_ForeignEnum: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
static var allCases: [Proto3ArenaUnittest_ForeignEnum] = [
.foreignZero,
.foreignFoo,
.foreignBar,
.foreignBaz,
]
}
#endif // swift(>=4.2)
/// This proto includes every type of field in both singular and repeated
/// forms.
struct Proto3ArenaUnittest_TestAllTypes {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Singular
var optionalInt32: Int32 {
get {return _storage._optionalInt32}
set {_uniqueStorage()._optionalInt32 = newValue}
}
var optionalInt64: Int64 {
get {return _storage._optionalInt64}
set {_uniqueStorage()._optionalInt64 = newValue}
}
var optionalUint32: UInt32 {
get {return _storage._optionalUint32}
set {_uniqueStorage()._optionalUint32 = newValue}
}
var optionalUint64: UInt64 {
get {return _storage._optionalUint64}
set {_uniqueStorage()._optionalUint64 = newValue}
}
var optionalSint32: Int32 {
get {return _storage._optionalSint32}
set {_uniqueStorage()._optionalSint32 = newValue}
}
var optionalSint64: Int64 {
get {return _storage._optionalSint64}
set {_uniqueStorage()._optionalSint64 = newValue}
}
var optionalFixed32: UInt32 {
get {return _storage._optionalFixed32}
set {_uniqueStorage()._optionalFixed32 = newValue}
}
var optionalFixed64: UInt64 {
get {return _storage._optionalFixed64}
set {_uniqueStorage()._optionalFixed64 = newValue}
}
var optionalSfixed32: Int32 {
get {return _storage._optionalSfixed32}
set {_uniqueStorage()._optionalSfixed32 = newValue}
}
var optionalSfixed64: Int64 {
get {return _storage._optionalSfixed64}
set {_uniqueStorage()._optionalSfixed64 = newValue}
}
var optionalFloat: Float {
get {return _storage._optionalFloat}
set {_uniqueStorage()._optionalFloat = newValue}
}
var optionalDouble: Double {
get {return _storage._optionalDouble}
set {_uniqueStorage()._optionalDouble = newValue}
}
var optionalBool: Bool {
get {return _storage._optionalBool}
set {_uniqueStorage()._optionalBool = newValue}
}
var optionalString: String {
get {return _storage._optionalString}
set {_uniqueStorage()._optionalString = newValue}
}
var optionalBytes: Data {
get {return _storage._optionalBytes}
set {_uniqueStorage()._optionalBytes = newValue}
}
var optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
get {return _storage._optionalNestedMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()}
set {_uniqueStorage()._optionalNestedMessage = newValue}
}
/// Returns true if `optionalNestedMessage` has been explicitly set.
var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil}
/// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil}
var optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage {
get {return _storage._optionalForeignMessage ?? Proto3ArenaUnittest_ForeignMessage()}
set {_uniqueStorage()._optionalForeignMessage = newValue}
}
/// Returns true if `optionalForeignMessage` has been explicitly set.
var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil}
/// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil}
var optionalImportMessage: ProtobufUnittestImport_ImportMessage {
get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessage()}
set {_uniqueStorage()._optionalImportMessage = newValue}
}
/// Returns true if `optionalImportMessage` has been explicitly set.
var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil}
/// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil}
var optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum {
get {return _storage._optionalNestedEnum}
set {_uniqueStorage()._optionalNestedEnum = newValue}
}
var optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum {
get {return _storage._optionalForeignEnum}
set {_uniqueStorage()._optionalForeignEnum = newValue}
}
var optionalStringPiece: String {
get {return _storage._optionalStringPiece}
set {_uniqueStorage()._optionalStringPiece = newValue}
}
var optionalCord: String {
get {return _storage._optionalCord}
set {_uniqueStorage()._optionalCord = newValue}
}
/// Defined in unittest_import_public.proto
var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage {
get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessage()}
set {_uniqueStorage()._optionalPublicImportMessage = newValue}
}
/// Returns true if `optionalPublicImportMessage` has been explicitly set.
var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil}
/// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil}
var optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
get {return _storage._optionalLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()}
set {_uniqueStorage()._optionalLazyMessage = newValue}
}
/// Returns true if `optionalLazyMessage` has been explicitly set.
var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil}
/// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil}
var optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage {
get {return _storage._optionalLazyImportMessage ?? ProtobufUnittestImport_ImportMessage()}
set {_uniqueStorage()._optionalLazyImportMessage = newValue}
}
/// Returns true if `optionalLazyImportMessage` has been explicitly set.
var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil}
/// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value.
mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil}
/// Repeated
var repeatedInt32: [Int32] {
get {return _storage._repeatedInt32}
set {_uniqueStorage()._repeatedInt32 = newValue}
}
var repeatedInt64: [Int64] {
get {return _storage._repeatedInt64}
set {_uniqueStorage()._repeatedInt64 = newValue}
}
var repeatedUint32: [UInt32] {
get {return _storage._repeatedUint32}
set {_uniqueStorage()._repeatedUint32 = newValue}
}
var repeatedUint64: [UInt64] {
get {return _storage._repeatedUint64}
set {_uniqueStorage()._repeatedUint64 = newValue}
}
var repeatedSint32: [Int32] {
get {return _storage._repeatedSint32}
set {_uniqueStorage()._repeatedSint32 = newValue}
}
var repeatedSint64: [Int64] {
get {return _storage._repeatedSint64}
set {_uniqueStorage()._repeatedSint64 = newValue}
}
var repeatedFixed32: [UInt32] {
get {return _storage._repeatedFixed32}
set {_uniqueStorage()._repeatedFixed32 = newValue}
}
var repeatedFixed64: [UInt64] {
get {return _storage._repeatedFixed64}
set {_uniqueStorage()._repeatedFixed64 = newValue}
}
var repeatedSfixed32: [Int32] {
get {return _storage._repeatedSfixed32}
set {_uniqueStorage()._repeatedSfixed32 = newValue}
}
var repeatedSfixed64: [Int64] {
get {return _storage._repeatedSfixed64}
set {_uniqueStorage()._repeatedSfixed64 = newValue}
}
var repeatedFloat: [Float] {
get {return _storage._repeatedFloat}
set {_uniqueStorage()._repeatedFloat = newValue}
}
var repeatedDouble: [Double] {
get {return _storage._repeatedDouble}
set {_uniqueStorage()._repeatedDouble = newValue}
}
var repeatedBool: [Bool] {
get {return _storage._repeatedBool}
set {_uniqueStorage()._repeatedBool = newValue}
}
var repeatedString: [String] {
get {return _storage._repeatedString}
set {_uniqueStorage()._repeatedString = newValue}
}
var repeatedBytes: [Data] {
get {return _storage._repeatedBytes}
set {_uniqueStorage()._repeatedBytes = newValue}
}
var repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] {
get {return _storage._repeatedNestedMessage}
set {_uniqueStorage()._repeatedNestedMessage = newValue}
}
var repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] {
get {return _storage._repeatedForeignMessage}
set {_uniqueStorage()._repeatedForeignMessage = newValue}
}
var repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] {
get {return _storage._repeatedImportMessage}
set {_uniqueStorage()._repeatedImportMessage = newValue}
}
var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] {
get {return _storage._repeatedNestedEnum}
set {_uniqueStorage()._repeatedNestedEnum = newValue}
}
var repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] {
get {return _storage._repeatedForeignEnum}
set {_uniqueStorage()._repeatedForeignEnum = newValue}
}
var repeatedStringPiece: [String] {
get {return _storage._repeatedStringPiece}
set {_uniqueStorage()._repeatedStringPiece = newValue}
}
var repeatedCord: [String] {
get {return _storage._repeatedCord}
set {_uniqueStorage()._repeatedCord = newValue}
}
var repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] {
get {return _storage._repeatedLazyMessage}
set {_uniqueStorage()._repeatedLazyMessage = newValue}
}
var oneofField: OneOf_OneofField? {
get {return _storage._oneofField}
set {_uniqueStorage()._oneofField = newValue}
}
var oneofUint32: UInt32 {
get {
if case .oneofUint32(let v)? = _storage._oneofField {return v}
return 0
}
set {_uniqueStorage()._oneofField = .oneofUint32(newValue)}
}
var oneofNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
get {
if case .oneofNestedMessage(let v)? = _storage._oneofField {return v}
return Proto3ArenaUnittest_TestAllTypes.NestedMessage()
}
set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)}
}
var oneofString: String {
get {
if case .oneofString(let v)? = _storage._oneofField {return v}
return String()
}
set {_uniqueStorage()._oneofField = .oneofString(newValue)}
}
var oneofBytes: Data {
get {
if case .oneofBytes(let v)? = _storage._oneofField {return v}
return SwiftProtobuf.Internal.emptyData
}
set {_uniqueStorage()._oneofField = .oneofBytes(newValue)}
}
var unknownFields = SwiftProtobuf.UnknownStorage()
enum OneOf_OneofField: Equatable {
case oneofUint32(UInt32)
case oneofNestedMessage(Proto3ArenaUnittest_TestAllTypes.NestedMessage)
case oneofString(String)
case oneofBytes(Data)
#if !swift(>=4.1)
static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField, rhs: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField) -> Bool {
switch (lhs, rhs) {
case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
case (.oneofNestedMessage(let l), .oneofNestedMessage(let r)): return l == r
case (.oneofString(let l), .oneofString(let r)): return l == r
case (.oneofBytes(let l), .oneofBytes(let r)): return l == r
default: return false
}
}
#endif
}
enum NestedEnum: SwiftProtobuf.Enum {
typealias RawValue = Int
case zero // = 0
case foo // = 1
case bar // = 2
case baz // = 3
/// Intentionally negative.
case neg // = -1
case UNRECOGNIZED(Int)
init() {
self = .zero
}
init?(rawValue: Int) {
switch rawValue {
case -1: self = .neg
case 0: self = .zero
case 1: self = .foo
case 2: self = .bar
case 3: self = .baz
default: self = .UNRECOGNIZED(rawValue)
}
}
var rawValue: Int {
switch self {
case .neg: return -1
case .zero: return 0
case .foo: return 1
case .bar: return 2
case .baz: return 3
case .UNRECOGNIZED(let i): return i
}
}
}
struct NestedMessage {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The field name "b" fails to compile in proto1 because it conflicts with
/// a local variable named "b" in one of the generated methods. Doh.
/// This file needs to compile in proto1 to test backwards-compatibility.
var bb: Int32 = 0
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
init() {}
fileprivate var _storage = _StorageClass.defaultInstance
}
#if swift(>=4.2)
extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
static var allCases: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [
.zero,
.foo,
.bar,
.baz,
.neg,
]
}
#endif // swift(>=4.2)
struct Proto3ArenaUnittest_TestPackedTypes {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var packedInt32: [Int32] = []
var packedInt64: [Int64] = []
var packedUint32: [UInt32] = []
var packedUint64: [UInt64] = []
var packedSint32: [Int32] = []
var packedSint64: [Int64] = []
var packedFixed32: [UInt32] = []
var packedFixed64: [UInt64] = []
var packedSfixed32: [Int32] = []
var packedSfixed64: [Int64] = []
var packedFloat: [Float] = []
var packedDouble: [Double] = []
var packedBool: [Bool] = []
var packedEnum: [Proto3ArenaUnittest_ForeignEnum] = []
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// Explicitly set packed to false
struct Proto3ArenaUnittest_TestUnpackedTypes {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var repeatedInt32: [Int32] = []
var repeatedInt64: [Int64] = []
var repeatedUint32: [UInt32] = []
var repeatedUint64: [UInt64] = []
var repeatedSint32: [Int32] = []
var repeatedSint64: [Int64] = []
var repeatedFixed32: [UInt32] = []
var repeatedFixed64: [UInt64] = []
var repeatedSfixed32: [Int32] = []
var repeatedSfixed64: [Int64] = []
var repeatedFloat: [Float] = []
var repeatedDouble: [Double] = []
var repeatedBool: [Bool] = []
var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = []
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// This proto includes a recusively nested message.
struct Proto3ArenaUnittest_NestedTestAllTypes {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var child: Proto3ArenaUnittest_NestedTestAllTypes {
get {return _storage._child ?? Proto3ArenaUnittest_NestedTestAllTypes()}
set {_uniqueStorage()._child = newValue}
}
/// Returns true if `child` has been explicitly set.
var hasChild: Bool {return _storage._child != nil}
/// Clears the value of `child`. Subsequent reads from it will return its default value.
mutating func clearChild() {_uniqueStorage()._child = nil}
var payload: Proto3ArenaUnittest_TestAllTypes {
get {return _storage._payload ?? Proto3ArenaUnittest_TestAllTypes()}
set {_uniqueStorage()._payload = newValue}
}
/// Returns true if `payload` has been explicitly set.
var hasPayload: Bool {return _storage._payload != nil}
/// Clears the value of `payload`. Subsequent reads from it will return its default value.
mutating func clearPayload() {_uniqueStorage()._payload = nil}
var repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] {
get {return _storage._repeatedChild}
set {_uniqueStorage()._repeatedChild = newValue}
}
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
fileprivate var _storage = _StorageClass.defaultInstance
}
/// Define these after TestAllTypes to make sure the compiler can handle
/// that.
struct Proto3ArenaUnittest_ForeignMessage {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var c: Int32 = 0
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
/// TestEmptyMessage is used to test behavior of unknown fields.
struct Proto3ArenaUnittest_TestEmptyMessage {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
var unknownFields = SwiftProtobuf.UnknownStorage()
init() {}
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "proto3_arena_unittest"
extension Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding {
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
0: .same(proto: "FOREIGN_ZERO"),
4: .same(proto: "FOREIGN_FOO"),
5: .same(proto: "FOREIGN_BAR"),
6: .same(proto: "FOREIGN_BAZ"),
]
}
extension Proto3ArenaUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestAllTypes"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "optional_int32"),
2: .standard(proto: "optional_int64"),
3: .standard(proto: "optional_uint32"),
4: .standard(proto: "optional_uint64"),
5: .standard(proto: "optional_sint32"),
6: .standard(proto: "optional_sint64"),
7: .standard(proto: "optional_fixed32"),
8: .standard(proto: "optional_fixed64"),
9: .standard(proto: "optional_sfixed32"),
10: .standard(proto: "optional_sfixed64"),
11: .standard(proto: "optional_float"),
12: .standard(proto: "optional_double"),
13: .standard(proto: "optional_bool"),
14: .standard(proto: "optional_string"),
15: .standard(proto: "optional_bytes"),
18: .standard(proto: "optional_nested_message"),
19: .standard(proto: "optional_foreign_message"),
20: .standard(proto: "optional_import_message"),
21: .standard(proto: "optional_nested_enum"),
22: .standard(proto: "optional_foreign_enum"),
24: .standard(proto: "optional_string_piece"),
25: .standard(proto: "optional_cord"),
26: .standard(proto: "optional_public_import_message"),
27: .standard(proto: "optional_lazy_message"),
115: .standard(proto: "optional_lazy_import_message"),
31: .standard(proto: "repeated_int32"),
32: .standard(proto: "repeated_int64"),
33: .standard(proto: "repeated_uint32"),
34: .standard(proto: "repeated_uint64"),
35: .standard(proto: "repeated_sint32"),
36: .standard(proto: "repeated_sint64"),
37: .standard(proto: "repeated_fixed32"),
38: .standard(proto: "repeated_fixed64"),
39: .standard(proto: "repeated_sfixed32"),
40: .standard(proto: "repeated_sfixed64"),
41: .standard(proto: "repeated_float"),
42: .standard(proto: "repeated_double"),
43: .standard(proto: "repeated_bool"),
44: .standard(proto: "repeated_string"),
45: .standard(proto: "repeated_bytes"),
48: .standard(proto: "repeated_nested_message"),
49: .standard(proto: "repeated_foreign_message"),
50: .standard(proto: "repeated_import_message"),
51: .standard(proto: "repeated_nested_enum"),
52: .standard(proto: "repeated_foreign_enum"),
54: .standard(proto: "repeated_string_piece"),
55: .standard(proto: "repeated_cord"),
57: .standard(proto: "repeated_lazy_message"),
111: .standard(proto: "oneof_uint32"),
112: .standard(proto: "oneof_nested_message"),
113: .standard(proto: "oneof_string"),
114: .standard(proto: "oneof_bytes"),
]
fileprivate class _StorageClass {
var _optionalInt32: Int32 = 0
var _optionalInt64: Int64 = 0
var _optionalUint32: UInt32 = 0
var _optionalUint64: UInt64 = 0
var _optionalSint32: Int32 = 0
var _optionalSint64: Int64 = 0
var _optionalFixed32: UInt32 = 0
var _optionalFixed64: UInt64 = 0
var _optionalSfixed32: Int32 = 0
var _optionalSfixed64: Int64 = 0
var _optionalFloat: Float = 0
var _optionalDouble: Double = 0
var _optionalBool: Bool = false
var _optionalString: String = String()
var _optionalBytes: Data = SwiftProtobuf.Internal.emptyData
var _optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil
var _optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage? = nil
var _optionalImportMessage: ProtobufUnittestImport_ImportMessage? = nil
var _optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum = .zero
var _optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum = .foreignZero
var _optionalStringPiece: String = String()
var _optionalCord: String = String()
var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage? = nil
var _optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil
var _optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage? = nil
var _repeatedInt32: [Int32] = []
var _repeatedInt64: [Int64] = []
var _repeatedUint32: [UInt32] = []
var _repeatedUint64: [UInt64] = []
var _repeatedSint32: [Int32] = []
var _repeatedSint64: [Int64] = []
var _repeatedFixed32: [UInt32] = []
var _repeatedFixed64: [UInt64] = []
var _repeatedSfixed32: [Int32] = []
var _repeatedSfixed64: [Int64] = []
var _repeatedFloat: [Float] = []
var _repeatedDouble: [Double] = []
var _repeatedBool: [Bool] = []
var _repeatedString: [String] = []
var _repeatedBytes: [Data] = []
var _repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = []
var _repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] = []
var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] = []
var _repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = []
var _repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] = []
var _repeatedStringPiece: [String] = []
var _repeatedCord: [String] = []
var _repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = []
var _oneofField: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField?
static let defaultInstance = _StorageClass()
private init() {}
init(copying source: _StorageClass) {
_optionalInt32 = source._optionalInt32
_optionalInt64 = source._optionalInt64
_optionalUint32 = source._optionalUint32
_optionalUint64 = source._optionalUint64
_optionalSint32 = source._optionalSint32
_optionalSint64 = source._optionalSint64
_optionalFixed32 = source._optionalFixed32
_optionalFixed64 = source._optionalFixed64
_optionalSfixed32 = source._optionalSfixed32
_optionalSfixed64 = source._optionalSfixed64
_optionalFloat = source._optionalFloat
_optionalDouble = source._optionalDouble
_optionalBool = source._optionalBool
_optionalString = source._optionalString
_optionalBytes = source._optionalBytes
_optionalNestedMessage = source._optionalNestedMessage
_optionalForeignMessage = source._optionalForeignMessage
_optionalImportMessage = source._optionalImportMessage
_optionalNestedEnum = source._optionalNestedEnum
_optionalForeignEnum = source._optionalForeignEnum
_optionalStringPiece = source._optionalStringPiece
_optionalCord = source._optionalCord
_optionalPublicImportMessage = source._optionalPublicImportMessage
_optionalLazyMessage = source._optionalLazyMessage
_optionalLazyImportMessage = source._optionalLazyImportMessage
_repeatedInt32 = source._repeatedInt32
_repeatedInt64 = source._repeatedInt64
_repeatedUint32 = source._repeatedUint32
_repeatedUint64 = source._repeatedUint64
_repeatedSint32 = source._repeatedSint32
_repeatedSint64 = source._repeatedSint64
_repeatedFixed32 = source._repeatedFixed32
_repeatedFixed64 = source._repeatedFixed64
_repeatedSfixed32 = source._repeatedSfixed32
_repeatedSfixed64 = source._repeatedSfixed64
_repeatedFloat = source._repeatedFloat
_repeatedDouble = source._repeatedDouble
_repeatedBool = source._repeatedBool
_repeatedString = source._repeatedString
_repeatedBytes = source._repeatedBytes
_repeatedNestedMessage = source._repeatedNestedMessage
_repeatedForeignMessage = source._repeatedForeignMessage
_repeatedImportMessage = source._repeatedImportMessage
_repeatedNestedEnum = source._repeatedNestedEnum
_repeatedForeignEnum = source._repeatedForeignEnum
_repeatedStringPiece = source._repeatedStringPiece
_repeatedCord = source._repeatedCord
_repeatedLazyMessage = source._repeatedLazyMessage
_oneofField = source._oneofField
}
}
fileprivate mutating func _uniqueStorage() -> _StorageClass {
if !isKnownUniquelyReferenced(&_storage) {
_storage = _StorageClass(copying: _storage)
}
return _storage
}
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
_ = _uniqueStorage()
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32)
case 2: try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64)
case 3: try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32)
case 4: try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64)
case 5: try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32)
case 6: try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64)
case 7: try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32)
case 8: try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64)
case 9: try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32)
case 10: try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64)
case 11: try decoder.decodeSingularFloatField(value: &_storage._optionalFloat)
case 12: try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble)
case 13: try decoder.decodeSingularBoolField(value: &_storage._optionalBool)
case 14: try decoder.decodeSingularStringField(value: &_storage._optionalString)
case 15: try decoder.decodeSingularBytesField(value: &_storage._optionalBytes)
case 18: try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage)
case 19: try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage)
case 20: try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage)
case 21: try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum)
case 22: try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum)
case 24: try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece)
case 25: try decoder.decodeSingularStringField(value: &_storage._optionalCord)
case 26: try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage)
case 27: try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage)
case 31: try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32)
case 32: try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64)
case 33: try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32)
case 34: try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64)
case 35: try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32)
case 36: try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64)
case 37: try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32)
case 38: try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64)
case 39: try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32)
case 40: try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64)
case 41: try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat)
case 42: try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble)
case 43: try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool)
case 44: try decoder.decodeRepeatedStringField(value: &_storage._repeatedString)
case 45: try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes)
case 48: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage)
case 49: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage)
case 50: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage)
case 51: try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum)
case 52: try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum)
case 54: try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece)
case 55: try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord)
case 57: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage)
case 111:
if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
var v: UInt32?
try decoder.decodeSingularUInt32Field(value: &v)
if let v = v {_storage._oneofField = .oneofUint32(v)}
case 112:
var v: Proto3ArenaUnittest_TestAllTypes.NestedMessage?
if let current = _storage._oneofField {
try decoder.handleConflictingOneOf()
if case .oneofNestedMessage(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {_storage._oneofField = .oneofNestedMessage(v)}
case 113:
if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
var v: String?
try decoder.decodeSingularStringField(value: &v)
if let v = v {_storage._oneofField = .oneofString(v)}
case 114:
if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
var v: Data?
try decoder.decodeSingularBytesField(value: &v)
if let v = v {_storage._oneofField = .oneofBytes(v)}
case 115: try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage)
default: break
}
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
if _storage._optionalInt32 != 0 {
try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1)
}
if _storage._optionalInt64 != 0 {
try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2)
}
if _storage._optionalUint32 != 0 {
try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3)
}
if _storage._optionalUint64 != 0 {
try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4)
}
if _storage._optionalSint32 != 0 {
try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5)
}
if _storage._optionalSint64 != 0 {
try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6)
}
if _storage._optionalFixed32 != 0 {
try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7)
}
if _storage._optionalFixed64 != 0 {
try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8)
}
if _storage._optionalSfixed32 != 0 {
try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9)
}
if _storage._optionalSfixed64 != 0 {
try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10)
}
if _storage._optionalFloat != 0 {
try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11)
}
if _storage._optionalDouble != 0 {
try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12)
}
if _storage._optionalBool != false {
try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13)
}
if !_storage._optionalString.isEmpty {
try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14)
}
if !_storage._optionalBytes.isEmpty {
try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15)
}
if let v = _storage._optionalNestedMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
}
if let v = _storage._optionalForeignMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 19)
}
if let v = _storage._optionalImportMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
}
if _storage._optionalNestedEnum != .zero {
try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21)
}
if _storage._optionalForeignEnum != .foreignZero {
try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22)
}
if !_storage._optionalStringPiece.isEmpty {
try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24)
}
if !_storage._optionalCord.isEmpty {
try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25)
}
if let v = _storage._optionalPublicImportMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 26)
}
if let v = _storage._optionalLazyMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 27)
}
if !_storage._repeatedInt32.isEmpty {
try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31)
}
if !_storage._repeatedInt64.isEmpty {
try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32)
}
if !_storage._repeatedUint32.isEmpty {
try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33)
}
if !_storage._repeatedUint64.isEmpty {
try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34)
}
if !_storage._repeatedSint32.isEmpty {
try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35)
}
if !_storage._repeatedSint64.isEmpty {
try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36)
}
if !_storage._repeatedFixed32.isEmpty {
try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37)
}
if !_storage._repeatedFixed64.isEmpty {
try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38)
}
if !_storage._repeatedSfixed32.isEmpty {
try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39)
}
if !_storage._repeatedSfixed64.isEmpty {
try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40)
}
if !_storage._repeatedFloat.isEmpty {
try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41)
}
if !_storage._repeatedDouble.isEmpty {
try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42)
}
if !_storage._repeatedBool.isEmpty {
try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43)
}
if !_storage._repeatedString.isEmpty {
try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44)
}
if !_storage._repeatedBytes.isEmpty {
try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45)
}
if !_storage._repeatedNestedMessage.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48)
}
if !_storage._repeatedForeignMessage.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49)
}
if !_storage._repeatedImportMessage.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50)
}
if !_storage._repeatedNestedEnum.isEmpty {
try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51)
}
if !_storage._repeatedForeignEnum.isEmpty {
try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52)
}
if !_storage._repeatedStringPiece.isEmpty {
try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54)
}
if !_storage._repeatedCord.isEmpty {
try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55)
}
if !_storage._repeatedLazyMessage.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57)
}
switch _storage._oneofField {
case .oneofUint32(let v)?:
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111)
case .oneofNestedMessage(let v)?:
try visitor.visitSingularMessageField(value: v, fieldNumber: 112)
case .oneofString(let v)?:
try visitor.visitSingularStringField(value: v, fieldNumber: 113)
case .oneofBytes(let v)?:
try visitor.visitSingularBytesField(value: v, fieldNumber: 114)
case nil: break
}
if let v = _storage._optionalLazyImportMessage {
try visitor.visitSingularMessageField(value: v, fieldNumber: 115)
}
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_TestAllTypes, rhs: Proto3ArenaUnittest_TestAllTypes) -> Bool {
if lhs._storage !== rhs._storage {
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
let _storage = _args.0
let rhs_storage = _args.1
if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false}
if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false}
if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false}
if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false}
if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false}
if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false}
if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false}
if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false}
if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false}
if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false}
if _storage._optionalFloat != rhs_storage._optionalFloat {return false}
if _storage._optionalDouble != rhs_storage._optionalDouble {return false}
if _storage._optionalBool != rhs_storage._optionalBool {return false}
if _storage._optionalString != rhs_storage._optionalString {return false}
if _storage._optionalBytes != rhs_storage._optionalBytes {return false}
if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false}
if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false}
if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false}
if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false}
if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false}
if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false}
if _storage._optionalCord != rhs_storage._optionalCord {return false}
if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false}
if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false}
if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false}
if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false}
if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false}
if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false}
if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false}
if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false}
if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false}
if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false}
if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false}
if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false}
if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false}
if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false}
if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false}
if _storage._repeatedBool != rhs_storage._repeatedBool {return false}
if _storage._repeatedString != rhs_storage._repeatedString {return false}
if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false}
if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false}
if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false}
if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false}
if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false}
if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false}
if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false}
if _storage._repeatedCord != rhs_storage._repeatedCord {return false}
if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false}
if _storage._oneofField != rhs_storage._oneofField {return false}
return true
}
if !storagesAreEqual {return false}
}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding {
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
-1: .same(proto: "NEG"),
0: .same(proto: "ZERO"),
1: .same(proto: "FOO"),
2: .same(proto: "BAR"),
3: .same(proto: "BAZ"),
]
}
extension Proto3ArenaUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = Proto3ArenaUnittest_TestAllTypes.protoMessageName + ".NestedMessage"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "bb"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularInt32Field(value: &self.bb)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.bb != 0 {
try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage, rhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage) -> Bool {
if lhs.bb != rhs.bb {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestPackedTypes"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
90: .standard(proto: "packed_int32"),
91: .standard(proto: "packed_int64"),
92: .standard(proto: "packed_uint32"),
93: .standard(proto: "packed_uint64"),
94: .standard(proto: "packed_sint32"),
95: .standard(proto: "packed_sint64"),
96: .standard(proto: "packed_fixed32"),
97: .standard(proto: "packed_fixed64"),
98: .standard(proto: "packed_sfixed32"),
99: .standard(proto: "packed_sfixed64"),
100: .standard(proto: "packed_float"),
101: .standard(proto: "packed_double"),
102: .standard(proto: "packed_bool"),
103: .standard(proto: "packed_enum"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 90: try decoder.decodeRepeatedInt32Field(value: &self.packedInt32)
case 91: try decoder.decodeRepeatedInt64Field(value: &self.packedInt64)
case 92: try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32)
case 93: try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64)
case 94: try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32)
case 95: try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64)
case 96: try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32)
case 97: try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64)
case 98: try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32)
case 99: try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64)
case 100: try decoder.decodeRepeatedFloatField(value: &self.packedFloat)
case 101: try decoder.decodeRepeatedDoubleField(value: &self.packedDouble)
case 102: try decoder.decodeRepeatedBoolField(value: &self.packedBool)
case 103: try decoder.decodeRepeatedEnumField(value: &self.packedEnum)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.packedInt32.isEmpty {
try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90)
}
if !self.packedInt64.isEmpty {
try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91)
}
if !self.packedUint32.isEmpty {
try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92)
}
if !self.packedUint64.isEmpty {
try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93)
}
if !self.packedSint32.isEmpty {
try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94)
}
if !self.packedSint64.isEmpty {
try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95)
}
if !self.packedFixed32.isEmpty {
try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96)
}
if !self.packedFixed64.isEmpty {
try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97)
}
if !self.packedSfixed32.isEmpty {
try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98)
}
if !self.packedSfixed64.isEmpty {
try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99)
}
if !self.packedFloat.isEmpty {
try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100)
}
if !self.packedDouble.isEmpty {
try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101)
}
if !self.packedBool.isEmpty {
try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102)
}
if !self.packedEnum.isEmpty {
try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_TestPackedTypes, rhs: Proto3ArenaUnittest_TestPackedTypes) -> Bool {
if lhs.packedInt32 != rhs.packedInt32 {return false}
if lhs.packedInt64 != rhs.packedInt64 {return false}
if lhs.packedUint32 != rhs.packedUint32 {return false}
if lhs.packedUint64 != rhs.packedUint64 {return false}
if lhs.packedSint32 != rhs.packedSint32 {return false}
if lhs.packedSint64 != rhs.packedSint64 {return false}
if lhs.packedFixed32 != rhs.packedFixed32 {return false}
if lhs.packedFixed64 != rhs.packedFixed64 {return false}
if lhs.packedSfixed32 != rhs.packedSfixed32 {return false}
if lhs.packedSfixed64 != rhs.packedSfixed64 {return false}
if lhs.packedFloat != rhs.packedFloat {return false}
if lhs.packedDouble != rhs.packedDouble {return false}
if lhs.packedBool != rhs.packedBool {return false}
if lhs.packedEnum != rhs.packedEnum {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "repeated_int32"),
2: .standard(proto: "repeated_int64"),
3: .standard(proto: "repeated_uint32"),
4: .standard(proto: "repeated_uint64"),
5: .standard(proto: "repeated_sint32"),
6: .standard(proto: "repeated_sint64"),
7: .standard(proto: "repeated_fixed32"),
8: .standard(proto: "repeated_fixed64"),
9: .standard(proto: "repeated_sfixed32"),
10: .standard(proto: "repeated_sfixed64"),
11: .standard(proto: "repeated_float"),
12: .standard(proto: "repeated_double"),
13: .standard(proto: "repeated_bool"),
14: .standard(proto: "repeated_nested_enum"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32)
case 2: try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64)
case 3: try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32)
case 4: try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64)
case 5: try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32)
case 6: try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64)
case 7: try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32)
case 8: try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64)
case 9: try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32)
case 10: try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64)
case 11: try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat)
case 12: try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble)
case 13: try decoder.decodeRepeatedBoolField(value: &self.repeatedBool)
case 14: try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.repeatedInt32.isEmpty {
try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1)
}
if !self.repeatedInt64.isEmpty {
try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2)
}
if !self.repeatedUint32.isEmpty {
try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3)
}
if !self.repeatedUint64.isEmpty {
try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4)
}
if !self.repeatedSint32.isEmpty {
try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5)
}
if !self.repeatedSint64.isEmpty {
try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6)
}
if !self.repeatedFixed32.isEmpty {
try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7)
}
if !self.repeatedFixed64.isEmpty {
try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8)
}
if !self.repeatedSfixed32.isEmpty {
try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9)
}
if !self.repeatedSfixed64.isEmpty {
try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10)
}
if !self.repeatedFloat.isEmpty {
try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11)
}
if !self.repeatedDouble.isEmpty {
try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12)
}
if !self.repeatedBool.isEmpty {
try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13)
}
if !self.repeatedNestedEnum.isEmpty {
try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_TestUnpackedTypes, rhs: Proto3ArenaUnittest_TestUnpackedTypes) -> Bool {
if lhs.repeatedInt32 != rhs.repeatedInt32 {return false}
if lhs.repeatedInt64 != rhs.repeatedInt64 {return false}
if lhs.repeatedUint32 != rhs.repeatedUint32 {return false}
if lhs.repeatedUint64 != rhs.repeatedUint64 {return false}
if lhs.repeatedSint32 != rhs.repeatedSint32 {return false}
if lhs.repeatedSint64 != rhs.repeatedSint64 {return false}
if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false}
if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false}
if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false}
if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false}
if lhs.repeatedFloat != rhs.repeatedFloat {return false}
if lhs.repeatedDouble != rhs.repeatedDouble {return false}
if lhs.repeatedBool != rhs.repeatedBool {return false}
if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "child"),
2: .same(proto: "payload"),
3: .standard(proto: "repeated_child"),
]
fileprivate class _StorageClass {
var _child: Proto3ArenaUnittest_NestedTestAllTypes? = nil
var _payload: Proto3ArenaUnittest_TestAllTypes? = nil
var _repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] = []
static let defaultInstance = _StorageClass()
private init() {}
init(copying source: _StorageClass) {
_child = source._child
_payload = source._payload
_repeatedChild = source._repeatedChild
}
}
fileprivate mutating func _uniqueStorage() -> _StorageClass {
if !isKnownUniquelyReferenced(&_storage) {
_storage = _StorageClass(copying: _storage)
}
return _storage
}
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
_ = _uniqueStorage()
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularMessageField(value: &_storage._child)
case 2: try decoder.decodeSingularMessageField(value: &_storage._payload)
case 3: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedChild)
default: break
}
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
if let v = _storage._child {
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
}
if let v = _storage._payload {
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
}
if !_storage._repeatedChild.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._repeatedChild, fieldNumber: 3)
}
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_NestedTestAllTypes, rhs: Proto3ArenaUnittest_NestedTestAllTypes) -> Bool {
if lhs._storage !== rhs._storage {
let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
let _storage = _args.0
let rhs_storage = _args.1
if _storage._child != rhs_storage._child {return false}
if _storage._payload != rhs_storage._payload {return false}
if _storage._repeatedChild != rhs_storage._repeatedChild {return false}
return true
}
if !storagesAreEqual {return false}
}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ForeignMessage"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "c"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
case 1: try decoder.decodeSingularInt32Field(value: &self.c)
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.c != 0 {
try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_ForeignMessage, rhs: Proto3ArenaUnittest_ForeignMessage) -> Bool {
if lhs.c != rhs.c {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Proto3ArenaUnittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage"
static let _protobuf_nameMap = SwiftProtobuf._NameMap()
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let _ = try decoder.nextFieldNumber() {
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: Proto3ArenaUnittest_TestEmptyMessage, rhs: Proto3ArenaUnittest_TestEmptyMessage) -> Bool {
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
|
{
"pile_set_name": "Github"
}
|
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable import/no-mutable-exports */
let CURRENT = 'NULL';
/**
* use authority or getAuthority
* @param {string|()=>String} currentAuthority
*/
const renderAuthorize = Authorized => currentAuthority => {
if (currentAuthority) {
if (typeof currentAuthority === 'function') {
CURRENT = currentAuthority();
}
if (
Object.prototype.toString.call(currentAuthority) === '[object String]' ||
Array.isArray(currentAuthority)
) {
CURRENT = currentAuthority;
}
} else {
CURRENT = 'NULL';
}
return Authorized;
};
export { CURRENT };
export default Authorized => renderAuthorize(Authorized);
|
{
"pile_set_name": "Github"
}
|
/*=============================================================================
Copyright (c) 2018 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#define BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/mpl/and.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Sequence>
struct is_native_fusion_sequence
: mpl::and_<
is_complete<Sequence>
, is_convertible<Sequence, detail::from_sequence_convertible_type>
>
{};
}}}
#endif
|
{
"pile_set_name": "Github"
}
|
// This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not %target-swift-frontend %s -emit-ir
protocol 0{class TextOutputStream
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include <errno.h>
#include "bio_lcl.h"
#include "internal/cryptlib.h"
/*
* BIO_put and BIO_get both add to the digest, BIO_gets returns the digest
*/
static int nullf_write(BIO *h, const char *buf, int num);
static int nullf_read(BIO *h, char *buf, int size);
static int nullf_puts(BIO *h, const char *str);
static int nullf_gets(BIO *h, char *str, int size);
static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
static long nullf_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
static const BIO_METHOD methods_nullf = {
BIO_TYPE_NULL_FILTER,
"NULL filter",
/* TODO: Convert to new style write function */
bwrite_conv,
nullf_write,
/* TODO: Convert to new style read function */
bread_conv,
nullf_read,
nullf_puts,
nullf_gets,
nullf_ctrl,
NULL,
NULL,
nullf_callback_ctrl,
};
const BIO_METHOD *BIO_f_null(void)
{
return &methods_nullf;
}
static int nullf_read(BIO *b, char *out, int outl)
{
int ret = 0;
if (out == NULL)
return 0;
if (b->next_bio == NULL)
return 0;
ret = BIO_read(b->next_bio, out, outl);
BIO_clear_retry_flags(b);
BIO_copy_next_retry(b);
return ret;
}
static int nullf_write(BIO *b, const char *in, int inl)
{
int ret = 0;
if ((in == NULL) || (inl <= 0))
return 0;
if (b->next_bio == NULL)
return 0;
ret = BIO_write(b->next_bio, in, inl);
BIO_clear_retry_flags(b);
BIO_copy_next_retry(b);
return ret;
}
static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
{
long ret;
if (b->next_bio == NULL)
return 0;
switch (cmd) {
case BIO_C_DO_STATE_MACHINE:
BIO_clear_retry_flags(b);
ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
BIO_copy_next_retry(b);
break;
case BIO_CTRL_DUP:
ret = 0L;
break;
default:
ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
}
return ret;
}
static long nullf_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
{
long ret = 1;
if (b->next_bio == NULL)
return 0;
switch (cmd) {
default:
ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
break;
}
return ret;
}
static int nullf_gets(BIO *bp, char *buf, int size)
{
if (bp->next_bio == NULL)
return 0;
return BIO_gets(bp->next_bio, buf, size);
}
static int nullf_puts(BIO *bp, const char *str)
{
if (bp->next_bio == NULL)
return 0;
return BIO_puts(bp->next_bio, str);
}
|
{
"pile_set_name": "Github"
}
|
#include "api_config.h"
#include "common.h"
#include <iostream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/algorithm/string.hpp>
// === implementation of the api_config class ===
using namespace lsl;
using namespace lslboost::algorithm;
/// Helper function: Substitute the "~" character by the full home directory (according to environment variables).
std::string expand_tilde(const std::string &filename) {
if (!filename.empty() && filename[0] == '~') {
std::string homedir;
if (getenv("HOME"))
homedir = getenv("HOME");
else if (getenv("USERPROFILE"))
homedir = getenv("USERPROFILE");
else if (getenv("HOMEDRIVE") && getenv("HOMEPATH"))
homedir = std::string(getenv("HOMEDRIVE")) + getenv("HOMEPATH");
else {
std::cerr << "Cannot determine the user's home directory; config files in the home directory will not be discovered." << std::endl;
return filename;
}
return homedir + filename.substr(1);
}
return filename;
}
/// Helper function: Parse a set specifier (a string of the form {a, b, c, ...}) into a vector of strings.
static std::vector<std::string> parse_set(const std::string &setstr) {
std::vector<std::string> result;
if ((setstr.size() > 2) && setstr[0] == '{' && setstr[setstr.size()-1] == '}') {
// non-empty set: split by ","
std::string sub = setstr.substr(1,setstr.size()-2);
lslboost::algorithm::split(result,sub,lslboost::algorithm::is_any_of(","));
// remove leading and trailing whitespace from each element
for (std::vector<std::string>::iterator i=result.begin(); i!=result.end(); i++)
trim(*i);
}
return result;
}
// Returns true if the file exists and is openable for reading
bool file_is_readable(const std::string& filename) {
std::ifstream f(filename.c_str());
return f.good();
}
/**
* Constructor.
* Applies default settings and overrides them based on a config file (if present).
*/
api_config::api_config() {
// for each config file location under consideration...
std::string filenames[] = {"lsl_api.cfg", expand_tilde("~/lsl_api/lsl_api.cfg"), "/etc/lsl_api/lsl_api.cfg"};
for (std::size_t k=0; k < sizeof(filenames)/sizeof(filenames[0]); k++) {
try {
if (file_is_readable(filenames[k])) {
// try to load it if the file exists
load_from_file(filenames[k]);
// successful: finished
return;
}
} catch(std::exception &e) {
std::cerr << "Error trying to load config file " << filenames[k] << ": " << e.what() << std::endl;
}
}
// unsuccessful: load default settings
load_from_file();
}
/**
* Load a configuration file (or use defaults if a filename is empty).
* Expects a proper platform-native file name. Throws if there's an error.
*/
void api_config::load_from_file(const std::string &filename) {
try {
lslboost::property_tree::ptree pt;
if (!filename.empty())
read_ini(filename, pt);
// read out the [ports] parameters
multicast_port_ = pt.get("ports.MulticastPort",16571);
base_port_ = pt.get("ports.BasePort",16572);
port_range_ = pt.get("ports.PortRange",32);
allow_random_ports_ = pt.get("ports.AllowRandomPorts",true);
#ifdef __APPLE__
ipv6_ = pt.get("ports.IPv6","disable"); // on Mac OS (10.7) there's a bug in the IPv6 implementation that breaks LSL when it tries to use both v4 and v6
#else
ipv6_ = pt.get("ports.IPv6","allow");
#endif
// fix some common mis-spellings
if (ipv6_ == "disabled")
ipv6_ = "disable";
if (ipv6_ == "allowed")
ipv6_ = "allow";
if (ipv6_ == "forced")
ipv6_ = "force";
if (ipv6_ != "disable" && ipv6_ != "allow" && ipv6_ != "force")
throw std::runtime_error("Unsupported setting for the IPv6 parameter.");
// read the [multicast] parameters
resolve_scope_ = pt.get("multicast.ResolveScope","site");
listen_address_ = pt.get("multicast.ListenAddress","");
std::vector<std::string> machine_group = parse_set(pt.get("multicast.MachineAddresses","{127.0.0.1, FF31:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> link_group = parse_set(pt.get("multicast.LinkAddresses","{255.255.255.255, 224.0.0.183, FF02:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> site_group = parse_set(pt.get("multicast.SiteAddresses","{239.255.172.215, FF05:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> organization_group = parse_set(pt.get("multicast.OrganizationAddresses","{239.192.172.215, FF08:113D:6FDD:2C17:A643:FFE2:1BD1:3CD2}"));
std::vector<std::string> global_group = parse_set(pt.get("multicast.GlobalAddresses","{}"));
multicast_ttl_ = -1;
// construct list of addresses & TTL according to the ResolveScope.
if (resolve_scope_ == "machine") {
multicast_addresses_ = machine_group;
multicast_ttl_ = 0;
}
if (resolve_scope_ == "link") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_ttl_ = 1;
}
if (resolve_scope_ == "site") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_ttl_ = 24;
}
if (resolve_scope_ == "organization") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),organization_group.begin(),organization_group.end());
multicast_ttl_ = 32;
}
if (resolve_scope_ == "global") {
multicast_addresses_ = machine_group;
multicast_addresses_.insert(multicast_addresses_.end(),link_group.begin(),link_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),site_group.begin(),site_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),organization_group.begin(),organization_group.end());
multicast_addresses_.insert(multicast_addresses_.end(),global_group.begin(),global_group.end());
multicast_ttl_ = 255;
}
if (multicast_ttl_ == -1)
throw std::runtime_error("This ResolveScope setting is unsupported.");
// apply overrides, if any
int ttl_override = pt.get("multicast.TTLOverride",-1);
std::vector<std::string> address_override = parse_set(pt.get("multicast.AddressesOverride","{}"));
if (ttl_override >= 0)
multicast_ttl_ = ttl_override;
if (!address_override.empty())
multicast_addresses_ = address_override;
// read the [lab] settings
known_peers_ = parse_set(pt.get("lab.KnownPeers","{}"));
session_id_ = pt.get("lab.SessionID","default");
// read the [tuning] settings
use_protocol_version_ = std::min(LSL_PROTOCOL_VERSION,pt.get("tuning.UseProtocolVersion",LSL_PROTOCOL_VERSION));
watchdog_check_interval_ = pt.get("tuning.WatchdogCheckInterval",15.0);
watchdog_time_threshold_ = pt.get("tuning.WatchdogTimeThreshold",15.0);
multicast_min_rtt_ = pt.get("tuning.MulticastMinRTT",0.5);
multicast_max_rtt_ = pt.get("tuning.MulticastMaxRTT",3.0);
unicast_min_rtt_ = pt.get("tuning.UnicastMinRTT",0.75);
unicast_max_rtt_ = pt.get("tuning.UnicastMaxRTT",5.0);
continuous_resolve_interval_ = pt.get("tuning.ContinuousResolveInterval",0.5);
timer_resolution_ = pt.get("tuning.TimerResolution",1);
max_cached_queries_ = pt.get("tuning.MaxCachedQueries",100);
time_update_interval_ = pt.get("tuning.TimeUpdateInterval",2.0);
time_update_minprobes_ = pt.get("tuning.TimeUpdateMinProbes",6);
time_probe_count_ = pt.get("tuning.TimeProbeCount",8);
time_probe_interval_ = pt.get("tuning.TimeProbeInterval",0.064);
time_probe_max_rtt_ = pt.get("tuning.TimeProbeMaxRTT",0.128);
outlet_buffer_reserve_ms_ = pt.get("tuning.OutletBufferReserveMs",5000);
outlet_buffer_reserve_samples_ = pt.get("tuning.OutletBufferReserveSamples",128);
inlet_buffer_reserve_ms_ = pt.get("tuning.InletBufferReserveMs",5000);
inlet_buffer_reserve_samples_ = pt.get("tuning.InletBufferReserveSamples",128);
smoothing_halftime_ = pt.get("tuning.SmoothingHalftime",90.0f);
force_default_timestamps_ = pt.get("tuning.ForceDefaultTimestamps", false);
} catch(std::exception &e) {
std::cerr << "Error parsing config file " << filename << " (" << e.what() << "). Rolling back to defaults." << std::endl;
// any error: assign defaults
load_from_file();
// and rethrow
throw e;
}
}
/**
* Instantiate / retrieve singleton.
*/
const api_config *api_config::get_instance() {
lslboost::call_once(&called_once,once_flag);
return get_instance_internal();
}
api_config *api_config::get_instance_internal() {
static api_config cfg;
return &cfg;
}
void api_config::called_once() { get_instance_internal(); }
lslboost::once_flag api_config::once_flag = BOOST_ONCE_INIT;
|
{
"pile_set_name": "Github"
}
|
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('mock', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg, undefined);
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock from package', function (t) {
t.plan(8);
var files = {};
files[path.resolve('/foo/bar/baz.js')] = 'beep';
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, file));
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[file]);
}
};
}
resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/bar/baz.js'));
t.equal(pkg && pkg.main, 'bar');
});
resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');
});
});
test('mock package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
test('mock package from package', function (t) {
t.plan(2);
var files = {};
files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep';
files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({
main: './baz.js'
});
function opts(basedir) {
return {
basedir: path.resolve(basedir),
isFile: function (file, cb) {
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
},
'package': { main: 'bar' },
readFile: function (file, cb) {
cb(null, files[path.resolve(file)]);
}
};
}
resolve('bar', opts('/foo'), function (err, res, pkg) {
if (err) return t.fail(err);
t.equal(res, path.resolve('/foo/node_modules/bar/baz.js'));
t.equal(pkg && pkg.main, './baz.js');
});
});
|
{
"pile_set_name": "Github"
}
|
def extractLambytlWordpressCom(item):
'''
Parser for 'lambytl.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('King of Classical Music', 'King of Classical Music', 'translated'),
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for tagname, name, tl_type in tagmap:
if tagname in item['tags']:
return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type)
return False
|
{
"pile_set_name": "Github"
}
|
import fetch from 'dva/fetch';
import { notification } from 'antd';
function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
}
notification.error({
message: `请求错误 ${response.status}: ${response.url}`,
description: response.statusText,
});
const error = new Error(response.statusText);
error.response = response;
throw error;
}
/**
* Requests a URL, returning a promise.
*
* @param {string} url The URL we want to request
* @param {object} [options] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err"
*/
export default function request(url, options) {
const defaultOptions = {
credentials: 'include',
};
const newOptions = { ...defaultOptions, ...options };
if (newOptions.method === 'POST' || newOptions.method === 'PUT') {
newOptions.headers = {
Accept: 'application/json',
'Content-Type': 'application/json; charset=utf-8',
...newOptions.headers,
};
newOptions.body = JSON.stringify(newOptions.body);
}
return fetch(url, newOptions)
.then(checkStatus)
.then(response => response.json())
.catch((error) => {
if (error.code) {
notification.error({
message: error.name,
description: error.message,
});
}
if ('stack' in error && 'message' in error) {
notification.error({
message: `request error: ${url}`,
description: error.message,
});
}
return error;
});
}
|
{
"pile_set_name": "Github"
}
|
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/apply_wrap.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename F
, typename has_apply_ = typename aux::has_apply<F>::type
>
struct apply_wrap0
: F::template apply< >
{
};
template<
typename F, typename T1
>
struct apply_wrap1
: F::template apply<T1>
{
};
template<
typename F, typename T1, typename T2
>
struct apply_wrap2
: F::template apply< T1,T2 >
{
};
template<
typename F, typename T1, typename T2, typename T3
>
struct apply_wrap3
: F::template apply< T1,T2,T3 >
{
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
struct apply_wrap4
: F::template apply< T1,T2,T3,T4 >
{
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct apply_wrap5
: F::template apply< T1,T2,T3,T4,T5 >
{
};
}}
|
{
"pile_set_name": "Github"
}
|
export type ModuleAddress =
ModuleAddress.GitHubRepo |
ModuleAddress.GitHubRawUrl |
ModuleAddress.DenoLandUrl
;
export namespace ModuleAddress {
/** e.g: "github:userOrOrg/repositoryName#branch" */
export type GitHubRepo = {
type: "GITHUB REPO";
userOrOrg: string;
repositoryName: string;
branch?: string;
};
export namespace GitHubRepo {
/**
* Input example
* KSXGitHub/simple-js-yaml-port-for-deno or
* github:KSXGitHub/simple-js-yaml-port-for-deno or
* KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or
* github:KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or
*/
export function parse(
raw: string
): GitHubRepo {
const match = raw.match(/^(?:github:\s*)?([^\/]*)\/([^\/]+)$/i)!;
const [repositoryName, branch] = match[2].split("#");
return {
"type": "GITHUB REPO",
"userOrOrg": match[1],
repositoryName,
branch
};
}
/** Match valid parse input */
export function match(raw: string): boolean {
return /^(?:github:)?[^\/\:]+\/[^\/]+$/.test(raw);
}
}
/** https://raw.githubusercontent.com/user/repo/branch/path/to/file.ts */
export type GitHubRawUrl = {
type: "GITHUB-RAW URL"
baseUrlWithoutBranch: string;
pathToIndex: string;
branch: string;
};
export namespace GitHubRawUrl {
export function parse(raw: string): GitHubRawUrl {
const match = raw.match(
/^(https?:\/\/raw\.github(?:usercontent)?\.com\/[^\/]+\/[^\/]+\/)([^\/]+)\/(.*)$/
)!;
return {
"type": "GITHUB-RAW URL",
"baseUrlWithoutBranch": match[1]
.replace(
/^https?:\/\/raw\.github(?:usercontent)?/,
"https://raw.githubusercontent"
)
.replace(/\/$/, "")
,
"branch": match[2],
"pathToIndex": match[3]
};
}
export function match(raw: string): boolean {
return /^https?:\/\/raw\.github(?:usercontent)?\.com/.test(raw);
}
}
/** e.g: https://deno.land/x/foo@1.2.3/mod.js */
export type DenoLandUrl = {
type: "DENO.LAND URL"
isStd: boolean;
baseUrlWithoutBranch: string;
pathToIndex: string;
branch?: string;
};
export namespace DenoLandUrl {
export function parse(raw: string): DenoLandUrl {
const isStd = /^https?:\/\/deno\.land\/std/.test(raw);
const match = isStd ?
raw.match(/^(https?:\/\/deno\.land\/std)([@\/].*)$/)! :
raw.match(/^(https?:\/\/deno\.land\/x\/[^@\/]+)([@\/].*)$/)!
;
// https://deno.land/std@master/node/querystring.ts
// [1]: https://deno.land/std
// [2]: @master/node/querystring.ts
// https://deno.land/std/node/querystring.ts
// [1]: https://deno.land/std
// [2]: /node/querystring.ts
//https://deno.land/x/foo@1.2.3/mod.js
// [1]: https://deno.land/x/foo
// [2]: @1.2.3/mod.js
//https://deno.land/x/foo/mod.js
// [1]: https://deno.land/x/foo
// [2]: /mod.js
const { branch, pathToIndex } = match[2].startsWith("@") ? (() => {
const [
, branch, // 1.2.3
pathToIndex // mod.js
] = match[2].match(/^@([^\/]+)\/(.*)$/)!;
return { branch, pathToIndex }
})() : ({
"branch": undefined,
"pathToIndex": match[2].replace(/^\//, "") // mod.js
});
return {
"type": "DENO.LAND URL",
isStd,
"baseUrlWithoutBranch": match[1],
"branch": branch,
pathToIndex
};
}
export function match(raw: string): boolean {
return /^https?:\/\/deno\.land\/(?:(?:std)|(?:x))[\/|@]/.test(raw);
}
}
export function parse(raw: string): ModuleAddress {
for (const ns of [GitHubRepo, GitHubRawUrl, DenoLandUrl]) {
if (!ns.match(raw)) {
continue;
}
return ns.parse(raw);
}
throw new Error(`${raw} is not a valid module address`);
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package org.activiti.designer.validation.bpmn20.bundle;
/**
* Plugin constants for the org.activiti.designer.validation.bpmn20 bundle.
*
* @author Tiese Barrell
* @version 1
* @since 5.6
*
*/
public final class PluginConstants {
public static final String VALIDATOR_ID = "com.atosorigin.esuite.editor.process.validation.ESuiteProcessValidator";
public static final String VALIDATOR_NAME = "E-Suite Process Validator";
public static final String FORMAT_NAME = "E-Suite ZaakType jPDL";
public static final String MARKER_MESSAGE_PATTERN = "[%s] %s";
public static final int WORK_CLEAR_MARKERS = 5;
public static final int WORK_EXTRACT_CONSTRUCTS = 20;
public static final int WORK_USER_TASK = 10;
public static final int WORK_SCRIPT_TASK = 10;
public static final int WORK_SERVICE_TASK = 10;
public static final int WORK_SEQUENCE_FLOW = 10;
public static final int WORK_SUB_PROCESS = 10;
public static final int WORK_TOTAL = WORK_CLEAR_MARKERS + WORK_EXTRACT_CONSTRUCTS + WORK_USER_TASK + WORK_SCRIPT_TASK + WORK_SERVICE_TASK
+ WORK_SEQUENCE_FLOW + WORK_SUB_PROCESS;
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
module.exports = function(Chart) {
var helpers = Chart.helpers;
function filterByPosition(array, position) {
return helpers.where(array, function(v) {
return v.position === position;
});
}
function sortByWeight(array, reverse) {
array.forEach(function(v, i) {
v._tmpIndex_ = i;
return v;
});
array.sort(function(a, b) {
var v0 = reverse ? b : a;
var v1 = reverse ? a : b;
return v0.weight === v1.weight ?
v0._tmpIndex_ - v1._tmpIndex_ :
v0.weight - v1.weight;
});
array.forEach(function(v) {
delete v._tmpIndex_;
});
}
/**
* @interface ILayoutItem
* @prop {String} position - The position of the item in the chart layout. Possible values are
* 'left', 'top', 'right', 'bottom', and 'chartArea'
* @prop {Number} weight - The weight used to sort the item. Higher weights are further away from the chart area
* @prop {Boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down
* @prop {Function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)
* @prop {Function} update - Takes two parameters: width and height. Returns size of item
* @prop {Function} getPadding - Returns an object with padding on the edges
* @prop {Number} width - Width of item. Must be valid after update()
* @prop {Number} height - Height of item. Must be valid after update()
* @prop {Number} left - Left edge of the item. Set by layout system and cannot be used in update
* @prop {Number} top - Top edge of the item. Set by layout system and cannot be used in update
* @prop {Number} right - Right edge of the item. Set by layout system and cannot be used in update
* @prop {Number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update
*/
// The layout service is very self explanatory. It's responsible for the layout within a chart.
// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
// It is this service's responsibility of carrying out that layout.
Chart.layoutService = {
defaults: {},
/**
* Register a box to a chart.
* A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
* @param {Chart} chart - the chart to use
* @param {ILayoutItem} item - the item to add to be layed out
*/
addBox: function(chart, item) {
if (!chart.boxes) {
chart.boxes = [];
}
// initialize item with default values
item.fullWidth = item.fullWidth || false;
item.position = item.position || 'top';
item.weight = item.weight || 0;
chart.boxes.push(item);
},
/**
* Remove a layoutItem from a chart
* @param {Chart} chart - the chart to remove the box from
* @param {Object} layoutItem - the item to remove from the layout
*/
removeBox: function(chart, layoutItem) {
var index = chart.boxes? chart.boxes.indexOf(layoutItem) : -1;
if (index !== -1) {
chart.boxes.splice(index, 1);
}
},
/**
* Sets (or updates) options on the given `item`.
* @param {Chart} chart - the chart in which the item lives (or will be added to)
* @param {Object} item - the item to configure with the given options
* @param {Object} options - the new item options.
*/
configure: function(chart, item, options) {
var props = ['fullWidth', 'position', 'weight'];
var ilen = props.length;
var i = 0;
var prop;
for (; i<ilen; ++i) {
prop = props[i];
if (options.hasOwnProperty(prop)) {
item[prop] = options[prop];
}
}
},
/**
* Fits boxes of the given chart into the given size by having each box measure itself
* then running a fitting algorithm
* @param {Chart} chart - the chart
* @param {Number} width - the width to fit into
* @param {Number} height - the height to fit into
*/
update: function(chart, width, height) {
if (!chart) {
return;
}
var layoutOptions = chart.options.layout;
var padding = layoutOptions ? layoutOptions.padding : null;
var leftPadding = 0;
var rightPadding = 0;
var topPadding = 0;
var bottomPadding = 0;
if (!isNaN(padding)) {
// options.layout.padding is a number. assign to all
leftPadding = padding;
rightPadding = padding;
topPadding = padding;
bottomPadding = padding;
} else {
leftPadding = padding.left || 0;
rightPadding = padding.right || 0;
topPadding = padding.top || 0;
bottomPadding = padding.bottom || 0;
}
var leftBoxes = filterByPosition(chart.boxes, 'left');
var rightBoxes = filterByPosition(chart.boxes, 'right');
var topBoxes = filterByPosition(chart.boxes, 'top');
var bottomBoxes = filterByPosition(chart.boxes, 'bottom');
var chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');
// Sort boxes by weight. A higher weight is further away from the chart area
sortByWeight(leftBoxes, true);
sortByWeight(rightBoxes, false);
sortByWeight(topBoxes, true);
sortByWeight(bottomBoxes, false);
// Essentially we now have any number of boxes on each of the 4 sides.
// Our canvas looks like the following.
// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
// B1 is the bottom axis
// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
// These locations are single-box locations only, when trying to register a chartArea location that is already taken,
// an error will be thrown.
//
// |----------------------------------------------------|
// | T1 (Full Width) |
// |----------------------------------------------------|
// | | | T2 | |
// | |----|-------------------------------------|----|
// | | | C1 | | C2 | |
// | | |----| |----| |
// | | | | |
// | L1 | L2 | ChartArea (C0) | R1 |
// | | | | |
// | | |----| |----| |
// | | | C3 | | C4 | |
// | |----|-------------------------------------|----|
// | | | B1 | |
// |----------------------------------------------------|
// | B2 (Full Width) |
// |----------------------------------------------------|
//
// What we do to find the best sizing, we do the following
// 1. Determine the minimum size of the chart area.
// 2. Split the remaining width equally between each vertical axis
// 3. Split the remaining height equally between each horizontal axis
// 4. Give each layout the maximum size it can be. The layout will return it's minimum size
// 5. Adjust the sizes of each axis based on it's minimum reported size.
// 6. Refit each axis
// 7. Position each axis in the final location
// 8. Tell the chart the final location of the chart area
// 9. Tell any axes that overlay the chart area the positions of the chart area
// Step 1
var chartWidth = width - leftPadding - rightPadding;
var chartHeight = height - topPadding - bottomPadding;
var chartAreaWidth = chartWidth / 2; // min 50%
var chartAreaHeight = chartHeight / 2; // min 50%
// Step 2
var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);
// Step 3
var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);
// Step 4
var maxChartAreaWidth = chartWidth;
var maxChartAreaHeight = chartHeight;
var minBoxSizes = [];
function getMinimumBoxSize(box) {
var minSize;
var isHorizontal = box.isHorizontal();
if (isHorizontal) {
minSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);
maxChartAreaHeight -= minSize.height;
} else {
minSize = box.update(verticalBoxWidth, chartAreaHeight);
maxChartAreaWidth -= minSize.width;
}
minBoxSizes.push({
horizontal: isHorizontal,
minSize: minSize,
box: box,
});
}
helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
// If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)
var maxHorizontalLeftPadding = 0;
var maxHorizontalRightPadding = 0;
var maxVerticalTopPadding = 0;
var maxVerticalBottomPadding = 0;
helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {
if (horizontalBox.getPadding) {
var boxPadding = horizontalBox.getPadding();
maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);
maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);
}
});
helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {
if (verticalBox.getPadding) {
var boxPadding = verticalBox.getPadding();
maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);
maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);
}
});
// At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could
// be if the axes are drawn at their minimum sizes.
// Steps 5 & 6
var totalLeftBoxesWidth = leftPadding;
var totalRightBoxesWidth = rightPadding;
var totalTopBoxesHeight = topPadding;
var totalBottomBoxesHeight = bottomPadding;
// Function to fit a box
function fitBox(box) {
var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
return minBox.box === box;
});
if (minBoxSize) {
if (box.isHorizontal()) {
var scaleMargin = {
left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),
right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),
top: 0,
bottom: 0
};
// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
// on the margin. Sometimes they need to increase in size slightly
box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
} else {
box.update(minBoxSize.minSize.width, maxChartAreaHeight);
}
}
}
// Update, and calculate the left and right margins for the horizontal boxes
helpers.each(leftBoxes.concat(rightBoxes), fitBox);
helpers.each(leftBoxes, function(box) {
totalLeftBoxesWidth += box.width;
});
helpers.each(rightBoxes, function(box) {
totalRightBoxesWidth += box.width;
});
// Set the Left and Right margins for the horizontal boxes
helpers.each(topBoxes.concat(bottomBoxes), fitBox);
// Figure out how much margin is on the top and bottom of the vertical boxes
helpers.each(topBoxes, function(box) {
totalTopBoxesHeight += box.height;
});
helpers.each(bottomBoxes, function(box) {
totalBottomBoxesHeight += box.height;
});
function finalFitVerticalBox(box) {
var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {
return minSize.box === box;
});
var scaleMargin = {
left: 0,
right: 0,
top: totalTopBoxesHeight,
bottom: totalBottomBoxesHeight
};
if (minBoxSize) {
box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);
}
}
// Let the left layout know the final margin
helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);
// Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)
totalLeftBoxesWidth = leftPadding;
totalRightBoxesWidth = rightPadding;
totalTopBoxesHeight = topPadding;
totalBottomBoxesHeight = bottomPadding;
helpers.each(leftBoxes, function(box) {
totalLeftBoxesWidth += box.width;
});
helpers.each(rightBoxes, function(box) {
totalRightBoxesWidth += box.width;
});
helpers.each(topBoxes, function(box) {
totalTopBoxesHeight += box.height;
});
helpers.each(bottomBoxes, function(box) {
totalBottomBoxesHeight += box.height;
});
// We may be adding some padding to account for rotated x axis labels
var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);
totalLeftBoxesWidth += leftPaddingAddition;
totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);
var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);
totalTopBoxesHeight += topPaddingAddition;
totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);
// Figure out if our chart area changed. This would occur if the dataset layout label rotation
// changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
// without calling `fit` again
var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;
var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;
if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {
helpers.each(leftBoxes, function(box) {
box.height = newMaxChartAreaHeight;
});
helpers.each(rightBoxes, function(box) {
box.height = newMaxChartAreaHeight;
});
helpers.each(topBoxes, function(box) {
if (!box.fullWidth) {
box.width = newMaxChartAreaWidth;
}
});
helpers.each(bottomBoxes, function(box) {
if (!box.fullWidth) {
box.width = newMaxChartAreaWidth;
}
});
maxChartAreaHeight = newMaxChartAreaHeight;
maxChartAreaWidth = newMaxChartAreaWidth;
}
// Step 7 - Position the boxes
var left = leftPadding + leftPaddingAddition;
var top = topPadding + topPaddingAddition;
function placeBox(box) {
if (box.isHorizontal()) {
box.left = box.fullWidth ? leftPadding : totalLeftBoxesWidth;
box.right = box.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;
box.top = top;
box.bottom = top + box.height;
// Move to next point
top = box.bottom;
} else {
box.left = left;
box.right = left + box.width;
box.top = totalTopBoxesHeight;
box.bottom = totalTopBoxesHeight + maxChartAreaHeight;
// Move to next point
left = box.right;
}
}
helpers.each(leftBoxes.concat(topBoxes), placeBox);
// Account for chart width and height
left += maxChartAreaWidth;
top += maxChartAreaHeight;
helpers.each(rightBoxes, placeBox);
helpers.each(bottomBoxes, placeBox);
// Step 8
chart.chartArea = {
left: totalLeftBoxesWidth,
top: totalTopBoxesHeight,
right: totalLeftBoxesWidth + maxChartAreaWidth,
bottom: totalTopBoxesHeight + maxChartAreaHeight
};
// Step 9
helpers.each(chartAreaBoxes, function(box) {
box.left = chart.chartArea.left;
box.top = chart.chartArea.top;
box.right = chart.chartArea.right;
box.bottom = chart.chartArea.bottom;
box.update(maxChartAreaWidth, maxChartAreaHeight);
});
}
};
};
|
{
"pile_set_name": "Github"
}
|
--- a/pppd/sha1.c
+++ b/pppd/sha1.c
@@ -18,7 +18,7 @@
#include <string.h>
#include <netinet/in.h> /* htonl() */
-#include <net/ppp_defs.h>
+#include "pppd.h"
#include "sha1.h"
static void
|
{
"pile_set_name": "Github"
}
|
<?xml version='1.0' ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="include/StorageFunctions.xsl"/>
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:element name="StorageObjects">
<xsl:apply-templates select="Strings"/>
<xsl:call-template name="TaskingInfo">
<xsl:with-param name="info" select="TaskingInfo"/>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template match="Strings">
<xsl:element name="ObjectValue">
<xsl:attribute name="name">Strings</xsl:attribute>
<xsl:apply-templates select="String"/>
</xsl:element>
</xsl:template>
<xsl:template match="String">
<xsl:element name="ObjectValue">
<xsl:attribute name="name">String</xsl:attribute>
<xsl:element name="StringValue">
<xsl:attribute name="name">string</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<xsl:element name="IntValue">
<xsl:attribute name="name">offset</xsl:attribute>
<xsl:value-of select="@offset"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:transform>
|
{
"pile_set_name": "Github"
}
|
package io.quarkus.it.panache;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
@Entity
@IdClass(ObjectWithCompositeId.ObjectKey.class)
public class ObjectWithCompositeId extends PanacheEntityBase {
@Id
public String part1;
@Id
public String part2;
public String description;
static class ObjectKey implements Serializable {
private String part1;
private String part2;
public ObjectKey() {
}
public ObjectKey(String part1, String part2) {
this.part1 = part1;
this.part2 = part2;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ObjectKey objectKey = (ObjectKey) o;
return part1.equals(objectKey.part1) &&
part2.equals(objectKey.part2);
}
@Override
public int hashCode() {
return Objects.hash(part1, part2);
}
}
}
|
{
"pile_set_name": "Github"
}
|
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
# Compiled at: 2012-05-08 15:43:06
pass
|
{
"pile_set_name": "Github"
}
|
{{ define "shared/style" }}
<link rel="stylesheet" href={{ Mix "/css/app.css" }}>
{{ end }}
|
{
"pile_set_name": "Github"
}
|
use azure_sdk_storage_core::{EndpointProtocol, ConnectionStringBuilder};
pub fn main() {
let account_name =
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
let account_key = std::env::var("ACCOUNT_KEY").expect("Set env variable ACCOUNT_KEY first!");
let default_endpoints_protocol = std::env::var("DEFAULT_ENDPOINTS_PROTOCOL")
.expect("Set env variable DEFAULT_ENDPOINTS_PROTOCOL first!");
let default_endpoints_protocol = match &default_endpoints_protocol[..] {
"https" => EndpointProtocol::Https,
"http" => EndpointProtocol::Http,
_ => panic!("Invalid default endpoints protocol")
};
let connection_string = ConnectionStringBuilder::new()
.with_account_name(&account_name)
.with_account_key(&account_key)
.with_default_endpoints_protocol(default_endpoints_protocol)
.build();
println!("The connection string is: '{}'", connection_string);
}
|
{
"pile_set_name": "Github"
}
|
#include "ExtractionOptionsJsonObject.h"
#include <regex>
namespace polycube {
namespace service {
namespace model {
ExtractionOptionsJsonObject::ExtractionOptionsJsonObject() {
m_swapOnRead = false;
m_swapOnReadIsSet = true;
m_emptyOnRead = false;
m_emptyOnReadIsSet = true;
}
ExtractionOptionsJsonObject::ExtractionOptionsJsonObject(const nlohmann::json &val) : JsonObjectBase(val) {
m_swapOnReadIsSet = false;
m_emptyOnReadIsSet = false;
if (val.count("swap-on-read"))
setSwapOnRead(val.at("swap-on-read").get<bool>());
if (val.count("empty-on-read"))
setEmptyOnRead(val.at("empty-on-read").get<bool>());
}
nlohmann::json ExtractionOptionsJsonObject::toJson() const {
nlohmann::json val = nlohmann::json::object();
if (!getBase().is_null())
val.update(getBase());
if (m_swapOnReadIsSet)
val["swap-on-read"] = m_swapOnRead;
if (m_emptyOnReadIsSet)
val["empty-on-read"] = m_emptyOnRead;
return val;
}
bool ExtractionOptionsJsonObject::getSwapOnRead() const {
return m_swapOnRead;
}
void ExtractionOptionsJsonObject::setSwapOnRead(bool value) {
m_swapOnRead = value;
m_swapOnReadIsSet = true;
}
bool ExtractionOptionsJsonObject::swapOnReadIsSet() const {
return m_swapOnReadIsSet;
}
void ExtractionOptionsJsonObject::unsetSwapOnRead() {
m_swapOnReadIsSet = false;
}
bool ExtractionOptionsJsonObject::getEmptyOnRead() const {
return m_emptyOnRead;
}
void ExtractionOptionsJsonObject::setEmptyOnRead(bool value) {
m_emptyOnRead = value;
m_emptyOnReadIsSet = true;
}
bool ExtractionOptionsJsonObject::emptyOnReadIsSet() const {
return m_emptyOnReadIsSet;
}
void ExtractionOptionsJsonObject::unsetEmptyOnRead() {
m_emptyOnReadIsSet = false;
}
}// namespace model
}// namespace service
}// namespace polycube
|
{
"pile_set_name": "Github"
}
|
{
"id": "draft04.json",
"$schema": "draft04.json",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"positiveInteger": {
"type": "integer",
"minimum": 0
},
"positiveIntegerDefault0": {
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
},
"simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"$schema": {
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": {},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
},
"maxLength": { "$ref": "#/definitions/positiveInteger" },
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},
"additionalItems": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/schemaArray" }
],
"default": {}
},
"maxItems": { "$ref": "#/definitions/positiveInteger" },
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
"uniqueItems": {
"type": "boolean",
"default": false
},
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
],
"default": {}
},
"definitions": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/stringArray" }
]
}
},
"enum": {
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{ "$ref": "#/definitions/simpleTypes" },
{
"type": "array",
"items": { "$ref": "#/definitions/simpleTypes" },
"minItems": 1,
"uniqueItems": true
}
]
},
"format": { "type": "string" },
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" }
},
"dependencies": {
"exclusiveMaximum": [ "maximum" ],
"exclusiveMinimum": [ "minimum" ]
},
"default": {}
}
|
{
"pile_set_name": "Github"
}
|
<?php
final class PhabricatorFileDropUploadController
extends PhabricatorFileController {
public function shouldAllowRestrictedParameter($parameter_name) {
// Prevent false positives from file content when it is submitted via
// drag-and-drop upload.
return true;
}
/**
* @phutil-external-symbol class PhabricatorStartup
*/
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
// NOTE: Throws if valid CSRF token is not present in the request.
$request->validateCSRF();
$name = $request->getStr('name');
$file_phid = $request->getStr('phid');
// If there's no explicit view policy, make it very restrictive by default.
// This is the correct policy for files dropped onto objects during
// creation, comment and edit flows.
$view_policy = $request->getStr('viewPolicy');
if (!$view_policy) {
$view_policy = $viewer->getPHID();
}
$is_chunks = $request->getBool('querychunks');
if ($is_chunks) {
$params = array(
'filePHID' => $file_phid,
);
$result = id(new ConduitCall('file.querychunks', $params))
->setUser($viewer)
->execute();
return id(new AphrontAjaxResponse())->setContent($result);
}
$is_allocate = $request->getBool('allocate');
if ($is_allocate) {
$params = array(
'name' => $name,
'contentLength' => $request->getInt('length'),
'viewPolicy' => $view_policy,
);
$result = id(new ConduitCall('file.allocate', $params))
->setUser($viewer)
->execute();
$file_phid = $result['filePHID'];
if ($file_phid) {
$file = $this->loadFile($file_phid);
$result += $file->getDragAndDropDictionary();
}
return id(new AphrontAjaxResponse())->setContent($result);
}
// Read the raw request data. We're either doing a chunk upload or a
// vanilla upload, so we need it.
$data = PhabricatorStartup::getRawInput();
$is_chunk_upload = $request->getBool('uploadchunk');
if ($is_chunk_upload) {
$params = array(
'filePHID' => $file_phid,
'byteStart' => $request->getInt('byteStart'),
'data' => $data,
);
$result = id(new ConduitCall('file.uploadchunk', $params))
->setUser($viewer)
->execute();
$file = $this->loadFile($file_phid);
if ($file->getIsPartial()) {
$result = array();
} else {
$result = array(
'complete' => true,
) + $file->getDragAndDropDictionary();
}
return id(new AphrontAjaxResponse())->setContent($result);
}
$file = PhabricatorFile::newFromXHRUpload(
$data,
array(
'name' => $request->getStr('name'),
'authorPHID' => $viewer->getPHID(),
'viewPolicy' => $view_policy,
'isExplicitUpload' => true,
));
$result = $file->getDragAndDropDictionary();
return id(new AphrontAjaxResponse())->setContent($result);
}
private function loadFile($file_phid) {
$viewer = $this->getViewer();
$file = id(new PhabricatorFileQuery())
->setViewer($viewer)
->withPHIDs(array($file_phid))
->executeOne();
if (!$file) {
throw new Exception(pht('Failed to load file.'));
}
return $file;
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Durandal 2.0.1 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
/**
* The viewLocator module collaborates with the viewEngine module to provide views (literally dom sub-trees) to other parts of the framework as needed. The primary consumer of the viewLocator is the composition module.
* @module viewLocator
* @requires system
* @requires viewEngine
*/
define(['durandal/system', 'durandal/viewEngine'], function (system, viewEngine) {
function findInElements(nodes, url) {
for (var i = 0; i < nodes.length; i++) {
var current = nodes[i];
var existingUrl = current.getAttribute('data-view');
if (existingUrl == url) {
return current;
}
}
}
function escape(str) {
return (str + '').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
}
/**
* @class ViewLocatorModule
* @static
*/
return {
/**
* Allows you to set up a convention for mapping module folders to view folders. It is a convenience method that customizes `convertModuleIdToViewId` and `translateViewIdToArea` under the covers.
* @method useConvention
* @param {string} [modulesPath] A string to match in the path and replace with the viewsPath. If not specified, the match is 'viewmodels'.
* @param {string} [viewsPath] The replacement for the modulesPath. If not specified, the replacement is 'views'.
* @param {string} [areasPath] Partial views are mapped to the "views" folder if not specified. Use this parameter to change their location.
*/
useConvention: function(modulesPath, viewsPath, areasPath) {
modulesPath = modulesPath || 'viewmodels';
viewsPath = viewsPath || 'views';
areasPath = areasPath || viewsPath;
var reg = new RegExp(escape(modulesPath), 'gi');
this.convertModuleIdToViewId = function (moduleId) {
return moduleId.replace(reg, viewsPath);
};
this.translateViewIdToArea = function (viewId, area) {
if (!area || area == 'partial') {
return areasPath + '/' + viewId;
}
return areasPath + '/' + area + '/' + viewId;
};
},
/**
* Maps an object instance to a view instance.
* @method locateViewForObject
* @param {object} obj The object to locate the view for.
* @param {string} [area] The area to translate the view to.
* @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first.
* @return {Promise} A promise of the view.
*/
locateViewForObject: function(obj, area, elementsToSearch) {
var view;
if (obj.getView) {
view = obj.getView();
if (view) {
return this.locateView(view, area, elementsToSearch);
}
}
if (obj.viewUrl) {
return this.locateView(obj.viewUrl, area, elementsToSearch);
}
var id = system.getModuleId(obj);
if (id) {
return this.locateView(this.convertModuleIdToViewId(id), area, elementsToSearch);
}
return this.locateView(this.determineFallbackViewId(obj), area, elementsToSearch);
},
/**
* Converts a module id into a view id. By default the ids are the same.
* @method convertModuleIdToViewId
* @param {string} moduleId The module id.
* @return {string} The view id.
*/
convertModuleIdToViewId: function(moduleId) {
return moduleId;
},
/**
* If no view id can be determined, this function is called to genreate one. By default it attempts to determine the object's type and use that.
* @method determineFallbackViewId
* @param {object} obj The object to determine the fallback id for.
* @return {string} The view id.
*/
determineFallbackViewId: function (obj) {
var funcNameRegex = /function (.{1,})\(/;
var results = (funcNameRegex).exec((obj).constructor.toString());
var typeName = (results && results.length > 1) ? results[1] : "";
return 'views/' + typeName;
},
/**
* Takes a view id and translates it into a particular area. By default, no translation occurs.
* @method translateViewIdToArea
* @param {string} viewId The view id.
* @param {string} area The area to translate the view to.
* @return {string} The translated view id.
*/
translateViewIdToArea: function (viewId, area) {
return viewId;
},
/**
* Locates the specified view.
* @method locateView
* @param {string|DOMElement} viewOrUrlOrId A view, view url or view id to locate.
* @param {string} [area] The area to translate the view to.
* @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first.
* @return {Promise} A promise of the view.
*/
locateView: function(viewOrUrlOrId, area, elementsToSearch) {
if (typeof viewOrUrlOrId === 'string') {
var viewId;
if (viewEngine.isViewUrl(viewOrUrlOrId)) {
viewId = viewEngine.convertViewUrlToViewId(viewOrUrlOrId);
} else {
viewId = viewOrUrlOrId;
}
if (area) {
viewId = this.translateViewIdToArea(viewId, area);
}
if (elementsToSearch) {
var existing = findInElements(elementsToSearch, viewId);
if (existing) {
return system.defer(function(dfd) {
dfd.resolve(existing);
}).promise();
}
}
return viewEngine.createView(viewId);
}
return system.defer(function(dfd) {
dfd.resolve(viewOrUrlOrId);
}).promise();
}
};
});
|
{
"pile_set_name": "Github"
}
|
#include <elle/das/tuple.hh>
#include <elle/test.hh>
#include <elle/serialization/json.hh>
#include <elle/das/Symbol.hh>
#include <elle/das/serializer.hh>
ELLE_DAS_SYMBOL(foo);
ELLE_DAS_SYMBOL(bar);
static
void
basics()
{
auto t = elle::das::make_tuple(foo = 3, bar = "lol");
BOOST_CHECK_EQUAL(t.foo, 3);
BOOST_CHECK_EQUAL(t.bar, "lol");
}
static
void
move()
{
elle::das::make_tuple(foo = elle::make_unique<int>(42),
bar = std::vector<int>());
auto f = elle::make_unique<int>(42);
auto b = std::vector<int>();
elle::das::make_tuple(foo = std::move(f), bar = b);
}
static
void
print()
{
auto t = elle::das::make_tuple(foo = 3, bar = "lol");
BOOST_CHECK_EQUAL(elle::sprintf("%s", t), "(foo = 3, bar = lol)");
}
static
void
serialize()
{
auto t = elle::das::make_tuple(foo = 3, bar = std::string("lol"));
auto s = elle::serialization::json::serialize(t);
auto j = elle::json::read(s.string());
BOOST_CHECK(j["foo"] == 3);
BOOST_CHECK(j["bar"] == "lol");
auto d = elle::serialization::json::deserialize<decltype(t)>(s);
BOOST_CHECK(d.foo == t.foo);
BOOST_CHECK(d.bar == t.bar);
}
static
void
hash()
{
using elle::das::make_tuple;
BOOST_TEST(
hash_value(elle::das::make_tuple()) ==
hash_value(elle::das::make_tuple()));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) ==
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(foo = 4, bar = std::string("lol"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("bar"))));
BOOST_TEST(
hash_value(elle::das::make_tuple(foo = 3, bar = std::string("lol"))) !=
hash_value(elle::das::make_tuple(bar = std::string("lol"), foo = 3)));
}
static
void
compare()
{
BOOST_TEST(
elle::das::make_tuple() ==
elle::das::make_tuple());
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) ==
elle::das::make_tuple(foo = 3, bar = std::string("lol")));
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) !=
elle::das::make_tuple(foo = 4, bar = std::string("lol")));
BOOST_TEST(
elle::das::make_tuple(foo = 3, bar = std::string("lol")) !=
elle::das::make_tuple(foo = 3, bar = std::string("bar")));
}
/*-------.
| Driver |
`-------*/
ELLE_TEST_SUITE()
{
auto& master = boost::unit_test::framework::master_test_suite();
master.add(BOOST_TEST_CASE(basics));
master.add(BOOST_TEST_CASE(move));
master.add(BOOST_TEST_CASE(print));
master.add(BOOST_TEST_CASE(serialize));
master.add(BOOST_TEST_CASE(hash));
master.add(BOOST_TEST_CASE(compare));
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
#pragma once
namespace Designer
{
class Model;
enum ECompilerFlag
{
eCompiler_CastShadow = BIT(1),
eCompiler_Physicalize = BIT(2),
eCompiler_General = eCompiler_CastShadow | eCompiler_Physicalize
};
//! This class plays a role of creating engine resources used for rendering and physicalizing out of the Designer::Model instance.
class ModelCompiler : public _i_reference_target_t
{
public:
ModelCompiler(int nCompilerFlag);
ModelCompiler(const ModelCompiler& compiler);
virtual ~ModelCompiler();
bool IsValid() const;
void Compile(CBaseObject* pBaseObject, Model* pModel, ShelfID shelfID = eShelf_Any, bool bUpdateOnlyRenderNode = false);
void DeleteAllRenderNodes();
void DeleteRenderNode(ShelfID shelfID);
IRenderNode* GetRenderNode() { return m_pRenderNode[0]; }
void UpdateHighlightPassState(bool bSelected, bool bHighlighted);
bool GetIStatObj(_smart_ptr<IStatObj>* pStatObj);
bool CreateIndexdMesh(Model* pModel, IIndexedMesh* pMesh, bool bCreateBackFaces);
void SaveToCgf(const char* filename);
void SetViewDistRatio(int nViewDistRatio) { m_viewDistRatio = nViewDistRatio; }
int GetViewDistRatio() const { return m_viewDistRatio; }
void SetRenderFlags(uint64 nRenderFlag) { m_RenderFlags = nRenderFlag; }
uint64 GetRenderFlags() const { return m_RenderFlags; }
void SetStaticObjFlags(int nStaticObjFlag);
int GetStaticObjFlags();
void SetSelected(bool bSelect);
void AddFlags(int nFlags) { m_nCompilerFlag |= nFlags; }
void RemoveFlags(int nFlags) { m_nCompilerFlag &= (~nFlags); }
bool CheckFlags(int nFlags) const { return (m_nCompilerFlag & nFlags) ? true : false; }
void SaveMesh(CArchive& ar, CBaseObject* pObj, Model* pModel);
bool LoadMesh(CArchive& ar, CBaseObject* pObj, Model* pModel);
bool SaveMesh(int nVersion, std::vector<char>& buffer, CBaseObject* pObj, Model* pModel);
bool LoadMesh(int nVersion, std::vector<char>& buffer, CBaseObject* pObj, Model* pModel);
private:
bool UpdateMesh(CBaseObject* pBaseObject, Model* pModel, ShelfID nShelf);
void UpdateRenderNode(CBaseObject* pBaseObject, ShelfID nShelf);
void RemoveStatObj(ShelfID nShelf);
void CreateStatObj(ShelfID nShelf);
IMaterial* GetMaterialFromBaseObj(CBaseObject* pObj) const;
void InvalidateStatObj(IStatObj* pStatObj, bool bPhysics);
private:
mutable IStatObj* m_pStatObj[cShelfMax];
mutable IRenderNode* m_pRenderNode[cShelfMax];
uint64 m_RenderFlags;
int m_viewDistRatio;
int m_nCompilerFlag;
};
}
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Giacomo Po <gpo@ucla.edu>
// Copyright (C) 2011 Gael Guennebaud <g.gael@free.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <cmath>
#include "../../test/sparse_solver.h"
#include <Eigen/IterativeSolvers>
template<typename T> void test_minres_T()
{
// Identity preconditioner
MINRES<SparseMatrix<T>, Lower, IdentityPreconditioner > minres_colmajor_lower_I;
MINRES<SparseMatrix<T>, Upper, IdentityPreconditioner > minres_colmajor_upper_I;
// Diagonal preconditioner
MINRES<SparseMatrix<T>, Lower, DiagonalPreconditioner<T> > minres_colmajor_lower_diag;
MINRES<SparseMatrix<T>, Upper, DiagonalPreconditioner<T> > minres_colmajor_upper_diag;
MINRES<SparseMatrix<T>, Lower|Upper, DiagonalPreconditioner<T> > minres_colmajor_uplo_diag;
// call tests for SPD matrix
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_I) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_I) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_diag) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_diag) );
CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_uplo_diag) );
// TO DO: symmetric semi-definite matrix
// TO DO: symmetric indefinite matrix
}
void test_minres()
{
CALL_SUBTEST_1(test_minres_T<double>());
// CALL_SUBTEST_2(test_minres_T<std::compex<double> >());
}
|
{
"pile_set_name": "Github"
}
|
#define YEAR 2013
#define STATUS "release"
#ifndef ROOT_DIR
#define ROOT_DIR ".."
#endif
#define BUILD_DIR ROOT_DIR + "/build/NetBox/
#ifndef SOURCE_DIR
#define SOURCE_DIR ROOT_DIR + "/src/NetBox"
#endif
#ifndef OUTPUT_DIR
#define OUTPUT_DIR ROOT_DIR + "/build"
#endif
#ifndef BINARIES_DIR_FAR2
#define BINARIES_DIR_FAR2 BUILD_DIR + "/Far2"
#endif
#ifndef BINARIES_DIR_FAR3
#define BINARIES_DIR_FAR3 BUILD_DIR + "/Far3"
#endif
#ifndef PUTTY_SOURCE_DIR
#define PUTTY_SOURCE_DIR "C:/Program Files/Putty"
#endif
#define FileSourceMain_Far2x86 BINARIES_DIR_FAR2 + "/x86/NetBox.dll"
#define FileSourceMain_Far2x64 BINARIES_DIR_FAR2 + "/x64/NetBox.dll"
#define FileSourceMain_Far3x86 BINARIES_DIR_FAR3 + "/x86/NetBox.dll"
#define FileSourceMain_Far3x64 BINARIES_DIR_FAR3 + "/x64/NetBox.dll"
#define FileSourceEng SOURCE_DIR + "/NetBoxEng.lng"
#define FileSourceRus SOURCE_DIR + "/NetBoxRus.lng"
#define FileSourceChangeLog ROOT_DIR + "/ChangeLog"
#define FileSourceReadmeEng ROOT_DIR + "/README.md"
#define FileSourceReadmeRu ROOT_DIR + "/README.RU.md"
#define FileSourceLicense ROOT_DIR + "/LICENSE.txt"
#define PluginSubDirName "NetBox"
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(FileSourceMain_Far2x86, Major, Minor, Rev, Build)
#define Version Str(Major) + "." + Str(Minor) + (Rev > 0 ? "." + Str(Rev) : "") + \
(STATUS != "" ? " " + STATUS : "")
[Setup]
AppId=netbox
AppMutex=NetBox
AppName=NetBox plugin for Far2/Far3
AppPublisher=Michael Lukashov
AppPublisherURL=https://github.com/michaellukashov/Far-NetBox
AppSupportURL=http://forum.farmanager.com/viewtopic.php?f=39&t=6638
AppUpdatesURL=http://plugring.farmanager.com/plugin.php?pid=859&l=en
VersionInfoCompany=Michael Lukashov
VersionInfoDescription=Setup for NetBox plugin for Far2/Far3 {#Version}
VersionInfoVersion={#Major}.{#Minor}.{#Rev}.{#Build}
VersionInfoTextVersion={#Version}
VersionInfoCopyright=(c) 2011-{#YEAR} Michael Lukashov
DefaultDirName={pf}\Far Manager\Plugins\{#PluginSubDirName}
UsePreviousAppDir=false
DisableProgramGroupPage=true
LicenseFile=licence.setup
; UninstallDisplayIcon={app}\winscp.ico
OutputDir={#OUTPUT_DIR}
DisableStartupPrompt=yes
AppVersion={#Version}
AppVerName=NetBox plugin for Far2/Far3 {#Version}
OutputBaseFilename=FarNetBox-{#Major}.{#Minor}.{#Rev}_Far2_Far3_x86_x64
Compression=lzma2/ultra
SolidCompression=yes
PrivilegesRequired=none
Uninstallable=no
MinVersion=5.1
DisableDirPage=yes
; AlwaysShowDirOnReadyPage=yes
ArchitecturesInstallIn64BitMode=x64
[Types]
Name: full; Description: "Full installation"
; Name: compact; Description: "Compact installation"
Name: custom; Description: "Custom installation"; Flags: iscustom
; Languages: en ru
[Components]
Name: main_far2_x86; Description: "NetBox for Far2/x86"; Types: full custom; check: IsFar2X86Installed
Name: main_far2_x64; Description: "NetBox for Far2/x64"; Types: full custom; check: IsWin64 and IsFar3X64Installed
Name: main_far3_x86; Description: "NetBox for Far3/x86"; Types: full custom; check: IsFar3X86Installed
Name: main_far3_x64; Description: "NetBox for Far3/x64"; Types: full custom; check: IsWin64 and IsFar3X64Installed
; Name: pageant; Description: "Pageant (SSH authentication agent)"; Types: full
; Name: puttygen; Description: "PuTTYgen (key generator)"; Types: full
[Files]
Source: "{#FileSourceMain_Far2x86}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceMain_Far2x64}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceMain_Far3x86}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceMain_Far3x64}"; DestName: "NetBox.dll"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceEng}"; DestName: "NetBoxEng.lng"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceRus}"; DestName: "NetBoxRus.lng"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceChangeLog}"; DestName: "ChangeLog"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeEng}"; DestName: "README.md"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceReadmeRu}"; DestName: "README.RU.md"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin2X86Dir}"; Components: main_far2_x86; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin2X64Dir}"; Components: main_far2_x64; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin3X86Dir}"; Components: main_far3_x86; Flags: ignoreversion
Source: "{#FileSourceLicense}"; DestName: "LICENSE.txt"; DestDir: "{code:GetPlugin3X64Dir}"; Components: main_far3_x64; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\LICENCE"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\LICENCE"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\putty.hlp"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\putty.hlp"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\pageant.exe"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 pageant; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\pageant.exe"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 pageant; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\puttygen.exe"; DestDir: "{code:GetPluginX86Dir}\PuTTY"; Components: main_x86 puttygen; Flags: ignoreversion
; Source: "{#PUTTY_SOURCE_DIR}\puttygen.exe"; DestDir: "{code:GetPluginX64Dir}\PuTTY"; Components: main_x64 puttygen; Flags: ignoreversion
[InstallDelete]
[Code]
var
InputDirsPage: TInputDirWizardPage;
function GetFar2X86InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far2', 'InstallDir', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far2', 'InstallDir', InstallDir) then
begin
Result := InstallDir;
end;
end;
function GetFar2X64InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKCU, 'Software\Far2', 'InstallDir_x64', InstallDir) or
RegQueryStringValue(HKLM, 'Software\Far2', 'InstallDir_x64', InstallDir) then
begin
Result := InstallDir;
end;
end;
function IsFar2X86Installed(): Boolean;
begin
Result := GetFar2X86InstallDir() <> '';
end;
function IsFar2X64Installed(): Boolean;
begin
Result := GetFar2X64InstallDir() <> '';
end;
function GetDefaultFar2X86Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar2X86InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far2\Plugins\{#PluginSubDirName}');
end;
end;
function GetDefaultFar2X64Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar2X64InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far2\Plugins\{#PluginSubDirName}');
end;
end;
function GetPlugin2X86Dir(Param: String): String;
begin
Result := InputDirsPage.Values[0];
end;
function GetPlugin2X64Dir(Param: String): String;
begin
Result := InputDirsPage.Values[1];
end;
function GetFar3X86InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far Manager', 'InstallDir', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far Manager', 'InstallDir', InstallDir) then
begin
Result := InstallDir;
end;
end;
function GetFar3X64InstallDir(): String;
var
InstallDir: String;
begin
if RegQueryStringValue(HKLM, 'Software\Far Manager', 'InstallDir_x64', InstallDir) or
RegQueryStringValue(HKCU, 'Software\Far Manager', 'InstallDir_x64', InstallDir) then
begin
Result := InstallDir;
end;
end;
function IsFar3X86Installed(): Boolean;
begin
Result := GetFar3X86InstallDir() <> '';
end;
function IsFar3X64Installed(): Boolean;
begin
Result := GetFar3X64InstallDir() <> '';
end;
function GetDefaultFar3X86Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar3X86InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far Manager\Plugins\{#PluginSubDirName}');
end;
end;
function GetDefaultFar3X64Dir(): String;
var
InstallDir: String;
begin
InstallDir := GetFar3X64InstallDir();
if InstallDir <> '' then
begin
Result := AddBackslash(InstallDir) + 'Plugins\{#PluginSubDirName}';
end
else
begin
Result := ExpandConstant('{pf}\Far Manager\Plugins\{#PluginSubDirName}');
end;
end;
function GetPlugin3X86Dir(Param: String): String;
begin
Result := InputDirsPage.Values[2];
end;
function GetPlugin3X64Dir(Param: String): String;
begin
Result := InputDirsPage.Values[3];
end;
procedure CreateTheWizardPage;
begin
// Input dirs
InputDirsPage := CreateInputDirPage(wpSelectComponents,
'Select plugin location', 'Where plugin should be installed?',
'Plugin will be installed in the following folder(s).'#13#10#13#10 +
'To continue, click Next. If you would like to select a different folder, click Browse.',
False, 'Plugin folder');
InputDirsPage.Add('Far2/x86 plugin location:');
InputDirsPage.Values[0] := GetDefaultFar2X86Dir();
InputDirsPage.Add('Far2/x64 plugin location:');
InputDirsPage.Values[1] := GetDefaultFar2X64Dir();
InputDirsPage.Add('Far3/x86 plugin location:');
InputDirsPage.Values[2] := GetDefaultFar3X86Dir();
InputDirsPage.Add('Far3/x64 plugin location:');
InputDirsPage.Values[3] := GetDefaultFar3X64Dir();
end;
procedure SetupInputDirs();
begin
InputDirsPage.Edits[0].Enabled := IsComponentSelected('main_far2_x86');
InputDirsPage.Buttons[0].Enabled := IsComponentSelected('main_far2_x86');
InputDirsPage.PromptLabels[0].Enabled := IsComponentSelected('main_far2_x86');
// InputDirsPage.Edits[1].Visible := IsWin64();
// InputDirsPage.Buttons[1].Visible := IsWin64();
// InputDirsPage.PromptLabels[1].Visible := IsWin64();
InputDirsPage.Edits[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.Buttons[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.PromptLabels[1].Enabled := IsComponentSelected('main_far2_x64');
InputDirsPage.Edits[2].Enabled := IsComponentSelected('main_far3_x86');
InputDirsPage.Buttons[2].Enabled := IsComponentSelected('main_far3_x86');
InputDirsPage.PromptLabels[2].Enabled := IsComponentSelected('main_far3_x86');
// InputDirsPage.Edits[3].Visible := IsWin64();
// InputDirsPage.Buttons[3].Visible := IsWin64();
// InputDirsPage.PromptLabels[3].Visible := IsWin64();
InputDirsPage.Edits[3].Enabled := IsComponentSelected('main_far3_x64');
InputDirsPage.Buttons[3].Enabled := IsComponentSelected('main_far3_x64');
InputDirsPage.PromptLabels[3].Enabled := IsComponentSelected('main_far3_x64');
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpWelcome then
begin
// SetupComponents();
end
else
if CurPageID = wpSelectComponents then
begin
SetupInputDirs();
end
else
if CurPageID = InputDirsPage.ID then
begin
WizardForm.DirEdit.Text := InputDirsPage.Values[0];
end;
Result := True;
end;
function BackButtonClick(CurPageID: Integer): Boolean;
begin
// MsgBox('CurPageID: ' + IntToStr(CurPageID), mbInformation, mb_Ok);
if CurPageID = InputDirsPage.ID then
begin
// SetupComponents();
end;
if CurPageID = wpReady then
begin
SetupInputDirs();
end;
Result := True;
end;
procedure InitializeWizard();
begin
// Custom wizard page
CreateTheWizardPage;
WizardForm.LicenseAcceptedRadio.Checked := True;
end;
|
{
"pile_set_name": "Github"
}
|
/* fre:ac - free audio converter
* Copyright (C) 2001-2020 Robert Kausch <robert.kausch@freac.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
#include <dialogs/config/configcomponent.h>
#include <config.h>
#include <resources.h>
#ifdef __WIN32__
# include <smooth/init.win32.h>
#endif
using namespace BoCA;
using namespace BoCA::AS;
freac::ConfigComponentDialog::ConfigComponentDialog(Component *component)
{
BoCA::Config *config = BoCA::Config::Get();
BoCA::I18n *i18n = BoCA::I18n::Get();
i18n->SetContext("Configuration");
layer = component->GetConfigurationLayer();
if (layer != NIL)
{
mainWnd = new Window(component->GetName(), Point(config->GetIntValue(Config::CategorySettingsID, Config::SettingsWindowPosXID, Config::SettingsWindowPosXDefault), config->GetIntValue(Config::CategorySettingsID, Config::SettingsWindowPosYID, Config::SettingsWindowPosYDefault)) + Point(60, 60), layer->GetSize() + Size(8, 73));
mainWnd->SetRightToLeft(i18n->IsActiveLanguageRightToLeft());
mainWnd_titlebar = new Titlebar(TB_CLOSEBUTTON);
divbar = new Divider(39, OR_HORZ | OR_BOTTOM);
btn_cancel = new Button(i18n->TranslateString("Cancel"), Point(175, 29), Size());
btn_cancel->onAction.Connect(&ConfigComponentDialog::Cancel, this);
btn_cancel->SetOrientation(OR_LOWERRIGHT);
btn_ok = new Button(i18n->TranslateString("OK"), btn_cancel->GetPosition() - Point(88, 0), Size());
btn_ok->onAction.Connect(&ConfigComponentDialog::OK, this);
btn_ok->SetOrientation(OR_LOWERRIGHT);
Add(mainWnd);
mainWnd->Add(mainWnd_titlebar);
mainWnd->Add(divbar);
mainWnd->Add(btn_ok);
mainWnd->Add(btn_cancel);
mainWnd->GetMainLayer()->Add(layer);
mainWnd->SetFlags(mainWnd->GetFlags() | WF_NOTASKBUTTON | WF_MODAL);
mainWnd->SetIcon(ImageLoader::Load(String(Config::Get()->resourcesPath).Append("icons/freac.png")));
#ifdef __WIN32__
mainWnd->SetIconDirect(LoadImageA(hInstance, MAKEINTRESOURCEA(IDI_ICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
#endif
}
else
{
mainWnd = NIL;
mainWnd_titlebar = NIL;
btn_cancel = NIL;
btn_ok = NIL;
divbar = NIL;
}
}
freac::ConfigComponentDialog::~ConfigComponentDialog()
{
if (layer == NIL) return;
DeleteObject(mainWnd_titlebar);
DeleteObject(mainWnd);
DeleteObject(btn_ok);
DeleteObject(btn_cancel);
DeleteObject(divbar);
}
const Error &freac::ConfigComponentDialog::ShowDialog()
{
if (layer != NIL) mainWnd->WaitUntilClosed();
else error = Error();
return error;
}
Void freac::ConfigComponentDialog::OK()
{
if (layer->SaveSettings() == Error()) return;
mainWnd->Close();
}
Void freac::ConfigComponentDialog::Cancel()
{
mainWnd->Close();
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Customer\Controller\Adminhtml\Index;
class Wishlist extends \Magento\Customer\Controller\Adminhtml\Index
{
/**
* Wishlist Action
*
* @return \Magento\Framework\View\Result\Layout
*/
public function execute()
{
$customerId = $this->initCurrentCustomer();
$itemId = (int)$this->getRequest()->getParam('delete');
if ($customerId && $itemId) {
try {
$this->_objectManager->create(\Magento\Wishlist\Model\Item::class)->load($itemId)->delete();
} catch (\Exception $exception) {
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($exception);
}
}
$resultLayout = $this->resultLayoutFactory->create();
return $resultLayout;
}
}
|
{
"pile_set_name": "Github"
}
|
import { ChildProcessReporter } from '@integration/testing-tools';
import { serenity, StreamReporter } from '@serenity-js/core';
export = function () {
this.setDefaultTimeout(5000);
serenity.configure({
crew: [
new ChildProcessReporter(),
new StreamReporter(),
],
});
};
|
{
"pile_set_name": "Github"
}
|
/*
* linux/fs/super.c
*
* (C) 1991 Linus Torvalds
*/
/*
* super.c contains code to handle the super-block tables.
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <asm/system.h>
#include <errno.h>
#include <sys/stat.h>
int sync_dev(int dev);
void wait_for_keypress(void);
/* set_bit uses setb, as gas doesn't recognize setc */
#define set_bit(bitnr,addr) ({ \
register int __res __asm__("ax"); \
__asm__("bt %2,%3;setb %%al":"=a" (__res):"a" (0),"r" (bitnr),"m" (*(addr))); \
__res; })
struct super_block super_block[NR_SUPER];
/* this is initialized in init/main.c */
int ROOT_DEV = 0;
static void lock_super(struct super_block * sb)
{
cli();
while (sb->s_lock)
sleep_on(&(sb->s_wait));
sb->s_lock = 1;
sti();
}
static void free_super(struct super_block * sb)
{
cli();
sb->s_lock = 0;
wake_up(&(sb->s_wait));
sti();
}
static void wait_on_super(struct super_block * sb)
{
cli();
while (sb->s_lock)
sleep_on(&(sb->s_wait));
sti();
}
struct super_block * get_super(int dev)
{
struct super_block * s;
if (!dev)
return NULL;
s = 0+super_block;
while (s < NR_SUPER+super_block)
if (s->s_dev == dev) {
wait_on_super(s);
if (s->s_dev == dev)
return s;
s = 0+super_block;
} else
s++;
return NULL;
}
void put_super(int dev)
{
struct super_block * sb;
struct m_inode * inode;
int i;
if (dev == ROOT_DEV) {
printk("root diskette changed: prepare for armageddon\n\r");
return;
}
if (!(sb = get_super(dev)))
return;
if (sb->s_imount) {
printk("Mounted disk changed - tssk, tssk\n\r");
return;
}
lock_super(sb);
sb->s_dev = 0;
for(i=0;i<I_MAP_SLOTS;i++)
brelse(sb->s_imap[i]);
for(i=0;i<Z_MAP_SLOTS;i++)
brelse(sb->s_zmap[i]);
free_super(sb);
return;
}
static struct super_block * read_super(int dev)
{
struct super_block * s;
struct buffer_head * bh;
int i,block;
if (!dev)
return NULL;
check_disk_change(dev);
if (s = get_super(dev))
return s;
for (s = 0+super_block ;; s++) {
if (s >= NR_SUPER+super_block)
return NULL;
if (!s->s_dev)
break;
}
s->s_dev = dev;
s->s_isup = NULL;
s->s_imount = NULL;
s->s_time = 0;
s->s_rd_only = 0;
s->s_dirt = 0;
lock_super(s);
if (!(bh = bread(dev,1))) {
s->s_dev=0;
free_super(s);
return NULL;
}
*((struct d_super_block *) s) =
*((struct d_super_block *) bh->b_data);
brelse(bh);
if (s->s_magic != SUPER_MAGIC) {
s->s_dev = 0;
free_super(s);
return NULL;
}
for (i=0;i<I_MAP_SLOTS;i++)
s->s_imap[i] = NULL;
for (i=0;i<Z_MAP_SLOTS;i++)
s->s_zmap[i] = NULL;
block=2;
for (i=0 ; i < s->s_imap_blocks ; i++)
if (s->s_imap[i]=bread(dev,block))
block++;
else
break;
for (i=0 ; i < s->s_zmap_blocks ; i++)
if (s->s_zmap[i]=bread(dev,block))
block++;
else
break;
if (block != 2+s->s_imap_blocks+s->s_zmap_blocks) {
for(i=0;i<I_MAP_SLOTS;i++)
brelse(s->s_imap[i]);
for(i=0;i<Z_MAP_SLOTS;i++)
brelse(s->s_zmap[i]);
s->s_dev=0;
free_super(s);
return NULL;
}
s->s_imap[0]->b_data[0] |= 1;
s->s_zmap[0]->b_data[0] |= 1;
free_super(s);
return s;
}
int sys_umount(char * dev_name)
{
struct m_inode * inode;
struct super_block * sb;
int dev;
if (!(inode=namei(dev_name)))
return -ENOENT;
dev = inode->i_zone[0];
if (!S_ISBLK(inode->i_mode)) {
iput(inode);
return -ENOTBLK;
}
iput(inode);
if (dev==ROOT_DEV)
return -EBUSY;
if (!(sb=get_super(dev)) || !(sb->s_imount))
return -ENOENT;
if (!sb->s_imount->i_mount)
printk("Mounted inode has i_mount=0\n");
for (inode=inode_table+0 ; inode<inode_table+NR_INODE ; inode++)
if (inode->i_dev==dev && inode->i_count)
return -EBUSY;
sb->s_imount->i_mount=0;
iput(sb->s_imount);
sb->s_imount = NULL;
iput(sb->s_isup);
sb->s_isup = NULL;
put_super(dev);
sync_dev(dev);
return 0;
}
int sys_mount(char * dev_name, char * dir_name, int rw_flag)
{
struct m_inode * dev_i, * dir_i;
struct super_block * sb;
int dev;
if (!(dev_i=namei(dev_name)))
return -ENOENT;
dev = dev_i->i_zone[0];
if (!S_ISBLK(dev_i->i_mode)) {
iput(dev_i);
return -EPERM;
}
iput(dev_i);
if (!(dir_i=namei(dir_name)))
return -ENOENT;
if (dir_i->i_count != 1 || dir_i->i_num == ROOT_INO) {
iput(dir_i);
return -EBUSY;
}
if (!S_ISDIR(dir_i->i_mode)) {
iput(dir_i);
return -EPERM;
}
if (!(sb=read_super(dev))) {
iput(dir_i);
return -EBUSY;
}
if (sb->s_imount) {
iput(dir_i);
return -EBUSY;
}
if (dir_i->i_mount) {
iput(dir_i);
return -EPERM;
}
sb->s_imount=dir_i;
dir_i->i_mount=1;
dir_i->i_dirt=1; /* NOTE! we don't iput(dir_i) */
return 0; /* we do that in umount */
}
void mount_root(void)
{
int i,free;
struct super_block * p;
struct m_inode * mi;
if (32 != sizeof (struct d_inode))
panic("bad i-node size");
for(i=0;i<NR_FILE;i++)
file_table[i].f_count=0;
if (MAJOR(ROOT_DEV) == 2) {
printk("Insert root floppy and press ENTER");
wait_for_keypress();
}
for(p = &super_block[0] ; p < &super_block[NR_SUPER] ; p++) {
p->s_dev = 0;
p->s_lock = 0;
p->s_wait = NULL;
}
if (!(p=read_super(ROOT_DEV)))
panic("Unable to mount root");
if (!(mi=iget(ROOT_DEV,ROOT_INO)))
panic("Unable to read root i-node");
mi->i_count += 3 ; /* NOTE! it is logically used 4 times, not 1 */
p->s_isup = p->s_imount = mi;
current->pwd = mi;
current->root = mi;
free=0;
i=p->s_nzones;
while (-- i >= 0)
if (!set_bit(i&8191,p->s_zmap[i>>13]->b_data))
free++;
printk("%d/%d free blocks\n\r",free,p->s_nzones);
free=0;
i=p->s_ninodes+1;
while (-- i >= 0)
if (!set_bit(i&8191,p->s_imap[i>>13]->b_data))
free++;
printk("%d/%d free inodes\n\r",free,p->s_ninodes);
}
|
{
"pile_set_name": "Github"
}
|
//
// GDDropboxUploadStateWrapper.m
// GDFileManagerExample
//
// Created by Graham Dennis on 11/08/13.
// Copyright (c) 2013 Graham Dennis. All rights reserved.
//
#import "GDFileManagerUploadState.h"
@implementation GDFileManagerUploadState
@synthesize parentVersionID = _parentVersionID;
- (instancetype)initWithUploadState:(id<NSCoding>)uploadState mimeType:(NSString *)mimeType uploadURL:(NSURL *)uploadURL parentVersionID:(NSString *)parentVersionID
{
return [self initWithUploadState:uploadState mimeType:mimeType uploadURL:uploadURL parentVersionID:parentVersionID extraState:nil];
}
- (instancetype)initWithUploadState:(id <NSCoding>)uploadState mimeType:(NSString *)mimeType uploadURL:(NSURL *)uploadURL parentVersionID:(NSString *)parentVersionID extraState:(NSDictionary *)extraState
{
if ((self = [super init])) {
_uploadState = uploadState;
_uploadURL = uploadURL;
_parentVersionID = parentVersionID;
_mimeType = mimeType;
_extraState = extraState;
}
return self;
}
- (NSURL *)fileServiceSessionURL { return self.uploadURL; }
#pragma mark - NSCoding
static NSString *const kUploadState = @"UploadState";
static NSString *const kUploadURL = @"UploadURL";
static NSString *const kParentVersionID = @"ParentVersionID";
static NSString *const kMIMEType = @"MIMEType";
static NSString *const kExtraState = @"ExtraState";
- (id)initWithCoder:(NSCoder *)aDecoder
{
id <NSCoding> uploadState = [aDecoder decodeObjectForKey:kUploadState];
NSURL *uploadURL = [aDecoder decodeObjectForKey:kUploadURL];
NSString *parentVersionID = [aDecoder decodeObjectForKey:kParentVersionID];
NSString *mimeType = [aDecoder decodeObjectForKey:kMIMEType];
NSDictionary *extraState = [aDecoder decodeObjectForKey:kExtraState];
return [self initWithUploadState:uploadState mimeType:mimeType uploadURL:uploadURL parentVersionID:parentVersionID extraState:extraState];
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:self.uploadState forKey:kUploadState];
[aCoder encodeObject:self.uploadURL forKey:kUploadURL];
[aCoder encodeObject:self.parentVersionID forKey:kParentVersionID];
[aCoder encodeObject:self.mimeType forKey:kMIMEType];
[aCoder encodeObject:self.extraState forKey:kExtraState];
}
@end
|
{
"pile_set_name": "Github"
}
|
/dts-v1/;
#include "bcm6348.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Sagem F@st 2404";
compatible = "sagem,fast-2404", "brcm,bcm6348";
chosen {
bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
stdout-path = "serial0:115200n8";
};
};
&pflash {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
cfe@0 {
label = "CFE";
reg = <0x000000 0x010000>;
read-only;
};
linux@10000 {
label = "linux";
reg = <0x010000 0x3e0000>;
compatible = "brcm,bcm963xx-imagetag";
};
nvram@3f0000 {
label = "nvram";
reg = <0x3f0000 0x010000>;
};
};
};
&pinctrl {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>;
};
&uart0 {
status = "okay";
};
|
{
"pile_set_name": "Github"
}
|
//
// TAPIResponse.m
// TwitterNetworkLayer
//
// Created on 10/17/14.
// Copyright © 2020 Twitter. All rights reserved.
//
#import "TAPIError.h"
#import "TAPIResponse.h"
#import "TNL_Project.h"
NS_INLINE BOOL _DataBeginsWithHTMLDocType(NSData *data)
{
static const char sDocType[] = "<!DOCTYPE html";
static const size_t sDocTypeLength = (sizeof(sDocType) / sizeof(sDocType[0])) - 1; // minus 1 to ignore the NULL terminator
return data.length >= sDocTypeLength && 0 == strncmp(data.bytes, sDocType, sDocTypeLength);
}
static id _ParseAPIResponse(TNLResponseInfo *info, NSError ** parseErrorOut, NSError ** apiErrorOut);
static NSArray *_ExtractAPIErrors(id parsedObject);
@implementation TAPIResponse
@synthesize apiError = _apiError;
@synthesize parseError = _parseError;
@synthesize parsedObject = _parsedObject;
- (void)prepare
{
[super prepare];
if (!_operationError) {
NSError *apiError;
NSError *parseError;
_parsedObject = _ParseAPIResponse(_info, &parseError, &apiError);
_parseError = parseError;
_apiError = apiError;
TNLAttemptMetrics *metrics = _metrics.attemptMetrics.lastObject;
metrics.responseBodyParseError = parseError;
if (apiError) {
metrics.APIErrors = @[apiError];
}
}
}
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
_parsedObject = [coder decodeObjectOfClasses:[NSSet setWithObjects:[NSString class], [NSNumber class], [NSArray class], [NSDictionary class], nil]
forKey:@"parsedObject"];
_parseError = [coder decodeObjectOfClass:[NSError class] forKey:@"parseError"];
_apiError = [coder decodeObjectOfClass:[NSError class] forKey:@"apiError"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:TNLErrorToSecureCodingError(_parsedObject) forKey:@"parsedObject"];
[aCoder encodeObject:TNLErrorToSecureCodingError(_apiError) forKey:@"apiError"];
[aCoder encodeObject:TNLErrorToSecureCodingError(_parseError) forKey:@"parseError"];
}
- (NSError *)anyError
{
return self.operationError ?: self.parseError ?: self.apiError;
}
@end
static id _ParseAPIResponse(TNLResponseInfo *info, NSError ** errorOut, NSError ** apiErrorOut)
{
id json = nil;
NSError *parseError = nil;
__block NSError *apiError = TNLHTTPStatusCodeIsSuccess(info.statusCode) ? nil : [NSError errorWithDomain:TAPIErrorDomain code:0 userInfo:nil];
NSInteger statusCode = info.statusCode;
NSData *data = info.data;
TNLAssert(statusCode > 0);
BOOL hasDocTypePrefix = _DataBeginsWithHTMLDocType(data);
if (hasDocTypePrefix) {
parseError = [NSError errorWithDomain:TAPIOperationErrorDomain
code:TAPIOperationErrorCodeServiceEncounteredTechnicalError
userInfo:nil];
} else {
json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
if (json) {
NSArray *apiErrors = _ExtractAPIErrors(json);
// Underlying behavior in some 4XX errors
if (TNLHTTPStatusCodeIsClientError(statusCode)) {
[apiErrors enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSError *currentError = obj;
if ([currentError.domain isEqualToString:TAPIErrorDomain]) {
apiError = currentError;
*stop = YES;
}
}];
}
} else {
parseError = [NSError errorWithDomain:TAPIParseErrorDomain
code:TAPIParseErrorCodeCannotParseResponse
userInfo:(parseError) ? @{ NSUnderlyingErrorKey : parseError } : nil];
}
}
if (errorOut) {
*errorOut = parseError;
}
if (apiErrorOut) {
*apiErrorOut = apiError;
}
return json;
}
static NSArray *_ExtractAPIErrors(id parsedObject)
{
TNLAssert(parsedObject != nil);
NSMutableArray *errorItems = [[NSMutableArray alloc] init];
if ([parsedObject isKindOfClass:[NSDictionary class]]) {
id errors = [parsedObject objectForKey:@"errors"];
if ([errors isKindOfClass:[NSArray class]]) {
[errors enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
BOOL successfullyParsedError = NO;
if ([obj isKindOfClass:[NSDictionary class]]) {
id codeObject = [obj objectForKey:@"code"];
id messageObject = [obj objectForKey:@"message"];
if (codeObject && messageObject) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
if (messageObject) {
userInfo[NSLocalizedDescriptionKey] = messageObject;
}
NSInteger code = [codeObject integerValue];
id timestamp = [obj objectForKey:@"timestamp"];
if (timestamp) {
userInfo[@"timestamp"] = timestamp;
}
[errorItems addObject:[NSError errorWithDomain:TAPIErrorDomain
code:code
userInfo:userInfo]];
successfullyParsedError = YES;
}
}
if (!successfullyParsedError) {
NSLog(@"Failed to parse server error:[%@]", obj);
}
}];
}
}
return errorItems;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2014 Saravan Pantham
*
* 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 com.psaravan.filebrowserview.lib.AsyncTasks;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.widget.Toast;
import com.psaravan.filebrowserview.lib.Interfaces.MoveInterface;
import com.psaravan.filebrowserview.lib.R;
import org.apache.commons.io.FileUtils;
import java.io.File;
/**
* AsyncTask that moves the specified file/folder recursively to a new location.
*
* @author Saravan Pantham
*/
public class AsyncMoveTask extends AsyncTask<String, Void, Boolean> {
private Context mContext;
private ProgressDialog pd;
private File mSourceFile;
private File mDestDirFile;
private boolean mShowProgress = true;
private MoveInterface mMoveInterface;
public AsyncMoveTask(Context context, File source, File destDir, boolean showProgress) {
mContext = context;
mSourceFile = source;
mShowProgress = showProgress;
mDestDirFile = destDir;
}
@Override
protected void onPreExecute() {
if (mSourceFile==null)
return;
//Skip the rest of this method if the user doesn't want a progress dialog.
if (!mShowProgress)
return;
pd = new ProgressDialog(mContext);
pd.setCancelable(false);
pd.setIndeterminate(false);
pd.setTitle(R.string.move);
pd.setMessage(mContext.getResources().getString(R.string.moving) + " " + mSourceFile.getName());
pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources()
.getString(R.string.run_in_background),
new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
pd.dismiss();
}
});
pd.show();
if (mMoveInterface!=null)
mMoveInterface.preMoveStartSync();
}
@Override
protected Boolean doInBackground(String... params) {
if (mMoveInterface!=null)
mMoveInterface.preMoveStartAsync();
if (mSourceFile==null || mDestDirFile==null) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
if (mSourceFile.isDirectory()) {
try {
FileUtils.moveDirectory(mSourceFile, mDestDirFile);
} catch (Exception e) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
} else {
try {
FileUtils.moveFile(mSourceFile, mDestDirFile);
} catch (Exception e) {
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(false);
return false;
}
}
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteAsync(true);
return true;
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
if (mMoveInterface!=null)
mMoveInterface.onMoveCompleteSync(result);
if (pd!=null)
pd.dismiss();
if (result==true) {
String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.moved);
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
} else {
String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.could_not_be_moved);
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
}
}
/**
* @param moveInterface The move interface instance to attach to this
* AsyncTask.
*/
public void setMoveInterface(MoveInterface moveInterface) {
mMoveInterface = moveInterface;
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
class BufferHandlerTest extends TestCase
{
private $shutdownCheckHandler;
/**
* @covers Monolog\Handler\BufferHandler::__construct
* @covers Monolog\Handler\BufferHandler::handle
* @covers Monolog\Handler\BufferHandler::close
*/
public function testHandleBuffers()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$this->assertFalse($test->hasDebugRecords());
$this->assertFalse($test->hasInfoRecords());
$handler->close();
$this->assertTrue($test->hasInfoRecords());
$this->assertTrue(count($test->getRecords()) === 2);
}
/**
* @covers Monolog\Handler\BufferHandler::close
* @covers Monolog\Handler\BufferHandler::flush
*/
public function testPropagatesRecordsAtEndOfRequest()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->handle($this->getRecord(Logger::WARNING));
$handler->handle($this->getRecord(Logger::DEBUG));
$this->shutdownCheckHandler = $test;
register_shutdown_function(array($this, 'checkPropagation'));
}
public function checkPropagation()
{
if (!$this->shutdownCheckHandler->hasWarningRecords() || !$this->shutdownCheckHandler->hasDebugRecords()) {
echo '!!! BufferHandlerTest::testPropagatesRecordsAtEndOfRequest failed to verify that the messages have been propagated' . PHP_EOL;
exit(1);
}
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleBufferLimit()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 2);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->handle($this->getRecord(Logger::WARNING));
$handler->close();
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
$this->assertFalse($test->hasDebugRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleBufferLimitWithFlushOnOverflow()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 3, Logger::DEBUG, true, true);
// send two records
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::DEBUG));
$this->assertFalse($test->hasDebugRecords());
$this->assertCount(0, $test->getRecords());
// overflow
$handler->handle($this->getRecord(Logger::INFO));
$this->assertTrue($test->hasDebugRecords());
$this->assertCount(3, $test->getRecords());
// should buffer again
$handler->handle($this->getRecord(Logger::WARNING));
$this->assertCount(3, $test->getRecords());
$handler->close();
$this->assertCount(5, $test->getRecords());
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleLevel()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 0, Logger::INFO);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->handle($this->getRecord(Logger::WARNING));
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->close();
$this->assertTrue($test->hasWarningRecords());
$this->assertTrue($test->hasInfoRecords());
$this->assertFalse($test->hasDebugRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::flush
*/
public function testFlush()
{
$test = new TestHandler();
$handler = new BufferHandler($test, 0);
$handler->handle($this->getRecord(Logger::DEBUG));
$handler->handle($this->getRecord(Logger::INFO));
$handler->flush();
$this->assertTrue($test->hasInfoRecords());
$this->assertTrue($test->hasDebugRecords());
$this->assertFalse($test->hasWarningRecords());
}
/**
* @covers Monolog\Handler\BufferHandler::handle
*/
public function testHandleUsesProcessors()
{
$test = new TestHandler();
$handler = new BufferHandler($test);
$handler->pushProcessor(function ($record) {
$record['extra']['foo'] = true;
return $record;
});
$handler->handle($this->getRecord(Logger::WARNING));
$handler->flush();
$this->assertTrue($test->hasWarningRecords());
$records = $test->getRecords();
$this->assertTrue($records[0]['extra']['foo']);
}
}
|
{
"pile_set_name": "Github"
}
|
{
"type": "minecraft:crafting_shaped",
"pattern": [
"X ",
"XX ",
"XXX"
],
"key": {
"X": {
"item": "tfc:wood/planks/douglas_fir"
}
},
"result": {
"item": "tfc:stairs/wood/douglas_fir",
"count": 8
}
}
|
{
"pile_set_name": "Github"
}
|
using Mirror;
namespace WeaverTargetRpcTests.TargetRpcValid
{
class TargetRpcValid : NetworkBehaviour
{
[TargetRpc]
void TargetThatIsTotallyValid(NetworkConnection nc) { }
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This implements a Clang tool to convert all instances of std::string("") to
// std::string(). The latter is more efficient (as std::string doesn't have to
// take a copy of an empty string) and generates fewer instructions as well. It
// should be run using the tools/clang/scripts/run_tool.py helper.
#include <memory>
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Refactoring.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
using namespace clang::ast_matchers;
using clang::tooling::CommonOptionsParser;
using clang::tooling::Replacement;
using clang::tooling::Replacements;
namespace {
// Handles replacements for stack and heap-allocated instances, e.g.:
// std::string a("");
// std::string* b = new std::string("");
class ConstructorCallback : public MatchFinder::MatchCallback {
public:
ConstructorCallback(Replacements* replacements)
: replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
// Handles replacements for invocations of std::string("") in an initializer
// list.
class InitializerCallback : public MatchFinder::MatchCallback {
public:
InitializerCallback(Replacements* replacements)
: replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
// Handles replacements for invocations of std::string("") in a temporary
// context, e.g. FunctionThatTakesString(std::string("")). Note that this
// handles implicits construction of std::string as well.
class TemporaryCallback : public MatchFinder::MatchCallback {
public:
TemporaryCallback(Replacements* replacements) : replacements_(replacements) {}
virtual void run(const MatchFinder::MatchResult& result) override;
private:
Replacements* const replacements_;
};
class EmptyStringConverter {
public:
explicit EmptyStringConverter(Replacements* replacements)
: constructor_callback_(replacements),
initializer_callback_(replacements),
temporary_callback_(replacements) {}
void SetupMatchers(MatchFinder* match_finder);
private:
ConstructorCallback constructor_callback_;
InitializerCallback initializer_callback_;
TemporaryCallback temporary_callback_;
};
void EmptyStringConverter::SetupMatchers(MatchFinder* match_finder) {
const clang::ast_matchers::StatementMatcher& constructor_call = id(
"call",
cxxConstructExpr(
hasDeclaration(cxxMethodDecl(ofClass(hasName("std::basic_string")))),
argumentCountIs(2), hasArgument(0, id("literal", stringLiteral())),
hasArgument(1, cxxDefaultArgExpr())));
// Note that expr(has()) in the matcher is significant; the Clang AST wraps
// calls to the std::string constructor with exprWithCleanups nodes. Without
// the expr(has()) matcher, the first and last rules would not match anything!
match_finder->addMatcher(varDecl(forEach(expr(has(constructor_call)))),
&constructor_callback_);
match_finder->addMatcher(cxxNewExpr(has(constructor_call)),
&constructor_callback_);
// The implicitly generated constructor for temporary could be wrapped by
// implicitCastExpr, so ignoringParenImpCasts is needed.
match_finder->addMatcher(
cxxBindTemporaryExpr(ignoringParenImpCasts(forEach(constructor_call))),
&temporary_callback_);
// Note that forEachConstructorInitializer is needed. The std::string
// constructor is wrapped by exprWithCleanups and cxxCtorInitializer.
// forEach() would not work.
match_finder->addMatcher(cxxConstructorDecl(forEachConstructorInitializer(
withInitializer(expr(has(constructor_call))))),
&initializer_callback_);
}
void ConstructorCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
clang::CharSourceRange range =
clang::CharSourceRange::getTokenRange(call->getParenOrBraceRange());
auto err = replacements_->add(Replacement(*result.SourceManager, range, ""));
assert(!err);
}
void InitializerCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
auto err = replacements_->add(Replacement(*result.SourceManager, call, ""));
assert(!err);
}
void TemporaryCallback::run(const MatchFinder::MatchResult& result) {
const clang::StringLiteral* literal =
result.Nodes.getNodeAs<clang::StringLiteral>("literal");
if (literal->getLength() > 0)
return;
const clang::CXXConstructExpr* call =
result.Nodes.getNodeAs<clang::CXXConstructExpr>("call");
// Differentiate between explicit and implicit calls to std::string's
// constructor. An implicitly generated constructor won't have a valid
// source range for the parenthesis. We do this because the matched expression
// for |call| in the explicit case doesn't include the closing parenthesis.
clang::SourceRange range = call->getParenOrBraceRange();
if (range.isValid()) {
auto err =
replacements_->add(Replacement(*result.SourceManager, literal, ""));
assert(!err);
} else {
auto err = replacements_->add(
Replacement(*result.SourceManager, call,
literal->isWide() ? "std::wstring()" : "std::string()"));
assert(!err);
}
}
} // namespace
static llvm::cl::extrahelp common_help(CommonOptionsParser::HelpMessage);
int main(int argc, const char* argv[]) {
llvm::cl::OptionCategory category("EmptyString Tool");
CommonOptionsParser options(argc, argv, category);
clang::tooling::ClangTool tool(options.getCompilations(),
options.getSourcePathList());
Replacements replacements;
EmptyStringConverter converter(&replacements);
MatchFinder match_finder;
converter.SetupMatchers(&match_finder);
std::unique_ptr<clang::tooling::FrontendActionFactory> frontend_factory =
clang::tooling::newFrontendActionFactory(&match_finder);
int result = tool.run(frontend_factory.get());
if (result != 0)
return result;
if (replacements.empty())
return 0;
// Each replacement line should have the following format:
// r:<file path>:<offset>:<length>:<replacement text>
// Only the <replacement text> field can contain embedded ":" characters.
// TODO(dcheng): Use a more clever serialization. Ideally we'd use the YAML
// serialization and then use clang-apply-replacements, but that would require
// copying and pasting a larger amount of boilerplate for all Chrome clang
// tools.
llvm::outs() << "==== BEGIN EDITS ====\n";
for (const auto& r : replacements) {
llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset()
<< ":::" << r.getLength() << ":::" << r.getReplacementText()
<< "\n";
}
llvm::outs() << "==== END EDITS ====\n";
return 0;
}
|
{
"pile_set_name": "Github"
}
|
using NHapi.Base.Parser;
using NHapi.Base;
using NHapi.Base.Log;
using System;
using System.Collections.Generic;
using NHapi.Model.V26.Segment;
using NHapi.Model.V26.Datatype;
using NHapi.Base.Model;
namespace NHapi.Model.V26.Group
{
///<summary>
///Represents the RRI_I12_AUTHORIZATION_CONTACT Group. A Group is an ordered collection of message
/// segments that can repeat together or be optionally in/excluded together.
/// This Group contains the following elements:
///<ol>
///<li>0: AUT (Authorization Information) </li>
///<li>1: CTD (Contact Data) optional </li>
///</ol>
///</summary>
[Serializable]
public class RRI_I12_AUTHORIZATION_CONTACT : AbstractGroup {
///<summary>
/// Creates a new RRI_I12_AUTHORIZATION_CONTACT Group.
///</summary>
public RRI_I12_AUTHORIZATION_CONTACT(IGroup parent, IModelClassFactory factory) : base(parent, factory){
try {
this.add(typeof(AUT), true, false);
this.add(typeof(CTD), false, false);
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating RRI_I12_AUTHORIZATION_CONTACT - this is probably a bug in the source code generator.", e);
}
}
///<summary>
/// Returns AUT (Authorization Information) - creates it if necessary
///</summary>
public AUT AUT {
get{
AUT ret = null;
try {
ret = (AUT)this.GetStructure("AUT");
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
///<summary>
/// Returns CTD (Contact Data) - creates it if necessary
///</summary>
public CTD CTD {
get{
CTD ret = null;
try {
ret = (CTD)this.GetStructure("CTD");
} catch(HL7Exception e) {
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <XCTest/XCTest.h>
#import <IGListKit/IGListKit.h>
#import "IGListDebugger.h"
#import "IGListAdapterUpdaterInternal.h"
#import "IGListTestAdapterDataSource.h"
#import "IGListMoveIndexInternal.h"
#import "IGListMoveIndexPathInternal.h"
@interface IGListDebuggerTests : XCTestCase
@end
@implementation IGListDebuggerTests
- (void)test_whenSearchingAdapterInstances_thatCorrectCountReturned {
UIViewController *controller = [UIViewController new];
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:[UICollectionViewFlowLayout new]];
IGListAdapterUpdater *updater = [IGListAdapterUpdater new];
NSIndexPath *path = [NSIndexPath indexPathForItem:0 inSection:0];
updater.applyingUpdateData = [[IGListBatchUpdateData alloc] initWithInsertSections:[NSIndexSet indexSetWithIndex:1]
deleteSections:[NSIndexSet indexSetWithIndex:2]
moveSections:[NSSet setWithObject:[[IGListMoveIndex alloc] initWithFrom:3 to:4]]
insertIndexPaths:@[path]
deleteIndexPaths:@[path]
moveIndexPaths:@[[[IGListMoveIndexPath alloc] initWithFrom:path to:path]]];
IGListTestAdapterDataSource *dataSource = [IGListTestAdapterDataSource new];
dataSource.objects = @[@1, @2, @3];
IGListAdapter *adapter1 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:nil workingRangeSize:0];
adapter1.collectionView = collectionView;
adapter1.dataSource = dataSource;
IGListAdapter *adapter2 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:controller workingRangeSize:2];
adapter2.collectionView = collectionView;
IGListAdapter *adapter3 = [[IGListAdapter alloc] initWithUpdater:[IGListAdapterUpdater new] viewController:controller workingRangeSize:2];
adapter3.collectionView = collectionView;
NSArray *descriptions = [IGListDebugger adapterDescriptions];
XCTAssertEqual(descriptions.count, 4);
}
@end
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
drop dataverse test if exists;
create dataverse test;
use test;
create type test.MyRecord as
{
id : bigint,
point : point,
kwds : string
};
create external dataset MyData(MyRecord) using localfs((`path`=`asterix_nc1://data/spatial/spatialData.json`),(`format`=`adm`));
|
{
"pile_set_name": "Github"
}
|
var baseSum = require('./_baseSum'),
identity = require('./identity');
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
module.exports = sum;
|
{
"pile_set_name": "Github"
}
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageProfile(Model):
"""Storage Profile properties of a server.
:param backup_retention_days: Backup retention days for the server.
:type backup_retention_days: int
:param geo_redundant_backup: Enable Geo-redundant or not for server
backup. Possible values include: 'Enabled', 'Disabled'
:type geo_redundant_backup: str or
~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup
:param storage_mb: Max storage allowed for a server.
:type storage_mb: int
"""
_attribute_map = {
'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'},
'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'},
'storage_mb': {'key': 'storageMB', 'type': 'int'},
}
def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None:
super(StorageProfile, self).__init__(**kwargs)
self.backup_retention_days = backup_retention_days
self.geo_redundant_backup = geo_redundant_backup
self.storage_mb = storage_mb
|
{
"pile_set_name": "Github"
}
|
namespace ScriptableObjectArchitecture
{
public static class SOArchitecture_Utility
{
public const int ASSET_MENU_ORDER_VARIABLES = 121;
public const int ASSET_MENU_ORDER_EVENTS = 122;
public const int ASSET_MENU_ORDER_COLLECTIONS = 123;
public const string VARIABLE_SUBMENU = "Variables/";
public const string COLLECTION_SUBMENU = "Collections/";
public const string GAME_EVENT = "Game Events/";
public const string ADVANCED_GAME_EVENT = GAME_EVENT + "Advanced/";
public const string ADVANCED_VARIABLE_SUBMENU = VARIABLE_SUBMENU + "Advanced/";
public const string ADVANCED_VARIABLE_COLLECTION = COLLECTION_SUBMENU + "Advanced/";
// Add Component Menus
public const string ADD_COMPONENT_ROOT_MENU = "SO Architecture/";
public const string EVENT_LISTENER_SUBMENU = ADD_COMPONENT_ROOT_MENU + "Event Listeners/";
}
}
|
{
"pile_set_name": "Github"
}
|
package net.sgoliver.android.controlpers2;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
public class ControlLogin extends LinearLayout {
private EditText txtUsuario;
private EditText txtPassword;
private Button btnLogin;
private TextView lblMensaje;
private OnLoginListener listener;
public ControlLogin(Context context) {
super(context);
inicializar();
}
public ControlLogin(Context context, AttributeSet attrs) {
super(context, attrs);
inicializar();
// Procesamos los atributos XML personalizados
TypedArray a =
getContext().obtainStyledAttributes(attrs,
R.styleable.ControlLogin);
String textoBoton = a.getString(
R.styleable.ControlLogin_login_text);
btnLogin.setText(textoBoton);
a.recycle();
}
private void inicializar()
{
//Utilizamos el layout 'control_login' como interfaz del control
String infService = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li =
(LayoutInflater)getContext().getSystemService(infService);
li.inflate(R.layout.control_login, this, true);
//Obtenemoslas referencias a los distintos control
txtUsuario = (EditText)findViewById(R.id.TxtUsuario);
txtPassword = (EditText)findViewById(R.id.TxtPassword);
btnLogin = (Button)findViewById(R.id.BtnAceptar);
lblMensaje = (TextView)findViewById(R.id.LblMensaje);
//Asociamos los eventos necesarios
asignarEventos();
}
public void setOnLoginListener(OnLoginListener l)
{
listener = l;
}
private void asignarEventos()
{
btnLogin.setOnClickListener(new OnClickListener()
{
public void onClick(View v) {
listener.onLogin(txtUsuario.getText().toString(),
txtPassword.getText().toString());
}
});
}
public void setMensaje(String msg)
{
lblMensaje.setText(msg);
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
#include <map>
#include <memory>
#include <string>
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/prefs/testing_pref_service.h"
#include "net/log/test_net_log.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
class PrefService;
class TestingPrefServiceSimple;
namespace data_reduction_proxy {
class DataReductionProxyTestContext;
class MockDataReductionProxyConfig;
template <class C>
class MockDataReductionProxySettings : public C {
public:
MockDataReductionProxySettings<C>() : C() {
}
MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*());
MOCK_METHOD0(GetLocalStatePrefs, PrefService*());
MOCK_METHOD1(RecordStartupState,
void(ProxyStartupState state));
};
class DataReductionProxySettingsTestBase : public testing::Test {
public:
static void AddTestProxyToCommandLine();
DataReductionProxySettingsTestBase();
DataReductionProxySettingsTestBase(bool allowed,
bool fallback_allowed,
bool promo_allowed);
~DataReductionProxySettingsTestBase() override;
void AddProxyToCommandLine();
void SetUp() override;
template <class C> void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback);
virtual void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback) = 0;
void ExpectSetProxyPrefs(bool expected_enabled,
bool expected_at_startup);
void CheckMaybeActivateDataReductionProxy(bool initially_enabled,
bool request_succeeded,
bool expected_enabled,
bool expected_restricted,
bool expected_fallback_restricted);
void CheckOnPrefChange(bool enabled, bool expected_enabled, bool managed);
void InitWithStatisticsPrefs();
void InitDataReductionProxy(bool enabled_at_startup);
void CheckDataReductionProxySyntheticTrial(bool enabled);
bool SyntheticFieldTrialRegistrationCallback(const std::string& trial_name,
const std::string& group_name) {
synthetic_field_trials_[trial_name] = group_name;
return true;
}
base::MessageLoopForIO message_loop_;
std::unique_ptr<DataReductionProxyTestContext> test_context_;
std::unique_ptr<DataReductionProxySettings> settings_;
base::Time last_update_time_;
std::map<std::string, std::string> synthetic_field_trials_;
};
// Test implementations should be subclasses of an instantiation of this
// class parameterized for whatever DataReductionProxySettings class
// is being tested.
template <class C>
class ConcreteDataReductionProxySettingsTest
: public DataReductionProxySettingsTestBase {
public:
typedef MockDataReductionProxySettings<C> MockSettings;
void ResetSettings(bool allowed,
bool fallback_allowed,
bool promo_allowed,
bool holdback) override {
return DataReductionProxySettingsTestBase::ResetSettings<C>(
allowed, fallback_allowed, promo_allowed, holdback);
}
};
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
|
{
"pile_set_name": "Github"
}
|
describe('jsdoc/src/astNode', () => {
const astBuilder = require('jsdoc/src/astbuilder');
const astNode = require('jsdoc/src/astnode');
const babelParser = require('@babel/parser');
const env = require('jsdoc/env');
const Syntax = require('jsdoc/src/syntax').Syntax;
function parse(str) {
return babelParser.parse(str, astBuilder.parserOptions).program.body[0];
}
// create the AST nodes we'll be testing
const arrayExpression = parse('[,]').expression;
const arrowFunctionExpression = parse('var foo = () => {};').declarations[0].init;
const assignmentExpression = parse('foo = 1;').expression;
const binaryExpression = parse('foo & foo;').expression;
const experimentalObjectRestSpread = parse('var one = {...two, three: 4};').declarations[0].init;
const functionDeclaration1 = parse('function foo() {}');
const functionDeclaration2 = parse('function foo(bar) {}');
const functionDeclaration3 = parse('function foo(bar, baz, qux) {}');
const functionDeclaration4 = parse('function foo(...bar) {}');
const functionExpression1 = parse('var foo = function() {};').declarations[0].init;
const functionExpression2 = parse('var foo = function(bar) {};').declarations[0].init;
const identifier = parse('foo;').expression;
const literal = parse('1;').expression;
const memberExpression = parse('foo.bar;').expression;
const memberExpressionComputed1 = parse('foo["bar"];').expression;
const memberExpressionComputed2 = parse('foo[\'bar\'];').expression;
const methodDefinition1 = parse('class Foo { bar() {} }').body.body[0];
const methodDefinition2 = parse('var foo = () => class { bar() {} };').declarations[0].init.body
.body[0];
const propertyGet = parse('var foo = { get bar() {} };').declarations[0].init.properties[0];
const propertyInit = parse('var foo = { bar: {} };').declarations[0].init.properties[0];
const propertySet = parse('var foo = { set bar(a) {} };').declarations[0].init.properties[0];
const thisExpression = parse('this;').expression;
const unaryExpression1 = parse('+1;').expression;
const unaryExpression2 = parse('+foo;').expression;
const variableDeclarator1 = parse('var foo = 1;').declarations[0];
const variableDeclarator2 = parse('var foo;').declarations[0];
it('should exist', () => {
expect(astNode).toBeObject();
});
it('should export an addNodeProperties method', () => {
expect(astNode.addNodeProperties).toBeFunction();
});
it('should export a getInfo method', () => {
expect(astNode.getInfo).toBeFunction();
});
it('should export a getParamNames method', () => {
expect(astNode.getParamNames).toBeFunction();
});
it('should export an isAccessor method', () => {
expect(astNode.isAccessor).toBeFunction();
});
it('should export an isAssignment method', () => {
expect(astNode.isAssignment).toBeFunction();
});
it('should export an isFunction method', () => {
expect(astNode.isFunction).toBeFunction();
});
it('should export an isScope method', () => {
expect(astNode.isScope).toBeFunction();
});
it('should export a nodeToString method', () => {
expect(astNode.nodeToString).toBeFunction();
});
it('should export a nodeToValue method', () => {
expect(astNode.nodeToValue).toBeFunction();
});
describe('addNodeProperties', () => {
let debugEnabled;
beforeEach(() => {
debugEnabled = Boolean(env.opts.debug);
});
afterEach(() => {
env.opts.debug = debugEnabled;
});
it('should return null for undefined input', () => {
expect( astNode.addNodeProperties() ).toBe(null);
});
it('should return null if the input is not an object', () => {
expect( astNode.addNodeProperties('foo') ).toBe(null);
});
it('should preserve existing properties that are not "node properties"', () => {
const node = astNode.addNodeProperties({foo: 1});
expect(node).toBeObject();
expect(node.foo).toBe(1);
});
it('should add a non-enumerable nodeId if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'nodeId');
expect(descriptor).toBeObject();
expect(descriptor.value).toBeString();
expect(descriptor.enumerable).toBeFalse();
});
it('should not overwrite an existing nodeId', () => {
const nodeId = 'foo';
const node = astNode.addNodeProperties({nodeId: nodeId});
expect(node.nodeId).toBe(nodeId);
});
it('should add an enumerable nodeId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'nodeId');
expect(descriptor.enumerable).toBeTrue();
});
it('should add a non-enumerable, writable parent if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'parent');
expect(descriptor).toBeDefined();
expect(descriptor.value).toBeUndefined();
expect(descriptor.enumerable).toBeFalse();
expect(descriptor.writable).toBeTrue();
});
it('should not overwrite an existing parent', () => {
const parent = {};
const node = astNode.addNodeProperties({parent: parent});
expect(node.parent).toBe(parent);
});
it('should not overwrite a null parent', () => {
const node = astNode.addNodeProperties({parent: null});
expect(node.parent).toBeNull();
});
it('should add an enumerable parentId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'parentId');
expect(descriptor).toBeObject();
expect(descriptor.enumerable).toBeTrue();
});
it('should provide a null parentId in debug mode for nodes with no parent', () => {
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
expect(node.parentId).toBeNull();
});
it('should provide a non-null parentId in debug mode for nodes with a parent', () => {
let node;
let parent;
env.opts.debug = true;
node = astNode.addNodeProperties({});
parent = astNode.addNodeProperties({});
node.parent = parent;
expect(node.parentId).toBe(parent.nodeId);
});
it('should add a non-enumerable, writable enclosingScope if necessary', () => {
const node = astNode.addNodeProperties({});
const descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScope');
expect(descriptor).toBeObject();
expect(descriptor.value).toBeUndefined();
expect(descriptor.enumerable).toBeFalse();
expect(descriptor.writable).toBeTrue();
});
it('should not overwrite an existing enclosingScope', () => {
const enclosingScope = {};
const node = astNode.addNodeProperties({enclosingScope: enclosingScope});
expect(node.enclosingScope).toBe(enclosingScope);
});
it('should not overwrite a null enclosingScope', () => {
const node = astNode.addNodeProperties({enclosingScope: null});
expect(node.enclosingScope).toBeNull();
});
it('should add an enumerable enclosingScopeId in debug mode', () => {
let descriptor;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
descriptor = Object.getOwnPropertyDescriptor(node, 'enclosingScopeId');
expect(descriptor).toBeObject();
expect(descriptor.enumerable).toBeTrue();
});
it('should provide a null enclosingScopeId in debug mode for nodes with no enclosing scope',
() => {
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
expect(node.enclosingScopeId).toBeNull();
});
it('should provide a non-null enclosingScopeId in debug mode for nodes with an enclosing ' +
'scope', () => {
let enclosingScope;
let node;
env.opts.debug = true;
node = astNode.addNodeProperties({});
enclosingScope = astNode.addNodeProperties({});
node.enclosingScope = enclosingScope;
expect(node.enclosingScopeId).toBe(enclosingScope.nodeId);
});
});
describe('getInfo', () => {
it('should throw an error for undefined input', () => {
function noNode() {
astNode.getInfo();
}
expect(noNode).toThrow();
});
it('should return the correct info for an AssignmentExpression', () => {
const info = astNode.getInfo(assignmentExpression);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Literal);
expect(info.node.value).toBe(1);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.Literal);
expect(info.value).toBe(1);
});
it('should return the correct info for a FunctionDeclaration', () => {
const info = astNode.getInfo(functionDeclaration2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionDeclaration);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.FunctionDeclaration);
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('bar');
});
it('should return the correct info for a FunctionExpression', () => {
const info = astNode.getInfo(functionExpression2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionExpression);
expect(info.name).toBe('');
expect(info.type).toBe(Syntax.FunctionExpression);
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('bar');
});
it('should return the correct info for a MemberExpression', () => {
const info = astNode.getInfo(memberExpression);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.MemberExpression);
expect(info.name).toBe('foo.bar');
expect(info.type).toBe(Syntax.MemberExpression);
});
it('should return the correct info for a computed MemberExpression', () => {
const info = astNode.getInfo(memberExpressionComputed1);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.MemberExpression);
expect(info.name).toBe('foo["bar"]');
expect(info.type).toBe(Syntax.MemberExpression);
});
it('should return the correct info for a Property initializer', () => {
const info = astNode.getInfo(propertyInit);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.ObjectExpression);
expect(info.name).toBe('bar');
expect(info.type).toBe(Syntax.ObjectExpression);
});
it('should return the correct info for a Property setter', () => {
const info = astNode.getInfo(propertySet);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.FunctionExpression);
expect(info.name).toBe('bar');
expect(info.type).toBeUndefined();
expect(info.value).toBeUndefined();
expect(info.paramnames).toBeArrayOfSize(1);
expect(info.paramnames[0]).toBe('a');
});
it('should return the correct info for a VariableDeclarator with a value', () => {
const info = astNode.getInfo(variableDeclarator1);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Literal);
expect(info.name).toBe('foo');
expect(info.type).toBe(Syntax.Literal);
expect(info.value).toBe(1);
});
it('should return the correct info for a VariableDeclarator with no value', () => {
const info = astNode.getInfo(variableDeclarator2);
expect(info).toBeObject();
expect(info.node).toBeObject();
expect(info.node.type).toBe(Syntax.Identifier);
expect(info.name).toBe('foo');
expect(info.type).toBeUndefined();
expect(info.value).toBeUndefined();
});
it('should return the correct info for other node types', () => {
const info = astNode.getInfo(binaryExpression);
expect(info).toBeObject();
expect(info.node).toBe(binaryExpression);
expect(info.type).toBe(Syntax.BinaryExpression);
});
});
describe('getParamNames', () => {
it('should return an empty array for undefined input', () => {
const params = astNode.getParamNames();
expect(params).toBeEmptyArray();
});
it('should return an empty array if the input has no params property', () => {
const params = astNode.getParamNames({});
expect(params).toBeEmptyArray();
});
it('should return an empty array if the input has no params', () => {
const params = astNode.getParamNames(functionDeclaration1);
expect(params).toBeEmptyArray();
});
it('should return a single-item array if the input has a single param', () => {
const params = astNode.getParamNames(functionDeclaration2);
expect(params).toEqual(['bar']);
});
it('should return a multi-item array if the input has multiple params', () => {
const params = astNode.getParamNames(functionDeclaration3);
expect(params).toEqual([
'bar',
'baz',
'qux'
]);
});
it('should include rest parameters', () => {
const params = astNode.getParamNames(functionDeclaration4);
expect(params).toEqual(['bar']);
});
});
describe('isAccessor', () => {
it('should return false for undefined values', () => {
expect( astNode.isAccessor() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isAccessor('foo') ).toBeFalse();
});
it('should return false for non-Property nodes', () => {
expect( astNode.isAccessor(binaryExpression) ).toBeFalse();
});
it('should return false for Property nodes whose kind is "init"', () => {
expect( astNode.isAccessor(propertyInit) ).toBeFalse();
});
it('should return true for Property nodes whose kind is "get"', () => {
expect( astNode.isAccessor(propertyGet) ).toBeTrue();
});
it('should return true for Property nodes whose kind is "set"', () => {
expect( astNode.isAccessor(propertySet) ).toBeTrue();
});
});
describe('isAssignment', () => {
it('should return false for undefined values', () => {
expect( astNode.isAssignment() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isAssignment('foo') ).toBeFalse();
});
it('should return false for nodes that are not assignments', () => {
expect( astNode.isAssignment(binaryExpression) ).toBeFalse();
});
it('should return true for AssignmentExpression nodes', () => {
expect( astNode.isAssignment(assignmentExpression) ).toBeTrue();
});
it('should return true for VariableDeclarator nodes', () => {
expect( astNode.isAssignment(variableDeclarator1) ).toBeTrue();
});
});
describe('isFunction', () => {
it('should recognize function declarations as functions', () => {
expect( astNode.isFunction(functionDeclaration1) ).toBeTrue();
});
it('should recognize function expressions as functions', () => {
expect( astNode.isFunction(functionExpression1) ).toBeTrue();
});
it('should recognize method definitions as functions', () => {
expect( astNode.isFunction(methodDefinition1) ).toBeTrue();
});
it('should recognize arrow function expressions as functions', () => {
expect( astNode.isFunction(arrowFunctionExpression) ).toBeTrue();
});
it('should recognize non-functions', () => {
expect( astNode.isFunction(arrayExpression) ).toBeFalse();
});
});
describe('isScope', () => {
it('should return false for undefined values', () => {
expect( astNode.isScope() ).toBeFalse();
});
it('should return false if the parameter is not an object', () => {
expect( astNode.isScope('foo') ).toBeFalse();
});
it('should return true for CatchClause nodes', () => {
expect( astNode.isScope({type: Syntax.CatchClause}) ).toBeTrue();
});
it('should return true for FunctionDeclaration nodes', () => {
expect( astNode.isScope({type: Syntax.FunctionDeclaration}) ).toBeTrue();
});
it('should return true for FunctionExpression nodes', () => {
expect( astNode.isScope({type: Syntax.FunctionExpression}) ).toBeTrue();
});
it('should return false for other nodes', () => {
expect( astNode.isScope({type: Syntax.NameExpression}) ).toBeFalse();
});
});
describe('nodeToString', () => {
it('should be an alias to nodeToValue', () => {
expect(astNode.nodeToString).toBe(astNode.nodeToValue);
});
});
describe('nodeToValue', () => {
it('should return `[null]` for the sparse array `[,]`', () => {
expect( astNode.nodeToValue(arrayExpression) ).toBe('[null]');
});
it('should return the variable name for assignment expressions', () => {
expect( astNode.nodeToValue(assignmentExpression) ).toBe('foo');
});
it('should return the function name for function declarations', () => {
expect( astNode.nodeToValue(functionDeclaration1) ).toBe('foo');
});
it('should return undefined for anonymous function expressions', () => {
expect( astNode.nodeToValue(functionExpression1) ).toBeUndefined();
});
it('should return the identifier name for identifiers', () => {
expect( astNode.nodeToValue(identifier) ).toBe('foo');
});
it('should return the literal value for literals', () => {
expect( astNode.nodeToValue(literal) ).toBe(1);
});
it('should return the object and property for noncomputed member expressions', () => {
expect( astNode.nodeToValue(memberExpression) ).toBe('foo.bar');
});
it('should return the object and property, with a computed property that uses the same ' +
'quote character as the original source, for computed member expressions', () => {
expect( astNode.nodeToValue(memberExpressionComputed1) ).toBe('foo["bar"]');
expect( astNode.nodeToValue(memberExpressionComputed2) ).toBe('foo[\'bar\']');
});
// TODO: we can't test this here because JSDoc, not Babylon, adds the `parent` property to
// nodes. also, we currently return an empty string instead of `<anonymous>` in this case;
// see `module:jsdoc/src/astnode.nodeToValue` and the comment on `Syntax.MethodDefinition`
// for details
xit('should return `<anonymous>` for method definitions inside classes that were ' +
'returned by an arrow function expression', () => {
expect( astNode.nodeToValue(methodDefinition2) ).toBe('<anonymous>');
});
it('should return "this" for this expressions', () => {
expect( astNode.nodeToValue(thisExpression) ).toBe('this');
});
it('should return the operator and nodeToValue value for prefix unary expressions',
() => {
expect( astNode.nodeToValue(unaryExpression1) ).toBe('+1');
expect( astNode.nodeToValue(unaryExpression2) ).toBe('+foo');
});
it('should throw an error for postfix unary expressions', () => {
function postfixNodeToValue() {
// there's no valid source representation for this one, so we fake it
const unaryExpressionPostfix = (() => {
const node = parse('+1;').body[0].expression;
node.prefix = false;
return node;
})();
return astNode.nodeToValue(unaryExpressionPostfix);
}
expect(postfixNodeToValue).toThrow();
});
it('should return the variable name for variable declarators', () => {
expect( astNode.nodeToValue(variableDeclarator1) ).toBe('foo');
});
it('should return an empty string for all other nodes', () => {
expect( astNode.nodeToValue(binaryExpression) ).toBe('');
});
it('should understand and ignore ExperimentalSpreadProperty', () => {
expect( astNode.nodeToValue(experimentalObjectRestSpread) ).toBe('{"three":4}');
});
});
});
|
{
"pile_set_name": "Github"
}
|
// This file was generated by go generate; DO NOT EDIT
package currency
import "golang.org/x/text/internal/tag"
// CLDRVersion is the CLDR version from which the tables in this package are derived.
const CLDRVersion = "29"
const (
xxx = 282
xts = 280
usd = 249
eur = 92
jpy = 131
gbp = 97
chf = 60
aud = 19
nzd = 190
cad = 57
sek = 217
nok = 188
dkk = 80
xag = 263
xau = 264
xpt = 277
xpd = 275
brl = 46
cny = 66
inr = 123
rub = 208
hkd = 112
idr = 118
krw = 139
mxn = 176
pln = 199
sar = 211
thb = 232
try = 241
twd = 243
zar = 290
)
// currency holds an alphabetically sorted list of canonical 3-letter currency
// identifiers. Each identifier is followed by a byte of type currencyInfo,
// defined in gen_common.go.
var currency tag.Index = "" + // Size: 1196 bytes
"\x00\x00\x00\x00ADP\x09AED\x00AFA\x00AFN\x09ALK\x00ALL\x09AMD\x09ANG\x00" +
"AOA\x00AOK\x00AON\x00AOR\x00ARA\x00ARL\x00ARM\x00ARP\x00ARS\x00ATS\x00AU" +
"D\x00AWG\x00AZM\x00AZN\x00BAD\x00BAM\x00BAN\x00BBD\x00BDT\x00BEC\x00BEF" +
"\x00BEL\x00BGL\x00BGM\x00BGN\x00BGO\x00BHD\x1bBIF\x09BMD\x00BND\x00BOB" +
"\x00BOL\x00BOP\x00BOV\x00BRB\x00BRC\x00BRE\x00BRL\x00BRN\x00BRR\x00BRZ" +
"\x00BSD\x00BTN\x00BUK\x00BWP\x00BYB\x00BYR\x09BZD\x00CAD(CDF\x00CHE\x00C" +
"HF(CHW\x00CLE\x00CLF$CLP\x09CNX\x00CNY\x00COP\x09COU\x00CRC\x09CSD\x00CS" +
"K\x00CUC\x00CUP\x00CVE\x00CYP\x00CZK\x08DDM\x00DEM\x00DJF\x09DKK\x00DOP" +
"\x00DZD\x00ECS\x00ECV\x00EEK\x00EGP\x00ERN\x00ESA\x00ESB\x00ESP\x09ETB" +
"\x00EUR\x00FIM\x00FJD\x00FKP\x00FRF\x00GBP\x00GEK\x00GEL\x00GHC\x00GHS" +
"\x00GIP\x00GMD\x00GNF\x09GNS\x00GQE\x00GRD\x00GTQ\x00GWE\x00GWP\x00GYD" +
"\x09HKD\x00HNL\x00HRD\x00HRK\x00HTG\x00HUF\x08IDR\x09IEP\x00ILP\x00ILR" +
"\x00ILS\x00INR\x00IQD\x09IRR\x09ISJ\x00ISK\x09ITL\x09JMD\x00JOD\x1bJPY" +
"\x09KES\x00KGS\x00KHR\x00KMF\x09KPW\x09KRH\x00KRO\x00KRW\x09KWD\x1bKYD" +
"\x00KZT\x00LAK\x09LBP\x09LKR\x00LRD\x00LSL\x00LTL\x00LTT\x00LUC\x00LUF" +
"\x09LUL\x00LVL\x00LVR\x00LYD\x1bMAD\x00MAF\x00MCF\x00MDC\x00MDL\x00MGA" +
"\x09MGF\x09MKD\x00MKN\x00MLF\x00MMK\x09MNT\x09MOP\x00MRO\x09MTL\x00MTP" +
"\x00MUR\x09MVP\x00MVR\x00MWK\x00MXN\x00MXP\x00MXV\x00MYR\x00MZE\x00MZM" +
"\x00MZN\x00NAD\x00NGN\x00NIC\x00NIO\x00NLG\x00NOK\x00NPR\x00NZD\x00OMR" +
"\x1bPAB\x00PEI\x00PEN\x00PES\x00PGK\x00PHP\x00PKR\x09PLN\x00PLZ\x00PTE" +
"\x00PYG\x09QAR\x00RHD\x00ROL\x00RON\x00RSD\x09RUB\x00RUR\x00RWF\x09SAR" +
"\x00SBD\x00SCR\x00SDD\x00SDG\x00SDP\x00SEK\x00SGD\x00SHP\x00SIT\x00SKK" +
"\x00SLL\x09SOS\x09SRD\x00SRG\x00SSP\x00STD\x09SUR\x00SVC\x00SYP\x09SZL" +
"\x00THB\x00TJR\x00TJS\x00TMM\x09TMT\x00TND\x1bTOP\x00TPE\x00TRL\x09TRY" +
"\x00TTD\x00TWD\x08TZS\x09UAH\x00UAK\x00UGS\x00UGX\x09USD\x00USN\x00USS" +
"\x00UYI\x09UYP\x00UYU\x00UZS\x09VEB\x00VEF\x00VND\x09VNN\x00VUV\x09WST" +
"\x00XAF\x09XAG\x00XAU\x00XBA\x00XBB\x00XBC\x00XBD\x00XCD\x00XDR\x00XEU" +
"\x00XFO\x00XFU\x00XOF\x09XPD\x00XPF\x09XPT\x00XRE\x00XSU\x00XTS\x00XUA" +
"\x00XXX\x00YDD\x00YER\x09YUD\x00YUM\x00YUN\x00YUR\x00ZAL\x00ZAR\x00ZMK" +
"\x09ZMW\x00ZRN\x00ZRZ\x00ZWD\x09ZWL\x00ZWR\x00\xff\xff\xff\xff"
const numCurrencies = 297
type toCurrency struct {
region uint16
code uint16
}
var regionToCurrency = []toCurrency{ // 255 elements
0: {region: 0x4143, code: 0xdb},
1: {region: 0x4144, code: 0x5c},
2: {region: 0x4145, code: 0x2},
3: {region: 0x4146, code: 0x4},
4: {region: 0x4147, code: 0x10d},
5: {region: 0x4149, code: 0x10d},
6: {region: 0x414c, code: 0x6},
7: {region: 0x414d, code: 0x7},
8: {region: 0x414f, code: 0x9},
9: {region: 0x4152, code: 0x11},
10: {region: 0x4153, code: 0xf9},
11: {region: 0x4154, code: 0x5c},
12: {region: 0x4155, code: 0x13},
13: {region: 0x4157, code: 0x14},
14: {region: 0x4158, code: 0x5c},
15: {region: 0x415a, code: 0x16},
16: {region: 0x4241, code: 0x18},
17: {region: 0x4242, code: 0x1a},
18: {region: 0x4244, code: 0x1b},
19: {region: 0x4245, code: 0x5c},
20: {region: 0x4246, code: 0x112},
21: {region: 0x4247, code: 0x21},
22: {region: 0x4248, code: 0x23},
23: {region: 0x4249, code: 0x24},
24: {region: 0x424a, code: 0x112},
25: {region: 0x424c, code: 0x5c},
26: {region: 0x424d, code: 0x25},
27: {region: 0x424e, code: 0x26},
28: {region: 0x424f, code: 0x27},
29: {region: 0x4251, code: 0xf9},
30: {region: 0x4252, code: 0x2e},
31: {region: 0x4253, code: 0x32},
32: {region: 0x4254, code: 0x33},
33: {region: 0x4256, code: 0xbc},
34: {region: 0x4257, code: 0x35},
35: {region: 0x4259, code: 0x37},
36: {region: 0x425a, code: 0x38},
37: {region: 0x4341, code: 0x39},
38: {region: 0x4343, code: 0x13},
39: {region: 0x4344, code: 0x3a},
40: {region: 0x4346, code: 0x106},
41: {region: 0x4347, code: 0x106},
42: {region: 0x4348, code: 0x3c},
43: {region: 0x4349, code: 0x112},
44: {region: 0x434b, code: 0xbe},
45: {region: 0x434c, code: 0x40},
46: {region: 0x434d, code: 0x106},
47: {region: 0x434e, code: 0x42},
48: {region: 0x434f, code: 0x43},
49: {region: 0x4352, code: 0x45},
50: {region: 0x4355, code: 0x49},
51: {region: 0x4356, code: 0x4a},
52: {region: 0x4357, code: 0x8},
53: {region: 0x4358, code: 0x13},
54: {region: 0x4359, code: 0x5c},
55: {region: 0x435a, code: 0x4c},
56: {region: 0x4445, code: 0x5c},
57: {region: 0x4447, code: 0xf9},
58: {region: 0x444a, code: 0x4f},
59: {region: 0x444b, code: 0x50},
60: {region: 0x444d, code: 0x10d},
61: {region: 0x444f, code: 0x51},
62: {region: 0x445a, code: 0x52},
63: {region: 0x4541, code: 0x5c},
64: {region: 0x4543, code: 0xf9},
65: {region: 0x4545, code: 0x5c},
66: {region: 0x4547, code: 0x56},
67: {region: 0x4548, code: 0x9c},
68: {region: 0x4552, code: 0x57},
69: {region: 0x4553, code: 0x5c},
70: {region: 0x4554, code: 0x5b},
71: {region: 0x4555, code: 0x5c},
72: {region: 0x4649, code: 0x5c},
73: {region: 0x464a, code: 0x5e},
74: {region: 0x464b, code: 0x5f},
75: {region: 0x464d, code: 0xf9},
76: {region: 0x464f, code: 0x50},
77: {region: 0x4652, code: 0x5c},
78: {region: 0x4741, code: 0x106},
79: {region: 0x4742, code: 0x61},
80: {region: 0x4744, code: 0x10d},
81: {region: 0x4745, code: 0x63},
82: {region: 0x4746, code: 0x5c},
83: {region: 0x4747, code: 0x61},
84: {region: 0x4748, code: 0x65},
85: {region: 0x4749, code: 0x66},
86: {region: 0x474c, code: 0x50},
87: {region: 0x474d, code: 0x67},
88: {region: 0x474e, code: 0x68},
89: {region: 0x4750, code: 0x5c},
90: {region: 0x4751, code: 0x106},
91: {region: 0x4752, code: 0x5c},
92: {region: 0x4753, code: 0x61},
93: {region: 0x4754, code: 0x6c},
94: {region: 0x4755, code: 0xf9},
95: {region: 0x4757, code: 0x112},
96: {region: 0x4759, code: 0x6f},
97: {region: 0x484b, code: 0x70},
98: {region: 0x484d, code: 0x13},
99: {region: 0x484e, code: 0x71},
100: {region: 0x4852, code: 0x73},
101: {region: 0x4854, code: 0x74},
102: {region: 0x4855, code: 0x75},
103: {region: 0x4943, code: 0x5c},
104: {region: 0x4944, code: 0x76},
105: {region: 0x4945, code: 0x5c},
106: {region: 0x494c, code: 0x7a},
107: {region: 0x494d, code: 0x61},
108: {region: 0x494e, code: 0x7b},
109: {region: 0x494f, code: 0xf9},
110: {region: 0x4951, code: 0x7c},
111: {region: 0x4952, code: 0x7d},
112: {region: 0x4953, code: 0x7f},
113: {region: 0x4954, code: 0x5c},
114: {region: 0x4a45, code: 0x61},
115: {region: 0x4a4d, code: 0x81},
116: {region: 0x4a4f, code: 0x82},
117: {region: 0x4a50, code: 0x83},
118: {region: 0x4b45, code: 0x84},
119: {region: 0x4b47, code: 0x85},
120: {region: 0x4b48, code: 0x86},
121: {region: 0x4b49, code: 0x13},
122: {region: 0x4b4d, code: 0x87},
123: {region: 0x4b4e, code: 0x10d},
124: {region: 0x4b50, code: 0x88},
125: {region: 0x4b52, code: 0x8b},
126: {region: 0x4b57, code: 0x8c},
127: {region: 0x4b59, code: 0x8d},
128: {region: 0x4b5a, code: 0x8e},
129: {region: 0x4c41, code: 0x8f},
130: {region: 0x4c42, code: 0x90},
131: {region: 0x4c43, code: 0x10d},
132: {region: 0x4c49, code: 0x3c},
133: {region: 0x4c4b, code: 0x91},
134: {region: 0x4c52, code: 0x92},
135: {region: 0x4c53, code: 0x122},
136: {region: 0x4c54, code: 0x5c},
137: {region: 0x4c55, code: 0x5c},
138: {region: 0x4c56, code: 0x5c},
139: {region: 0x4c59, code: 0x9b},
140: {region: 0x4d41, code: 0x9c},
141: {region: 0x4d43, code: 0x5c},
142: {region: 0x4d44, code: 0xa0},
143: {region: 0x4d45, code: 0x5c},
144: {region: 0x4d46, code: 0x5c},
145: {region: 0x4d47, code: 0xa1},
146: {region: 0x4d48, code: 0xf9},
147: {region: 0x4d4b, code: 0xa3},
148: {region: 0x4d4c, code: 0x112},
149: {region: 0x4d4d, code: 0xa6},
150: {region: 0x4d4e, code: 0xa7},
151: {region: 0x4d4f, code: 0xa8},
152: {region: 0x4d50, code: 0xf9},
153: {region: 0x4d51, code: 0x5c},
154: {region: 0x4d52, code: 0xa9},
155: {region: 0x4d53, code: 0x10d},
156: {region: 0x4d54, code: 0x5c},
157: {region: 0x4d55, code: 0xac},
158: {region: 0x4d56, code: 0xae},
159: {region: 0x4d57, code: 0xaf},
160: {region: 0x4d58, code: 0xb0},
161: {region: 0x4d59, code: 0xb3},
162: {region: 0x4d5a, code: 0xb6},
163: {region: 0x4e41, code: 0xb7},
164: {region: 0x4e43, code: 0x114},
165: {region: 0x4e45, code: 0x112},
166: {region: 0x4e46, code: 0x13},
167: {region: 0x4e47, code: 0xb8},
168: {region: 0x4e49, code: 0xba},
169: {region: 0x4e4c, code: 0x5c},
170: {region: 0x4e4f, code: 0xbc},
171: {region: 0x4e50, code: 0xbd},
172: {region: 0x4e52, code: 0x13},
173: {region: 0x4e55, code: 0xbe},
174: {region: 0x4e5a, code: 0xbe},
175: {region: 0x4f4d, code: 0xbf},
176: {region: 0x5041, code: 0xc0},
177: {region: 0x5045, code: 0xc2},
178: {region: 0x5046, code: 0x114},
179: {region: 0x5047, code: 0xc4},
180: {region: 0x5048, code: 0xc5},
181: {region: 0x504b, code: 0xc6},
182: {region: 0x504c, code: 0xc7},
183: {region: 0x504d, code: 0x5c},
184: {region: 0x504e, code: 0xbe},
185: {region: 0x5052, code: 0xf9},
186: {region: 0x5053, code: 0x7a},
187: {region: 0x5054, code: 0x5c},
188: {region: 0x5057, code: 0xf9},
189: {region: 0x5059, code: 0xca},
190: {region: 0x5141, code: 0xcb},
191: {region: 0x5245, code: 0x5c},
192: {region: 0x524f, code: 0xce},
193: {region: 0x5253, code: 0xcf},
194: {region: 0x5255, code: 0xd0},
195: {region: 0x5257, code: 0xd2},
196: {region: 0x5341, code: 0xd3},
197: {region: 0x5342, code: 0xd4},
198: {region: 0x5343, code: 0xd5},
199: {region: 0x5344, code: 0xd7},
200: {region: 0x5345, code: 0xd9},
201: {region: 0x5347, code: 0xda},
202: {region: 0x5348, code: 0xdb},
203: {region: 0x5349, code: 0x5c},
204: {region: 0x534a, code: 0xbc},
205: {region: 0x534b, code: 0x5c},
206: {region: 0x534c, code: 0xde},
207: {region: 0x534d, code: 0x5c},
208: {region: 0x534e, code: 0x112},
209: {region: 0x534f, code: 0xdf},
210: {region: 0x5352, code: 0xe0},
211: {region: 0x5353, code: 0xe2},
212: {region: 0x5354, code: 0xe3},
213: {region: 0x5356, code: 0xf9},
214: {region: 0x5358, code: 0x8},
215: {region: 0x5359, code: 0xe6},
216: {region: 0x535a, code: 0xe7},
217: {region: 0x5441, code: 0x61},
218: {region: 0x5443, code: 0xf9},
219: {region: 0x5444, code: 0x106},
220: {region: 0x5446, code: 0x5c},
221: {region: 0x5447, code: 0x112},
222: {region: 0x5448, code: 0xe8},
223: {region: 0x544a, code: 0xea},
224: {region: 0x544b, code: 0xbe},
225: {region: 0x544c, code: 0xf9},
226: {region: 0x544d, code: 0xec},
227: {region: 0x544e, code: 0xed},
228: {region: 0x544f, code: 0xee},
229: {region: 0x5452, code: 0xf1},
230: {region: 0x5454, code: 0xf2},
231: {region: 0x5456, code: 0x13},
232: {region: 0x5457, code: 0xf3},
233: {region: 0x545a, code: 0xf4},
234: {region: 0x5541, code: 0xf5},
235: {region: 0x5547, code: 0xf8},
236: {region: 0x554d, code: 0xf9},
237: {region: 0x5553, code: 0xf9},
238: {region: 0x5559, code: 0xfe},
239: {region: 0x555a, code: 0xff},
240: {region: 0x5641, code: 0x5c},
241: {region: 0x5643, code: 0x10d},
242: {region: 0x5645, code: 0x101},
243: {region: 0x5647, code: 0xf9},
244: {region: 0x5649, code: 0xf9},
245: {region: 0x564e, code: 0x102},
246: {region: 0x5655, code: 0x104},
247: {region: 0x5746, code: 0x114},
248: {region: 0x5753, code: 0x105},
249: {region: 0x584b, code: 0x5c},
250: {region: 0x5945, code: 0x11c},
251: {region: 0x5954, code: 0x5c},
252: {region: 0x5a41, code: 0x122},
253: {region: 0x5a4d, code: 0x124},
254: {region: 0x5a57, code: 0xf9},
} // Size: 1044 bytes
type regionInfo struct {
region uint16
code uint16
from uint32
to uint32
}
var regionData = []regionInfo{ // 492 elements
0: {region: 0x4143, code: 0xdb, from: 0xf7021, to: 0x0},
1: {region: 0x4144, code: 0x5c, from: 0xf9e21, to: 0x0},
2: {region: 0x4144, code: 0x5a, from: 0xea221, to: 0xfa45c},
3: {region: 0x4144, code: 0x60, from: 0xf5021, to: 0xfa451},
4: {region: 0x4144, code: 0x1, from: 0xf2021, to: 0xfa39f},
5: {region: 0x4145, code: 0x2, from: 0xf6ab3, to: 0x0},
6: {region: 0x4146, code: 0x4, from: 0xfa547, to: 0x0},
7: {region: 0x4146, code: 0x3, from: 0xf0e6e, to: 0xfa59f},
8: {region: 0x4147, code: 0x10d, from: 0xf5b46, to: 0x0},
9: {region: 0x4149, code: 0x10d, from: 0xf5b46, to: 0x0},
10: {region: 0x414c, code: 0x6, from: 0xf5b10, to: 0x0},
11: {region: 0x414c, code: 0x5, from: 0xf3561, to: 0xf5b10},
12: {region: 0x414d, code: 0x7, from: 0xf9376, to: 0x0},
13: {region: 0x414d, code: 0xd1, from: 0xf8f99, to: 0xf9376},
14: {region: 0x414d, code: 0xe4, from: 0xf5221, to: 0xf8f99},
15: {region: 0x414f, code: 0x9, from: 0xf9f8d, to: 0x0},
16: {region: 0x414f, code: 0xc, from: 0xf96e1, to: 0xfa041},
17: {region: 0x414f, code: 0xb, from: 0xf8d39, to: 0xfa041},
18: {region: 0x414f, code: 0xa, from: 0xf7228, to: 0xf8e61},
19: {region: 0x4151, code: 0x811a, from: 0x0, to: 0x0},
20: {region: 0x4152, code: 0x11, from: 0xf9021, to: 0x0},
21: {region: 0x4152, code: 0xd, from: 0xf82ce, to: 0xf9021},
22: {region: 0x4152, code: 0x10, from: 0xf7ec1, to: 0xf82ce},
23: {region: 0x4152, code: 0xe, from: 0xf6421, to: 0xf7ec1},
24: {region: 0x4152, code: 0xf, from: 0xeb365, to: 0xf6421},
25: {region: 0x4153, code: 0xf9, from: 0xee0f0, to: 0x0},
26: {region: 0x4154, code: 0x5c, from: 0xf9e21, to: 0x0},
27: {region: 0x4154, code: 0x12, from: 0xf3784, to: 0xfa45c},
28: {region: 0x4155, code: 0x13, from: 0xf5c4e, to: 0x0},
29: {region: 0x4157, code: 0x14, from: 0xf8421, to: 0x0},
30: {region: 0x4157, code: 0x8, from: 0xf28aa, to: 0xf8421},
31: {region: 0x4158, code: 0x5c, from: 0xf9e21, to: 0x0},
32: {region: 0x415a, code: 0x16, from: 0xfac21, to: 0x0},
33: {region: 0x415a, code: 0x15, from: 0xf9376, to: 0xfad9f},
34: {region: 0x415a, code: 0xd1, from: 0xf8f99, to: 0xf9421},
35: {region: 0x415a, code: 0xe4, from: 0xf5221, to: 0xf8f99},
36: {region: 0x4241, code: 0x18, from: 0xf9621, to: 0x0},
37: {region: 0x4241, code: 0x19, from: 0xf950f, to: 0xf9ae1},
38: {region: 0x4241, code: 0x17, from: 0xf90e1, to: 0xf950f},
39: {region: 0x4241, code: 0x120, from: 0xf90e1, to: 0xf9341},
40: {region: 0x4241, code: 0x11f, from: 0xf8c21, to: 0xf90e1},
41: {region: 0x4241, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
42: {region: 0x4242, code: 0x1a, from: 0xf6b83, to: 0x0},
43: {region: 0x4242, code: 0x10d, from: 0xf5b46, to: 0xf6b83},
44: {region: 0x4244, code: 0x1b, from: 0xf6821, to: 0x0},
45: {region: 0x4244, code: 0xc6, from: 0xf3881, to: 0xf6821},
46: {region: 0x4244, code: 0x7b, from: 0xe5711, to: 0xf3881},
47: {region: 0x4245, code: 0x5c, from: 0xf9e21, to: 0x0},
48: {region: 0x4245, code: 0x1d, from: 0xe4e47, to: 0xfa45c},
49: {region: 0x4245, code: 0xbb, from: 0xe318f, to: 0xe4e47},
50: {region: 0x4245, code: 0x801e, from: 0xf6421, to: 0xf8c65},
51: {region: 0x4245, code: 0x801c, from: 0xf6421, to: 0xf8c65},
52: {region: 0x4246, code: 0x112, from: 0xf8104, to: 0x0},
53: {region: 0x4247, code: 0x21, from: 0xf9ee5, to: 0x0},
54: {region: 0x4247, code: 0x1f, from: 0xf5421, to: 0xf9ee5},
55: {region: 0x4247, code: 0x20, from: 0xf40ac, to: 0xf5421},
56: {region: 0x4247, code: 0x22, from: 0xeaee8, to: 0xf40ac},
57: {region: 0x4248, code: 0x23, from: 0xf5b50, to: 0x0},
58: {region: 0x4249, code: 0x24, from: 0xf58b3, to: 0x0},
59: {region: 0x424a, code: 0x112, from: 0xf6f7e, to: 0x0},
60: {region: 0x424c, code: 0x5c, from: 0xf9e21, to: 0x0},
61: {region: 0x424c, code: 0x60, from: 0xf5021, to: 0xfa451},
62: {region: 0x424d, code: 0x25, from: 0xf6446, to: 0x0},
63: {region: 0x424e, code: 0x26, from: 0xf5ecc, to: 0x0},
64: {region: 0x424e, code: 0xb3, from: 0xf5730, to: 0xf5ecc},
65: {region: 0x424f, code: 0x27, from: 0xf8621, to: 0x0},
66: {region: 0x424f, code: 0x29, from: 0xf5621, to: 0xf859f},
67: {region: 0x424f, code: 0x28, from: 0xe8ed7, to: 0xf5621},
68: {region: 0x424f, code: 0x802a, from: 0x0, to: 0x0},
69: {region: 0x4251, code: 0xf9, from: 0xfb621, to: 0x0},
70: {region: 0x4251, code: 0x8, from: 0xfb54a, to: 0xfb621},
71: {region: 0x4252, code: 0x2e, from: 0xf94e1, to: 0x0},
72: {region: 0x4252, code: 0x30, from: 0xf9301, to: 0xf94e1},
73: {region: 0x4252, code: 0x2d, from: 0xf8c70, to: 0xf9301},
74: {region: 0x4252, code: 0x2f, from: 0xf8a2f, to: 0xf8c70},
75: {region: 0x4252, code: 0x2c, from: 0xf845c, to: 0xf8a2f},
76: {region: 0x4252, code: 0x2b, from: 0xf5e4d, to: 0xf845c},
77: {region: 0x4252, code: 0x31, from: 0xf2d61, to: 0xf5e4d},
78: {region: 0x4253, code: 0x32, from: 0xf5cb9, to: 0x0},
79: {region: 0x4254, code: 0x33, from: 0xf6c90, to: 0x0},
80: {region: 0x4254, code: 0x7b, from: 0xee621, to: 0x0},
81: {region: 0x4255, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
82: {region: 0x4256, code: 0xbc, from: 0xee2c7, to: 0x0},
83: {region: 0x4257, code: 0x35, from: 0xf7117, to: 0x0},
84: {region: 0x4257, code: 0x122, from: 0xf524e, to: 0xf7117},
85: {region: 0x4259, code: 0x37, from: 0xfa021, to: 0x0},
86: {region: 0x4259, code: 0x36, from: 0xf9501, to: 0xfa19f},
87: {region: 0x4259, code: 0xd1, from: 0xf8f99, to: 0xf9568},
88: {region: 0x4259, code: 0xe4, from: 0xf5221, to: 0xf8f99},
89: {region: 0x425a, code: 0x38, from: 0xf6c21, to: 0x0},
90: {region: 0x4341, code: 0x39, from: 0xe8421, to: 0x0},
91: {region: 0x4343, code: 0x13, from: 0xf5c4e, to: 0x0},
92: {region: 0x4344, code: 0x3a, from: 0xf9ce1, to: 0x0},
93: {region: 0x4344, code: 0x125, from: 0xf9361, to: 0xf9ce1},
94: {region: 0x4344, code: 0x126, from: 0xf675b, to: 0xf9361},
95: {region: 0x4346, code: 0x106, from: 0xf9221, to: 0x0},
96: {region: 0x4347, code: 0x106, from: 0xf9221, to: 0x0},
97: {region: 0x4348, code: 0x3c, from: 0xe0e71, to: 0x0},
98: {region: 0x4348, code: 0x803b, from: 0x0, to: 0x0},
99: {region: 0x4348, code: 0x803d, from: 0x0, to: 0x0},
100: {region: 0x4349, code: 0x112, from: 0xf4d84, to: 0x0},
101: {region: 0x434b, code: 0xbe, from: 0xf5eea, to: 0x0},
102: {region: 0x434c, code: 0x40, from: 0xf6f3d, to: 0x0},
103: {region: 0x434c, code: 0x3e, from: 0xf5021, to: 0xf6f3d},
104: {region: 0x434c, code: 0x803f, from: 0x0, to: 0x0},
105: {region: 0x434d, code: 0x106, from: 0xf6a81, to: 0x0},
106: {region: 0x434e, code: 0x42, from: 0xf4261, to: 0x0},
107: {region: 0x434e, code: 0x8041, from: 0xf7621, to: 0xf9d9f},
108: {region: 0x434f, code: 0x43, from: 0xee221, to: 0x0},
109: {region: 0x434f, code: 0x8044, from: 0x0, to: 0x0},
110: {region: 0x4350, code: 0x811a, from: 0x0, to: 0x0},
111: {region: 0x4352, code: 0x45, from: 0xed15a, to: 0x0},
112: {region: 0x4353, code: 0x46, from: 0xfa4af, to: 0xfacc3},
113: {region: 0x4353, code: 0x5c, from: 0xfa644, to: 0xfacc3},
114: {region: 0x4353, code: 0x11e, from: 0xf9438, to: 0xfa4af},
115: {region: 0x4355, code: 0x49, from: 0xe8621, to: 0x0},
116: {region: 0x4355, code: 0x48, from: 0xf9421, to: 0x0},
117: {region: 0x4355, code: 0xf9, from: 0xed621, to: 0xf4e21},
118: {region: 0x4356, code: 0x4a, from: 0xef421, to: 0x0},
119: {region: 0x4356, code: 0xc9, from: 0xeeeb6, to: 0xf6ee5},
120: {region: 0x4357, code: 0x8, from: 0xfb54a, to: 0x0},
121: {region: 0x4358, code: 0x13, from: 0xf5c4e, to: 0x0},
122: {region: 0x4359, code: 0x5c, from: 0xfb021, to: 0x0},
123: {region: 0x4359, code: 0x4b, from: 0xef52a, to: 0xfb03f},
124: {region: 0x435a, code: 0x4c, from: 0xf9221, to: 0x0},
125: {region: 0x435a, code: 0x47, from: 0xf42c1, to: 0xf9261},
126: {region: 0x4444, code: 0x4d, from: 0xf38f4, to: 0xf8d42},
127: {region: 0x4445, code: 0x5c, from: 0xf9e21, to: 0x0},
128: {region: 0x4445, code: 0x4e, from: 0xf38d4, to: 0xfa45c},
129: {region: 0x4447, code: 0xf9, from: 0xf5b68, to: 0x0},
130: {region: 0x444a, code: 0x4f, from: 0xf72db, to: 0x0},
131: {region: 0x444b, code: 0x50, from: 0xea2bb, to: 0x0},
132: {region: 0x444d, code: 0x10d, from: 0xf5b46, to: 0x0},
133: {region: 0x444f, code: 0x51, from: 0xf3741, to: 0x0},
134: {region: 0x444f, code: 0xf9, from: 0xee2d5, to: 0xf3741},
135: {region: 0x445a, code: 0x52, from: 0xf5881, to: 0x0},
136: {region: 0x4541, code: 0x5c, from: 0xf9e21, to: 0x0},
137: {region: 0x4543, code: 0xf9, from: 0xfa142, to: 0x0},
138: {region: 0x4543, code: 0x53, from: 0xeb881, to: 0xfa142},
139: {region: 0x4543, code: 0x8054, from: 0xf92b7, to: 0xfa029},
140: {region: 0x4545, code: 0x5c, from: 0xfb621, to: 0x0},
141: {region: 0x4545, code: 0x55, from: 0xf90d5, to: 0xfb59f},
142: {region: 0x4545, code: 0xe4, from: 0xf5221, to: 0xf90d4},
143: {region: 0x4547, code: 0x56, from: 0xebb6e, to: 0x0},
144: {region: 0x4548, code: 0x9c, from: 0xf705a, to: 0x0},
145: {region: 0x4552, code: 0x57, from: 0xf9b68, to: 0x0},
146: {region: 0x4552, code: 0x5b, from: 0xf92b8, to: 0xf9b68},
147: {region: 0x4553, code: 0x5c, from: 0xf9e21, to: 0x0},
148: {region: 0x4553, code: 0x5a, from: 0xe9953, to: 0xfa45c},
149: {region: 0x4553, code: 0x8058, from: 0xf7421, to: 0xf7b9f},
150: {region: 0x4553, code: 0x8059, from: 0xf6e21, to: 0xf959f},
151: {region: 0x4554, code: 0x5b, from: 0xf712f, to: 0x0},
152: {region: 0x4555, code: 0x5c, from: 0xf9e21, to: 0x0},
153: {region: 0x4555, code: 0x810f, from: 0xf7621, to: 0xf9d9f},
154: {region: 0x4649, code: 0x5c, from: 0xf9e21, to: 0x0},
155: {region: 0x4649, code: 0x5d, from: 0xf5621, to: 0xfa45c},
156: {region: 0x464a, code: 0x5e, from: 0xf622d, to: 0x0},
157: {region: 0x464b, code: 0x5f, from: 0xeda21, to: 0x0},
158: {region: 0x464d, code: 0xf9, from: 0xf3021, to: 0x0},
159: {region: 0x464d, code: 0x83, from: 0xef543, to: 0xf3021},
160: {region: 0x464f, code: 0x50, from: 0xf3821, to: 0x0},
161: {region: 0x4652, code: 0x5c, from: 0xf9e21, to: 0x0},
162: {region: 0x4652, code: 0x60, from: 0xf5021, to: 0xfa451},
163: {region: 0x4741, code: 0x106, from: 0xf9221, to: 0x0},
164: {region: 0x4742, code: 0x61, from: 0xd3cfb, to: 0x0},
165: {region: 0x4744, code: 0x10d, from: 0xf5e5b, to: 0x0},
166: {region: 0x4745, code: 0x63, from: 0xf9737, to: 0x0},
167: {region: 0x4745, code: 0x62, from: 0xf9285, to: 0xf9739},
168: {region: 0x4745, code: 0xd1, from: 0xf8f99, to: 0xf92cb},
169: {region: 0x4745, code: 0xe4, from: 0xf5221, to: 0xf8f99},
170: {region: 0x4746, code: 0x5c, from: 0xf9e21, to: 0x0},
171: {region: 0x4746, code: 0x60, from: 0xf5021, to: 0xfa451},
172: {region: 0x4747, code: 0x61, from: 0xe4c21, to: 0x0},
173: {region: 0x4748, code: 0x65, from: 0xfaee3, to: 0x0},
174: {region: 0x4748, code: 0x64, from: 0xf7669, to: 0xfaf9f},
175: {region: 0x4749, code: 0x66, from: 0xd6221, to: 0x0},
176: {region: 0x474c, code: 0x50, from: 0xea2bb, to: 0x0},
177: {region: 0x474d, code: 0x67, from: 0xf66e1, to: 0x0},
178: {region: 0x474e, code: 0x68, from: 0xf8426, to: 0x0},
179: {region: 0x474e, code: 0x69, from: 0xf6942, to: 0xf8426},
180: {region: 0x4750, code: 0x5c, from: 0xf9e21, to: 0x0},
181: {region: 0x4750, code: 0x60, from: 0xf5021, to: 0xfa451},
182: {region: 0x4751, code: 0x106, from: 0xf9221, to: 0x0},
183: {region: 0x4751, code: 0x6a, from: 0xf6ee7, to: 0xf84c1},
184: {region: 0x4752, code: 0x5c, from: 0xfa221, to: 0x0},
185: {region: 0x4752, code: 0x6b, from: 0xf44a1, to: 0xfa45c},
186: {region: 0x4753, code: 0x61, from: 0xee821, to: 0x0},
187: {region: 0x4754, code: 0x6c, from: 0xf0abb, to: 0x0},
188: {region: 0x4755, code: 0xf9, from: 0xf3115, to: 0x0},
189: {region: 0x4757, code: 0x112, from: 0xf9a7f, to: 0x0},
190: {region: 0x4757, code: 0x6e, from: 0xf705c, to: 0xf9a7f},
191: {region: 0x4757, code: 0x6d, from: 0xef421, to: 0xf705c},
192: {region: 0x4759, code: 0x6f, from: 0xf5cba, to: 0x0},
193: {region: 0x484b, code: 0x70, from: 0xece42, to: 0x0},
194: {region: 0x484d, code: 0x13, from: 0xf5e50, to: 0x0},
195: {region: 0x484e, code: 0x71, from: 0xf0c83, to: 0x0},
196: {region: 0x4852, code: 0x73, from: 0xf94be, to: 0x0},
197: {region: 0x4852, code: 0x72, from: 0xf8f97, to: 0xf9621},
198: {region: 0x4852, code: 0x11f, from: 0xf8c21, to: 0xf8f97},
199: {region: 0x4852, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
200: {region: 0x4854, code: 0x74, from: 0xea11a, to: 0x0},
201: {region: 0x4854, code: 0xf9, from: 0xef621, to: 0x0},
202: {region: 0x4855, code: 0x75, from: 0xf34f7, to: 0x0},
203: {region: 0x4943, code: 0x5c, from: 0xf9e21, to: 0x0},
204: {region: 0x4944, code: 0x76, from: 0xf5b8d, to: 0x0},
205: {region: 0x4945, code: 0x5c, from: 0xf9e21, to: 0x0},
206: {region: 0x4945, code: 0x77, from: 0xf0421, to: 0xfa449},
207: {region: 0x4945, code: 0x61, from: 0xe1021, to: 0xf0421},
208: {region: 0x494c, code: 0x7a, from: 0xf8324, to: 0x0},
209: {region: 0x494c, code: 0x79, from: 0xf7856, to: 0xf8324},
210: {region: 0x494c, code: 0x78, from: 0xf3910, to: 0xf7856},
211: {region: 0x494d, code: 0x61, from: 0xe6023, to: 0x0},
212: {region: 0x494e, code: 0x7b, from: 0xe5711, to: 0x0},
213: {region: 0x494f, code: 0xf9, from: 0xf5b68, to: 0x0},
214: {region: 0x4951, code: 0x7c, from: 0xf1693, to: 0x0},
215: {region: 0x4951, code: 0x56, from: 0xf016b, to: 0xf1693},
216: {region: 0x4951, code: 0x7b, from: 0xf016b, to: 0xf1693},
217: {region: 0x4952, code: 0x7d, from: 0xf18ad, to: 0x0},
218: {region: 0x4953, code: 0x7f, from: 0xf7a21, to: 0x0},
219: {region: 0x4953, code: 0x7e, from: 0xefd81, to: 0xf7a21},
220: {region: 0x4953, code: 0x50, from: 0xea2bb, to: 0xefd81},
221: {region: 0x4954, code: 0x5c, from: 0xf9e21, to: 0x0},
222: {region: 0x4954, code: 0x80, from: 0xe8d18, to: 0xfa45c},
223: {region: 0x4a45, code: 0x61, from: 0xe5a21, to: 0x0},
224: {region: 0x4a4d, code: 0x81, from: 0xf6328, to: 0x0},
225: {region: 0x4a4f, code: 0x82, from: 0xf3ce1, to: 0x0},
226: {region: 0x4a50, code: 0x83, from: 0xe9ec1, to: 0x0},
227: {region: 0x4b45, code: 0x84, from: 0xf5d2e, to: 0x0},
228: {region: 0x4b47, code: 0x85, from: 0xf92aa, to: 0x0},
229: {region: 0x4b47, code: 0xd1, from: 0xf8f99, to: 0xf92aa},
230: {region: 0x4b47, code: 0xe4, from: 0xf5221, to: 0xf8f99},
231: {region: 0x4b48, code: 0x86, from: 0xf7874, to: 0x0},
232: {region: 0x4b49, code: 0x13, from: 0xf5c4e, to: 0x0},
233: {region: 0x4b4d, code: 0x87, from: 0xf6ee6, to: 0x0},
234: {region: 0x4b4e, code: 0x10d, from: 0xf5b46, to: 0x0},
235: {region: 0x4b50, code: 0x88, from: 0xf4e91, to: 0x0},
236: {region: 0x4b52, code: 0x8b, from: 0xf54ca, to: 0x0},
237: {region: 0x4b52, code: 0x89, from: 0xf424f, to: 0xf54ca},
238: {region: 0x4b52, code: 0x8a, from: 0xf330f, to: 0xf424f},
239: {region: 0x4b57, code: 0x8c, from: 0xf5281, to: 0x0},
240: {region: 0x4b59, code: 0x8d, from: 0xf6621, to: 0x0},
241: {region: 0x4b59, code: 0x81, from: 0xf6328, to: 0xf6621},
242: {region: 0x4b5a, code: 0x8e, from: 0xf9365, to: 0x0},
243: {region: 0x4c41, code: 0x8f, from: 0xf778a, to: 0x0},
244: {region: 0x4c42, code: 0x90, from: 0xf3842, to: 0x0},
245: {region: 0x4c43, code: 0x10d, from: 0xf5b46, to: 0x0},
246: {region: 0x4c49, code: 0x3c, from: 0xf0241, to: 0x0},
247: {region: 0x4c4b, code: 0x91, from: 0xf74b6, to: 0x0},
248: {region: 0x4c52, code: 0x92, from: 0xf3021, to: 0x0},
249: {region: 0x4c53, code: 0x122, from: 0xf524e, to: 0x0},
250: {region: 0x4c53, code: 0x93, from: 0xf7836, to: 0x0},
251: {region: 0x4c54, code: 0x5c, from: 0xfbe21, to: 0x0},
252: {region: 0x4c54, code: 0x94, from: 0xf92d9, to: 0xfbd9f},
253: {region: 0x4c54, code: 0x95, from: 0xf9141, to: 0xf92d9},
254: {region: 0x4c54, code: 0xe4, from: 0xf5221, to: 0xf9141},
255: {region: 0x4c55, code: 0x5c, from: 0xf9e21, to: 0x0},
256: {region: 0x4c55, code: 0x97, from: 0xf3124, to: 0xfa45c},
257: {region: 0x4c55, code: 0x8096, from: 0xf6421, to: 0xf8c65},
258: {region: 0x4c55, code: 0x8098, from: 0xf6421, to: 0xf8c65},
259: {region: 0x4c56, code: 0x5c, from: 0xfbc21, to: 0x0},
260: {region: 0x4c56, code: 0x99, from: 0xf92dc, to: 0xfbb9f},
261: {region: 0x4c56, code: 0x9a, from: 0xf90a7, to: 0xf9351},
262: {region: 0x4c56, code: 0xe4, from: 0xf5221, to: 0xf90f4},
263: {region: 0x4c59, code: 0x9b, from: 0xf6721, to: 0x0},
264: {region: 0x4d41, code: 0x9c, from: 0xf4f51, to: 0x0},
265: {region: 0x4d41, code: 0x9d, from: 0xeb221, to: 0xf4f51},
266: {region: 0x4d43, code: 0x5c, from: 0xf9e21, to: 0x0},
267: {region: 0x4d43, code: 0x60, from: 0xf5021, to: 0xfa451},
268: {region: 0x4d43, code: 0x9e, from: 0xf5021, to: 0xfa451},
269: {region: 0x4d44, code: 0xa0, from: 0xf937d, to: 0x0},
270: {region: 0x4d44, code: 0x9f, from: 0xf90c1, to: 0xf937d},
271: {region: 0x4d45, code: 0x5c, from: 0xfa421, to: 0x0},
272: {region: 0x4d45, code: 0x4e, from: 0xf9f42, to: 0xfa4af},
273: {region: 0x4d45, code: 0x11e, from: 0xf9438, to: 0xfa4af},
274: {region: 0x4d46, code: 0x5c, from: 0xf9e21, to: 0x0},
275: {region: 0x4d46, code: 0x60, from: 0xf5021, to: 0xfa451},
276: {region: 0x4d47, code: 0xa1, from: 0xf7f61, to: 0x0},
277: {region: 0x4d47, code: 0xa2, from: 0xf56e1, to: 0xfa99f},
278: {region: 0x4d48, code: 0xf9, from: 0xf3021, to: 0x0},
279: {region: 0x4d4b, code: 0xa3, from: 0xf92b4, to: 0x0},
280: {region: 0x4d4b, code: 0xa4, from: 0xf909a, to: 0xf92b4},
281: {region: 0x4d4c, code: 0x112, from: 0xf80c1, to: 0x0},
282: {region: 0x4d4c, code: 0xa5, from: 0xf54e2, to: 0xf811f},
283: {region: 0x4d4c, code: 0x112, from: 0xf4d78, to: 0xf54e2},
284: {region: 0x4d4d, code: 0xa6, from: 0xf8ad2, to: 0x0},
285: {region: 0x4d4d, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
286: {region: 0x4d4e, code: 0xa7, from: 0xef661, to: 0x0},
287: {region: 0x4d4f, code: 0xa8, from: 0xeda21, to: 0x0},
288: {region: 0x4d50, code: 0xf9, from: 0xf3021, to: 0x0},
289: {region: 0x4d51, code: 0x5c, from: 0xf9e21, to: 0x0},
290: {region: 0x4d51, code: 0x60, from: 0xf5021, to: 0xfa451},
291: {region: 0x4d52, code: 0xa9, from: 0xf6add, to: 0x0},
292: {region: 0x4d52, code: 0x112, from: 0xf4d7c, to: 0xf6add},
293: {region: 0x4d53, code: 0x10d, from: 0xf5e5b, to: 0x0},
294: {region: 0x4d54, code: 0x5c, from: 0xfb021, to: 0x0},
295: {region: 0x4d54, code: 0xaa, from: 0xf60c7, to: 0xfb03f},
296: {region: 0x4d54, code: 0xab, from: 0xef50d, to: 0xf60c7},
297: {region: 0x4d55, code: 0xac, from: 0xf1c81, to: 0x0},
298: {region: 0x4d56, code: 0xae, from: 0xf7ae1, to: 0x0},
299: {region: 0x4d57, code: 0xaf, from: 0xf664f, to: 0x0},
300: {region: 0x4d58, code: 0xb0, from: 0xf9221, to: 0x0},
301: {region: 0x4d58, code: 0xb1, from: 0xe3c21, to: 0xf919f},
302: {region: 0x4d58, code: 0x80b2, from: 0x0, to: 0x0},
303: {region: 0x4d59, code: 0xb3, from: 0xf5730, to: 0x0},
304: {region: 0x4d5a, code: 0xb6, from: 0xface1, to: 0x0},
305: {region: 0x4d5a, code: 0xb5, from: 0xf78d0, to: 0xfad9f},
306: {region: 0x4d5a, code: 0xb4, from: 0xf6ed9, to: 0xf78d0},
307: {region: 0x4e41, code: 0xb7, from: 0xf9221, to: 0x0},
308: {region: 0x4e41, code: 0x122, from: 0xf524e, to: 0x0},
309: {region: 0x4e43, code: 0x114, from: 0xf8221, to: 0x0},
310: {region: 0x4e45, code: 0x112, from: 0xf4d93, to: 0x0},
311: {region: 0x4e46, code: 0x13, from: 0xf5c4e, to: 0x0},
312: {region: 0x4e47, code: 0xb8, from: 0xf6a21, to: 0x0},
313: {region: 0x4e49, code: 0xba, from: 0xf8e9e, to: 0x0},
314: {region: 0x4e49, code: 0xb9, from: 0xf884f, to: 0xf8e9e},
315: {region: 0x4e4c, code: 0x5c, from: 0xf9e21, to: 0x0},
316: {region: 0x4e4c, code: 0xbb, from: 0xe2a21, to: 0xfa45c},
317: {region: 0x4e4f, code: 0xbc, from: 0xee2c7, to: 0x0},
318: {region: 0x4e4f, code: 0xd9, from: 0xea2bb, to: 0xee2c7},
319: {region: 0x4e50, code: 0xbd, from: 0xf1a21, to: 0x0},
320: {region: 0x4e50, code: 0x7b, from: 0xe9c21, to: 0xf5d51},
321: {region: 0x4e52, code: 0x13, from: 0xf5c4e, to: 0x0},
322: {region: 0x4e55, code: 0xbe, from: 0xf5eea, to: 0x0},
323: {region: 0x4e5a, code: 0xbe, from: 0xf5eea, to: 0x0},
324: {region: 0x4f4d, code: 0xbf, from: 0xf696b, to: 0x0},
325: {region: 0x5041, code: 0xc0, from: 0xedf64, to: 0x0},
326: {region: 0x5041, code: 0xf9, from: 0xedf72, to: 0x0},
327: {region: 0x5045, code: 0xc2, from: 0xf8ee1, to: 0x0},
328: {region: 0x5045, code: 0xc1, from: 0xf8241, to: 0xf8ee1},
329: {region: 0x5045, code: 0xc3, from: 0xe8e4e, to: 0xf8241},
330: {region: 0x5046, code: 0x114, from: 0xf339a, to: 0x0},
331: {region: 0x5047, code: 0xc4, from: 0xf6f30, to: 0x0},
332: {region: 0x5047, code: 0x13, from: 0xf5c4e, to: 0xf6f30},
333: {region: 0x5048, code: 0xc5, from: 0xf34e4, to: 0x0},
334: {region: 0x504b, code: 0xc6, from: 0xf3881, to: 0x0},
335: {region: 0x504b, code: 0x7b, from: 0xe5711, to: 0xf370f},
336: {region: 0x504c, code: 0xc7, from: 0xf9621, to: 0x0},
337: {region: 0x504c, code: 0xc8, from: 0xf3d5c, to: 0xf959f},
338: {region: 0x504d, code: 0x5c, from: 0xf9e21, to: 0x0},
339: {region: 0x504d, code: 0x60, from: 0xf6995, to: 0xfa451},
340: {region: 0x504e, code: 0xbe, from: 0xf622d, to: 0x0},
341: {region: 0x5052, code: 0xf9, from: 0xed58a, to: 0x0},
342: {region: 0x5052, code: 0x5a, from: 0xe1021, to: 0xed58a},
343: {region: 0x5053, code: 0x7a, from: 0xf8324, to: 0x0},
344: {region: 0x5053, code: 0x82, from: 0xf984c, to: 0x0},
345: {region: 0x5053, code: 0x78, from: 0xf5ec1, to: 0xf7856},
346: {region: 0x5053, code: 0x82, from: 0xf3ce1, to: 0xf5ec1},
347: {region: 0x5054, code: 0x5c, from: 0xf9e21, to: 0x0},
348: {region: 0x5054, code: 0xc9, from: 0xeeeb6, to: 0xfa45c},
349: {region: 0x5057, code: 0xf9, from: 0xf3021, to: 0x0},
350: {region: 0x5059, code: 0xca, from: 0xf2f61, to: 0x0},
351: {region: 0x5141, code: 0xcb, from: 0xf6ab3, to: 0x0},
352: {region: 0x5245, code: 0x5c, from: 0xf9e21, to: 0x0},
353: {region: 0x5245, code: 0x60, from: 0xf6e21, to: 0xfa451},
354: {region: 0x524f, code: 0xce, from: 0xfaae1, to: 0x0},
355: {region: 0x524f, code: 0xcd, from: 0xf403c, to: 0xfad9f},
356: {region: 0x5253, code: 0xcf, from: 0xfad59, to: 0x0},
357: {region: 0x5253, code: 0x46, from: 0xfa4af, to: 0xfad59},
358: {region: 0x5253, code: 0x11e, from: 0xf9438, to: 0xfa4af},
359: {region: 0x5255, code: 0xd0, from: 0xf9e21, to: 0x0},
360: {region: 0x5255, code: 0xd1, from: 0xf8f99, to: 0xf9d9f},
361: {region: 0x5257, code: 0xd2, from: 0xf58b3, to: 0x0},
362: {region: 0x5341, code: 0xd3, from: 0xf4156, to: 0x0},
363: {region: 0x5342, code: 0xd4, from: 0xf7358, to: 0x0},
364: {region: 0x5342, code: 0x13, from: 0xf5c4e, to: 0xf74de},
365: {region: 0x5343, code: 0xd5, from: 0xedf61, to: 0x0},
366: {region: 0x5344, code: 0xd7, from: 0xfae2a, to: 0x0},
367: {region: 0x5344, code: 0xd6, from: 0xf90c8, to: 0xfaede},
368: {region: 0x5344, code: 0xd8, from: 0xf4a88, to: 0xf9cc1},
369: {region: 0x5344, code: 0x56, from: 0xec233, to: 0xf4c21},
370: {region: 0x5344, code: 0x61, from: 0xec233, to: 0xf4c21},
371: {region: 0x5345, code: 0xd9, from: 0xea2bb, to: 0x0},
372: {region: 0x5347, code: 0xda, from: 0xf5ecc, to: 0x0},
373: {region: 0x5347, code: 0xb3, from: 0xf5730, to: 0xf5ecc},
374: {region: 0x5348, code: 0xdb, from: 0xefa4f, to: 0x0},
375: {region: 0x5349, code: 0x5c, from: 0xfae21, to: 0x0},
376: {region: 0x5349, code: 0xdc, from: 0xf9147, to: 0xfae2e},
377: {region: 0x534a, code: 0xbc, from: 0xee2c7, to: 0x0},
378: {region: 0x534b, code: 0x5c, from: 0xfb221, to: 0x0},
379: {region: 0x534b, code: 0xdd, from: 0xf919f, to: 0xfb221},
380: {region: 0x534b, code: 0x47, from: 0xf42c1, to: 0xf919f},
381: {region: 0x534c, code: 0xde, from: 0xf5904, to: 0x0},
382: {region: 0x534c, code: 0x61, from: 0xe217e, to: 0xf5c44},
383: {region: 0x534d, code: 0x5c, from: 0xf9e21, to: 0x0},
384: {region: 0x534d, code: 0x80, from: 0xe9397, to: 0xfa25c},
385: {region: 0x534e, code: 0x112, from: 0xf4e84, to: 0x0},
386: {region: 0x534f, code: 0xdf, from: 0xf50e1, to: 0x0},
387: {region: 0x5352, code: 0xe0, from: 0xfa821, to: 0x0},
388: {region: 0x5352, code: 0xe1, from: 0xf28aa, to: 0xfa79f},
389: {region: 0x5352, code: 0xbb, from: 0xe2f74, to: 0xf28aa},
390: {region: 0x5353, code: 0xe2, from: 0xfb6f2, to: 0x0},
391: {region: 0x5353, code: 0xd7, from: 0xfae2a, to: 0xfb721},
392: {region: 0x5354, code: 0xe3, from: 0xf7328, to: 0x0},
393: {region: 0x5355, code: 0xe4, from: 0xf5221, to: 0xf8f99},
394: {region: 0x5356, code: 0xf9, from: 0xfa221, to: 0x0},
395: {region: 0x5356, code: 0xe5, from: 0xeff6b, to: 0xfa221},
396: {region: 0x5358, code: 0x8, from: 0xfb54a, to: 0x0},
397: {region: 0x5359, code: 0xe6, from: 0xf3821, to: 0x0},
398: {region: 0x535a, code: 0xe7, from: 0xf6d26, to: 0x0},
399: {region: 0x5441, code: 0x61, from: 0xf242c, to: 0x0},
400: {region: 0x5443, code: 0xf9, from: 0xf6328, to: 0x0},
401: {region: 0x5444, code: 0x106, from: 0xf9221, to: 0x0},
402: {region: 0x5446, code: 0x5c, from: 0xf9e21, to: 0x0},
403: {region: 0x5446, code: 0x60, from: 0xf4e21, to: 0xfa451},
404: {region: 0x5447, code: 0x112, from: 0xf4d7c, to: 0x0},
405: {region: 0x5448, code: 0xe8, from: 0xf108f, to: 0x0},
406: {region: 0x544a, code: 0xea, from: 0xfa15a, to: 0x0},
407: {region: 0x544a, code: 0xe9, from: 0xf96aa, to: 0xfa159},
408: {region: 0x544a, code: 0xd1, from: 0xf8f99, to: 0xf96aa},
409: {region: 0x544b, code: 0xbe, from: 0xf5eea, to: 0x0},
410: {region: 0x544c, code: 0xf9, from: 0xf9f54, to: 0x0},
411: {region: 0x544c, code: 0xef, from: 0xf4e22, to: 0xfa4b4},
412: {region: 0x544c, code: 0x76, from: 0xf6f87, to: 0xfa4b4},
413: {region: 0x544d, code: 0xec, from: 0xfb221, to: 0x0},
414: {region: 0x544d, code: 0xeb, from: 0xf9361, to: 0xfb221},
415: {region: 0x544d, code: 0xd1, from: 0xf8f99, to: 0xf9361},
416: {region: 0x544d, code: 0xe4, from: 0xf5221, to: 0xf8f99},
417: {region: 0x544e, code: 0xed, from: 0xf4d61, to: 0x0},
418: {region: 0x544f, code: 0xee, from: 0xf5c4e, to: 0x0},
419: {region: 0x5450, code: 0xef, from: 0xf4e22, to: 0xfa4b4},
420: {region: 0x5450, code: 0x76, from: 0xf6f87, to: 0xfa4b4},
421: {region: 0x5452, code: 0xf1, from: 0xfaa21, to: 0x0},
422: {region: 0x5452, code: 0xf0, from: 0xf0561, to: 0xfab9f},
423: {region: 0x5454, code: 0xf2, from: 0xf5821, to: 0x0},
424: {region: 0x5456, code: 0x13, from: 0xf5c4e, to: 0x0},
425: {region: 0x5457, code: 0xf3, from: 0xf3acf, to: 0x0},
426: {region: 0x545a, code: 0xf4, from: 0xf5cce, to: 0x0},
427: {region: 0x5541, code: 0xf5, from: 0xf9922, to: 0x0},
428: {region: 0x5541, code: 0xf6, from: 0xf916d, to: 0xf9351},
429: {region: 0x5541, code: 0xd1, from: 0xf8f99, to: 0xf916d},
430: {region: 0x5541, code: 0xe4, from: 0xf5221, to: 0xf8f99},
431: {region: 0x5547, code: 0xf8, from: 0xf86af, to: 0x0},
432: {region: 0x5547, code: 0xf7, from: 0xf5d0f, to: 0xf86af},
433: {region: 0x554d, code: 0xf9, from: 0xf3021, to: 0x0},
434: {region: 0x5553, code: 0xf9, from: 0xe0021, to: 0x0},
435: {region: 0x5553, code: 0x80fa, from: 0x0, to: 0x0},
436: {region: 0x5553, code: 0x80fb, from: 0x0, to: 0xfbc61},
437: {region: 0x5559, code: 0xfe, from: 0xf9261, to: 0x0},
438: {region: 0x5559, code: 0xfd, from: 0xf6ee1, to: 0xf9261},
439: {region: 0x5559, code: 0x80fc, from: 0x0, to: 0x0},
440: {region: 0x555a, code: 0xff, from: 0xf94e1, to: 0x0},
441: {region: 0x5641, code: 0x5c, from: 0xf9e21, to: 0x0},
442: {region: 0x5641, code: 0x80, from: 0xe9d53, to: 0xfa45c},
443: {region: 0x5643, code: 0x10d, from: 0xf5b46, to: 0x0},
444: {region: 0x5645, code: 0x101, from: 0xfb021, to: 0x0},
445: {region: 0x5645, code: 0x100, from: 0xe9eab, to: 0xfb0de},
446: {region: 0x5647, code: 0xf9, from: 0xe5221, to: 0x0},
447: {region: 0x5647, code: 0x61, from: 0xe5221, to: 0xf4e21},
448: {region: 0x5649, code: 0xf9, from: 0xe5a21, to: 0x0},
449: {region: 0x564e, code: 0x102, from: 0xf832e, to: 0x0},
450: {region: 0x564e, code: 0x103, from: 0xf74a3, to: 0xf832e},
451: {region: 0x5655, code: 0x104, from: 0xf7a21, to: 0x0},
452: {region: 0x5746, code: 0x114, from: 0xf52fe, to: 0x0},
453: {region: 0x5753, code: 0x105, from: 0xf5eea, to: 0x0},
454: {region: 0x584b, code: 0x5c, from: 0xfa421, to: 0x0},
455: {region: 0x584b, code: 0x4e, from: 0xf9f21, to: 0xfa469},
456: {region: 0x584b, code: 0x11e, from: 0xf9438, to: 0xf9f3e},
457: {region: 0x5944, code: 0x11b, from: 0xf5a81, to: 0xf9821},
458: {region: 0x5945, code: 0x11c, from: 0xf8cb6, to: 0x0},
459: {region: 0x5954, code: 0x5c, from: 0xf9e21, to: 0x0},
460: {region: 0x5954, code: 0x60, from: 0xf7057, to: 0xfa451},
461: {region: 0x5954, code: 0x87, from: 0xf6e21, to: 0xf7057},
462: {region: 0x5955, code: 0x11e, from: 0xf9438, to: 0xfa4af},
463: {region: 0x5955, code: 0x11f, from: 0xf8c21, to: 0xf90f8},
464: {region: 0x5955, code: 0x11d, from: 0xf5c21, to: 0xf8c21},
465: {region: 0x5a41, code: 0x122, from: 0xf524e, to: 0x0},
466: {region: 0x5a41, code: 0x8121, from: 0xf8321, to: 0xf966d},
467: {region: 0x5a4d, code: 0x124, from: 0xfba21, to: 0x0},
468: {region: 0x5a4d, code: 0x123, from: 0xf6030, to: 0xfba21},
469: {region: 0x5a52, code: 0x125, from: 0xf9361, to: 0xf9cff},
470: {region: 0x5a52, code: 0x126, from: 0xf675b, to: 0xf9361},
471: {region: 0x5a57, code: 0xf9, from: 0xfb28c, to: 0x0},
472: {region: 0x5a57, code: 0x128, from: 0xfb242, to: 0xfb28c},
473: {region: 0x5a57, code: 0x129, from: 0xfb101, to: 0xfb242},
474: {region: 0x5a57, code: 0x127, from: 0xf7892, to: 0xfb101},
475: {region: 0x5a57, code: 0xcc, from: 0xf6451, to: 0xf7892},
476: {region: 0x5a5a, code: 0x8107, from: 0x0, to: 0x0},
477: {region: 0x5a5a, code: 0x8108, from: 0x0, to: 0x0},
478: {region: 0x5a5a, code: 0x8109, from: 0x0, to: 0x0},
479: {region: 0x5a5a, code: 0x810a, from: 0x0, to: 0x0},
480: {region: 0x5a5a, code: 0x810b, from: 0x0, to: 0x0},
481: {region: 0x5a5a, code: 0x810c, from: 0x0, to: 0x0},
482: {region: 0x5a5a, code: 0x810e, from: 0x0, to: 0x0},
483: {region: 0x5a5a, code: 0x8110, from: 0xf1421, to: 0xfa681},
484: {region: 0x5a5a, code: 0x8111, from: 0x0, to: 0xfbb7e},
485: {region: 0x5a5a, code: 0x8113, from: 0x0, to: 0x0},
486: {region: 0x5a5a, code: 0x8115, from: 0x0, to: 0x0},
487: {region: 0x5a5a, code: 0x8116, from: 0x0, to: 0xf9f7e},
488: {region: 0x5a5a, code: 0x8117, from: 0x0, to: 0x0},
489: {region: 0x5a5a, code: 0x8118, from: 0x0, to: 0x0},
490: {region: 0x5a5a, code: 0x8119, from: 0x0, to: 0x0},
491: {region: 0x5a5a, code: 0x811a, from: 0x0, to: 0x0},
} // Size: 5928 bytes
// symbols holds symbol data of the form <n> <str>, where n is the length of
// the symbol string str.
var symbols string = "" + // Size: 1460 bytes
"\x00\x02Kz\x01$\x02A$\x02KM\x03৳\x02Bs\x02R$\x01P\x03р.\x03CA$\x04CN¥" +
"\x02¥\x03₡\x03Kč\x02kr\x03E£\x03₧\x03€\x02£\x03₾\x02FG\x01Q\x03HK$\x01L" +
"\x02kn\x02Ft\x02Rp\x03₪\x03₹\x04JP¥\x03៛\x02CF\x03₩\x03₸\x03₭\x03L£\x02R" +
"s\x02Lt\x02Ls\x02Ar\x01K\x03₮\x03MX$\x02RM\x03₦\x02C$\x03NZ$\x03₱\x03zł" +
"\x03₲\x03₽\x02RF\x02Db\x03฿\x02T$\x03₺\x03NT$\x03₴\x03US$\x03₫\x04FCFA" +
"\x03EC$\x03CFA\x04CFPF\x01R\x02ZK\x05GH₵\x03AU$\x06ብር\x03***\x09د.إ." +
"\u200f\x03AR$\x03BB$\x09د.ب.\u200f\x03BM$\x03BN$\x03BS$\x03BZ$\x03CL$" +
"\x03CO$\x03CU$\x03DO$\x09د.ج.\u200f\x09ج.م.\u200f\x03FJ$\x04UK£\x03GY$" +
"\x08ر.إن.\x09د.ع.\u200f\x06ر.إ.\x03JM$\x09د.أ.\u200f\x0cف.ج.ق.\u200f\x09" +
"د.ك.\u200f\x03KY$\x09ل.ل.\u200f\x09د.ل.\u200f\x09د.م.\u200f\x09أ.م." +
"\u200f\x09ر.ع.\u200f\x06ر.ب.\x09ر.ق.\u200f\x09ر.س.\u200f\x03SB$\x09د.س." +
"\u200f\x06ج.س.\x03SR$\x09ج.ج.س.\x09ل.س.\u200f\x09د.ت.\u200f\x06ل.ت.\x03T" +
"T$\x03UY$\x09ر.ي.\u200f\x03Fdj\x03Nfk\x01S\x04GB£\x03TSh\x03₼\x03S£\x04B" +
"ds$\x03BD$\x02B$\x04CUC$\x03$MN\x03RD$\x04FK£\x02G$\x04Íkr\x02J$\x03CI$" +
"\x02L$\x02N$\x07руб.\x03SI$\x02S$\x02$U\x05лв.\x06щ.д.\x02$A\x03$CA\x04£" +
" E\x05£ RU\x04$ HK\x03£L\x04$ ZN\x03$ T\x04$ SU\x04din.\x04КМ\x04Кч\x04з" +
"л\x07дин.\x04Тл\x01F\x03USh\x04Kčs\x03ECU\x02TK\x03kr.\x03Ksh\x03öS\x03" +
"BGK\x03BGJ\x04Cub$\x02DM\x04Fl£\x04F.G.\x02FC\x04F.Rw\x03Nu.\x05KR₩\x05T" +
"H฿\x06Δρχ\x02Tk\x02$b\x02Kr\x02Gs\x03CFP\x03FBu\x01D\x04MOP$\x02MK\x02SR" +
"\x02Le\x04NAf.\x01E\x02VT\x03WS$\x03BsF\x02Af\x03Naf\x02$a\x04Afl.\x02Br" +
"\x02TL\x03B/.\x03S/.\x03Gs.\x03Bs.\x02؋\x04¥CN\x03$HK\x08ریال\x03$MX\x03" +
"$NZ\x03$EC\x02UM\x02mk\x03$AR\x03$AU\x02FB\x03$BM\x03$BN\x03$BS\x03$BZ" +
"\x03$CL\x03$CO\x04£CY\x03£E\x03$FJ\x04£FK\x04£GB\x04£GI\x04£IE\x04£IL" +
"\x05₤IT\x04£LB\x04£MT\x03$NA\x02$C\x03$RH\x02FR\x03$SB\x03$SG\x03$SR\x03" +
"$TT\x03$US\x03$UY\x04FCFP\x02Kw\x05$\u00a0AU\x05$\u00a0HK\x05$\u00a0NZ" +
"\x05$\u00a0SG\x05$\u00a0US\x02DA\x01G\x02LS\x02DT\x02$R\x04¥JP\x03$NT" +
"\x07રૂ.\x06ל״י\x03₨\x02֏\x03NKr\x03元\x03¥\x03\u200b\x04БД\x05КД$\x02LE" +
"\x02Kn\x06сом\x02zl\x02rb\x03MTn\x06ден\x12ဒေါ်လာ\x12စီအာစီ\x0cनेरू\x02ر" +
"\x04Esc.\x06\u200bPTE\x04XXXX\x06ТМТ\x03Dkr\x03Skr\x03Nkr\x07රු.\x0fසිෆ්" +
"එ\x03NIS\x05Lekë\x03den\x05[BGN]\x05[BYR]\x06руб\x02r.\x03rub\x03BR$" +
"\x03Ekr\x04EG£\x03Ikr\x03Rs.\x04AUD$\x04NZD$\x07крб.\x05soʻm\x06сўм\x03₩" +
"\x03ILS\x02P.\x03Zł"
type curToIndex struct {
cur uint16
idx uint16
}
var normalLangIndex = []uint16{ // 748 elements
// Entry 0 - 3F
0x0000, 0x0014, 0x0014, 0x0014, 0x0017, 0x0018, 0x0018, 0x0018,
0x0018, 0x0019, 0x0019, 0x001c, 0x001c, 0x0038, 0x0038, 0x0038,
0x0038, 0x0039, 0x0039, 0x0039, 0x0039, 0x003a, 0x003a, 0x003a,
0x003a, 0x003a, 0x003a, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b,
0x003b, 0x003b, 0x003b, 0x003b, 0x003c, 0x003e, 0x003e, 0x003e,
0x003e, 0x003e, 0x003e, 0x003e, 0x003f, 0x003f, 0x0042, 0x0042,
0x0044, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x004c,
0x004c, 0x004d, 0x004d, 0x004e, 0x004e, 0x005f, 0x005f, 0x005f,
// Entry 40 - 7F
0x005f, 0x005f, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0063,
0x0071, 0x0071, 0x0071, 0x0071, 0x0082, 0x0088, 0x0088, 0x0088,
0x0088, 0x0091, 0x0091, 0x0091, 0x0092, 0x0092, 0x0093, 0x0093,
0x0094, 0x0094, 0x0095, 0x0095, 0x0095, 0x0095, 0x0095, 0x009c,
0x009c, 0x009d, 0x009d, 0x009f, 0x009f, 0x00a3, 0x00a3, 0x00a3,
0x00a4, 0x00a4, 0x00ac, 0x00ac, 0x00ac, 0x00ad, 0x00ad, 0x00ae,
0x00af, 0x00af, 0x00af, 0x00b4, 0x00b4, 0x00b4, 0x00b4, 0x00b4,
0x00b4, 0x00b4, 0x00ba, 0x00ba, 0x00bb, 0x00bb, 0x00be, 0x00be,
// Entry 80 - BF
0x00be, 0x00c1, 0x00c1, 0x00c1, 0x00c3, 0x00c5, 0x00c5, 0x00c6,
0x00c7, 0x00c7, 0x00c7, 0x00dc, 0x00dd, 0x00dd, 0x00de, 0x00df,
0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e4, 0x00e5, 0x00e5,
0x00e6, 0x00e6, 0x00e6, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00e9,
0x00ea, 0x00ec, 0x00ec, 0x00ec, 0x00ed, 0x00ed, 0x00ee, 0x00f0,
0x00f1, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2,
0x00f2, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8,
0x00f9, 0x00fa, 0x00fb, 0x00fb, 0x00fc, 0x00fc, 0x00fd, 0x00fe,
// Entry C0 - FF
0x00ff, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0104, 0x0105,
0x0106, 0x0107, 0x0108, 0x0109, 0x010a, 0x010b, 0x010b, 0x010b,
0x010c, 0x010d, 0x010e, 0x010e, 0x010f, 0x0110, 0x0112, 0x0112,
0x0113, 0x0115, 0x0116, 0x0117, 0x0117, 0x0118, 0x0119, 0x011a,
0x011b, 0x011c, 0x011d, 0x011d, 0x011d, 0x011e, 0x011e, 0x011e,
0x011f, 0x0120, 0x0121, 0x0122, 0x0122, 0x0122, 0x0122, 0x0134,
0x0139, 0x013b, 0x013c, 0x013d, 0x013f, 0x0141, 0x0142, 0x0144,
0x0146, 0x0146, 0x0147, 0x0147, 0x0148, 0x0149, 0x014a, 0x014a,
// Entry 100 - 13F
0x0153, 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, 0x0159, 0x015a,
0x015c, 0x015e, 0x015f, 0x0164, 0x0164, 0x0166, 0x0166, 0x0166,
0x0166, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0172, 0x0173,
0x0173, 0x0184, 0x0184, 0x0188, 0x0188, 0x0189, 0x018a, 0x018a,
0x01b0, 0x01b0, 0x01b0, 0x01b1, 0x01b1, 0x01b1, 0x01d1, 0x01d2,
0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d3, 0x01d4, 0x01d4,
0x01d4, 0x01d4, 0x01d5, 0x01d5, 0x01d5, 0x01d6, 0x01d7, 0x01d9,
0x01d9, 0x01d9, 0x01d9, 0x01da, 0x01da, 0x01da, 0x01db, 0x01dc,
// Entry 140 - 17F
0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dd, 0x01de, 0x01de,
0x01df, 0x01df, 0x01df, 0x01e0, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
0x01e1, 0x01e7, 0x01e7, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01f6,
0x01f6, 0x01f9, 0x01f9, 0x01f9, 0x01f9, 0x01fa, 0x01fa, 0x01fa,
0x01fb, 0x01fb, 0x01fb, 0x01fb, 0x01fc, 0x01fd, 0x01fd, 0x01fd,
0x01fe, 0x01fe, 0x0201, 0x0201, 0x0203, 0x0203, 0x0215, 0x0216,
0x0216, 0x021b, 0x021b, 0x022d, 0x022d, 0x0230, 0x0230, 0x0234,
0x0234, 0x0235, 0x0235, 0x0236, 0x0236, 0x0242, 0x0242, 0x0249,
// Entry 180 - 1BF
0x0249, 0x0249, 0x0249, 0x0249, 0x024e, 0x024e, 0x024e, 0x024e,
0x024e, 0x024f, 0x024f, 0x024f, 0x0259, 0x0259, 0x025a, 0x025a,
0x025a, 0x025b, 0x025b, 0x025b, 0x025c, 0x025c, 0x025f, 0x025f,
0x025f, 0x025f, 0x0260, 0x0260, 0x0266, 0x0266, 0x0266, 0x0266,
0x0267, 0x0267, 0x0268, 0x0268, 0x026b, 0x026b, 0x026d, 0x026d,
0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x026f, 0x0270,
0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270,
0x027f, 0x027f, 0x0280, 0x0280, 0x0285, 0x0285, 0x0286, 0x0286,
// Entry 1C0 - 1FF
0x0287, 0x0287, 0x0288, 0x0289, 0x0289, 0x0289, 0x0289, 0x028b,
0x028b, 0x028b, 0x028b, 0x028b, 0x029e, 0x029e, 0x029f, 0x029f,
0x02a0, 0x02a0, 0x02a1, 0x02a1, 0x02a6, 0x02a6, 0x02a7, 0x02a7,
0x02a8, 0x02a9, 0x02a9, 0x02aa, 0x02aa, 0x02ab, 0x02ab, 0x02ac,
0x02ac, 0x02ac, 0x02ac, 0x02b8, 0x02b8, 0x02bb, 0x02bb, 0x02be,
0x02be, 0x02c0, 0x02c0, 0x02c4, 0x02c5, 0x02c5, 0x02c6, 0x02c6,
0x02c6, 0x02c6, 0x02c6, 0x02c9, 0x02c9, 0x02ca, 0x02ca, 0x02ca,
0x02cb, 0x02cb, 0x02dd, 0x02dd, 0x02dd, 0x02dd, 0x02dd, 0x02df,
// Entry 200 - 23F
0x02df, 0x02df, 0x02e5, 0x02e6, 0x02e6, 0x02e7, 0x02e8, 0x02e8,
0x02e9, 0x02ea, 0x02ea, 0x02ea, 0x02eb, 0x02eb, 0x02eb, 0x02eb,
0x02eb, 0x02eb, 0x02eb, 0x02eb, 0x02ed, 0x02ed, 0x02ed, 0x02ee,
0x02ee, 0x02ef, 0x02ef, 0x02f0, 0x02f0, 0x02f0, 0x02f2, 0x02f2,
0x02f4, 0x02f5, 0x02f6, 0x02f6, 0x02f6, 0x02f6, 0x02f6, 0x0305,
0x0305, 0x0305, 0x0305, 0x0306, 0x0306, 0x0309, 0x030a, 0x030a,
0x030a, 0x030c, 0x030c, 0x030c, 0x030d, 0x030e, 0x030f, 0x0310,
0x0311, 0x0311, 0x0312, 0x0314, 0x0316, 0x0316, 0x0316, 0x0316,
// Entry 240 - 27F
0x0317, 0x0317, 0x0328, 0x0329, 0x0329, 0x032a, 0x032a, 0x0332,
0x0334, 0x0335, 0x0336, 0x0337, 0x0337, 0x0337, 0x0338, 0x0338,
0x0339, 0x0339, 0x033a, 0x033a, 0x033b, 0x033b, 0x033c, 0x033c,
0x033c, 0x0340, 0x0340, 0x0340, 0x0342, 0x0343, 0x0343, 0x0343,
0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343, 0x0343,
0x0346, 0x0346, 0x0354, 0x0354, 0x0358, 0x0358, 0x0358, 0x0358,
0x0358, 0x0358, 0x0358, 0x0358, 0x0358, 0x0358, 0x0359, 0x035a,
0x035b, 0x035c, 0x035c, 0x035e, 0x035e, 0x035f, 0x035f, 0x0367,
// Entry 280 - 2BF
0x0367, 0x0367, 0x0367, 0x0367, 0x0367, 0x036f, 0x036f, 0x036f,
0x036f, 0x036f, 0x036f, 0x036f, 0x036f, 0x0386, 0x0386, 0x0386,
0x0386, 0x0389, 0x038a, 0x038a, 0x038a, 0x038b, 0x038b, 0x038e,
0x038e, 0x038f, 0x0391, 0x0394, 0x0396, 0x0396, 0x0397, 0x0398,
0x0398, 0x039a, 0x039a, 0x039b, 0x039c, 0x039c, 0x039c, 0x039e,
0x039e, 0x039e, 0x03a1, 0x03a1, 0x03a6, 0x03a6, 0x03a6, 0x03a6,
0x03a6, 0x03a6, 0x03a6, 0x03a6, 0x03a8, 0x03a8, 0x03bb, 0x03bb,
0x03be, 0x03bf, 0x03bf, 0x03c0, 0x03c1, 0x03c1, 0x03c3, 0x03c3,
// Entry 2C0 - 2FF
0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c5, 0x03c5, 0x03c5, 0x03c5,
0x03c7, 0x03c7, 0x03c7, 0x03c7, 0x03c8, 0x03c8, 0x03c8, 0x03ca,
0x03ca, 0x03ca, 0x03ca, 0x03cb, 0x03cb, 0x03cb, 0x03cb, 0x03cb,
0x03cb, 0x03cc, 0x03cc, 0x03cc, 0x03d0, 0x03d0, 0x03d0, 0x03d0,
0x03d4, 0x03d4, 0x03d4, 0x03d5, 0x03d7, 0x03d9, 0x03dd, 0x03df,
0x03e0, 0x03e0, 0x03e2, 0x03e2,
} // Size: 1520 bytes
var normalSymIndex = []curToIndex{ // 994 elements
0: {cur: 0x13, idx: 0x6},
1: {cur: 0x2e, idx: 0x13},
2: {cur: 0x39, idx: 0x1c},
3: {cur: 0x42, idx: 0x20},
4: {cur: 0x5c, idx: 0x3b},
5: {cur: 0x61, idx: 0x3f},
6: {cur: 0x70, idx: 0x4b},
7: {cur: 0x7a, idx: 0x5a},
8: {cur: 0x7b, idx: 0x5e},
9: {cur: 0x83, idx: 0x62},
10: {cur: 0x8b, idx: 0x6e},
11: {cur: 0xb0, idx: 0x90},
12: {cur: 0xbe, idx: 0x9e},
13: {cur: 0xf3, idx: 0xc3},
14: {cur: 0xf9, idx: 0xcb},
15: {cur: 0x102, idx: 0xcf},
16: {cur: 0x106, idx: 0xd3},
17: {cur: 0x10d, idx: 0xd8},
18: {cur: 0x112, idx: 0xdc},
19: {cur: 0x114, idx: 0xe0},
20: {cur: 0xb0, idx: 0x0},
21: {cur: 0xe8, idx: 0xb8},
22: {cur: 0x122, idx: 0xe5},
23: {cur: 0xb7, idx: 0x4},
24: {cur: 0x65, idx: 0xea},
25: {cur: 0x13, idx: 0xf0},
26: {cur: 0x5b, idx: 0xf4},
27: {cur: 0xe8, idx: 0xb8},
28: {cur: 0x0, idx: 0xfb},
29: {cur: 0x2, idx: 0xff},
30: {cur: 0x13, idx: 0xf0},
31: {cur: 0x23, idx: 0x111},
32: {cur: 0x52, idx: 0x13b},
33: {cur: 0x56, idx: 0x145},
34: {cur: 0x76, idx: 0x15c},
35: {cur: 0x7c, idx: 0x165},
36: {cur: 0x7d, idx: 0x16f},
37: {cur: 0x82, idx: 0x17a},
38: {cur: 0x87, idx: 0x184},
39: {cur: 0x8c, idx: 0x191},
40: {cur: 0x90, idx: 0x19f},
41: {cur: 0x9b, idx: 0x1a9},
42: {cur: 0x9c, idx: 0x1b3},
43: {cur: 0xa9, idx: 0x1bd},
44: {cur: 0xbf, idx: 0x1c7},
45: {cur: 0xc6, idx: 0x1d1},
46: {cur: 0xcb, idx: 0x1d8},
47: {cur: 0xd3, idx: 0x1e2},
48: {cur: 0xd6, idx: 0x1f0},
49: {cur: 0xd7, idx: 0x1fa},
50: {cur: 0xe2, idx: 0x205},
51: {cur: 0xe6, idx: 0x20f},
52: {cur: 0xe8, idx: 0xb8},
53: {cur: 0xed, idx: 0x219},
54: {cur: 0xf1, idx: 0x223},
55: {cur: 0x11c, idx: 0x232},
56: {cur: 0x4f, idx: 0x23c},
57: {cur: 0x57, idx: 0x240},
58: {cur: 0xd7, idx: 0x0},
59: {cur: 0xdf, idx: 0x244},
60: {cur: 0x61, idx: 0x246},
61: {cur: 0xe2, idx: 0x3f},
62: {cur: 0xf4, idx: 0x24b},
63: {cur: 0x83, idx: 0x25},
64: {cur: 0xe8, idx: 0xb8},
65: {cur: 0xf9, idx: 0x4},
66: {cur: 0x16, idx: 0x24f},
67: {cur: 0xe8, idx: 0xb8},
68: {cur: 0x16, idx: 0x24f},
69: {cur: 0x2e, idx: 0x0},
70: {cur: 0x37, idx: 0x18},
71: {cur: 0x39, idx: 0x0},
72: {cur: 0x83, idx: 0x25},
73: {cur: 0xbe, idx: 0x0},
74: {cur: 0xd0, idx: 0xae},
75: {cur: 0xf9, idx: 0x4},
76: {cur: 0x124, idx: 0x8a},
77: {cur: 0xf4, idx: 0x24b},
78: {cur: 0x13, idx: 0x0},
79: {cur: 0x21, idx: 0x29c},
80: {cur: 0x2e, idx: 0x0},
81: {cur: 0x39, idx: 0x0},
82: {cur: 0x42, idx: 0x0},
83: {cur: 0x61, idx: 0x0},
84: {cur: 0x70, idx: 0x0},
85: {cur: 0x7a, idx: 0x0},
86: {cur: 0x7b, idx: 0x0},
87: {cur: 0x83, idx: 0x0},
88: {cur: 0x8b, idx: 0x0},
89: {cur: 0xb0, idx: 0x0},
90: {cur: 0xbe, idx: 0x0},
91: {cur: 0xf3, idx: 0x0},
92: {cur: 0xf9, idx: 0x2a2},
93: {cur: 0x102, idx: 0x0},
94: {cur: 0x10d, idx: 0x0},
95: {cur: 0x1b, idx: 0xc},
96: {cur: 0xe8, idx: 0xb8},
97: {cur: 0x42, idx: 0x25},
98: {cur: 0x42, idx: 0x20},
99: {cur: 0x13, idx: 0x2a9},
100: {cur: 0x2e, idx: 0x0},
101: {cur: 0x39, idx: 0x2ac},
102: {cur: 0x42, idx: 0x0},
103: {cur: 0x61, idx: 0x2b5},
104: {cur: 0x70, idx: 0x2bb},
105: {cur: 0x7a, idx: 0x0},
106: {cur: 0x83, idx: 0x0},
107: {cur: 0x8b, idx: 0x0},
108: {cur: 0xbe, idx: 0x2c4},
109: {cur: 0xf3, idx: 0x0},
110: {cur: 0xf9, idx: 0x2cd},
111: {cur: 0x102, idx: 0x0},
112: {cur: 0x10d, idx: 0x0},
113: {cur: 0x13, idx: 0x0},
114: {cur: 0x18, idx: 0x9},
115: {cur: 0x2e, idx: 0x0},
116: {cur: 0x39, idx: 0x0},
117: {cur: 0x42, idx: 0x0},
118: {cur: 0x61, idx: 0x0},
119: {cur: 0x70, idx: 0x0},
120: {cur: 0x73, idx: 0x51},
121: {cur: 0x7a, idx: 0x0},
122: {cur: 0x83, idx: 0x25},
123: {cur: 0xb0, idx: 0x0},
124: {cur: 0xbe, idx: 0x0},
125: {cur: 0xcf, idx: 0x2d2},
126: {cur: 0xe8, idx: 0xb8},
127: {cur: 0xf9, idx: 0x0},
128: {cur: 0x10d, idx: 0x0},
129: {cur: 0x114, idx: 0x0},
130: {cur: 0x18, idx: 0x2d7},
131: {cur: 0x4c, idx: 0x2dc},
132: {cur: 0x83, idx: 0x25},
133: {cur: 0xc7, idx: 0x2e1},
134: {cur: 0xcf, idx: 0x2e6},
135: {cur: 0xf1, idx: 0x2ee},
136: {cur: 0x13, idx: 0xf0},
137: {cur: 0x2e, idx: 0x0},
138: {cur: 0x39, idx: 0x0},
139: {cur: 0x42, idx: 0x25},
140: {cur: 0x5a, idx: 0x37},
141: {cur: 0xb0, idx: 0x0},
142: {cur: 0xe8, idx: 0xb8},
143: {cur: 0xf9, idx: 0x0},
144: {cur: 0x10d, idx: 0x0},
145: {cur: 0x60, idx: 0x2f3},
146: {cur: 0xd0, idx: 0xae},
147: {cur: 0xf8, idx: 0x2f5},
148: {cur: 0xf9, idx: 0x4},
149: {cur: 0x13, idx: 0xf0},
150: {cur: 0x47, idx: 0x2f9},
151: {cur: 0x4c, idx: 0x2c},
152: {cur: 0x7a, idx: 0x0},
153: {cur: 0x7b, idx: 0x0},
154: {cur: 0x102, idx: 0x0},
155: {cur: 0x10f, idx: 0x2fe},
156: {cur: 0xd0, idx: 0xae},
157: {cur: 0x8b, idx: 0x0},
158: {cur: 0xe8, idx: 0xb8},
159: {cur: 0x13, idx: 0xf0},
160: {cur: 0x50, idx: 0x305},
161: {cur: 0xe8, idx: 0xb8},
162: {cur: 0xf9, idx: 0x4},
163: {cur: 0x84, idx: 0x309},
164: {cur: 0x12, idx: 0x30d},
165: {cur: 0x13, idx: 0xf0},
166: {cur: 0x20, idx: 0x311},
167: {cur: 0x22, idx: 0x315},
168: {cur: 0x4e, idx: 0x31e},
169: {cur: 0x83, idx: 0x25},
170: {cur: 0xe8, idx: 0xb8},
171: {cur: 0xf9, idx: 0x4},
172: {cur: 0x5c, idx: 0x0},
173: {cur: 0x5c, idx: 0x0},
174: {cur: 0x97, idx: 0x2f3},
175: {cur: 0x13, idx: 0x0},
176: {cur: 0x83, idx: 0x25},
177: {cur: 0xc7, idx: 0xa6},
178: {cur: 0xe8, idx: 0xb8},
179: {cur: 0xf9, idx: 0x4},
180: {cur: 0x13, idx: 0xf0},
181: {cur: 0x33, idx: 0x333},
182: {cur: 0x7a, idx: 0x0},
183: {cur: 0x8b, idx: 0x337},
184: {cur: 0xe8, idx: 0x33d},
185: {cur: 0x106, idx: 0x0},
186: {cur: 0x84, idx: 0x309},
187: {cur: 0x13, idx: 0xf0},
188: {cur: 0x65, idx: 0xea},
189: {cur: 0xe8, idx: 0xb8},
190: {cur: 0x6b, idx: 0x343},
191: {cur: 0xe8, idx: 0xb8},
192: {cur: 0xf9, idx: 0x4},
193: {cur: 0x83, idx: 0x25},
194: {cur: 0xf9, idx: 0x4},
195: {cur: 0x83, idx: 0x62},
196: {cur: 0xf9, idx: 0xcb},
197: {cur: 0x10d, idx: 0x4},
198: {cur: 0x10d, idx: 0x4},
199: {cur: 0x13, idx: 0x4},
200: {cur: 0x2e, idx: 0x0},
201: {cur: 0x39, idx: 0x0},
202: {cur: 0x42, idx: 0x0},
203: {cur: 0x5c, idx: 0x0},
204: {cur: 0x61, idx: 0x0},
205: {cur: 0x70, idx: 0x0},
206: {cur: 0x7a, idx: 0x0},
207: {cur: 0x7b, idx: 0x0},
208: {cur: 0x83, idx: 0x0},
209: {cur: 0x8b, idx: 0x0},
210: {cur: 0xb0, idx: 0x0},
211: {cur: 0xbe, idx: 0x0},
212: {cur: 0xd5, idx: 0x7e},
213: {cur: 0xf3, idx: 0x0},
214: {cur: 0xf9, idx: 0x0},
215: {cur: 0x102, idx: 0x0},
216: {cur: 0x106, idx: 0x0},
217: {cur: 0x10d, idx: 0x0},
218: {cur: 0x112, idx: 0x0},
219: {cur: 0x114, idx: 0x356},
220: {cur: 0x1a, idx: 0x4},
221: {cur: 0x24, idx: 0x35a},
222: {cur: 0x25, idx: 0x4},
223: {cur: 0x32, idx: 0x4},
224: {cur: 0x35, idx: 0x16},
225: {cur: 0x38, idx: 0x4},
226: {cur: 0x39, idx: 0x4},
227: {cur: 0x13, idx: 0x4},
228: {cur: 0xbe, idx: 0x4},
229: {cur: 0x13, idx: 0x4},
230: {cur: 0x50, idx: 0x305},
231: {cur: 0x10d, idx: 0x4},
232: {cur: 0x57, idx: 0x240},
233: {cur: 0x5e, idx: 0x4},
234: {cur: 0x5f, idx: 0x3f},
235: {cur: 0x61, idx: 0x246},
236: {cur: 0x10d, idx: 0x4},
237: {cur: 0x65, idx: 0xea},
238: {cur: 0x61, idx: 0x246},
239: {cur: 0x66, idx: 0x3f},
240: {cur: 0x67, idx: 0x35e},
241: {cur: 0x6f, idx: 0x4},
242: {cur: 0x81, idx: 0x4},
243: {cur: 0x84, idx: 0x309},
244: {cur: 0x13, idx: 0x4},
245: {cur: 0x10d, idx: 0x4},
246: {cur: 0x8d, idx: 0x4},
247: {cur: 0x10d, idx: 0x4},
248: {cur: 0x92, idx: 0x4},
249: {cur: 0x122, idx: 0xe5},
250: {cur: 0xa1, idx: 0x87},
251: {cur: 0xa8, idx: 0x360},
252: {cur: 0x10d, idx: 0x4},
253: {cur: 0x61, idx: 0x246},
254: {cur: 0xac, idx: 0x7e},
255: {cur: 0xaf, idx: 0x365},
256: {cur: 0xb3, idx: 0x94},
257: {cur: 0xb7, idx: 0x4},
258: {cur: 0x13, idx: 0x4},
259: {cur: 0xb8, idx: 0x97},
260: {cur: 0x13, idx: 0x4},
261: {cur: 0xbe, idx: 0x4},
262: {cur: 0xbe, idx: 0x4},
263: {cur: 0xc4, idx: 0x8a},
264: {cur: 0xc5, idx: 0xa2},
265: {cur: 0xc6, idx: 0x7e},
266: {cur: 0xbe, idx: 0x4},
267: {cur: 0xd2, idx: 0xb2},
268: {cur: 0xd4, idx: 0x4},
269: {cur: 0xd5, idx: 0x368},
270: {cur: 0xd9, idx: 0x30},
271: {cur: 0xda, idx: 0x4},
272: {cur: 0x61, idx: 0x246},
273: {cur: 0xdb, idx: 0x3f},
274: {cur: 0xde, idx: 0x36b},
275: {cur: 0x61, idx: 0x246},
276: {cur: 0xe2, idx: 0x3f},
277: {cur: 0x8, idx: 0x36e},
278: {cur: 0xe7, idx: 0x373},
279: {cur: 0xbe, idx: 0x4},
280: {cur: 0xee, idx: 0xbc},
281: {cur: 0xf2, idx: 0x4},
282: {cur: 0x13, idx: 0x4},
283: {cur: 0xf4, idx: 0x24b},
284: {cur: 0xf8, idx: 0x2f5},
285: {cur: 0x10d, idx: 0x4},
286: {cur: 0x104, idx: 0x375},
287: {cur: 0x105, idx: 0x378},
288: {cur: 0x122, idx: 0xe5},
289: {cur: 0x124, idx: 0x8a},
290: {cur: 0x13, idx: 0x0},
291: {cur: 0x2e, idx: 0x0},
292: {cur: 0x42, idx: 0x0},
293: {cur: 0x5a, idx: 0x37},
294: {cur: 0x61, idx: 0x0},
295: {cur: 0x70, idx: 0x0},
296: {cur: 0x7a, idx: 0x0},
297: {cur: 0x7b, idx: 0x0},
298: {cur: 0x83, idx: 0x0},
299: {cur: 0x8b, idx: 0x0},
300: {cur: 0xb0, idx: 0x0},
301: {cur: 0xbe, idx: 0x0},
302: {cur: 0xe8, idx: 0xb8},
303: {cur: 0xf3, idx: 0x0},
304: {cur: 0xf9, idx: 0x4},
305: {cur: 0x106, idx: 0x0},
306: {cur: 0x10d, idx: 0x0},
307: {cur: 0x112, idx: 0x0},
308: {cur: 0x39, idx: 0x0},
309: {cur: 0x5c, idx: 0x0},
310: {cur: 0xe8, idx: 0x0},
311: {cur: 0xf9, idx: 0x0},
312: {cur: 0x102, idx: 0x0},
313: {cur: 0x11, idx: 0x4},
314: {cur: 0xf9, idx: 0xcb},
315: {cur: 0x27, idx: 0x10},
316: {cur: 0x2e, idx: 0x13},
317: {cur: 0x40, idx: 0x4},
318: {cur: 0xf9, idx: 0xcb},
319: {cur: 0x43, idx: 0x4},
320: {cur: 0xf9, idx: 0xcb},
321: {cur: 0x45, idx: 0x28},
322: {cur: 0x49, idx: 0x4},
323: {cur: 0xf9, idx: 0xcb},
324: {cur: 0x51, idx: 0x26c},
325: {cur: 0xf9, idx: 0xcb},
326: {cur: 0xf9, idx: 0x4},
327: {cur: 0x106, idx: 0xd3},
328: {cur: 0x6c, idx: 0x49},
329: {cur: 0x71, idx: 0x4f},
330: {cur: 0x4, idx: 0x380},
331: {cur: 0x8, idx: 0x383},
332: {cur: 0x9, idx: 0x1},
333: {cur: 0x11, idx: 0x387},
334: {cur: 0x13, idx: 0xf0},
335: {cur: 0x14, idx: 0x38a},
336: {cur: 0x42, idx: 0x20},
337: {cur: 0xb0, idx: 0x4},
338: {cur: 0x114, idx: 0x0},
339: {cur: 0xba, idx: 0x9b},
340: {cur: 0xc0, idx: 0x395},
341: {cur: 0xc2, idx: 0x399},
342: {cur: 0xc5, idx: 0xa2},
343: {cur: 0xf9, idx: 0x4},
344: {cur: 0xca, idx: 0x39d},
345: {cur: 0xf9, idx: 0x4},
346: {cur: 0x83, idx: 0x25},
347: {cur: 0xf9, idx: 0x4},
348: {cur: 0xf9, idx: 0xcb},
349: {cur: 0xfe, idx: 0x4},
350: {cur: 0x101, idx: 0x3a1},
351: {cur: 0x13, idx: 0xf0},
352: {cur: 0x55, idx: 0x30},
353: {cur: 0x83, idx: 0x25},
354: {cur: 0xe8, idx: 0xb8},
355: {cur: 0xf9, idx: 0x4},
356: {cur: 0x5a, idx: 0x37},
357: {cur: 0xe8, idx: 0xb8},
358: {cur: 0x4, idx: 0x3a5},
359: {cur: 0x39, idx: 0x2ac},
360: {cur: 0x42, idx: 0x3a8},
361: {cur: 0x70, idx: 0x3ad},
362: {cur: 0x7d, idx: 0x3b1},
363: {cur: 0x83, idx: 0x25},
364: {cur: 0xb0, idx: 0x3ba},
365: {cur: 0xbe, idx: 0x3be},
366: {cur: 0xe8, idx: 0xb8},
367: {cur: 0xf9, idx: 0x4},
368: {cur: 0x10d, idx: 0x3c2},
369: {cur: 0x68, idx: 0x46},
370: {cur: 0xa9, idx: 0x3c6},
371: {cur: 0x13, idx: 0x0},
372: {cur: 0x2e, idx: 0x0},
373: {cur: 0x39, idx: 0x0},
374: {cur: 0x42, idx: 0x0},
375: {cur: 0x5d, idx: 0x3c9},
376: {cur: 0x70, idx: 0x0},
377: {cur: 0x7a, idx: 0x0},
378: {cur: 0x7b, idx: 0x0},
379: {cur: 0x83, idx: 0x25},
380: {cur: 0x8b, idx: 0x0},
381: {cur: 0xb0, idx: 0x0},
382: {cur: 0xbe, idx: 0x0},
383: {cur: 0xf3, idx: 0x0},
384: {cur: 0xf9, idx: 0x4},
385: {cur: 0x102, idx: 0x0},
386: {cur: 0x10d, idx: 0x0},
387: {cur: 0x114, idx: 0x0},
388: {cur: 0x83, idx: 0x25},
389: {cur: 0xc5, idx: 0xa2},
390: {cur: 0xe8, idx: 0xb8},
391: {cur: 0xf9, idx: 0x4},
392: {cur: 0x50, idx: 0x30},
393: {cur: 0x50, idx: 0x305},
394: {cur: 0x11, idx: 0x3cc},
395: {cur: 0x13, idx: 0x3d0},
396: {cur: 0x1d, idx: 0x3d4},
397: {cur: 0x25, idx: 0x3d7},
398: {cur: 0x26, idx: 0x3db},
399: {cur: 0x32, idx: 0x3df},
400: {cur: 0x38, idx: 0x3e3},
401: {cur: 0x39, idx: 0x2ac},
402: {cur: 0x40, idx: 0x3e7},
403: {cur: 0x42, idx: 0x0},
404: {cur: 0x43, idx: 0x3eb},
405: {cur: 0x4b, idx: 0x3ef},
406: {cur: 0x5e, idx: 0x3f8},
407: {cur: 0x5f, idx: 0x3fc},
408: {cur: 0x60, idx: 0x2f3},
409: {cur: 0x61, idx: 0x401},
410: {cur: 0x66, idx: 0x406},
411: {cur: 0x70, idx: 0x0},
412: {cur: 0x77, idx: 0x40b},
413: {cur: 0x78, idx: 0x410},
414: {cur: 0x80, idx: 0x415},
415: {cur: 0x83, idx: 0x0},
416: {cur: 0x90, idx: 0x41b},
417: {cur: 0xab, idx: 0x420},
418: {cur: 0xb0, idx: 0x3ba},
419: {cur: 0xb7, idx: 0x425},
420: {cur: 0xbe, idx: 0x3be},
421: {cur: 0xcc, idx: 0x42c},
422: {cur: 0xd4, idx: 0x433},
423: {cur: 0xda, idx: 0x437},
424: {cur: 0xe0, idx: 0x43b},
425: {cur: 0xf2, idx: 0x43f},
426: {cur: 0xf3, idx: 0x0},
427: {cur: 0xf9, idx: 0x443},
428: {cur: 0xfe, idx: 0x447},
429: {cur: 0x105, idx: 0x378},
430: {cur: 0x10d, idx: 0x0},
431: {cur: 0x114, idx: 0x44b},
432: {cur: 0x24, idx: 0x35a},
433: {cur: 0x11, idx: 0x0},
434: {cur: 0x13, idx: 0x453},
435: {cur: 0x25, idx: 0x0},
436: {cur: 0x26, idx: 0x0},
437: {cur: 0x32, idx: 0x0},
438: {cur: 0x38, idx: 0x0},
439: {cur: 0x39, idx: 0x4},
440: {cur: 0x40, idx: 0x0},
441: {cur: 0x42, idx: 0x20},
442: {cur: 0x43, idx: 0x0},
443: {cur: 0x5e, idx: 0x0},
444: {cur: 0x5f, idx: 0x0},
445: {cur: 0x61, idx: 0x3f},
446: {cur: 0x66, idx: 0x0},
447: {cur: 0x70, idx: 0x459},
448: {cur: 0x7a, idx: 0x0},
449: {cur: 0x83, idx: 0x25},
450: {cur: 0x8b, idx: 0x0},
451: {cur: 0x90, idx: 0x0},
452: {cur: 0xb0, idx: 0x0},
453: {cur: 0xb7, idx: 0x0},
454: {cur: 0xbe, idx: 0x45f},
455: {cur: 0xd4, idx: 0x0},
456: {cur: 0xda, idx: 0x465},
457: {cur: 0xe0, idx: 0x0},
458: {cur: 0xf2, idx: 0x0},
459: {cur: 0xf9, idx: 0x46b},
460: {cur: 0xfe, idx: 0x0},
461: {cur: 0x102, idx: 0x0},
462: {cur: 0x106, idx: 0x0},
463: {cur: 0x112, idx: 0x0},
464: {cur: 0x114, idx: 0x0},
465: {cur: 0x3a, idx: 0x32b},
466: {cur: 0x4f, idx: 0x23c},
467: {cur: 0x52, idx: 0x471},
468: {cur: 0x68, idx: 0x46},
469: {cur: 0x74, idx: 0x474},
470: {cur: 0x87, idx: 0x6b},
471: {cur: 0x60, idx: 0x0},
472: {cur: 0x97, idx: 0x2f3},
473: {cur: 0xa1, idx: 0x87},
474: {cur: 0xa9, idx: 0x3c6},
475: {cur: 0xac, idx: 0x7e},
476: {cur: 0xd2, idx: 0xb2},
477: {cur: 0xd5, idx: 0x368},
478: {cur: 0xe6, idx: 0x476},
479: {cur: 0xed, idx: 0x479},
480: {cur: 0x104, idx: 0x375},
481: {cur: 0x13, idx: 0xf0},
482: {cur: 0x39, idx: 0x9b},
483: {cur: 0x5e, idx: 0x14f},
484: {cur: 0xd4, idx: 0x292},
485: {cur: 0xe8, idx: 0xb8},
486: {cur: 0x114, idx: 0x0},
487: {cur: 0x83, idx: 0x25},
488: {cur: 0xe8, idx: 0xb8},
489: {cur: 0xf9, idx: 0x4},
490: {cur: 0xe8, idx: 0xb8},
491: {cur: 0xf9, idx: 0x4},
492: {cur: 0x13, idx: 0x2a9},
493: {cur: 0x2e, idx: 0x47c},
494: {cur: 0x39, idx: 0x2ac},
495: {cur: 0x5a, idx: 0x37},
496: {cur: 0x70, idx: 0x3ad},
497: {cur: 0x83, idx: 0x47f},
498: {cur: 0xb0, idx: 0x3ba},
499: {cur: 0xe8, idx: 0xb8},
500: {cur: 0xf3, idx: 0x484},
501: {cur: 0xf9, idx: 0x4},
502: {cur: 0x12, idx: 0x30d},
503: {cur: 0x83, idx: 0x25},
504: {cur: 0xf9, idx: 0x4},
505: {cur: 0xe8, idx: 0xb8},
506: {cur: 0x84, idx: 0x309},
507: {cur: 0xb8, idx: 0x97},
508: {cur: 0x65, idx: 0xea},
509: {cur: 0xf9, idx: 0x4},
510: {cur: 0x78, idx: 0x490},
511: {cur: 0xe8, idx: 0xb8},
512: {cur: 0xf9, idx: 0x4},
513: {cur: 0xe8, idx: 0xb8},
514: {cur: 0xf9, idx: 0x4},
515: {cur: 0x13, idx: 0x0},
516: {cur: 0x2e, idx: 0x0},
517: {cur: 0x39, idx: 0x0},
518: {cur: 0x42, idx: 0x0},
519: {cur: 0x5c, idx: 0x0},
520: {cur: 0x61, idx: 0x0},
521: {cur: 0x70, idx: 0x0},
522: {cur: 0x7a, idx: 0x0},
523: {cur: 0x7b, idx: 0x0},
524: {cur: 0x83, idx: 0x0},
525: {cur: 0x8b, idx: 0x0},
526: {cur: 0xb0, idx: 0x0},
527: {cur: 0xbe, idx: 0x0},
528: {cur: 0xf3, idx: 0x0},
529: {cur: 0xf9, idx: 0x0},
530: {cur: 0x102, idx: 0x0},
531: {cur: 0x10d, idx: 0x0},
532: {cur: 0x114, idx: 0x0},
533: {cur: 0x18, idx: 0x9},
534: {cur: 0x13, idx: 0x0},
535: {cur: 0x83, idx: 0x25},
536: {cur: 0xc7, idx: 0xa6},
537: {cur: 0xe8, idx: 0xb8},
538: {cur: 0xf9, idx: 0x4},
539: {cur: 0x13, idx: 0x0},
540: {cur: 0x2e, idx: 0x0},
541: {cur: 0x39, idx: 0x0},
542: {cur: 0x42, idx: 0x0},
543: {cur: 0x5c, idx: 0x0},
544: {cur: 0x61, idx: 0x0},
545: {cur: 0x70, idx: 0x0},
546: {cur: 0x75, idx: 0x54},
547: {cur: 0x7a, idx: 0x0},
548: {cur: 0x7b, idx: 0x0},
549: {cur: 0x83, idx: 0x25},
550: {cur: 0x8b, idx: 0x0},
551: {cur: 0xb0, idx: 0x0},
552: {cur: 0xbe, idx: 0x0},
553: {cur: 0xf3, idx: 0x0},
554: {cur: 0xf9, idx: 0x0},
555: {cur: 0x102, idx: 0x0},
556: {cur: 0x10d, idx: 0x0},
557: {cur: 0x7, idx: 0x49b},
558: {cur: 0xe8, idx: 0xb8},
559: {cur: 0xf9, idx: 0x4},
560: {cur: 0x13, idx: 0xf0},
561: {cur: 0x76, idx: 0x57},
562: {cur: 0x7b, idx: 0x7e},
563: {cur: 0xe8, idx: 0xb8},
564: {cur: 0xb8, idx: 0x97},
565: {cur: 0x42, idx: 0x25},
566: {cur: 0x13, idx: 0x0},
567: {cur: 0x2e, idx: 0x0},
568: {cur: 0x39, idx: 0x0},
569: {cur: 0x5c, idx: 0x0},
570: {cur: 0x61, idx: 0x0},
571: {cur: 0x7b, idx: 0x0},
572: {cur: 0x8b, idx: 0x0},
573: {cur: 0xb0, idx: 0x0},
574: {cur: 0xbe, idx: 0x0},
575: {cur: 0xf3, idx: 0x0},
576: {cur: 0xf9, idx: 0x0},
577: {cur: 0x102, idx: 0x0},
578: {cur: 0x2e, idx: 0x0},
579: {cur: 0x70, idx: 0x0},
580: {cur: 0x83, idx: 0x0},
581: {cur: 0x8b, idx: 0x0},
582: {cur: 0xb0, idx: 0x0},
583: {cur: 0xe8, idx: 0xb8},
584: {cur: 0xf3, idx: 0x0},
585: {cur: 0x13, idx: 0xf0},
586: {cur: 0x42, idx: 0x4a2},
587: {cur: 0x83, idx: 0x4a6},
588: {cur: 0xe8, idx: 0xb8},
589: {cur: 0xf9, idx: 0x4},
590: {cur: 0xf4, idx: 0x24b},
591: {cur: 0x13, idx: 0x0},
592: {cur: 0x42, idx: 0x0},
593: {cur: 0x63, idx: 0x42},
594: {cur: 0x70, idx: 0x0},
595: {cur: 0x7a, idx: 0x0},
596: {cur: 0x7b, idx: 0x0},
597: {cur: 0x83, idx: 0x0},
598: {cur: 0x8b, idx: 0x0},
599: {cur: 0xbe, idx: 0x0},
600: {cur: 0x102, idx: 0x0},
601: {cur: 0x52, idx: 0x471},
602: {cur: 0x84, idx: 0x309},
603: {cur: 0xf4, idx: 0x24b},
604: {cur: 0x13, idx: 0xf0},
605: {cur: 0x4a, idx: 0x4aa},
606: {cur: 0xe8, idx: 0xb8},
607: {cur: 0x84, idx: 0x309},
608: {cur: 0x25, idx: 0x4ae},
609: {cur: 0x39, idx: 0x4b3},
610: {cur: 0x8e, idx: 0x72},
611: {cur: 0xd0, idx: 0xae},
612: {cur: 0xe8, idx: 0xb8},
613: {cur: 0xf9, idx: 0x4},
614: {cur: 0x50, idx: 0x305},
615: {cur: 0x84, idx: 0x309},
616: {cur: 0x86, idx: 0x67},
617: {cur: 0xe8, idx: 0xb8},
618: {cur: 0xf9, idx: 0x4},
619: {cur: 0xe8, idx: 0xb8},
620: {cur: 0xf9, idx: 0x4},
621: {cur: 0x13, idx: 0xf0},
622: {cur: 0xe8, idx: 0xb8},
623: {cur: 0xf4, idx: 0x24b},
624: {cur: 0x13, idx: 0x0},
625: {cur: 0x2e, idx: 0x0},
626: {cur: 0x39, idx: 0x0},
627: {cur: 0x61, idx: 0x0},
628: {cur: 0x70, idx: 0x0},
629: {cur: 0x7a, idx: 0x0},
630: {cur: 0x7b, idx: 0x0},
631: {cur: 0x85, idx: 0x4bf},
632: {cur: 0x8b, idx: 0x0},
633: {cur: 0xb0, idx: 0x0},
634: {cur: 0xbe, idx: 0x0},
635: {cur: 0xe8, idx: 0xb8},
636: {cur: 0xf3, idx: 0x0},
637: {cur: 0xf9, idx: 0x0},
638: {cur: 0x10d, idx: 0x0},
639: {cur: 0xf4, idx: 0x24b},
640: {cur: 0x12, idx: 0x30d},
641: {cur: 0x13, idx: 0xf0},
642: {cur: 0x83, idx: 0x25},
643: {cur: 0xe8, idx: 0xb8},
644: {cur: 0xf9, idx: 0x4},
645: {cur: 0xf8, idx: 0x2f5},
646: {cur: 0xf9, idx: 0x4},
647: {cur: 0x3a, idx: 0x32b},
648: {cur: 0x9, idx: 0x1},
649: {cur: 0x8f, idx: 0x76},
650: {cur: 0xe8, idx: 0xb8},
651: {cur: 0x13, idx: 0x0},
652: {cur: 0x2e, idx: 0x0},
653: {cur: 0x39, idx: 0x0},
654: {cur: 0x42, idx: 0x0},
655: {cur: 0x61, idx: 0x0},
656: {cur: 0x70, idx: 0x0},
657: {cur: 0x7a, idx: 0x0},
658: {cur: 0x7b, idx: 0x0},
659: {cur: 0x83, idx: 0x0},
660: {cur: 0x8b, idx: 0x0},
661: {cur: 0xb0, idx: 0x0},
662: {cur: 0xbe, idx: 0x0},
663: {cur: 0xf3, idx: 0x0},
664: {cur: 0xf9, idx: 0x0},
665: {cur: 0x102, idx: 0x0},
666: {cur: 0x106, idx: 0x0},
667: {cur: 0x10d, idx: 0x0},
668: {cur: 0x112, idx: 0x0},
669: {cur: 0x114, idx: 0x0},
670: {cur: 0x3a, idx: 0x32b},
671: {cur: 0x84, idx: 0x309},
672: {cur: 0x84, idx: 0x309},
673: {cur: 0x13, idx: 0xf0},
674: {cur: 0x83, idx: 0x25},
675: {cur: 0x99, idx: 0x84},
676: {cur: 0xe8, idx: 0xb8},
677: {cur: 0xf9, idx: 0x4},
678: {cur: 0x84, idx: 0x309},
679: {cur: 0xf4, idx: 0x24b},
680: {cur: 0x84, idx: 0x309},
681: {cur: 0xac, idx: 0x7e},
682: {cur: 0xa1, idx: 0x87},
683: {cur: 0xb6, idx: 0x4cc},
684: {cur: 0x13, idx: 0x0},
685: {cur: 0x42, idx: 0x0},
686: {cur: 0x61, idx: 0x0},
687: {cur: 0x70, idx: 0x0},
688: {cur: 0x7a, idx: 0x0},
689: {cur: 0x7b, idx: 0x0},
690: {cur: 0x83, idx: 0x0},
691: {cur: 0x8b, idx: 0x0},
692: {cur: 0xa3, idx: 0x4d0},
693: {cur: 0xbe, idx: 0x0},
694: {cur: 0xf3, idx: 0x0},
695: {cur: 0x102, idx: 0x0},
696: {cur: 0x83, idx: 0x25},
697: {cur: 0xe8, idx: 0xb8},
698: {cur: 0xf9, idx: 0x4},
699: {cur: 0xa7, idx: 0x8c},
700: {cur: 0xe8, idx: 0xb8},
701: {cur: 0xf9, idx: 0x4},
702: {cur: 0xe8, idx: 0xb8},
703: {cur: 0xf9, idx: 0x4},
704: {cur: 0x39, idx: 0x0},
705: {cur: 0xb0, idx: 0x0},
706: {cur: 0xb3, idx: 0x94},
707: {cur: 0xf9, idx: 0x0},
708: {cur: 0x26, idx: 0x4},
709: {cur: 0xda, idx: 0x4},
710: {cur: 0x45, idx: 0x4ea},
711: {cur: 0xa6, idx: 0x8a},
712: {cur: 0xe8, idx: 0xb8},
713: {cur: 0xf9, idx: 0x4},
714: {cur: 0xb7, idx: 0x4},
715: {cur: 0x13, idx: 0x0},
716: {cur: 0x2e, idx: 0x0},
717: {cur: 0x39, idx: 0x0},
718: {cur: 0x42, idx: 0x0},
719: {cur: 0x70, idx: 0x0},
720: {cur: 0x7a, idx: 0x0},
721: {cur: 0x7b, idx: 0x0},
722: {cur: 0x83, idx: 0x0},
723: {cur: 0x8b, idx: 0x0},
724: {cur: 0xb0, idx: 0x0},
725: {cur: 0xbc, idx: 0x30},
726: {cur: 0xbe, idx: 0x0},
727: {cur: 0xf3, idx: 0x0},
728: {cur: 0xf9, idx: 0x0},
729: {cur: 0x102, idx: 0x0},
730: {cur: 0x106, idx: 0x0},
731: {cur: 0x10d, idx: 0x0},
732: {cur: 0x114, idx: 0x0},
733: {cur: 0xbd, idx: 0x4fd},
734: {cur: 0xe8, idx: 0xb8},
735: {cur: 0x13, idx: 0xf0},
736: {cur: 0x39, idx: 0x9b},
737: {cur: 0x5e, idx: 0x14f},
738: {cur: 0xd4, idx: 0x292},
739: {cur: 0xe8, idx: 0xb8},
740: {cur: 0x114, idx: 0x0},
741: {cur: 0x14, idx: 0x38a},
742: {cur: 0xf9, idx: 0x4},
743: {cur: 0x8, idx: 0x36e},
744: {cur: 0xe0, idx: 0x4},
745: {cur: 0x8, idx: 0x36e},
746: {cur: 0xbc, idx: 0x30},
747: {cur: 0x61, idx: 0x246},
748: {cur: 0xe2, idx: 0x3f},
749: {cur: 0xf8, idx: 0x2f5},
750: {cur: 0x5b, idx: 0x38f},
751: {cur: 0x84, idx: 0x309},
752: {cur: 0x63, idx: 0x42},
753: {cur: 0xf9, idx: 0x4},
754: {cur: 0x63, idx: 0x0},
755: {cur: 0xd0, idx: 0xae},
756: {cur: 0xe8, idx: 0xb8},
757: {cur: 0xc6, idx: 0x50a},
758: {cur: 0x13, idx: 0x0},
759: {cur: 0x39, idx: 0x0},
760: {cur: 0x42, idx: 0x0},
761: {cur: 0x61, idx: 0x0},
762: {cur: 0x70, idx: 0x0},
763: {cur: 0x7a, idx: 0x0},
764: {cur: 0x7b, idx: 0x0},
765: {cur: 0x83, idx: 0x0},
766: {cur: 0x8b, idx: 0x0},
767: {cur: 0xb0, idx: 0x0},
768: {cur: 0xbe, idx: 0x0},
769: {cur: 0xc7, idx: 0xa6},
770: {cur: 0xf3, idx: 0x0},
771: {cur: 0xf9, idx: 0x0},
772: {cur: 0x102, idx: 0x0},
773: {cur: 0x4, idx: 0x3a5},
774: {cur: 0x13, idx: 0xf0},
775: {cur: 0xc9, idx: 0x50d},
776: {cur: 0xe8, idx: 0xb8},
777: {cur: 0x9, idx: 0x1},
778: {cur: 0x4a, idx: 0x4aa},
779: {cur: 0xc9, idx: 0x512},
780: {cur: 0x97, idx: 0x2f3},
781: {cur: 0xa8, idx: 0x360},
782: {cur: 0xb6, idx: 0x4cc},
783: {cur: 0xc9, idx: 0x4aa},
784: {cur: 0xe3, idx: 0xb5},
785: {cur: 0xc2, idx: 0x399},
786: {cur: 0x27, idx: 0x10},
787: {cur: 0xc2, idx: 0x0},
788: {cur: 0xc2, idx: 0x0},
789: {cur: 0xf9, idx: 0x4},
790: {cur: 0x24, idx: 0x35a},
791: {cur: 0x13, idx: 0x0},
792: {cur: 0x2e, idx: 0x0},
793: {cur: 0x39, idx: 0x0},
794: {cur: 0x42, idx: 0x0},
795: {cur: 0x5c, idx: 0x0},
796: {cur: 0x61, idx: 0x0},
797: {cur: 0x70, idx: 0x0},
798: {cur: 0x7a, idx: 0x0},
799: {cur: 0x7b, idx: 0x0},
800: {cur: 0x83, idx: 0x0},
801: {cur: 0x8b, idx: 0x0},
802: {cur: 0xb0, idx: 0x0},
803: {cur: 0xbe, idx: 0x0},
804: {cur: 0xf3, idx: 0x0},
805: {cur: 0xf9, idx: 0x0},
806: {cur: 0x102, idx: 0x0},
807: {cur: 0x10d, idx: 0x0},
808: {cur: 0xa0, idx: 0x4f},
809: {cur: 0xf4, idx: 0x24b},
810: {cur: 0x0, idx: 0x519},
811: {cur: 0x83, idx: 0x25},
812: {cur: 0xd0, idx: 0xae},
813: {cur: 0xd1, idx: 0x18},
814: {cur: 0xe8, idx: 0xb8},
815: {cur: 0xec, idx: 0x51e},
816: {cur: 0xf5, idx: 0xc7},
817: {cur: 0xf9, idx: 0x4},
818: {cur: 0x37, idx: 0x18},
819: {cur: 0xd1, idx: 0x0},
820: {cur: 0x85, idx: 0x4bf},
821: {cur: 0x8e, idx: 0x72},
822: {cur: 0xa0, idx: 0x4f},
823: {cur: 0xd2, idx: 0xb2},
824: {cur: 0xf4, idx: 0x24b},
825: {cur: 0xd0, idx: 0xae},
826: {cur: 0x84, idx: 0x309},
827: {cur: 0xf4, idx: 0x24b},
828: {cur: 0x50, idx: 0x525},
829: {cur: 0xbc, idx: 0x30},
830: {cur: 0xd9, idx: 0x529},
831: {cur: 0xe8, idx: 0xb8},
832: {cur: 0xbc, idx: 0x52d},
833: {cur: 0xd9, idx: 0x30},
834: {cur: 0xb6, idx: 0x4cc},
835: {cur: 0x91, idx: 0x531},
836: {cur: 0xe8, idx: 0xb8},
837: {cur: 0x112, idx: 0x539},
838: {cur: 0x13, idx: 0x0},
839: {cur: 0x2e, idx: 0x0},
840: {cur: 0x39, idx: 0x0},
841: {cur: 0x42, idx: 0x0},
842: {cur: 0x61, idx: 0x0},
843: {cur: 0x70, idx: 0x0},
844: {cur: 0x7a, idx: 0x549},
845: {cur: 0x7b, idx: 0x0},
846: {cur: 0x83, idx: 0x0},
847: {cur: 0x8b, idx: 0x0},
848: {cur: 0xbe, idx: 0x0},
849: {cur: 0xf3, idx: 0x0},
850: {cur: 0xf9, idx: 0x0},
851: {cur: 0x102, idx: 0x0},
852: {cur: 0x39, idx: 0x0},
853: {cur: 0x83, idx: 0x25},
854: {cur: 0xe8, idx: 0xb8},
855: {cur: 0xf9, idx: 0x4},
856: {cur: 0xdf, idx: 0x244},
857: {cur: 0x4f, idx: 0x23c},
858: {cur: 0x5b, idx: 0x38f},
859: {cur: 0x84, idx: 0x309},
860: {cur: 0x6, idx: 0x54d},
861: {cur: 0xe8, idx: 0xb8},
862: {cur: 0xa3, idx: 0x553},
863: {cur: 0x13, idx: 0x0},
864: {cur: 0x18, idx: 0x2d7},
865: {cur: 0x21, idx: 0x557},
866: {cur: 0x37, idx: 0x55d},
867: {cur: 0x83, idx: 0x25},
868: {cur: 0x8b, idx: 0x0},
869: {cur: 0xbe, idx: 0x0},
870: {cur: 0x102, idx: 0x0},
871: {cur: 0x13, idx: 0x0},
872: {cur: 0x18, idx: 0x9},
873: {cur: 0x21, idx: 0x557},
874: {cur: 0x37, idx: 0x55d},
875: {cur: 0x83, idx: 0x25},
876: {cur: 0x8b, idx: 0x0},
877: {cur: 0xbe, idx: 0x0},
878: {cur: 0x102, idx: 0x0},
879: {cur: 0x13, idx: 0x0},
880: {cur: 0x1a, idx: 0x257},
881: {cur: 0x25, idx: 0x11b},
882: {cur: 0x2e, idx: 0x571},
883: {cur: 0x32, idx: 0x123},
884: {cur: 0x38, idx: 0x127},
885: {cur: 0x42, idx: 0x0},
886: {cur: 0x50, idx: 0x525},
887: {cur: 0x51, idx: 0x26c},
888: {cur: 0x55, idx: 0x575},
889: {cur: 0x56, idx: 0x579},
890: {cur: 0x61, idx: 0x0},
891: {cur: 0x70, idx: 0x0},
892: {cur: 0x7b, idx: 0x0},
893: {cur: 0x7f, idx: 0x57e},
894: {cur: 0x81, idx: 0x176},
895: {cur: 0x83, idx: 0x0},
896: {cur: 0x8b, idx: 0x0},
897: {cur: 0xbc, idx: 0x52d},
898: {cur: 0xbe, idx: 0x0},
899: {cur: 0xd9, idx: 0x30},
900: {cur: 0xf3, idx: 0x0},
901: {cur: 0x102, idx: 0x0},
902: {cur: 0x84, idx: 0x309},
903: {cur: 0xe8, idx: 0xb8},
904: {cur: 0xf4, idx: 0x24b},
905: {cur: 0x3a, idx: 0x32b},
906: {cur: 0xf8, idx: 0x2f5},
907: {cur: 0x83, idx: 0x25},
908: {cur: 0xe8, idx: 0xb8},
909: {cur: 0xf9, idx: 0x4},
910: {cur: 0x91, idx: 0x582},
911: {cur: 0xb3, idx: 0x94},
912: {cur: 0xda, idx: 0x296},
913: {cur: 0xb3, idx: 0x94},
914: {cur: 0xda, idx: 0x4},
915: {cur: 0xf9, idx: 0xcb},
916: {cur: 0xe8, idx: 0xb8},
917: {cur: 0xf9, idx: 0x4},
918: {cur: 0xf8, idx: 0x2f5},
919: {cur: 0x84, idx: 0x309},
920: {cur: 0x13, idx: 0xf0},
921: {cur: 0x83, idx: 0x25},
922: {cur: 0x5b, idx: 0x38f},
923: {cur: 0x57, idx: 0x240},
924: {cur: 0x5c, idx: 0x0},
925: {cur: 0x61, idx: 0x0},
926: {cur: 0x13, idx: 0x586},
927: {cur: 0xbe, idx: 0x58b},
928: {cur: 0xee, idx: 0xbc},
929: {cur: 0x13, idx: 0xf0},
930: {cur: 0x83, idx: 0x25},
931: {cur: 0xe8, idx: 0xb8},
932: {cur: 0xf1, idx: 0xbf},
933: {cur: 0xf9, idx: 0x4},
934: {cur: 0x42, idx: 0x4a6},
935: {cur: 0xf9, idx: 0x4},
936: {cur: 0x13, idx: 0x0},
937: {cur: 0x2e, idx: 0x0},
938: {cur: 0x39, idx: 0x0},
939: {cur: 0x42, idx: 0x0},
940: {cur: 0x5c, idx: 0x0},
941: {cur: 0x61, idx: 0x0},
942: {cur: 0x70, idx: 0x0},
943: {cur: 0x7a, idx: 0x0},
944: {cur: 0x7b, idx: 0x0},
945: {cur: 0x83, idx: 0x25},
946: {cur: 0x8b, idx: 0x0},
947: {cur: 0xb0, idx: 0x0},
948: {cur: 0xbe, idx: 0x0},
949: {cur: 0xf3, idx: 0x0},
950: {cur: 0xf5, idx: 0xc7},
951: {cur: 0xf6, idx: 0x590},
952: {cur: 0xf9, idx: 0x0},
953: {cur: 0x102, idx: 0x0},
954: {cur: 0x10d, idx: 0x0},
955: {cur: 0xc6, idx: 0x7e},
956: {cur: 0xe8, idx: 0xb8},
957: {cur: 0xf9, idx: 0x4},
958: {cur: 0xc6, idx: 0x0},
959: {cur: 0xff, idx: 0x598},
960: {cur: 0x4, idx: 0x3a5},
961: {cur: 0xe8, idx: 0xb8},
962: {cur: 0xff, idx: 0x59e},
963: {cur: 0x92, idx: 0x4},
964: {cur: 0x92, idx: 0x4},
965: {cur: 0x13, idx: 0xf0},
966: {cur: 0xe8, idx: 0xb8},
967: {cur: 0xf4, idx: 0x24b},
968: {cur: 0x83, idx: 0x25},
969: {cur: 0xf9, idx: 0x4},
970: {cur: 0xf8, idx: 0x2f5},
971: {cur: 0xb8, idx: 0x97},
972: {cur: 0x13, idx: 0xf0},
973: {cur: 0x83, idx: 0x25},
974: {cur: 0x8b, idx: 0x5a5},
975: {cur: 0xf3, idx: 0x4},
976: {cur: 0x13, idx: 0xf0},
977: {cur: 0x42, idx: 0x4a6},
978: {cur: 0x79, idx: 0x5a9},
979: {cur: 0x8b, idx: 0x5a5},
980: {cur: 0x42, idx: 0x20},
981: {cur: 0x42, idx: 0x20},
982: {cur: 0xa8, idx: 0x360},
983: {cur: 0x42, idx: 0x20},
984: {cur: 0xda, idx: 0x4},
985: {cur: 0x13, idx: 0xf0},
986: {cur: 0x83, idx: 0x25},
987: {cur: 0x8b, idx: 0x5a5},
988: {cur: 0xf3, idx: 0x4},
989: {cur: 0x8b, idx: 0x6e},
990: {cur: 0xf3, idx: 0xc3},
991: {cur: 0xa8, idx: 0x360},
992: {cur: 0xe8, idx: 0xb8},
993: {cur: 0x122, idx: 0xe5},
} // Size: 4000 bytes
var narrowLangIndex = []uint16{ // 748 elements
// Entry 0 - 3F
0x0000, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0062, 0x0062,
0x0062, 0x0062, 0x0062, 0x0063, 0x0063, 0x0080, 0x0080, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081,
0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x0081, 0x008a, 0x008a,
0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x008c, 0x00a5,
0x00a5, 0x00a5, 0x00a5, 0x00a5, 0x00a5, 0x00d4, 0x00d4, 0x00d4,
// Entry 40 - 7F
0x00d4, 0x00d4, 0x00d5, 0x00d5, 0x00d5, 0x00d5, 0x00d5, 0x00d5,
0x00d8, 0x00d8, 0x00d8, 0x00d8, 0x00d9, 0x00d9, 0x00d9, 0x00d9,
0x00d9, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3,
0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e3, 0x00e4,
0x00e4, 0x00e4, 0x00e4, 0x00ea, 0x00ea, 0x00ef, 0x00ef, 0x00ef,
0x00ef, 0x00ef, 0x00f7, 0x00f7, 0x00f7, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
// Entry 80 - BF
0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
0x00f8, 0x00f8, 0x00f8, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
// Entry C0 - FF
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0102,
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
// Entry 100 - 13F
0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
0x0108, 0x0108, 0x0109, 0x010a, 0x010a, 0x010b, 0x010b, 0x010b,
0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b, 0x010b,
0x010b, 0x010d, 0x010d, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
// Entry 140 - 17F
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
0x0118, 0x0118, 0x0118, 0x0119, 0x0119, 0x011a, 0x011a, 0x011c,
0x011c, 0x011c, 0x011c, 0x011c, 0x011c, 0x011e, 0x011e, 0x011e,
0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e, 0x011e,
0x011e, 0x011e, 0x011f, 0x011f, 0x0122, 0x0122, 0x0123, 0x0123,
0x0123, 0x0123, 0x0123, 0x0124, 0x0124, 0x0125, 0x0125, 0x0126,
0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0127, 0x0127, 0x012d,
// Entry 180 - 1BF
0x012d, 0x012d, 0x012d, 0x012d, 0x0130, 0x0130, 0x0130, 0x0130,
0x0130, 0x0130, 0x0130, 0x0130, 0x0131, 0x0131, 0x0131, 0x0131,
0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
0x0131, 0x0131, 0x0131, 0x0131, 0x0132, 0x0132, 0x0132, 0x0132,
0x0132, 0x0132, 0x0132, 0x0132, 0x0133, 0x0133, 0x0134, 0x0134,
0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
0x0140, 0x0140, 0x0140, 0x0140, 0x0141, 0x0141, 0x0141, 0x0141,
// Entry 1C0 - 1FF
0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0141, 0x0142,
0x0142, 0x0142, 0x0142, 0x0142, 0x014d, 0x014d, 0x014d, 0x014d,
0x014d, 0x014d, 0x014d, 0x014d, 0x014e, 0x014e, 0x014e, 0x014e,
0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
0x014e, 0x014e, 0x014e, 0x014f, 0x014f, 0x0150, 0x0150, 0x0151,
0x0151, 0x0152, 0x0152, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
0x0153, 0x0153, 0x0153, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154,
0x0154, 0x0154, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
// Entry 200 - 23F
0x0155, 0x0155, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
0x0156, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0158,
0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0159, 0x0159, 0x0159,
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
// Entry 240 - 27F
0x0159, 0x0159, 0x015a, 0x015a, 0x015a, 0x015a, 0x015a, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
0x015d, 0x015d, 0x015e, 0x015e, 0x015f, 0x015f, 0x015f, 0x015f,
0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f,
0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x015f, 0x0161,
// Entry 280 - 2BF
0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0164, 0x0164, 0x0164,
0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0166, 0x0166, 0x0166,
0x0166, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0168,
0x0168, 0x0168, 0x0168, 0x0168, 0x0169, 0x0169, 0x0169, 0x0169,
0x0169, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a, 0x016a,
0x016a, 0x016a, 0x016a, 0x016a, 0x016b, 0x016b, 0x016b, 0x016b,
0x016b, 0x016b, 0x016b, 0x016b, 0x016b, 0x016b, 0x016c, 0x016c,
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
// Entry 2C0 - 2FF
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e, 0x016e,
0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f, 0x016f,
0x016f, 0x016f, 0x0177, 0x0177,
} // Size: 1520 bytes
var narrowSymIndex = []curToIndex{ // 375 elements
0: {cur: 0x9, idx: 0x1},
1: {cur: 0x11, idx: 0x4},
2: {cur: 0x13, idx: 0x4},
3: {cur: 0x18, idx: 0x9},
4: {cur: 0x1a, idx: 0x4},
5: {cur: 0x1b, idx: 0xc},
6: {cur: 0x25, idx: 0x4},
7: {cur: 0x26, idx: 0x4},
8: {cur: 0x27, idx: 0x10},
9: {cur: 0x2e, idx: 0x13},
10: {cur: 0x32, idx: 0x4},
11: {cur: 0x35, idx: 0x16},
12: {cur: 0x37, idx: 0x18},
13: {cur: 0x38, idx: 0x4},
14: {cur: 0x39, idx: 0x4},
15: {cur: 0x40, idx: 0x4},
16: {cur: 0x42, idx: 0x25},
17: {cur: 0x43, idx: 0x4},
18: {cur: 0x45, idx: 0x28},
19: {cur: 0x48, idx: 0x4},
20: {cur: 0x49, idx: 0x4},
21: {cur: 0x4c, idx: 0x2c},
22: {cur: 0x50, idx: 0x30},
23: {cur: 0x51, idx: 0x4},
24: {cur: 0x56, idx: 0x33},
25: {cur: 0x5a, idx: 0x37},
26: {cur: 0x5c, idx: 0x3b},
27: {cur: 0x5e, idx: 0x4},
28: {cur: 0x5f, idx: 0x3f},
29: {cur: 0x61, idx: 0x3f},
30: {cur: 0x63, idx: 0x42},
31: {cur: 0x66, idx: 0x3f},
32: {cur: 0x68, idx: 0x46},
33: {cur: 0x6c, idx: 0x49},
34: {cur: 0x6f, idx: 0x4},
35: {cur: 0x70, idx: 0x4},
36: {cur: 0x71, idx: 0x4f},
37: {cur: 0x73, idx: 0x51},
38: {cur: 0x75, idx: 0x54},
39: {cur: 0x76, idx: 0x57},
40: {cur: 0x7a, idx: 0x5a},
41: {cur: 0x7b, idx: 0x5e},
42: {cur: 0x7f, idx: 0x30},
43: {cur: 0x81, idx: 0x4},
44: {cur: 0x83, idx: 0x25},
45: {cur: 0x86, idx: 0x67},
46: {cur: 0x87, idx: 0x6b},
47: {cur: 0x88, idx: 0x6e},
48: {cur: 0x8b, idx: 0x6e},
49: {cur: 0x8d, idx: 0x4},
50: {cur: 0x8e, idx: 0x72},
51: {cur: 0x8f, idx: 0x76},
52: {cur: 0x90, idx: 0x7a},
53: {cur: 0x91, idx: 0x7e},
54: {cur: 0x92, idx: 0x4},
55: {cur: 0x94, idx: 0x81},
56: {cur: 0x99, idx: 0x84},
57: {cur: 0xa1, idx: 0x87},
58: {cur: 0xa6, idx: 0x8a},
59: {cur: 0xa7, idx: 0x8c},
60: {cur: 0xac, idx: 0x7e},
61: {cur: 0xb0, idx: 0x4},
62: {cur: 0xb3, idx: 0x94},
63: {cur: 0xb7, idx: 0x4},
64: {cur: 0xb8, idx: 0x97},
65: {cur: 0xba, idx: 0x9b},
66: {cur: 0xbc, idx: 0x30},
67: {cur: 0xbd, idx: 0x7e},
68: {cur: 0xbe, idx: 0x4},
69: {cur: 0xc5, idx: 0xa2},
70: {cur: 0xc6, idx: 0x7e},
71: {cur: 0xc7, idx: 0xa6},
72: {cur: 0xca, idx: 0xaa},
73: {cur: 0xd0, idx: 0xae},
74: {cur: 0xd1, idx: 0x18},
75: {cur: 0xd2, idx: 0xb2},
76: {cur: 0xd4, idx: 0x4},
77: {cur: 0xd9, idx: 0x30},
78: {cur: 0xda, idx: 0x4},
79: {cur: 0xdb, idx: 0x3f},
80: {cur: 0xe0, idx: 0x4},
81: {cur: 0xe2, idx: 0x3f},
82: {cur: 0xe3, idx: 0xb5},
83: {cur: 0xe6, idx: 0x3f},
84: {cur: 0xe8, idx: 0xb8},
85: {cur: 0xee, idx: 0xbc},
86: {cur: 0xf1, idx: 0xbf},
87: {cur: 0xf2, idx: 0x4},
88: {cur: 0xf3, idx: 0x4},
89: {cur: 0xf5, idx: 0xc7},
90: {cur: 0xf9, idx: 0x4},
91: {cur: 0xfe, idx: 0x4},
92: {cur: 0x101, idx: 0x10},
93: {cur: 0x102, idx: 0xcf},
94: {cur: 0x10d, idx: 0x4},
95: {cur: 0x122, idx: 0xe5},
96: {cur: 0x124, idx: 0xe7},
97: {cur: 0xf3, idx: 0xc3},
98: {cur: 0xf3, idx: 0xc3},
99: {cur: 0x11, idx: 0x109},
100: {cur: 0x13, idx: 0xf0},
101: {cur: 0x1a, idx: 0x10d},
102: {cur: 0x25, idx: 0x11b},
103: {cur: 0x26, idx: 0x11f},
104: {cur: 0x32, idx: 0x123},
105: {cur: 0x38, idx: 0x127},
106: {cur: 0x39, idx: 0x1c},
107: {cur: 0x40, idx: 0x12b},
108: {cur: 0x42, idx: 0x20},
109: {cur: 0x43, idx: 0x12f},
110: {cur: 0x49, idx: 0x133},
111: {cur: 0x51, idx: 0x137},
112: {cur: 0x5e, idx: 0x14f},
113: {cur: 0x61, idx: 0x153},
114: {cur: 0x6f, idx: 0x158},
115: {cur: 0x70, idx: 0x4b},
116: {cur: 0x81, idx: 0x176},
117: {cur: 0x83, idx: 0x62},
118: {cur: 0x8d, idx: 0x19b},
119: {cur: 0xb0, idx: 0x90},
120: {cur: 0xbe, idx: 0x9e},
121: {cur: 0xd4, idx: 0x1ec},
122: {cur: 0xe0, idx: 0x201},
123: {cur: 0xe2, idx: 0x205},
124: {cur: 0xf2, idx: 0x22a},
125: {cur: 0xf3, idx: 0xc3},
126: {cur: 0xf9, idx: 0xcb},
127: {cur: 0xfe, idx: 0x22e},
128: {cur: 0x26, idx: 0x4},
129: {cur: 0x37, idx: 0x0},
130: {cur: 0x50, idx: 0x0},
131: {cur: 0x73, idx: 0x0},
132: {cur: 0x7f, idx: 0x0},
133: {cur: 0xbc, idx: 0x0},
134: {cur: 0xc7, idx: 0x0},
135: {cur: 0xd1, idx: 0x0},
136: {cur: 0xd9, idx: 0x0},
137: {cur: 0xf3, idx: 0xc3},
138: {cur: 0xe6, idx: 0x253},
139: {cur: 0xf3, idx: 0xc3},
140: {cur: 0x13, idx: 0x6},
141: {cur: 0x1a, idx: 0x257},
142: {cur: 0x25, idx: 0x25c},
143: {cur: 0x32, idx: 0x260},
144: {cur: 0x38, idx: 0x127},
145: {cur: 0x39, idx: 0x1c},
146: {cur: 0x48, idx: 0x263},
147: {cur: 0x49, idx: 0x268},
148: {cur: 0x51, idx: 0x26c},
149: {cur: 0x5e, idx: 0x14f},
150: {cur: 0x5f, idx: 0x270},
151: {cur: 0x6f, idx: 0x275},
152: {cur: 0x7f, idx: 0x278},
153: {cur: 0x81, idx: 0x27d},
154: {cur: 0x8d, idx: 0x280},
155: {cur: 0x92, idx: 0x284},
156: {cur: 0xb0, idx: 0x90},
157: {cur: 0xb7, idx: 0x287},
158: {cur: 0xbe, idx: 0x9e},
159: {cur: 0xd0, idx: 0x28a},
160: {cur: 0xd4, idx: 0x292},
161: {cur: 0xda, idx: 0x296},
162: {cur: 0xf2, idx: 0x22a},
163: {cur: 0xfe, idx: 0x299},
164: {cur: 0x10d, idx: 0xd8},
165: {cur: 0x11, idx: 0x0},
166: {cur: 0x13, idx: 0x0},
167: {cur: 0x1a, idx: 0x0},
168: {cur: 0x1b, idx: 0x0},
169: {cur: 0x25, idx: 0x0},
170: {cur: 0x26, idx: 0x0},
171: {cur: 0x2e, idx: 0x0},
172: {cur: 0x32, idx: 0x0},
173: {cur: 0x37, idx: 0x0},
174: {cur: 0x38, idx: 0x0},
175: {cur: 0x39, idx: 0x0},
176: {cur: 0x40, idx: 0x0},
177: {cur: 0x42, idx: 0x0},
178: {cur: 0x43, idx: 0x0},
179: {cur: 0x45, idx: 0x0},
180: {cur: 0x49, idx: 0x0},
181: {cur: 0x51, idx: 0x0},
182: {cur: 0x5e, idx: 0x0},
183: {cur: 0x66, idx: 0x0},
184: {cur: 0x6f, idx: 0x0},
185: {cur: 0x70, idx: 0x0},
186: {cur: 0x7a, idx: 0x0},
187: {cur: 0x7b, idx: 0x0},
188: {cur: 0x81, idx: 0x0},
189: {cur: 0x86, idx: 0x0},
190: {cur: 0x8b, idx: 0x0},
191: {cur: 0x8d, idx: 0x0},
192: {cur: 0x8e, idx: 0x0},
193: {cur: 0x8f, idx: 0x0},
194: {cur: 0x92, idx: 0x0},
195: {cur: 0xa7, idx: 0x0},
196: {cur: 0xb0, idx: 0x0},
197: {cur: 0xb7, idx: 0x0},
198: {cur: 0xb8, idx: 0x0},
199: {cur: 0xbe, idx: 0x0},
200: {cur: 0xc5, idx: 0x0},
201: {cur: 0xca, idx: 0x0},
202: {cur: 0xd4, idx: 0x0},
203: {cur: 0xda, idx: 0x0},
204: {cur: 0xe0, idx: 0x0},
205: {cur: 0xe2, idx: 0x0},
206: {cur: 0xf1, idx: 0x0},
207: {cur: 0xf2, idx: 0x0},
208: {cur: 0xf3, idx: 0x0},
209: {cur: 0xf5, idx: 0x0},
210: {cur: 0xfe, idx: 0x0},
211: {cur: 0x102, idx: 0x0},
212: {cur: 0xf3, idx: 0xc3},
213: {cur: 0x56, idx: 0x2b0},
214: {cur: 0x90, idx: 0x2c0},
215: {cur: 0xee, idx: 0x2c9},
216: {cur: 0xf3, idx: 0xc3},
217: {cur: 0x9, idx: 0x0},
218: {cur: 0x27, idx: 0x0},
219: {cur: 0x50, idx: 0x0},
220: {cur: 0x6c, idx: 0x0},
221: {cur: 0x71, idx: 0x0},
222: {cur: 0x7f, idx: 0x0},
223: {cur: 0xbc, idx: 0x0},
224: {cur: 0xd9, idx: 0x0},
225: {cur: 0xe3, idx: 0x0},
226: {cur: 0x101, idx: 0x0},
227: {cur: 0xf3, idx: 0xc3},
228: {cur: 0x1b, idx: 0x302},
229: {cur: 0x35, idx: 0x0},
230: {cur: 0x70, idx: 0x4b},
231: {cur: 0xf3, idx: 0xc3},
232: {cur: 0x122, idx: 0x0},
233: {cur: 0x124, idx: 0x0},
234: {cur: 0x50, idx: 0x305},
235: {cur: 0x7f, idx: 0x305},
236: {cur: 0xbc, idx: 0x305},
237: {cur: 0xd9, idx: 0x305},
238: {cur: 0xf3, idx: 0xc3},
239: {cur: 0x48, idx: 0x319},
240: {cur: 0x5f, idx: 0x321},
241: {cur: 0x68, idx: 0x326},
242: {cur: 0x87, idx: 0x32b},
243: {cur: 0xd2, idx: 0x32e},
244: {cur: 0xe6, idx: 0x0},
245: {cur: 0xf3, idx: 0xc3},
246: {cur: 0x124, idx: 0x8a},
247: {cur: 0x5c, idx: 0x0},
248: {cur: 0x1b, idx: 0x34a},
249: {cur: 0x27, idx: 0x34d},
250: {cur: 0x49, idx: 0xa2},
251: {cur: 0x56, idx: 0x3f},
252: {cur: 0x7f, idx: 0x350},
253: {cur: 0xca, idx: 0x353},
254: {cur: 0xd9, idx: 0x350},
255: {cur: 0xfe, idx: 0x299},
256: {cur: 0x56, idx: 0x0},
257: {cur: 0xf3, idx: 0xc3},
258: {cur: 0x56, idx: 0x33},
259: {cur: 0x101, idx: 0x37c},
260: {cur: 0x11, idx: 0x387},
261: {cur: 0x37, idx: 0x38f},
262: {cur: 0x51, idx: 0x26c},
263: {cur: 0xf1, idx: 0x392},
264: {cur: 0x101, idx: 0x3a1},
265: {cur: 0xf3, idx: 0xc3},
266: {cur: 0xf3, idx: 0xc3},
267: {cur: 0xf3, idx: 0xc3},
268: {cur: 0xfe, idx: 0x299},
269: {cur: 0xf3, idx: 0xc3},
270: {cur: 0x56, idx: 0x3f4},
271: {cur: 0x87, idx: 0x32b},
272: {cur: 0x90, idx: 0x2c0},
273: {cur: 0xba, idx: 0x429},
274: {cur: 0xd2, idx: 0x430},
275: {cur: 0xf3, idx: 0xc3},
276: {cur: 0x124, idx: 0x450},
277: {cur: 0x87, idx: 0x6b},
278: {cur: 0xba, idx: 0x9b},
279: {cur: 0x124, idx: 0xe7},
280: {cur: 0xf3, idx: 0xc3},
281: {cur: 0xf3, idx: 0xc3},
282: {cur: 0x2e, idx: 0x47c},
283: {cur: 0xf3, idx: 0xc3},
284: {cur: 0xac, idx: 0x488},
285: {cur: 0xf3, idx: 0xc3},
286: {cur: 0xf3, idx: 0xc3},
287: {cur: 0xac, idx: 0x497},
288: {cur: 0xc6, idx: 0x497},
289: {cur: 0xf3, idx: 0xc3},
290: {cur: 0xf3, idx: 0xc3},
291: {cur: 0xf3, idx: 0xc3},
292: {cur: 0xf3, idx: 0xc3},
293: {cur: 0xf3, idx: 0xc3},
294: {cur: 0xf3, idx: 0xc3},
295: {cur: 0x27, idx: 0x34d},
296: {cur: 0x37, idx: 0x38f},
297: {cur: 0x48, idx: 0x263},
298: {cur: 0x56, idx: 0x3f4},
299: {cur: 0xbc, idx: 0x49e},
300: {cur: 0xf3, idx: 0xc3},
301: {cur: 0x42, idx: 0x4a6},
302: {cur: 0x83, idx: 0x4a6},
303: {cur: 0xf3, idx: 0xc3},
304: {cur: 0xf3, idx: 0xc3},
305: {cur: 0xf3, idx: 0xc3},
306: {cur: 0xf3, idx: 0xc3},
307: {cur: 0xf3, idx: 0xc3},
308: {cur: 0xf3, idx: 0xc3},
309: {cur: 0x25, idx: 0x25c},
310: {cur: 0x32, idx: 0x260},
311: {cur: 0x38, idx: 0x127},
312: {cur: 0x39, idx: 0x9b},
313: {cur: 0x51, idx: 0x26c},
314: {cur: 0x56, idx: 0x4b9},
315: {cur: 0x70, idx: 0x4b},
316: {cur: 0x73, idx: 0x4bc},
317: {cur: 0x81, idx: 0x27d},
318: {cur: 0xf2, idx: 0x22a},
319: {cur: 0xf3, idx: 0xc3},
320: {cur: 0xf3, idx: 0xc3},
321: {cur: 0xf3, idx: 0xc3},
322: {cur: 0x1b, idx: 0x0},
323: {cur: 0x37, idx: 0x38f},
324: {cur: 0x7a, idx: 0x0},
325: {cur: 0x7b, idx: 0x0},
326: {cur: 0x86, idx: 0x0},
327: {cur: 0x8f, idx: 0x0},
328: {cur: 0xa7, idx: 0x0},
329: {cur: 0xc7, idx: 0x4c6},
330: {cur: 0xca, idx: 0x353},
331: {cur: 0xd0, idx: 0x4c9},
332: {cur: 0x102, idx: 0x0},
333: {cur: 0xf3, idx: 0xc3},
334: {cur: 0xf3, idx: 0xc3},
335: {cur: 0xf3, idx: 0xc3},
336: {cur: 0xf3, idx: 0xc3},
337: {cur: 0xf3, idx: 0xc3},
338: {cur: 0xf3, idx: 0xc3},
339: {cur: 0x38, idx: 0x4d7},
340: {cur: 0xf3, idx: 0xc3},
341: {cur: 0xf3, idx: 0xc3},
342: {cur: 0xf3, idx: 0xc3},
343: {cur: 0xf3, idx: 0xc3},
344: {cur: 0xf3, idx: 0xc3},
345: {cur: 0xf3, idx: 0xc3},
346: {cur: 0xf3, idx: 0xc3},
347: {cur: 0x91, idx: 0x531},
348: {cur: 0xf3, idx: 0xc3},
349: {cur: 0xf3, idx: 0xc3},
350: {cur: 0xf3, idx: 0xc3},
351: {cur: 0xd0, idx: 0x563},
352: {cur: 0xf3, idx: 0xc3},
353: {cur: 0x37, idx: 0x56a},
354: {cur: 0xd0, idx: 0x56d},
355: {cur: 0xf3, idx: 0xc3},
356: {cur: 0x5a, idx: 0x0},
357: {cur: 0xf3, idx: 0xc3},
358: {cur: 0xf3, idx: 0xc3},
359: {cur: 0xf3, idx: 0xc3},
360: {cur: 0xf3, idx: 0xc3},
361: {cur: 0xf3, idx: 0xc3},
362: {cur: 0xf3, idx: 0xc3},
363: {cur: 0xf3, idx: 0xc3},
364: {cur: 0xf3, idx: 0xc3},
365: {cur: 0xf3, idx: 0xc3},
366: {cur: 0xf3, idx: 0xc3},
367: {cur: 0x37, idx: 0x5ad},
368: {cur: 0x50, idx: 0x350},
369: {cur: 0x73, idx: 0x4bc},
370: {cur: 0x7f, idx: 0x350},
371: {cur: 0xbc, idx: 0x350},
372: {cur: 0xc7, idx: 0x5b0},
373: {cur: 0xd9, idx: 0x350},
374: {cur: 0xf3, idx: 0xc3},
} // Size: 1524 bytes
// Total table size 18192 bytes (17KiB); checksum: 61A71530
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2011, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef _LIBROOT_MEMORY_PRIVATE_H
#define _LIBROOT_MEMORY_PRIVATE_H
#include <OS.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
status_t get_memory_properties(team_id teamID, const void* address,
uint32* _protected, uint32* _lock);
__END_DECLS
#endif // _LIBROOT_MEMORY_PRIVATE_H
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @author Lajos Molnár <lajax.m@gmail.com>
*
* @since 1.0
*/
namespace lajax\translatemanager\models;
use Yii;
/**
* This is the model class for table "language_translate".
*
* @property string $id
* @property string $language
* @property string $translation
* @property LanguageSource $LanguageSource
* @property Language $language0
*/
class LanguageTranslate extends \yii\db\ActiveRecord
{
/**
* @var int Number of translated language elements.
*/
public $cnt;
/**
* @inheritdoc
*/
public static function getDb()
{
$dbMessageSources = Yii::getObjectVars(Yii::$app->i18n->getMessageSource('DbMessageSource'));
return $dbMessageSources['db'];
}
/**
* @inheritdoc
*/
public static function tableName()
{
$dbMessageSources = Yii::getObjectVars(Yii::$app->i18n->getMessageSource('DbMessageSource'));
return isset($dbMessageSources['messageTable']) ? $dbMessageSources['messageTable'] : '{{%message}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'language'], 'required'],
[['id'], 'integer'],
[['id'], 'exist', 'targetClass' => '\lajax\translatemanager\models\LanguageSource'],
[['language'], 'exist', 'targetClass' => '\lajax\translatemanager\models\Language', 'targetAttribute' => 'language_id'],
[['translation'], 'string'],
[['language'], 'string', 'max' => 5],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('model', 'ID'),
'language' => Yii::t('model', 'Language'),
'translation' => Yii::t('model', 'Translation'),
];
}
/**
* Returnes language object by id and language_id. If not found, creates a new one.
*
* @param int $id LanguageSource id
* @param string $languageId Language language_id
*
* @return LanguageTranslate
*
* @deprecated since version 1.2.7
*/
public static function getLanguageTranslateByIdAndLanguageId($id, $languageId)
{
$languageTranslate = self::findOne(['id' => $id, 'language' => $languageId]);
if (!$languageTranslate) {
$languageTranslate = new self([
'id' => $id,
'language' => $languageId,
]);
}
return $languageTranslate;
}
/**
* @return array The name of languages the language element has been translated into.
*/
public function getTranslatedLanguageNames()
{
$translatedLanguages = $this->getTranslatedLanguages();
$data = [];
foreach ($translatedLanguages as $languageTranslate) {
$data[$languageTranslate->language] = $languageTranslate->getLanguageName();
}
return $data;
}
/**
* Returns the language element in all other languages.
*
* @return LanguageTranslate[]
*/
public function getTranslatedLanguages()
{
return static::find()->where('id = :id AND language != :language', [':id' => $this->id, 'language' => $this->language])->all();
}
/**
* @staticvar array $language_names caching the list of languages.
*
* @return string
*/
public function getLanguageName()
{
static $language_names;
if (!$language_names || empty($language_names[$this->language])) {
$language_names = Language::getLanguageNames();
}
return empty($language_names[$this->language]) ? $this->language : $language_names[$this->language];
}
/**
* @return \yii\db\ActiveQuery
*
* @deprecated since version 1.4.5
*/
public function getId0()
{
return $this->hasOne(LanguageSource::className(), ['id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLanguageSource()
{
return $this->hasOne(LanguageSource::className(), ['id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLanguage0()
{
return $this->hasOne(Language::className(), ['language_id' => 'language']);
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package pkcs12
import (
"errors"
"unicode/utf16"
)
// bmpString returns s encoded in UCS-2 with a zero terminator.
func bmpString(s string) ([]byte, error) {
// References:
// https://tools.ietf.org/html/rfc7292#appendix-B.1
// https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
// - non-BMP characters are encoded in UTF 16 by using a surrogate pair of 16-bit codes
// EncodeRune returns 0xfffd if the rune does not need special encoding
// - the above RFC provides the info that BMPStrings are NULL terminated.
ret := make([]byte, 0, 2*len(s)+2)
for _, r := range s {
if t, _ := utf16.EncodeRune(r); t != 0xfffd {
return nil, errors.New("pkcs12: string contains characters that cannot be encoded in UCS-2")
}
ret = append(ret, byte(r/256), byte(r%256))
}
return append(ret, 0, 0), nil
}
func decodeBMPString(bmpString []byte) (string, error) {
if len(bmpString)%2 != 0 {
return "", errors.New("pkcs12: odd-length BMP string")
}
// strip terminator if present
if l := len(bmpString); l >= 2 && bmpString[l-1] == 0 && bmpString[l-2] == 0 {
bmpString = bmpString[:l-2]
}
s := make([]uint16, 0, len(bmpString)/2)
for len(bmpString) > 0 {
s = append(s, uint16(bmpString[0])<<8+uint16(bmpString[1]))
bmpString = bmpString[2:]
}
return string(utf16.Decode(s)), nil
}
|
{
"pile_set_name": "Github"
}
|
# GENERATED VERSION FILE
# TIME: Sun May 24 21:24:18 2020
__version__ = '1.0.rc0'
short_version = '1.0.rc0'
|
{
"pile_set_name": "Github"
}
|
export class KeyboardControls {
constructor(visualizer, bindings) {
this.visualizer = visualizer;
this.keyState = {};
this.keyBindings = bindings;
this.el = null;
this._onKeyUp = null;
this._onKeyDown = null;
}
attach(el) {
if (!el) el = document.body;
this.el = el;
// Make element focusable
el.querySelector("canvas").setAttribute("tabindex", 0);
this._onKeyUp = (e) => {
if (document.activeElement.tagName == "INPUT") return;
if (typeof this.keyBindings[e.code] !== "undefined") {
const event = this.keyBindings[e.code];
if (typeof event === "function") {
event();
}
else {
this.keyState[event] = false;
if (!this.visualizer.isPlaying() &&
Object.values(this.keyState).every((v) => !v)) {
}
}
e.preventDefault();
}
};
this._onKeyDown = (e) => {
if (document.activeElement.tagName == "INPUT") return;
if (typeof this.keyBindings[e.code] !== "undefined") {
const event = this.keyBindings[e.code];
if (typeof event !== "function") {
this.keyState[event] = true;
if (!this.visualizer.isPlaying()) {
// Run the Pixi event loop while keys are down
this.visualizer.application.start();
}
}
e.preventDefault();
}
};
el.addEventListener("keyup", this._onKeyUp);
el.addEventListener("keydown", this._onKeyDown);
}
destroy() {
this.el.removeEventListener("keyup", this._onKeyUp);
this.el.removeEventListener("keydown", this._onKeyDown);
this.visualizer = null;
}
handleKeys(dt) {
dt *= this.visualizer.timeStep * this.visualizer.scrubSpeed * 50;
if (this.keyState["scrubBackwards"]) {
this.visualizer.pause();
this.visualizer.advanceTime(-dt);
this.visualizer.render();
}
else if (this.keyState["scrubForwards"]) {
this.visualizer.pause();
this.visualizer.advanceTime(dt);
this.visualizer.render(dt);
}
if (this.keyState["panUp"]) {
this.visualizer.camera.panBy(0, 1);
}
else if (this.keyState["panDown"]) {
this.visualizer.camera.panBy(0, -1);
}
if (this.keyState["panLeft"]) {
this.visualizer.camera.panBy(1, 0);
}
else if (this.keyState["panRight"]) {
this.visualizer.camera.panBy(-1, 0);
}
if (this.keyState["zoomIn"]) {
this.visualizer.camera.zoomBy(0.5, 0.5, dt);
}
else if (this.keyState["zoomOut"]) {
this.visualizer.camera.zoomBy(0.5, 0.5, -dt);
}
}
}
|
{
"pile_set_name": "Github"
}
|
export function union<T>(...sets: Set<T>[]): Set<T> {
const result = new Set<T>()
for (const set of sets) {
for (const item of set) {
result.add(item)
}
}
return result
}
export function intersection<T>(set: Set<T>, ...sets: Set<T>[]): Set<T> {
const result = new Set<T>()
top: for (const item of set) {
for (const other of sets) {
if (!other.has(item))
continue top
}
result.add(item)
}
return result
}
export function difference<T>(set: Set<T>, ...sets: Set<T>[]): Set<T> {
const result = new Set<T>(set)
for (const item of union(...sets)) {
result.delete(item)
}
return result
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 com.amazonaws.services.rekognition.model.transform;
import com.amazonaws.services.rekognition.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.json.AwsJsonReader;
/**
* JSON unmarshaller for POJO Emotion
*/
class EmotionJsonUnmarshaller implements Unmarshaller<Emotion, JsonUnmarshallerContext> {
public Emotion unmarshall(JsonUnmarshallerContext context) throws Exception {
AwsJsonReader reader = context.getReader();
if (!reader.isContainer()) {
reader.skipValue();
return null;
}
Emotion emotion = new Emotion();
reader.beginObject();
while (reader.hasNext()) {
String name = reader.nextName();
if (name.equals("Type")) {
emotion.setType(StringJsonUnmarshaller.getInstance()
.unmarshall(context));
} else if (name.equals("Confidence")) {
emotion.setConfidence(FloatJsonUnmarshaller.getInstance()
.unmarshall(context));
} else {
reader.skipValue();
}
}
reader.endObject();
return emotion;
}
private static EmotionJsonUnmarshaller instance;
public static EmotionJsonUnmarshaller getInstance() {
if (instance == null)
instance = new EmotionJsonUnmarshaller();
return instance;
}
}
|
{
"pile_set_name": "Github"
}
|
/*=============================================================================
Copyright (c) 2011 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED)
#define BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct accumulate;
}
template <typename Sequence, typename State, typename F>
BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
, result_of::accumulate<Sequence, State const, F>
>::type
accumulate(Sequence& seq, State const& state, F f);
template <typename Sequence, typename State, typename F>
BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
, result_of::accumulate<Sequence const, State const, F>
>::type
accumulate(Sequence const& seq, State const& state, F f);
}}
#endif
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include "../../../util/debug.h"
#include "../../../util/header.h"
static inline void
cpuid(unsigned int op, unsigned int *a, unsigned int *b, unsigned int *c,
unsigned int *d)
{
__asm__ __volatile__ (".byte 0x53\n\tcpuid\n\t"
"movl %%ebx, %%esi\n\t.byte 0x5b"
: "=a" (*a),
"=S" (*b),
"=c" (*c),
"=d" (*d)
: "a" (op));
}
static int
__get_cpuid(char *buffer, size_t sz, const char *fmt)
{
unsigned int a, b, c, d, lvl;
int family = -1, model = -1, step = -1;
int nb;
char vendor[16];
cpuid(0, &lvl, &b, &c, &d);
strncpy(&vendor[0], (char *)(&b), 4);
strncpy(&vendor[4], (char *)(&d), 4);
strncpy(&vendor[8], (char *)(&c), 4);
vendor[12] = '\0';
if (lvl >= 1) {
cpuid(1, &a, &b, &c, &d);
family = (a >> 8) & 0xf; /* bits 11 - 8 */
model = (a >> 4) & 0xf; /* Bits 7 - 4 */
step = a & 0xf;
/* extended family */
if (family == 0xf)
family += (a >> 20) & 0xff;
/* extended model */
if (family >= 0x6)
model += ((a >> 16) & 0xf) << 4;
}
nb = scnprintf(buffer, sz, fmt, vendor, family, model, step);
/* look for end marker to ensure the entire data fit */
if (strchr(buffer, '$')) {
buffer[nb-1] = '\0';
return 0;
}
return ENOBUFS;
}
int
get_cpuid(char *buffer, size_t sz)
{
return __get_cpuid(buffer, sz, "%s,%u,%u,%u$");
}
char *
get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
{
char *buf = malloc(128);
if (buf && __get_cpuid(buf, 128, "%s-%u-%X-%X$") < 0) {
free(buf);
return NULL;
}
return buf;
}
/* Full CPUID format for x86 is vendor-family-model-stepping */
static bool is_full_cpuid(const char *id)
{
const char *tmp = id;
int count = 0;
while ((tmp = strchr(tmp, '-')) != NULL) {
count++;
tmp++;
}
if (count == 3)
return true;
return false;
}
int strcmp_cpuid_str(const char *mapcpuid, const char *id)
{
regex_t re;
regmatch_t pmatch[1];
int match;
bool full_mapcpuid = is_full_cpuid(mapcpuid);
bool full_cpuid = is_full_cpuid(id);
/*
* Full CPUID format is required to identify a platform.
* Error out if the cpuid string is incomplete.
*/
if (full_mapcpuid && !full_cpuid) {
pr_info("Invalid CPUID %s. Full CPUID is required, "
"vendor-family-model-stepping\n", id);
return 1;
}
if (regcomp(&re, mapcpuid, REG_EXTENDED) != 0) {
/* Warn unable to generate match particular string. */
pr_info("Invalid regular expression %s\n", mapcpuid);
return 1;
}
match = !regexec(&re, id, 1, pmatch, 0);
regfree(&re);
if (match) {
size_t match_len = (pmatch[0].rm_eo - pmatch[0].rm_so);
size_t cpuid_len;
/* If the full CPUID format isn't required,
* ignoring the stepping.
*/
if (!full_mapcpuid && full_cpuid)
cpuid_len = strrchr(id, '-') - id;
else
cpuid_len = strlen(id);
/* Verify the entire string matched. */
if (match_len == cpuid_len)
return 0;
}
return 1;
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.