max_stars_count
int64
301
224k
text
stringlengths
6
1.05M
token_count
int64
3
727k
4,283
/* * Copyright (c) 2008-2021, Hazelcast, 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. */ package com.hazelcast.aws; import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.hazelcast.aws.AwsEcsApi.Task; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import java.time.Clock; import java.time.Instant; import java.time.ZoneId; import java.util.List; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static java.util.Arrays.asList; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItems; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.mockito.BDDMockito.given; import static org.mockito.Matchers.any; @RunWith(MockitoJUnitRunner.class) public class AwsEcsApiTest { private static final Clock CLOCK = Clock.fixed(Instant.ofEpochMilli(1585909518929L), ZoneId.systemDefault()); private static final String AUTHORIZATION_HEADER = "authorization-header"; private static final String TOKEN = "<KEY>; private static final AwsCredentials CREDENTIALS = AwsCredentials.builder() .setAccessKey("AKIDEXAMPLE") .setSecretKey("<KEY>") .setToken(TOKEN) .build(); @Mock private AwsRequestSigner requestSigner; private String endpoint; private AwsEcsApi awsEcsApi; @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); @Before public void setUp() { given(requestSigner.authHeader(any(), any(), any(), any(), any(), any())).willReturn(AUTHORIZATION_HEADER); endpoint = String.format("http://localhost:%s", wireMockRule.port()); AwsConfig awsConfig = AwsConfig.builder().build(); awsEcsApi = new AwsEcsApi(endpoint, awsConfig, requestSigner, CLOCK); } @Test public void listTasks() { // given String cluster = "arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster"; //language=JSON String requestBody = "{\n" + " \"cluster\": \"arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster\"\n" + "}"; //language=JSON String response = "{\n" + " \"taskArns\": [\n" + " \"arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a\",\n" + " \"arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207\"\n" + " ]\n" + "}"; stubFor(post("/") .withHeader("X-Amz-Date", equalTo("20200403T102518Z")) .withHeader("Authorization", equalTo(AUTHORIZATION_HEADER)) .withHeader("X-Amz-Target", equalTo("AmazonEC2ContainerServiceV20141113.ListTasks")) .withHeader("Content-Type", equalTo("application/x-amz-json-1.1")) .withHeader("Accept-Encoding", equalTo("identity")) .withHeader("X-Amz-Security-Token", equalTo(TOKEN)) .withRequestBody(equalToJson(requestBody)) .willReturn(aResponse().withStatus(200).withBody(response))); // when List<String> tasks = awsEcsApi.listTasks(cluster, CREDENTIALS); // then assertThat(tasks, hasItems( "arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a", "arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207" ) ); } @Test public void listTasksFiltered() { // given String cluster = "arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster"; AwsConfig awsConfig = AwsConfig.builder() .setFamily("family-name") .build(); AwsEcsApi awsEcsApi = new AwsEcsApi(endpoint, awsConfig, requestSigner, CLOCK); //language=JSON String requestBody = "{\n" + " \"cluster\": \"arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster\",\n" + " \"family\": \"family-name\"\n" + "}"; //language=JSON String response = "{\n" + " \"taskArns\": [\n" + " \"arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a\",\n" + " \"arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207\"\n" + " ]\n" + "}"; stubFor(post("/") .withHeader("X-Amz-Date", equalTo("20200403T102518Z")) .withHeader("Authorization", equalTo(AUTHORIZATION_HEADER)) .withHeader("X-Amz-Target", equalTo("AmazonEC2ContainerServiceV20141113.ListTasks")) .withHeader("Content-Type", equalTo("application/x-amz-json-1.1")) .withHeader("Accept-Encoding", equalTo("identity")) .withHeader("X-Amz-Security-Token", equalTo(TOKEN)) .withRequestBody(equalToJson(requestBody)) .willReturn(aResponse().withStatus(200).withBody(response))); // when List<String> tasks = awsEcsApi.listTasks(cluster, CREDENTIALS); // then assertThat(tasks, hasItems( "arn:aws:ecs:us-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a", "arn:aws:ecs:us-east-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207" ) ); } @Test public void describeTasks() { // given String cluster = "arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster"; List<String> tasks = asList( "arn:aws:ecs:eu-central-1-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a", "arn:aws:ecs:eu-central-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207" ); //language=JSON String requestBody = "{\n" + " \"cluster\" : \"arn:aws:ecs:eu-central-1:665466731577:cluster/rafal-test-cluster\",\n" + " \"tasks\": [\n" + " \"arn:aws:ecs:eu-central-1-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a\",\n" + " \"arn:aws:ecs:eu-central-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207\"\n" + " ]\n" + "}"; //language=JSON String response = "{\n" + " \"tasks\": [\n" + " {\n" + " \"taskArn\": \"arn:aws:ecs:eu-central-1-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a\",\n" + " \"availabilityZone\": \"eu-central-1a\",\n" + " \"containers\": [\n" + " {\n" + " \"taskArn\": \"arn:aws:ecs:eu-central-1-east-1:012345678910:task/0b69d5c0-d655-4695-98cd-5d2d526d9d5a\",\n" + " \"networkInterfaces\": [\n" + " {\n" + " \"privateIpv4Address\": \"10.0.1.16\"\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + " },\n" + " {\n" + " \"taskArn\": \"arn:aws:ecs:eu-central-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207\",\n" + " \"availabilityZone\": \"eu-central-1a\",\n" + " \"containers\": [\n" + " {\n" + " \"taskArn\": \"arn:aws:ecs:eu-central-1:012345678910:task/51a01bdf-d00e-487e-ab14-7645330b6207\",\n" + " \"networkInterfaces\": [\n" + " {\n" + " \"privateIpv4Address\": \"10.0.1.219\"\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + "}"; stubFor(post("/") .withHeader("X-Amz-Date", equalTo("20200403T102518Z")) .withHeader("Authorization", equalTo(AUTHORIZATION_HEADER)) .withHeader("X-Amz-Target", equalTo("AmazonEC2ContainerServiceV20141113.DescribeTasks")) .withHeader("Content-Type", equalTo("application/x-amz-json-1.1")) .withHeader("Accept-Encoding", equalTo("identity")) .withHeader("X-Amz-Security-Token", equalTo(TOKEN)) .withRequestBody(equalToJson(requestBody)) .willReturn(aResponse().withStatus(200).withBody(response))); // when List<Task> result = awsEcsApi.describeTasks(cluster, tasks, CREDENTIALS); // then assertEquals("10.0.1.16", result.get(0).getPrivateAddress()); assertEquals("eu-central-1a", result.get(0).getAvailabilityZone()); assertEquals("10.0.1.219", result.get(1).getPrivateAddress()); assertEquals("eu-central-1a", result.get(1).getAvailabilityZone()); } @Test public void awsError() { // given int errorCode = 401; String errorMessage = "Error message retrieved from AWS"; stubFor(post(urlMatching("/.*")) .willReturn(aResponse().withStatus(errorCode).withBody(errorMessage))); // when Exception exception = assertThrows(Exception.class, () -> awsEcsApi.listTasks("cluster-arn", CREDENTIALS)); // then assertTrue(exception.getMessage().contains(Integer.toString(errorCode))); assertTrue(exception.getMessage().contains(errorMessage)); } }
5,182
313
<filename>deps/GraphBLAS/rmm_wrap/pmr_malloc.h #ifndef PMR_MALLOC_H #define PMR_MALLOC_H #include <stdlib.h> #include <stdint.h> #ifdef __cplusplus extern "C" { #endif void *rmm_wrap_malloc (size_t size) ; void rmm_wrap_free (void *) ; void *rmm_wrap_calloc (size_t, size_t) ; void *rmm_wrap_realloc (void *, size_t) ; #ifdef __cplusplus } #endif #endif
184
728
<filename>bundles/sirix-core/src/main/java/org/sirix/page/delegates/ReferencesPage4.java /* * Copyright (c) 2011, University of Konstanz, Distributed Systems Group All rights reserved. * <p> * 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 the University of Konstanz nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written permission. * <p> * 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 <COPYRIGHT HOLDER> 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. */ package org.sirix.page.delegates; import com.google.common.base.MoreObjects; import org.sirix.api.PageTrx; import org.sirix.page.DeserializedReferencesPage4Tuple; import org.sirix.page.PageReference; import org.sirix.page.SerializationType; import org.sirix.page.interfaces.Page; import org.sirix.settings.Constants; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import java.io.DataInput; import java.io.DataOutput; import java.util.ArrayList; import java.util.List; /** * Class to provide basic reference handling functionality. */ public final class ReferencesPage4 implements Page { /** * Page reference 1. */ private final List<PageReference> references; /** * Page reference 4. */ private final List<Short> offsets; /** * Constructor to initialize instance. */ public ReferencesPage4() { references = new ArrayList<>(4); offsets = new ArrayList<>(4); } /** * Constructor to initialize instance. * * @param in input stream to read from * @param type the serialization type */ public ReferencesPage4(final DataInput in, final SerializationType type) { final DeserializedReferencesPage4Tuple tuple = type.deserializeReferencesPage4(in); references = tuple.getReferences(); offsets = tuple.getOffsets(); } /** * Constructor to initialize instance. * * @param pageToClone committed page */ public ReferencesPage4(final ReferencesPage4 pageToClone) { references = new ArrayList<>(4); offsets = new ArrayList<>(4); final var otherOffsets = pageToClone.getOffsets(); for (int offset = 0, size = otherOffsets.size(); offset < size; offset++) { offsets.add(otherOffsets.get(offset)); final var pageReference = new PageReference(); final var pageReferenceToClone = pageToClone.getReferences().get(offset); pageReference.setKey(pageReferenceToClone.getKey()); pageReference.setLogKey(pageReferenceToClone.getLogKey()); pageReference.setPageFragments(pageReferenceToClone.getPageFragments()); pageReference.setPersistentLogKey(pageReferenceToClone.getPersistentLogKey()); references.add(pageReference); } } public List<Short> getOffsets() { return offsets; } @Override public List<PageReference> getReferences() { return references; } /** * Get page reference of given offset. * * @param offset offset of page reference * @return {@link PageReference} at given offset */ @Override public PageReference getOrCreateReference(final @Nonnegative int offset) { for (final var currOffset : offsets) { if (currOffset == offset) { return references.get(offset); } } if (offsets.size() < 4) { offsets.add((short) offset); final var newReference = new PageReference(); references.add(newReference); return newReference; } return null; } @Override public boolean setOrCreateReference(final int offset, final PageReference pageReference) { for (int i = 0, count = offsets.size(); i < count; i++) { if (offsets.get(i) == offset) { references.set(i, pageReference); return false; } } if (offsets.size() < 4) { offsets.add((short) offset); references.add(pageReference); return false; } return true; } /** * Recursively call commit on all referenced pages. * * @param pageWriteTrx the page write transaction */ @Override public void commit(@Nonnull final PageTrx pageWriteTrx) { for (final PageReference reference : references) { if (reference.getLogKey() != Constants.NULL_ID_INT || reference.getPersistentLogKey() != Constants.NULL_ID_LONG) { pageWriteTrx.commit(reference); } } } /** * Serialize page references into output. * * @param out output stream * @param type the type to serialize (transaction intent log or the data file * itself). */ @Override public void serialize(final DataOutput out, final SerializationType type) { assert out != null; assert type != null; type.serializeReferencesPage4(out, references, offsets); } @Override public String toString() { final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this); for (final int offset : offsets) { helper.add("offset", offset); } for (final PageReference ref : references) { helper.add("reference", ref); } return helper.toString(); } }
2,001
642
<filename>jeesuite-zuul-support/src/main/java/com/jeesuite/zuul/filter/post/ResponseRewriteHandler.java<gh_stars>100-1000 package com.jeesuite.zuul.filter.post; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.common.io.CharStreams; import com.jeesuite.common.WebConstants; import com.jeesuite.zuul.filter.FilterHandler; import com.jeesuite.zuul.model.BizSystemModule; import com.netflix.util.Pair; import com.netflix.zuul.context.RequestContext; public class ResponseRewriteHandler implements FilterHandler { private static Logger log = LoggerFactory.getLogger("com.jeesuite.zuul.filter"); private static final String DEFAULT_ERROR_MSG = "系统繁忙"; private static final String _MESSAGE_NAME = "message"; private static final String _MSG_NAME = "msg"; private static final String _CODE_NAME = "code"; private static final String _DATA_NAME = "data"; @Override public Object process(RequestContext ctx, HttpServletRequest request, BizSystemModule module) { int statusCode = ctx.getResponseStatusCode(); if(statusCode != 200)return null; InputStream responseDataStream = ctx.getResponseDataStream(); if(responseDataStream == null)return null; List<Pair<String, String>> headers = ctx.getOriginResponseHeaders(); for (Pair<String, String> pair : headers) { if (WebConstants.HEADER_RESP_KEEP.equals(pair.first())) { if (Boolean.parseBoolean(pair.second())) { return null; } } // if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(pair.first()) && !pair.second().contains(MediaType.APPLICATION_JSON_VALUE) && !pair.second().contains(MediaType.TEXT_PLAIN_VALUE) && !pair.second().contains(MediaType.TEXT_HTML_VALUE)) { return null; } if (HttpHeaders.CONTENT_DISPOSITION.equalsIgnoreCase(pair.first())) { return null; } } // String responseMsg = null; String responseData = null; JSONObject originRespJSON = null; boolean rebuild = Boolean.FALSE; try { responseData = responseDataStream == null ? null : CharStreams.toString(new InputStreamReader(responseDataStream, StandardCharsets.UTF_8)); if (StringUtils.isBlank(responseData)) { rebuild = true; return null; } if (log.isTraceEnabled()) { log.trace("ORIGIN_RESPONSE -> {}", responseData); } try { originRespJSON = JSON.parseObject(responseData); } catch (Exception e) { } // 已经包含code结构不处理 if (originRespJSON == null || !(originRespJSON.containsKey(_CODE_NAME) && (originRespJSON.containsKey(_DATA_NAME) || originRespJSON.containsKey(_MSG_NAME)))) { rebuild = true; if (statusCode != 200) { try { responseMsg = originRespJSON.getString(_MESSAGE_NAME); } catch (Exception e) { } if (responseMsg == null) { try { responseMsg = HttpStatus.valueOf(statusCode).getReasonPhrase(); } catch (Exception e) { } } if (responseMsg == null) responseMsg = DEFAULT_ERROR_MSG; } } } catch (Exception e) { String error = "Error during filtering[ResponseFilter]"; log.error(error, e); statusCode = 500; responseMsg = DEFAULT_ERROR_MSG; } finally { // 系统异常全部正常返回 if (statusCode == 500) { ctx.setResponseStatusCode(200); } // if (rebuild) { JSONObject respJSONObject = new JSONObject(); respJSONObject.put(_CODE_NAME, statusCode == 200 ? 200 : 500); if (StringUtils.isNotBlank(responseMsg)) respJSONObject.put(_MSG_NAME, responseMsg); if (originRespJSON != null) { respJSONObject.put(_DATA_NAME, originRespJSON); } else if (StringUtils.isNotBlank(responseData)) { try { respJSONObject.put(_DATA_NAME, JSON.parse(responseData)); } catch (Exception e2) { respJSONObject.put(_DATA_NAME, responseData); } } responseData = respJSONObject.toJSONString(); ctx.setResponseBody(responseData); }else{ ctx.setResponseBody(responseData); } } return null; } @Override public int order() { return 0; } }
1,773
1,093
<reponame>comister/kayenta /* * Copyright 2018 Netflix, Inc. * * 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.netflix.kayenta.canary.orca; public class CanaryStageNames { public static final String REFID_SET_CONTEXT = "setupContext"; public static final String REFID_FETCH_CONTROL_PREFIX = "fetchControl"; public static final String REFID_FETCH_EXPERIMENT_PREFIX = "fetchExperiment"; public static final String REFID_MIX_METRICS = "mixMetrics"; public static final String REFID_JUDGE = "judge"; }
303
1,526
<filename>tests/data/fd_check.py<gh_stars>1000+ #!/usr/bin/env python import fcntl import os import sys def ttyname(fd): try: t = os.ttyname(fd) if hasattr(t, 'decode'): t = t.decode() return t except OSError: return None def controlling_tty(): try: fp = open('/dev/tty') try: return ttyname(fp.fileno()) finally: fp.close() except (IOError, OSError): return None fd = int(sys.argv[2]) st = os.fstat(fd) if sys.argv[3] == 'write': os.write(fd, u'TEST'.encode()) buf = u'' else: buf = os.read(fd, 4).decode() open(sys.argv[1], 'w').write(repr({ 'buf': buf, 'flags': fcntl.fcntl(fd, fcntl.F_GETFL), 'st_mode': st.st_mode, 'st_dev': st.st_dev, 'st_ino': st.st_ino, 'ttyname': ttyname(fd), 'controlling_tty': controlling_tty(), }))
471
362
<gh_stars>100-1000 package net.ripe.db.whois.changedphase3; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static net.ripe.db.whois.changedphase3.util.Scenario.Builder.given; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.CREATE; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.DELETE; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.GET___; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.META__; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.MODIFY; import static net.ripe.db.whois.changedphase3.util.Scenario.Method.SEARCH; import static net.ripe.db.whois.changedphase3.util.Scenario.Mode.NEW_MODE; import static net.ripe.db.whois.changedphase3.util.Scenario.ObjectStatus.OBJ_DOES_NOT_EXIST_____; import static net.ripe.db.whois.changedphase3.util.Scenario.ObjectStatus.OBJ_EXISTS_NO_CHANGED__; import static net.ripe.db.whois.changedphase3.util.Scenario.ObjectStatus.OBJ_EXISTS_WITH_CHANGED; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.EXPORT_; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.MAILUPD; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.NRTM___; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.REST___; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.SYNCUPD; import static net.ripe.db.whois.changedphase3.util.Scenario.Protocol.TELNET_; import static net.ripe.db.whois.changedphase3.util.Scenario.Req.NOT_APPLIC__; import static net.ripe.db.whois.changedphase3.util.Scenario.Req.NO_CHANGED__; import static net.ripe.db.whois.changedphase3.util.Scenario.Req.WITH_CHANGED; import static net.ripe.db.whois.changedphase3.util.Scenario.Result.FAILURE; import static net.ripe.db.whois.changedphase3.util.Scenario.Result.SUCCESS; @org.junit.jupiter.api.Tag("IntegrationTest") public class ChangedNewModeTestIntegration extends AbstractChangedPhase3IntegrationTest { @BeforeAll public static void beforeClass() { System.setProperty("feature.toggle.changed.attr.available", "false"); } @AfterAll public static void afterClass() { System.clearProperty("feature.toggle.changed.attr.available"); } @Test public void new_mode_rest() { given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(REST___, CREATE, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(REST___, CREATE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(REST___, MODIFY, WITH_CHANGED).then(FAILURE, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(REST___, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(REST___, MODIFY, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(REST___, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(REST___, DELETE, NOT_APPLIC__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(REST___, DELETE, NOT_APPLIC__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(REST___, SEARCH, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(REST___, SEARCH, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(REST___, GET___, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(REST___, GET___, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(REST___, META__, NOT_APPLIC__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); } @Test public void new_mode_telnet() { given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(TELNET_, SEARCH, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(TELNET_, SEARCH, NOT_APPLIC__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(TELNET_, META__, NOT_APPLIC__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); } @Test public void new_mode_syncupdates() { given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(SYNCUPD, CREATE, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(SYNCUPD, CREATE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(SYNCUPD, MODIFY, WITH_CHANGED).then(FAILURE, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(SYNCUPD, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(SYNCUPD, MODIFY, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(SYNCUPD, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(SYNCUPD, DELETE, WITH_CHANGED).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(SYNCUPD, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(SYNCUPD, DELETE, WITH_CHANGED).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(SYNCUPD, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); } @Test public void new_mode_mailupdates() { given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(MAILUPD, CREATE, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(MAILUPD, CREATE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(MAILUPD, MODIFY, WITH_CHANGED).then(FAILURE, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(MAILUPD, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(MAILUPD, MODIFY, WITH_CHANGED).then(FAILURE).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(MAILUPD, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(MAILUPD, DELETE, WITH_CHANGED).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(MAILUPD, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(MAILUPD, DELETE, WITH_CHANGED).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(MAILUPD, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); } @Test public void new_mode_nrtm() { given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(NRTM___, CREATE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(NRTM___, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(NRTM___, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(NRTM___, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(NRTM___, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); } @Test public void new_mode_export() { given(NEW_MODE, OBJ_DOES_NOT_EXIST_____).when(EXPORT_, CREATE, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(EXPORT_, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(EXPORT_, MODIFY, NO_CHANGED__).then(SUCCESS, OBJ_EXISTS_NO_CHANGED__).run(context); given(NEW_MODE, OBJ_EXISTS_WITH_CHANGED).when(EXPORT_, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); given(NEW_MODE, OBJ_EXISTS_NO_CHANGED__).when(EXPORT_, DELETE, NO_CHANGED__).then(SUCCESS, OBJ_DOES_NOT_EXIST_____).run(context); } }
4,053
521
<reponame>Fimbure/icebox-1 /** @file SMM Periodic SMI Library. Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include <PiSmm.h> #include <Protocol/SmmPeriodicTimerDispatch2.h> #include <Library/BaseLib.h> #include <Library/BaseMemoryLib.h> #include <Library/SynchronizationLib.h> #include <Library/DebugLib.h> #include <Library/TimerLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/SmmServicesTableLib.h> #include <Library/SmmPeriodicSmiLib.h> /// /// Define the number of periodic SMI handler entries that should be allocated to the list /// of free periodic SMI handlers when the list of free periodic SMI handlers is empty. /// #define PERIODIC_SMI_LIBRARY_ALLOCATE_SIZE 0x08 /// /// Signature for a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure /// #define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE SIGNATURE_32 ('P', 'S', 'M', 'I') /// /// Structure that contains state information for an enabled periodic SMI handler /// typedef struct { /// /// Signature value that must be set to PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE /// UINT32 Signature; /// /// The link entry to be inserted to the list of periodic SMI handlers. /// LIST_ENTRY Link; /// /// The dispatch function to called to invoke an enabled periodic SMI handler. /// PERIODIC_SMI_LIBRARY_HANDLER DispatchFunction; /// /// The context to pass into DispatchFunction /// VOID *Context; /// /// The tick period in 100 ns units that DispatchFunction should be called. /// UINT64 TickPeriod; /// /// The Cpu number that is required to execute DispatchFunction. If Cpu is /// set to PERIODIC_SMI_LIBRARY_ANY_CPU, then DispatchFunction may be executed /// on any CPU. /// UINTN Cpu; /// /// The size, in bytes, of the stack allocated for a periodic SMI handler. /// This value must be a multiple of EFI_PAGE_SIZE. /// UINTN StackSize; /// /// A pointer to the stack allocated using AllocatePages(). This field will /// be NULL if StackSize is 0. /// VOID *Stack; /// /// Spin lock used to wait for an AP to complete the execution of a periodic SMI handler /// SPIN_LOCK DispatchLock; /// /// The rate in Hz of the performance counter that is used to measure the /// amount of time that a periodic SMI handler executes. /// UINT64 PerfomanceCounterRate; /// /// The start count value of the performance counter that is used to measure /// the amount of time that a periodic SMI handler executes. /// UINT64 PerfomanceCounterStartValue; /// /// The end count value of the performance counter that is used to measure /// the amount of time that a periodic SMI handler executes. /// UINT64 PerfomanceCounterEndValue; /// /// The context record passed into the Register() function of the SMM Periodic /// Timer Dispatch Protocol when a periodic SMI handler is enabled. /// EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT RegisterContext; /// /// The handle returned from the Register() function of the SMM Periodic /// Timer Dispatch Protocol when a periodic SMI handler is enabled. /// EFI_HANDLE DispatchHandle; /// /// The total number of performance counter ticks that the periodic SMI handler /// has been executing in its current invocation. /// UINT64 DispatchTotalTime; /// /// The performance counter value that was captured the last time that the /// periodic SMI handler called PeriodcSmiExecutionTime(). This allows the /// time value returned by PeriodcSmiExecutionTime() to be accurate even when /// the performance counter rolls over. /// UINT64 DispatchCheckPointTime; /// /// Buffer used to save the context when control is transfer from this library /// to an enabled periodic SMI handler. This saved context is used when the /// periodic SMI handler exits or yields. /// BASE_LIBRARY_JUMP_BUFFER DispatchJumpBuffer; /// /// Flag that is set to TRUE when a periodic SMI handler requests to yield /// using PeriodicSmiYield(). When this flag IS TRUE, YieldJumpBuffer is /// valid. When this flag is FALSE, YieldJumpBuffer is not valid. /// BOOLEAN YieldFlag; /// /// Buffer used to save the context when a periodic SMI handler requests to /// yield using PeriodicSmiYield(). This context is used to resume the /// execution of a periodic SMI handler the next time control is transferd /// to the periodic SMI handler that yielded. /// BASE_LIBRARY_JUMP_BUFFER YieldJumpBuffer; /// /// The amount of time, in 100 ns units, that have elapsed since the last /// time the periodic SMI handler was invoked. /// UINT64 ElapsedTime; } PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT; /** Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure based on a pointer to a RegisterContext field. **/ #define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_REGISTER_CONTEXT(a) \ CR ( \ a, \ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT, \ RegisterContext, \ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE \ ) /** Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure based on a pointer to a Link field. **/ #define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK(a) \ CR ( \ a, \ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT, \ Link, \ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE \ ) /// /// Pointer to the SMM Periodic Timer Disatch Protocol that was located in the constuctor. /// EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *gSmmPeriodicTimerDispatch2 = NULL; /// /// Pointer to a table of supported periodic SMI tick periods in 100 ns units /// sorted from largest to smallest terminated by a tick period value of 0. /// This table is allocated using AllocatePool() in the constructor and filled /// in based on the values returned from the SMM Periodic Timer Dispatch 2 Protocol /// function GetNextShorterInterval(). /// UINT64 *gSmiTickPeriodTable = NULL; /// /// Linked list of free periodic SMI handlers that this library can use. /// LIST_ENTRY gFreePeriodicSmiLibraryHandlers = INITIALIZE_LIST_HEAD_VARIABLE (gFreePeriodicSmiLibraryHandlers); /// /// Linked list of periodic SMI handlers that this library is currently managing. /// LIST_ENTRY gPeriodicSmiLibraryHandlers = INITIALIZE_LIST_HEAD_VARIABLE (gPeriodicSmiLibraryHandlers); /// /// Pointer to the periodic SMI handler that is currently being executed. /// Is set to NULL if no periodic SMI handler is currently being executed. /// PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *gActivePeriodicSmiLibraryHandler = NULL; /** Internal worker function that returns a pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the periodic SMI handler that is currently being executed. If a periodic SMI handler is not currently being executed, the NULL is returned. @retval NULL A periodic SMI handler is not currently being executed. @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT associated with the active periodic SMI handler. **/ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * GetActivePeriodicSmiLibraryHandler ( VOID ) { return gActivePeriodicSmiLibraryHandler; } /** Internal worker function that returns a pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure associated with the DispatchHandle that was returned when the periodic SMI handler was enabled with PeriodicSmiEnable(). If DispatchHandle is NULL, then the active periodic SMI handler is returned. If DispatchHandle is NULL and there is no active periodic SMI handler, then NULL is returned. @param[in] DispatchHandle DispatchHandle that was returned when the periodic SMI handler was enabled with PeriodicSmiEnable(). This is an optional parameter that may be NULL. If this parameter is NULL, then the active periodic SMI handler is returned. @retval NULL DispatchHandle is NULL and there is no active periodic SMI handler. @retval NULL DispatchHandle does not match any of the periodic SMI handlers that have been enabled with PeriodicSmiEnable(). @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT associated with the DispatchHandle. **/ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * LookupPeriodicSmiLibraryHandler ( IN EFI_HANDLE DispatchHandle OPTIONAL ) { LIST_ENTRY *Link; PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // If DispatchHandle is NULL, then return the active periodic SMI handler // if (DispatchHandle == NULL) { return GetActivePeriodicSmiLibraryHandler (); } // // Search the periodic SMI handler entries for a a matching DispatchHandle // for ( Link = GetFirstNode (&gPeriodicSmiLibraryHandlers) ; !IsNull (&gPeriodicSmiLibraryHandlers, Link) ; Link = GetNextNode (&gPeriodicSmiLibraryHandlers, Link) ) { PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link); if (PeriodicSmiLibraryHandler->DispatchHandle == DispatchHandle) { return PeriodicSmiLibraryHandler; } } // // No entries match DispatchHandle, so return NULL // return NULL; } /** Internal worker function that sets that active periodic SMI handler based on the Context used when the periodic SMI handler was registered with the SMM Periodic Timer Dispatch 2 Protocol. If Context is NULL, then the state is updated to show that there is not active periodic SMI handler. A pointer to the active PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure is returned. @retval NULL Context is NULL. @retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT associated with Context. **/ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * SetActivePeriodicSmiLibraryHandler ( IN CONST VOID *Context OPTIONAL ) { if (Context == NULL) { gActivePeriodicSmiLibraryHandler = NULL; } else { gActivePeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_REGISTER_CONTEXT (Context); } return gActivePeriodicSmiLibraryHandler; } /** Internal worker function that moves the specified periodic SMI handler from the list of managed periodic SMI handlers to the list of free periodic SMI handlers. @param[in] PeriodicSmiLibraryHandler Pointer to the periodic SMI handler to be reclaimed. **/ VOID ReclaimPeriodicSmiLibraryHandler ( PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler ) { ASSERT (PeriodicSmiLibraryHandler->DispatchHandle == NULL); if (PeriodicSmiLibraryHandler->Stack != NULL) { FreePages ( PeriodicSmiLibraryHandler->Stack, EFI_SIZE_TO_PAGES (PeriodicSmiLibraryHandler->StackSize) ); PeriodicSmiLibraryHandler->Stack = NULL; } RemoveEntryList (&PeriodicSmiLibraryHandler->Link); InsertHeadList (&gFreePeriodicSmiLibraryHandlers, &PeriodicSmiLibraryHandler->Link); } /** Add the additional entries to the list of free periodic SMI handlers. The function is assumed to be called only when the list of free periodic SMI handlers is empty. @retval TRUE The additional entries were added. @retval FALSE There was no available resource for the additional entries. **/ BOOLEAN EnlargeFreePeriodicSmiLibraryHandlerList ( VOID ) { UINTN Index; PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // Add the entries to the list // for (Index = 0; Index < PERIODIC_SMI_LIBRARY_ALLOCATE_SIZE; Index++) { PeriodicSmiLibraryHandler = AllocatePool (sizeof (PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT)); if (PeriodicSmiLibraryHandler == NULL) { break; } PeriodicSmiLibraryHandler->Signature = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE; InsertHeadList (&gFreePeriodicSmiLibraryHandlers, &PeriodicSmiLibraryHandler->Link); } return (BOOLEAN) (Index > 0); } /** Internal worker function that returns a free entry for a new periodic SMI handler. If no free entries are available, then additional entries are allocated. @retval NULL There are not enough resources available to to allocate a free entry. @retval other Pointer to a free PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure. **/ PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * FindFreePeriodicSmiLibraryHandler ( VOID ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; if (IsListEmpty (&gFreePeriodicSmiLibraryHandlers)) { if (!EnlargeFreePeriodicSmiLibraryHandlerList ()) { return NULL; } } // // Get one from the list of free periodic SMI handlers. // PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK ( GetFirstNode (&gFreePeriodicSmiLibraryHandlers) ); RemoveEntryList (&PeriodicSmiLibraryHandler->Link); InsertTailList (&gPeriodicSmiLibraryHandlers, &PeriodicSmiLibraryHandler->Link); return PeriodicSmiLibraryHandler; } /** This function returns a pointer to a table of supported periodic SMI tick periods in 100 ns units sorted from largest to smallest. The table contains a array of UINT64 values terminated by a tick period value of 0. The returned table must be treated as read-only data and must not be freed. @return A pointer to a table of UINT64 tick period values in 100ns units sorted from largest to smallest terminated by a tick period of 0. **/ UINT64 * EFIAPI PeriodicSmiSupportedTickPeriod ( VOID ) { // // Return the table allocated and populated by SmmPeriodicSmiLibConstructor() // return gSmiTickPeriodTable; } /** This function returns the time in 100ns units since the periodic SMI handler function was called. If the periodic SMI handler was resumed through PeriodicSmiYield(), then the time returned is the time in 100ns units since PeriodicSmiYield() returned. @return The actual time in 100ns units that the periodic SMI handler has been executing. If this function is not called from within an enabled periodic SMI handler, then 0 is returned. **/ UINT64 EFIAPI PeriodicSmiExecutionTime ( VOID ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; UINT64 Current; UINT64 Count; // // If there is no active periodic SMI handler, then return 0 // PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); if (PeriodicSmiLibraryHandler == NULL) { return 0; } // // Get the current performance counter value // Current = GetPerformanceCounter (); // // Count the number of performance counter ticks since the periodic SMI handler // was dispatched or the last time this function was called. // if (PeriodicSmiLibraryHandler->PerfomanceCounterEndValue > PeriodicSmiLibraryHandler->PerfomanceCounterStartValue) { // // The performance counter counts up. Check for roll over condition. // if (Current > PeriodicSmiLibraryHandler->DispatchCheckPointTime) { Count = Current - PeriodicSmiLibraryHandler->DispatchCheckPointTime; } else { Count = (Current - PeriodicSmiLibraryHandler->PerfomanceCounterStartValue) + (PeriodicSmiLibraryHandler->PerfomanceCounterEndValue - PeriodicSmiLibraryHandler->DispatchCheckPointTime); } } else { // // The performance counter counts down. Check for roll over condition. // if (PeriodicSmiLibraryHandler->DispatchCheckPointTime > Current) { Count = PeriodicSmiLibraryHandler->DispatchCheckPointTime - Current; } else { Count = (PeriodicSmiLibraryHandler->DispatchCheckPointTime - PeriodicSmiLibraryHandler->PerfomanceCounterEndValue) + (PeriodicSmiLibraryHandler->PerfomanceCounterStartValue - Current); } } // // Accumulate the total number of performance counter ticks since the periodic // SMI handler was dispatched or resumed. // PeriodicSmiLibraryHandler->DispatchTotalTime += Count; // // Update the checkpoint value to the current performance counter value // PeriodicSmiLibraryHandler->DispatchCheckPointTime = Current; // // Convert the total number of performance counter ticks to 100 ns units // return DivU64x64Remainder ( MultU64x32 (PeriodicSmiLibraryHandler->DispatchTotalTime, 10000000), PeriodicSmiLibraryHandler->PerfomanceCounterRate, NULL ); } /** This function returns control back to the SMM Foundation. When the next periodic SMI for the currently executing handler is triggered, the periodic SMI handler will restarted from its registered DispatchFunction entry point. If this function is not called from within an enabled periodic SMI handler, then control is returned to the calling function. **/ VOID EFIAPI PeriodicSmiExit ( VOID ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // If there is no active periodic SMI handler, then return // PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); if (PeriodicSmiLibraryHandler == NULL) { return; } // // Perform a long jump back to the point when the currently executing dispatch // function was dispatched. // LongJump (&PeriodicSmiLibraryHandler->DispatchJumpBuffer, 1); // // Must never return // ASSERT (FALSE); CpuDeadLoop(); } /** This function yields control back to the SMM Foundation. When the next periodic SMI for the currently executing handler is triggered, the periodic SMI handler will be resumed and this function will return. Use of this function requires a seperate stack for the periodic SMI handler. A non zero stack size must be specified in PeriodicSmiEnable() for this function to be used. If the stack size passed into PeriodicSmiEnable() was zero, the 0 is returned. If this function is not called from within an enabled periodic SMI handler, then 0 is returned. @return The actual time in 100ns units elasped since this function was called. A value of 0 indicates an unknown amount of time. **/ UINT64 EFIAPI PeriodicSmiYield ( VOID ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; UINTN SetJumpFlag; // // If there is no active periodic SMI handler, then return // PeriodicSmiLibraryHandler = GetActivePeriodicSmiLibraryHandler (); if (PeriodicSmiLibraryHandler == NULL) { return 0; } // // If PeriodicSmiYield() is called without an allocated stack, then just return // immediately with an elapsed time of 0. // if (PeriodicSmiLibraryHandler->Stack == NULL) { return 0; } // // Set a flag so the next periodic SMI event will resume at where SetJump() // is called below. // PeriodicSmiLibraryHandler->YieldFlag = TRUE; // // Save context in YieldJumpBuffer // SetJumpFlag = SetJump (&PeriodicSmiLibraryHandler->YieldJumpBuffer); if (SetJumpFlag == 0) { // // The intial call to SetJump() always returns 0. // If this is the initial call, then exit the current periodic SMI handler // PeriodicSmiExit (); } // // We get here when a LongJump is performed from PeriodicSmiDispatchFunctionOnCpu() // to resume a periodic SMI handler that called PeriodicSmiYield() on the // previous time this periodic SMI handler was dispatched. // // Clear the flag so the next periodic SMI dispatch will not resume. // PeriodicSmiLibraryHandler->YieldFlag = FALSE; // // Return the amount elapsed time that occured while yielded // return PeriodicSmiLibraryHandler->ElapsedTime; } /** Internal worker function that transfers control to an enabled periodic SMI handler. If the enabled periodic SMI handler was allocated its own stack, then this function is called on that allocated stack through the BaseLin function SwitchStack(). @param[in] Context1 Context1 parameter passed into SwitchStack(). @param[in] Context2 Context2 parameter passed into SwitchStack(). **/ VOID EFIAPI PeriodicSmiDispatchFunctionSwitchStack ( IN VOID *Context1, OPTIONAL IN VOID *Context2 OPTIONAL ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // Convert Context1 to PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * // PeriodicSmiLibraryHandler = (PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *)Context1; // // Dispatch the registered handler passing in the context that was registered // and the amount of time that has elapsed since the previous time this // periodic SMI handler was dispacthed. // PeriodicSmiLibraryHandler->DispatchFunction ( PeriodicSmiLibraryHandler->Context, PeriodicSmiLibraryHandler->ElapsedTime ); // // If this DispatchFunction() returns, then unconditially call PeriodicSmiExit() // to perform a LongJump() back to PeriodicSmiDispatchFunctionOnCpu(). The // LongJump() will resume exection on the original stack. // PeriodicSmiExit (); } /** Internal worker function that transfers control to an enabled periodic SMI handler on the specified logial CPU. This function determines if the periodic SMI handler yielded and needs to be resumed. It also and switches to an allocated stack if one was allocated in PeriodicSmiEnable(). @param[in] PeriodicSmiLibraryHandler A pointer to the context for the periodic SMI handler to execute. **/ VOID EFIAPI PeriodicSmiDispatchFunctionOnCpu ( PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler ) { // // Save context in DispatchJumpBuffer. The intial call to SetJump() always // returns 0. If this is the initial call, then either resume from a prior // call to PeriodicSmiYield() or call the DispatchFunction registerd in // PeriodicSmiEnable() using an allocated stack if one was specified. // if (SetJump (&PeriodicSmiLibraryHandler->DispatchJumpBuffer) != 0) { return; } // // Capture the performance counter value just before the periodic SMI handler // is resumed so the amount of time the periodic SMI handler executes can be // calculated. // PeriodicSmiLibraryHandler->DispatchTotalTime = 0; PeriodicSmiLibraryHandler->DispatchCheckPointTime = GetPerformanceCounter(); if (PeriodicSmiLibraryHandler->YieldFlag) { // // Perform a long jump back to the point where the previously dispatched // function called PeriodicSmiYield(). // LongJump (&PeriodicSmiLibraryHandler->YieldJumpBuffer, 1); } else if (PeriodicSmiLibraryHandler->Stack == NULL) { // // If Stack is NULL then call DispatchFunction using current stack passing // in the context that was registered and the amount of time that has // elapsed since the previous time this periodic SMI handler was dispacthed. // PeriodicSmiLibraryHandler->DispatchFunction ( PeriodicSmiLibraryHandler->Context, PeriodicSmiLibraryHandler->ElapsedTime ); // // If this DispatchFunction() returns, then unconditially call PeriodicSmiExit() // to perform a LongJump() back to this function. // PeriodicSmiExit (); } else { // // If Stack is not NULL then call DispatchFunction switching to the allocated stack // SwitchStack ( PeriodicSmiDispatchFunctionSwitchStack, PeriodicSmiLibraryHandler, NULL, (UINT8 *)PeriodicSmiLibraryHandler->Stack + PeriodicSmiLibraryHandler->StackSize ); } // // Must never return // ASSERT (FALSE); CpuDeadLoop(); } /** Internal worker function that transfers control to an enabled periodic SMI handler on the specified logial CPU. This worker function is only called using the SMM Services Table function SmmStartupThisAp() to execute the periodic SMI handler on a logical CPU that is different than the one that is running the SMM Foundation. When the periodic SMI handler returns, a lock is released to notify the CPU that is running the SMM Foundation that the periodic SMI handler execution has finished its execution. @param[in, out] Buffer A pointer to the context for the periodic SMI handler. **/ VOID EFIAPI PeriodicSmiDispatchFunctionWithLock ( IN OUT VOID *Buffer ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // Get context // PeriodicSmiLibraryHandler = (PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *)Buffer; // // Execute dispatch function on the currently excuting logical CPU // PeriodicSmiDispatchFunctionOnCpu (PeriodicSmiLibraryHandler); // // Release the dispatch spin lock // ReleaseSpinLock (&PeriodicSmiLibraryHandler->DispatchLock); } /** Internal worker function that transfers control to a periodic SMI handler that was enabled using PeriodicSmiEnable(). @param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister(). @param[in] Context Points to an optional handler context which was specified when the handler was registered. @param[in, out] CommBuffer A pointer to a collection of data in memory that will be conveyed from a non-SMM environment into an SMM environment. @param[in, out] CommBufferSize The size of the CommBuffer. @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers should still be called. @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should still be called. @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still be called. @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. **/ EFI_STATUS EFIAPI PeriodicSmiDispatchFunction ( IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; EFI_SMM_PERIODIC_TIMER_CONTEXT *TimerContext; EFI_STATUS Status; // // Set the active periodic SMI handler // PeriodicSmiLibraryHandler = SetActivePeriodicSmiLibraryHandler (Context); if (PeriodicSmiLibraryHandler == NULL) { return EFI_NOT_FOUND; } // // Retrieve the elapsed time since the last time this periodic SMI handler was called // PeriodicSmiLibraryHandler->ElapsedTime = 0; if (CommBuffer != NULL) { TimerContext = (EFI_SMM_PERIODIC_TIMER_CONTEXT *)CommBuffer; PeriodicSmiLibraryHandler->ElapsedTime = TimerContext->ElapsedTime; } // // Dispatch the periodic SMI handler // if ((PeriodicSmiLibraryHandler->Cpu == PERIODIC_SMI_LIBRARY_ANY_CPU) || (PeriodicSmiLibraryHandler->Cpu == gSmst->CurrentlyExecutingCpu) ) { // // Dispatch on the currently execution CPU if the CPU specified in PeriodicSmiEnable() // was PERIODIC_SMI_LIBARRY_ANY_CPU or the currently executing CPU matches the CPU // that was specified in PeriodicSmiEnable(). // PeriodicSmiDispatchFunctionOnCpu (PeriodicSmiLibraryHandler); } else { // // Acquire spin lock for ths periodic SMI handler. The AP will release the // spin lock when it is done executing the periodic SMI handler. // AcquireSpinLock (&PeriodicSmiLibraryHandler->DispatchLock); // // Execute the periodic SMI handler on the CPU that was specified in // PeriodicSmiEnable(). // Status = gSmst->SmmStartupThisAp ( PeriodicSmiDispatchFunctionWithLock, PeriodicSmiLibraryHandler->Cpu, PeriodicSmiLibraryHandler ); if (!EFI_ERROR (Status)) { // // Wait for the AP to release the spin lock. // while (!AcquireSpinLockOrFail (&PeriodicSmiLibraryHandler->DispatchLock)) { CpuPause (); } } // // Release the spin lock for the periodic SMI handler. // ReleaseSpinLock (&PeriodicSmiLibraryHandler->DispatchLock); } // // Reclaim the active periodic SMI handler if it was disabled during the current dispatch. // if (PeriodicSmiLibraryHandler->DispatchHandle == NULL) { ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler); } // // Update state to show that there is no active periodic SMI handler // SetActivePeriodicSmiLibraryHandler (NULL); return EFI_SUCCESS; } /** This function enables a periodic SMI handler. @param[in, out] DispatchHandle A pointer to the handle associated with the enabled periodic SMI handler. This is an optional parameter that may be NULL. If it is NULL, then the handle will not be returned, which means that the periodic SMI handler can never be disabled. @param[in] DispatchFunction A pointer to a periodic SMI handler function. @param[in] Context Optional content to pass into DispatchFunction. @param[in] TickPeriod The requested tick period in 100ns units that control should be givien to the periodic SMI handler. Must be one of the supported values returned by PeriodicSmiSupportedPickPeriod(). @param[in] Cpu Specifies the CPU that is required to execute the periodic SMI handler. If Cpu is PERIODIC_SMI_LIBRARY_ANY_CPU, then the periodic SMI handler will always be executed on the SMST CurrentlyExecutingCpu, which may vary across periodic SMIs. If Cpu is between 0 and the SMST NumberOfCpus, then the periodic SMI will always be executed on the requested CPU. @param[in] StackSize The size, in bytes, of the stack to allocate for use by the periodic SMI handler. If 0, then the default stack will be used. @retval EFI_INVALID_PARAMETER DispatchFunction is NULL. @retval EFI_UNSUPPORTED TickPeriod is not a supported tick period. The supported tick periods can be retrieved using PeriodicSmiSupportedTickPeriod(). @retval EFI_INVALID_PARAMETER Cpu is not PERIODIC_SMI_LIBRARY_ANY_CPU or in the range 0 to SMST NumberOfCpus. @retval EFI_OUT_OF_RESOURCES There are not enough resources to enable the periodic SMI handler. @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the stack speficied by StackSize. @retval EFI_SUCCESS The periodic SMI handler was enabled. **/ EFI_STATUS EFIAPI PeriodicSmiEnable ( IN OUT EFI_HANDLE *DispatchHandle, OPTIONAL IN PERIODIC_SMI_LIBRARY_HANDLER DispatchFunction, IN CONST VOID *Context, OPTIONAL IN UINT64 TickPeriod, IN UINTN Cpu, IN UINTN StackSize ) { EFI_STATUS Status; UINTN Index; PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // Make sure all the input parameters are valid // if (DispatchFunction == NULL) { return EFI_INVALID_PARAMETER; } for (Index = 0; gSmiTickPeriodTable[Index] != 0; Index++) { if (gSmiTickPeriodTable[Index] == TickPeriod) { break; } } if (gSmiTickPeriodTable[Index] == 0) { return EFI_UNSUPPORTED; } if (Cpu != PERIODIC_SMI_LIBRARY_ANY_CPU && Cpu >= gSmst->NumberOfCpus) { return EFI_INVALID_PARAMETER; } // // Find a free periodic SMI handler entry // PeriodicSmiLibraryHandler = FindFreePeriodicSmiLibraryHandler(); if (PeriodicSmiLibraryHandler == NULL) { return EFI_OUT_OF_RESOURCES; } // // Initialize a new periodic SMI handler entry // PeriodicSmiLibraryHandler->YieldFlag = FALSE; PeriodicSmiLibraryHandler->DispatchHandle = NULL; PeriodicSmiLibraryHandler->DispatchFunction = DispatchFunction; PeriodicSmiLibraryHandler->Context = (VOID *)Context; PeriodicSmiLibraryHandler->Cpu = Cpu; PeriodicSmiLibraryHandler->StackSize = ALIGN_VALUE (StackSize, EFI_PAGE_SIZE); if (PeriodicSmiLibraryHandler->StackSize > 0) { PeriodicSmiLibraryHandler->Stack = AllocatePages (EFI_SIZE_TO_PAGES (PeriodicSmiLibraryHandler->StackSize)); if (PeriodicSmiLibraryHandler->Stack == NULL) { return EFI_OUT_OF_RESOURCES; } ZeroMem (PeriodicSmiLibraryHandler->Stack, PeriodicSmiLibraryHandler->StackSize); } else { PeriodicSmiLibraryHandler->Stack = NULL; } InitializeSpinLock (&PeriodicSmiLibraryHandler->DispatchLock); PeriodicSmiLibraryHandler->PerfomanceCounterRate = GetPerformanceCounterProperties ( &PeriodicSmiLibraryHandler->PerfomanceCounterStartValue, &PeriodicSmiLibraryHandler->PerfomanceCounterEndValue ); PeriodicSmiLibraryHandler->RegisterContext.Period = TickPeriod; PeriodicSmiLibraryHandler->RegisterContext.SmiTickInterval = TickPeriod; Status = gSmmPeriodicTimerDispatch2->Register ( gSmmPeriodicTimerDispatch2, PeriodicSmiDispatchFunction, &PeriodicSmiLibraryHandler->RegisterContext, &PeriodicSmiLibraryHandler->DispatchHandle ); if (EFI_ERROR (Status)) { PeriodicSmiLibraryHandler->DispatchHandle = NULL; ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler); return EFI_OUT_OF_RESOURCES; } // // Return the registered handle if the optional DispatchHandle parameter is not NULL // if (DispatchHandle != NULL) { *DispatchHandle = PeriodicSmiLibraryHandler->DispatchHandle; } return EFI_SUCCESS; } /** This function disables a periodic SMI handler that has been previously enabled with PeriodicSmiEnable(). @param[in] DispatchHandle A handle associated with a previously enabled periodic SMI handler. This is an optional parameter that may be NULL. If it is NULL, then the active periodic SMI handlers is disabled. @retval FALSE DispatchHandle is NULL and there is no active periodic SMI handler. @retval FALSE The periodic SMI handler specified by DispatchHandle has not been enabled with PeriodicSmiEnable(). @retval TRUE The periodic SMI handler specified by DispatchHandle has been disabled. If DispatchHandle is NULL, then the active periodic SMI handler has been disabled. **/ BOOLEAN EFIAPI PeriodicSmiDisable ( IN EFI_HANDLE DispatchHandle OPTIONAL ) { PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; EFI_STATUS Status; // // Lookup the periodic SMI handler specified by DispatchHandle // PeriodicSmiLibraryHandler = LookupPeriodicSmiLibraryHandler (DispatchHandle); if (PeriodicSmiLibraryHandler == NULL) { return FALSE; } // // Unregister the periodic SMI handler from the SMM Periodic Timer Dispatch 2 Protocol // Status = gSmmPeriodicTimerDispatch2->UnRegister ( gSmmPeriodicTimerDispatch2, PeriodicSmiLibraryHandler->DispatchHandle ); if (EFI_ERROR (Status)) { return FALSE; } // // Mark the entry for the disabled periodic SMI handler as free, and // call ReclaimPeriodicSmiLibraryHandler to move it to the list of free // periodic SMI handlers. // PeriodicSmiLibraryHandler->DispatchHandle = NULL; if (PeriodicSmiLibraryHandler != GetActivePeriodicSmiLibraryHandler ()) { ReclaimPeriodicSmiLibraryHandler (PeriodicSmiLibraryHandler); } return TRUE; } /** This constructor function caches the pointer to the SMM Periodic Timer Dispatch 2 Protocol and collects the list SMI tick rates that the hardware supports. @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. **/ EFI_STATUS EFIAPI SmmPeriodicSmiLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; UINT64 *SmiTickInterval; UINTN Count; // // Locate the SMM Periodic Timer Dispatch 2 Protocol // Status = gSmst->SmmLocateProtocol ( &gEfiSmmPeriodicTimerDispatch2ProtocolGuid, NULL, (VOID **)&gSmmPeriodicTimerDispatch2 ); ASSERT_EFI_ERROR (Status); ASSERT (gSmmPeriodicTimerDispatch2 != NULL); // // Count the number of periodic SMI tick intervals that the SMM Periodic Timer // Dipatch 2 Protocol supports. // SmiTickInterval = NULL; Count = 0; do { Status = gSmmPeriodicTimerDispatch2->GetNextShorterInterval ( gSmmPeriodicTimerDispatch2, &SmiTickInterval ); Count++; } while (SmiTickInterval != NULL); // // Allocate a buffer for the table of supported periodic SMI tick periods. // gSmiTickPeriodTable = AllocateZeroPool (Count * sizeof (UINT64)); ASSERT (gSmiTickPeriodTable != NULL); // // Fill in the table of supported periodic SMI tick periods. // SmiTickInterval = NULL; Count = 0; do { gSmiTickPeriodTable[Count] = 0; Status = gSmmPeriodicTimerDispatch2->GetNextShorterInterval ( gSmmPeriodicTimerDispatch2, &SmiTickInterval ); if (SmiTickInterval != NULL) { gSmiTickPeriodTable[Count] = *SmiTickInterval; } Count++; } while (SmiTickInterval != NULL); // // Allocate buffer for initial set of periodic SMI handlers // EnlargeFreePeriodicSmiLibraryHandlerList (); return EFI_SUCCESS; } /** The constructor function caches the pointer to the SMM Periodic Timer Dispatch 2 Protocol and collects the list SMI tick rates that the hardware supports. @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. **/ EFI_STATUS EFIAPI SmmPeriodicSmiLibDestructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { LIST_ENTRY *Link; PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler; // // Free the table of supported periodic SMI tick rates // if (gSmiTickPeriodTable != NULL) { FreePool (gSmiTickPeriodTable); } // // Disable all periodic SMI handlers // for (Link = GetFirstNode (&gPeriodicSmiLibraryHandlers); !IsNull (&gPeriodicSmiLibraryHandlers, Link);) { PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link); Link = GetNextNode (&gPeriodicSmiLibraryHandlers, Link); PeriodicSmiDisable (PeriodicSmiLibraryHandler->DispatchHandle); } // // Free all the periodic SMI handler entries // for (Link = GetFirstNode (&gFreePeriodicSmiLibraryHandlers); !IsNull (&gFreePeriodicSmiLibraryHandlers, Link);) { PeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK (Link); Link = RemoveEntryList (Link); FreePool (PeriodicSmiLibraryHandler); } return EFI_SUCCESS; }
16,538
2,010
import tensorflow as tf FLAGS = tf.app.flags.FLAGS def define_flags(): ############ # Run mode ############ tf.app.flags.DEFINE_string('run', None, "Which operation to run. [train|inference]") ########################## # Training parameters ########################### tf.app.flags.DEFINE_integer('nb_epoch', 400, "Number of epochs") tf.app.flags.DEFINE_integer('batch_size', 64, "Number of samples per batch.") tf.app.flags.DEFINE_integer('nb_batch_per_epoch', 500, "Number of batches per epoch") tf.app.flags.DEFINE_float('learning_rate', 2E-4, "Learning rate used for AdamOptimizer") tf.app.flags.DEFINE_integer('noise_dim', 100, "Noise dimension for GAN generation") tf.app.flags.DEFINE_integer('random_seed', 0, "Seed used to initialize rng.") ############################################ # General tensorflow parameters parameters ############################################# tf.app.flags.DEFINE_bool('use_XLA', False, "Whether to use XLA compiler.") tf.app.flags.DEFINE_integer('num_threads', 2, "Number of threads to fetch the data") tf.app.flags.DEFINE_float('capacity_factor', 32, "Nuumber of batches to store in queue") ########## # Datasets ########## tf.app.flags.DEFINE_string('data_format', "NCHW", "Tensorflow image data format.") tf.app.flags.DEFINE_string('celebA_path', "../../data/raw/img_align_celeba", "Path to celebA images") tf.app.flags.DEFINE_integer('channels', 3, "Number of channels") tf.app.flags.DEFINE_float('central_fraction', 0.8, "Central crop as a fraction of total image") tf.app.flags.DEFINE_integer('img_size', 64, "Image size") ############## # Directories ############## tf.app.flags.DEFINE_string('model_dir', '../../models', "Output folder where checkpoints are dumped.") tf.app.flags.DEFINE_string('log_dir', '../../logs', "Logs for tensorboard.") tf.app.flags.DEFINE_string('fig_dir', '../../figures', "Where to save figures.") tf.app.flags.DEFINE_string('raw_dir', '../../data/raw', "Where raw data is saved") tf.app.flags.DEFINE_string('data_dir', '../../data/processed', "Where processed data is saved")
774
14,668
// 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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ #include <memory> #include <set> #include <string> #include <vector> #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/containers/unique_ptr_adapters.h" #include "base/memory/weak_ptr.h" #include "content/browser/devtools/protocol/devtools_domain_handler.h" #include "content/browser/devtools/protocol/input.h" #include "content/browser/renderer_host/input/synthetic_gesture.h" #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" #include "content/public/browser/render_widget_host.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/mojom/page/widget.mojom.h" namespace content { class DevToolsAgentHostImpl; class RenderFrameHostImpl; class RenderWidgetHostImpl; namespace protocol { class InputHandler : public DevToolsDomainHandler, public Input::Backend { public: InputHandler(bool allow_file_access, bool allow_sending_input_to_browser); InputHandler(const InputHandler&) = delete; InputHandler& operator=(const InputHandler&) = delete; ~InputHandler() override; static std::vector<InputHandler*> ForAgentHost(DevToolsAgentHostImpl* host); void Wire(UberDispatcher* dispatcher) override; void SetRenderer(int process_host_id, RenderFrameHostImpl* frame_host) override; void OnPageScaleFactorChanged(float page_scale_factor); void StartDragging(const blink::mojom::DragData& drag_data, blink::DragOperationsMask drag_operations_mask, bool* intercepted); Response Disable() override; void DispatchKeyEvent( const std::string& type, Maybe<int> modifiers, Maybe<double> timestamp, Maybe<std::string> text, Maybe<std::string> unmodified_text, Maybe<std::string> key_identifier, Maybe<std::string> code, Maybe<std::string> key, Maybe<int> windows_virtual_key_code, Maybe<int> native_virtual_key_code, Maybe<bool> auto_repeat, Maybe<bool> is_keypad, Maybe<bool> is_system_key, Maybe<int> location, Maybe<Array<std::string>> commands, std::unique_ptr<DispatchKeyEventCallback> callback) override; void InsertText(const std::string& text, std::unique_ptr<InsertTextCallback> callback) override; void ImeSetComposition( const std::string& text, int selection_start, int selection_end, Maybe<int> replacement_start, Maybe<int> replacement_end, std::unique_ptr<ImeSetCompositionCallback> callback) override; void DispatchMouseEvent( const std::string& event_type, double x, double y, Maybe<int> modifiers, Maybe<double> timestamp, Maybe<std::string> button, Maybe<int> buttons, Maybe<int> click_count, Maybe<double> force, Maybe<double> tangential_pressure, Maybe<int> tilt_x, Maybe<int> tilt_y, Maybe<int> twist, Maybe<double> delta_x, Maybe<double> delta_y, Maybe<std::string> pointer_type, std::unique_ptr<DispatchMouseEventCallback> callback) override; void DispatchDragEvent( const std::string& event_type, double x, double y, std::unique_ptr<Input::DragData> data, Maybe<int> modifiers, std::unique_ptr<DispatchDragEventCallback> callback) override; void DispatchTouchEvent( const std::string& type, std::unique_ptr<Array<Input::TouchPoint>> touch_points, protocol::Maybe<int> modifiers, protocol::Maybe<double> timestamp, std::unique_ptr<DispatchTouchEventCallback> callback) override; Response EmulateTouchFromMouseEvent(const std::string& type, int x, int y, const std::string& button, Maybe<double> timestamp, Maybe<double> delta_x, Maybe<double> delta_y, Maybe<int> modifiers, Maybe<int> click_count) override; Response SetIgnoreInputEvents(bool ignore) override; Response SetInterceptDrags(bool enabled) override; void SynthesizePinchGesture( double x, double y, double scale_factor, Maybe<int> relative_speed, Maybe<std::string> gesture_source_type, std::unique_ptr<SynthesizePinchGestureCallback> callback) override; void SynthesizeScrollGesture( double x, double y, Maybe<double> x_distance, Maybe<double> y_distance, Maybe<double> x_overscroll, Maybe<double> y_overscroll, Maybe<bool> prevent_fling, Maybe<int> speed, Maybe<std::string> gesture_source_type, Maybe<int> repeat_count, Maybe<int> repeat_delay_ms, Maybe<std::string> interaction_marker_name, std::unique_ptr<SynthesizeScrollGestureCallback> callback) override; void SynthesizeTapGesture( double x, double y, Maybe<int> duration, Maybe<int> tap_count, Maybe<std::string> gesture_source_type, std::unique_ptr<SynthesizeTapGestureCallback> callback) override; private: class InputInjector; void DispatchWebTouchEvent( const std::string& type, std::unique_ptr<Array<Input::TouchPoint>> touch_points, protocol::Maybe<int> modifiers, protocol::Maybe<double> timestamp, std::unique_ptr<DispatchTouchEventCallback> callback); void DispatchSyntheticPointerActionTouch( const std::string& type, std::unique_ptr<Array<Input::TouchPoint>> touch_points, protocol::Maybe<int> modifiers, protocol::Maybe<double> timestamp, std::unique_ptr<DispatchTouchEventCallback> callback); void OnWidgetForDispatchMouseEvent( std::unique_ptr<DispatchMouseEventCallback> callback, std::unique_ptr<blink::WebMouseEvent> mouse_event, blink::WebMouseWheelEvent* wheel_event, base::WeakPtr<RenderWidgetHostViewBase> target, absl::optional<gfx::PointF> point); void OnWidgetForDispatchDragEvent( const std::string& event_type, double x, double y, std::unique_ptr<Input::DragData> data, Maybe<int> modifiers, std::unique_ptr<DispatchDragEventCallback> callback, base::WeakPtr<RenderWidgetHostViewBase> target, absl::optional<gfx::PointF> point); void OnWidgetForDispatchWebTouchEvent( std::unique_ptr<DispatchTouchEventCallback> callback, std::vector<blink::WebTouchEvent> events, base::WeakPtr<RenderWidgetHostViewBase> target, absl::optional<gfx::PointF> point); SyntheticPointerActionParams PrepareSyntheticPointerActionParams( SyntheticPointerActionParams::PointerActionType pointer_action_type, int id, double x, double y, int key_modifiers, float radius_x = 1.f, float radius_y = 1.f, float rotation_angle = 0.f, float force = 1.f); void SynthesizeRepeatingScroll( SyntheticSmoothScrollGestureParams gesture_params, int repeat_count, base::TimeDelta repeat_delay, std::string interaction_marker_name, int id, std::unique_ptr<SynthesizeScrollGestureCallback> callback); void OnScrollFinished( SyntheticSmoothScrollGestureParams gesture_params, int repeat_count, base::TimeDelta repeat_delay, std::string interaction_marker_name, int id, std::unique_ptr<SynthesizeScrollGestureCallback> callback, SyntheticGesture::Result result); void ClearInputState(); bool PointIsWithinContents(gfx::PointF point) const; InputInjector* EnsureInjector(RenderWidgetHostImpl* widget_host); RenderWidgetHostViewBase* GetRootView(); RenderFrameHostImpl* host_; // WebContents associated with the |host_|. WebContents* web_contents_; std::unique_ptr<Input::Frontend> frontend_; base::flat_set<std::unique_ptr<InputInjector>, base::UniquePtrComparator> injectors_; float page_scale_factor_; int last_id_; bool ignore_input_events_ = false; bool intercept_drags_ = false; const bool allow_file_access_; const bool allow_sending_input_to_browser_ = false; std::set<int> pointer_ids_; std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; base::flat_map<int, blink::WebTouchPoint> touch_points_; base::WeakPtrFactory<InputHandler> weak_factory_{this}; }; } // namespace protocol } // namespace content #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_
3,561
1,040
// Copyright (c) <NAME> // Licensed under the MIT License // ====================================================================== // ORBITER SOFTWARE DEVELOPMENT KIT // ScnEditorAPI.h // Scenario editor plugin interface // ====================================================================== #ifndef __SCNEDITORAPI_H #define __SCNEDITORAPI_H #include "OrbiterAPI.h" #define WM_SCNEDITOR WM_USER #define SE_ADDFUNCBUTTON 0x01 #define SE_ADDPAGEBUTTON 0x02 #define SE_GETVESSEL 0x04 typedef void (*CustomButtonFunc)(OBJHANDLE); typedef struct { char btnlabel[32]; CustomButtonFunc func; } EditorFuncSpec; typedef struct { char btnlabel[32]; HINSTANCE hDLL; WORD ResId; DLGPROC TabProc; } EditorPageSpec; #endif // !__SCNEDITORAPI_H
278
337
package amazmod.com.transport.data; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import com.huami.watch.transport.DataBundle; import amazmod.com.transport.Transportable; public class BatteryData extends Transportable implements Parcelable { public static final String EXTRA = "batteryData"; private static final String LEVEL = "level"; private static final String CHARGING = "charging"; private static final String USB_CHARGE = "usb_charge"; private static final String AC_CHARGE = "ac_charge"; private static final String DATE_LAST_CHARGE = "date_last_charge"; private float level; private boolean charging; private boolean usbCharge; private boolean acCharge; private long dateLastCharge; public BatteryData() {} protected BatteryData(Parcel in) { level = in.readFloat(); charging = in.readByte() != 0; usbCharge = in.readByte() != 0; acCharge = in.readByte() != 0; dateLastCharge = in.readLong(); } public static final Creator<BatteryData> CREATOR = new Creator<BatteryData>() { @Override public BatteryData createFromParcel(Parcel in) { return new BatteryData(in); } @Override public BatteryData[] newArray(int size) { return new BatteryData[size]; } }; @Override public DataBundle toDataBundle(DataBundle dataBundle) { dataBundle.putFloat(LEVEL, level); dataBundle.putBoolean(CHARGING, charging); dataBundle.putBoolean(USB_CHARGE, usbCharge); dataBundle.putBoolean(AC_CHARGE, acCharge); dataBundle.putLong(DATE_LAST_CHARGE, dateLastCharge); return dataBundle; } @Override public Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putParcelable(EXTRA, this); return bundle; } public static BatteryData fromBundle(Bundle bundle) { return bundle.getParcelable(EXTRA); } public static BatteryData fromDataBundle(DataBundle dataBundle) { BatteryData batteryData = new BatteryData(); float level = dataBundle.getFloat(LEVEL); boolean charging = dataBundle.getBoolean(CHARGING); boolean usbCharge = dataBundle.getBoolean(USB_CHARGE); boolean acCharge = dataBundle.getBoolean(AC_CHARGE); long dateLastCharge = dataBundle.getLong(DATE_LAST_CHARGE); batteryData.setLevel(level); batteryData.setCharging(charging); batteryData.setUsbCharge(usbCharge); batteryData.setAcCharge(acCharge); batteryData.setDateLastCharge(dateLastCharge); return batteryData; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeFloat(level); dest.writeByte((byte) (charging ? 1 : 0)); dest.writeByte((byte) (usbCharge ? 1 : 0)); dest.writeByte((byte) (acCharge ? 1 : 0)); dest.writeLong(dateLastCharge); } public float getLevel() { return level; } public void setLevel(float level) { this.level = level; } public boolean isCharging() { return charging; } public void setCharging(boolean charging) { this.charging = charging; } public boolean isUsbCharge() { return usbCharge; } public void setUsbCharge(boolean usbCharge) { this.usbCharge = usbCharge; } public boolean isAcCharge() { return acCharge; } public void setAcCharge(boolean acCharge) { this.acCharge = acCharge; } public long getDateLastCharge() { return dateLastCharge; } public void setDateLastCharge(long dateLastCharge) { this.dateLastCharge = dateLastCharge; } }
1,518
2,023
#### The recipe from __future__ import generators from inspect import getargspec, formatargspec _redefinition = """ _redef_tmp = %(name)s def %(name)s%(oldargs)s: wrapped = type('_GeneratorWrapper', (object,), %(name)s._realgen.__dict__)() wrapped.__iter__ = lambda self: self wrapped.next = %(name)s._realgen%(newargs)s.next return wrapped %(name)s.__doc__ = _redef_tmp.__doc__ %(name)s._realgen = _redef_tmp del _redef_tmp """ def enableAttributes(genfunc): """Wrapper for generators to enable classlike attribute access. The generator definition should specify 'self' as the first parameter. Calls to a wrapped generator should ignore the self parameter. """ old = getargspec(genfunc) old[0].pop(0) new = getargspec(genfunc) new[0][0] = 'wrapped' specs = {'name': genfunc.func_name, 'oldargs': formatargspec(*old), 'newargs': formatargspec(*new)} exec(_redefinition % specs, genfunc.func_globals) #### A minimal, complete example def outputCaps(self, logfile): """Convert to uppercase and emit to stdout and logfile""" self.lineno = 1 while True: logfile.write(self.line.upper()) print self.prefix, self.line.upper(), yield None self.lineno += 1 outputCaps.prefix = 'Capitalized:' # Make a class var style default enableAttributes(outputCaps) # Wrap the generator in a class g = outputCaps(open('destfil.txt','w')) for line in open('sourcefil.txt'): g.line = line.rstrip() # Data can be passed into the generator g.next() print g.lineno # Generators can also update the attributes print dir(g) # Still has __iter__() and next() print outputCaps.__doc__ # Docstrings survive wrapping print g.prefix # Gen attributes carry through to instances help(outputCaps) # PyDoc produces an accurate help screen
714
716
package com.netflix.exhibitor.core.automanage; import com.google.common.collect.Lists; import com.netflix.exhibitor.core.Exhibitor; import com.netflix.exhibitor.core.activity.ActivityLog; import com.netflix.exhibitor.core.config.IntConfigs; import com.netflix.exhibitor.core.state.InstanceStateTypes; import com.netflix.exhibitor.core.state.ServerList; import com.netflix.exhibitor.core.state.ServerSpec; import com.netflix.exhibitor.core.state.ServerType; import com.netflix.exhibitor.core.state.UsState; import java.util.List; import java.util.Map; class FixedEnsembleBuilder implements EnsembleBuilder { private final Exhibitor exhibitor; private final ClusterState clusterState; private final UsState usState; private final int fixedEnsembleSize; FixedEnsembleBuilder(Exhibitor exhibitor, ClusterState clusterState) { this.exhibitor = exhibitor; this.clusterState = clusterState; usState = new UsState(exhibitor); fixedEnsembleSize = exhibitor.getConfigManager().getConfig().getInt(IntConfigs.AUTO_MANAGE_INSTANCES_FIXED_ENSEMBLE_SIZE); } @SuppressWarnings("SimplifiableIfStatement") @Override public boolean newEnsembleNeeded() { if ( (usState.getUs() != null) ) { // we're in the ensemble - nothing to do return false; } if ( clusterState.getConfiguredServerList().getSpecs().size() < fixedEnsembleSize ) { return true; // there's room, we can add ourselves in } if ( !clusterState.hasDeadInstances() ) { exhibitor.getLog().add(ActivityLog.Type.INFO, "Cannot add this instance to the ensemble as the ensemble is at the configured fixed ensemble size."); return false; } return true; } @Override public ServerList createPotentialServerList() { ServerList configuredServerList = clusterState.getConfiguredServerList(); Map<ServerSpec, InstanceStateTypes> statusMap = clusterState.buildStatusMap(); List<ServerSpec> newList = Lists.newArrayList(); for ( ServerSpec spec : configuredServerList.getSpecs() ) { if ( statusMap.get(spec) != InstanceStateTypes.DOWN ) { newList.add(spec); } } if ( newList.size() >= fixedEnsembleSize ) { return configuredServerList; // no room for us } int standardTypeCount = 0; for ( ServerSpec spec : newList ) { if ( spec.getServerType() == ServerType.STANDARD ) { ++standardTypeCount; } } int observerThreshold = exhibitor.getConfigManager().getConfig().getInt(IntConfigs.OBSERVER_THRESHOLD); ServerType serverType = ((observerThreshold > 0) && (standardTypeCount >= observerThreshold)) ? ServerType.OBSERVER : ServerType.STANDARD; int existingMaxId = FlexibleEnsembleBuilder.getExistingMaxId(configuredServerList); ServerSpec us = new ServerSpec(exhibitor.getThisJVMHostname(), existingMaxId + 1, serverType); newList.add(us); return new ServerList(newList); } }
1,304
2,206
<filename>rl4j/rl4j-core/src/main/java/org/deeplearning4j/rl4j/agent/learning/algorithm/nstepqlearning/NStepQLearning.java /* * ****************************************************************************** * * * * * * This program and the accompanying materials are made available under the * * terms of the Apache License, Version 2.0 which is available at * * https://www.apache.org/licenses/LICENSE-2.0. * * * * See the NOTICE file distributed with this work for additional * * information regarding copyright ownership. * * 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. * * * * SPDX-License-Identifier: Apache-2.0 * ***************************************************************************** */ package org.deeplearning4j.rl4j.agent.learning.algorithm.nstepqlearning; import lombok.Builder; import lombok.Data; import lombok.NonNull; import lombok.experimental.SuperBuilder; import org.deeplearning4j.rl4j.agent.learning.algorithm.IUpdateAlgorithm; import org.deeplearning4j.rl4j.agent.learning.update.Features; import org.deeplearning4j.rl4j.agent.learning.update.FeaturesBuilder; import org.deeplearning4j.rl4j.agent.learning.update.FeaturesLabels; import org.deeplearning4j.rl4j.agent.learning.update.Gradients; import org.deeplearning4j.rl4j.experience.StateActionReward; import org.deeplearning4j.rl4j.network.CommonLabelNames; import org.deeplearning4j.rl4j.network.CommonOutputNames; import org.deeplearning4j.rl4j.network.IOutputNeuralNet; import org.deeplearning4j.rl4j.network.ITrainableNeuralNet; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j; import java.util.List; public class NStepQLearning implements IUpdateAlgorithm<Gradients, StateActionReward<Integer>> { private final ITrainableNeuralNet threadCurrent; private final IOutputNeuralNet target; private final double gamma; private final NStepQLearningHelper algorithmHelper; private final FeaturesBuilder featuresBuilder; /** * @param threadCurrent The &theta;' parameters (the thread-specific network) * @param target The &theta;<sup>&ndash;</sup> parameters (the global target network) * @param actionSpaceSize The numbers of possible actions that can be taken on the environment */ public NStepQLearning(@NonNull ITrainableNeuralNet threadCurrent, @NonNull IOutputNeuralNet target, int actionSpaceSize, @NonNull Configuration configuration) { this.threadCurrent = threadCurrent; this.target = target; this.gamma = configuration.getGamma(); algorithmHelper = threadCurrent.isRecurrent() ? new RecurrentNStepQLearningHelper(actionSpaceSize) : new NonRecurrentNStepQLearningHelper(actionSpaceSize); featuresBuilder = new FeaturesBuilder(threadCurrent.isRecurrent()); } @Override public Gradients compute(List<StateActionReward<Integer>> trainingBatch) { int size = trainingBatch.size(); StateActionReward<Integer> stateActionReward = trainingBatch.get(size - 1); Features features = featuresBuilder.build(trainingBatch); INDArray labels = algorithmHelper.createLabels(size); double r; if (stateActionReward.isTerminal()) { r = 0; } else { INDArray expectedValuesOfLast = algorithmHelper.getTargetExpectedQValuesOfLast(target, trainingBatch, features); r = Nd4j.max(expectedValuesOfLast).getDouble(0); } for (int i = size - 1; i >= 0; --i) { stateActionReward = trainingBatch.get(i); r = stateActionReward.getReward() + gamma * r; INDArray expectedQValues = threadCurrent.output(stateActionReward.getObservation()).get(CommonOutputNames.QValues); expectedQValues = expectedQValues.putScalar(stateActionReward.getAction(), r); algorithmHelper.setLabels(labels, i, expectedQValues); } FeaturesLabels featuresLabels = new FeaturesLabels(features); featuresLabels.putLabels(CommonLabelNames.QValues, labels); return threadCurrent.computeGradients(featuresLabels); } @SuperBuilder @Data public static class Configuration { /** * The discount factor (default is 0.99) */ @Builder.Default double gamma = 0.99; } }
1,649
1,170
// // VHLanguagesButton.h // VHGithubNotifier // // Created by Nightonke on 2017/9/23. // Copyright © 2017年 黄伟平. All rights reserved. // #import "VHCursorButton.h" @interface VHLanguagesButton : VHCursorButton - (void)setSelectedLanguageIDs:(NSSet<NSNumber *> *)languageIDs; @end
112
1,345
<gh_stars>1000+ from typing import Any, Dict, Union import numpy as np from pydantic import validator from ...utils.events import EventedModel from ...utils.events.custom_types import Array from ..translations import trans from .categorical_colormap_utils import ColorCycle, compare_colormap_dicts from .standardize_color import transform_color class CategoricalColormap(EventedModel): """Colormap that relates categorical values to colors. Parameters ---------- colormap : Dict[Any, np.ndarray] The mapping between categorical property values and color. fallback_color : ColorCycle The color to be used in the case that a value is mapped that is not in colormap. This can be given as any ColorType and it will be converted to a ColorCycle. An array of the values contained in the ColorCycle.cycle is stored in ColorCycle.values. The default value is a cycle of all white. """ colormap: Dict[Any, Array[np.float32, (4,)]] = {} fallback_color: ColorCycle = 'white' @validator('colormap', pre=True) def _standardize_colormap(cls, v): transformed_colormap = {k: transform_color(v)[0] for k, v in v.items()} return transformed_colormap def map(self, color_properties: Union[list, np.ndarray]) -> np.ndarray: """Map an array of values to an array of colors Parameters ---------- color_properties : Union[list, np.ndarray] The property values to be converted to colors. Returns ------- colors : np.ndarray An Nx4 color array where N is the number of property values provided. """ if isinstance(color_properties, (list, np.ndarray)): color_properties = np.asarray(color_properties) else: color_properties = np.asarray([color_properties]) # add properties if they are not in the colormap color_cycle_keys = [*self.colormap] props_in_map = np.in1d(color_properties, color_cycle_keys) if not np.all(props_in_map): new_prop_values = color_properties[np.logical_not(props_in_map)] indices_to_add = np.unique(new_prop_values, return_index=True)[1] props_to_add = [ new_prop_values[index] for index in sorted(indices_to_add) ] for prop in props_to_add: new_color = next(self.fallback_color.cycle) self.colormap[prop] = np.squeeze(transform_color(new_color)) # map the colors colors = np.array([self.colormap[x] for x in color_properties]) return colors @classmethod def from_array(cls, fallback_color): return cls(fallback_color=fallback_color) @classmethod def from_dict(cls, params: dict): if ('colormap' in params) or ('fallback_color' in params): if 'colormap' in params: colormap = { k: transform_color(v)[0] for k, v in params['colormap'].items() } else: colormap = {} if 'fallback_color' in params: fallback_color = params['fallback_color'] else: fallback_color = 'white' else: colormap = {k: transform_color(v)[0] for k, v in params.items()} fallback_color = 'white' return cls(colormap=colormap, fallback_color=fallback_color) @classmethod def __get_validators__(cls): yield cls.validate_type @classmethod def validate_type(cls, val): if isinstance(val, cls): return val if isinstance(val, list) or isinstance(val, np.ndarray): return cls.from_array(val) elif isinstance(val, dict): return cls.from_dict(val) else: raise TypeError( trans._( 'colormap should be an array or dict', deferred=True, ) ) def __eq__(self, other): if isinstance(other, CategoricalColormap): if not compare_colormap_dicts(self.colormap, other.colormap): return False if not np.allclose( self.fallback_color.values, other.fallback_color.values ): return False return True else: return False
2,021
1,694
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>. // #import <MMCommon/WXPBGeneratedMessage.h> @class AdExposureInfo, AdExposureSocialInfo, BaseRequest, NSString; @interface AdExposureRequest : WXPBGeneratedMessage { } + (void)initialize; // Remaining properties @property(nonatomic) unsigned int adType; // @dynamic adType; @property(retain, nonatomic) BaseRequest *baseRequest; // @dynamic baseRequest; @property(retain, nonatomic) NSString *bssid; // @dynamic bssid; @property(retain, nonatomic) NSString *descxml; // @dynamic descxml; @property(nonatomic) unsigned int exposureCnt; // @dynamic exposureCnt; @property(nonatomic) unsigned int exposureDuration; // @dynamic exposureDuration; @property(retain, nonatomic) AdExposureInfo *exposureInfo; // @dynamic exposureInfo; @property(nonatomic) unsigned long long feedDuration; // @dynamic feedDuration; @property(nonatomic) unsigned long long feedFullDuration; // @dynamic feedFullDuration; @property(nonatomic) unsigned int scene; // @dynamic scene; @property(retain, nonatomic) NSString *snsStatext; // @dynamic snsStatext; @property(retain, nonatomic) AdExposureSocialInfo *socialInfo; // @dynamic socialInfo; @property(nonatomic) unsigned int source; // @dynamic source; @property(retain, nonatomic) NSString *ssid; // @dynamic ssid; @property(nonatomic) unsigned long long timestampMs; // @dynamic timestampMs; @property(nonatomic) unsigned int type; // @dynamic type; @property(retain, nonatomic) NSString *viewid; // @dynamic viewid; @end
511
336
<gh_stars>100-1000 package com.shazam.fork.model; import com.google.common.base.Objects; import java.util.concurrent.atomic.AtomicInteger; public class TestCaseEventCounter { public static final TestCaseEventCounter EMPTY = new TestCaseEventCounter(null, 0); private TestCaseEvent testCaseEvent; private AtomicInteger count; public TestCaseEventCounter(TestCaseEvent testCaseEvent, int initialCount) { this.testCaseEvent = testCaseEvent; this.count = new AtomicInteger(initialCount); } public int increaseCount() { return count.incrementAndGet(); } public TestCaseEvent getTestCaseEvent() { return testCaseEvent; } public int getCount() { return count.get(); } public TestCaseEventCounter withIncreasedCount() { increaseCount(); return this; } @Override public int hashCode() { return testCaseEvent.hashCode(); } @Override public boolean equals(Object obj) { if (obj == null) return false; if (getClass() != obj.getClass()) return false; final TestCaseEventCounter other = (TestCaseEventCounter) obj; return Objects.equal(this.testCaseEvent, other.testCaseEvent); } }
450
1,062
<reponame>larkov/MailTrackerBlocker<gh_stars>1000+ // // Generated by class-dump 3.5b1 (64 bit) (Debug version compiled Dec 3 2019 19:59:57). // // Copyright (C) 1997-2019 <NAME>. // #import <objc/NSObject.h> @class MCMessage, MFMessageThread; @interface MessageListItem : NSObject { MCMessage *_message; // 8 = 0x8 MFMessageThread *_messageThread; // 16 = 0x10 long long _type; // 24 = 0x18 long long _providerType; // 32 = 0x20 } + (id)messagesFromMessageListItems:(id)arg1; // IMP=0x00000001001e6a8e + (id)messageListItemForMessageOrThread:(id)arg1 providerType:(long long)arg2; // IMP=0x00000001001e695e + (id)searchProgressMessageListItem; // IMP=0x00000001001e6921 + (id)topHitsHeaderMessageListItem; // IMP=0x00000001001e68e4 + (id)sortViewHeaderMessageListItem; // IMP=0x00000001001e68a7 @property(readonly, nonatomic) long long providerType; // @synthesize providerType=_providerType; @property(readonly, nonatomic) long long type; // @synthesize type=_type; @property(readonly, nonatomic) MFMessageThread *messageThread; // @synthesize messageThread=_messageThread; @property(readonly, nonatomic) MCMessage *message; // @synthesize message=_message; // - (void).cxx_destruct; // IMP=0x00000001001e709c - (id)description; // IMP=0x00000001001e6e7c - (BOOL)isEqual:(id)arg1; // IMP=0x00000001001e6d3d @property(readonly, nonatomic) MCMessage *snippetMessage; @property(readonly, nonatomic) BOOL isTopHit; @property(readonly, nonatomic) BOOL isMessageOrThread; - (id)initWithType:(long long)arg1 message:(id)arg2 providerType:(long long)arg3; // IMP=0x00000001001e69fa @end
606
2,137
package com.publiccms.views.method.tools; import java.util.List; import org.springframework.stereotype.Component; import com.publiccms.common.base.BaseMethod; import com.publiccms.common.tools.CommonUtils; import com.publiccms.common.tools.VerificationUtils; import freemarker.template.TemplateModelException; /** * * GetMd5Method * */ @Component public class GetSha512Method extends BaseMethod { @SuppressWarnings("unchecked") @Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { String string = getString(0, arguments); if (CommonUtils.notEmpty(string)) { return VerificationUtils.sha512Encode(string); } return null; } @Override public boolean needAppToken() { return false; } @Override public int minParametersNumber() { return 1; } }
372
1,062
<reponame>larkov/MailTrackerBlocker<gh_stars>1000+ // // Generated by class-dump 3.5b1 (64 bit) (Debug version compiled Dec 3 2019 19:59:57). // // Copyright (C) 1997-2019 <NAME>. // #import "NSObject-Protocol.h" @class NSCoder, NSString; @protocol NSWindowRestoration <NSObject> + (void)restoreWindowWithIdentifier:(NSString *)arg1 state:(NSCoder *)arg2 completionHandler:(void (^)(NSWindow *, NSError *))arg3; @end
160
1,350
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.azure.storage.blob.implementation.util; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public enum BlobRequestConditionProperty { LEASE_ID("LeaseId"), TAGS_CONDITIONS("TagsConditions"), IF_MODIFIED_SINCE("IfModifiedSince"), IF_UNMODIFIED_SINCE("IfUnmodifiedSince"), IF_MATCH("IfMatch"), IF_NONE_MATCH("IfNoneMatch"); /** The actual serialized value for a BlobRequestConditionProperty instance. */ private final String value; BlobRequestConditionProperty(String value) { this.value = value; } /** * Parses a serialized value to a BlobRequestConditionProperty instance. * * @param value the serialized value to parse. * @return the parsed BlobRequestConditionProperty object, or null if unable to parse. */ @JsonCreator public static BlobRequestConditionProperty fromString(String value) { BlobRequestConditionProperty[] items = BlobRequestConditionProperty.values(); for (BlobRequestConditionProperty item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } } return null; } @JsonValue @Override public String toString() { return this.value; } }
520
506
<gh_stars>100-1000 // https://www.codechef.com/SEPT17/problems/CHEFSUM/ #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<int> vi; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; vi v = vi(n); vll prefix = vll(n, 0); for (int j = 0; j < n; j++) { cin >> v[j]; prefix[j] += v[j]; if (j > 0) { prefix[j] += prefix[j-1]; } } vll suffix = vll(n); suffix[n - 1] = v[n - 1]; for (int j = n - 2; j >= 0; j--) { suffix[j] += suffix[j + 1] + v[j]; } int m = 0; ll sum = 100000000000; for (int j = 0; j < n; j++) { ll x = prefix[j] + suffix[j]; if (x < sum) { m = j; sum = x; } } cout << m + 1 << endl; } }
451
416
package org.simpleflatmapper.reflect.getter; import org.simpleflatmapper.reflect.IndexedGetter; import java.lang.reflect.Array; public class ArrayIndexedGetter<P> implements IndexedGetter<Object,P> { @SuppressWarnings("unchecked") @Override public P get(Object target, int index) { return (P) Array.get(target, index); } }
127
4,238
#!/usr/bin/env python from unittest import mock from absl.testing import absltest from grr_response_client.client_actions.windows import windows from grr_response_core.lib.rdfvalues import protodict as rdf_protodict from grr.test_lib import client_test_lib class WindowsActionTests(absltest.TestCase): def testEnumerateInterfaces(self): replies = [] enumif = windows.EnumerateInterfaces() enumif.SendReply = replies.append enumif.Run(None) self.assertNotEmpty(replies) found_address = False for interface in replies: for address in interface.addresses: self.assertNotEmpty(address.human_readable_address) found_address = True if not found_address: self.fail("Not a single address found in EnumerateInterfaces {}".format( replies)) def testEnumerateInterfacesMock(self): # Stub out wmi.WMI().Win32_NetworkAdapterConfiguration() wmi = mock.MagicMock() wmi.Win32_NetworkAdapterConfiguration.return_value = [ client_test_lib.WMIWin32NetworkAdapterConfigurationMock() ] replies = [] with mock.patch.object(windows.wmi, "WMI", return_value=wmi): enumif = windows.EnumerateInterfaces() enumif.SendReply = replies.append enumif.Run(None) self.assertLen(replies, 1) interface = replies[0] self.assertLen(interface.addresses, 4) addresses = [x.human_readable_address for x in interface.addresses] self.assertCountEqual(addresses, [ "192.168.1.20", "fc00:e968:6179::de52:7100:aaaa:1111:aaaa", "fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b", "fc00:e968:6179::de52:7100" ]) def testRunWMI(self): result_list = list(windows.RunWMIQuery("SELECT * FROM Win32_logicalDisk")) self.assertNotEmpty(result_list) drive = result_list[0] self.assertIsInstance(drive, rdf_protodict.Dict) self.assertNotEmpty(drive["DeviceID"]) self.assertGreater(int(drive["Size"]), 0) def testRunWMIMocked(self): with mock.patch.object(windows, "win32com") as win32com: wmi_obj = win32com.client.GetObject.return_value mock_query_result = mock.MagicMock() mock_query_result.Properties_ = [] mock_config = client_test_lib.WMIWin32NetworkAdapterConfigurationMock wmi_properties = mock_config.__dict__.items() for key, value in wmi_properties: keyval = mock.MagicMock() keyval.Name, keyval.Value = key, value mock_query_result.Properties_.append(keyval) wmi_obj.ExecQuery.return_value = [mock_query_result] result_list = list(windows.RunWMIQuery("select blah")) self.assertLen(result_list, 1) result = result_list.pop() self.assertIsInstance(result, rdf_protodict.Dict) nest = result["NestingTest"] self.assertEqual(nest["one"]["two"], [3, 4]) self.assertIn("Unsupported type", nest["one"]["broken"]) self.assertIsInstance(nest["one"]["three"], rdf_protodict.Dict) self.assertEqual(nest["four"], []) self.assertEqual(nest["five"], "astring") self.assertEqual(nest["six"], [None, None, ""]) self.assertEqual(nest["seven"], None) self.assertCountEqual(nest["rdfvalue"].keys(), ["a"]) self.assertEqual(result["GatewayCostMetric"], [0, 256]) self.assertIsInstance(result["OpaqueObject"], str) self.assertIn("Unsupported type", result["OpaqueObject"]) if __name__ == "__main__": absltest.main()
1,345
2,828
<filename>curator-examples/src/main/java/pubsub/messages/LocationAvailable.java /** * 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 pubsub.messages; import pubsub.models.Message; import pubsub.models.Priority; import java.time.Duration; import java.util.Objects; public class LocationAvailable extends Message { private final String name; private final Duration availableUntil; public LocationAvailable() { this(Priority.low, "", Duration.ZERO); } public LocationAvailable(Priority priority, String name, Duration availableUntil) { super(priority); this.name = Objects.requireNonNull(name, "name cannot be null"); this.availableUntil = Objects.requireNonNull(availableUntil, "availableUntil cannot be null"); } public LocationAvailable(String id, Priority priority, String name, Duration availableUntil) { super(id, priority); this.name = Objects.requireNonNull(name, "name cannot be null"); this.availableUntil = Objects.requireNonNull(availableUntil, "availableUntil cannot be null"); } @Override public String toString() { return "LocationAvailable{" + "name='" + name + '\'' + ", availableUntil=" + availableUntil + "} " + super.toString(); } }
601
458
<reponame>niranjanchintu/hyscale /** * Copyright 2019 <NAME>, Inc. * * 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 io.hyscale.controller.validator.impl; import com.fasterxml.jackson.core.type.TypeReference; import io.hyscale.commons.exception.HyscaleException; import io.hyscale.commons.logger.LoggerTags; import io.hyscale.commons.logger.WorkflowLogger; import io.hyscale.commons.validator.Validator; import io.hyscale.controller.activity.ValidatorActivity; import io.hyscale.controller.model.WorkflowContext; import io.hyscale.generator.services.builder.DefaultPortsBuilder; import io.hyscale.servicespec.commons.fields.HyscaleSpecFields; import io.hyscale.servicespec.commons.model.service.Agent; import io.hyscale.servicespec.commons.model.service.Port; import io.hyscale.servicespec.commons.model.service.ServiceSpec; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; /** * Validates the both Service and * Agent Ports present in Hspec on * Duplication of Ports etc. */ @Component public class PortsValidator implements Validator<WorkflowContext> { private static final Logger logger = LoggerFactory.getLogger(PortsValidator.class); @Autowired DefaultPortsBuilder defaultPortsBuilder; @Override public boolean validate(WorkflowContext workflowContext) throws HyscaleException { ServiceSpec serviceSpec = workflowContext.getServiceSpec(); List<Port> servicePorts = serviceSpec.get(HyscaleSpecFields.ports, new TypeReference<>() { }); List<Agent> agents = serviceSpec.get(HyscaleSpecFields.agents, new TypeReference<>() { }); return checkDuplicatePorts(servicePorts, agents); } public boolean checkDuplicatePorts(List<Port> servicePorts, List<Agent> agents) { if (CollectionUtils.isEmpty(servicePorts) || CollectionUtils.isEmpty(agents)) { return true; } List<String> exposedPorts = new ArrayList<>(); servicePorts.stream().forEach(port -> exposedPorts.add(defaultPortsBuilder.updatePortProtocol(port).getPort())); StringBuilder duplicatePortsList = new StringBuilder(); boolean portsValid = true; // Check for duplicate ports being exposed in service or agents for (Agent agent : agents) { if (CollectionUtils.isNotEmpty(agent.getPorts())) { for (Port port : agent.getPorts()) { port = defaultPortsBuilder.updatePortProtocol(port); if (exposedPorts.contains(port.getPort())) { duplicatePortsList.append(port.getPort()).append(" "); portsValid = false; } exposedPorts.add(port.getPort()); } } } if (!portsValid) { logger.info("Duplicate Port Exposed in Spec {} ", duplicatePortsList); WorkflowLogger.persist(ValidatorActivity.DUPLICATE_PORTS, LoggerTags.ERROR, duplicatePortsList.toString()); } return portsValid; } }
1,389
30,023
<gh_stars>1000+ """Tests for the Coolmaster component."""
19
14,668
// Copyright 2012 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_VIZ_SERVICE_DISPLAY_OUTPUT_SURFACE_H_ #define COMPONENTS_VIZ_SERVICE_DISPLAY_OUTPUT_SURFACE_H_ #include <memory> #include <vector> #include "base/callback_helpers.h" #include "base/memory/ref_counted.h" #include "base/threading/thread_checker.h" #include "components/viz/common/display/update_vsync_parameters_callback.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/gpu/gpu_vsync_callback.h" #include "components/viz/common/resources/resource_format.h" #include "components/viz/common/resources/returned_resource.h" #include "components/viz/service/display/pending_swap_params.h" #include "components/viz/service/display/software_output_device.h" #include "components/viz/service/viz_service_export.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/texture_in_use_response.h" #include "gpu/ipc/common/surface_handle.h" #include "gpu/ipc/gpu_task_scheduler_helper.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "skia/ext/skia_matrix_44.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/gfx/color_space.h" #include "ui/gfx/overlay_transform.h" #include "ui/gfx/surface_origin.h" #include "ui/latency/latency_info.h" namespace gfx { namespace mojom { class DelegatedInkPointRenderer; } // namespace mojom class ColorSpace; class Rect; class Size; struct SwapResponse; } // namespace gfx namespace viz { class OutputSurfaceClient; class OutputSurfaceFrame; class SkiaOutputSurface; // This class represents a platform-independent API for presenting // buffers to display via GPU or software compositing. Implementations // can provide platform-specific behaviour. class VIZ_SERVICE_EXPORT OutputSurface { public: enum Type { kSoftware = 0, kOpenGL = 1, kVulkan = 2, }; enum class OrientationMode { kLogic, // The orientation same to logical screen orientation as seen by // the user. kHardware, // The orientation same to the hardware. }; struct Capabilities { Capabilities(); Capabilities(const Capabilities& capabilities); Capabilities& operator=(const Capabilities& capabilities); PendingSwapParams pending_swap_params{1}; // The number of buffers for the SkiaOutputDevice. If the // |supports_post_sub_buffer| true, SkiaOutputSurfaceImpl will track target // damaged area based on this number. int number_of_buffers = 2; // Whether this output surface renders to the default OpenGL zero // framebuffer or to an offscreen framebuffer. bool uses_default_gl_framebuffer = true; // Where (0,0) is on this OutputSurface. gfx::SurfaceOrigin output_surface_origin = gfx::SurfaceOrigin::kBottomLeft; // Whether this OutputSurface supports stencil operations or not. // Note: HasExternalStencilTest() must return false when an output surface // has been configured for stencil usage. bool supports_stencil = false; // Whether this OutputSurface supports post sub buffer or not. bool supports_post_sub_buffer = false; // Whether this OutputSurface supports commit overlay planes. bool supports_commit_overlay_planes = false; // Whether this OutputSurface permits scheduling an isothetic sub-rectangle // (i.e. viewport) of its contents for display, allowing the DirectRenderer // to apply resize optimization by padding to its width/height. bool supports_viewporter = false; // Whether this OutputSurface supports gpu vsync callbacks. bool supports_gpu_vsync = false; // OutputSurface's orientation mode. OrientationMode orientation_mode = OrientationMode::kLogic; // Whether this OutputSurface supports direct composition layers. bool supports_dc_layers = false; // Whether this OutputSurface should skip DrawAndSwap(). This is true for // the unified display on Chrome OS. All drawing is handled by the physical // displays so the unified display should skip that work. bool skips_draw = false; // Indicates whether this surface will invalidate only the damage rect. // When this is false contents outside the damaged area might need to be // recomposited to the surface. bool only_invalidates_damage_rect = true; // Whether OutputSurface::GetTargetDamageBoundingRect is implemented and // will return a bounding rectangle of the target buffer invalidated area. bool supports_target_damage = false; // Whether the gpu supports surfaceless surface (equivalent of using buffer // queue). bool supports_surfaceless = false; // This is copied over from gpu feature info since there is no easy way to // share that out of skia output surface. bool android_surface_control_feature_enabled = false; // True if the buffer content will be preserved after presenting. bool preserve_buffer_content = false; // True if the SkiaOutputDevice will set // SwapBuffersCompleteParams::frame_buffer_damage_area for every // SwapBuffers complete callback. bool damage_area_from_skia_output_device = false; // This is the maximum size for RenderPass textures. No maximum size is // enforced if zero. int max_render_target_size = 0; // The root surface is rendered using vulkan secondary command buffer. bool root_is_vulkan_secondary_command_buffer = false; // Some new Intel GPUs support two YUV MPO planes. Promoting two videos // to hardware overlays in these platforms will benefit power consumption. bool supports_two_yuv_hardware_overlays = false; // True if the OS supports delegated ink trails. // This is currently only implemented on Win10 with DirectComposition on the // SkiaRenderer. bool supports_delegated_ink = false; // True if the OutputSurface can resize to match the size of the root // surface. E.g. Wayland protocol allows this. bool resize_based_on_root_surface = false; // Some configuration supports allocating frame buffers on demand. // When enabled, `number_of_buffers` should be interpreted as the maximum // number of buffers to allocate. bool use_dynamic_frame_buffer_allocation = false; // SkColorType for all supported buffer formats. SkColorType sk_color_types[static_cast<int>(gfx::BufferFormat::LAST) + 1] = {}; }; // Constructor for skia-based compositing. explicit OutputSurface(Type type); // Constructor for GL-based compositing. explicit OutputSurface(scoped_refptr<ContextProvider> context_provider); // Constructor for software compositing. explicit OutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device); OutputSurface(const OutputSurface&) = delete; OutputSurface& operator=(const OutputSurface&) = delete; virtual ~OutputSurface(); const Capabilities& capabilities() const { return capabilities_; } Type type() const { return type_; } // Obtain the 3d context or the software device associated with this output // surface. Either of these may return a null pointer, but not both. // In the event of a lost context, the entire output surface should be // recreated. ContextProvider* context_provider() const { return context_provider_.get(); } SoftwareOutputDevice* software_device() const { return software_device_.get(); } // Downcasts to SkiaOutputSurface if it is one and returns nullptr otherwise. virtual SkiaOutputSurface* AsSkiaOutputSurface(); void set_color_matrix(const skia::Matrix44& color_matrix) { color_matrix_ = color_matrix; } const skia::Matrix44& color_matrix() const { return color_matrix_; } // Only useful for GPU backend. virtual gpu::SurfaceHandle GetSurfaceHandle() const; virtual void BindToClient(OutputSurfaceClient* client) = 0; virtual void EnsureBackbuffer() = 0; virtual void DiscardBackbuffer() = 0; // Bind the default framebuffer for drawing to, only valid for GL backed // OutputSurfaces. virtual void BindFramebuffer() = 0; // Marks that the given rectangle will be drawn to on the default, bound // framebuffer. Only valid if |capabilities().supports_dc_layers| is true. virtual void SetDrawRectangle(const gfx::Rect& rect); // Enable or disable DC layers. Must be called before DC layers are scheduled. // Only valid if |capabilities().supports_dc_layers| is true. virtual void SetEnableDCLayers(bool enabled); // Returns true if a main image overlay plane should be scheduled. virtual bool IsDisplayedAsOverlayPlane() const = 0; // Get the texture for the main image's overlay. virtual unsigned GetOverlayTextureId() const = 0; // Returns the |mailbox| corresponding to the main image's overlay. virtual gpu::Mailbox GetOverlayMailbox() const; virtual void Reshape(const gfx::Size& size, float device_scale_factor, const gfx::ColorSpace& color_space, gfx::BufferFormat format, bool use_stencil) = 0; virtual bool HasExternalStencilTest() const = 0; virtual void ApplyExternalStencil() = 0; // Gives the GL internal format that should be used for calling CopyTexImage2D // when the framebuffer is bound via BindFramebuffer(). virtual uint32_t GetFramebufferCopyTextureFormat() = 0; // Swaps the current backbuffer to the screen. For successful swaps, the // implementation must call OutputSurfaceClient::DidReceiveSwapBuffersAck() // after returning from this method in order to unblock the next frame. virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; // Returns a rectangle whose contents may have changed since the current // buffer was last submitted and needs to be redrawn. For partial swap, // the contents outside this rectangle can be considered valid and do not need // to be redrawn. // In cases where partial swap is disabled, this method will still be called. // The direct renderer will union the returned rect with the rectangle of the // surface itself. // TODO(dcastagna): Consider making the following pure virtual. virtual gfx::Rect GetCurrentFramebufferDamage() const; // Updates the GpuFence associated with this surface. The id of a newly // created GpuFence is returned, or if an error occurs, or fences are not // supported, the special id of 0 (meaning "no fence") is returned. In all // cases, any previously associated fence is destroyed. The returned fence id // corresponds to the GL id used by the CHROMIUM_gpu_fence GL extension and // can be passed directly to any related extension functions. virtual unsigned UpdateGpuFence() = 0; // Sets callback to receive updated vsync parameters after SwapBuffers() if // supported. virtual void SetUpdateVSyncParametersCallback( UpdateVSyncParametersCallback callback) = 0; // Set a callback for vsync signal from GPU service for begin frames. The // callbacks must be received on the calling thread. virtual void SetGpuVSyncCallback(GpuVSyncCallback callback); // Enable or disable vsync callback based on whether begin frames are needed. virtual void SetGpuVSyncEnabled(bool enabled); // When the device is rotated, the scene prepared by the UI is in the logical // screen space as seen by the user. However, attempting to scanout a buffer // with its content in this logical space may be unsupported or inefficient // when rendered by the display hardware. // // In order to avoid this, this API provides the OutputSurface with the // transform/rotation that should be applied to the display compositor's // output. This is the same rotation as the physical rotation on the display. // In some cases, this is done natively by the graphics backend ( // For instance, this is already done by GL drivers on Android. See // https://source.android.com/devices/graphics/implement#pre-rotation). // // If not supported natively, the OutputSurface should return the transform // needed in GetDisplayTransform for it to explicitly applied by the // compositor. virtual void SetDisplayTransformHint(gfx::OverlayTransform transform) = 0; virtual gfx::OverlayTransform GetDisplayTransform() = 0; virtual base::ScopedClosureRunner GetCacheBackBufferCb(); // If set to true, the OutputSurface must deliver // OutputSurfaceclient::DidSwapWithSize notifications to its client. // OutputSurfaces which support delivering swap size notifications should // override this. virtual void SetNeedsSwapSizeNotifications( bool needs_swap_size_notifications); // Notifies surface that we want to measure viz-gpu latency for next draw. virtual void SetNeedsMeasureNextDrawLatency() {} // Updates timing info on the provided LatencyInfo when swap completes. static void UpdateLatencyInfoOnSwap( const gfx::SwapResponse& response, std::vector<ui::LatencyInfo>* latency_info); // Notifies the OutputSurface of rate of content updates in frames per second. virtual void SetFrameRate(float frame_rate) {} // Sends the pending delegated ink renderer receiver to GPU Main to allow the // browser process to send points directly there. virtual void InitDelegatedInkPointRendererReceiver( mojo::PendingReceiver<gfx::mojom::DelegatedInkPointRenderer> pending_receiver); protected: struct OutputSurface::Capabilities capabilities_; scoped_refptr<ContextProvider> context_provider_; std::unique_ptr<SoftwareOutputDevice> software_device_; private: const Type type_; skia::Matrix44 color_matrix_; }; } // namespace viz #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_OUTPUT_SURFACE_H_
4,072
303
#include "modules/timer/timer.h" using namespace love; static TickCounter counter; Timer::Timer() { osTickCounterStart(&counter); this->prevFPSUpdate = currentTime = this->GetTime(); } double common::Timer::GetTime() { counter.elapsed = svcGetSystemTick() - counter.reference; return osTickCounterRead(&counter) / 1000.0; }
118
2,341
# # Copyright 2016 Cluster Labs, Inc. # # 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. # from django.db import models from backend.lk.models.apimodel import APIModel from backend.lk.models.sdkvisit import SDKVisit class SDKTap(APIModel): visit = models.ForeignKey(SDKVisit, related_name='+', on_delete=models.DO_NOTHING) create_time = models.DateTimeField(auto_now_add=True) time = models.DateTimeField(null=False) x = models.FloatField(null=False) y = models.FloatField(null=False) orient = models.CharField(max_length=1)
316
312
<filename>deployment/src/test/java/io/quarkiverse/githubapp/deployment/ConfigFileOrderTest.java package io.quarkiverse.githubapp.deployment; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.kohsuke.github.GHEventPayload; import io.quarkiverse.githubapp.ConfigFile; import io.quarkiverse.githubapp.event.Label; import io.quarkus.test.QuarkusUnitTest; public class ConfigFileOrderTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addClass(ListeningClass.class)) .withConfigurationResource("application.properties"); @Test public void testConfigFileOrder() { } static class ListeningClass { void createLabel(@ConfigFile("my-config-file.txt") String configuration, @Label.Created GHEventPayload.Label labelPayload) { } } }
412
370
<reponame>stdbio/smf // Copyright (c) 2016 <NAME>. All rights reserved. // #pragma once // std #include <memory> #include <utility> #include <vector> #include <optional> #include <map> #include <seastar/core/gate.hh> #include <seastar/net/tls.hh> #include <seastar/core/shared_ptr.hh> #include "smf/histogram.h" #include "smf/macros.h" #include "smf/rpc_connection.h" #include "smf/rpc_envelope.h" #include "smf/rpc_filter.h" #include "smf/rpc_recv_typed_context.h" namespace smf { struct rpc_client_opts { seastar::ipv4_addr server_addr; /// \ brief rpc client tls trust certficate /// seastar::shared_ptr<seastar::tls::certificate_credentials> credentials; /// \ brief The default timeout PER connection body. After we /// parse the header of the connection we need to /// make sure that we at some point receive some /// bytes or expire the connection. Effectively infinite typename seastar::timer<>::duration recv_timeout = std::chrono::minutes(1); /// \brief 1GB. After this limit, each connection /// will block until there are enough bytes free in memory to continue uint64_t memory_avail_for_client = uint64_t(1) << 30 /*1GB*/; }; /// \brief class intented for communicating with a remote host /// the intended use case is single threaded, callback driven /// /// Note: This class uses seastar::SEDA pipelines to process filters. /// That is, it will effectively execute ALL filters (either incoming or /// outgoing) as 'one' future. In seastar terms this means blocking. /// /// We are trading off throughput for latency. So write filters /// efficiently /// /// This class after connect() initiates a background future<> that will /// do the dispatching of the future *once* it receives the data from the /// socket that it is continually polling. /// We maintain a set of futures and sessions associated with responses /// and will full fill them as they come in, out of order even! /// This is coupled w/ a very specific server impl of processing one /// request at a time per fiber /// /// Performance: We currently run at 26micros 100%-tile latency w/ a DPDK /// runtime /// With the posix stack we run about 180 micros w/ a client at posix and /// server /// running w/ dpdk. While both running on regular posix we run about /// 14ms. /// Our p999 is 7 micros on the dpdk runtime and about 4ms w/ posix. /// class rpc_client { public: struct work_item { using promise_t = seastar::promise<std::optional<rpc_recv_context>>; explicit work_item(uint16_t idx) : session(idx) {} ~work_item() {} SMF_DISALLOW_COPY_AND_ASSIGN(work_item); promise_t pr; uint16_t session{0}; }; using in_filter_t = std::function<seastar::future<rpc_recv_context>(rpc_recv_context)>; using out_filter_t = std::function<seastar::future<rpc_envelope>(rpc_envelope)>; public: explicit rpc_client(seastar::ipv4_addr server_addr); explicit rpc_client(rpc_client_opts opts); rpc_client(rpc_client &&) noexcept; virtual const char *name() const = 0; /// \brief actually does the send to the remote location /// \param req - the bytes to send /// template <typename T> seastar::future<rpc_recv_typed_context<T>> send(rpc_envelope e) { using ret_type = rpc_recv_typed_context<T>; return seastar::with_gate( *dispatch_gate_, [this, e = std::move(e)]() mutable { return raw_send(std::move(e)).then([](auto opt_ctx) { return seastar::make_ready_future<ret_type>(std::move(opt_ctx)); }); }); } virtual seastar::future<> connect() final; /// \brief if connection is open, it will /// 1. conn->disable() /// 2. fulfill all futures with exceptions /// 3. stop() the connection /// 4. connect() virtual seastar::future<> reconnect() final; virtual seastar::future<> stop() final; virtual ~rpc_client(); virtual void disable_histogram_metrics() final; virtual void enable_histogram_metrics() final; SMF_ALWAYS_INLINE virtual bool is_histogram_enabled() const final { return !!hist_; } SMF_ALWAYS_INLINE virtual seastar::lw_shared_ptr<histogram> get_histogram() final { return hist_; } /// \brief use to enqueue or dequeue filters /// \code{.cpp} /// client->incoming_filters().push_back(zstd_decompression_filter()); /// \endcode SMF_ALWAYS_INLINE virtual std::vector<in_filter_t> & incoming_filters() final { return in_filters_; } /// \brief use to enqueue or dequeue filters /// \code{.cpp} /// client->outgoing_filters().push_back(zstd_compression_filter(1000)); /// \endcode SMF_ALWAYS_INLINE virtual std::vector<out_filter_t> & outgoing_filters() final { return out_filters_; } SMF_ALWAYS_INLINE virtual bool is_conn_valid() const final { return conn_ && conn_->is_valid(); } SMF_DISALLOW_COPY_AND_ASSIGN(rpc_client); public: const seastar::ipv4_addr server_addr; // public for the stage pipelines seastar::future<rpc_recv_context> apply_incoming_filters(rpc_recv_context); seastar::future<rpc_envelope> apply_outgoing_filters(rpc_envelope); private: seastar::future<std::optional<rpc_recv_context>> raw_send(rpc_envelope e); seastar::future<> do_reads(); seastar::future<> dispatch_write(rpc_envelope e); seastar::future<> process_one_request(); void fail_outstanding_futures(); // stage pipeline applications seastar::future<rpc_recv_context> stage_incoming_filters(rpc_recv_context); seastar::future<rpc_envelope> stage_outgoing_filters(rpc_envelope); private: seastar::lw_shared_ptr<rpc_connection_limits> limits_; seastar::shared_ptr<seastar::tls::certificate_credentials> creds_; // need to be public for parent_shared_from_this() uint64_t read_counter_{0}; seastar::lw_shared_ptr<rpc_connection> conn_; std::unordered_map<uint16_t, seastar::lw_shared_ptr<work_item>> rpc_slots_; std::vector<in_filter_t> in_filters_; std::vector<out_filter_t> out_filters_; std::unique_ptr<seastar::gate> dispatch_gate_ = nullptr; seastar::semaphore serialize_writes_{1}; seastar::lw_shared_ptr<histogram> hist_ = nullptr; uint16_t session_idx_{0}; }; } // namespace smf
2,297
329
#pragma once // Copyright (c) 2018-present The Alive2 Authors. // Distributed under the MIT license that can be found in the LICENSE file. #include "ir/constant.h" #include "ir/value.h" #include <string> #include <string_view> #include <vector> namespace smt { class Model; } namespace IR { class Predicate { public: virtual void print(std::ostream &os) const = 0; virtual smt::expr toSMT(State &s) const = 0; virtual smt::expr getTypeConstraints() const; virtual void fixupTypes(const smt::Model &m); virtual ~Predicate() {} }; class BoolPred final : public Predicate { public: enum Pred { AND, OR }; private: Predicate &lhs, &rhs; Pred pred; public: BoolPred(Predicate &lhs, Predicate &rhs, Pred pred) : lhs(lhs), rhs(rhs), pred(pred) {} void print(std::ostream &os) const override; smt::expr toSMT(State &s) const override; }; class FnPred final : public Predicate { enum Fn { AddNSW, AddNUW, SubNSW, SubNUW, MulNSW, MulNUW, ShlNSW, ShlNUW } fn; std::vector<Value*> args; smt::expr mkMustAnalysis(State &s, smt::expr &&e) const; public: FnPred(std::string_view name, std::vector<Value*> &&args); void print(std::ostream &os) const override; smt::expr toSMT(State &s) const override; smt::expr getTypeConstraints() const override; void fixupTypes(const smt::Model &m) override; }; struct FnPredException { std::string str; FnPredException(std::string &&str) : str(std::move(str)) {} }; class CmpPred final : public Predicate { public: enum Pred { EQ, NE, SLE, SLT, SGE, SGT, ULE, ULT, UGE, UGT }; private: Constant &lhs, &rhs; Pred pred; public: CmpPred(Constant &lhs, Constant &rhs, Pred pred) : lhs(lhs), rhs(rhs), pred(pred) {} void print(std::ostream &os) const override; smt::expr toSMT(State &s) const override; smt::expr getTypeConstraints() const override; void fixupTypes(const smt::Model &m) override; }; }
713
1,668
package org.elixir_lang.jps; import com.intellij.util.xmlb.annotations.Tag; import org.jetbrains.annotations.NotNull; public class CompilerOptions { @Tag("useMixCompiler") public boolean useMixCompiler = true; @Tag("useDocs") public boolean attachDocsEnabled = true; @Tag("useDebugInfo") public boolean attachDebugInfoEnabled = true; @Tag("useWarningsAsErrors") public boolean warningsAsErrorsEnabled = false; @Tag("useIgnoreModuleConflict") public boolean ignoreModuleConflictEnabled = false; public CompilerOptions() { } public CompilerOptions(@NotNull CompilerOptions options){ useMixCompiler = options.useMixCompiler; attachDocsEnabled = options.attachDocsEnabled; attachDebugInfoEnabled = options.attachDebugInfoEnabled; warningsAsErrorsEnabled = options.warningsAsErrorsEnabled; ignoreModuleConflictEnabled = options.ignoreModuleConflictEnabled; } }
279
868
/* * * 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.activemq.artemis.utils.collections; import java.util.Collection; import java.util.Map; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Test; public class NoOpMapTest { @Test public void testPut() { Map<String, String> map = NoOpMap.instance(); assertNull(map.put("hello", "world")); assertNull(map.put("hello", "world2")); assertEquals(0, map.size()); } @Test public void testGet() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); assertNull(map.get("hello")); } @Test public void testValues() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); Collection<String> values = map.values(); assertEquals(0, values.size()); } @Test public void testKeys() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); Set<String> keySet = map.keySet(); assertEquals(0, keySet.size()); } @Test public void testEntrySet() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); Set<Map.Entry<String, String>> entrySet = map.entrySet(); assertEquals(0, entrySet.size()); } @Test public void testIsEmpty() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); assertTrue(map.isEmpty()); } @Test public void testRemove() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); assertNull(map.remove("hello")); } @Test public void testReplace() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); assertNull(map.replace("hello", "world2")); map.put("hello", "world"); assertFalse(map.replace("hello", "world", "world2")); } }
1,000
687
<filename>supersqlite/third_party/sqlite3/icu/norm2_nfc_data.h // © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // // Copyright (C) 1999-2016, International Business Machines // Corporation and others. All Rights Reserved. // // file name: norm2_nfc_data.h // // machine-generated by: icu/source/tools/gennorm2/n2builder.cpp #ifdef INCLUDED_FROM_NORMALIZER2_CPP static const UVersionInfo norm2_nfc_data_formatVersion={4,0,0,0}; static const UVersionInfo norm2_nfc_data_dataVersion={0xb,0,0,0}; static const int32_t norm2_nfc_data_indexes[Normalizer2Impl::IX_COUNT]={ 0x50,0x4ab0,0x8708,0x8808,0x8808,0x8808,0x8808,0x8808,0xc0,0x300,0xadc,0x29d0,0x3c56,0xfc00,0x1282,0x3b8c, 0x3c24,0x3c56,0x300,0 }; static const uint16_t norm2_nfc_data_trieIndex[1690]={ 0,0x40,0x7b,0xbb,0xfb,0x13a,0x17a,0x1b2,0x1f2,0x226,0x254,0x226,0x294,0x2d4,0x313,0x353, 0x393,0x3d2,0x40f,0x44e,0x226,0x226,0x488,0x4c8,0x4f8,0x530,0x226,0x570,0x59f,0x5de,0x226,0x5f3, 0x631,0x65f,0x226,0x68c,0x6cc,0x709,0x729,0x768,0x7a7,0x7e4,0x803,0x840,0x729,0x879,0x8a7,0x8e6, 0x226,0x920,0x937,0x977,0x98e,0x9cd,0x226,0xa03,0xa23,0xa5e,0xa6a,0xaa4,0xacc,0xb09,0xb49,0xb83, 0xb9e,0x226,0xbd9,0x226,0xc19,0xc38,0xc6e,0xcab,0x226,0x226,0x226,0x226,0x226,0xcce,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xcfa,0x226,0x226,0xd2f, 0x226,0x226,0xd4d,0x226,0xd77,0x226,0x226,0x226,0xdb3,0xdd3,0xe13,0x226,0xe51,0xe91,0xec5,0xef1, 0x808,0x226,0x226,0xf25,0x226,0x226,0x226,0xf65,0xfa5,0xfe5,0x1025,0x1065,0x10a5,0x10e5,0x1125,0x1165, 0x11a5,0x226,0x226,0x11d5,0x1206,0x226,0x1236,0x1269,0x12a6,0x12e5,0x1325,0x135b,0x1389,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x13b4,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0xcbc,0x226,0x13d1,0x226,0x1411,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x1451,0x148b,0x14c9,0x1509,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1548,0x1586,0x15a6,0x226,0x226,0x226,0x226, 0x15e0,0x226,0x226,0x161c,0x164e,0x167c,0x80c,0x168f,0x226,0x226,0x169f,0x16df,0x226,0x226,0x226,0x13e3, 0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727, 0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737, 0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b, 0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f, 0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f, 0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723, 0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733, 0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727, 0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737, 0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b, 0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x1733,0x171f,0x1727,0x172f,0x1737,0x1723,0x172b,0x176b,0x226, 0x17ab,0x17e6,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x1826,0x1866,0x18a6,0x18e6,0x1926,0x1966,0x19a6,0x19e6,0x1a09,0x1a49,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1a69,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x61f,0x62e,0x644,0x663,0x678,0x678,0x678,0x67c,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xbd9,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x54f,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x40c, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1a9c,0x226,0x226,0x1aac,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0xdc5,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1abc,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ac6,0x54f, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x7eb,0x226,0x226,0x9ba,0x226,0x1ad6, 0x1ae3,0x1aef,0x226,0x226,0x226,0x226,0x414,0x226,0x1afa,0x1b0a,0x226,0x226,0x226,0x7e0,0x226,0x226, 0x226,0x226,0x1b1a,0x226,0x226,0x226,0x1b25,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x1b2c,0x226,0x226,0x226,0x226,0x1b37,0x1b46,0x8f6,0x1b54,0x412,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x1b62,0x798,0x226,0x226,0x226,0x226,0x226,0x1b72,0x1b81,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x8d6,0x1b89,0x1b99,0x226,0x226,0x226,0x9ba, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ba3,0x226,0x226,0x226,0x226,0x226,0x226,0x7e6,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ba0,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x7ed,0x7ea,0x226,0x226,0x226,0x226,0x7e8, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x9ba,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xbd3,0x226,0x226,0x226,0x226,0x7ea,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bb3,0x226,0x226,0x226, 0xebe,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bb8,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x1bc7,0x1bd7,0x1be5,0x1bf2,0x226,0x1bfe,0x1c0c,0x1c1c,0x226,0x226,0x226,0x226, 0xce9,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c2c,0x1c34,0x1c42,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c52,0x226,0x226,0x226, 0x226,0x226,0x226,0x1c5e,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c6e, 0x1c7e,0x1c8e,0x1c9e,0x1cae,0x1cbe,0x1cce,0x1cde,0x1cee,0x1cfe,0x1d0e,0x1d1e,0x1d2e,0x1d3e,0x1d4e,0x1d5e,0x1d6e, 0x1d7e,0x1d8e,0x1d9e,0x1dae,0x1dbe,0x1dce,0x1dde,0x1dee,0x1dfe,0x1e0e,0x1e1e,0x1e2e,0x1e3e,0x1e4e,0x1e5e,0x1e6e, 0x1e7e,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226, 0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x408, 0x428,0xc4,0xc4,0xc4,0x448,0x457,0x46a,0x486,0x4a3,0x4bf,0x4dc,0x4f9,0x516,0x533,0xc4,0xc4, 0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4, 0xc4,0xc4,0xc4,0x54d,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4, 0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4, 0xc4,0xc4,0x564,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x56f,0x58c,0xc4,0xc4,0xc4, 0xc4,0xc4,0xc4,0x5ac,0xc4,0xc4,0xc4,0x5bf,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4, 0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4, 0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x5df,0x5ff }; static const uint16_t norm2_nfc_data_trieData[7822]={ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,4,8,0xc,1, 1,0x10,0x50,0x5c,0x70,0x88,0xcc,0xd0,0xec,0x108,0x144,0x148,0x15c,0x174,0x180,0x1a4, 0x1e4,1,0x1ec,0x20c,0x228,0x244,0x290,0x298,0x2b0,0x2b8,0x2dc,1,1,1,1,1, 1,0x2f4,0x334,0x340,0x354,0x36c,0x3b0,0x3b4,0x3d0,0x3f0,0x428,0x430,0x444,0x45c,0x468,0x48c, 0x4cc,1,0x4d4,0x4f4,0x510,0x530,0x57c,0x584,0x5a0,0x5a8,0x5d0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0x5e8,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0x1284,0x128a,0xade,0x1290,0xaf4, 0xafe,0x5f4,0xb08,0x1296,0x129c,0xb12,0x12a2,0x12a8,0x12ae,0x12b4,0xb28,1,0x12ba,0x12c0,0x12c6,0xb32, 0xb48,0xb5a,1,0x5fc,0x12cc,0x12d2,0x12d8,0xb64,0x12de,1,1,0x12e4,0x12ea,0xb7a,0x12f0,0xb90, 0xb9a,0x600,0xba4,0x12f6,0x12fc,0xbae,0x1302,0x1308,0x130e,0x1314,0xbc4,1,0x131a,0x1320,0x1326,0xbce, 0xbe4,0xbf6,1,0x608,0x132c,0x1332,0x1338,0xc00,0x133e,1,0x1344,0x134a,0x1350,0xc16,0xc2c,0x1357, 0x135d,0x1362,0x1368,0x136e,0x1374,0x137a,0x1380,0x1386,0x138c,0x1392,0x1398,1,1,0xc42,0xc50,0x139e, 0x13a4,0x13aa,0x13b0,0x13b7,0x13bd,0x13c2,0x13c8,0x13ce,0x13d4,0x13da,0x13e0,0x13e6,0x13ec,0x13f3,0x13f9,0x13fe, 0x1404,1,1,0x140a,0x1410,0x1416,0x141c,0x1422,0x1428,0x142f,0x1435,0x143a,1,1,1,0x1441, 0x1447,0x144d,0x1453,1,0x1458,0x145e,0x1465,0x146b,0x1470,0x1476,1,1,1,0x147c,0x1482,0x1489, 0x148f,0x1494,0x149a,1,1,1,0xc5e,0xc6c,0x14a0,0x14a6,0x14ac,0x14b2,1,1,0x14b8,0x14be, 0x14c5,0x14cb,0x14d0,0x14d6,0xc7a,0xc84,0x14dc,0x14e2,0x14e9,0x14ef,0xc8e,0xc98,0x14f5,0x14fb,0x1500,0x1506, 1,1,0xca2,0xcac,0xcb6,0xcc0,0x150c,0x1512,0x1518,0x151e,0x1524,0x152a,0x1531,0x1537,0x153c,0x1542, 0x1548,0x154e,0x1554,0x155a,0x1560,0x1566,0x156c,0x1572,0x1578,0x60c,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0xcca,0xce4,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xcfe,0xd18,1,1,1,1,1, 1,0x610,1,1,1,1,1,1,1,1,1,1,1,1,1,0x157e, 0x1584,0x158a,0x1590,0x1596,0x159c,0x15a2,0x15a8,0x15b0,0x15ba,0x15c4,0x15ce,0x15d8,0x15e2,0x15ec,0x15f6,1, 0x1600,0x160a,0x1614,0x161e,0x1627,0x162d,1,1,0x1632,0x1638,0x163e,0x1644,0xd32,0xd3c,0x164d,0x1657, 0x165f,0x1665,0x166b,1,1,1,0x1670,0x1676,1,1,0x167c,0x1682,0x168a,0x1694,0x169d,0x16a3, 0x16a9,0x16af,0x16b4,0x16ba,0x16c0,0x16c6,0x16cc,0x16d2,0x16d8,0x16de,0x16e4,0x16ea,0x16f0,0x16f6,0x16fc,0x1702, 0x1708,0x170e,0x1714,0x171a,0x1720,0x1726,0x172c,0x1732,0x1738,0x173e,0x1744,0x174a,0x1750,0x1756,1,1, 0x175c,0x1762,1,1,1,1,1,1,0xd46,0xd50,0xd5a,0xd64,0x176a,0x1774,0x177e,0x1788, 0xd6e,0xd78,0x1792,0x179c,0x17a4,0x17aa,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x614,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xffcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc,0xfdcc, 0xfdcc,0xffcc,0xffcc,0xfdcc,0xffcc,0xfdcc,0xffcc,0xfdcc,0xfdcc,0xffd0,0xffb8,0xffb8,0xffb8,0xffb8,0xffd0,0xfdb0, 0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xff94,0xff94,0xfdb8,0xfdb8,0xfdb8,0xfdb8,0xfd94,0xfd94,0xffb8,0xffb8,0xffb8, 0xffb8,0xfdb8,0xfdb8,0xffb8,0xfdb8,0xfdb8,0xffb8,0xffb8,0xfe02,0xfe02,0xfe02,0xfe02,0xfc02,0xffb8,0xffb8,0xffb8, 0xffb8,0xffcc,0xffcc,0xffcc,0x3c26,0x3c2c,0xfdcc,0x3c32,0x3c38,0xfde0,0xffcc,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc, 0xffcc,0xffb8,0xffb8,1,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffd0,0xffb8,0xffb8,0xffcc, 0xffd2,0xffd4,0xffd4,0xffd2,0xffd4,0xffd4,0xffd2,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,0x29d1,1,1,1,1,1,1,1, 1,1,0x29d5,1,1,1,1,1,0x17b1,0x17b7,0x29d9,0x17bd,0x17c3,0x17c9,1,0x17cf, 1,0x17d5,0x17db,0x17e3,0x618,1,1,1,0x634,1,0x644,1,0x658,1,1,1, 1,1,0x674,1,0x684,1,1,1,0x688,1,1,1,0x6a0,0x17eb,0x17f1,0xd82, 0x17f7,0xd8c,0x17fd,0x1805,0x6b4,1,1,1,0x6d4,1,0x6e4,1,0x6fc,1,1,1, 1,1,0x71c,1,0x72c,1,1,1,0x734,1,1,1,0x754,0xd96,0xda8,0x180d, 0x1813,0xdba,1,1,1,0x76c,0x1819,0x181f,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0x1825,0x182b,1,0x1831,1,1,0x774,0x1837,1,1,1,1,0x183d, 0x1843,0x1849,1,0x778,1,1,0x780,1,0x784,0x790,0x798,0x79c,0x184f,0x7ac,1,1, 1,0x7b0,1,1,1,1,0x7b4,1,1,1,0x7c4,1,1,1,0x7c8,1, 0x7cc,1,1,0x7d0,1,1,0x7d8,1,0x7dc,0x7e8,0x7f0,0x7f4,0x1855,0x804,1,1, 1,0x808,1,1,1,0x80c,1,1,1,0x81c,1,1,1,0x820,1,0x824, 1,1,0x185b,0x1861,1,0x1867,1,1,0x828,0x186d,1,1,1,1,0x1873,0x1879, 0x187f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x82c,0x830,0x1885,0x188b,1,1,1,1,1,1, 1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x1891, 0x1897,1,1,1,1,1,1,1,1,1,1,1,1,1,0x189d,0x18a3, 0x18a9,0x18af,1,1,0x18b5,0x18bb,0x834,0x838,0x18c1,0x18c7,0x18cd,0x18d3,0x18d9,0x18df,1,1, 0x18e5,0x18eb,0x18f1,0x18f7,0x18fd,0x1903,0x83c,0x840,0x1909,0x190f,0x1915,0x191b,0x1921,0x1927,0x192d,0x1933, 0x1939,0x193f,0x1945,0x194b,1,1,0x1951,0x1957,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc, 0xffcc,0xffcc,0xffbc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8, 0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffbc,0xffc8,0xffcc,0xfe14,0xfe16,0xfe18,0xfe1a,0xfe1c,0xfe1e,0xfe20,0xfe22, 0xfe24,0xfe26,0xfe26,0xfe28,0xfe2a,0xfe2c,1,0xfe2e,1,0xfe30,0xfe32,1,0xffcc,0xffb8,1,0xfe24, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xfe3c,0xfe3e,0xfe40,1,1,1,1,1,1,1,0x195c,0x1962,0x1969,0x196f,0x1975,0x844, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0x850,1,0x854,0xfe36,0xfe38,0xfe3a,0xfe3c,0xfe3e, 0xfe40,0xfe42,0xfe44,0xfdcc,0xfdcc,0xfdb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0xfe46,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0x197b,0x858,0x1981,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,0x85c,0x1987,1,0x860,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,0xffcc, 0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,1,1,0xffcc,0xffcc,1,0xffb8,0xffcc,0xffcc,0xffb8,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0xfe48,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc, 0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffcc,0xffb8,0xffb8,0xffcc,0xffb8,0xffcc,0xffcc, 0xffb8,0xffcc,0xffb8,0xffcc,0xffb8,0xffcc,0xffb8,0xffcc,0xffcc,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,1,1,1,1,1,1,1,1,1, 0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0xffb8,0xffb8,0xffb8,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffb8, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffb8, 0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xfe36,0xfe38,0xfe3a,0xffcc, 0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0x864,0x198d,1,1,1,1,1,1,0x868,0x1993,1,0x86c, 0x1999,1,1,1,1,1,1,1,0xfc0e,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xfe12,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc,1,1, 1,0x29dc,0x29e2,0x29e8,0x29ee,0x29f4,0x29fa,0x2a00,0x2a06,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xfe0e,1,0xfc00,1,1,1,1,1,1,1,0x870, 1,1,1,0x199f,0x19a5,0xfe12,1,1,1,1,1,1,1,1,1,0xfc00, 1,1,1,1,0x2a0c,0x2a12,1,0x2a18,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xffcc,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0x2a1e,1,1,0x2a24,1,1, 1,1,1,0xfe0e,1,1,1,1,1,1,1,1,1,1,1,1, 1,0xfe12,1,1,1,1,1,1,1,1,1,1,1,0x2a2a,0x2a30,0x2a36, 1,1,0x2a3c,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe0e, 1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0x878,0x19ab,1,1,0x19b1,0x19b7,0xfe12,1,1,1,1,1,1,1,1,0xfc00, 0xfc00,1,1,1,1,0x2a42,0x2a48,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0x884,1,0x19bd,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xfc00,1,1,1,1,1,1,0x888,0x890,1,1, 0x19c3,0x19c9,0x19cf,0xfe12,1,1,1,1,1,1,1,1,1,0xfc00,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x894,1,0x19d5,1,1,1,1,0xfe12,1,1, 1,1,1,1,1,0xfea8,0xfcb6,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0xfe0e,1,1,0x898,0x19db,1,0xfc00,1,1,1,0x89c,0x19e1,0x19e7, 1,0xdc4,0x19ef,1,0xfe12,1,1,1,1,1,1,1,0xfc00,0xfc00,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xfe12,0xfe12,1,0xfc00,1,1,1, 1,1,1,0x8a8,0x8b0,1,1,0x19f7,0x19fd,0x1a03,0xfe12,1,1,1,1,1, 1,1,1,1,0xfc00,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,0xfc12,1,1, 1,1,0xfc00,1,1,1,1,1,1,1,1,1,0x8b4,0x1a09,1,0xdce, 0x1a11,0x1a19,0xfc00,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0xfece,0xfece,0xfe12,1,1, 1,1,1,1,1,1,0xfed6,0xfed6,0xfed6,0xfed6,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,0xfeec,0xfeec,1,1,1,1,1,1,1,1,0xfef4,0xfef4,0xfef4,0xfef4, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0xffb8,0xffb8,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,0xffb8,1,0xffb8,1,0xffb0,1,1,1,1,1,1,0x2a4f,1,1,1, 1,1,1,1,1,1,0x2a55,1,1,1,1,0x2a5b,1,1,1,1, 0x2a61,1,1,1,1,0x2a67,1,1,1,1,1,1,1,1,1,1, 1,1,0x2a6d,1,1,1,1,1,1,1,0xff02,0xff04,0x3c40,0xff08,0x3c48,0x2a72, 1,0x2a78,1,0xff04,0xff04,0xff04,0xff04,1,1,0xff04,0x3c50,0xffcc,0xffcc,0xfe12,1,0xffcc, 0xffcc,1,1,1,1,1,1,1,1,1,1,1,0x2a7f,1,1,1, 1,1,1,1,1,1,0x2a85,1,1,1,1,0x2a8b,1,1,1,1, 0x2a91,1,1,1,1,0x2a97,1,1,1,1,1,1,1,1,1,1, 1,1,0x2a9d,1,1,1,1,1,1,0xffb8,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0x8c0,0x1a1f,1,1,1,1,1,1,1,0xfc00,1,1,1, 1,1,1,1,1,0xfe0e,1,0xfe12,0xfe12,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xffb8,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00, 0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00, 0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,0xfe12,1,1,1,1,1,1,1,1,1,1,0xffcc,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xffc8,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0xffbc,0xffcc,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0xffcc,0xffb8,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0xfe12,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 1,1,0xffb8,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc, 0xffb8,1,1,1,1,1,0x8c4,0x1a25,0x8c8,0x1a2b,0x8cc,0x1a31,0x8d0,0x1a37,0x8d4,0x1a3d, 1,1,0x8d8,0x1a43,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xfe0e,0xfc00,1,1,1,1,0x8dc,0x1a49,0x8e0,0x1a4f,0x8e4, 0x8e8,0x1a55,0x1a5b,0x8ec,0x1a61,0xfe12,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12, 0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,0xfe0e,1,1,1,1,1,1,1,1, 1,1,1,0xfe12,0xfe12,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xffcc,0xffcc,0xffcc,1,0xfe02,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc, 0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,1,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,1,1, 1,1,0xffb8,1,1,1,1,1,1,0xffcc,1,1,1,0xffcc,0xffcc,1, 1,1,1,1,1,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8, 0xffcc,0xffcc,0xffd4,0xffac,0xffb8,0xff94,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffd0,0xffc8,0xffc8,0xffb8,1, 0xffcc,0xffd2,0xffb8,0xffcc,0xffb8,0x1a66,0x1a6c,0x1a72,0x1a78,0x1a7f,0x1a85,0x1a8b,0x1a91,0x1a99,0x1aa3,0x1aaa, 0x1ab0,0x1ab6,0x1abc,0x1ac2,0x1ac8,0x1acf,0x1ad5,0x1ada,0x1ae0,0x1ae8,0x1af2,0x1afc,0x1b06,0x1b0e,0x1b14,0x1b1a, 0x1b20,0x1b29,0x1b33,0x1b3b,0x1b41,0x1b46,0x1b4c,0x1b52,0x1b58,0x1b5e,0x1b64,0x1b6a,0x1b70,0x1b77,0x1b7d,0x1b82, 0x1b88,0x1b8e,0x1b94,0x1b9c,0x1ba6,0x1bae,0x1bb4,0x1bba,0x1bc0,0x1bc6,0x1bcc,0xdd8,0xde2,0x1bd4,0x1bde,0x1be6, 0x1bec,0x1bf2,0x1bf8,0x1bfe,0x1c04,0x1c0a,0x1c10,0x1c17,0x1c1d,0x1c22,0x1c28,0x1c2e,0x1c34,0x1c3a,0x1c40,0x1c46, 0x1c4c,0x1c54,0x1c5e,0x1c68,0x1c72,0x1c7c,0x1c86,0x1c90,0x1c9a,0x1ca3,0x1ca9,0x1caf,0x1cb5,0x1cba,0x1cc0,0xdec, 0xdf6,0x1cc8,0x1cd2,0x1cda,0x1ce0,0x1ce6,0x1cec,0xe00,0xe0a,0x1cf4,0x1cfe,0x1d08,0x1d12,0x1d1c,0x1d26,0x1d2e, 0x1d34,0x1d3a,0x1d40,0x1d46,0x1d4c,0x1d52,0x1d58,0x1d5e,0x1d64,0x1d6a,0x1d70,0x1d76,0x1d7c,0x1d84,0x1d8e,0x1d98, 0x1da2,0x1daa,0x1db0,0x1db7,0x1dbd,0x1dc2,0x1dc8,0x1dce,0x1dd4,0x1dda,0x1de0,0x1de6,0x1dec,0x1df3,0x1df9,0x1dff, 0x1e05,0x1e0b,0x1e11,0x1e16,0x1e1c,0x1e22,0x1e28,0x1e2f,0x1e35,0x1e3b,0x1e41,0x1e46,0x1e4c,0x1e52,0x1e58,1, 0x1e5f,1,1,1,1,0xe14,0xe22,0x1e64,0x1e6a,0x1e72,0x1e7c,0x1e86,0x1e90,0x1e9a,0x1ea4,0x1eae, 0x1eb8,0x1ec2,0x1ecc,0x1ed6,0x1ee0,0x1eea,0x1ef4,0x1efe,0x1f08,0x1f12,0x1f1c,0x1f26,0x1f30,0xe30,0xe3a,0x1f38, 0x1f3e,0x1f44,0x1f4a,0x1f52,0x1f5c,0x1f66,0x1f70,0x1f7a,0x1f84,0x1f8e,0x1f98,0x1fa2,0x1fac,0x1fb4,0x1fba,0x1fc0, 0x1fc6,0xe44,0xe4e,0x1fcc,0x1fd2,0x1fda,0x1fe4,0x1fee,0x1ff8,0x2002,0x200c,0x2016,0x2020,0x202a,0x2034,0x203e, 0x2048,0x2052,0x205c,0x2066,0x2070,0x207a,0x2084,0x208e,0x2098,0x20a0,0x20a6,0x20ac,0x20b2,0x20ba,0x20c4,0x20ce, 0x20d8,0x20e2,0x20ec,0x20f6,0x2100,0x210a,0x2114,0x211c,0x2122,0x2129,0x212f,0x2134,0x213a,0x2140,0x2146,1, 1,1,1,1,1,0xe58,0xe6e,0xe86,0xe94,0xea2,0xeb0,0xebe,0xecc,0xed8,0xeee,0xf06, 0xf14,0xf22,0xf30,0xf3e,0xf4c,0xf58,0xf66,0x214f,0x2159,0x2163,0x216d,1,1,0xf74,0xf82,0x2177, 0x2181,0x218b,0x2195,1,1,0xf90,0xfa6,0xfbe,0xfcc,0xfda,0xfe8,0xff6,0x1004,0x1010,0x1026,0x103e, 0x104c,0x105a,0x1068,0x1076,0x1084,0x1090,0x10a2,0x219f,0x21a9,0x21b3,0x21bd,0x21c7,0x21d1,0x10b4,0x10c6,0x21db, 0x21e5,0x21ef,0x21f9,0x2203,0x220d,0x10d8,0x10e6,0x2217,0x2221,0x222b,0x2235,1,1,0x10f4,0x1102,0x223f, 0x2249,0x2253,0x225d,1,1,0x1110,0x1122,0x2267,0x2271,0x227b,0x2285,0x228f,0x2299,1,0x1134,1, 0x22a3,1,0x22ad,1,0x22b7,0x1146,0x115c,0x1174,0x1182,0x1190,0x119e,0x11ac,0x11ba,0x11c6,0x11dc,0x11f4, 0x1202,0x1210,0x121e,0x122c,0x123a,0x1246,0x3b8e,0x22bf,0x3b96,0x1250,0x3b9e,0x22c5,0x3ba6,0x22cb,0x3bae,0x22d1, 0x3bb6,0x125a,0x3bbe,1,1,0x22d8,0x22e2,0x22f1,0x2301,0x2311,0x2321,0x2331,0x2341,0x234c,0x2356,0x2365, 0x2375,0x2385,0x2395,0x23a5,0x23b5,0x23c0,0x23ca,0x23d9,0x23e9,0x23f9,0x2409,0x2419,0x2429,0x2434,0x243e,0x244d, 0x245d,0x246d,0x247d,0x248d,0x249d,0x24a8,0x24b2,0x24c1,0x24d1,0x24e1,0x24f1,0x2501,0x2511,0x251c,0x2526,0x2535, 0x2545,0x2555,0x2565,0x2575,0x2585,0x258f,0x2595,0x259d,0x25a4,0x25ad,1,0x1264,0x25b7,0x25bf,0x25c5,0x25cb, 0x3bc6,0x25d0,1,0x2aa2,0x8f0,1,0x25d7,0x25df,0x25e6,0x25ef,1,0x126e,0x25f9,0x2601,0x3bce,0x2607, 0x3bd6,0x260c,0x2613,0x2619,0x261f,0x2625,0x262b,0x2633,0x3be0,1,1,0x263b,0x2643,0x264b,0x2651,0x2657, 0x3bea,1,0x265d,0x2663,0x2669,0x266f,0x2675,0x267d,0x3bf4,0x2685,0x268b,0x2691,0x2699,0x26a1,0x26a7,0x26ad, 0x3bfe,0x26b3,0x26b9,0x3c06,0x2aa7,1,1,0x26c1,0x26c8,0x26d1,1,0x1278,0x26db,0x26e3,0x3c0e,0x26e9, 0x3c16,0x26ee,0x2aab,0x8fc,1,0xfa09,0xfa09,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xffcc,0xffcc,0xfe02,0xfe02,0xffcc,0xffcc,0xffcc,0xffcc,0xfe02,0xfe02,0xfe02, 0xffcc,0xffcc,1,1,1,1,0xffcc,1,1,1,0xfe02,0xfe02,0xffcc,0xffb8,0xffcc,0xfe02, 0xfe02,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0x2aae,1,1,1, 0x2ab2,0x3c1e,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x908,1,0x90c,1,0x910,1,1,1,1,1, 0x26f5,0x26fb,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0x2701,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x2707,0x270d,0x2713,0x914,1,0x918,1,0x91c,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0x920,0x2719,1,1,1,0x924,0x271f, 1,0x928,0x2725,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0x92c,0x272b,0x930,0x2731,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,0x934,1,1,1,0x2737,1,0x938,0x273d,0x93c,1,0x2743,0x940,0x2749,1, 1,1,0x944,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0x274f,0x948,0x2755,1,0x94c,0x950,1,1,1,1,1, 1,1,0x275b,0x2761,0x2767,0x276d,0x2773,0x954,0x958,0x2779,0x277f,0x95c,0x960,0x2785,0x278b,0x964, 0x968,0x96c,0x970,1,1,0x2791,0x2797,0x974,0x978,0x279d,0x27a3,0x97c,0x980,0x27a9,0x27af,1, 1,1,1,1,1,1,0x984,0x988,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,0x98c,1,1,1,1,1,0x990,0x994,1, 0x998,0x27b5,0x27bb,0x27c1,0x27c7,1,1,0x99c,0x9a0,0x9a4,0x9a8,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0x27cd,0x27d3,0x27d9,0x27df,1, 1,1,1,1,1,0x27e5,0x27eb,0x27f1,0x27f7,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,0x2ab7,0x2abb,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0x2abf,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0xffb4,0xffc8,0xffd0,0xffbc,0xffc0, 0xffc0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,0x9ac,1,1,1,1,0x9b0,0x27fd,0x9b4,0x2803,0x9b8,0x2809,0x9bc,0x280f,0x9c0,0x2815, 0x9c4,0x281b,0x9c8,0x2821,0x9cc,0x2827,0x9d0,0x282d,0x9d4,0x2833,0x9d8,0x2839,0x9dc,0x283f,1,0x9e0, 0x2845,0x9e4,0x284b,0x9e8,0x2851,1,1,1,1,1,0x9ec,0x2857,0x285d,0x9f4,0x2863,0x2869, 0x9fc,0x286f,0x2875,0xa04,0x287b,0x2881,0xa0c,0x2887,0x288d,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,0x2893,1,1, 1,1,0xfc10,0xfc10,1,1,0xa14,0x2899,1,1,1,1,1,1,1,0xa18, 1,1,1,1,0xa1c,0x289f,0xa20,0x28a5,0xa24,0x28ab,0xa28,0x28b1,0xa2c,0x28b7,0xa30,0x28bd, 0xa34,0x28c3,0xa38,0x28c9,0xa3c,0x28cf,0xa40,0x28d5,0xa44,0x28db,0xa48,0x28e1,1,0xa4c,0x28e7,0xa50, 0x28ed,0xa54,0x28f3,1,1,1,1,1,0xa58,0x28f9,0x28ff,0xa60,0x2905,0x290b,0xa68,0x2911, 0x2917,0xa70,0x291d,0x2923,0xa78,0x2929,0x292f,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,0xa80,0xa84,0xa88,0xa8c,1,0x2935,1,1, 0x293b,0x2941,0x2947,0x294d,1,1,0xa90,0x2953,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,0xffcc,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xffcc,0xffcc,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xffb8,0xffb8,0xffb8,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc, 1,0xffcc,0xffcc,0xffb8,1,1,0xffcc,0xffcc,1,1,1,1,1,0xffcc,0xffcc,1, 0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1,0xadc, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0xadc,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0xadc,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0xadc,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283, 0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,0x1283,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0x3c56,1,0x3c56,0x3c56,0x3c56, 0x3c56,0x3c56,0x3c56,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0x3c56,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0x3c56,1,1,1,1,0x3c56, 1,1,1,0x3c56,1,0x3c56,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,0x3b87,1,0x2ac5,0x2ac9,0x2acd,0x2ad1,0x2ad5,0x2ad9,0x2add,0x2ae1,0x2ae1,0x2ae5, 0x2ae9,0x2aed,0x2af1,0x2af5,0x2af9,0x2afd,0x2b01,0x2b05,0x2b09,0x2b0d,0x2b11,0x2b15,0x2b19,0x2b1d,0x2b21,0x2b25, 0x2b29,0x2b2d,0x2b31,0x2b35,0x2b39,0x2b3d,0x2b41,0x2b45,0x2b49,0x2b4d,0x2b51,0x2b55,0x2b59,0x2b5d,0x2b61,0x2b65, 0x2b69,0x2b6d,0x2b71,0x2b75,0x2b79,0x2b7d,0x2b81,0x2b85,0x2b89,0x2b8d,0x2b91,0x2b95,0x2b99,0x2b9d,0x2ba1,0x2ba5, 0x2ba9,0x2bad,0x2bb1,0x2bb5,0x2bb9,0x2bbd,0x2bc1,0x2bc5,0x2bc9,0x2bcd,0x2bd1,0x2bd5,0x2bd9,0x2bdd,0x2be1,0x2be5, 0x2be9,0x2bed,0x2bf1,0x2bf5,0x2bf9,0x2bfd,0x2c01,0x2c05,0x2c09,0x2c0d,0x2c11,0x2c15,0x2c19,0x2c1d,0x2c21,0x2c25, 0x2c29,0x2c2d,0x2b11,0x2c31,0x2c35,0x2c39,0x2c3d,0x2c41,0x2c45,0x2c49,0x2c4d,0x2c51,0x2c55,0x2c59,0x2c5d,0x2c61, 0x2c65,0x2c69,0x2c6d,0x2c71,0x2c75,0x2c79,0x2c7d,0x2c81,0x2c85,0x2c89,0x2c8d,0x2c91,0x2c95,0x2c99,0x2c9d,0x2ca1, 0x2ca5,0x2ca9,0x2cad,0x2cb1,0x2cb5,0x2cb9,0x2cbd,0x2cc1,0x2cc5,0x2cc9,0x2ccd,0x2cd1,0x2cd5,0x2cd9,0x2cdd,0x2ce1, 0x2ce5,0x2ce9,0x2ced,0x2cf1,0x2cf5,0x2cf9,0x2cfd,0x2d01,0x2d05,0x2d09,0x2d0d,0x2d11,0x2d15,0x2d19,0x2d1d,0x2d21, 0x2d25,0x2d29,0x2d2d,0x2d31,0x2d35,0x2d39,0x2d3d,0x2c79,0x2d41,0x2d45,0x2d49,0x2d4d,0x2d51,0x2d55,0x2d59,0x2d5d, 0x2c39,0x2d61,0x2d65,0x2d69,0x2d6d,0x2d71,0x2d75,0x2d79,0x2d7d,0x2d81,0x2d85,0x2d89,0x2d8d,0x2d91,0x2d95,0x2d99, 0x2d9d,0x2da1,0x2da5,0x2da9,0x2dad,0x2b11,0x2db1,0x2db5,0x2db9,0x2dbd,0x2dc1,0x2dc5,0x2dc9,0x2dcd,0x2dd1,0x2dd5, 0x2dd9,0x2ddd,0x2de1,0x2de5,0x2de9,0x2ded,0x2df1,0x2df5,0x2df9,0x2dfd,0x2e01,0x2e05,0x2e09,0x2e0d,0x2e11,0x2e15, 0x2e19,0x2c41,0x2e1d,0x2e21,0x2e25,0x2e29,0x2e2d,0x2e31,0x2e35,0x2e39,0x2e3d,0x2e41,0x2e45,0x2e49,0x2e4d,0x2e51, 0x2e55,0x2e59,0x2e5d,0x2e61,0x2e65,0x2e69,0x2e6d,0x2e71,0x2e75,0x2e79,0x2e7d,0x2e81,0x2e85,0x2e89,0x2e8d,0x2e91, 0x2e95,0x2e99,0x2e9d,0x2ea1,0x2ea5,0x2ea9,0x2ead,0x2eb1,0x2eb5,0x2eb9,0x2ebd,0x2ec1,0x2ec5,0x2ec9,0x2ecd,0x2ed1, 0x2ed5,0x2ed9,0x2edd,0x2ee1,1,1,0x2ee5,1,0x2ee9,1,1,0x2eed,0x2ef1,0x2ef5,0x2ef9,0x2efd, 0x2f01,0x2f05,0x2f09,0x2f0d,0x2f11,1,0x2f15,1,0x2f19,1,1,0x2f1d,0x2f21,1,1,1, 0x2f25,0x2f29,0x2f2d,0x2f31,0x2f35,0x2f39,0x2f3d,0x2f41,0x2f45,0x2f49,0x2f4d,0x2f51,0x2f55,0x2f59,0x2f5d,0x2f61, 0x2f65,0x2f69,0x2f6d,0x2f71,0x2f75,0x2f79,0x2f7d,0x2f81,0x2f85,0x2f89,0x2f8d,0x2f91,0x2f95,0x2f99,0x2f9d,0x2fa1, 0x2fa5,0x2fa9,0x2fad,0x2fb1,0x2fb5,0x2fb9,0x2fbd,0x2fc1,0x2fc5,0x2fc9,0x2fcd,0x2fd1,0x2fd5,0x2d15,0x2fd9,0x2fdd, 0x2fe1,0x2fe5,0x2fe9,0x2fed,0x2fed,0x2ff1,0x2ff5,0x2ff9,0x2ffd,0x3001,0x3005,0x3009,0x300d,0x2f1d,0x3011,0x3015, 0x3019,0x301d,0x3021,0x3027,1,1,0x302b,0x302f,0x3033,0x3037,0x303b,0x303f,0x3043,0x3047,0x2f55,0x304b, 0x304f,0x3053,0x2ee5,0x3057,0x305b,0x305f,0x3063,0x3067,0x306b,0x306f,0x3073,0x3077,0x307b,0x307f,0x3083,0x2f79, 0x3087,0x2f7d,0x308b,0x308f,0x3093,0x3097,0x309b,0x2ee9,0x2b65,0x309f,0x30a3,0x30a7,0x2c7d,0x2dd9,0x30ab,0x30af, 0x2f99,0x30b3,0x2f9d,0x30b7,0x30bb,0x30bf,0x2ef1,0x30c3,0x30c7,0x30cb,0x30cf,0x30d3,0x2ef5,0x30d7,0x30db,0x30df, 0x30e3,0x30e7,0x30eb,0x2fd5,0x30ef,0x30f3,0x2d15,0x30f7,0x2fe5,0x30fb,0x30ff,0x3103,0x3107,0x310b,0x2ff9,0x310f, 0x2f19,0x3113,0x2ffd,0x2c31,0x3117,0x3001,0x311b,0x3009,0x311f,0x3123,0x3127,0x312b,0x312f,0x3011,0x2f09,0x3133, 0x3015,0x3137,0x3019,0x313b,0x2ae1,0x313f,0x3145,0x314b,0x3151,0x3155,0x3159,0x315d,0x3163,0x3169,0x316f,0x3173, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0x3176,0xfe34,0x317c,1,1,1,1,1,1,1, 1,1,1,0x3182,0x3188,0x3190,0x319a,0x31a2,0x31a8,0x31ae,0x31b4,0x31ba,0x31c0,0x31c6,0x31cc,0x31d2, 1,0x31d8,0x31de,0x31e4,0x31ea,0x31f0,1,0x31f6,1,0x31fc,0x3202,1,0x3208,0x320e,1,0x3214, 0x321a,0x3220,0x3226,0x322c,0x3232,0x3238,0x323e,0x3244,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xffb8,1,0xffcc,1,1,1,1, 1,1,1,1,0xffcc,0xfe02,0xffb8,1,1,1,1,0xfe12,1,1,1,1, 0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,0xffb8,0xffb8,0xffcc,0xffcc, 0xffcc,0xffb8,0xffcc,0xffb8,0xffb8,0xffb8,1,1,1,1,1,1,1,1,1,0xa94, 0x2959,0xa9a,0x2963,1,1,1,1,1,0xaa0,1,1,1,1,1,0x296d,1, 1,1,1,1,1,1,1,1,0xfe12,0xfc0e,1,1,1,1,1,1, 1,0xfc00,1,1,1,1,1,1,0x2977,0x2981,1,0xaa6,0xaac,0xfe12,0xfe12,1, 1,1,1,1,1,1,1,1,1,1,0xfe12,1,1,1,1,1, 1,1,1,1,0xfe0e,1,1,1,1,1,0xfe12,0xfe0e,1,1,1,1, 1,1,1,1,1,0xfe0e,0xfe12,1,1,1,1,1,1,1,1,1, 1,1,0xfe0e,0xfe0e,1,0xfc00,1,1,1,1,1,1,1,0xab2,1,1, 1,0x298b,0x2995,0xfe12,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,1,1,1,0xfe12,1,1,1,0xfe0e,1,1,1,1,1,1,1, 1,1,0xfc00,1,1,1,1,1,1,1,1,0xabe,0xfc00,0x299f,0x29a9,0xfc00, 0x29b3,1,1,0xfe12,0xfe0e,1,1,1,1,1,1,1,1,1,1,1, 1,0xad0,0xad6,0x29bd,0x29c7,1,1,1,0xfe12,0xfe0e,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,0xfe12,0xfe0e,1,1,1,1,1, 1,1,1,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0xfe02,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,0x324a,0x3254,0x3268,0x3280,0x3298,0x32b0,0x32c8,0xffb0,0xffb0,0xfe02,0xfe02, 0xfe02,1,1,1,0xffc4,0xffb0,0xffb0,0xffb0,1,1,1,1,1,1,1,1, 0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,1,1, 1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1, 1,1,1,1,1,1,1,0x32d6,0x32e0,0x32f4,0x330c,0x3324,0x333c,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc, 0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,0xffcc, 0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1, 1,1,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,1,1,1,1,1,1, 1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xfe0e,1,1,1,1,1,0x334b,0x334f, 0x3353,0x3357,0x335d,0x2f3d,0x3361,0x3365,0x3369,0x336d,0x2f41,0x3371,0x3375,0x3379,0x2f45,0x337f,0x3383,0x3387, 0x338b,0x3391,0x3395,0x3399,0x339d,0x33a3,0x33a7,0x33ab,0x33af,0x302f,0x33b3,0x33b9,0x33bd,0x33c1,0x33c5,0x33c9, 0x33cd,0x33d1,0x33d5,0x3043,0x2f49,0x2f4d,0x3047,0x33d9,0x33dd,0x2c49,0x33e1,0x2f51,0x33e5,0x33e9,0x33ed,0x33f1, 0x33f1,0x33f1,0x33f5,0x33fb,0x33ff,0x3403,0x3407,0x340d,0x3411,0x3415,0x3419,0x341d,0x3421,0x3425,0x3429,0x342d, 0x3431,0x3435,0x3439,0x343d,0x343d,0x304f,0x3441,0x3445,0x3449,0x344d,0x2f59,0x3451,0x3455,0x3459,0x2ead,0x345d, 0x3461,0x3465,0x3469,0x346d,0x3471,0x3475,0x3479,0x347d,0x3483,0x3487,0x348b,0x348f,0x3493,0x3497,0x349b,0x34a1, 0x34a7,0x34ab,0x34af,0x34b3,0x34b7,0x34bb,0x34bf,0x34c3,0x34c7,0x34c7,0x34cb,0x34d1,0x34d5,0x2c39,0x34d9,0x34dd, 0x34e3,0x34e7,0x34eb,0x34ef,0x34f3,0x34f7,0x2f6d,0x34fb,0x34ff,0x3503,0x3509,0x350d,0x3513,0x3517,0x351b,0x351f, 0x3523,0x3527,0x352b,0x352f,0x3533,0x3537,0x353b,0x353f,0x3545,0x3549,0x354d,0x3551,0x2b61,0x3555,0x355b,0x355f, 0x355f,0x3565,0x3569,0x3569,0x356d,0x3571,0x3577,0x357d,0x3581,0x3585,0x3589,0x358d,0x3591,0x3595,0x3599,0x359d, 0x35a1,0x2f71,0x35a5,0x35ab,0x35af,0x35b3,0x307f,0x35b3,0x35b7,0x2f79,0x35bb,0x35bf,0x35c3,0x35c7,0x2f7d,0x2af5, 0x35cb,0x35cf,0x35d3,0x35d7,0x35db,0x35df,0x35e3,0x35e9,0x35ed,0x35f1,0x35f5,0x35f9,0x35fd,0x3603,0x3607,0x360b, 0x360f,0x3613,0x3617,0x361b,0x361f,0x3623,0x2f81,0x3627,0x362b,0x3631,0x3635,0x3639,0x363d,0x2f89,0x3641,0x3645, 0x3649,0x364d,0x3651,0x3655,0x3659,0x365d,0x2b65,0x309f,0x3661,0x3665,0x3669,0x366d,0x3673,0x3677,0x367b,0x367f, 0x2f8d,0x3683,0x3689,0x368d,0x3691,0x3151,0x3695,0x3699,0x369d,0x36a1,0x36a5,0x36ab,0x36af,0x36b3,0x36b7,0x36bd, 0x36c1,0x36c5,0x36c9,0x2c7d,0x36cd,0x36d1,0x36d7,0x36dd,0x36e3,0x36e7,0x36ed,0x36f1,0x36f5,0x36f9,0x36fd,0x2f91, 0x2dd9,0x3701,0x3705,0x3709,0x370d,0x3713,0x3717,0x371b,0x371f,0x30af,0x3723,0x3727,0x372d,0x3731,0x3735,0x373b, 0x3741,0x3745,0x30b3,0x3749,0x374d,0x3751,0x3755,0x3759,0x375d,0x3761,0x3767,0x376b,0x3771,0x3775,0x377b,0x30bb, 0x377f,0x3783,0x3789,0x378d,0x3791,0x3797,0x379d,0x37a1,0x37a5,0x37a9,0x37ad,0x37ad,0x37b1,0x37b5,0x30c3,0x37b9, 0x37bd,0x37c1,0x37c5,0x37c9,0x37cf,0x37d3,0x2c45,0x37d9,0x37df,0x37e3,0x37e9,0x37ef,0x37f5,0x37f9,0x30db,0x37fd, 0x3803,0x3809,0x380f,0x3815,0x3819,0x3819,0x30df,0x3159,0x381d,0x3821,0x3825,0x3829,0x382f,0x2bad,0x30e7,0x3833, 0x3837,0x2fbd,0x383d,0x3843,0x2f05,0x3849,0x384d,0x2fcd,0x3851,0x3855,0x3859,0x385f,0x385f,0x3865,0x3869,0x386d, 0x3873,0x3877,0x387b,0x387f,0x3885,0x3889,0x388d,0x3891,0x3895,0x3899,0x389f,0x38a3,0x38a7,0x38ab,0x38af,0x38b3, 0x38b7,0x38bd,0x38c3,0x38c7,0x38cd,0x38d1,0x38d7,0x38db,0x2fe5,0x38df,0x38e5,0x38eb,0x38ef,0x38f5,0x38f9,0x38ff, 0x3903,0x3907,0x390b,0x390f,0x3913,0x3917,0x391d,0x3923,0x3929,0x3565,0x392f,0x3933,0x3937,0x393b,0x393f,0x3943, 0x3947,0x394b,0x394f,0x3953,0x3957,0x395b,0x2c8d,0x3961,0x3965,0x3969,0x396d,0x3971,0x3975,0x2ff1,0x3979,0x397d, 0x3981,0x3985,0x3989,0x398f,0x3995,0x399b,0x399f,0x39a3,0x39a7,0x39ab,0x39b1,0x39b5,0x39bb,0x39bf,0x39c3,0x39c9, 0x39cf,0x39d3,0x2b99,0x39d7,0x39db,0x39df,0x39e3,0x39e7,0x39eb,0x3103,0x39ef,0x39f3,0x39f7,0x39fb,0x39ff,0x3a03, 0x3a07,0x3a0b,0x3a0f,0x3a13,0x3a19,0x3a1d,0x3a21,0x3a25,0x3a29,0x3a2d,0x3a33,0x3a39,0x3a3d,0x3a41,0x3117,0x311b, 0x3a45,0x3a49,0x3a4f,0x3a53,0x3a57,0x3a5b,0x3a5f,0x3a65,0x3a6b,0x3a6f,0x3a73,0x3a77,0x3a7d,0x311f,0x3a81,0x3a87, 0x3a8d,0x3a91,0x3a95,0x3a99,0x3a9f,0x3aa3,0x3aa7,0x3aab,0x3aaf,0x3ab3,0x3ab7,0x3abb,0x3ac1,0x3ac5,0x3ac9,0x3acd, 0x3ad3,0x3ad7,0x3adb,0x3adf,0x3ae3,0x3ae9,0x3aef,0x3af3,0x3af7,0x3afb,0x3b01,0x3b05,0x3137,0x3137,0x3b0b,0x3b0f, 0x3b15,0x3b19,0x3b1d,0x3b21,0x3b25,0x3b29,0x3b2d,0x3b31,0x313b,0x3b37,0x3b3b,0x3b3f,0x3b43,0x3b47,0x3b4b,0x3b51, 0x3b55,0x3b5b,0x3b61,0x3b67,0x3b6b,0x3b6f,0x3b73,0x3b77,0x3b7b,0x3b7f,0x3b83,0x3b87,1,1 }; static const UCPTrie norm2_nfc_data_trie={ norm2_nfc_data_trieIndex, { norm2_nfc_data_trieData }, 1690, 7822, 0x2fc00, 0x30, 0, 0, 0, 0, 0xc4, 0x226, 0x1, }; static const uint16_t norm2_nfc_data_extraData[7724]={ 0xffff,0xffff,0x8670,0x44dc,0x8670,0x44c0,0x8670,0x44de,0x600,0x180,0x602,0x182,0x604,0x185,0x606,0x186, 0x608,0x200,0x60c,0x205,0x60e,0x44d,0x610,0x189,0x612,0x3d44,0x614,0x18b,0x618,0x39a,0x61e,0x400, 0x622,0x404,0x646,0x3d41,0x64a,0x3c00,0x8650,0x208,0x60e,0x3c04,0x646,0x3c08,0x8662,0x3c0c,0x602,0x20c, 0x604,0x210,0x60e,0x214,0x618,0x218,0x864e,0x18f,0x60e,0x3c14,0x618,0x21c,0x646,0x3c18,0x64e,0x3c20, 0x65a,0x3c24,0x8662,0x3c1c,0x600,0x190,0x602,0x192,0x604,0x195,0x606,0x3d78,0x608,0x225,0x60c,0x228, 0x60e,0x22c,0x610,0x196,0x612,0x3d74,0x618,0x234,0x61e,0x408,0x622,0x40c,0x646,0x3d71,0x64e,0x451, 0x650,0x230,0x65a,0x3c30,0x8660,0x3c34,0x860e,0x3c3c,0x602,0x3e8,0x604,0x238,0x608,0x3c40,0x60c,0x23c, 0x60e,0x240,0x618,0x3cc,0x864e,0x244,0x604,0x248,0x60e,0x3c44,0x610,0x3c4c,0x618,0x43c,0x646,0x3c48, 0x64e,0x3c50,0x865c,0x3c54,0x600,0x198,0x602,0x19a,0x604,0x19c,0x606,0x250,0x608,0x254,0x60c,0x258, 0x60e,0x260,0x610,0x19f,0x612,0x3d90,0x618,0x39e,0x61e,0x410,0x622,0x414,0x646,0x3d94,0x650,0x25c, 0x8660,0x3c58,0x8604,0x268,0x602,0x3c60,0x618,0x3d0,0x646,0x3c64,0x64e,0x26c,0x8662,0x3c68,0x602,0x272, 0x618,0x27a,0x646,0x3c6d,0x64e,0x276,0x65a,0x3c78,0x8662,0x3c74,0x602,0x3c7c,0x60e,0x3c80,0x8646,0x3c84, 0x600,0x3f0,0x602,0x286,0x606,0x1a2,0x60e,0x3c88,0x618,0x28e,0x646,0x3c8c,0x64e,0x28a,0x65a,0x3c94, 0x8662,0x3c90,0x600,0x1a4,0x602,0x1a6,0x604,0x1a9,0x606,0x1ab,0x608,0x299,0x60c,0x29c,0x60e,0x45d, 0x610,0x1ad,0x612,0x3d9c,0x616,0x2a0,0x618,0x3a2,0x61e,0x418,0x622,0x41c,0x636,0x341,0x646,0x3d99, 0x8650,0x3d5,0x602,0x3ca8,0x860e,0x3cac,0x602,0x2a8,0x60e,0x3cb0,0x618,0x2b0,0x61e,0x420,0x622,0x424, 0x646,0x3cb5,0x64e,0x2ac,0x8662,0x3cbc,0x602,0x2b5,0x604,0x2b8,0x60e,0x3cc0,0x618,0x2c1,0x646,0x3cc5, 0x64c,0x430,0x864e,0x2bc,0x60e,0x3cd4,0x618,0x2c8,0x646,0x3cd8,0x64c,0x434,0x64e,0x2c4,0x65a,0x3ce0, 0x8662,0x3cdc,0x600,0x1b2,0x602,0x1b4,0x604,0x1b6,0x606,0x2d1,0x608,0x2d5,0x60c,0x2d8,0x610,0x1b9, 0x612,0x3dcc,0x614,0x2dc,0x616,0x2e0,0x618,0x3a6,0x61e,0x428,0x622,0x42c,0x636,0x35f,0x646,0x3dc8, 0x648,0x3ce4,0x650,0x2e4,0x65a,0x3cec,0x8660,0x3ce8,0x606,0x3cf8,0x8646,0x3cfc,0x600,0x3d00,0x602,0x3d04, 0x604,0x2e8,0x60e,0x3d0c,0x610,0x3d08,0x8646,0x3d10,0x60e,0x3d14,0x8610,0x3d18,0x600,0x3de4,0x602,0x1ba, 0x604,0x2ec,0x606,0x3df0,0x608,0x464,0x60e,0x3d1c,0x610,0x2f0,0x612,0x3dec,0x8646,0x3de8,0x602,0x2f2, 0x604,0x3d20,0x60e,0x2f6,0x618,0x2fa,0x646,0x3d24,0x8662,0x3d28,0x600,0x1c0,0x602,0x1c2,0x604,0x1c5, 0x606,0x1c6,0x608,0x202,0x60c,0x207,0x60e,0x44f,0x610,0x1c9,0x612,0x3d46,0x614,0x1cb,0x618,0x39c, 0x61e,0x402,0x622,0x406,0x646,0x3d43,0x64a,0x3c02,0x8650,0x20a,0x60e,0x3c06,0x646,0x3c0a,0x8662,0x3c0e, 0x602,0x20e,0x604,0x212,0x60e,0x216,0x618,0x21a,0x864e,0x1cf,0x60e,0x3c16,0x618,0x21e,0x646,0x3c1a, 0x64e,0x3c22,0x65a,0x3c26,0x8662,0x3c1e,0x600,0x1d0,0x602,0x1d2,0x604,0x1d5,0x606,0x3d7a,0x608,0x227, 0x60c,0x22a,0x60e,0x22e,0x610,0x1d6,0x612,0x3d76,0x618,0x236,0x61e,0x40a,0x622,0x40e,0x646,0x3d73, 0x64e,0x453,0x650,0x232,0x65a,0x3c32,0x8660,0x3c36,0x860e,0x3c3e,0x602,0x3ea,0x604,0x23a,0x608,0x3c42, 0x60c,0x23e,0x60e,0x242,0x618,0x3ce,0x864e,0x246,0x604,0x24a,0x60e,0x3c46,0x610,0x3c4e,0x618,0x43e, 0x646,0x3c4a,0x64e,0x3c52,0x65c,0x3c56,0x8662,0x3d2c,0x600,0x1d8,0x602,0x1da,0x604,0x1dc,0x606,0x252, 0x608,0x256,0x60c,0x25a,0x610,0x1df,0x612,0x3d92,0x618,0x3a0,0x61e,0x412,0x622,0x416,0x646,0x3d96, 0x650,0x25e,0x8660,0x3c5a,0x604,0x26a,0x8618,0x3e0,0x602,0x3c62,0x618,0x3d2,0x646,0x3c66,0x64e,0x26e, 0x8662,0x3c6a,0x602,0x274,0x618,0x27c,0x646,0x3c6f,0x64e,0x278,0x65a,0x3c7a,0x8662,0x3c76,0x602,0x3c7e, 0x60e,0x3c82,0x8646,0x3c86,0x600,0x3f2,0x602,0x288,0x606,0x1e2,0x60e,0x3c8a,0x618,0x290,0x646,0x3c8e, 0x64e,0x28c,0x65a,0x3c96,0x8662,0x3c92,0x600,0x1e4,0x602,0x1e6,0x604,0x1e9,0x606,0x1eb,0x608,0x29b, 0x60c,0x29e,0x60e,0x45f,0x610,0x1ed,0x612,0x3d9e,0x616,0x2a2,0x618,0x3a4,0x61e,0x41a,0x622,0x41e, 0x636,0x343,0x646,0x3d9b,0x8650,0x3d7,0x602,0x3caa,0x860e,0x3cae,0x602,0x2aa,0x60e,0x3cb2,0x618,0x2b2, 0x61e,0x422,0x622,0x426,0x646,0x3cb7,0x64e,0x2ae,0x8662,0x3cbe,0x602,0x2b7,0x604,0x2ba,0x60e,0x3cc2, 0x618,0x2c3,0x646,0x3cc7,0x64c,0x432,0x864e,0x2be,0x60e,0x3cd6,0x610,0x3d2e,0x618,0x2ca,0x646,0x3cda, 0x64c,0x436,0x64e,0x2c6,0x65a,0x3ce2,0x8662,0x3cde,0x600,0x1f2,0x602,0x1f4,0x604,0x1f6,0x606,0x2d3, 0x608,0x2d7,0x60c,0x2da,0x610,0x1f9,0x612,0x3dce,0x614,0x2de,0x616,0x2e2,0x618,0x3a8,0x61e,0x42a, 0x622,0x42e,0x636,0x361,0x646,0x3dca,0x648,0x3ce6,0x650,0x2e6,0x65a,0x3cee,0x8660,0x3cea,0x606,0x3cfa, 0x8646,0x3cfe,0x600,0x3d02,0x602,0x3d06,0x604,0x2ea,0x60e,0x3d0e,0x610,0x3d0a,0x614,0x3d30,0x8646,0x3d12, 0x60e,0x3d16,0x8610,0x3d1a,0x600,0x3de6,0x602,0x1fa,0x604,0x2ee,0x606,0x3df2,0x608,0x466,0x60e,0x3d1e, 0x610,0x1fe,0x612,0x3dee,0x614,0x3d32,0x8646,0x3dea,0x602,0x2f4,0x604,0x3d22,0x60e,0x2f8,0x618,0x2fc, 0x646,0x3d26,0x8662,0x3d2a,0x600,0x3fda,0x602,0x70a,0x8684,0x3f82,0x602,0x3f8,0x8608,0x3c4,0x8602,0x3fc, 0x602,0x3fa,0x8608,0x3c6,0x8602,0x3fe,0x860e,0x3d36,0x8618,0x3dc,0x8618,0x3de,0x600,0x3f74,0x602,0x70c, 0x608,0x3f72,0x60c,0x3f70,0x626,0x3e11,0x628,0x3e13,0x868a,0x3f78,0x600,0x3f90,0x602,0x710,0x626,0x3e31, 0x8628,0x3e33,0x600,0x3f94,0x602,0x712,0x626,0x3e51,0x628,0x3e53,0x868a,0x3f98,0x600,0x3fb4,0x602,0x714, 0x608,0x3fb2,0x60c,0x3fb0,0x610,0x754,0x626,0x3e71,0x8628,0x3e73,0x600,0x3ff0,0x602,0x718,0x626,0x3e91, 0x8628,0x3e93,0x8628,0x3fd8,0x600,0x3fd4,0x602,0x71c,0x608,0x3fd2,0x60c,0x3fd0,0x610,0x756,0x8628,0x3eb3, 0x600,0x3ff4,0x602,0x71e,0x626,0x3ed1,0x628,0x3ed3,0x868a,0x3ff8,0x600,0x3ee1,0x602,0x759,0x608,0x3f62, 0x60c,0x3f60,0x626,0x3e01,0x628,0x3e03,0x684,0x3f6d,0x868a,0x3f66,0x600,0x3ee4,0x602,0x75a,0x626,0x3e21, 0x8628,0x3e23,0x600,0x3ee9,0x602,0x75d,0x626,0x3e41,0x628,0x3e43,0x684,0x3f8d,0x868a,0x3f86,0x600,0x3eec, 0x602,0x75e,0x608,0x3fa2,0x60c,0x3fa0,0x610,0x795,0x626,0x3e61,0x628,0x3e63,0x8684,0x3fac,0x600,0x3ef0, 0x602,0x798,0x626,0x3e81,0x8628,0x3e83,0x626,0x3fc8,0x8628,0x3fca,0x600,0x3ef4,0x602,0x79a,0x608,0x3fc2, 0x60c,0x3fc0,0x610,0x797,0x626,0x3ea1,0x628,0x3ea3,0x8684,0x3fcc,0x600,0x3ef9,0x602,0x79d,0x626,0x3ec1, 0x628,0x3ec3,0x684,0x3fed,0x868a,0x3fe6,0x602,0x7a6,0x8610,0x7a8,0x8610,0x80e,0x60c,0x9a0,0x8610,0x9a4, 0x8602,0x806,0x600,0x800,0x60c,0x9ac,0x8610,0x802,0x60c,0x982,0x8610,0x9b8,0x8610,0x9bc,0x600,0x81a, 0x608,0x9c4,0x60c,0x832,0x8610,0x9c8,0x8602,0x818,0x8610,0x9cc,0x608,0x9dc,0x60c,0x81c,0x610,0x9e0, 0x8616,0x9e4,0x8610,0x9e8,0x8610,0x9f0,0x8610,0x9d8,0x60c,0x9a2,0x8610,0x9a6,0x8602,0x8a6,0x600,0x8a0, 0x60c,0x9ae,0x8610,0x8a2,0x60c,0x984,0x8610,0x9ba,0x8610,0x9be,0x600,0x8ba,0x608,0x9c6,0x60c,0x872, 0x8610,0x9ca,0x8602,0x8b8,0x8610,0x9ce,0x608,0x9de,0x60c,0x8bc,0x610,0x9e2,0x8616,0x9e6,0x8610,0x9ea, 0x8610,0x9f2,0x8610,0x9da,0x8610,0x8ae,0x861e,0x8ec,0x861e,0x8ee,0x8610,0x9b4,0x8610,0x9b6,0x8610,0x9d4, 0x8610,0x9d6,0xca6,0xc44,0xca8,0xc46,0x8caa,0xc4a,0x8ca8,0xc48,0x8ca8,0xc4c,0x8ca8,0xd84,0x8ca8,0xda6, 0x8ca8,0xd80,0x9278,0x1252,0x9278,0x1262,0x9278,0x1268,0x137c,0x1396,0x93ae,0x1398,0x167c,0x1696,0x16ac,0x1690, 0x96ae,0x1698,0x97ae,0x1728,0x177c,0x1794,0x97ae,0x1798,0x977c,0x1796,0x98ac,0x1890,0x99aa,0x1980,0x1984,0x1995, 0x19aa,0x198e,0x99ac,0x1990,0x1a7c,0x1a94,0x9aae,0x1a98,0x9a7c,0x1a96,0x1b94,0x1bb4,0x1b9e,0x1bb9,0x9bbe,0x1bbc, 0xa05c,0x204c,0xb66a,0x360c,0xb66a,0x3610,0xb66a,0x3614,0xb66a,0x3618,0xb66a,0x361c,0xb66a,0x3624,0xb66a,0x3676, 0xb66a,0x367a,0xb66a,0x3680,0xb66a,0x3682,0xb66a,0x3686,0x600,0x3f9a,0x602,0x3f9c,0x8684,0x3f9e,0x600,0x3fba, 0x602,0x3fbc,0x8684,0x3fbe,0x8670,0x4334,0x8670,0x4336,0x8670,0x435c,0x8670,0x439a,0x8670,0x439e,0x8670,0x439c, 0x8670,0x4408,0x8670,0x4412,0x8670,0x4418,0x8670,0x4448,0x8670,0x444c,0x8670,0x4482,0x8670,0x4488,0x8670,0x448e, 0x8670,0x4492,0x8670,0x44da,0x8670,0x44c4,0x8670,0x44e0,0x8670,0x44e2,0x8670,0x44e8,0x8670,0x44ea,0x8670,0x44f0, 0x8670,0x44f2,0x8670,0x4500,0x8670,0x4502,0x8670,0x45c0,0x8670,0x45c2,0x8670,0x4508,0x8670,0x450a,0x8670,0x4510, 0x8670,0x4512,0x8670,0x45c4,0x8670,0x45c6,0x8670,0x4558,0x8670,0x455a,0x8670,0x455c,0x8670,0x455e,0x8670,0x45d4, 0x8670,0x45d6,0x8670,0x45d8,0x8670,0x45da,0xe132,0x6128,0xe132,0x6098,0xe132,0x609c,0xe132,0x60a0,0xe132,0x60a4, 0xe132,0x60a8,0xe132,0x60ac,0xe132,0x60b0,0xe132,0x60b4,0xe132,0x60b8,0xe132,0x60bc,0xe132,0x60c0,0xe132,0x60c4, 0xe132,0x60ca,0xe132,0x60ce,0xe132,0x60d2,0x6132,0x60e0,0xe134,0x60e2,0x6132,0x60e6,0xe134,0x60e8,0x6132,0x60ec, 0xe134,0x60ee,0x6132,0x60f2,0xe134,0x60f4,0x6132,0x60f8,0xe134,0x60fa,0xe132,0x613c,0xe132,0x61e8,0xe132,0x6158, 0xe132,0x615c,0xe132,0x6160,0xe132,0x6164,0xe132,0x6168,0xe132,0x616c,0xe132,0x6170,0xe132,0x6174,0xe132,0x6178, 0xe132,0x617c,0xe132,0x6180,0xe132,0x6184,0xe132,0x618a,0xe132,0x618e,0xe132,0x6192,0x6132,0x61a0,0xe134,0x61a2, 0x6132,0x61a6,0xe134,0x61a8,0x6132,0x61ac,0xe134,0x61ae,0x6132,0x61b2,0xe134,0x61b4,0x6132,0x61b8,0xe134,0x61ba, 0xe132,0x61ee,0xe132,0x61f0,0xe132,0x61f2,0xe132,0x61f4,0xe132,0x61fc,0xb489,0x2e82,0x2134,0xb489,0x2e82,0x2138, 0xb489,0x2e82,0x2156,0xb489,0x49c2,0x225c,0xb489,0x49c2,0x225e,0x3489,0xcf82,0x2696,0xb489,0xd5c2,0x2698,0x348b, 0x2c02,0x2978,0x348b,0x2e82,0x2976,0xb48b,0x2f42,0x297c,0xb48b,0x6bc2,0x2b74,0xb48b,0x6bc2,0x2b76,2,0xe602, 0x41,0x302,0x600,0x3d4c,0x602,0x3d48,0x606,0x3d54,0x8612,0x3d50,0xe602,0x41,0x308,0x8608,0x3bc,0xe602, 0x41,0x30a,0x8602,0x3f4,0xca02,0x43,0x327,0x8602,0x3c10,0xe602,0x45,0x302,0x600,0x3d80,0x602,0x3d7c, 0x606,0x3d88,0x8612,0x3d84,0xe602,0x49,0x308,0x8602,0x3c5c,0xe602,0x4f,0x302,0x600,0x3da4,0x602,0x3da0, 0x606,0x3dac,0x8612,0x3da8,0xe602,0x4f,0x303,0x602,0x3c98,0x608,0x458,0x8610,0x3c9c,0xe602,0x4f,0x308, 0x8608,0x454,0xe602,0x55,0x308,0x600,0x3b6,0x602,0x3ae,0x608,0x3aa,0x8618,0x3b2,0xe602,0x61,0x302, 0x600,0x3d4e,0x602,0x3d4a,0x606,0x3d56,0x8612,0x3d52,0xe602,0x61,0x308,0x8608,0x3be,0xe602,0x61,0x30a, 0x8602,0x3f6,0xca02,0x63,0x327,0x8602,0x3c12,0xe602,0x65,0x302,0x600,0x3d82,0x602,0x3d7e,0x606,0x3d8a, 0x8612,0x3d86,0xe602,0x69,0x308,0x8602,0x3c5e,0xe602,0x6f,0x302,0x600,0x3da6,0x602,0x3da2,0x606,0x3dae, 0x8612,0x3daa,0xe602,0x6f,0x303,0x602,0x3c9a,0x608,0x45a,0x8610,0x3c9e,0xe602,0x6f,0x308,0x8608,0x456, 0xe602,0x75,0x308,0x600,0x3b8,0x602,0x3b0,0x608,0x3ac,0x8618,0x3b4,0xe602,0x41,0x306,0x600,0x3d60, 0x602,0x3d5c,0x606,0x3d68,0x8612,0x3d64,0xe602,0x61,0x306,0x600,0x3d62,0x602,0x3d5e,0x606,0x3d6a,0x8612, 0x3d66,0xe602,0x45,0x304,0x600,0x3c28,0x8602,0x3c2c,0xe602,0x65,0x304,0x600,0x3c2a,0x8602,0x3c2e,0xe602, 0x4f,0x304,0x600,0x3ca0,0x8602,0x3ca4,0xe602,0x6f,0x304,0x600,0x3ca2,0x8602,0x3ca6,0xe602,0x53,0x301, 0x860e,0x3cc8,0xe602,0x73,0x301,0x860e,0x3cca,0xe602,0x53,0x30c,0x860e,0x3ccc,0xe602,0x73,0x30c,0x860e, 0x3cce,0xe602,0x55,0x303,0x8602,0x3cf0,0xe602,0x75,0x303,0x8602,0x3cf2,0xe602,0x55,0x304,0x8610,0x3cf4, 0xe602,0x75,0x304,0x8610,0x3cf6,0xd802,0x4f,0x31b,0x600,0x3db8,0x602,0x3db4,0x606,0x3dc0,0x612,0x3dbc, 0x8646,0x3dc4,0xd802,0x6f,0x31b,0x600,0x3dba,0x602,0x3db6,0x606,0x3dc2,0x612,0x3dbe,0x8646,0x3dc6,0xd802, 0x55,0x31b,0x600,0x3dd4,0x602,0x3dd0,0x606,0x3ddc,0x612,0x3dd8,0x8646,0x3de0,0xd802,0x75,0x31b,0x600, 0x3dd6,0x602,0x3dd2,0x606,0x3dde,0x612,0x3dda,0x8646,0x3de2,0xca02,0x4f,0x328,0x8608,0x3d8,0xca02,0x6f, 0x328,0x8608,0x3da,0xe602,0x41,0x307,0x8608,0x3c0,0xe602,0x61,0x307,0x8608,0x3c2,0xca02,0x45,0x327, 0x860c,0x3c38,0xca02,0x65,0x327,0x860c,0x3c3a,0xe602,0x4f,0x307,0x8608,0x460,0xe602,0x6f,0x307,0x8608, 0x462,0xe602,0x3b1,0x301,0x868a,0x3f68,0xe602,0x3b7,0x301,0x868a,0x3f88,0xe602,0x3b9,0x308,0x600,0x3fa4, 0x602,0x720,0x8684,0x3fae,0xe602,0x3c5,0x308,0x600,0x3fc4,0x602,0x760,0x8684,0x3fce,0xe602,0x3c9,0x301, 0x868a,0x3fe8,2,0xcc6,0xcc2,0x99aa,0x1996,2,0xdd9,0xdcf,0x9b94,0x1bba,0xdc02,0x4c,0x323,0x8608, 0x3c70,0xdc02,0x6c,0x323,0x8608,0x3c72,0xdc02,0x52,0x323,0x8608,0x3cb8,0xdc02,0x72,0x323,0x8608,0x3cba, 0xdc02,0x53,0x323,0x860e,0x3cd0,0xdc02,0x73,0x323,0x860e,0x3cd2,0xdc02,0x41,0x323,0x604,0x3d58,0x860c, 0x3d6c,0xdc02,0x61,0x323,0x604,0x3d5a,0x860c,0x3d6e,0xdc02,0x45,0x323,0x8604,0x3d8c,0xdc02,0x65,0x323, 0x8604,0x3d8e,0xdc02,0x4f,0x323,0x8604,0x3db0,0xdc02,0x6f,0x323,0x8604,0x3db2,0xe602,0x3b1,0x313,0x600, 0x3e05,0x602,0x3e09,0x684,0x3e0d,0x868a,0x3f00,0xe602,0x3b1,0x314,0x600,0x3e07,0x602,0x3e0b,0x684,0x3e0f, 0x868a,0x3f02,0x1f00,0xe643,0x3b1,0x313,0x300,0x868a,0x3f04,0x1f01,0xe643,0x3b1,0x314,0x300,0x868a,0x3f06, 0x1f00,0xe643,0x3b1,0x313,0x301,0x868a,0x3f08,0x1f01,0xe643,0x3b1,0x314,0x301,0x868a,0x3f0a,0x1f00,0xe643, 0x3b1,0x313,0x342,0x868a,0x3f0c,0x1f01,0xe643,0x3b1,0x314,0x342,0x868a,0x3f0e,0xe602,0x391,0x313,0x600, 0x3e15,0x602,0x3e19,0x684,0x3e1d,0x868a,0x3f10,0xe602,0x391,0x314,0x600,0x3e17,0x602,0x3e1b,0x684,0x3e1f, 0x868a,0x3f12,0x1f08,0xe643,0x391,0x313,0x300,0x868a,0x3f14,0x1f09,0xe643,0x391,0x314,0x300,0x868a,0x3f16, 0x1f08,0xe643,0x391,0x313,0x301,0x868a,0x3f18,0x1f09,0xe643,0x391,0x314,0x301,0x868a,0x3f1a,0x1f08,0xe643, 0x391,0x313,0x342,0x868a,0x3f1c,0x1f09,0xe643,0x391,0x314,0x342,0x868a,0x3f1e,0xe602,0x3b5,0x313,0x600, 0x3e24,0x8602,0x3e28,0xe602,0x3b5,0x314,0x600,0x3e26,0x8602,0x3e2a,0xe602,0x395,0x313,0x600,0x3e34,0x8602, 0x3e38,0xe602,0x395,0x314,0x600,0x3e36,0x8602,0x3e3a,0xe602,0x3b7,0x313,0x600,0x3e45,0x602,0x3e49,0x684, 0x3e4d,0x868a,0x3f20,0xe602,0x3b7,0x314,0x600,0x3e47,0x602,0x3e4b,0x684,0x3e4f,0x868a,0x3f22,0x1f20,0xe643, 0x3b7,0x313,0x300,0x868a,0x3f24,0x1f21,0xe643,0x3b7,0x314,0x300,0x868a,0x3f26,0x1f20,0xe643,0x3b7,0x313, 0x301,0x868a,0x3f28,0x1f21,0xe643,0x3b7,0x314,0x301,0x868a,0x3f2a,0x1f20,0xe643,0x3b7,0x313,0x342,0x868a, 0x3f2c,0x1f21,0xe643,0x3b7,0x314,0x342,0x868a,0x3f2e,0xe602,0x397,0x313,0x600,0x3e55,0x602,0x3e59,0x684, 0x3e5d,0x868a,0x3f30,0xe602,0x397,0x314,0x600,0x3e57,0x602,0x3e5b,0x684,0x3e5f,0x868a,0x3f32,0x1f28,0xe643, 0x397,0x313,0x300,0x868a,0x3f34,0x1f29,0xe643,0x397,0x314,0x300,0x868a,0x3f36,0x1f28,0xe643,0x397,0x313, 0x301,0x868a,0x3f38,0x1f29,0xe643,0x397,0x314,0x301,0x868a,0x3f3a,0x1f28,0xe643,0x397,0x313,0x342,0x868a, 0x3f3c,0x1f29,0xe643,0x397,0x314,0x342,0x868a,0x3f3e,0xe602,0x3b9,0x313,0x600,0x3e64,0x602,0x3e68,0x8684, 0x3e6c,0xe602,0x3b9,0x314,0x600,0x3e66,0x602,0x3e6a,0x8684,0x3e6e,0xe602,0x399,0x313,0x600,0x3e74,0x602, 0x3e78,0x8684,0x3e7c,0xe602,0x399,0x314,0x600,0x3e76,0x602,0x3e7a,0x8684,0x3e7e,0xe602,0x3bf,0x313,0x600, 0x3e84,0x8602,0x3e88,0xe602,0x3bf,0x314,0x600,0x3e86,0x8602,0x3e8a,0xe602,0x39f,0x313,0x600,0x3e94,0x8602, 0x3e98,0xe602,0x39f,0x314,0x600,0x3e96,0x8602,0x3e9a,0xe602,0x3c5,0x313,0x600,0x3ea4,0x602,0x3ea8,0x8684, 0x3eac,0xe602,0x3c5,0x314,0x600,0x3ea6,0x602,0x3eaa,0x8684,0x3eae,0xe602,0x3a5,0x314,0x600,0x3eb6,0x602, 0x3eba,0x8684,0x3ebe,0xe602,0x3c9,0x313,0x600,0x3ec5,0x602,0x3ec9,0x684,0x3ecd,0x868a,0x3f40,0xe602,0x3c9, 0x314,0x600,0x3ec7,0x602,0x3ecb,0x684,0x3ecf,0x868a,0x3f42,0x1f60,0xe643,0x3c9,0x313,0x300,0x868a,0x3f44, 0x1f61,0xe643,0x3c9,0x314,0x300,0x868a,0x3f46,0x1f60,0xe643,0x3c9,0x313,0x301,0x868a,0x3f48,0x1f61,0xe643, 0x3c9,0x314,0x301,0x868a,0x3f4a,0x1f60,0xe643,0x3c9,0x313,0x342,0x868a,0x3f4c,0x1f61,0xe643,0x3c9,0x314, 0x342,0x868a,0x3f4e,0xe602,0x3a9,0x313,0x600,0x3ed5,0x602,0x3ed9,0x684,0x3edd,0x868a,0x3f50,0xe602,0x3a9, 0x314,0x600,0x3ed7,0x602,0x3edb,0x684,0x3edf,0x868a,0x3f52,0x1f68,0xe643,0x3a9,0x313,0x300,0x868a,0x3f54, 0x1f69,0xe643,0x3a9,0x314,0x300,0x868a,0x3f56,0x1f68,0xe643,0x3a9,0x313,0x301,0x868a,0x3f58,0x1f69,0xe643, 0x3a9,0x314,0x301,0x868a,0x3f5a,0x1f68,0xe643,0x3a9,0x313,0x342,0x868a,0x3f5c,0x1f69,0xe643,0x3a9,0x314, 0x342,0x868a,0x3f5e,0xe602,0x3b1,0x300,0x868a,0x3f64,0xe602,0x3b7,0x300,0x868a,0x3f84,0xe602,0x3c9,0x300, 0x868a,0x3fe4,0xe602,0x3b1,0x342,0x868a,0x3f6e,0xe602,0x3b7,0x342,0x868a,0x3f8e,0xe602,0x3c9,0x342,0x868a, 0x3fee,3,0xe602,0x41,0x300,0xe602,0x41,0x301,0xe602,0x41,0x303,0xe602,0x45,0x300,0xe602,0x45, 0x301,0xe602,0x45,0x308,0xe602,0x49,0x300,0xe602,0x49,0x301,0xe602,0x49,0x302,0xe602,0x4e,0x303, 0xe602,0x4f,0x300,0xe602,0x4f,0x301,0xe602,0x55,0x300,0xe602,0x55,0x301,0xe602,0x55,0x302,0xe602, 0x59,0x301,0xe602,0x61,0x300,0xe602,0x61,0x301,0xe602,0x61,0x303,0xe602,0x65,0x300,0xe602,0x65, 0x301,0xe602,0x65,0x308,0xe602,0x69,0x300,0xe602,0x69,0x301,0xe602,0x69,0x302,0xe602,0x6e,0x303, 0xe602,0x6f,0x300,0xe602,0x6f,0x301,0xe602,0x75,0x300,0xe602,0x75,0x301,0xe602,0x75,0x302,0xe602, 0x79,0x301,0xe602,0x79,0x308,0xe602,0x41,0x304,0xe602,0x61,0x304,0xca02,0x41,0x328,0xca02,0x61, 0x328,0xe602,0x43,0x301,0xe602,0x63,0x301,0xe602,0x43,0x302,0xe602,0x63,0x302,0xe602,0x43,0x307, 0xe602,0x63,0x307,0xe602,0x43,0x30c,0xe602,0x63,0x30c,0xe602,0x44,0x30c,0xe602,0x64,0x30c,0xe602, 0x45,0x306,0xe602,0x65,0x306,0xe602,0x45,0x307,0xe602,0x65,0x307,0xca02,0x45,0x328,0xca02,0x65, 0x328,0xe602,0x45,0x30c,0xe602,0x65,0x30c,0xe602,0x47,0x302,0xe602,0x67,0x302,0xe602,0x47,0x306, 0xe602,0x67,0x306,0xe602,0x47,0x307,0xe602,0x67,0x307,0xca02,0x47,0x327,0xca02,0x67,0x327,0xe602, 0x48,0x302,0xe602,0x68,0x302,0xe602,0x49,0x303,0xe602,0x69,0x303,0xe602,0x49,0x304,0xe602,0x69, 0x304,0xe602,0x49,0x306,0xe602,0x69,0x306,0xca02,0x49,0x328,0xca02,0x69,0x328,0xe602,0x49,0x307, 0xe602,0x4a,0x302,0xe602,0x6a,0x302,0xca02,0x4b,0x327,0xca02,0x6b,0x327,0xe602,0x4c,0x301,0xe602, 0x6c,0x301,0xca02,0x4c,0x327,0xca02,0x6c,0x327,0xe602,0x4c,0x30c,0xe602,0x6c,0x30c,0xe602,0x4e, 0x301,0xe602,0x6e,0x301,0xca02,0x4e,0x327,0xca02,0x6e,0x327,0xe602,0x4e,0x30c,0xe602,0x6e,0x30c, 0xe602,0x4f,0x306,0xe602,0x6f,0x306,0xe602,0x4f,0x30b,0xe602,0x6f,0x30b,0xe602,0x52,0x301,0xe602, 0x72,0x301,0xca02,0x52,0x327,0xca02,0x72,0x327,0xe602,0x52,0x30c,0xe602,0x72,0x30c,0xe602,0x53, 0x302,0xe602,0x73,0x302,0xca02,0x53,0x327,0xca02,0x73,0x327,0xca02,0x54,0x327,0xca02,0x74,0x327, 0xe602,0x54,0x30c,0xe602,0x74,0x30c,0xe602,0x55,0x306,0xe602,0x75,0x306,0xe602,0x55,0x30a,0xe602, 0x75,0x30a,0xe602,0x55,0x30b,0xe602,0x75,0x30b,0xca02,0x55,0x328,0xca02,0x75,0x328,0xe602,0x57, 0x302,0xe602,0x77,0x302,0xe602,0x59,0x302,0xe602,0x79,0x302,0xe602,0x59,0x308,0xe602,0x5a,0x301, 0xe602,0x7a,0x301,0xe602,0x5a,0x307,0xe602,0x7a,0x307,0xe602,0x5a,0x30c,0xe602,0x7a,0x30c,0xe602, 0x41,0x30c,0xe602,0x61,0x30c,0xe602,0x49,0x30c,0xe602,0x69,0x30c,0xe602,0x4f,0x30c,0xe602,0x6f, 0x30c,0xe602,0x55,0x30c,0xe602,0x75,0x30c,0xdc,0xe643,0x55,0x308,0x304,0xfc,0xe643,0x75,0x308, 0x304,0xdc,0xe643,0x55,0x308,0x301,0xfc,0xe643,0x75,0x308,0x301,0xdc,0xe643,0x55,0x308,0x30c, 0xfc,0xe643,0x75,0x308,0x30c,0xdc,0xe643,0x55,0x308,0x300,0xfc,0xe643,0x75,0x308,0x300,0xc4, 0xe643,0x41,0x308,0x304,0xe4,0xe643,0x61,0x308,0x304,0x226,0xe643,0x41,0x307,0x304,0x227,0xe643, 0x61,0x307,0x304,0xe602,0xc6,0x304,0xe602,0xe6,0x304,0xe602,0x47,0x30c,0xe602,0x67,0x30c,0xe602, 0x4b,0x30c,0xe602,0x6b,0x30c,0x1ea,0xe643,0x4f,0x328,0x304,0x1eb,0xe643,0x6f,0x328,0x304,0xe602, 0x1b7,0x30c,0xe602,0x292,0x30c,0xe602,0x6a,0x30c,0xe602,0x47,0x301,0xe602,0x67,0x301,0xe602,0x4e, 0x300,0xe602,0x6e,0x300,0xc5,0xe643,0x41,0x30a,0x301,0xe5,0xe643,0x61,0x30a,0x301,0xe602,0xc6, 0x301,0xe602,0xe6,0x301,0xe602,0xd8,0x301,0xe602,0xf8,0x301,0xe602,0x41,0x30f,0xe602,0x61,0x30f, 0xe602,0x41,0x311,0xe602,0x61,0x311,0xe602,0x45,0x30f,0xe602,0x65,0x30f,0xe602,0x45,0x311,0xe602, 0x65,0x311,0xe602,0x49,0x30f,0xe602,0x69,0x30f,0xe602,0x49,0x311,0xe602,0x69,0x311,0xe602,0x4f, 0x30f,0xe602,0x6f,0x30f,0xe602,0x4f,0x311,0xe602,0x6f,0x311,0xe602,0x52,0x30f,0xe602,0x72,0x30f, 0xe602,0x52,0x311,0xe602,0x72,0x311,0xe602,0x55,0x30f,0xe602,0x75,0x30f,0xe602,0x55,0x311,0xe602, 0x75,0x311,0xdc02,0x53,0x326,0xdc02,0x73,0x326,0xdc02,0x54,0x326,0xdc02,0x74,0x326,0xe602,0x48, 0x30c,0xe602,0x68,0x30c,0xd6,0xe643,0x4f,0x308,0x304,0xf6,0xe643,0x6f,0x308,0x304,0xd5,0xe643, 0x4f,0x303,0x304,0xf5,0xe643,0x6f,0x303,0x304,0x22e,0xe643,0x4f,0x307,0x304,0x22f,0xe643,0x6f, 0x307,0x304,0xe602,0x59,0x304,0xe602,0x79,0x304,0xe602,0xa8,0x301,0xe602,0x391,0x301,0xe602,0x395, 0x301,0xe602,0x397,0x301,0xe602,0x399,0x301,0xe602,0x39f,0x301,0xe602,0x3a5,0x301,0xe602,0x3a9,0x301, 0x3ca,0xe643,0x3b9,0x308,0x301,0xe602,0x399,0x308,0xe602,0x3a5,0x308,0xe602,0x3b5,0x301,0xe602,0x3b9, 0x301,0x3cb,0xe643,0x3c5,0x308,0x301,0xe602,0x3bf,0x301,0xe602,0x3c5,0x301,0xe602,0x3d2,0x301,0xe602, 0x3d2,0x308,0xe602,0x415,0x300,0xe602,0x415,0x308,0xe602,0x413,0x301,0xe602,0x406,0x308,0xe602,0x41a, 0x301,0xe602,0x418,0x300,0xe602,0x423,0x306,0xe602,0x418,0x306,0xe602,0x438,0x306,0xe602,0x435,0x300, 0xe602,0x435,0x308,0xe602,0x433,0x301,0xe602,0x456,0x308,0xe602,0x43a,0x301,0xe602,0x438,0x300,0xe602, 0x443,0x306,0xe602,0x474,0x30f,0xe602,0x475,0x30f,0xe602,0x416,0x306,0xe602,0x436,0x306,0xe602,0x410, 0x306,0xe602,0x430,0x306,0xe602,0x410,0x308,0xe602,0x430,0x308,0xe602,0x415,0x306,0xe602,0x435,0x306, 0xe602,0x4d8,0x308,0xe602,0x4d9,0x308,0xe602,0x416,0x308,0xe602,0x436,0x308,0xe602,0x417,0x308,0xe602, 0x437,0x308,0xe602,0x418,0x304,0xe602,0x438,0x304,0xe602,0x418,0x308,0xe602,0x438,0x308,0xe602,0x41e, 0x308,0xe602,0x43e,0x308,0xe602,0x4e8,0x308,0xe602,0x4e9,0x308,0xe602,0x42d,0x308,0xe602,0x44d,0x308, 0xe602,0x423,0x304,0xe602,0x443,0x304,0xe602,0x423,0x308,0xe602,0x443,0x308,0xe602,0x423,0x30b,0xe602, 0x443,0x30b,0xe602,0x427,0x308,0xe602,0x447,0x308,0xe602,0x42b,0x308,0xe602,0x44b,0x308,0xe602,0x627, 0x653,0xe602,0x627,0x654,0xe602,0x648,0x654,0xdc02,0x627,0x655,0xe602,0x64a,0x654,0xe602,0x6d5,0x654, 0xe602,0x6c1,0x654,0xe602,0x6d2,0x654,0x702,0x928,0x93c,0x702,0x930,0x93c,0x702,0x933,0x93c,2, 0x9c7,0x9be,2,0x9c7,0x9d7,2,0xb47,0xb56,2,0xb47,0xb3e,2,0xb47,0xb57,2,0xb92, 0xbd7,2,0xbc6,0xbbe,2,0xbc7,0xbbe,2,0xbc6,0xbd7,0x5b02,0xc46,0xc56,2,0xcbf,0xcd5, 2,0xcc6,0xcd5,2,0xcc6,0xcd6,0xcca,0x43,0xcc6,0xcc2,0xcd5,2,0xd46,0xd3e,2,0xd47, 0xd3e,2,0xd46,0xd57,0x902,0xdd9,0xdca,0xddc,0x943,0xdd9,0xdcf,0xdca,2,0xdd9,0xddf,2, 0x1025,0x102e,2,0x1b05,0x1b35,2,0x1b07,0x1b35,2,0x1b09,0x1b35,2,0x1b0b,0x1b35,2,0x1b0d, 0x1b35,2,0x1b11,0x1b35,2,0x1b3a,0x1b35,2,0x1b3c,0x1b35,2,0x1b3e,0x1b35,2,0x1b3f,0x1b35, 2,0x1b42,0x1b35,0xdc02,0x41,0x325,0xdc02,0x61,0x325,0xe602,0x42,0x307,0xe602,0x62,0x307,0xdc02, 0x42,0x323,0xdc02,0x62,0x323,0xdc02,0x42,0x331,0xdc02,0x62,0x331,0xc7,0xe643,0x43,0x327,0x301, 0xe7,0xe643,0x63,0x327,0x301,0xe602,0x44,0x307,0xe602,0x64,0x307,0xdc02,0x44,0x323,0xdc02,0x64, 0x323,0xdc02,0x44,0x331,0xdc02,0x64,0x331,0xca02,0x44,0x327,0xca02,0x64,0x327,0xdc02,0x44,0x32d, 0xdc02,0x64,0x32d,0x112,0xe643,0x45,0x304,0x300,0x113,0xe643,0x65,0x304,0x300,0x112,0xe643,0x45, 0x304,0x301,0x113,0xe643,0x65,0x304,0x301,0xdc02,0x45,0x32d,0xdc02,0x65,0x32d,0xdc02,0x45,0x330, 0xdc02,0x65,0x330,0x228,0xe643,0x45,0x327,0x306,0x229,0xe643,0x65,0x327,0x306,0xe602,0x46,0x307, 0xe602,0x66,0x307,0xe602,0x47,0x304,0xe602,0x67,0x304,0xe602,0x48,0x307,0xe602,0x68,0x307,0xdc02, 0x48,0x323,0xdc02,0x68,0x323,0xe602,0x48,0x308,0xe602,0x68,0x308,0xca02,0x48,0x327,0xca02,0x68, 0x327,0xdc02,0x48,0x32e,0xdc02,0x68,0x32e,0xdc02,0x49,0x330,0xdc02,0x69,0x330,0xcf,0xe643,0x49, 0x308,0x301,0xef,0xe643,0x69,0x308,0x301,0xe602,0x4b,0x301,0xe602,0x6b,0x301,0xdc02,0x4b,0x323, 0xdc02,0x6b,0x323,0xdc02,0x4b,0x331,0xdc02,0x6b,0x331,0x1e36,0xe643,0x4c,0x323,0x304,0x1e37,0xe643, 0x6c,0x323,0x304,0xdc02,0x4c,0x331,0xdc02,0x6c,0x331,0xdc02,0x4c,0x32d,0xdc02,0x6c,0x32d,0xe602, 0x4d,0x301,0xe602,0x6d,0x301,0xe602,0x4d,0x307,0xe602,0x6d,0x307,0xdc02,0x4d,0x323,0xdc02,0x6d, 0x323,0xe602,0x4e,0x307,0xe602,0x6e,0x307,0xdc02,0x4e,0x323,0xdc02,0x6e,0x323,0xdc02,0x4e,0x331, 0xdc02,0x6e,0x331,0xdc02,0x4e,0x32d,0xdc02,0x6e,0x32d,0xd5,0xe643,0x4f,0x303,0x301,0xf5,0xe643, 0x6f,0x303,0x301,0xd5,0xe643,0x4f,0x303,0x308,0xf5,0xe643,0x6f,0x303,0x308,0x14c,0xe643,0x4f, 0x304,0x300,0x14d,0xe643,0x6f,0x304,0x300,0x14c,0xe643,0x4f,0x304,0x301,0x14d,0xe643,0x6f,0x304, 0x301,0xe602,0x50,0x301,0xe602,0x70,0x301,0xe602,0x50,0x307,0xe602,0x70,0x307,0xe602,0x52,0x307, 0xe602,0x72,0x307,0x1e5a,0xe643,0x52,0x323,0x304,0x1e5b,0xe643,0x72,0x323,0x304,0xdc02,0x52,0x331, 0xdc02,0x72,0x331,0xe602,0x53,0x307,0xe602,0x73,0x307,0x15a,0xe643,0x53,0x301,0x307,0x15b,0xe643, 0x73,0x301,0x307,0x160,0xe643,0x53,0x30c,0x307,0x161,0xe643,0x73,0x30c,0x307,0x1e62,0xe643,0x53, 0x323,0x307,0x1e63,0xe643,0x73,0x323,0x307,0xe602,0x54,0x307,0xe602,0x74,0x307,0xdc02,0x54,0x323, 0xdc02,0x74,0x323,0xdc02,0x54,0x331,0xdc02,0x74,0x331,0xdc02,0x54,0x32d,0xdc02,0x74,0x32d,0xdc02, 0x55,0x324,0xdc02,0x75,0x324,0xdc02,0x55,0x330,0xdc02,0x75,0x330,0xdc02,0x55,0x32d,0xdc02,0x75, 0x32d,0x168,0xe643,0x55,0x303,0x301,0x169,0xe643,0x75,0x303,0x301,0x16a,0xe643,0x55,0x304,0x308, 0x16b,0xe643,0x75,0x304,0x308,0xe602,0x56,0x303,0xe602,0x76,0x303,0xdc02,0x56,0x323,0xdc02,0x76, 0x323,0xe602,0x57,0x300,0xe602,0x77,0x300,0xe602,0x57,0x301,0xe602,0x77,0x301,0xe602,0x57,0x308, 0xe602,0x77,0x308,0xe602,0x57,0x307,0xe602,0x77,0x307,0xdc02,0x57,0x323,0xdc02,0x77,0x323,0xe602, 0x58,0x307,0xe602,0x78,0x307,0xe602,0x58,0x308,0xe602,0x78,0x308,0xe602,0x59,0x307,0xe602,0x79, 0x307,0xe602,0x5a,0x302,0xe602,0x7a,0x302,0xdc02,0x5a,0x323,0xdc02,0x7a,0x323,0xdc02,0x5a,0x331, 0xdc02,0x7a,0x331,0xdc02,0x68,0x331,0xe602,0x74,0x308,0xe602,0x77,0x30a,0xe602,0x79,0x30a,0xe602, 0x17f,0x307,0xe602,0x41,0x309,0xe602,0x61,0x309,0xc2,0xe643,0x41,0x302,0x301,0xe2,0xe643,0x61, 0x302,0x301,0xc2,0xe643,0x41,0x302,0x300,0xe2,0xe643,0x61,0x302,0x300,0xc2,0xe643,0x41,0x302, 0x309,0xe2,0xe643,0x61,0x302,0x309,0xc2,0xe643,0x41,0x302,0x303,0xe2,0xe643,0x61,0x302,0x303, 0x1ea0,0xe643,0x41,0x323,0x302,0x1ea1,0xe643,0x61,0x323,0x302,0x102,0xe643,0x41,0x306,0x301,0x103, 0xe643,0x61,0x306,0x301,0x102,0xe643,0x41,0x306,0x300,0x103,0xe643,0x61,0x306,0x300,0x102,0xe643, 0x41,0x306,0x309,0x103,0xe643,0x61,0x306,0x309,0x102,0xe643,0x41,0x306,0x303,0x103,0xe643,0x61, 0x306,0x303,0x1ea0,0xe643,0x41,0x323,0x306,0x1ea1,0xe643,0x61,0x323,0x306,0xe602,0x45,0x309,0xe602, 0x65,0x309,0xe602,0x45,0x303,0xe602,0x65,0x303,0xca,0xe643,0x45,0x302,0x301,0xea,0xe643,0x65, 0x302,0x301,0xca,0xe643,0x45,0x302,0x300,0xea,0xe643,0x65,0x302,0x300,0xca,0xe643,0x45,0x302, 0x309,0xea,0xe643,0x65,0x302,0x309,0xca,0xe643,0x45,0x302,0x303,0xea,0xe643,0x65,0x302,0x303, 0x1eb8,0xe643,0x45,0x323,0x302,0x1eb9,0xe643,0x65,0x323,0x302,0xe602,0x49,0x309,0xe602,0x69,0x309, 0xdc02,0x49,0x323,0xdc02,0x69,0x323,0xe602,0x4f,0x309,0xe602,0x6f,0x309,0xd4,0xe643,0x4f,0x302, 0x301,0xf4,0xe643,0x6f,0x302,0x301,0xd4,0xe643,0x4f,0x302,0x300,0xf4,0xe643,0x6f,0x302,0x300, 0xd4,0xe643,0x4f,0x302,0x309,0xf4,0xe643,0x6f,0x302,0x309,0xd4,0xe643,0x4f,0x302,0x303,0xf4, 0xe643,0x6f,0x302,0x303,0x1ecc,0xe643,0x4f,0x323,0x302,0x1ecd,0xe643,0x6f,0x323,0x302,0x1a0,0xe643, 0x4f,0x31b,0x301,0x1a1,0xe643,0x6f,0x31b,0x301,0x1a0,0xe643,0x4f,0x31b,0x300,0x1a1,0xe643,0x6f, 0x31b,0x300,0x1a0,0xe643,0x4f,0x31b,0x309,0x1a1,0xe643,0x6f,0x31b,0x309,0x1a0,0xe643,0x4f,0x31b, 0x303,0x1a1,0xe643,0x6f,0x31b,0x303,0x1a0,0xdc43,0x4f,0x31b,0x323,0x1a1,0xdc43,0x6f,0x31b,0x323, 0xdc02,0x55,0x323,0xdc02,0x75,0x323,0xe602,0x55,0x309,0xe602,0x75,0x309,0x1af,0xe643,0x55,0x31b, 0x301,0x1b0,0xe643,0x75,0x31b,0x301,0x1af,0xe643,0x55,0x31b,0x300,0x1b0,0xe643,0x75,0x31b,0x300, 0x1af,0xe643,0x55,0x31b,0x309,0x1b0,0xe643,0x75,0x31b,0x309,0x1af,0xe643,0x55,0x31b,0x303,0x1b0, 0xe643,0x75,0x31b,0x303,0x1af,0xdc43,0x55,0x31b,0x323,0x1b0,0xdc43,0x75,0x31b,0x323,0xe602,0x59, 0x300,0xe602,0x79,0x300,0xdc02,0x59,0x323,0xdc02,0x79,0x323,0xe602,0x59,0x309,0xe602,0x79,0x309, 0xe602,0x59,0x303,0xe602,0x79,0x303,0x1f10,0xe643,0x3b5,0x313,0x300,0x1f11,0xe643,0x3b5,0x314,0x300, 0x1f10,0xe643,0x3b5,0x313,0x301,0x1f11,0xe643,0x3b5,0x314,0x301,0x1f18,0xe643,0x395,0x313,0x300,0x1f19, 0xe643,0x395,0x314,0x300,0x1f18,0xe643,0x395,0x313,0x301,0x1f19,0xe643,0x395,0x314,0x301,0x1f30,0xe643, 0x3b9,0x313,0x300,0x1f31,0xe643,0x3b9,0x314,0x300,0x1f30,0xe643,0x3b9,0x313,0x301,0x1f31,0xe643,0x3b9, 0x314,0x301,0x1f30,0xe643,0x3b9,0x313,0x342,0x1f31,0xe643,0x3b9,0x314,0x342,0x1f38,0xe643,0x399,0x313, 0x300,0x1f39,0xe643,0x399,0x314,0x300,0x1f38,0xe643,0x399,0x313,0x301,0x1f39,0xe643,0x399,0x314,0x301, 0x1f38,0xe643,0x399,0x313,0x342,0x1f39,0xe643,0x399,0x314,0x342,0x1f40,0xe643,0x3bf,0x313,0x300,0x1f41, 0xe643,0x3bf,0x314,0x300,0x1f40,0xe643,0x3bf,0x313,0x301,0x1f41,0xe643,0x3bf,0x314,0x301,0x1f48,0xe643, 0x39f,0x313,0x300,0x1f49,0xe643,0x39f,0x314,0x300,0x1f48,0xe643,0x39f,0x313,0x301,0x1f49,0xe643,0x39f, 0x314,0x301,0x1f50,0xe643,0x3c5,0x313,0x300,0x1f51,0xe643,0x3c5,0x314,0x300,0x1f50,0xe643,0x3c5,0x313, 0x301,0x1f51,0xe643,0x3c5,0x314,0x301,0x1f50,0xe643,0x3c5,0x313,0x342,0x1f51,0xe643,0x3c5,0x314,0x342, 0x1f59,0xe643,0x3a5,0x314,0x300,0x1f59,0xe643,0x3a5,0x314,0x301,0x1f59,0xe643,0x3a5,0x314,0x342,0xe602, 0x3b5,0x300,0xe602,0x3b9,0x300,0xe602,0x3bf,0x300,0xe602,0x3c5,0x300,0x1f00,0xf043,0x3b1,0x313,0x345, 0x1f01,0xf043,0x3b1,0x314,0x345,0x1f02,0x345,2,0xf044,0x3b1,0x313,0x300,0x345,0x1f03,0x345,2, 0xf044,0x3b1,0x314,0x300,0x345,0x1f04,0x345,2,0xf044,0x3b1,0x313,0x301,0x345,0x1f05,0x345,2, 0xf044,0x3b1,0x314,0x301,0x345,0x1f06,0x345,2,0xf044,0x3b1,0x313,0x342,0x345,0x1f07,0x345,2, 0xf044,0x3b1,0x314,0x342,0x345,0x1f08,0xf043,0x391,0x313,0x345,0x1f09,0xf043,0x391,0x314,0x345,0x1f0a, 0x345,2,0xf044,0x391,0x313,0x300,0x345,0x1f0b,0x345,2,0xf044,0x391,0x314,0x300,0x345,0x1f0c, 0x345,2,0xf044,0x391,0x313,0x301,0x345,0x1f0d,0x345,2,0xf044,0x391,0x314,0x301,0x345,0x1f0e, 0x345,2,0xf044,0x391,0x313,0x342,0x345,0x1f0f,0x345,2,0xf044,0x391,0x314,0x342,0x345,0x1f20, 0xf043,0x3b7,0x313,0x345,0x1f21,0xf043,0x3b7,0x314,0x345,0x1f22,0x345,2,0xf044,0x3b7,0x313,0x300, 0x345,0x1f23,0x345,2,0xf044,0x3b7,0x314,0x300,0x345,0x1f24,0x345,2,0xf044,0x3b7,0x313,0x301, 0x345,0x1f25,0x345,2,0xf044,0x3b7,0x314,0x301,0x345,0x1f26,0x345,2,0xf044,0x3b7,0x313,0x342, 0x345,0x1f27,0x345,2,0xf044,0x3b7,0x314,0x342,0x345,0x1f28,0xf043,0x397,0x313,0x345,0x1f29,0xf043, 0x397,0x314,0x345,0x1f2a,0x345,2,0xf044,0x397,0x313,0x300,0x345,0x1f2b,0x345,2,0xf044,0x397, 0x314,0x300,0x345,0x1f2c,0x345,2,0xf044,0x397,0x313,0x301,0x345,0x1f2d,0x345,2,0xf044,0x397, 0x314,0x301,0x345,0x1f2e,0x345,2,0xf044,0x397,0x313,0x342,0x345,0x1f2f,0x345,2,0xf044,0x397, 0x314,0x342,0x345,0x1f60,0xf043,0x3c9,0x313,0x345,0x1f61,0xf043,0x3c9,0x314,0x345,0x1f62,0x345,2, 0xf044,0x3c9,0x313,0x300,0x345,0x1f63,0x345,2,0xf044,0x3c9,0x314,0x300,0x345,0x1f64,0x345,2, 0xf044,0x3c9,0x313,0x301,0x345,0x1f65,0x345,2,0xf044,0x3c9,0x314,0x301,0x345,0x1f66,0x345,2, 0xf044,0x3c9,0x313,0x342,0x345,0x1f67,0x345,2,0xf044,0x3c9,0x314,0x342,0x345,0x1f68,0xf043,0x3a9, 0x313,0x345,0x1f69,0xf043,0x3a9,0x314,0x345,0x1f6a,0x345,2,0xf044,0x3a9,0x313,0x300,0x345,0x1f6b, 0x345,2,0xf044,0x3a9,0x314,0x300,0x345,0x1f6c,0x345,2,0xf044,0x3a9,0x313,0x301,0x345,0x1f6d, 0x345,2,0xf044,0x3a9,0x314,0x301,0x345,0x1f6e,0x345,2,0xf044,0x3a9,0x313,0x342,0x345,0x1f6f, 0x345,2,0xf044,0x3a9,0x314,0x342,0x345,0xe602,0x3b1,0x306,0xe602,0x3b1,0x304,0x1f70,0xf043,0x3b1, 0x300,0x345,0xf002,0x3b1,0x345,0x3ac,0xf043,0x3b1,0x301,0x345,0x1fb6,0xf043,0x3b1,0x342,0x345,0xe602, 0x391,0x306,0xe602,0x391,0x304,0xe602,0x391,0x300,0xf002,0x391,0x345,0xe602,0xa8,0x342,0x1f74,0xf043, 0x3b7,0x300,0x345,0xf002,0x3b7,0x345,0x3ae,0xf043,0x3b7,0x301,0x345,0x1fc6,0xf043,0x3b7,0x342,0x345, 0xe602,0x395,0x300,0xe602,0x397,0x300,0xf002,0x397,0x345,0xe602,0x1fbf,0x300,0xe602,0x1fbf,0x301,0xe602, 0x1fbf,0x342,0xe602,0x3b9,0x306,0xe602,0x3b9,0x304,0x3ca,0xe643,0x3b9,0x308,0x300,0xe602,0x3b9,0x342, 0x3ca,0xe643,0x3b9,0x308,0x342,0xe602,0x399,0x306,0xe602,0x399,0x304,0xe602,0x399,0x300,0xe602,0x1ffe, 0x300,0xe602,0x1ffe,0x301,0xe602,0x1ffe,0x342,0xe602,0x3c5,0x306,0xe602,0x3c5,0x304,0x3cb,0xe643,0x3c5, 0x308,0x300,0xe602,0x3c1,0x313,0xe602,0x3c1,0x314,0xe602,0x3c5,0x342,0x3cb,0xe643,0x3c5,0x308,0x342, 0xe602,0x3a5,0x306,0xe602,0x3a5,0x304,0xe602,0x3a5,0x300,0xe602,0x3a1,0x314,0xe602,0xa8,0x300,0x1f7c, 0xf043,0x3c9,0x300,0x345,0xf002,0x3c9,0x345,0x3ce,0xf043,0x3c9,0x301,0x345,0x1ff6,0xf043,0x3c9,0x342, 0x345,0xe602,0x39f,0x300,0xe602,0x3a9,0x300,0xf002,0x3a9,0x345,0x102,0x2190,0x338,0x102,0x2192,0x338, 0x102,0x2194,0x338,0x102,0x21d0,0x338,0x102,0x21d4,0x338,0x102,0x21d2,0x338,0x102,0x2203,0x338,0x102, 0x2208,0x338,0x102,0x220b,0x338,0x102,0x2223,0x338,0x102,0x2225,0x338,0x102,0x223c,0x338,0x102,0x2243, 0x338,0x102,0x2245,0x338,0x102,0x2248,0x338,0x102,0x3d,0x338,0x102,0x2261,0x338,0x102,0x224d,0x338, 0x102,0x3c,0x338,0x102,0x3e,0x338,0x102,0x2264,0x338,0x102,0x2265,0x338,0x102,0x2272,0x338,0x102, 0x2273,0x338,0x102,0x2276,0x338,0x102,0x2277,0x338,0x102,0x227a,0x338,0x102,0x227b,0x338,0x102,0x2282, 0x338,0x102,0x2283,0x338,0x102,0x2286,0x338,0x102,0x2287,0x338,0x102,0x22a2,0x338,0x102,0x22a8,0x338, 0x102,0x22a9,0x338,0x102,0x22ab,0x338,0x102,0x227c,0x338,0x102,0x227d,0x338,0x102,0x2291,0x338,0x102, 0x2292,0x338,0x102,0x22b2,0x338,0x102,0x22b3,0x338,0x102,0x22b4,0x338,0x102,0x22b5,0x338,0x802,0x304b, 0x3099,0x802,0x304d,0x3099,0x802,0x304f,0x3099,0x802,0x3051,0x3099,0x802,0x3053,0x3099,0x802,0x3055,0x3099, 0x802,0x3057,0x3099,0x802,0x3059,0x3099,0x802,0x305b,0x3099,0x802,0x305d,0x3099,0x802,0x305f,0x3099,0x802, 0x3061,0x3099,0x802,0x3064,0x3099,0x802,0x3066,0x3099,0x802,0x3068,0x3099,0x802,0x306f,0x3099,0x802,0x306f, 0x309a,0x802,0x3072,0x3099,0x802,0x3072,0x309a,0x802,0x3075,0x3099,0x802,0x3075,0x309a,0x802,0x3078,0x3099, 0x802,0x3078,0x309a,0x802,0x307b,0x3099,0x802,0x307b,0x309a,0x802,0x3046,0x3099,0x802,0x309d,0x3099,0x802, 0x30ab,0x3099,0x802,0x30ad,0x3099,0x802,0x30af,0x3099,0x802,0x30b1,0x3099,0x802,0x30b3,0x3099,0x802,0x30b5, 0x3099,0x802,0x30b7,0x3099,0x802,0x30b9,0x3099,0x802,0x30bb,0x3099,0x802,0x30bd,0x3099,0x802,0x30bf,0x3099, 0x802,0x30c1,0x3099,0x802,0x30c4,0x3099,0x802,0x30c6,0x3099,0x802,0x30c8,0x3099,0x802,0x30cf,0x3099,0x802, 0x30cf,0x309a,0x802,0x30d2,0x3099,0x802,0x30d2,0x309a,0x802,0x30d5,0x3099,0x802,0x30d5,0x309a,0x802,0x30d8, 0x3099,0x802,0x30d8,0x309a,0x802,0x30db,0x3099,0x802,0x30db,0x309a,0x802,0x30a6,0x3099,0x802,0x30ef,0x3099, 0x802,0x30f0,0x3099,0x802,0x30f1,0x3099,0x802,0x30f2,0x3099,0x802,0x30fd,0x3099,0x704,0xd804,0xdc99,0xd804, 0xdcba,0x704,0xd804,0xdc9b,0xd804,0xdcba,0x704,0xd804,0xdca5,0xd804,0xdcba,4,0xd804,0xdd31,0xd804,0xdd27, 4,0xd804,0xdd32,0xd804,0xdd27,4,0xd804,0xdf47,0xd804,0xdf3e,4,0xd804,0xdf47,0xd804,0xdf57,4, 0xd805,0xdcb9,0xd805,0xdcba,4,0xd805,0xdcb9,0xd805,0xdcb0,4,0xd805,0xdcb9,0xd805,0xdcbd,4,0xd805, 0xddb8,0xd805,0xddaf,4,0xd805,0xddb9,0xd805,0xddaf,1,0x2b9,1,0x3b,1,0xb7,0x702,0x915, 0x93c,0x702,0x916,0x93c,0x702,0x917,0x93c,0x702,0x91c,0x93c,0x702,0x921,0x93c,0x702,0x922,0x93c, 0x702,0x92b,0x93c,0x702,0x92f,0x93c,0x702,0x9a1,0x9bc,0x702,0x9a2,0x9bc,0x702,0x9af,0x9bc,0x702, 0xa32,0xa3c,0x702,0xa38,0xa3c,0x702,0xa16,0xa3c,0x702,0xa17,0xa3c,0x702,0xa1c,0xa3c,0x702,0xa2b, 0xa3c,0x702,0xb21,0xb3c,0x702,0xb22,0xb3c,2,0xf42,0xfb7,2,0xf4c,0xfb7,2,0xf51,0xfb7, 2,0xf56,0xfb7,2,0xf5b,0xfb7,2,0xf40,0xfb5,0x8202,0xfb2,0xf80,0x8202,0xfb3,0xf80,2, 0xf92,0xfb7,2,0xf9c,0xfb7,2,0xfa1,0xfb7,2,0xfa6,0xfb7,2,0xfab,0xfb7,2,0xf90, 0xfb5,1,0x3b9,1,0x60,1,0xb4,1,0x3a9,1,0x4b,1,0x3008,1,0x3009,0x102, 0x2add,0x338,1,0x8c48,1,0x66f4,1,0x8eca,1,0x8cc8,1,0x6ed1,1,0x4e32,1,0x53e5, 1,0x9f9c,1,0x5951,1,0x91d1,1,0x5587,1,0x5948,1,0x61f6,1,0x7669,1,0x7f85, 1,0x863f,1,0x87ba,1,0x88f8,1,0x908f,1,0x6a02,1,0x6d1b,1,0x70d9,1,0x73de, 1,0x843d,1,0x916a,1,0x99f1,1,0x4e82,1,0x5375,1,0x6b04,1,0x721b,1,0x862d, 1,0x9e1e,1,0x5d50,1,0x6feb,1,0x85cd,1,0x8964,1,0x62c9,1,0x81d8,1,0x881f, 1,0x5eca,1,0x6717,1,0x6d6a,1,0x72fc,1,0x90ce,1,0x4f86,1,0x51b7,1,0x52de, 1,0x64c4,1,0x6ad3,1,0x7210,1,0x76e7,1,0x8001,1,0x8606,1,0x865c,1,0x8def, 1,0x9732,1,0x9b6f,1,0x9dfa,1,0x788c,1,0x797f,1,0x7da0,1,0x83c9,1,0x9304, 1,0x9e7f,1,0x8ad6,1,0x58df,1,0x5f04,1,0x7c60,1,0x807e,1,0x7262,1,0x78ca, 1,0x8cc2,1,0x96f7,1,0x58d8,1,0x5c62,1,0x6a13,1,0x6dda,1,0x6f0f,1,0x7d2f, 1,0x7e37,1,0x964b,1,0x52d2,1,0x808b,1,0x51dc,1,0x51cc,1,0x7a1c,1,0x7dbe, 1,0x83f1,1,0x9675,1,0x8b80,1,0x62cf,1,0x8afe,1,0x4e39,1,0x5be7,1,0x6012, 1,0x7387,1,0x7570,1,0x5317,1,0x78fb,1,0x4fbf,1,0x5fa9,1,0x4e0d,1,0x6ccc, 1,0x6578,1,0x7d22,1,0x53c3,1,0x585e,1,0x7701,1,0x8449,1,0x8aaa,1,0x6bba, 1,0x8fb0,1,0x6c88,1,0x62fe,1,0x82e5,1,0x63a0,1,0x7565,1,0x4eae,1,0x5169, 1,0x51c9,1,0x6881,1,0x7ce7,1,0x826f,1,0x8ad2,1,0x91cf,1,0x52f5,1,0x5442, 1,0x5973,1,0x5eec,1,0x65c5,1,0x6ffe,1,0x792a,1,0x95ad,1,0x9a6a,1,0x9e97, 1,0x9ece,1,0x529b,1,0x66c6,1,0x6b77,1,0x8f62,1,0x5e74,1,0x6190,1,0x6200, 1,0x649a,1,0x6f23,1,0x7149,1,0x7489,1,0x79ca,1,0x7df4,1,0x806f,1,0x8f26, 1,0x84ee,1,0x9023,1,0x934a,1,0x5217,1,0x52a3,1,0x54bd,1,0x70c8,1,0x88c2, 1,0x5ec9,1,0x5ff5,1,0x637b,1,0x6bae,1,0x7c3e,1,0x7375,1,0x4ee4,1,0x56f9, 1,0x5dba,1,0x601c,1,0x73b2,1,0x7469,1,0x7f9a,1,0x8046,1,0x9234,1,0x96f6, 1,0x9748,1,0x9818,1,0x4f8b,1,0x79ae,1,0x91b4,1,0x96b8,1,0x60e1,1,0x4e86, 1,0x50da,1,0x5bee,1,0x5c3f,1,0x6599,1,0x71ce,1,0x7642,1,0x84fc,1,0x907c, 1,0x9f8d,1,0x6688,1,0x962e,1,0x5289,1,0x677b,1,0x67f3,1,0x6d41,1,0x6e9c, 1,0x7409,1,0x7559,1,0x786b,1,0x7d10,1,0x985e,1,0x516d,1,0x622e,1,0x9678, 1,0x502b,1,0x5d19,1,0x6dea,1,0x8f2a,1,0x5f8b,1,0x6144,1,0x6817,1,0x9686, 1,0x5229,1,0x540f,1,0x5c65,1,0x6613,1,0x674e,1,0x68a8,1,0x6ce5,1,0x7406, 1,0x75e2,1,0x7f79,1,0x88cf,1,0x88e1,1,0x91cc,1,0x96e2,1,0x533f,1,0x6eba, 1,0x541d,1,0x71d0,1,0x7498,1,0x85fa,1,0x96a3,1,0x9c57,1,0x9e9f,1,0x6797, 1,0x6dcb,1,0x81e8,1,0x7acb,1,0x7b20,1,0x7c92,1,0x72c0,1,0x7099,1,0x8b58, 1,0x4ec0,1,0x8336,1,0x523a,1,0x5207,1,0x5ea6,1,0x62d3,1,0x7cd6,1,0x5b85, 1,0x6d1e,1,0x66b4,1,0x8f3b,1,0x884c,1,0x964d,1,0x898b,1,0x5ed3,1,0x5140, 1,0x55c0,1,0x585a,1,0x6674,1,0x51de,1,0x732a,1,0x76ca,1,0x793c,1,0x795e, 1,0x7965,1,0x798f,1,0x9756,1,0x7cbe,1,0x7fbd,1,0x8612,1,0x8af8,1,0x9038, 1,0x90fd,1,0x98ef,1,0x98fc,1,0x9928,1,0x9db4,1,0x90de,1,0x96b7,1,0x4fae, 1,0x50e7,1,0x514d,1,0x52c9,1,0x52e4,1,0x5351,1,0x559d,1,0x5606,1,0x5668, 1,0x5840,1,0x58a8,1,0x5c64,1,0x5c6e,1,0x6094,1,0x6168,1,0x618e,1,0x61f2, 1,0x654f,1,0x65e2,1,0x6691,1,0x6885,1,0x6d77,1,0x6e1a,1,0x6f22,1,0x716e, 1,0x722b,1,0x7422,1,0x7891,1,0x793e,1,0x7949,1,0x7948,1,0x7950,1,0x7956, 1,0x795d,1,0x798d,1,0x798e,1,0x7a40,1,0x7a81,1,0x7bc0,1,0x7e09,1,0x7e41, 1,0x7f72,1,0x8005,1,0x81ed,1,0x8279,1,0x8457,1,0x8910,1,0x8996,1,0x8b01, 1,0x8b39,1,0x8cd3,1,0x8d08,1,0x8fb6,1,0x96e3,1,0x97ff,1,0x983b,1,0x6075, 2,0xd850,0xdeee,1,0x8218,1,0x4e26,1,0x51b5,1,0x5168,1,0x4f80,1,0x5145,1, 0x5180,1,0x52c7,1,0x52fa,1,0x5555,1,0x5599,1,0x55e2,1,0x58b3,1,0x5944,1, 0x5954,1,0x5a62,1,0x5b28,1,0x5ed2,1,0x5ed9,1,0x5f69,1,0x5fad,1,0x60d8,1, 0x614e,1,0x6108,1,0x6160,1,0x6234,1,0x63c4,1,0x641c,1,0x6452,1,0x6556,1, 0x671b,1,0x6756,1,0x6b79,1,0x6edb,1,0x6ecb,1,0x701e,1,0x77a7,1,0x7235,1, 0x72af,1,0x7471,1,0x7506,1,0x753b,1,0x761d,1,0x761f,1,0x76db,1,0x76f4,1, 0x774a,1,0x7740,1,0x78cc,1,0x7ab1,1,0x7c7b,1,0x7d5b,1,0x7f3e,1,0x8352,1, 0x83ef,1,0x8779,1,0x8941,1,0x8986,1,0x8abf,1,0x8acb,1,0x8aed,1,0x8b8a,1, 0x8f38,1,0x9072,1,0x9199,1,0x9276,1,0x967c,1,0x97db,1,0x980b,1,0x9b12,2, 0xd84a,0xdc4a,2,0xd84a,0xdc44,2,0xd84c,0xdfd5,1,0x3b9d,1,0x4018,1,0x4039,2,0xd854, 0xde49,2,0xd857,0xdcd0,2,0xd85f,0xded3,1,0x9f43,1,0x9f8e,0xe02,0x5d9,0x5b4,0x1102,0x5f2, 0x5b7,0x1802,0x5e9,0x5c1,0x1902,0x5e9,0x5c2,0xfb49,0x1843,0x5e9,0x5bc,0x5c1,0xfb49,0x1943,0x5e9,0x5bc, 0x5c2,0x1102,0x5d0,0x5b7,0x1202,0x5d0,0x5b8,0x1502,0x5d0,0x5bc,0x1502,0x5d1,0x5bc,0x1502,0x5d2,0x5bc, 0x1502,0x5d3,0x5bc,0x1502,0x5d4,0x5bc,0x1502,0x5d5,0x5bc,0x1502,0x5d6,0x5bc,0x1502,0x5d8,0x5bc,0x1502, 0x5d9,0x5bc,0x1502,0x5da,0x5bc,0x1502,0x5db,0x5bc,0x1502,0x5dc,0x5bc,0x1502,0x5de,0x5bc,0x1502,0x5e0, 0x5bc,0x1502,0x5e1,0x5bc,0x1502,0x5e3,0x5bc,0x1502,0x5e4,0x5bc,0x1502,0x5e6,0x5bc,0x1502,0x5e7,0x5bc, 0x1502,0x5e8,0x5bc,0x1502,0x5e9,0x5bc,0x1502,0x5ea,0x5bc,0x1302,0x5d5,0x5b9,0x1702,0x5d1,0x5bf,0x1702, 0x5db,0x5bf,0x1702,0x5e4,0x5bf,0xd804,0xd834,0xdd57,0xd834,0xdd65,0xd804,0xd834,0xdd58,0xd834,0xdd65,0xd834, 0xdd5f,0xd834,0xdd6e,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6e,0xd834,0xdd5f,0xd834,0xdd6f,4, 0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xdd5f,0xd834,0xdd70,4,0xd846,0xd834,0xdd58,0xd834, 0xdd65,0xd834,0xdd70,0xd834,0xdd5f,0xd834,0xdd71,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd71,0xd834, 0xdd5f,0xd834,0xdd72,4,0xd846,0xd834,0xdd58,0xd834,0xdd65,0xd834,0xdd72,0xd804,0xd834,0xddb9,0xd834,0xdd65, 0xd804,0xd834,0xddba,0xd834,0xdd65,0xd834,0xddbb,0xd834,0xdd6e,4,0xd846,0xd834,0xddb9,0xd834,0xdd65,0xd834, 0xdd6e,0xd834,0xddbc,0xd834,0xdd6e,4,0xd846,0xd834,0xddba,0xd834,0xdd65,0xd834,0xdd6e,0xd834,0xddbb,0xd834, 0xdd6f,4,0xd846,0xd834,0xddb9,0xd834,0xdd65,0xd834,0xdd6f,0xd834,0xddbc,0xd834,0xdd6f,4,0xd846,0xd834, 0xddba,0xd834,0xdd65,0xd834,0xdd6f,1,0x4e3d,1,0x4e38,1,0x4e41,2,0xd840,0xdd22,1,0x4f60, 1,0x4fbb,1,0x5002,1,0x507a,1,0x5099,1,0x50cf,1,0x349e,2,0xd841,0xde3a,1, 0x5154,1,0x5164,1,0x5177,2,0xd841,0xdd1c,1,0x34b9,1,0x5167,1,0x518d,2,0xd841, 0xdd4b,1,0x5197,1,0x51a4,1,0x4ecc,1,0x51ac,2,0xd864,0xdddf,1,0x51f5,1,0x5203, 1,0x34df,1,0x523b,1,0x5246,1,0x5272,1,0x5277,1,0x3515,1,0x5305,1,0x5306, 1,0x5349,1,0x535a,1,0x5373,1,0x537d,1,0x537f,2,0xd842,0xde2c,1,0x7070,1, 0x53ca,1,0x53df,2,0xd842,0xdf63,1,0x53eb,1,0x53f1,1,0x5406,1,0x549e,1,0x5438, 1,0x5448,1,0x5468,1,0x54a2,1,0x54f6,1,0x5510,1,0x5553,1,0x5563,1,0x5584, 1,0x55ab,1,0x55b3,1,0x55c2,1,0x5716,1,0x5717,1,0x5651,1,0x5674,1,0x58ee, 1,0x57ce,1,0x57f4,1,0x580d,1,0x578b,1,0x5832,1,0x5831,1,0x58ac,2,0xd845, 0xdce4,1,0x58f2,1,0x58f7,1,0x5906,1,0x591a,1,0x5922,1,0x5962,2,0xd845,0xdea8, 2,0xd845,0xdeea,1,0x59ec,1,0x5a1b,1,0x5a27,1,0x59d8,1,0x5a66,1,0x36ee,1, 0x36fc,1,0x5b08,1,0x5b3e,2,0xd846,0xddc8,1,0x5bc3,1,0x5bd8,1,0x5bf3,2,0xd846, 0xdf18,1,0x5bff,1,0x5c06,1,0x5f53,1,0x5c22,1,0x3781,1,0x5c60,1,0x5cc0,1, 0x5c8d,2,0xd847,0xdde4,1,0x5d43,2,0xd847,0xdde6,1,0x5d6e,1,0x5d6b,1,0x5d7c,1, 0x5de1,1,0x5de2,1,0x382f,1,0x5dfd,1,0x5e28,1,0x5e3d,1,0x5e69,1,0x3862,2, 0xd848,0xdd83,1,0x387c,1,0x5eb0,1,0x5eb3,1,0x5eb6,2,0xd868,0xdf92,1,0x5efe,2, 0xd848,0xdf31,1,0x8201,1,0x5f22,1,0x38c7,2,0xd84c,0xdeb8,2,0xd858,0xddda,1,0x5f62, 1,0x5f6b,1,0x38e3,1,0x5f9a,1,0x5fcd,1,0x5fd7,1,0x5ff9,1,0x6081,1,0x393a, 1,0x391c,2,0xd849,0xded4,1,0x60c7,1,0x6148,1,0x614c,1,0x617a,1,0x61b2,1, 0x61a4,1,0x61af,1,0x61de,1,0x6210,1,0x621b,1,0x625d,1,0x62b1,1,0x62d4,1, 0x6350,2,0xd84a,0xdf0c,1,0x633d,1,0x62fc,1,0x6368,1,0x6383,1,0x63e4,2,0xd84a, 0xdff1,1,0x6422,1,0x63c5,1,0x63a9,1,0x3a2e,1,0x6469,1,0x647e,1,0x649d,1, 0x6477,1,0x3a6c,1,0x656c,2,0xd84c,0xdc0a,1,0x65e3,1,0x66f8,1,0x6649,1,0x3b19, 1,0x3b08,1,0x3ae4,1,0x5192,1,0x5195,1,0x6700,1,0x669c,1,0x80ad,1,0x43d9, 1,0x6721,1,0x675e,1,0x6753,2,0xd84c,0xdfc3,1,0x3b49,1,0x67fa,1,0x6785,1, 0x6852,2,0xd84d,0xdc6d,1,0x688e,1,0x681f,1,0x6914,1,0x6942,1,0x69a3,1,0x69ea, 1,0x6aa8,2,0xd84d,0xdea3,1,0x6adb,1,0x3c18,1,0x6b21,2,0xd84e,0xdca7,1,0x6b54, 1,0x3c4e,1,0x6b72,1,0x6b9f,1,0x6bbb,2,0xd84e,0xde8d,2,0xd847,0xdd0b,2,0xd84e, 0xdefa,1,0x6c4e,2,0xd84f,0xdcbc,1,0x6cbf,1,0x6ccd,1,0x6c67,1,0x6d16,1,0x6d3e, 1,0x6d69,1,0x6d78,1,0x6d85,2,0xd84f,0xdd1e,1,0x6d34,1,0x6e2f,1,0x6e6e,1, 0x3d33,1,0x6ec7,2,0xd84f,0xded1,1,0x6df9,1,0x6f6e,2,0xd84f,0xdf5e,2,0xd84f,0xdf8e, 1,0x6fc6,1,0x7039,1,0x701b,1,0x3d96,1,0x704a,1,0x707d,1,0x7077,1,0x70ad, 2,0xd841,0xdd25,1,0x7145,2,0xd850,0xde63,1,0x719c,2,0xd850,0xdfab,1,0x7228,1, 0x7250,2,0xd851,0xde08,1,0x7280,1,0x7295,2,0xd851,0xdf35,2,0xd852,0xdc14,1,0x737a, 1,0x738b,1,0x3eac,1,0x73a5,1,0x3eb8,1,0x7447,1,0x745c,1,0x7485,1,0x74ca, 1,0x3f1b,1,0x7524,2,0xd853,0xdc36,1,0x753e,2,0xd853,0xdc92,2,0xd848,0xdd9f,1, 0x7610,2,0xd853,0xdfa1,2,0xd853,0xdfb8,2,0xd854,0xdc44,1,0x3ffc,1,0x4008,2,0xd854, 0xdcf3,2,0xd854,0xdcf2,2,0xd854,0xdd19,2,0xd854,0xdd33,1,0x771e,1,0x771f,1,0x778b, 1,0x4046,1,0x4096,2,0xd855,0xdc1d,1,0x784e,1,0x40e3,2,0xd855,0xde26,2,0xd855, 0xde9a,2,0xd855,0xdec5,1,0x79eb,1,0x412f,1,0x7a4a,1,0x7a4f,2,0xd856,0xdd7c,2, 0xd856,0xdea7,1,0x7aee,1,0x4202,2,0xd856,0xdfab,1,0x7bc6,1,0x7bc9,1,0x4227,2, 0xd857,0xdc80,1,0x7cd2,1,0x42a0,1,0x7ce8,1,0x7ce3,1,0x7d00,2,0xd857,0xdf86,1, 0x7d63,1,0x4301,1,0x7dc7,1,0x7e02,1,0x7e45,1,0x4334,2,0xd858,0xde28,2,0xd858, 0xde47,1,0x4359,2,0xd858,0xded9,1,0x7f7a,2,0xd858,0xdf3e,1,0x7f95,1,0x7ffa,2, 0xd859,0xdcda,2,0xd859,0xdd23,1,0x8060,2,0xd859,0xdda8,1,0x8070,2,0xd84c,0xdf5f,1, 0x43d5,1,0x80b2,1,0x8103,1,0x440b,1,0x813e,1,0x5ab5,2,0xd859,0xdfa7,2,0xd859, 0xdfb5,2,0xd84c,0xdf93,2,0xd84c,0xdf9c,1,0x8204,1,0x8f9e,1,0x446b,1,0x8291,1, 0x828b,1,0x829d,1,0x52b3,1,0x82b1,1,0x82b3,1,0x82bd,1,0x82e6,2,0xd85a,0xdf3c, 1,0x831d,1,0x8363,1,0x83ad,1,0x8323,1,0x83bd,1,0x83e7,1,0x8353,1,0x83ca, 1,0x83cc,1,0x83dc,2,0xd85b,0xdc36,2,0xd85b,0xdd6b,2,0xd85b,0xdcd5,1,0x452b,1, 0x84f1,1,0x84f3,1,0x8516,2,0xd85c,0xdfca,1,0x8564,2,0xd85b,0xdf2c,1,0x455d,1, 0x4561,2,0xd85b,0xdfb1,2,0xd85c,0xdcd2,1,0x456b,1,0x8650,1,0x8667,1,0x8669,1, 0x86a9,1,0x8688,1,0x870e,1,0x86e2,1,0x8728,1,0x876b,1,0x8786,1,0x45d7,1, 0x87e1,1,0x8801,1,0x45f9,1,0x8860,1,0x8863,2,0xd85d,0xde67,1,0x88d7,1,0x88de, 1,0x4635,1,0x88fa,1,0x34bb,2,0xd85e,0xdcae,2,0xd85e,0xdd66,1,0x46be,1,0x46c7, 1,0x8aa0,1,0x8c55,2,0xd85f,0xdca8,1,0x8cab,1,0x8cc1,1,0x8d1b,1,0x8d77,2, 0xd85f,0xdf2f,2,0xd842,0xdc04,1,0x8dcb,1,0x8dbc,1,0x8df0,2,0xd842,0xdcde,1,0x8ed4, 2,0xd861,0xddd2,2,0xd861,0xdded,1,0x9094,1,0x90f1,1,0x9111,2,0xd861,0xdf2e,1, 0x911b,1,0x9238,1,0x92d7,1,0x92d8,1,0x927c,1,0x93f9,1,0x9415,2,0xd862,0xdffa, 1,0x958b,1,0x4995,1,0x95b7,2,0xd863,0xdd77,1,0x49e6,1,0x96c3,1,0x5db2,1, 0x9723,2,0xd864,0xdd45,2,0xd864,0xde1a,1,0x4a6e,1,0x4a76,1,0x97e0,2,0xd865,0xdc0a, 1,0x4ab2,2,0xd865,0xdc96,1,0x9829,2,0xd865,0xddb6,1,0x98e2,1,0x4b33,1,0x9929, 1,0x99a7,1,0x99c2,1,0x99fe,1,0x4bce,2,0xd866,0xdf30,1,0x9c40,1,0x9cfd,1, 0x4cce,1,0x4ced,1,0x9d67,2,0xd868,0xdcce,1,0x4cf8,2,0xd868,0xdd05,2,0xd868,0xde0e, 2,0xd868,0xde91,1,0x9ebb,1,0x4d56,1,0x9ef9,1,0x9efe,1,0x9f05,1,0x9f0f,1, 0x9f16,1,0x9f3b,2,0xd869,0xde00,0x3ac,0xe642,0x3b1,0x301,0x3ad,0xe642,0x3b5,0x301,0x3ae,0xe642, 0x3b7,0x301,0x3af,0xe642,0x3b9,0x301,0x3cc,0xe642,0x3bf,0x301,0x3cd,0xe642,0x3c5,0x301,0x3ce,0xe642, 0x3c9,0x301,0x386,0xe642,0x391,0x301,0x388,0xe642,0x395,0x301,0x389,0xe642,0x397,0x301,0x390,1, 0xe643,0x3b9,0x308,0x301,0x38a,0xe642,0x399,0x301,0x3b0,1,0xe643,0x3c5,0x308,0x301,0x38e,0xe642, 0x3a5,0x301,0x385,0xe642,0xa8,0x301,0x38c,0xe642,0x39f,0x301,0x38f,0xe642,0x3a9,0x301,0xc5,0xe642, 0x41,0x30a,0xe6e6,0xe681,0x300,0xe6e6,0xe681,0x301,0xe6e6,0xe681,0x313,0xe6e6,0xe682,0x308,0x301,0x8100, 0x8282,0xf71,0xf72,0x8100,0x8482,0xf71,0xf74,0x8100,0x8282,0xf71,0xf80,0 }; static const uint8_t norm2_nfc_data_smallFCD[256]={ 0xc0,0xef,3,0x7f,0xdf,0x70,0xcf,0x87,0xc7,0xe6,0x66,0x46,0x64,0x46,0x66,0x5b, 0x12,0,0,4,0,0,0,0x43,0x20,2,0x29,0xae,0xc2,0xc0,0xff,0xff, 0xc0,0x72,0xbf,0,0,0,0,0,0,0,0x40,0,0x80,0x88,0,0, 0xfe,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0x98,0,0xc1,0x66,0xe0,0x80,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,7,0,0,2,0 }; #endif // INCLUDED_FROM_NORMALIZER2_CPP
69,907
636
<gh_stars>100-1000 package org.hyperledger.indy.sdk.payment; import org.hyperledger.indy.sdk.InvalidStructureException; import org.hyperledger.indy.sdk.payments.IncompatiblePaymentException; import org.hyperledger.indy.sdk.payments.Payments; import org.hyperledger.indy.sdk.payments.UnknownPaymentMethodException; import org.junit.Test; import java.util.concurrent.ExecutionException; import static org.hamcrest.CoreMatchers.isA; public class BuildMintRequestTest extends PaymentIntegrationTest { @Test public void testBuildMintRequestWorksForUnknownPaymentMethod() throws Exception { thrown.expect(ExecutionException.class); thrown.expectCause(isA(UnknownPaymentMethodException.class)); Payments.buildMintRequest(wallet, DID_TRUSTEE, outputs, null).get(); } @Test public void testBuildMintRequestWorksForEmptyOutputs() throws Exception { thrown.expect(ExecutionException.class); thrown.expectCause(isA(InvalidStructureException.class)); Payments.buildMintRequest(wallet, DID_TRUSTEE, emptyArray, null).get(); } @Test public void testBuildMintRequestWorksForIncompatiblePaymentMethods() throws Exception { thrown.expect(ExecutionException.class); thrown.expectCause(isA(IncompatiblePaymentException.class)); Payments.buildMintRequest(wallet, DID_TRUSTEE, incompatibleOutputs, null).get(); } }
431
390
<filename>tests/test_bandit/test_cb_agents.py<gh_stars>100-1000 import shutil from genrl.agents import ( BernoulliMAB, BootstrapNeuralAgent, FixedAgent, LinearPosteriorAgent, NeuralGreedyAgent, NeuralLinearPosteriorAgent, NeuralNoiseSamplingAgent, VariationalAgent, ) from genrl.trainers import DCBTrainer from genrl.utils import CovertypeDataBandit from .utils import write_data class TestCBAgent: def _test_fn(self, agent_class) -> None: bandits = [] d = """2596,51,3,258,0,510,221,232,148,6279,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5 2590,56,2,212,-6,390,220,235,151,6225,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5 2804,139,9,268,65,3180,234,238,135,6121,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 2785,155,18,242,118,3090,238,238,122,6211,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2 2595,45,2,153,-1,391,220,234,150,6172,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5 """ fpath = write_data("covtype.data", d) bandits.append(CovertypeDataBandit(path=fpath)) fpath.unlink() bandits.append(BernoulliMAB(bandits=10, arms=10)) for bandit in bandits: agent = agent_class(bandit) trainer = DCBTrainer(agent, bandit, log_mode=["stdout"]) trainer.train(timesteps=10, update_interval=2, update_after=5, batch_size=2) shutil.rmtree("./logs") def test_linear_posterior_agent(self) -> None: self._test_fn(LinearPosteriorAgent) def test_neural_linear_posterior_agent(self) -> None: self._test_fn(NeuralLinearPosteriorAgent) def test_neural_greedy_agent(self) -> None: self._test_fn(NeuralGreedyAgent) def test_variational_agent(self) -> None: self._test_fn(VariationalAgent) def test_bootstrap_neural_agent(self) -> None: self._test_fn(BootstrapNeuralAgent) def test_neural_noise_sampling_agent(self) -> None: self._test_fn(NeuralNoiseSamplingAgent) def test_fixed_agent(self) -> None: self._test_fn(FixedAgent)
1,263
32,544
<filename>spring-boot-modules/spring-boot-annotations-2/src/test/java/com/baeldung/annotations/conditional/DevEnvLoggingConfigurationUnitTest.java package com.baeldung.annotations.conditional; import org.junit.Test; import org.junit.jupiter.api.Assertions; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.test.context.runner.ApplicationContextRunner; public class DevEnvLoggingConfigurationUnitTest { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner(); @Test public void whenDevEnvEnabled_thenDevEnvLoggingConfigurationAndLoggingServiceShouldBeCreated() { System.setProperty("env", "dev"); contextRunner .withUserConfiguration(ConditionalTestConfiguration.class) .run(context -> Assertions.assertNotNull( context.getBean(DevEnvLoggingConfiguration.class) ) ); contextRunner .withUserConfiguration(ConditionalTestConfiguration.class) .run(context -> Assertions.assertNotNull( context.getBean(LoggingService.class) ) ); } @Test public void whenDevEnvNotEnabled_thenDevEnvLoggingConfigurationAndLoggingServiceShouldNotBeCreated() { System.setProperty("env", "not-dev"); contextRunner .withUserConfiguration(ConditionalTestConfiguration.class) .run(context -> Assertions.assertThrows(NoSuchBeanDefinitionException.class, () -> context.getBean(DevEnvLoggingConfiguration.class) ) ); contextRunner .withUserConfiguration(ConditionalTestConfiguration.class) .run(context -> Assertions.assertThrows(NoSuchBeanDefinitionException.class, () -> context.getBean(LoggingService.class) ) ); } }
774
1,584
#ifndef INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX #define INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX // --------------------------------------------------------------------------------------- #include "portaudio.h" #include "portaudiocpp/CallbackStream.hxx" // --------------------------------------------------------------------------------------- // Forward declaration(s) namespace portaudio { class StreamParameters; } // --------------------------------------------------------------------------------------- // Declaration(s): namespace portaudio { // ----------------------------------------------------------------------------------- ////// /// @brief Callback stream using a free function with C linkage. It's important that the function /// the passed function pointer points to is declared ``extern "C"''. ////// class CFunCallbackStream : public CallbackStream { public: CFunCallbackStream(); CFunCallbackStream(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData); ~CFunCallbackStream(); void open(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData); private: CFunCallbackStream(const CFunCallbackStream &); // non-copyable CFunCallbackStream &operator=(const CFunCallbackStream &); // non-copyable }; // ----------------------------------------------------------------------------------- } // portaudio // --------------------------------------------------------------------------------------- #endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX
415
332
// Autogenerated from vk-api-schema. Please don't edit it manually. package com.vk.api.sdk.exceptions; public class ApiAuthException extends ApiException { public ApiAuthException(String message) { super(5, "User authorization failed", message); } }
90
14,668
<reponame>zealoussnow/chromium<filename>mojo/public/cpp/bindings/lib/message_dumper.cc // Copyright 2018 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. #include "mojo/public/cpp/bindings/message_dumper.h" #include "base/bind.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/logging.h" #include "base/no_destructor.h" #include "base/process/process.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "mojo/public/cpp/bindings/message.h" namespace { base::FilePath& DumpDirectory() { static base::NoDestructor<base::FilePath> dump_directory; return *dump_directory; } void WriteMessage(uint64_t identifier, const mojo::MessageDumper::MessageEntry& entry) { static uint64_t num = 0; if (!entry.interface_name) return; base::FilePath message_directory = DumpDirectory() .AppendASCII(entry.interface_name) .AppendASCII(base::NumberToString(identifier)); if (!base::DirectoryExists(message_directory) && !base::CreateDirectory(message_directory)) { LOG(ERROR) << "Failed to create" << message_directory.value(); return; } std::string filename = base::NumberToString(num++) + "." + entry.method_name + ".mojomsg"; base::FilePath path = message_directory.AppendASCII(filename); base::File file(path, base::File::FLAG_WRITE | base::File::FLAG_CREATE_ALWAYS); file.WriteAtCurrentPos(reinterpret_cast<const char*>(entry.data_bytes.data()), static_cast<int>(entry.data_bytes.size())); } } // namespace namespace mojo { MessageDumper::MessageEntry::MessageEntry(const uint8_t* data, uint32_t data_size, const char* interface_name, const char* method_name) : interface_name(interface_name), method_name(method_name), data_bytes(data, data + data_size) {} MessageDumper::MessageEntry::MessageEntry(const MessageEntry& entry) = default; MessageDumper::MessageEntry::~MessageEntry() {} MessageDumper::MessageDumper() : identifier_(base::RandUint64()) {} MessageDumper::~MessageDumper() {} bool MessageDumper::Accept(mojo::Message* message) { MessageEntry entry(message->data(), message->data_num_bytes(), message->interface_name(), message->method_name()); static base::NoDestructor<scoped_refptr<base::TaskRunner>> task_runner( base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); (*task_runner) ->PostTask(FROM_HERE, base::BindOnce(&WriteMessage, identifier_, std::move(entry))); return true; } void MessageDumper::SetMessageDumpDirectory(const base::FilePath& directory) { DumpDirectory() = directory; } const base::FilePath& MessageDumper::GetMessageDumpDirectory() { return DumpDirectory(); } } // namespace mojo
1,275
8,969
#!/usr/bin/env python3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """This is the entry point to create Dart APIs from the IDL database.""" import css_code_generator import os import sys # Setup all paths to find our PYTHON code # dart_dir is the location of dart's enlistment dartium (dartium-git/src/dart) # and Dart (dart-git/dart). dart_dir = os.path.abspath( os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))) sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/new_scripts')) sys.path.insert(1, os.path.join(dart_dir, 'third_party/WebCore/bindings/scripts')) # Dartium's third_party directory location is dartium-git/src/third_party # and Dart's third_party directory location is dart-git/dart/third_party. third_party_dir = os.path.join(dart_dir, 'third_party') ply_dir = os.path.join(third_party_dir, 'ply') # If ply directory found then we're a Dart enlistment; third_party location # is dart-git/dart/third_party if not os.path.exists(ply_dir): # For Dartium (ply directory is dartium-git/src/third_party/ply) third_party # location is dartium-git/src/third_party third_party_dir = os.path.join(dart_dir, '..', 'third_party') assert (os.path.exists(third_party_dir)) else: # It's Dart we need to make sure that WebCore is injected in our search path # because this is where idl_parser is located for a Dart enlistment. Dartium # can figure out the tools directory because of the location of where the # scripts blink scripts are located. sys.path.insert(1, os.path.join(dart_dir, 'third_party/WebCore')) sys.path.insert(1, third_party_dir) sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/scripts')) import dartgenerator import database import fremontcutbuilder import logging import monitored import multiemitter import optparse import shutil import subprocess import time from dartmetadata import DartMetadata from generator import TypeRegistry from generate_blink_file import Generate_Blink from htmleventgenerator import HtmlEventGenerator from htmlrenamer import HtmlRenamer from systemhtml import DartLibraryEmitter, Dart2JSBackend,\ HtmlDartInterfaceGenerator, DartLibrary, DartLibraries,\ HTML_LIBRARY_NAMES from systemnative import CPPLibraryEmitter, DartiumBackend from templateloader import TemplateLoader sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) import utils _logger = logging.getLogger('dartdomgenerator') class GeneratorOptions(object): def __init__(self, templates, database, type_registry, renamer, metadata, dart_js_interop): self.templates = templates self.database = database self.type_registry = type_registry self.renamer = renamer self.metadata = metadata self.dart_js_interop = dart_js_interop def LoadDatabase(database_dir, use_database_cache): common_database = database.Database(database_dir) if use_database_cache: common_database.LoadFromCache() else: common_database.Load() return common_database def GenerateFromDatabase(common_database, dart2js_output_dir, update_dom_metadata=False, logging_level=logging.WARNING, dart_js_interop=False, generate_static_extensions=False): print('\n ----- Accessing DOM using %s -----\n' % ('dart:js' if dart_js_interop else 'C++')) start_time = time.time() current_dir = os.path.dirname(__file__) auxiliary_dir = os.path.join(current_dir, '..', 'src') template_dir = os.path.join(current_dir, '..', 'templates') _logger.setLevel(logging_level) generator = dartgenerator.DartGenerator(logging_level) generator.LoadAuxiliary(auxiliary_dir) generator.FilterMembersWithUnidentifiedTypes(common_database) webkit_database = common_database.Clone() # Generate Dart interfaces for the WebKit DOM. generator.FilterInterfaces( database=webkit_database, or_annotations=['WebKit', 'Dart'], exclude_displaced=['WebKit'], exclude_suppressed=['WebKit', 'Dart']) generator.FixEventTargets(webkit_database) generator.AddMissingArguments(webkit_database) generator.CleanupOperationArguments(webkit_database) emitters = multiemitter.MultiEmitter(logging_level) metadata = DartMetadata( os.path.join(current_dir, '..', 'dom.json'), os.path.join(current_dir, '..', 'docs', 'docs.json'), logging_level) renamer = HtmlRenamer(webkit_database, metadata) type_registry = TypeRegistry(webkit_database, renamer) print('GenerateFromDatabase %s seconds' % round( (time.time() - start_time), 2)) def RunGenerator(dart_libraries, dart_output_dir, template_loader, backend_factory, dart_js_interop): options = GeneratorOptions(template_loader, webkit_database, type_registry, renamer, metadata, dart_js_interop) dart_library_emitter = DartLibraryEmitter(emitters, dart_output_dir, dart_libraries) event_generator = HtmlEventGenerator(webkit_database, renamer, metadata, template_loader) def generate_interface(interface, gl_constants=None): backend = backend_factory(interface) interface_generator = HtmlDartInterfaceGenerator( options, dart_library_emitter, event_generator, interface, backend) interface_generator.Generate() if len(backend._gl_constants) > 0 and not (gl_constants is None): gl_constants.extend(backend._gl_constants) generator.Generate(webkit_database, common_database, generate_interface) dart_library_emitter.EmitLibraries(auxiliary_dir, dart_js_interop) if dart2js_output_dir: template_paths = ['html/dart2js', 'html/impl', 'html/interface', ''] template_loader = TemplateLoader(template_dir, template_paths, { 'DARTIUM': False, 'DART2JS': True, 'JSINTEROP': False, 'NNBD': True, }) backend_options = GeneratorOptions(template_loader, webkit_database, type_registry, renamer, metadata, dart_js_interop) backend_factory = lambda interface:\ Dart2JSBackend(interface, backend_options, logging_level, generate_static_extensions) dart_output_dir = os.path.join(dart2js_output_dir, 'dart') dart_libraries = DartLibraries(HTML_LIBRARY_NAMES, template_loader, 'dart2js', dart2js_output_dir, dart_js_interop) for file in generator._auxiliary_files.values(): if file.endswith('darttemplate'): dart_libraries._libraries['html'].AddFile(file) print('\nGenerating dart2js:\n') start_time = time.time() RunGenerator(dart_libraries, dart_output_dir, template_loader, backend_factory, dart_js_interop) print('Generated dart2js in %s seconds' % round(time.time() - start_time, 2)) emitters.Flush() if update_dom_metadata: metadata.Flush() monitored.FinishMonitoring(dart2js_output_dir, _logger) def GenerateSingleFile(library_path, output_dir, generated_output_dir=None, prefix=None): library_dir = os.path.dirname(library_path) library_filename = os.path.basename(library_path) copy_dart_script = os.path.relpath('../../copy_dart.py', library_dir) output_dir = os.path.relpath(output_dir, library_dir) if not os.path.exists(library_dir): os.makedirs(library_dir) prefix_arg = 'export DART_HTML_PREFIX="' + prefix + '";' if prefix else "" command = ' '.join([ prefix_arg, 'cd', library_dir, ';', copy_dart_script, output_dir, library_filename ]) subprocess.call([command], shell=True) dart_bin = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dart') sdk_file = os.path.join(library_dir, output_dir, library_filename) formatCommand = ' '.join([dart_bin, 'format', sdk_file]) subprocess.call([formatCommand], shell=True) def UpdateCssProperties(): """Regenerate the CssStyleDeclaration template file with the current CSS properties.""" _logger.info('Updating Css Properties.') css_code_generator.GenerateCssTemplateFile() CACHED_PATCHES = """ // START_OF_CACHED_PATCHES // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // DO NOT EDIT GENERATED FILE. library cached_patches; var cached_patches = { /******************************************************** ***** ***** ***** MUST RUN tools/dartium/generate_patches.sh ***** ***** ***** ********************************************************/ }; """ def main(): parser = optparse.OptionParser() parser.add_option( '--parallel', dest='parallel', action='store_true', default=False, help='Use fremontcut in parallel mode.') parser.add_option( '--systems', dest='systems', action='store', type='string', default='htmldart2js,htmldartium,_blink', help='Systems to generate (htmldart2js, htmldartium, _blink)') parser.add_option( '--output-dir', dest='output_dir', action='store', type='string', default=None, help='Directory to put the generated files') parser.add_option( '--use-database-cache', dest='use_database_cache', action='store_true', default=False, help='''Use the cached database from the previous run to improve startup performance''') parser.add_option( '--update-dom-metadata', dest='update_dom_metadata', action='store_true', default=False, help='''Update the metadata list of DOM APIs''') parser.add_option( '--verbose', dest='logging_level', action='store_false', default=logging.WARNING, help='Output all informational messages') parser.add_option( '--examine', dest='examine_idls', action='store_true', default=None, help='Analyze IDL files') parser.add_option( '--logging', dest='logging', type='int', action='store', default=logging.NOTSET, help='Level of logging 20 is Info, 30 is Warnings, 40 is Errors') parser.add_option( '--gen-interop', dest='dart_js_interop', action='store_true', default=False, help='Use Javascript objects (dart:js) accessing the DOM in _blink') parser.add_option( '--no-cached-patches', dest='no_cached_patches', action='store_true', default=False, help='Do not generate the sdk/lib/js/cached_patches.dart file') parser.add_option( '--generate-static-extensions', dest='generate_static_extensions', action='store_true', default=False, help='Generate static extension members for dart:html classes') (options, args) = parser.parse_args() current_dir = os.path.dirname(__file__) database_dir = os.path.join(current_dir, '..', 'database') logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) systems = options.systems.split(',') output_dir = options.output_dir or os.path.join( current_dir, '..', '..', '..', utils.GetBuildDir(utils.GuessOS()), 'generated') dart2js_output_dir = None if 'htmldart2js' in systems: dart2js_output_dir = os.path.join(output_dir, 'dart2js') logging_level = options.logging_level \ if options.logging == logging.NOTSET else options.logging start_time = time.time() UpdateCssProperties() # Parse the IDL and create the database. database = fremontcutbuilder.main( options.parallel, logging_level=logging_level, examine_idls=options.examine_idls) GenerateFromDatabase(database, dart2js_output_dir, options.update_dom_metadata, logging_level, options.dart_js_interop, options.generate_static_extensions) file_generation_start_time = time.time() if 'htmldart2js' in systems: _logger.info('Generating dart2js single files.') for library_name in HTML_LIBRARY_NAMES: source = os.path.join(dart2js_output_dir, '%s_dart2js.dart' % library_name) GenerateSingleFile( source, os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) print('\nGenerating single file %s seconds' % round(time.time() - file_generation_start_time, 2)) end_time = time.time() print('\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2)) if __name__ == '__main__': sys.exit(main())
5,869
14,668
/* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 8.xx.xxxx */ /* at a redacted point in time */ /* Compiler settings for ../../chrome/elevation_service/elevation_service_idl.idl: Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.xx.xxxx protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ /* @@MIDL_FILE_HEADING( ) */ #pragma warning( disable: 4049 ) /* more than 64k source lines */ /* verify that the <rpcndr.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of <rpcndr.h> #endif /* __RPCNDR_H_VERSION__ */ #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif /*COM_NO_WINDOWS_H*/ #ifndef __elevation_service_idl_h__ #define __elevation_service_idl_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ #ifndef __IElevator_FWD_DEFINED__ #define __IElevator_FWD_DEFINED__ typedef interface IElevator IElevator; #endif /* __IElevator_FWD_DEFINED__ */ #ifndef __IElevatorChromium_FWD_DEFINED__ #define __IElevatorChromium_FWD_DEFINED__ typedef interface IElevatorChromium IElevatorChromium; #endif /* __IElevatorChromium_FWD_DEFINED__ */ #ifndef __IElevatorChrome_FWD_DEFINED__ #define __IElevatorChrome_FWD_DEFINED__ typedef interface IElevatorChrome IElevatorChrome; #endif /* __IElevatorChrome_FWD_DEFINED__ */ #ifndef __IElevatorChromeBeta_FWD_DEFINED__ #define __IElevatorChromeBeta_FWD_DEFINED__ typedef interface IElevatorChromeBeta IElevatorChromeBeta; #endif /* __IElevatorChromeBeta_FWD_DEFINED__ */ #ifndef __IElevatorChromeDev_FWD_DEFINED__ #define __IElevatorChromeDev_FWD_DEFINED__ typedef interface IElevatorChromeDev IElevatorChromeDev; #endif /* __IElevatorChromeDev_FWD_DEFINED__ */ #ifndef __IElevatorChromeCanary_FWD_DEFINED__ #define __IElevatorChromeCanary_FWD_DEFINED__ typedef interface IElevatorChromeCanary IElevatorChromeCanary; #endif /* __IElevatorChromeCanary_FWD_DEFINED__ */ #ifndef __IElevator_FWD_DEFINED__ #define __IElevator_FWD_DEFINED__ typedef interface IElevator IElevator; #endif /* __IElevator_FWD_DEFINED__ */ #ifndef __IElevatorChromium_FWD_DEFINED__ #define __IElevatorChromium_FWD_DEFINED__ typedef interface IElevatorChromium IElevatorChromium; #endif /* __IElevatorChromium_FWD_DEFINED__ */ #ifndef __IElevatorChrome_FWD_DEFINED__ #define __IElevatorChrome_FWD_DEFINED__ typedef interface IElevatorChrome IElevatorChrome; #endif /* __IElevatorChrome_FWD_DEFINED__ */ #ifndef __IElevatorChromeBeta_FWD_DEFINED__ #define __IElevatorChromeBeta_FWD_DEFINED__ typedef interface IElevatorChromeBeta IElevatorChromeBeta; #endif /* __IElevatorChromeBeta_FWD_DEFINED__ */ #ifndef __IElevatorChromeDev_FWD_DEFINED__ #define __IElevatorChromeDev_FWD_DEFINED__ typedef interface IElevatorChromeDev IElevatorChromeDev; #endif /* __IElevatorChromeDev_FWD_DEFINED__ */ #ifndef __IElevatorChromeCanary_FWD_DEFINED__ #define __IElevatorChromeCanary_FWD_DEFINED__ typedef interface IElevatorChromeCanary IElevatorChromeCanary; #endif /* __IElevatorChromeCanary_FWD_DEFINED__ */ /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" #ifdef __cplusplus extern "C"{ #endif #ifndef __IElevator_INTERFACE_DEFINED__ #define __IElevator_INTERFACE_DEFINED__ /* interface IElevator */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("A949CB4E-C4F9-44C4-B213-6BF8AA9AC69C") IElevator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE RunRecoveryCRXElevated( /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle) = 0; }; #else /* C style interface */ typedef struct IElevatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevator * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevator * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevator * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorVtbl; interface IElevator { CONST_VTBL struct IElevatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevator_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevator_INTERFACE_DEFINED__ */ #ifndef __IElevatorChromium_INTERFACE_DEFINED__ #define __IElevatorChromium_INTERFACE_DEFINED__ /* interface IElevatorChromium */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevatorChromium; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("B88C45B9-8825-4629-B83E-77CC67D9CEED") IElevatorChromium : public IElevator { public: }; #else /* C style interface */ typedef struct IElevatorChromiumVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevatorChromium * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevatorChromium * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevatorChromium * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevatorChromium * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorChromiumVtbl; interface IElevatorChromium { CONST_VTBL struct IElevatorChromiumVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevatorChromium_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevatorChromium_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevatorChromium_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevatorChromium_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevatorChromium_INTERFACE_DEFINED__ */ #ifndef __IElevatorChrome_INTERFACE_DEFINED__ #define __IElevatorChrome_INTERFACE_DEFINED__ /* interface IElevatorChrome */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevatorChrome; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("463ABECF-410D-407F-8AF5-0DF35A005CC8") IElevatorChrome : public IElevator { public: }; #else /* C style interface */ typedef struct IElevatorChromeVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevatorChrome * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevatorChrome * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevatorChrome * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevatorChrome * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorChromeVtbl; interface IElevatorChrome { CONST_VTBL struct IElevatorChromeVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevatorChrome_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevatorChrome_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevatorChrome_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevatorChrome_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevatorChrome_INTERFACE_DEFINED__ */ #ifndef __IElevatorChromeBeta_INTERFACE_DEFINED__ #define __IElevatorChromeBeta_INTERFACE_DEFINED__ /* interface IElevatorChromeBeta */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevatorChromeBeta; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("A2721D66-376E-4D2F-9F0F-9070E9A42B5F") IElevatorChromeBeta : public IElevator { public: }; #else /* C style interface */ typedef struct IElevatorChromeBetaVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevatorChromeBeta * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevatorChromeBeta * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevatorChromeBeta * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevatorChromeBeta * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorChromeBetaVtbl; interface IElevatorChromeBeta { CONST_VTBL struct IElevatorChromeBetaVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevatorChromeBeta_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevatorChromeBeta_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevatorChromeBeta_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevatorChromeBeta_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevatorChromeBeta_INTERFACE_DEFINED__ */ #ifndef __IElevatorChromeDev_INTERFACE_DEFINED__ #define __IElevatorChromeDev_INTERFACE_DEFINED__ /* interface IElevatorChromeDev */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevatorChromeDev; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("BB2AA26B-343A-4072-8B6F-80557B8CE571") IElevatorChromeDev : public IElevator { public: }; #else /* C style interface */ typedef struct IElevatorChromeDevVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevatorChromeDev * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevatorChromeDev * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevatorChromeDev * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevatorChromeDev * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorChromeDevVtbl; interface IElevatorChromeDev { CONST_VTBL struct IElevatorChromeDevVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevatorChromeDev_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevatorChromeDev_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevatorChromeDev_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevatorChromeDev_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevatorChromeDev_INTERFACE_DEFINED__ */ #ifndef __IElevatorChromeCanary_INTERFACE_DEFINED__ #define __IElevatorChromeCanary_INTERFACE_DEFINED__ /* interface IElevatorChromeCanary */ /* [unique][helpstring][uuid][oleautomation][object] */ EXTERN_C const IID IID_IElevatorChromeCanary; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("4F7CE041-28E9-484F-9DD0-61A8CACEFEE4") IElevatorChromeCanary : public IElevator { public: }; #else /* C style interface */ typedef struct IElevatorChromeCanaryVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IElevatorChromeCanary * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IElevatorChromeCanary * This); ULONG ( STDMETHODCALLTYPE *Release )( IElevatorChromeCanary * This); HRESULT ( STDMETHODCALLTYPE *RunRecoveryCRXElevated )( IElevatorChromeCanary * This, /* [string][in] */ const WCHAR *crx_path, /* [string][in] */ const WCHAR *browser_appid, /* [string][in] */ const WCHAR *browser_version, /* [string][in] */ const WCHAR *session_id, /* [in] */ DWORD caller_proc_id, /* [out] */ ULONG_PTR *proc_handle); END_INTERFACE } IElevatorChromeCanaryVtbl; interface IElevatorChromeCanary { CONST_VTBL struct IElevatorChromeCanaryVtbl *lpVtbl; }; #ifdef COBJMACROS #define IElevatorChromeCanary_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IElevatorChromeCanary_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IElevatorChromeCanary_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IElevatorChromeCanary_RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) \ ( (This)->lpVtbl -> RunRecoveryCRXElevated(This,crx_path,browser_appid,browser_version,session_id,caller_proc_id,proc_handle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IElevatorChromeCanary_INTERFACE_DEFINED__ */ #ifndef __ElevatorLib_LIBRARY_DEFINED__ #define __ElevatorLib_LIBRARY_DEFINED__ /* library ElevatorLib */ /* [helpstring][version][uuid] */ EXTERN_C const IID LIBID_ElevatorLib; #endif /* __ElevatorLib_LIBRARY_DEFINED__ */ /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
8,974
5,070
<reponame>joao-r-santos/DataSciencePython #https://www.kaggle.com/c/amazon-employee-access-challenge/forums/t/4797/starter-code-in-python-with-scikit-learn-auc-885 """ Amazon Access Challenge Starter Code These files provide some starter code using the scikit-learn library. It provides some examples on how to design a simple algorithm, including pre-processing, training a logistic regression classifier on the data, assess its performance through cross-validation and some pointers on where to go next. <NAME> <<EMAIL>> """ from __future__ import division import numpy as np from sklearn import (metrics, cross_validation, linear_model, preprocessing) SEED = 42 # always use a seed for randomized procedures def load_data(filename, use_labels=True): """ Load data from CSV files and return them as numpy arrays The use_labels parameter indicates whether one should read the first column (containing class labels). If false, return all 0s. """ # load column 1 to 8 (ignore last one) data = np.loadtxt(open("data/" + filename), delimiter=',', usecols=range(1, 9), skiprows=1) if use_labels: labels = np.loadtxt(open("data/" + filename), delimiter=',', usecols=[0], skiprows=1) else: labels = np.zeros(data.shape[0]) return labels, data def save_results(predictions, filename): """Given a vector of predictions, save results in CSV format.""" with open(filename, 'w') as f: f.write("id,ACTION\n") for i, pred in enumerate(predictions): f.write("%d,%f\n" % (i + 1, pred)) def main(): """ Fit models and make predictions. We'll use one-hot encoding to transform our categorical features into binary features. y and X will be numpy array objects. """ model = linear_model.LogisticRegression(C=3) # the classifier we'll use # === load data in memory === # print "loading data" y, X = load_data('train.csv') y_test, X_test = load_data('test.csv', use_labels=False) # === one-hot encoding === # # we want to encode the category IDs encountered both in # the training and the test set, so we fit the encoder on both encoder = preprocessing.OneHotEncoder() encoder.fit(np.vstack((X, X_test))) X = encoder.transform(X) # Returns a sparse matrix (see numpy.sparse) X_test = encoder.transform(X_test) # if you want to create new features, you'll need to compute them # before the encoding, and append them to your dataset after # === training & metrics === # mean_auc = 0.0 n = 10 # repeat the CV procedure 10 times to get more precise results for i in range(n): # for each iteration, randomly hold out 20% of the data as CV set X_train, X_cv, y_train, y_cv = cross_validation.train_test_split( X, y, test_size=.20, random_state=i*SEED) # if you want to perform feature selection / hyperparameter # optimization, this is where you want to do it # train model and make predictions model.fit(X_train, y_train) preds = model.predict_proba(X_cv)[:, 1] # compute AUC metric for this CV fold fpr, tpr, thresholds = metrics.roc_curve(y_cv, preds) roc_auc = metrics.auc(fpr, tpr) print "AUC (fold %d/%d): %f" % (i + 1, n, roc_auc) mean_auc += roc_auc print "Mean AUC: %f" % (mean_auc/n) # === Predictions === # # When making predictions, retrain the model on the whole training set model.fit(X, y) preds = model.predict_proba(X_test)[:, 1] filename = raw_input("Enter name for submission file: ") save_results(preds, filename + ".csv") if __name__ == '__main__': main()
1,407
466
/* Copyright (c) 2010, NullNoname All rights reserved. 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 NullNoname 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. */ package mu.nu.nullpo.game.subsystem.mode; import mu.nu.nullpo.game.component.Controller; import mu.nu.nullpo.game.event.EventReceiver; import mu.nu.nullpo.game.play.GameEngine; import mu.nu.nullpo.util.CustomProperties; import mu.nu.nullpo.util.GeneralUtil; /** * RETRO MANIA mode (Original from NullpoUE build 121909 by Zircean) */ public class RetroManiaMode extends AbstractMode { /** Current version */ private static final int CURRENT_VERSION = 2; /** Poweron Pattern */ private static final String STRING_POWERON_PATTERN = "4040050165233516506133350555213560141520224542633206134255165200333560031332022463366645230432611435"+ "5335503262512313515002442203656664131543211220146344201325061401134610644005663441101532234006340505"+ "4621441004021465010225623313311635326311133504346120621126223156523530636115044065300222245330252325"+ "5563545455656660124120450663502223206465164461126135621055103645066644052535021110020361422122352566"+ "1564343513043465103636404534525056551422631026052022163516150316500504641606133253660234134530365424"+ "4124644510156225214120146050543513004022131140054341604166064441010614144404145451160041314635320626"+ "0246251556635262420616451361336106153451563316660054255631510320566516465265421144640513424316315421"+ "6644140264401653410103024436251016522052305506020020331200443440341001604426324366453255122653512056"+ "4234334231212152312006153023444306242003331046140330636540231321265610510125435251421621035523001404"+ "0335464640401464125332132315552404146634264364245513600336065666305002023203545052006445544450440460"; /** Gravity table */ private static final int tableDenominator[][] = {{48, 32, 24, 18, 14, 12, 10, 8, 6, 4, 12, 10, 8, 6, 4, 2}, {48, 24, 18, 15, 12, 10, 8, 6, 4, 2, 10, 8, 6, 4, 2, 1}, {40, 20, 16, 12, 10, 8, 6, 4, 2, 1, 10, 8, 6, 4, 2, 1}, {30, 15, 12, 10, 8, 6, 4, 2, 1, 1, 8, 6, 4, 2, 1, 1}}; /** Time until auto-level up occers */ private static final int levelTime[] = {3584, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 2304, 3584, 3584, 2304, 2304, 2304, 2304, 3584}; /** Name of game types */ private static final String[] GAMETYPE_NAME = {"EASY","NORMAL","HARD","HARDEST"}; /** Number of game type */ private static final int GAMETYPE_MAX = 4; /** Number of ranking records */ private static final int RANKING_MAX = 10; /** Number of ranking types */ private static final int RANKING_TYPE = 4; /** Max score */ private static final int MAX_SCORE = 999999; /** Max lines */ private static final int MAX_LINES = 999; /** Max level */ private static final int MAX_LEVEL = 99; /** GameManager object (Manages entire game status) */ /** EventReceiver object (This receives many game events, can also be used for drawing the fonts.) */ /** Amount of points you just get from line clears */ private int lastscore; /** Elapsed time from last line clear (lastscore is displayed to screen until this reaches to 120) */ private int scgettime; /** Selected game type */ private int gametype; /** Selected starting level */ private int startlevel; /** Level timer */ private int levelTimer; /** Amount of lines cleared (It will be reset when the level increases) */ private int linesAfterLastLevelUp; /** Big mode on/off */ private boolean big; /** Poweron Pattern on/off */ private boolean poweron; /** Version of this mode */ private int version; /** Your place on leaderboard (-1: out of rank) */ private int rankingRank; /** Score records */ private int[][] rankingScore; /** Line records */ private int[][] rankingLines; /** Time records */ private int[][] rankingTime; /** * Returns the name of this mode */ @Override public String getName() { return "RETRO MANIA"; } /** * This function will be called when the game enters the main game screen. */ @Override public void playerInit(GameEngine engine, int playerID) { owner = engine.owner; receiver = engine.owner.receiver; lastscore = 0; scgettime = 0; levelTimer = 0; linesAfterLastLevelUp = 0; rankingRank = -1; rankingScore = new int[RANKING_TYPE][RANKING_MAX]; rankingLines = new int[RANKING_TYPE][RANKING_MAX]; rankingTime = new int[RANKING_TYPE][RANKING_MAX]; engine.tspinEnable = false; engine.b2bEnable = false; engine.comboType = GameEngine.COMBO_TYPE_DISABLE; engine.bighalf = false; engine.bigmove = false; engine.speed.are = 30; engine.speed.areLine = 30; engine.speed.lineDelay = 42; engine.speed.lockDelay = 30; engine.speed.das = 20; if(owner.replayMode == false) { loadSetting(owner.modeConfig); loadRanking(owner.modeConfig, engine.ruleopt.strRuleName); version = CURRENT_VERSION; } else { loadSetting(owner.replayProp); } engine.owner.backgroundStatus.bg = startlevel/2; if(engine.owner.backgroundStatus.bg > 19) engine.owner.backgroundStatus.bg = 19; engine.framecolor = GameEngine.FRAME_COLOR_GRAY; } /** * Set the gravity speed * @param engine GameEngine object */ private void setSpeed(GameEngine engine) { int lv = engine.statistics.level; if(lv < 0) lv = 0; if(lv >= tableDenominator[0].length) lv = tableDenominator[0].length - 1; engine.speed.gravity = 1; engine.speed.denominator = tableDenominator[gametype][lv]; } /** * Main routine for game setup screen */ @Override public boolean onSetting(GameEngine engine, int playerID) { if(engine.owner.replayMode == false) { // Configuration changes int change = updateCursor(engine, 3); if(change != 0) { engine.playSE("change"); switch(menuCursor) { case 0: gametype += change; if(gametype < 0) gametype = GAMETYPE_MAX - 1; if(gametype > GAMETYPE_MAX - 1) gametype = 0; break; case 1: startlevel += change; if (startlevel < 0) startlevel = 15; if (startlevel > 15) startlevel = 0; engine.owner.backgroundStatus.bg = startlevel/2; break; case 2: big = !big; break; case 3: poweron = !poweron; break; } } // Check for A button, when pressed this will begin the game if(engine.ctrl.isPush(Controller.BUTTON_A) && (menuTime >= 5)) { engine.playSE("decide"); saveSetting(owner.modeConfig); receiver.saveModeConfig(owner.modeConfig); return false; } // Check for B button, when pressed this will shutdown the game engine. if(engine.ctrl.isPush(Controller.BUTTON_B)) { engine.quitflag = true; } menuTime++; } else { menuTime++; menuCursor = -1; if(menuTime >= 60) { return false; } } return true; } /** * Renders game setup screen */ @Override public void renderSetting(GameEngine engine, int playerID) { drawMenu(engine, playerID, receiver, 0, EventReceiver.COLOR_BLUE, 0, "DIFFICULTY", GAMETYPE_NAME[gametype], "LEVEL", String.valueOf(startlevel), "BIG", GeneralUtil.getONorOFF(big), "POWERON", GeneralUtil.getONorOFF(poweron)); } /** * Ready */ @Override public boolean onReady(GameEngine engine, int playerID) { if(engine.statc[0] == 0) { if(poweron) { engine.nextPieceArrayID = GeneralUtil.createNextPieceArrayFromNumberString(STRING_POWERON_PATTERN); } } return false; } /** * This function will be called before the game actually begins (after Ready&Go screen disappears) */ @Override public void startGame(GameEngine engine, int playerID) { engine.statistics.level = startlevel; engine.statistics.levelDispAdd = 1; engine.big = big; owner.bgmStatus.bgm = 0; setSpeed(engine); } /** * Renders HUD (leaderboard or game statistics) */ @Override public void renderLast(GameEngine engine, int playerID) { receiver.drawScoreFont(engine, playerID, 0, 0, "RETRO MANIA", EventReceiver.COLOR_GREEN); receiver.drawScoreFont(engine, playerID, 0, 1, "("+GAMETYPE_NAME[gametype]+" SPEED)", EventReceiver.COLOR_GREEN); if( (engine.stat == GameEngine.Status.SETTING) || ((engine.stat == GameEngine.Status.RESULT) && (owner.replayMode == false)) ) { // Leaderboard if((owner.replayMode == false) && (big == false) && (startlevel == 0) && (engine.ai == null)) { float scale = (receiver.getNextDisplayType() == 2) ? 0.5f : 1.0f; int topY = (receiver.getNextDisplayType() == 2) ? 6 : 4; receiver.drawScoreFont(engine, playerID, 3, topY-1, "SCORE LINE TIME", EventReceiver.COLOR_BLUE, scale); for(int i = 0; i < RANKING_MAX; i++) { receiver.drawScoreFont(engine, playerID, 0, topY+i, String.format("%2d", i + 1), EventReceiver.COLOR_YELLOW, scale); receiver.drawScoreFont(engine, playerID, 3, topY+i, String.valueOf(rankingScore[gametype][i]), (i == rankingRank), scale); receiver.drawScoreFont(engine, playerID, 10, topY+i, String.valueOf(rankingLines[gametype][i]), (i == rankingRank), scale); receiver.drawScoreFont(engine, playerID, 15, topY+i, GeneralUtil.getTime(rankingTime[gametype][i]), (i == rankingRank), scale); } } } else { // Game statistics receiver.drawScoreFont(engine, playerID, 0, 3, "SCORE", EventReceiver.COLOR_BLUE); String strScore; if((lastscore == 0) || (scgettime >= 120)) { strScore = String.valueOf(engine.statistics.score); } else { strScore = String.valueOf(engine.statistics.score) + "(+" + String.valueOf(lastscore) + ")"; } receiver.drawScoreFont(engine, playerID, 0, 4, strScore); receiver.drawScoreFont(engine, playerID, 0, 6, "LINE", EventReceiver.COLOR_BLUE); receiver.drawScoreFont(engine, playerID, 0, 7, String.valueOf(engine.statistics.lines)); receiver.drawScoreFont(engine, playerID, 0, 9, "LEVEL", EventReceiver.COLOR_BLUE); receiver.drawScoreFont(engine, playerID, 0, 10, String.valueOf(engine.statistics.level)); receiver.drawScoreFont(engine, playerID, 0, 12, "TIME", EventReceiver.COLOR_BLUE); receiver.drawScoreFont(engine, playerID, 0, 13, GeneralUtil.getTime(engine.statistics.time)); //receiver.drawScoreFont(engine, playerID, 0, 15, String.valueOf(linesAfterLastLevelUp)); //receiver.drawScoreFont(engine, playerID, 0, 16, GeneralUtil.getTime(levelTime[Math.min(engine.statistics.level,15)] - levelTimer)); } } /** * This function will be called when the game timer updates */ @Override public void onLast(GameEngine engine, int playerID) { scgettime++; if(engine.timerActive) levelTimer++; // Max-out score, lines, and level if(version >= 2) { if(engine.statistics.score > MAX_SCORE) engine.statistics.score = MAX_SCORE; if(engine.statistics.lines > MAX_LINES) engine.statistics.lines = MAX_LINES; if(engine.statistics.level > MAX_LEVEL) engine.statistics.level = MAX_LEVEL; } } /** * Calculates line-clear score * (This function will be called even if no lines are cleared) */ @Override public void calcScore(GameEngine engine, int playerID, int lines) { // Determines line-clear bonus int pts = 0; int mult = Math.min(engine.statistics.level/2 + 1,5); if(lines == 1) { pts += 100 * mult; // Single } else if(lines == 2) { pts += 400 * mult; // Double } else if(lines == 3) { pts += 900 * mult; // Triple } else if(lines >= 4) { pts += 2000 * mult; // Four } // Perfect clear bonus if(engine.field.isEmpty()) { engine.playSE("bravo"); if(version >= 2) pts *= 10; else pts *= 20; } // Add score if(pts > 0) { lastscore = pts; scgettime = 0; engine.statistics.scoreFromLineClear += pts; engine.statistics.score += pts; } // Add lines linesAfterLastLevelUp += lines; // Update the meter engine.meterValue = ((linesAfterLastLevelUp % 4) * receiver.getMeterMax(engine)) / 3; engine.meterColor = GameEngine.METER_COLOR_GREEN; if(linesAfterLastLevelUp >= 1) engine.meterColor = GameEngine.METER_COLOR_YELLOW; if(linesAfterLastLevelUp >= 2) engine.meterColor = GameEngine.METER_COLOR_ORANGE; if(linesAfterLastLevelUp >= 3) engine.meterColor = GameEngine.METER_COLOR_RED; // Level up if( (linesAfterLastLevelUp >= 4) || ((levelTimer >= levelTime[Math.min(engine.statistics.level,15)]) && (lines == 0)) ) { engine.statistics.level++; owner.backgroundStatus.fadecount = 0; owner.backgroundStatus.fadebg = (engine.statistics.level/2); if (owner.backgroundStatus.fadebg > 19) owner.backgroundStatus.fadebg = 19; owner.backgroundStatus.fadesw = (owner.backgroundStatus.fadebg != owner.backgroundStatus.bg); levelTimer = 0; linesAfterLastLevelUp = 0; engine.meterValue = 0; setSpeed(engine); engine.playSE("levelup"); } } /** * This function will be called when soft-drop is used */ @Override public void afterSoftDropFall(GameEngine engine, int playerID, int fall) { if((version >= 2) && (engine.speed.denominator == 1)) return; engine.statistics.scoreFromSoftDrop += fall; engine.statistics.score += fall; } /** * This function will be called when hard-drop is used */ @Override public void afterHardDropFall(GameEngine engine, int playerID, int fall) { engine.statistics.scoreFromHardDrop += fall; engine.statistics.score += fall; } /** * Renders game result screen */ @Override public void renderResult(GameEngine engine, int playerID) { receiver.drawMenuFont(engine, playerID, 0, 1, "PLAY DATA", EventReceiver.COLOR_ORANGE); drawResultStats(engine, playerID, receiver, 3, EventReceiver.COLOR_BLUE, Statistic.SCORE, Statistic.LINES, Statistic.LEVEL, Statistic.TIME); drawResultRank(engine, playerID, receiver, 11, EventReceiver.COLOR_BLUE, rankingRank); } /** * This function will be called when the replay data is going to be saved */ @Override public void saveReplay(GameEngine engine, int playerID, CustomProperties prop) { saveSetting(prop); // Checks/Updates the ranking if((owner.replayMode == false) && (big == false) && (engine.ai == null)) { updateRanking(engine.statistics.score, engine.statistics.lines, engine.statistics.time, gametype); if(rankingRank != -1) { saveRanking(owner.modeConfig, engine.ruleopt.strRuleName); receiver.saveModeConfig(owner.modeConfig); } } } /** * Load the settings */ protected void loadSetting(CustomProperties prop) { startlevel = prop.getProperty("retromania.startlevel", 0); gametype = prop.getProperty("retromania.gametype", 0); big = prop.getProperty("retromania.big", false); poweron = prop.getProperty("retromania.poweron", false); version = prop.getProperty("retromania.version", 0); } /** * Save the settings */ protected void saveSetting(CustomProperties prop) { prop.setProperty("retromania.startlevel", startlevel); prop.setProperty("retromania.gametype", gametype); prop.setProperty("retromania.big", big); prop.setProperty("retromania.poweron", poweron); prop.setProperty("retromania.version", version); } /** * Load the ranking */ private void loadRanking(CustomProperties prop, String ruleName) { for(int i = 0; i < RANKING_MAX; i++) { for (int gametypeIndex = 0; gametypeIndex < RANKING_TYPE; gametypeIndex++) { rankingScore[gametypeIndex][i] = prop.getProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".score." + i, 0); rankingLines[gametypeIndex][i] = prop.getProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".lines." + i, 0); rankingTime[gametypeIndex][i] = prop.getProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".time." + i, 0); if(rankingScore[gametypeIndex][i] > MAX_SCORE) rankingScore[gametypeIndex][i] = MAX_SCORE; if(rankingLines[gametypeIndex][i] > MAX_LINES) rankingLines[gametypeIndex][i] = MAX_LINES; } } } /** * Save the ranking */ private void saveRanking(CustomProperties prop, String ruleName) { for(int i = 0; i < RANKING_MAX; i++) { for (int gametypeIndex = 0; gametypeIndex < RANKING_TYPE; gametypeIndex++) { prop.setProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".score." + i, rankingScore[gametypeIndex][i]); prop.setProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".lines." + i, rankingLines[gametypeIndex][i]); prop.setProperty("retromania.ranking." + ruleName + "." + gametypeIndex + ".time." + i, rankingTime[gametypeIndex][i]); } } } /** * Update the ranking */ private void updateRanking(int sc, int li, int time, int type) { rankingRank = checkRanking(sc, li, time, type); if(rankingRank != -1) { // Shift the old records for(int i = RANKING_MAX - 1; i > rankingRank; i--) { rankingScore[type][i] = rankingScore[type][i - 1]; rankingLines[type][i] = rankingLines[type][i - 1]; rankingTime[type][i] = rankingTime[type][i - 1]; } // Insert a new record rankingScore[type][rankingRank] = sc; rankingLines[type][rankingRank] = li; rankingTime[type][rankingRank] = time; } } /** * This function will check the ranking and returns which place you are. (-1: Out of rank) */ private int checkRanking(int sc, int li, int time, int type) { for(int i = 0; i < RANKING_MAX; i++) { if(sc > rankingScore[type][i]) { return i; } else if((sc == rankingScore[type][i]) && (li > rankingLines[type][i])) { return i; } else if((sc == rankingScore[type][i]) && (li == rankingLines[type][i]) && (time < rankingTime[type][i])) { return i; } } return -1; } }
7,698
2,649
<reponame>wangjiulonghenqiang/Dome package json.chao.com.wanandroid.core.event; /** * @author quchao * @date 2018/2/28 */ public class LoginEvent { private boolean isLogin; public boolean isLogin() { return isLogin; } public void setLogin(boolean login) { isLogin = login; } public LoginEvent(boolean isLogin) { this.isLogin = isLogin; } }
165
5,079
<reponame>kokosing/hue #include <yaml.h> #if PY_MAJOR_VERSION < 3 #define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), "strict") #else #define PyString_CheckExact PyBytes_CheckExact #define PyString_AS_STRING PyBytes_AS_STRING #define PyString_GET_SIZE PyBytes_GET_SIZE #define PyString_FromStringAndSize PyBytes_FromStringAndSize #endif #ifdef _MSC_VER /* MS Visual C++ 6.0 */ #if _MSC_VER == 1200 #define PyLong_FromUnsignedLongLong(z) PyInt_FromLong(i) #endif #endif
208
1,609
package com.mossle.api.user; import java.util.Map; import com.mossle.core.page.Page; public class MockUserConnector implements UserConnector { /** * 根据唯一标识获取用户信息. * * @param id * 用户的唯一标识,即便是不同用户库的用户id也是唯一的 */ public UserDTO findById(String id) { return null; } /** * 根据username和userRepoRef获取用户. * * @param username * 登录账号,每个用户库中的用户登录名都是唯一的 * @param userRepoRef * 用户库 */ public UserDTO findByUsername(String username, String userRepoRef) { return null; } /** * 根据reference和userRepoRef获取用户. * * @param ref * 针对某个用户库的用户的唯一标识 * @param userRepoRef * 用户库 */ public UserDTO findByRef(String ref, String userRepoRef) { return null; } /** * 分页查询用户. */ public Page pagedQuery(String userRepoRef, Page page, Map<String, Object> parameters) { return null; } public UserDTO findByNickName(String nickName, String userRepoRef) { return null; } }
706
3,799
/* * Copyright 2019 The Android Open Source Project * * 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 androidx.room.integration.testapp.vo; import static androidx.room.ForeignKey.CASCADE; import androidx.room.Entity; import androidx.room.ForeignKey; import androidx.room.RoomWarnings; @Entity( primaryKeys = {"friendA", "friendB"}, foreignKeys = { @ForeignKey( entity = User.class, parentColumns = "mId", childColumns = "friendA", onDelete = CASCADE), @ForeignKey( entity = User.class, parentColumns = "mId", childColumns = "friendB", onDelete = CASCADE), }) @SuppressWarnings(RoomWarnings.MISSING_INDEX_ON_FOREIGN_KEY_CHILD) public class FriendsJunction { public final int friendA; public final int friendB; public FriendsJunction(int friendA, int friendB) { this.friendA = friendA; this.friendB = friendB; } }
669
309
<reponame>cvandijck/VTKExamples #include <vtkSmartPointer.h> #include <vtkPointSource.h> #include <vtkBYUReader.h> #include <vtkOBJReader.h> #include <vtkPLYReader.h> #include <vtkPolyDataReader.h> #include <vtkSTLReader.h> #include <vtkXMLPolyDataReader.h> #include <vtkPointOccupancyFilter.h> #include <vtkThreshold.h> #include <vtkDataSetMapper.h> #include <vtkImageData.h> #include <vtkNamedColors.h> #include <vtkProperty.h> #include <vtkRenderWindow.h> #include <vtkRenderWindowInteractor.h> #include <vtkRenderer.h> #include <vtkCamera.h> #include <vtksys/SystemTools.hxx> namespace { vtkSmartPointer<vtkPolyData> ReadPolyData(const char *fileName); } int main (int argc, char *argv[]) { vtkSmartPointer<vtkPolyData> polyData = ReadPolyData(argc > 1 ? argv[1] : "");; int dimension = 128; vtkSmartPointer<vtkPointOccupancyFilter> occupancy = vtkSmartPointer<vtkPointOccupancyFilter>::New(); occupancy->SetInputData(polyData); occupancy->SetSampleDimensions(dimension, dimension, dimension); occupancy->SetOccupiedValue(255); occupancy->Update(); vtkSmartPointer<vtkThreshold> threshold = vtkSmartPointer<vtkThreshold>::New(); threshold->SetInputConnection(occupancy->GetOutputPort()); threshold->ThresholdByUpper(255); threshold->AllScalarsOff(); vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New(); mapper->SetInputConnection(threshold->GetOutputPort()); mapper->ScalarVisibilityOff(); vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New(); actor->SetMapper(mapper); // Colors vtkSmartPointer<vtkNamedColors> nc = vtkSmartPointer<vtkNamedColors>::New(); double flesh[3]; nc->GetColorRGB("moccasin", flesh); actor->GetProperty()->SetColor(flesh); // Create graphics stuff // vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New(); ren1->SetBackground(.3, .4, .6); vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New(); renWin->AddRenderer(ren1); renWin->SetSize(512,512); vtkSmartPointer<vtkRenderWindowInteractor> iren = vtkSmartPointer<vtkRenderWindowInteractor>::New(); iren->SetRenderWindow(renWin); // Add the actors to the renderer, set the background and size // ren1->AddActor(actor); // Generate an interesting view // ren1->ResetCamera(); ren1->GetActiveCamera()->Azimuth(120); ren1->GetActiveCamera()->Elevation(30); ren1->GetActiveCamera()->Dolly(1.25); ren1->ResetCameraClippingRange(); renWin->Render(); iren->Initialize(); iren->Start(); return EXIT_SUCCESS; } namespace { vtkSmartPointer<vtkPolyData> ReadPolyData(const char *fileName) { vtkSmartPointer<vtkPolyData> polyData; std::string extension = vtksys::SystemTools::GetFilenameExtension(std::string(fileName)); if (extension == ".ply") { vtkSmartPointer<vtkPLYReader> reader = vtkSmartPointer<vtkPLYReader>::New(); reader->SetFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else if (extension == ".vtp") { vtkSmartPointer<vtkXMLPolyDataReader> reader = vtkSmartPointer<vtkXMLPolyDataReader>::New(); reader->SetFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else if (extension == ".vtk") { vtkSmartPointer<vtkPolyDataReader> reader = vtkSmartPointer<vtkPolyDataReader>::New(); reader->SetFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else if (extension == ".obj") { vtkSmartPointer<vtkOBJReader> reader = vtkSmartPointer<vtkOBJReader>::New(); reader->SetFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else if (extension == ".stl") { vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New(); reader->SetFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else if (extension == ".g") { vtkSmartPointer<vtkBYUReader> reader = vtkSmartPointer<vtkBYUReader>::New(); reader->SetGeometryFileName (fileName); reader->Update(); polyData = reader->GetOutput(); } else { vtkSmartPointer<vtkPointSource> points = vtkSmartPointer<vtkPointSource>::New(); points->SetNumberOfPoints(1000); points->SetRadius(10.0); points->SetCenter(vtkMath::Random(-100, 100), vtkMath::Random(-100, 100), vtkMath::Random(-100, 100)); points->SetDistributionToShell(); points->Update(); polyData = points->GetOutput(); } return polyData; } }
1,805
1,272
/* * Copyright 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. */ #ifndef ACSDKMANUFACTORY_INTERNAL_ABSTRACTPOINTERCACHE_H_ #define ACSDKMANUFACTORY_INTERNAL_ABSTRACTPOINTERCACHE_H_ namespace alexaClientSDK { namespace acsdkManufactory { namespace internal { /// Forward declaration. class RuntimeManufactory; /** * Common parent class for an object used to cache an instance. */ class AbstractPointerCache { public: /** * Destructor. */ virtual ~AbstractPointerCache() = default; /** * Get the instance from the cache. * * @param runtimeManufactory The @c RuntimeManufactory to use to acquire an instance if the cache is empty. * @return A void* to a shared_ptr<Type>. Caller is responsible for casting this to to shared_ptr<Type>*. */ virtual void* get(RuntimeManufactory& runtimeManufactory) = 0; /** * Release any unneeded references in the cache after calling get(). * @note If get() is called without calling cleanup() afterwards, that may result in memory leaks. */ virtual void cleanup() = 0; }; } // namespace internal } // namespace acsdkManufactory } // namespace alexaClientSDK #endif // ACSDKMANUFACTORY_INTERNAL_ABSTRACTPOINTERCACHE_H_
548
6,240
<reponame>kzantow-web/closure-compiler /* * Copyright 2014 The Closure Compiler 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.google.javascript.jscomp; import static com.google.javascript.jscomp.Es6ToEs3Util.CANNOT_CONVERT_YET; import static com.google.javascript.jscomp.testing.CodeSubTree.findClassDefinition; import static com.google.javascript.rhino.testing.NodeSubject.assertNode; import com.google.javascript.jscomp.CompilerOptions.LanguageMode; import com.google.javascript.jscomp.colors.Color; import com.google.javascript.jscomp.colors.StandardColors; import com.google.javascript.jscomp.testing.NoninjectingCompiler; import com.google.javascript.jscomp.testing.TestExternsBuilder; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * Test cases for a transpilation pass that rewrites most usages of `super` syntax. * * <p>The covered rewrites are: * * <ul> * <li>`super.method` accesses and calls * <li>`super['prop']` accesses and calls * <li>adding constructor definitions (with `super()` calls if needed) to classes that omit them * <li>stripping `super()` calls from constructors of externs classes and interfaces (i.e stubs) * </ul> */ @RunWith(JUnit4.class) @SuppressWarnings("RhinoNodeGetFirstFirstChild") public final class Es6ConvertSuperTest extends CompilerTestCase { public Es6ConvertSuperTest() { super(MINIMAL_EXTERNS); } @Override protected Compiler createCompiler() { return new NoninjectingCompiler(); } @Override protected NoninjectingCompiler getLastCompiler() { return (NoninjectingCompiler) super.getLastCompiler(); } @Override @Before public void setUp() throws Exception { super.setUp(); setAcceptedLanguage(LanguageMode.ECMASCRIPT_2016); setLanguageOut(LanguageMode.ECMASCRIPT5); enableTypeCheck(); enableTypeInfoValidation(); enableScriptFeatureValidation(); replaceTypesWithColors(); } @Override protected CompilerPass getProcessor(final Compiler compiler) { return new Es6ConvertSuper(compiler); } // Instance `super` resolution @Test public void testCallingSuperInstanceProperty() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x @return {string} */", " g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " f() { super.g(3); }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " f() { A.prototype.g.call(this, 3); }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); Color classBInstanceType = Color.createUnion( findClassDefinition(getLastCompiler(), "B") .getRootNode() .getColor() .getInstanceColors()); // A.prototype.g.call(this, 3) Node callNode = findClassDefinition(getLastCompiler(), "B") .findMethodDefinition("f") .findMatchingQNameReferences("A.prototype.g.call") .get(0) // GETPROP node for A.prototype.g.call .getParent(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(4) // position and length of `super.g(3)` .hasCharno(8) .hasLength(10); assertNode(callNode).hasColorThat().isEqualTo(StandardColors.STRING); // A.prototype.g.call Node callee = callNode.getFirstChild(); assertNode(callee) .matchesQualifiedName("A.prototype.g.call") .hasLineno(4) // position and length of `super.g` .hasCharno(14) .hasLength(1); assertNode(callee).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype.g Node superDotGReplacement = callee.getFirstChild(); assertNode(superDotGReplacement) .matchesQualifiedName("A.prototype.g") .hasLineno(4) // position and length of `super.g` .hasCharno(14) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A.prototype Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(4) // position and length of `super` .hasCharno(8) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); // `this` node from `A.prototype.g.call(this, 3)` Node thisNode = callee.getNext(); assertNode(thisNode) .hasToken(Token.THIS) .hasLineno(4) // position and length of `super.g` .hasCharno(14) .hasLength(1) .isIndexable(false); // there's no direct correlation with text in the original source assertNode(thisNode).hasColorThat().isEqualTo(classBInstanceType); } @Test public void testCallingSuperInstanceElement() { test( externs( lines( "/** @dict */", "class A {", " constructor() { }", "", " /** @param {number} x */", " ['g'](x) { };", "}")), srcs( lines( "/** @dict */", "class B extends A {", " constructor() { super(); }", "", " ['f']() { super['g'](4); }", "}")), expected( lines( "class B extends A {", " constructor() {", " super();", " }", "", " ['f']() { A.prototype['g'].call(this, 4); }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); Color classBInstanceType = Color.createUnion( findClassDefinition(getLastCompiler(), "B") .getRootNode() .getColor() .getInstanceColors()); // A.prototype['g'].call(this, 4) Node callNode = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // ['f']() { ... } .getSecondChild() // () { ... } .getLastChild() // { ... } .getFirstChild() // statement `A.prototype['g'].call(this, 4);` .getOnlyChild(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(5) // position and length of `super['g'](4)` .hasCharno(12) .hasLength(13); // computed property prevents doing any better than StandardColors.UNKNOWN assertNode(callNode).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype['g'].call Node callee = callNode.getFirstChild(); assertNode(callee) .hasToken(Token.GETPROP) .hasLineno(5) // position and length of `super['g']` .hasCharno(12) .hasLength(10); assertNode(callee).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype['g'] Node superGetelemReplacement = callee.getFirstChild(); assertNode(superGetelemReplacement) .hasToken(Token.GETELEM) .hasLineno(5) // position and length of `super['g']` .hasCharno(12) .hasLength(10); // computed property prevents doing any better than StandardColors.UNKNOWN assertNode(superGetelemReplacement).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype Node superReplacement = superGetelemReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(5) // position and length of `super` .hasCharno(12) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); // `this` node from `A.prototype['g'].call(this, 3)` Node thisNode = callee.getNext(); assertNode(thisNode) .hasToken(Token.THIS) .hasLineno(5) // position and length of `super['g']` .hasCharno(12) .hasLength(10) .isIndexable(false); // there's no direct correlation with text in the original source assertNode(thisNode).hasColorThat().isEqualTo(classBInstanceType); } @Test public void testAccessingSuperInstanceProperty() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x */", " g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " f() { var t = super.g; }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " f() { var t = A.prototype.g; }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); // A.prototype.g Node superDotGReplacement = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // f .getOnlyChild() // function that implements f() {} .getLastChild() // method body .getFirstChild() // `var t = A.prototype.g;` .getFirstChild() // `t = A.prototype.g` .getOnlyChild(); // A.prototype.g assertNode(superDotGReplacement) .matchesQualifiedName("A.prototype.g") .hasLineno(4) // position and length of `super.g` .hasCharno(22) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A.prototype Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(4) // position and length of `super` .hasCharno(16) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); } @Test public void testAccessingSuperInstanceElement() { test( externs( lines( "/** @dict */", "class A {", " constructor() { }", "", " /** @param {number} x */", " ['g'](x) { };", "}")), srcs( lines( "/** @dict */", "class B extends A {", " constructor() { super(); }", "", " ['f']() { var t = super['g']; }", "}")), expected( lines( "class B extends A {", " constructor() {", " super();", " }", "", " ['f']() { var t = A.prototype['g']; }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); // A.prototype['g'] Node superGetelemReplacement = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // ['f'] .getSecondChild() // () { ... } .getLastChild() // { ... } .getFirstChild() // `var t = A.prototype['g'];` .getFirstChild() // `t = A.prototype['g']` .getOnlyChild(); // A.prototype['g'] assertNode(superGetelemReplacement) .hasToken(Token.GETELEM) .hasLineno(5) // position and length of `super['g']` .hasCharno(20) .hasLength(10); // getelem prevents us doing any better than unknown type assertNode(superGetelemReplacement).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype Node superReplacement = superGetelemReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(5) // position and length of `super` .hasCharno(20) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); } @Test public void testCannotAssignToSuperInstanceProperty() { testError( lines( "class A {", " constructor() { }", "", " /** @param {number} x */", " g(x) { }", "}", "", "class B extends A {", " constructor() { super(); }", "", " f() { super.g = 5; }", "}"), CANNOT_CONVERT_YET); } @Test public void testCannotAssignToSuperInstanceElement() { testError( lines( "/** @dict */", "class A {", " constructor() { }", "", " /** @param {number} x */", " ['g'](x) { }", "}", "", "class B extends A {", " constructor() { super(); }", "", " ['f']() { super['g'] = 5; }", "}"), CANNOT_CONVERT_YET); } // Static `super` resolution @Test public void testCallingSuperStaticProperty() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x @return {string} */", " static g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " static f() { super.g(3); }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " static f() { A.g.call(this, 3); }", "}"))); // get types we need to check Color classAType = findClassDefinition(getLastCompiler(), "A").getRootNode().getColor(); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); Color aDotGDotCallType = StandardColors.UNKNOWN; // colors do not track ".call" type Color classBType = findClassDefinition(getLastCompiler(), "B").getRootNode().getColor(); // A.g.call(this, 3) Node callNode = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // static f .getOnlyChild() // function that implements static f() {} .getLastChild() // method body .getFirstChild() // `A.g.call(this, 3);` .getOnlyChild(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(4) // position and length of `super.g(3)` .hasCharno(15) .hasLength(10); assertNode(callNode).hasColorThat().isEqualTo(StandardColors.STRING); // A.g.call Node callee = callNode.getFirstChild(); assertNode(callee) .matchesQualifiedName("A.g.call") .hasLineno(4) // position and length of `super.g` .hasCharno(21) .hasLength(1); assertNode(callee).hasColorThat().isEqualTo(aDotGDotCallType); // A.g Node superDotGReplacement = callee.getFirstChild(); assertNode(superDotGReplacement) .matchesQualifiedName("A.g") .hasLineno(4) // position and length of `super.g` .hasCharno(21) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A") .hasLineno(4) // position and length of `super` .hasCharno(15) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAType); Node thisNode = callee.getNext(); assertNode(thisNode).hasType(Token.THIS); assertNode(thisNode).hasColorThat().isEqualTo(classBType); } @Test public void testCallingSuperStaticElement() { test( externs( lines( "/** @dict */", "class A {", " constructor() { }", "", " /** @param {number} x */", " static ['g'](x) { };", "}")), srcs( lines( "/** @dict */", "class B extends A {", " constructor() { super(); }", "", " static ['f']() { super['g'](4); }", "}")), expected( lines( "class B extends A {", " constructor() {", " super();", " }", "", " static ['f']() { A['g'].call(this, 4); }", "}"))); // get types we need to check Color classAType = findClassDefinition(getLastCompiler(), "A").getRootNode().getColor(); Color classBType = findClassDefinition(getLastCompiler(), "B").getRootNode().getColor(); // A['g'].call(this, 4) Node callNode = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // static ['f']() { ... } .getSecondChild() // () { ... } .getLastChild() // { ... } .getFirstChild() // statement `A['g'].call(this, 4);` .getOnlyChild(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(5) // position and length of `super['g'](4)` .hasCharno(19) .hasLength(13); // computed property prevents doing any better than StandardColors.UNKNOWN assertNode(callNode).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A['g'].call Node callee = callNode.getFirstChild(); assertNode(callee) .hasToken(Token.GETPROP) .hasLineno(5) // position and length of `super['g']` .hasCharno(19) .hasLength(10); assertNode(callee).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A['g'] Node superGetelemReplacement = callee.getFirstChild(); assertNode(superGetelemReplacement) .hasToken(Token.GETELEM) .hasLineno(5) // position and length of `super['g']` .hasCharno(19) .hasLength(10); // computed property prevents doing any better than StandardColors.UNKNOWN assertNode(superGetelemReplacement).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A Node superReplacement = superGetelemReplacement.getFirstChild(); assertNode(superReplacement) .matchesName("A") .hasLineno(5) // position and length of `super` .hasCharno(19) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAType); // `this` node from `A['g'].call(this, 3)` Node thisNode = callee.getNext(); assertNode(thisNode) .hasToken(Token.THIS) .hasLineno(5) // position and length of `super['g']` .hasCharno(19) .hasLength(10) .isIndexable(false); // there's no direct correlation with text in the original source assertNode(thisNode).hasColorThat().isEqualTo(classBType); } @Test public void testAccessingSuperStaticProperty() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x */", " static g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " static f() { var t = super.g; }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " static f() { var t = A.g; }", "}"))); // get types we need to check Color classAType = findClassDefinition(getLastCompiler(), "A").getRootNode().getColor(); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); // A.prototype.g Node superDotGReplacement = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // f .getOnlyChild() // function that implements f() {} .getLastChild() // method body .getFirstChild() // `var t = A.g;` .getFirstChild() // `t = A.g` .getOnlyChild(); // A.g assertNode(superDotGReplacement) .matchesQualifiedName("A.g") .hasLineno(4) // position and length of `super.g` .hasCharno(29) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A.prototype Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A") .hasLineno(4) // position and length of `super` .hasCharno(23) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAType); } @Test public void testAccessingSuperStaticElement() { test( externs( lines( "/** @dict */", "class A {", " constructor() { }", "", " /** @param {number} x */", " static ['g'](x) { };", "}")), srcs( lines( "/** @dict */", "class B extends A {", " constructor() { super(); }", "", " static ['f']() { var t = super['g']; }", "}")), expected( lines( "class B extends A {", " constructor() {", " super();", " }", "", " static ['f']() { var t = A['g']; }", "}"))); // get types we need to check Color classAType = findClassDefinition(getLastCompiler(), "A").getRootNode().getColor(); // A.prototype.g Node superGetElemReplacement = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // ['f']() { ... } .getSecondChild() // () { ... } .getLastChild() // { ... } .getFirstChild() // `var t = A['g'];` .getFirstChild() // `t = A['g']` .getOnlyChild(); // `A['g']` assertNode(superGetElemReplacement) .hasToken(Token.GETELEM) .hasLineno(5) // position and length of `super['g']` .hasCharno(27) .hasLength(10); // computed property prevents doing any better than StandardColors.UNKNOWN assertNode(superGetElemReplacement).hasColorThat().isEqualTo(StandardColors.UNKNOWN); // A.prototype Node superReplacement = superGetElemReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A") .hasLineno(5) // position and length of `super` .hasCharno(27) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAType); } // Getters and setters @Test public void testResolvingSuperInGetter() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x @return {number} */", " g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " get f() { super.g(3); }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " get f() { A.prototype.g.call(this, 3); }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); Color aDotGDotCallType = StandardColors.UNKNOWN; // colors do not track ".call" type Color classBInstanceType = Color.createUnion( findClassDefinition(getLastCompiler(), "B") .getRootNode() .getColor() .getInstanceColors()); // A.prototype.g.call(this, 3) Node callNode = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // get f() { ... } .getOnlyChild() // () { ... } .getLastChild() // { ... } .getFirstChild() // statement `A.prototype.g.call(this, 3);` .getOnlyChild(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(4) // position and length of `super.g(3)` .hasCharno(12) .hasLength(10); assertNode(callNode).hasColorThat().isEqualTo(StandardColors.NUMBER); // A.prototype.g.call Node callee = callNode.getFirstChild(); assertNode(callee) .matchesQualifiedName("A.prototype.g.call") .hasLineno(4) // position and length of `super.g` .hasCharno(18) .hasLength(1); assertNode(callee).hasColorThat().isEqualTo(aDotGDotCallType); // A.prototype.g Node superDotGReplacement = callee.getFirstChild(); assertNode(superDotGReplacement) .matchesQualifiedName("A.prototype.g") .hasLineno(4) // position and length of `super.g` .hasCharno(18) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A.prototype Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(4) // position and length of `super` .hasCharno(12) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); // `this` node from `A.prototype.g.call(this, 3)` Node thisNode = callee.getNext(); assertNode(thisNode) .hasToken(Token.THIS) .hasLineno(4) // position and length of `super.g` .hasCharno(18) .hasLength(1) .isIndexable(false); // there's no direct correlation with text in the original source assertNode(thisNode).hasColorThat().isEqualTo(classBInstanceType); } @Test public void testResolvingSuperInSetter() { test( externs( lines( "class A {", " constructor() { }", "", " /** @param {number} x @return {string} */", " g(x) { }", "}")), srcs( lines( "class B extends A {", " constructor() { super(); }", "", " /** @param {number} x */", " set f(x) { super.g(x); }", "}")), expected( lines( "class B extends A {", " constructor() { super(); }", "", " set f(x) { A.prototype.g.call(this, x); }", "}"))); // get types we need to check Color classAPrototypeType = Color.createUnion( findClassDefinition(getLastCompiler(), "A").getRootNode().getColor().getPrototypes()); Color aDotGMethodType = findClassDefinition(getLastCompiler(), "A") .findMethodDefinition("g") .getRootNode() .getFirstChild() .getColor(); Color aDotGDotCallType = StandardColors.UNKNOWN; // colors do not track ".call" type Color classBInstanceType = Color.createUnion( findClassDefinition(getLastCompiler(), "B") .getRootNode() .getColor() .getInstanceColors()); // A.prototype.g.call(this, x) Node callNode = getLastCompiler() .getJsRoot() // root .getFirstChild() // script .getFirstChild() // class B .getLastChild() // class B's body .getLastChild() // set f(x) { ... } .getOnlyChild() // (x) { ... } .getLastChild() // { ... } .getFirstChild() // statement `A.prototype.g.call(this, x);` .getOnlyChild(); // CALL node within the statement assertNode(callNode) .hasToken(Token.CALL) .hasLineno(5) // position and length of `super.g(3)` .hasCharno(13) .hasLength(10); assertNode(callNode).hasColorThat().isEqualTo(StandardColors.STRING); // A.prototype.g.call Node callee = callNode.getFirstChild(); assertNode(callee) .matchesQualifiedName("A.prototype.g.call") .hasLineno(5) // position and length of `super.g` .hasCharno(19) .hasLength(1); assertNode(callee).hasColorThat().isEqualTo(aDotGDotCallType); // A.prototype.g Node superDotGReplacement = callee.getFirstChild(); assertNode(superDotGReplacement) .matchesQualifiedName("A.prototype.g") .hasLineno(5) // position and length of `super.g` .hasCharno(19) .hasLength(1); assertNode(superDotGReplacement).hasColorThat().isEqualTo(aDotGMethodType); // A.prototype Node superReplacement = superDotGReplacement.getFirstChild(); assertNode(superReplacement) .matchesQualifiedName("A.prototype") .hasLineno(5) // position and length of `super` .hasCharno(13) .hasLength(5) .hasOriginalName("super"); assertNode(superReplacement).hasColorThat().isEqualTo(classAPrototypeType); // `this` node from `A.prototype.g.call(this, 3)` Node thisNode = callee.getNext(); assertNode(thisNode) .hasToken(Token.THIS) .hasLineno(5) // position and length of `super.g` .hasCharno(19) .hasLength(1) .isIndexable(false); // there's no direct correlation with text in the original source assertNode(thisNode).hasColorThat().isEqualTo(classBInstanceType); } // Constructor synthesis @Test public void testSynthesizingConstructorOfBaseClassInSource() { test( externs(""), srcs( lines( "class A { }", // Force wrapping. "", "class B extends A {", " constructor() { super(); }", "}")), expected( lines( "class A {", " constructor() { }", "}", "", "class B extends A {", " constructor() { super(); }", "}"))); // class A { ... } Node classANode = findClassDefinition(getLastCompiler(), "A").getRootNode(); Color classAConstructorType = classANode.getColor(); // constructor() { } Node constructorMemberFunctionDefForA = classANode .getLastChild() // { ... } .getFirstChild(); assertNode(constructorMemberFunctionDefForA) .isMemberFunctionDef("constructor") .hasLineno(1) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(11) .isIndexable(false); assertNode(constructorMemberFunctionDefForA).hasColorThat().isEqualTo(classAConstructorType); Node constructorFunctionForA = constructorMemberFunctionDefForA.getOnlyChild(); assertNode(constructorFunctionForA) .hasToken(Token.FUNCTION) .hasLineno(1) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(11) .isIndexable(false); assertNode(constructorFunctionForA).hasColorThat().isEqualTo(classAConstructorType); } @Test public void testSynthesizingConstructorOfDerivedClassInSource() { test( externs(new TestExternsBuilder().addArguments().build()), srcs( lines( "class A {", // Force wrapping. " constructor() { }", "}", "", "class B extends A { }")), expected( lines( "class A {", " constructor() { }", "}", "", "class B extends A {", " constructor() { super(...arguments); }", "}"))); // class A { ... } Node classANode = findClassDefinition(getLastCompiler(), "A").getRootNode(); Color classAConstructorType = classANode.getColor(); // class B extends A { ... } Node classBNode = findClassDefinition(getLastCompiler(), "B").getRootNode(); Color classBConstructorType = classBNode.getColor(); Color classBInstanceType = Color.createUnion(classBConstructorType.getInstanceColors()); // constructor() { } Node constructorMemberFunctionDefForB = classBNode .getLastChild() // { ... } .getFirstChild(); assertNode(constructorMemberFunctionDefForB) .isMemberFunctionDef("constructor") .hasLineno(5) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(21) .isIndexable(false); assertNode(constructorMemberFunctionDefForB).hasColorThat().isEqualTo(classBConstructorType); Node constructorFunctionForB = constructorMemberFunctionDefForB.getOnlyChild(); assertNode(constructorFunctionForB) .hasToken(Token.FUNCTION) .hasLineno(5) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(21) .isIndexable(false); assertNode(constructorFunctionForB).hasColorThat().isEqualTo(classBConstructorType); // super(...arguments) Node superConstructorCall = constructorFunctionForB .getLastChild() // constructor body .getFirstChild() // expr_result statement .getOnlyChild(); assertNode(superConstructorCall) .hasToken(Token.CALL) .hasLineno(5) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(21) .isIndexable(false); assertNode(superConstructorCall).hasColorThat().isEqualTo(classBInstanceType); Node superNode = superConstructorCall.getFirstChild(); assertNode(superNode) .hasToken(Token.SUPER) .hasLineno(5) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(21) .isIndexable(false); assertNode(superNode).hasColorThat().isEqualTo(classAConstructorType); Node argumentsNode = superNode .getNext() // ...arguments .getOnlyChild(); assertNode(argumentsNode) .isName("arguments") .hasLineno(5) // synthetic constructor gets position and length of original class definition .hasCharno(0) .hasLength(21) .isIndexable(false); } @Test public void testSynthesizingConstructorOfBaseInterface() { test( externs(""), srcs("/** @interface */ class A { }"), expected("/** @interface */ class A { constructor() { } }")); // class A { ... } Node classANode = findClassDefinition(getLastCompiler(), "A").getRootNode(); Color classAConstructorType = classANode.getColor(); // constructor() { } Node constructorMemberFunctionDefForA = classANode .getLastChild() // { ... } .getFirstChild(); assertNode(constructorMemberFunctionDefForA) .isMemberFunctionDef("constructor") .hasLineno(1) // synthetic constructor gets position and length of original class definition .hasCharno(18) .hasLength(11) .isIndexable(false); assertNode(constructorMemberFunctionDefForA).hasColorThat().isEqualTo(classAConstructorType); Node constructorFunctionForA = constructorMemberFunctionDefForA.getOnlyChild(); assertNode(constructorFunctionForA) .hasToken(Token.FUNCTION) .hasLineno(1) // synthetic constructor gets position and length of original class definition .hasCharno(18) .hasLength(11) .isIndexable(false); assertNode(constructorFunctionForA).hasColorThat().isEqualTo(classAConstructorType); } @Test public void testSynthesizingConstructorOfDerivedInterface() { test( externs( lines( "/** @interface */", // Force wrapping. "class A {", " constructor() { }", "}")), srcs("/** @interface */ class B extends A { }"), expected( lines( "/** @interface */", // "class B extends A {", " constructor() { }", "}"))); } @Test public void testStrippingSuperCallFromConstructorOfDerivedInterface() { test( externs( lines( "const namespace = {};", "", "/** @interface */", "namespace.A = class {", " constructor() { }", "}")), srcs( lines( "/** @interface */", "class B extends namespace.A {", " constructor() { super(); }", "}")), expected( lines( "/** @interface */", // "class B extends namespace.A {", " constructor() { }", "}"))); } }
19,436
5,169
<filename>Specs/b/2/5/XPAlertView/0.0.1/XPAlertView.podspec.json { "name": "XPAlertView", "version": "0.0.1", "summary": "自用的swift版的AlertView不适配swift3.0", "description": "自用的swift版的AlertView不适配swift3.0", "homepage": "https://coding.net/u/JINY/p/XPAlertView/git/tree/master/XPAlertView", "license": "MIT", "authors": { "jinye": "<EMAIL>" }, "platforms": { "ios": "8.0" }, "source": { "git": "https://git.coding.net/JINY/XPAlertView.git", "tag": "0.0.1" }, "source_files": "XPAlertView/XPAlertView/XPAlertController.swift", "frameworks": "UIKit", "requires_arc": true }
296
320
#include <metal.hpp> #include "test.hpp" #define SEQ1(M) metal::list<VALUE(M)> #define COMBINE1(M) metal::list<ENUM(M, SEQ1)> #define SEQ2(N, M) metal::list<VALUE(M), VALUE(N)> #define COMBINE2_IMPL(M, N) ENUM(N, SEQ2, M) #define COMBINE2(M) metal::list<ENUM(M, COMBINE2_IMPL, M)> #define COMBINE(M, N) CAT(COMBINE, N)(M) #define MATRIX(M, N) \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), NUMBER(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, VALUE(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), NUMBER(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, NUMBER(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), NUMBER(N)>), (TRUE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, PAIR(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), NUMBER(N % 3)>), (TRUE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LIST(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), NUMBER(N % 3)>), (TRUE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, MAP(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), VALUE(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), NUMBER(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), PAIR(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), LIST(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), MAP(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), LAMBDA(N)>), (FALSE)); \ CHECK((metal::is_invocable<metal::lambda<metal::combine>, LAMBDA(M), LAMBDA(_)>), (FALSE)); \ CHECK((metal::combine<LIST(M), NUMBER(0)>), (metal::list<metal::list<>>)); \ CHECK((metal::combine<LIST(M), NUMBER(1)>), (COMBINE(M, 1))); \ CHECK((metal::combine<LIST(M), NUMBER(2)>), (COMBINE(M, 2))); \ /**/ GEN(MATRIX)
2,025
4,640
/* * 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.tvm; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; class NativeLibraryLoader { private static final String libPathInJar = "/lib/native/"; private static File tempDir; static { try { tempDir = File.createTempFile("tvm4j", ""); if (!tempDir.delete() || !tempDir.mkdir()) { throw new IOException("Couldn't create directory " + tempDir.getAbsolutePath()); } /* * Different cleanup strategies for Windows and Linux. * TODO: shutdown hook won't work on Windows */ if (!"Windows".equals(getUnifiedOSName())) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { for (File f : tempDir.listFiles()) { System.err.println("Deleting " + f.getAbsolutePath()); if (!f.delete()) { System.err.println("[WARN] Couldn't delete temporary file " + f.getAbsolutePath()); } } System.err.println("Deleting " + tempDir.getAbsolutePath()); if (!tempDir.delete()) { System.err.println( "[WARN] Couldn't delete temporary directory " + tempDir.getAbsolutePath()); } } }); } else { throw new RuntimeException("Windows not supported yet."); } } catch (IOException ex) { System.err.println("Couldn't create temporary directory: " + ex.getMessage()); throw new RuntimeException(ex); } } /** * Find the library as a resource in jar, copy it to a tempfile * and load it using System.load(). The name of the library has to be the * base name, it is mapped to the corresponding system name using * System.mapLibraryName(). e.g., the library "foo" is called "libfoo.so" * under Linux and "foo.dll" under Windows, but you just have to pass "foo" to * the loadLibrary(). * * @param libname basename of the library * @throws UnsatisfiedLinkError if library not found. * @throws IOException if file not found. */ public static void loadLibrary(String libname) throws UnsatisfiedLinkError, IOException { String mappedLibname = System.mapLibraryName(libname); String loadLibname = mappedLibname; if (mappedLibname.endsWith("dylib")) { System.err.println("Replaced .dylib with .jnilib"); loadLibname = mappedLibname.replace(".dylib", ".jnilib"); } System.err.println("Attempting to load " + loadLibname); extractResourceFileToTempDir(loadLibname, new Action() { @Override public void invoke(File target) { System.err.println("Loading library from " + target.getPath()); System.load(target.getPath()); } }); } /** * Translate all those Windows to "Windows". ("Windows XP", "Windows Vista", "Windows 7", etc.) */ private static String unifyOSName(String osname) { if (osname.startsWith("Windows")) { return "Windows"; } return osname; } private static String getUnifiedOSName() { return unifyOSName(System.getProperty("os.name")); } private static File createTempFile(String name) throws IOException { return new File(tempDir + File.separator + name); } static interface Action { public void invoke(File file); } /** * Copies the resource file to a temp file and do an action. * @param filename source file name (in lib/native). * @param action callback function to deal with the copied file. */ public static void extractResourceFileToTempDir(String filename, Action action) throws IOException { final String libFileInJar = libPathInJar + filename; InputStream is = NativeLibraryLoader.class.getResourceAsStream(libFileInJar); if (is == null) { throw new UnsatisfiedLinkError("Couldn't find the resource " + filename); } System.err.println(String.format("Loading %s from %s", filename, libPathInJar)); try { File tempfile = createTempFile(filename); OutputStream os = new FileOutputStream(tempfile); final long savedTime = System.currentTimeMillis(); byte[] buf = new byte[8192]; int len = is.read(buf); while (len > 0) { os.write(buf, 0, len); len = is.read(buf); } os.flush(); final FileInputStream lock = new FileInputStream(tempfile); os.close(); double seconds = (double) (System.currentTimeMillis() - savedTime) / 1e3; System.err.println(String.format("Copying took %.2f seconds.", seconds)); action.invoke(tempfile); lock.close(); } catch (IOException io) { System.err.println("[ERROR] Could not create the temp file: " + io.toString()); throw io; } catch (UnsatisfiedLinkError ule) { System.err.println("Couldn't load copied link file: " + ule.toString()); throw ule; } } }
2,030
1,137
<gh_stars>1000+ # Copyright (c) Facebook, Inc., its affiliates and Kakao Brain. All Rights Reserved import torch from fairseq.models.roberta import RobertaHubInterface, RobertaModel from pororo.tasks.tokenization import PororoTokenizationFactory from pororo.tasks.utils.download_utils import download_or_load class PosRobertaModel(RobertaModel): """ Helper class to load pre-trained models easily. And when you call load_hub_model, you can use brainbert models as same as RobertaHubInterface of fairseq. Methods ------- load_model(log_name: str): Load RobertaModel """ @classmethod def load_model(cls, model_name: str, lang: str, **kwargs): """ Load pre-trained model as RobertaHubInterface. :param model_name: model name from available_models :return: pre-trained model """ from fairseq import hub_utils # cache directory is treated as the home directory for both model and data files ckpt_dir = download_or_load(model_name, lang) x = hub_utils.from_pretrained( ckpt_dir, "model.pt", ckpt_dir, load_checkpoint_heads=True, **kwargs, ) return PosRobertaHubInterface( x["args"], x["task"], x["models"][0], lang, ) class PosRobertaHubInterface(RobertaHubInterface): def __init__(self, args, task, model, lang): super().__init__(args, task, model) self.bpe = PororoTokenizationFactory( task="tokenization", lang="ko", model="mecab_ko", ) self.bpe = self.bpe.load("cuda") def tokenize(self, sentence: str, add_special_tokens: bool = False): result = " ".join([token for token in self.bpe(sentence)]) return f"<s> {result} </s>" if add_special_tokens else result def fill_mask(self, masked_input: str, topk: int = 15): mask = "__" assert (mask in masked_input and masked_input.count(mask) == 1), "Please add one {0} token for the input".format(mask) text_spans = masked_input.split(mask) text_spans_bpe = ((" {0} ".format("<mask>")).join([ " ".join([ token if token != " " else "▃" for token in self.bpe(text_span.rstrip()) ]) for text_span in text_spans ]).strip()) tokens = self.task.source_dictionary.encode_line( "<s> " + text_spans_bpe + " </s>", append_eos=False, add_if_not_exist=False, ) masked_index = torch.nonzero( tokens == self.task.mask_idx, as_tuple=False, ) if tokens.dim() == 1: tokens = tokens.unsqueeze(0) with torch.no_grad(): features, _ = self.model( tokens.long().to(device=self.device), features_only=False, return_all_hiddens=False, ) logits = features[0, masked_index, :].squeeze() prob = logits.softmax(dim=0) _, index = prob.topk(k=topk, dim=0) topk_predicted_token_bpe = self.task.source_dictionary.string(index) return [bpe for bpe in topk_predicted_token_bpe.split()] def encode( self, sentence: str, *addl_sentences, add_special_tokens: bool = True, no_separator: bool = False, ) -> torch.LongTensor: bpe_sentence = self.tokenize( sentence, add_special_tokens=add_special_tokens, ) for s in addl_sentences: bpe_sentence += " </s>" if not no_separator and add_special_tokens else "" bpe_sentence += (" " + self.tokenize(s, add_special_tokens=False) + " </s>" if add_special_tokens else "") tokens = self.task.source_dictionary.encode_line( bpe_sentence, append_eos=False, add_if_not_exist=False, ) return tokens.long()
1,941
746
// 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.impala.analysis; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.hadoop.fs.Path; import org.apache.impala.catalog.MapType; import org.apache.impala.catalog.ScalarType; import org.apache.impala.catalog.StructField; import org.apache.impala.catalog.ArrayType; import org.apache.impala.catalog.StructType; import org.apache.impala.catalog.Type; import org.apache.impala.common.AnalysisException; import org.apache.impala.common.FileSystemUtil; import org.apache.impala.util.FileAnalysisUtil; import org.apache.orc.OrcFile; import org.apache.orc.OrcFile.ReaderOptions; import org.apache.orc.Reader; import org.apache.orc.TypeDescription; import org.apache.orc.TypeDescription.Category; import com.google.common.base.Preconditions; /** * Provides a helper function (extract()) which extracts the Impala schema from a given * ORC file. Details of the ORC types: * https://orc.apache.org/docs/types.html */ public class OrcSchemaExtractor { private final static String ERROR_MSG = "Failed to convert ORC type\n%s\nto an Impala %s type:\n%s\n"; /** * Validates the path and loads the ORC schema of the file. The ORC schema is also an * ORC type (TypeDescription), represented as a struct. */ private static TypeDescription loadOrcSchema(Path pathToFile) throws AnalysisException { FileAnalysisUtil.CheckIfFile(pathToFile); Reader reader = null; try { reader = OrcFile.createReader(pathToFile, new ReaderOptions(FileSystemUtil.getConfiguration())); } catch (IOException e) { // OrcFile.createReader throws IOException in case of any failure, including trying // to open a non-ORC file. throw new AnalysisException("Failed to open file as an ORC file: " + e); } return reader.getSchema(); } /** * Converts a primitive ORC type to an Impala Type. */ static private Type convertPrimitiveOrcType(TypeDescription type) { Category category = type.getCategory(); Preconditions.checkState(category.isPrimitive() || category.equals(Category.TIMESTAMP_INSTANT)); // ORC-790 switch (category) { case BINARY: return Type.STRING; case BOOLEAN: return Type.BOOLEAN; case BYTE: return Type.TINYINT; case CHAR: return ScalarType.createCharType(type.getMaxLength()); case DATE: return Type.DATE; case DECIMAL: return ScalarType.createDecimalType(type.getPrecision(), type.getScale()); case DOUBLE: return Type.DOUBLE; case FLOAT: return Type.FLOAT; case INT: return Type.INT; case LONG: return Type.BIGINT; case SHORT: return Type.SMALLINT; case STRING: return Type.STRING; case TIMESTAMP: return Type.TIMESTAMP; case TIMESTAMP_INSTANT: return Type.TIMESTAMP; case VARCHAR: return ScalarType.createVarcharType(type.getMaxLength()); default: Preconditions.checkState(false, "Unexpected ORC primitive type: " + category.getName()); return null; } } /** * Converts an ORC list type to an Impala array Type. An ORC list contains one child, * the TypeDescription of the elements. */ private static ArrayType convertArray(TypeDescription listType) throws AnalysisException { Preconditions.checkState(listType.getChildren().size() == 1); return new ArrayType(convertOrcType(listType.getChildren().get(0))); } /** * Converts an ORC map type to an Impala map Type. An ORC map contains two children, * the TypeDescriptions for the keys and values. */ private static MapType convertMap(TypeDescription mapType) throws AnalysisException { // ORC maps have two children, one for the keys, one for the values. Preconditions.checkState(mapType.getChildren().size() == 2); TypeDescription key = mapType.getChildren().get(0); TypeDescription value = mapType.getChildren().get(1); if (!key.getCategory().isPrimitive()) { throw new AnalysisException(String.format(ERROR_MSG, mapType.toString(), "MAP", "The key type of the MAP type must be primitive.")); } return new MapType(convertOrcType(key), convertOrcType(value)); } /** * Converts an ORC struct type to an Impala struct Type. */ private static StructType convertStruct(TypeDescription structType) throws AnalysisException { List<StructField> structFields = new ArrayList<>(); List<String> fieldNames = structType.getFieldNames(); List<TypeDescription> subTypes = structType.getChildren(); Preconditions.checkState(subTypes.size() == fieldNames.size()); for (int i = 0; i < subTypes.size(); i++) { StructField f = new StructField(fieldNames.get(i), convertOrcType(subTypes.get(i))); structFields.add(f); } return new StructType(structFields); } /** * Converts a non-primitive ORC type to an Impala Type. */ static private Type convertComplexOrcType(TypeDescription type) throws AnalysisException { Category category = type.getCategory(); Preconditions.checkState(!category.isPrimitive()); switch (category) { case LIST: return convertArray(type); case MAP: return convertMap(type); case STRUCT: return convertStruct(type); case UNION: throw new AnalysisException( "Unsupported ORC type UNION for field " + category.getName()); default: Preconditions.checkState(false, "Unexpected ORC primitive type: " + category.getName()); return null; } } /** * Converts an ORC type to an Impala Type. */ static private Type convertOrcType(TypeDescription type) throws AnalysisException { Category category = type.getCategory(); // TIMESTAMP_INSTANT is wrongly defined as a compound type (ORC-790). if (category.isPrimitive() || category.equals(Category.TIMESTAMP_INSTANT)) { return convertPrimitiveOrcType(type); } else { return convertComplexOrcType(type); } } /** * Parses an ORC file stored in HDFS and returns the corresponding Impala schema. * This fails with an analysis exception if any errors occur reading the file, * parsing the ORC schema, or if the ORC types cannot be represented in Impala. */ static public List<ColumnDef> extract(HdfsUri location) throws AnalysisException { List<ColumnDef> schema = new ArrayList<>(); TypeDescription orcSchema = loadOrcSchema(location.getPath()); // Returns a STRUCT. List<TypeDescription> subTypes = orcSchema.getChildren(); List<String> fieldNames = orcSchema.getFieldNames(); Preconditions.checkState(subTypes.size() == fieldNames.size()); for (int i = 0; i < subTypes.size(); i++) { TypeDescription orcType = subTypes.get(i); Type type = convertOrcType(orcType); Preconditions.checkNotNull(type); String colName = fieldNames.get(i); Map<ColumnDef.Option, Object> option = new HashMap<>(); option.put(ColumnDef.Option.COMMENT, "Inferred from ORC file."); schema.add(new ColumnDef(colName, new TypeDef(type), option)); } return schema; } }
2,695
62,208
package com.macro.mall.model; import java.util.ArrayList; import java.util.Date; import java.util.List; public class CmsSubjectExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public CmsSubjectExample() { oredCriteria = new ArrayList<>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andCategoryIdIsNull() { addCriterion("category_id is null"); return (Criteria) this; } public Criteria andCategoryIdIsNotNull() { addCriterion("category_id is not null"); return (Criteria) this; } public Criteria andCategoryIdEqualTo(Long value) { addCriterion("category_id =", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotEqualTo(Long value) { addCriterion("category_id <>", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThan(Long value) { addCriterion("category_id >", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) { addCriterion("category_id >=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThan(Long value) { addCriterion("category_id <", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThanOrEqualTo(Long value) { addCriterion("category_id <=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdIn(List<Long> values) { addCriterion("category_id in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotIn(List<Long> values) { addCriterion("category_id not in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdBetween(Long value1, Long value2) { addCriterion("category_id between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotBetween(Long value1, Long value2) { addCriterion("category_id not between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andTitleIsNull() { addCriterion("title is null"); return (Criteria) this; } public Criteria andTitleIsNotNull() { addCriterion("title is not null"); return (Criteria) this; } public Criteria andTitleEqualTo(String value) { addCriterion("title =", value, "title"); return (Criteria) this; } public Criteria andTitleNotEqualTo(String value) { addCriterion("title <>", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThan(String value) { addCriterion("title >", value, "title"); return (Criteria) this; } public Criteria andTitleGreaterThanOrEqualTo(String value) { addCriterion("title >=", value, "title"); return (Criteria) this; } public Criteria andTitleLessThan(String value) { addCriterion("title <", value, "title"); return (Criteria) this; } public Criteria andTitleLessThanOrEqualTo(String value) { addCriterion("title <=", value, "title"); return (Criteria) this; } public Criteria andTitleLike(String value) { addCriterion("title like", value, "title"); return (Criteria) this; } public Criteria andTitleNotLike(String value) { addCriterion("title not like", value, "title"); return (Criteria) this; } public Criteria andTitleIn(List<String> values) { addCriterion("title in", values, "title"); return (Criteria) this; } public Criteria andTitleNotIn(List<String> values) { addCriterion("title not in", values, "title"); return (Criteria) this; } public Criteria andTitleBetween(String value1, String value2) { addCriterion("title between", value1, value2, "title"); return (Criteria) this; } public Criteria andTitleNotBetween(String value1, String value2) { addCriterion("title not between", value1, value2, "title"); return (Criteria) this; } public Criteria andPicIsNull() { addCriterion("pic is null"); return (Criteria) this; } public Criteria andPicIsNotNull() { addCriterion("pic is not null"); return (Criteria) this; } public Criteria andPicEqualTo(String value) { addCriterion("pic =", value, "pic"); return (Criteria) this; } public Criteria andPicNotEqualTo(String value) { addCriterion("pic <>", value, "pic"); return (Criteria) this; } public Criteria andPicGreaterThan(String value) { addCriterion("pic >", value, "pic"); return (Criteria) this; } public Criteria andPicGreaterThanOrEqualTo(String value) { addCriterion("pic >=", value, "pic"); return (Criteria) this; } public Criteria andPicLessThan(String value) { addCriterion("pic <", value, "pic"); return (Criteria) this; } public Criteria andPicLessThanOrEqualTo(String value) { addCriterion("pic <=", value, "pic"); return (Criteria) this; } public Criteria andPicLike(String value) { addCriterion("pic like", value, "pic"); return (Criteria) this; } public Criteria andPicNotLike(String value) { addCriterion("pic not like", value, "pic"); return (Criteria) this; } public Criteria andPicIn(List<String> values) { addCriterion("pic in", values, "pic"); return (Criteria) this; } public Criteria andPicNotIn(List<String> values) { addCriterion("pic not in", values, "pic"); return (Criteria) this; } public Criteria andPicBetween(String value1, String value2) { addCriterion("pic between", value1, value2, "pic"); return (Criteria) this; } public Criteria andPicNotBetween(String value1, String value2) { addCriterion("pic not between", value1, value2, "pic"); return (Criteria) this; } public Criteria andProductCountIsNull() { addCriterion("product_count is null"); return (Criteria) this; } public Criteria andProductCountIsNotNull() { addCriterion("product_count is not null"); return (Criteria) this; } public Criteria andProductCountEqualTo(Integer value) { addCriterion("product_count =", value, "productCount"); return (Criteria) this; } public Criteria andProductCountNotEqualTo(Integer value) { addCriterion("product_count <>", value, "productCount"); return (Criteria) this; } public Criteria andProductCountGreaterThan(Integer value) { addCriterion("product_count >", value, "productCount"); return (Criteria) this; } public Criteria andProductCountGreaterThanOrEqualTo(Integer value) { addCriterion("product_count >=", value, "productCount"); return (Criteria) this; } public Criteria andProductCountLessThan(Integer value) { addCriterion("product_count <", value, "productCount"); return (Criteria) this; } public Criteria andProductCountLessThanOrEqualTo(Integer value) { addCriterion("product_count <=", value, "productCount"); return (Criteria) this; } public Criteria andProductCountIn(List<Integer> values) { addCriterion("product_count in", values, "productCount"); return (Criteria) this; } public Criteria andProductCountNotIn(List<Integer> values) { addCriterion("product_count not in", values, "productCount"); return (Criteria) this; } public Criteria andProductCountBetween(Integer value1, Integer value2) { addCriterion("product_count between", value1, value2, "productCount"); return (Criteria) this; } public Criteria andProductCountNotBetween(Integer value1, Integer value2) { addCriterion("product_count not between", value1, value2, "productCount"); return (Criteria) this; } public Criteria andRecommendStatusIsNull() { addCriterion("recommend_status is null"); return (Criteria) this; } public Criteria andRecommendStatusIsNotNull() { addCriterion("recommend_status is not null"); return (Criteria) this; } public Criteria andRecommendStatusEqualTo(Integer value) { addCriterion("recommend_status =", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusNotEqualTo(Integer value) { addCriterion("recommend_status <>", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusGreaterThan(Integer value) { addCriterion("recommend_status >", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusGreaterThanOrEqualTo(Integer value) { addCriterion("recommend_status >=", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusLessThan(Integer value) { addCriterion("recommend_status <", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusLessThanOrEqualTo(Integer value) { addCriterion("recommend_status <=", value, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusIn(List<Integer> values) { addCriterion("recommend_status in", values, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusNotIn(List<Integer> values) { addCriterion("recommend_status not in", values, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusBetween(Integer value1, Integer value2) { addCriterion("recommend_status between", value1, value2, "recommendStatus"); return (Criteria) this; } public Criteria andRecommendStatusNotBetween(Integer value1, Integer value2) { addCriterion("recommend_status not between", value1, value2, "recommendStatus"); return (Criteria) this; } public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; } public Criteria andCreateTimeIsNotNull() { addCriterion("create_time is not null"); return (Criteria) this; } public Criteria andCreateTimeEqualTo(Date value) { addCriterion("create_time =", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotEqualTo(Date value) { addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThan(Date value) { addCriterion("create_time >", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThan(Date value) { addCriterion("create_time <", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThanOrEqualTo(Date value) { addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeIn(List<Date> values) { addCriterion("create_time in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotIn(List<Date> values) { addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeBetween(Date value1, Date value2) { addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotBetween(Date value1, Date value2) { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andCollectCountIsNull() { addCriterion("collect_count is null"); return (Criteria) this; } public Criteria andCollectCountIsNotNull() { addCriterion("collect_count is not null"); return (Criteria) this; } public Criteria andCollectCountEqualTo(Integer value) { addCriterion("collect_count =", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountNotEqualTo(Integer value) { addCriterion("collect_count <>", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountGreaterThan(Integer value) { addCriterion("collect_count >", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountGreaterThanOrEqualTo(Integer value) { addCriterion("collect_count >=", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountLessThan(Integer value) { addCriterion("collect_count <", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountLessThanOrEqualTo(Integer value) { addCriterion("collect_count <=", value, "collectCount"); return (Criteria) this; } public Criteria andCollectCountIn(List<Integer> values) { addCriterion("collect_count in", values, "collectCount"); return (Criteria) this; } public Criteria andCollectCountNotIn(List<Integer> values) { addCriterion("collect_count not in", values, "collectCount"); return (Criteria) this; } public Criteria andCollectCountBetween(Integer value1, Integer value2) { addCriterion("collect_count between", value1, value2, "collectCount"); return (Criteria) this; } public Criteria andCollectCountNotBetween(Integer value1, Integer value2) { addCriterion("collect_count not between", value1, value2, "collectCount"); return (Criteria) this; } public Criteria andReadCountIsNull() { addCriterion("read_count is null"); return (Criteria) this; } public Criteria andReadCountIsNotNull() { addCriterion("read_count is not null"); return (Criteria) this; } public Criteria andReadCountEqualTo(Integer value) { addCriterion("read_count =", value, "readCount"); return (Criteria) this; } public Criteria andReadCountNotEqualTo(Integer value) { addCriterion("read_count <>", value, "readCount"); return (Criteria) this; } public Criteria andReadCountGreaterThan(Integer value) { addCriterion("read_count >", value, "readCount"); return (Criteria) this; } public Criteria andReadCountGreaterThanOrEqualTo(Integer value) { addCriterion("read_count >=", value, "readCount"); return (Criteria) this; } public Criteria andReadCountLessThan(Integer value) { addCriterion("read_count <", value, "readCount"); return (Criteria) this; } public Criteria andReadCountLessThanOrEqualTo(Integer value) { addCriterion("read_count <=", value, "readCount"); return (Criteria) this; } public Criteria andReadCountIn(List<Integer> values) { addCriterion("read_count in", values, "readCount"); return (Criteria) this; } public Criteria andReadCountNotIn(List<Integer> values) { addCriterion("read_count not in", values, "readCount"); return (Criteria) this; } public Criteria andReadCountBetween(Integer value1, Integer value2) { addCriterion("read_count between", value1, value2, "readCount"); return (Criteria) this; } public Criteria andReadCountNotBetween(Integer value1, Integer value2) { addCriterion("read_count not between", value1, value2, "readCount"); return (Criteria) this; } public Criteria andCommentCountIsNull() { addCriterion("comment_count is null"); return (Criteria) this; } public Criteria andCommentCountIsNotNull() { addCriterion("comment_count is not null"); return (Criteria) this; } public Criteria andCommentCountEqualTo(Integer value) { addCriterion("comment_count =", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountNotEqualTo(Integer value) { addCriterion("comment_count <>", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountGreaterThan(Integer value) { addCriterion("comment_count >", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountGreaterThanOrEqualTo(Integer value) { addCriterion("comment_count >=", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountLessThan(Integer value) { addCriterion("comment_count <", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountLessThanOrEqualTo(Integer value) { addCriterion("comment_count <=", value, "commentCount"); return (Criteria) this; } public Criteria andCommentCountIn(List<Integer> values) { addCriterion("comment_count in", values, "commentCount"); return (Criteria) this; } public Criteria andCommentCountNotIn(List<Integer> values) { addCriterion("comment_count not in", values, "commentCount"); return (Criteria) this; } public Criteria andCommentCountBetween(Integer value1, Integer value2) { addCriterion("comment_count between", value1, value2, "commentCount"); return (Criteria) this; } public Criteria andCommentCountNotBetween(Integer value1, Integer value2) { addCriterion("comment_count not between", value1, value2, "commentCount"); return (Criteria) this; } public Criteria andAlbumPicsIsNull() { addCriterion("album_pics is null"); return (Criteria) this; } public Criteria andAlbumPicsIsNotNull() { addCriterion("album_pics is not null"); return (Criteria) this; } public Criteria andAlbumPicsEqualTo(String value) { addCriterion("album_pics =", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsNotEqualTo(String value) { addCriterion("album_pics <>", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsGreaterThan(String value) { addCriterion("album_pics >", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsGreaterThanOrEqualTo(String value) { addCriterion("album_pics >=", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsLessThan(String value) { addCriterion("album_pics <", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsLessThanOrEqualTo(String value) { addCriterion("album_pics <=", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsLike(String value) { addCriterion("album_pics like", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsNotLike(String value) { addCriterion("album_pics not like", value, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsIn(List<String> values) { addCriterion("album_pics in", values, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsNotIn(List<String> values) { addCriterion("album_pics not in", values, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsBetween(String value1, String value2) { addCriterion("album_pics between", value1, value2, "albumPics"); return (Criteria) this; } public Criteria andAlbumPicsNotBetween(String value1, String value2) { addCriterion("album_pics not between", value1, value2, "albumPics"); return (Criteria) this; } public Criteria andDescriptionIsNull() { addCriterion("description is null"); return (Criteria) this; } public Criteria andDescriptionIsNotNull() { addCriterion("description is not null"); return (Criteria) this; } public Criteria andDescriptionEqualTo(String value) { addCriterion("description =", value, "description"); return (Criteria) this; } public Criteria andDescriptionNotEqualTo(String value) { addCriterion("description <>", value, "description"); return (Criteria) this; } public Criteria andDescriptionGreaterThan(String value) { addCriterion("description >", value, "description"); return (Criteria) this; } public Criteria andDescriptionGreaterThanOrEqualTo(String value) { addCriterion("description >=", value, "description"); return (Criteria) this; } public Criteria andDescriptionLessThan(String value) { addCriterion("description <", value, "description"); return (Criteria) this; } public Criteria andDescriptionLessThanOrEqualTo(String value) { addCriterion("description <=", value, "description"); return (Criteria) this; } public Criteria andDescriptionLike(String value) { addCriterion("description like", value, "description"); return (Criteria) this; } public Criteria andDescriptionNotLike(String value) { addCriterion("description not like", value, "description"); return (Criteria) this; } public Criteria andDescriptionIn(List<String> values) { addCriterion("description in", values, "description"); return (Criteria) this; } public Criteria andDescriptionNotIn(List<String> values) { addCriterion("description not in", values, "description"); return (Criteria) this; } public Criteria andDescriptionBetween(String value1, String value2) { addCriterion("description between", value1, value2, "description"); return (Criteria) this; } public Criteria andDescriptionNotBetween(String value1, String value2) { addCriterion("description not between", value1, value2, "description"); return (Criteria) this; } public Criteria andShowStatusIsNull() { addCriterion("show_status is null"); return (Criteria) this; } public Criteria andShowStatusIsNotNull() { addCriterion("show_status is not null"); return (Criteria) this; } public Criteria andShowStatusEqualTo(Integer value) { addCriterion("show_status =", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusNotEqualTo(Integer value) { addCriterion("show_status <>", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusGreaterThan(Integer value) { addCriterion("show_status >", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusGreaterThanOrEqualTo(Integer value) { addCriterion("show_status >=", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusLessThan(Integer value) { addCriterion("show_status <", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusLessThanOrEqualTo(Integer value) { addCriterion("show_status <=", value, "showStatus"); return (Criteria) this; } public Criteria andShowStatusIn(List<Integer> values) { addCriterion("show_status in", values, "showStatus"); return (Criteria) this; } public Criteria andShowStatusNotIn(List<Integer> values) { addCriterion("show_status not in", values, "showStatus"); return (Criteria) this; } public Criteria andShowStatusBetween(Integer value1, Integer value2) { addCriterion("show_status between", value1, value2, "showStatus"); return (Criteria) this; } public Criteria andShowStatusNotBetween(Integer value1, Integer value2) { addCriterion("show_status not between", value1, value2, "showStatus"); return (Criteria) this; } public Criteria andForwardCountIsNull() { addCriterion("forward_count is null"); return (Criteria) this; } public Criteria andForwardCountIsNotNull() { addCriterion("forward_count is not null"); return (Criteria) this; } public Criteria andForwardCountEqualTo(Integer value) { addCriterion("forward_count =", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountNotEqualTo(Integer value) { addCriterion("forward_count <>", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountGreaterThan(Integer value) { addCriterion("forward_count >", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountGreaterThanOrEqualTo(Integer value) { addCriterion("forward_count >=", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountLessThan(Integer value) { addCriterion("forward_count <", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountLessThanOrEqualTo(Integer value) { addCriterion("forward_count <=", value, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountIn(List<Integer> values) { addCriterion("forward_count in", values, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountNotIn(List<Integer> values) { addCriterion("forward_count not in", values, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountBetween(Integer value1, Integer value2) { addCriterion("forward_count between", value1, value2, "forwardCount"); return (Criteria) this; } public Criteria andForwardCountNotBetween(Integer value1, Integer value2) { addCriterion("forward_count not between", value1, value2, "forwardCount"); return (Criteria) this; } public Criteria andCategoryNameIsNull() { addCriterion("category_name is null"); return (Criteria) this; } public Criteria andCategoryNameIsNotNull() { addCriterion("category_name is not null"); return (Criteria) this; } public Criteria andCategoryNameEqualTo(String value) { addCriterion("category_name =", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameNotEqualTo(String value) { addCriterion("category_name <>", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameGreaterThan(String value) { addCriterion("category_name >", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameGreaterThanOrEqualTo(String value) { addCriterion("category_name >=", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameLessThan(String value) { addCriterion("category_name <", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameLessThanOrEqualTo(String value) { addCriterion("category_name <=", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameLike(String value) { addCriterion("category_name like", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameNotLike(String value) { addCriterion("category_name not like", value, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameIn(List<String> values) { addCriterion("category_name in", values, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameNotIn(List<String> values) { addCriterion("category_name not in", values, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameBetween(String value1, String value2) { addCriterion("category_name between", value1, value2, "categoryName"); return (Criteria) this; } public Criteria andCategoryNameNotBetween(String value1, String value2) { addCriterion("category_name not between", value1, value2, "categoryName"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
16,931
1,088
# Copyright 2021 Alibaba Group Holding Limited. 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. # ============================================================================= from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import numpy as np import tensorflow as tf from graphlearn.python.nn.tf.layers.ego_rgcn_conv import EgoRGCNConv class EgoRGCNTestCase(unittest.TestCase): @classmethod def setUpClass(cls): pass @classmethod def tearDownClass(cls): pass def setUp(self): pass def tearDown(self): pass def test_base_decomposition(self): batch_size = 32 in_dim = [8, 16] out_dim = 8 num_relations = 2 hop1 = 5 rgcn = EgoRGCNConv('rgcn1', in_dim, out_dim, num_relations, num_bases=2, num_blocks=None) x = tf.convert_to_tensor(np.array( np.random.random([batch_size, in_dim[0]]), dtype=np.float32)) hop1_1 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) hop1_2 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) neighbor = [hop1_1, hop1_2] out = rgcn.forward(x, neighbor, hop1) with tf.Session() as sess: sess.run(tf.local_variables_initializer()) sess.run(tf.global_variables_initializer()) out = sess.run(out) self.assertListEqual([batch_size, out_dim], list(out.shape)) def test_block_decomposition(self): batch_size = 32 in_dim = [8, 16] out_dim = 8 num_relations = 2 hop1 = 5 rgcn = EgoRGCNConv('rgcn2', in_dim, out_dim, num_relations, num_bases=None, num_blocks=2) x = tf.convert_to_tensor(np.array( np.random.random([batch_size, in_dim[0]]), dtype=np.float32)) hop1_1 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) hop1_2 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) neighbor = [hop1_1, hop1_2] out = rgcn.forward(x, neighbor, hop1) with tf.Session() as sess: sess.run(tf.local_variables_initializer()) sess.run(tf.global_variables_initializer()) out = sess.run(out) self.assertListEqual([batch_size, out_dim], list(out.shape)) def test_no_regularization(self): batch_size = 32 in_dim = [8, 16] out_dim = 8 num_relations = 2 hop1 = 5 rgcn = EgoRGCNConv('rgcn3', in_dim, out_dim, num_relations) x = tf.convert_to_tensor(np.array( np.random.random([batch_size, in_dim[0]]), dtype=np.float32)) hop1_1 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) hop1_2 = tf.convert_to_tensor(np.array( np.random.random([batch_size * hop1, in_dim[1]]), dtype=np.float32)) neighbor = [hop1_1, hop1_2] out = rgcn.forward(x, neighbor, hop1) with tf.Session() as sess: sess.run(tf.local_variables_initializer()) sess.run(tf.global_variables_initializer()) out = sess.run(out) self.assertListEqual([batch_size, out_dim], list(out.shape)) if __name__ == "__main__": unittest.main()
1,572
1,319
import numpy as np import os import cv2 import time import utils_func # defined functions # Input directory img_dir = '../../intermediate_result/data/data_ori/test_data/' # frames dir extracted from videos bbox_path = '../../intermediate_result/det_result/result_10frame_detmodel2_5w/' # detection result dir mask_dir = '../../intermediate_result/mask/mask-diff/' # mask dir # Output directory result_dir = '../../intermediate_result/pixel_track/coarse_ddet/' # Thresholds frame_rate = 10 len_time_thre = 40 # minimum abnormal duration (seconds) suspiciou_time_thre = 20 # minimum suspiciou abnormal duration (seconds) detect_thred = 3 # the normal-suspicious state transition threshold no_detect_thred = 3 # the suspicious/abnormal-normal state transition threshold anomely_score_thred = 0.7 # anomely score threshold bbox_thres = 0.7 # Detection confidence threshold traceback_thres = 400 # backtrack time threshold iou_thres = 0.1 # iou score threshold raio_thres = 0.6 # relaxed constraint satisfaction ratio # Traverse all videos for video_id in range(1, 101): print('video_id: ', video_id) video_name = str(video_id) + '/' # Output dir if not os.path.exists(result_dir + str(video_id) + "/"): os.makedirs(result_dir + str(video_id) + "/") f_pre_out = open(res_dir_path + "pre_" + str(video_id) + '.txt', 'w') # Get image list img_names = os.listdir(os.path.join(img_dir, video_name)) img_names.sort() im = cv2.imread(os.path.join(img_dir, video_name, img_names[0].split(".npy")[0])) h, w, c = im.shape # Read masks try: mask = cv2.imread(mask_dir + "mask_" + str(video_id).zfill(3) + '.jpg', 0) mask[mask > 0] = 1 has_mask = True except: has_mask = False print('has_mask: ', has_mask) # -- Read detection results frame by frame -- dt_results_fbf = {} for img_name in img_names: npy_name = img_name + '.npy' im_info = np.load(os.path.join(bbox_path, str(video_id) + "/" + npy_name), allow_pickle=True) bbox_num = len(im_info) if img_name not in dt_results_fbf: dt_results_fbf[img_name] = [] for j in range(0, bbox_num): bbox_ = im_info[j][0] score_ = im_info[j][1] if score_ > bbox_thres: dt_results_fbf[img_name].append([int(float(bbox_[0])), int(float(bbox_[1])), int(float(bbox_[0] + bbox_[2])), int(float(bbox_[1] + bbox_[3])), float(score_)]) # [x1, y1, x2, y2, score] # -- Define info six spatial-temporal information matrices -- detect_count_matrix = np.zeros((h, w)) no_detect_count_matrix = np.zeros((h, w)) start_time_matrix = np.zeros((h, w), dtype=int) end_time_matrix = np.zeros((h, w), dtype=int) state_matrix = np.zeros((h, w), dtype=int) score_matrix = np.zeros((h, w)) # Init anomaly all_results = [] anomely_now = {} start = 0 tmp_start = 0 # --- Traverse all frames in a video --- for img_name in img_names: img_name = img_name.split(".npy")[0] t = time.time() img_path = os.path.join(img_dir, video_name, img_name) frame = cv2.imread(img_path) # -*- -*- spatial matrices -*- -*- # 1. Init spatial matrices by detection result tmp_detect = np.zeros((h, w)) # get ddet state for each pixel tmp_score = np.zeros((h, w)) # get top ddet score for each pixel for box in dt_results_fbf[img_name]: if box[3] - box[1] > 0 and box[2] - box[0] > 0: tmp_detect[box[1]:box[3], box[0]:box[2]] = 1 tmp_score[int(float(box[1])):int(float(box[3])), int(float(box[0])):int(float(box[2]))] \ = np.maximum(box[4], tmp_score[int(float(box[1])):int(float(box[3])), int(float(box[0])):int(float(box[2]))]) # 2. Mask filtering tmp_no_detect = 1 - tmp_detect if has_mask == True: tmp_detect = tmp_detect * mask tmp_no_detect = tmp_no_detect * mask tmp_score = tmp_score * mask # 3. Update spatial matrices detect_count_matrix += tmp_detect no_detect_count_matrix += tmp_no_detect no_detect_count_matrix[tmp_detect > 0] = 0 # if detected, clear no_detect_count score_matrix += tmp_score # -*- -*- temporal matrices -*- -*- # 4. Update temporal matrices start_time_matrix[detect_count_matrix == 1] = int(str(img_name).split('.jpg')[0].split('_')[2]) end_time_matrix[detect_count_matrix > 0] = int(str(img_name).split('.jpg')[0].split('_')[2]) state_matrix[detect_count_matrix > detect_thred] = 1 # 5. Detect anomaly by temporal matrices time_delay = end_time_matrix - start_time_matrix time_delay = time_delay * state_matrix index = np.unravel_index(time_delay.argmax(), time_delay.shape) # find # -*- -*- anomaly judgement -*- -*- # 1. normality to anomaly transition if np.max(time_delay) / frame_rate > len_time_thre and start == 0: # find a longest-delay box time_frame = start_time_matrix[index] G = detect_count_matrix.copy() G[G < detect_count_matrix[index] - 2] = 0 G[G > 0] = 1 region = utils_func.search_region(G, index) # connected region max_iou = 0 # IOU between anomaly and boxes in frames previously count = 1 # relaxed satisfaction num tmp_len = 1 # frame num raio = 0.0 # relaxed satisfaction ratio anomely_now['region'] = region start_time = time_frame # backtrack the start time (Algorithm 2 Pixel-level Backtrack methods.) while (max_iou > iou_thres or tmp_len < traceback_thres or raio > raio_thres) and time_frame >= 3: raio = float(count) / float(tmp_len) max_iou = 0 similarity_PSNR = 0 # PSNR similarity similarity_color = 0 # color histogram similarity key_time_frame = 'test_'+str(video_id)+'_'+str(time_frame).zfill(5)+'.jpg' # previous frames if key_time_frame in dt_results_fbf: for box_i in dt_results_fbf[key_time_frame]: # overlapped max_iou = max(max_iou, utils_func.compute_iou(anomely_now['region'], np.array(box_i))) # non-overlapped try: # box in previous frames prev_im = cv2.imread(img_dir + str(video_id) + "/" + key_time_frame) prev_bbox = prev_im[box_i[1]:box_i[3], box_i[0]:box_i[2], :] # box(connected region) in anomaly now_im = cv2.imread(img_dir + str(video_id) + "/test_" + str(video_id) + "_" + \ str(int(anomely_now['start_time'] * frame_rate / 3) * 3 + 3).zfill(5) + ".jpg") now_bbox = now_im[anomely_now['region'][1]:anomely_now['region'][3], \ anomely_now['region'][0]:anomely_now['region'][2], :] # restrictions for eliminating disturbances (shape, position) if prev_bbox.shape[0] * prev_bbox.shape[1] < 100 \ or (box_i[1]-anomely_now['region'][1]) > 3*max(prev_bbox.shape[0], now_bbox.shape[0]) \ or (box_i[0]-anomely_now['region'][0]) > 3*max(prev_bbox.shape[1], now_bbox.shape[1]) \ or (abs(prev_bbox.shape[0] - now_bbox.shape[0]) / float(prev_bbox.shape[0]) > 0.1 \ and abs(prev_bbox.shape[1] - now_bbox.shape[1]) / float(prev_bbox.shape[1]) > 0.1): pass else: # calculate similarities similarity_PSNR = max(similarity_PSNR, utils_func.psnr(now_bbox, prev_bbox)) similarity_color = max(similarity_color, utils_func.compare_similar_hist( \ utils_func.calc_bgr_hist(now_bbox), \ utils_func.calc_bgr_hist(prev_bbox))) except: continue # relaxed constraints to deal with discontinuous detection results # relaxed threshold if max_iou > 0.3 or similarity_PSNR > 18 or similarity_color > 0.88: count += 1 # update threshold if max_iou > 0.5 or similarity_PSNR > 20 or similarity_color > 0.9: start_time = time_frame time_frame -= 3 tmp_len += 1 time_frame = start_time # update the start/end time anomely_now['start_time'] = max(0, start_time / frame_rate) anomely_now['end_time'] = max(0, end_time_matrix[index] / frame_rate) start = 1 # 2. normality to suspicious anomaly transition elif np.max(time_delay) / frame_rate > suspiciou_time_thre and tmp_start == 0: time_frame = int(start_time_matrix[index]) G = detect_count_matrix.copy() G[G < detect_count_matrix[index] - 2] = 0 G[G > 0] = 1 region = utils_func.search_region(G, index) anomely_now['region'] = region # (No backtrack process here compared with normality to anomaly transition) anomely_now['start_time'] = max(0, time_frame / frame_rate) anomely_now['end_time'] = max(0, end_time_matrix[index] / frame_rate) tmp_start = 1 # 3. anomaly to normality transition if np.max(time_delay) / frame_rate > len_time_thre and start == 1: if no_detect_count_matrix[index] > no_detect_thred: anomely_score = score_matrix[index] / detect_count_matrix[index] if anomely_score > anomely_score_thred: anomely_now['end_time'] = end_time_matrix[index] / frame_rate anomely_now['score'] = anomely_score # record candidates and clear anomely_now all_results.append(anomely_now) anomely_now = {} start = 0 # 4. suspicious anomaly to normality transition elif np.max(time_delay) / frame_rate > suspiciou_time_thre and tmp_start == 1: if no_detect_count_matrix[index] > no_detect_thred: anomely_score = score_matrix[index] / detect_count_matrix[index] if anomely_score > anomely_score_thred: anomely_now['end_time'] = end_time_matrix[index] / frame_rate anomely_now['score'] = anomely_score # (no record candidates here) tmp_start = 0 # update matrices state_matrix[no_detect_count_matrix > no_detect_thred] = 0 no_detect_count_matrix[no_detect_count_matrix > no_detect_thred] = 0 tmp_detect = tmp_detect + state_matrix tmp_detect[tmp_detect > 1] = 1 detect_count_matrix = detect_count_matrix * tmp_detect score_matrix = score_matrix * tmp_detect # record candidates and clear anomely_now if np.max(time_delay) / frame_rate > len_time_thre and start == 1: anomely_score = score_matrix[index] / detect_count_matrix[index] if anomely_score > anomely_score_thred: anomely_now['end_time'] = end_time_matrix[index] / frame_rate anomely_now['score'] = anomely_score all_results.append(anomely_now) anomely_now = {} start = 0 # --- sort and write results --- last_time = [] for item in all_results: last_time.append([item["start_time"], item["end_time"], item["region"]]) last_time.sort() if last_time: for i in range(len(last_time)): # write (starttime, endtime, bbox) to txt f_pre_out.write(str(last_time[i][0]) + " " + \ str(last_time[i][1]) + " " + \ str(last_time[i][2]) + "\n") f_pre_out.close()
6,528
15,193
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' Pre-configured tile sources for common third party tile services. get_provider Use this function to retrieve an instance of a predefined tile provider. .. warning:: get_provider is deprecated as of Bokeh 3.0.0 and will be removed in a future release. Use ``add_tile`` directly instead. Args: provider_name (Union[str, Vendors, xyzservices.TileProvider]) Name of the tile provider to supply. Use a ``tile_providers.Vendors`` enumeration value, or the string name of one of the known providers. Use :class:`xyzservices.TileProvider` to pass custom tile providers. Returns: WMTSTileProviderSource: The desired tile provider instance Raises: ValueError, if the specified provider can not be found Example: .. code-block:: python >>> from bokeh.tile_providers import get_provider, Vendors >>> get_provider(Vendors.CARTODBPOSITRON) <class 'bokeh.models.tiles.WMTSTileSource'> >>> get_provider('CARTODBPOSITRON') <class 'bokeh.models.tiles.WMTSTileSource'> >>> import xyzservices.providers as xyz >>> get_provider(xyz.CartoDB.Positron) <class 'bokeh.models.tiles.WMTSTileSource'> The available built-in tile providers are listed in the ``Vendors`` enum: .. bokeh-enum:: Vendors :module: bokeh.tile_providers :noindex: .. warning:: The built-in Vendors are deprecated as of Bokeh 3.0.0 and will be removed in a future release. You can pass the same strings to ``add_tile`` directly. Any of these values may be be passed to the ``get_provider`` function in order to obtain a tile provider to use with a Bokeh plot. Representative samples of each tile provider are shown below. CARTODBPOSITRON --------------- Tile Source for CartoDB Tile Service .. raw:: html <img src="https://tiles.basemaps.cartocdn.com/light_all/14/2627/6331.png" /> CARTODBPOSITRON_RETINA ---------------------- Tile Source for CartoDB Tile Service (tiles at 'retina' resolution) .. raw:: html <img src="https://tiles.basemaps.cartocdn.com/light_all/14/2627/[email protected]" /> ESRI_IMAGERY ------------ Tile Source for ESRI public tiles. .. raw:: html <img src="https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/14/6331/2627.jpg" /> OSM --- Tile Source for Open Street Maps. .. raw:: html <img src="https://c.tile.openstreetmap.org/14/2627/6331.png" /> STAMEN_TERRAIN -------------- Tile Source for Stamen Terrain Service .. raw:: html <img src="https://stamen-tiles.a.ssl.fastly.net/terrain/14/2627/6331.png" /> STAMEN_TERRAIN_RETINA --------------------- Tile Source for Stamen Terrain Service (tiles at 'retina' resolution) .. raw:: html <img src="https://stamen-tiles.a.ssl.fastly.net/terrain/14/2627/[email protected]" /> STAMEN_TONER ------------ Tile Source for Stamen Toner Service .. raw:: html <img src="https://stamen-tiles.a.ssl.fastly.net/toner/14/2627/6331.png" /> STAMEN_TONER_BACKGROUND ----------------------- Tile Source for Stamen Toner Background Service which does not include labels .. raw:: html <img src="https://stamen-tiles.a.ssl.fastly.net/toner-background/14/2627/6331.png" /> STAMEN_TONER_LABELS ------------------- Tile Source for Stamen Toner Service which includes only labels .. raw:: html <img src="https://stamen-tiles.a.ssl.fastly.net/toner-labels/14/2627/6331.png" /> ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import annotations import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports import sys import types # External imports # __all__ defined at the bottom on the class module import xyzservices # Bokeh imports from bokeh.core.enums import enumeration # Bokeh imports from .util.deprecation import deprecated #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- class _TileProvidersModule(types.ModuleType): def deprecated_vendors(): deprecated((3, 0, 0), "tile_providers module", "add_tile directly") return enumeration('CARTODBPOSITRON', 'CARTODBPOSITRON_RETINA', 'STAMEN_TERRAIN', 'STAMEN_TERRAIN_RETINA', 'STAMEN_TONER', 'STAMEN_TONER_BACKGROUND', 'STAMEN_TONER_LABELS', 'OSM', 'ESRI_IMAGERY', case_sensitive=True) Vendors = deprecated_vendors() def get_provider(self, provider_name): deprecated((3, 0, 0), "get_provider", "add_tile directly") from bokeh.models import WMTSTileSource if isinstance(provider_name, WMTSTileSource): # This allows `get_provider(CARTODBPOSITRON)` to work return WMTSTileSource(url=provider_name.url, attribution=provider_name.attribution) if isinstance(provider_name, str): provider_name = provider_name.lower() if provider_name == "esri_imagery": provider_name = "esri_worldimagery" if provider_name == "osm": provider_name = "openstreetmap_mapnik" if "retina" in provider_name: provider_name = provider_name.replace("retina", "") retina = True else: retina = False scale_factor = "@2x" if retina else None provider_name = xyzservices.providers.query_name(provider_name) else: scale_factor = None if isinstance(provider_name, xyzservices.TileProvider): return WMTSTileSource( url=provider_name.build_url(scale_factor=scale_factor), attribution=provider_name.html_attribution, min_zoom=provider_name.get("min_zoom", 0), max_zoom=provider_name.get("max_zoom", 30), ) # Properties -------------------------------------------------------------- CARTODBPOSITRON = Vendors.CARTODBPOSITRON CARTODBPOSITRON_RETINA = Vendors.CARTODBPOSITRON_RETINA STAMEN_TERRAIN = Vendors.STAMEN_TERRAIN STAMEN_TERRAIN_RETINA = Vendors.STAMEN_TERRAIN_RETINA STAMEN_TONER = Vendors.STAMEN_TONER STAMEN_TONER_BACKGROUND = Vendors.STAMEN_TONER_BACKGROUND STAMEN_TONER_LABELS = Vendors.STAMEN_TONER_LABELS OSM = Vendors.OSM ESRI_IMAGERY = Vendors.ESRI_IMAGERY #----------------------------------------------------------------------------- # Code #----------------------------------------------------------------------------- _mod = _TileProvidersModule("bokeh.tile_providers") _mod.__doc__ = __doc__ _mod.__all__ = ( 'CARTODBPOSITRON', 'CARTODBPOSITRON_RETINA', 'STAMEN_TERRAIN', 'STAMEN_TERRAIN_RETINA', 'STAMEN_TONER', 'STAMEN_TONER_BACKGROUND', 'STAMEN_TONER_LABELS', 'OSM', 'ESRI_IMAGERY', 'get_provider', 'Vendors' ) sys.modules['bokeh.tile_providers'] = _mod del _mod, sys, types
2,992
1,292
/** * */ package org.sikuli.guide; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JLabel; public class SikuliGuideText extends SikuliGuideComponent { static final int SHADOW_SIZE = 10; static final int DEFAULT_MAXIMUM_WIDTH = 300; String text; JLabel label; public SikuliGuideText(String text){ super(); this.text = text; label = new JLabel(); add(label); setMaximumWidth(DEFAULT_MAXIMUM_WIDTH); updateLabel(); } public void setMaximumWidth(int max_width){ this.max_width = max_width; updateLabel(); updateSize(); } public void setText(String text){ this.text = text; updateLabel(); } public String getText(){ return text; } void updateLabel(){ String htmltxt = "<html><div style='" + getStyleString() + "'>" + text + "</div></html>"; label.setText(htmltxt); Dimension size = label.getPreferredSize(); if (size.width > max_width){ // hack to limit the width of the text to width htmltxt = "<html><div style='width:" + max_width + ";" + getStyleString() + "'>" + text + "</div></html>"; label.setText(htmltxt); } updateSize(); } void updateSize(){ Dimension size = label.getPreferredSize(); label.setSize(size); setActualSize(size); } int fontSize = 12; int max_width = Integer.MAX_VALUE; String getStyleString(){ //return "font-size:"+fontSize+"px;color:white;background-color:#333333;padding:3px"; //return "font-size:"+fontSize+"px;color:black;background-color:#FFF1A8;padding:3px"; return "font-size:"+fontSize+"px;color:black;background-color:#FFFF00;padding:3px"; } public void setFontSize(int i) { fontSize = i; updateLabel(); } public void paintComponent(Graphics g){ Dimension originalSize = label.getPreferredSize(); Dimension actualSize = getActualSize(); float scalex = 1f * actualSize.width / originalSize.width; float scaley = 1f * actualSize.height / originalSize.height; ((Graphics2D) g).scale(scalex, scaley); super.paintComponent(g); } TextPropertyEditor ed = null; public void setEditable(boolean editable){ if (editable){ }else{ // this.getParent().remove(ed); } } }
1,087
1,014
package com.github.neuralnetworks.samples.server; import java.util.List; import com.github.neuralnetworks.util.Environment; import com.github.neuralnetworks.util.RuntimeConfiguration; /** * This class allow to run a test (that you copy into the function JUnitOnServerStarter#jUnitTest() ) via command line with different epochs on different devices and all or a specific configuration * (from JUnitOnServerStarter#runtimeConfigurations()). * * @author tmey */ public abstract class JUnitOnServerStarter { public abstract List<RuntimeConfiguration[]> runtimeConfigurations(); public abstract void jUnitTest(int epochs, String folder); /** * * @param configuration * 0 to test all configurations, between 1 and number of configuration to use a specific configuration * @param epochs * must be greater than zero! * @param preferredDevice * <0 to not use it otherwise it is used */ public void startTests(int configuration, int epochs, int preferredDevice, String folder) { if (epochs <= 0) { throw new IllegalArgumentException("number of epochs must be greater than zero!"); } List<RuntimeConfiguration[]> runtimeConfigurations = runtimeConfigurations(); if (configuration != 0 && configuration < 1 && configuration <= runtimeConfigurations.size()) { throw new IllegalArgumentException("configuration number must be between 1 and " + runtimeConfigurations.size() + " or you don't set it to use all configurations!"); } if (configuration == 0) { for (int i = 0; i < runtimeConfigurations.size(); i++) { Environment.getInstance().setRuntimeConfiguration(runtimeConfigurations.get(i)[0]); // device!! if (preferredDevice >= 0) { Environment.getInstance().getRuntimeConfiguration().getOpenCLConfiguration().setPreferredDevice(preferredDevice); } jUnitTest(epochs, folder); } } else { Environment.getInstance().setRuntimeConfiguration(runtimeConfigurations.get(configuration - 1)[0]); // device!! if (preferredDevice >= 0) { Environment.getInstance().getRuntimeConfiguration().getOpenCLConfiguration().setPreferredDevice(preferredDevice); } jUnitTest(epochs, folder); } } public void startTestFromCommandLine(String[] args) { if (args.length < 1 || args.length > 4) { System.out.println("first argument the epochs, second the configuration (optional), third preferred device (optional, need second parameter)!"); return; } int epochs = Integer.parseInt(args[0]); int configuration = 0; if (args.length >= 2) { configuration = Integer.parseInt(args[1]); } int preferredDevice = -1; if (args.length >= 3) { preferredDevice = Integer.parseInt(args[2]); } String folder = ""; if (args.length >= 4) { folder = args[3]; } startTests(configuration, epochs, preferredDevice, folder); } }
934
14,668
// Copyright 2020 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 CHROMEOS_UI_FRAME_DESKS_MOVE_TO_DESKS_MENU_MODEL_H_ #define CHROMEOS_UI_FRAME_DESKS_MOVE_TO_DESKS_MENU_MODEL_H_ #include "ui/base/models/simple_menu_model.h" namespace chromeos { // A menu model that builds the contents of the Move to Desks menu. class MoveToDesksMenuModel : public ui::SimpleMenuModel { public: // The command id for showing the Move to Desks menu. This is an arbitrary // number that must not collide with other command ids. If this needs to be // updated, choose an unused number. static constexpr int kMenuCommandId = 40800; // If `add_title` is true, a title will be added to the Move to Desks menu. // Should be set to true if this is a standalone menu and not a submenu. explicit MoveToDesksMenuModel( std::unique_ptr<ui::SimpleMenuModel::Delegate> delegate, bool add_title = false); MoveToDesksMenuModel(const MoveToDesksMenuModel&) = delete; MoveToDesksMenuModel& operator=(const MoveToDesksMenuModel&) = delete; ~MoveToDesksMenuModel() override; // To avoid colliding with other command ids, start the sequence of command // ids from |kMenuCommandId| + 1. Also give them explicit values to make the // command ids more discoverable. See crbug.com/1222475. enum CommandId { MOVE_TO_DESK_1 = 40801, MOVE_TO_DESK_2 = 40802, MOVE_TO_DESK_3 = 40803, MOVE_TO_DESK_4 = 40804, MOVE_TO_DESK_5 = 40805, MOVE_TO_DESK_6 = 40806, MOVE_TO_DESK_7 = 40807, MOVE_TO_DESK_8 = 40808, TOGGLE_ASSIGN_TO_ALL_DESKS = 40809, }; // SimpleMenuModel: bool MayHaveMnemonicsAt(int index) const override; private: // A menu delegate used to determine which labels are shown and enabled. Also // handles how different command ids are handled. std::unique_ptr<ui::SimpleMenuModel::Delegate> delegate_; // This is the index of the assign to all desks item in the menu model. int assign_to_all_desks_item_index_; }; } // namespace chromeos #endif // CHROMEOS_UI_FRAME_DESKS_MOVE_TO_DESKS_MENU_MODEL_H_
762
1,056
<reponame>timfel/netbeans /* * 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.netbeans.modules.sampler; import java.awt.Dialog; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import org.junit.*; import static org.junit.Assert.*; import org.netbeans.junit.MockServices; import org.netbeans.junit.NbTestCase; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.Exceptions; /** * * @author <NAME> */ public class SamplerTest { @BeforeClass public static void setUpClass() throws Exception { //register DialogDisplayer which "pushes" Yes option in the document save dialog MockServices.setServices(DD.class); } @AfterClass public static void tearDownClass() throws Exception { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of createSampler method, of class Sampler. */ @Test public void testCreateSampler() { System.out.println("createSampler"); String name = "test"; Sampler result = Sampler.createSampler(name); assertNotNull(result); } /** * Test of createManualSampler method, of class Sampler. */ @Test public void testCreateManualSampler() { System.out.println("createManualSampler"); String name = "gentest"; Sampler result = Sampler.createManualSampler(name); assertNotNull(result); } /** * Test of cancel method, of class Sampler. */ @Test public void testCancel() { System.out.println("cancel"); Sampler instance = Sampler.createManualSampler("cancel"); instance.start(); instance.cancel(); } /** * Test of stopAndWriteTo method, of class Sampler. */ @Test public void testStopAndWriteTo() throws IOException { System.out.println("stopAndWriteTo"); ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); Sampler instance = Sampler.createSampler("cancel"); instance.start(); instance.stopAndWriteTo(dos); dos.close(); // there should no data in out, since stopAndWriteTo is // invoked immediately after start assertTrue(out.size() == 0); } /** * Test of stopAndWriteTo method, of class Sampler. */ @Test public void testStopAndWriteTo1() throws IOException { System.out.println("stopAndWriteTo1"); ByteArrayOutputStream out = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(out); Sampler instance = Sampler.createSampler("cancel"); instance.start(); longRunningMethod(); instance.stopAndWriteTo(dos); dos.close(); // make sure we have some sampling data assertTrue(out.size() > 0); } private void longRunningMethod() { for (int i=0; i<100;i++) { try { Thread.sleep(30); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } } } /** * Test of stop method, of class Sampler. */ @Test public void testStop() { System.out.println("stop"); Sampler instance = Sampler.createManualSampler("stop"); DD.hasData = false; instance.start(); longRunningMethod(); instance.stop(); assert(DD.hasData); } /** Our own dialog displayer. */ public static final class DD extends DialogDisplayer { static boolean hasData; @Override public Dialog createDialog(DialogDescriptor descriptor) { throw new IllegalStateException ("Not implemented"); } @Override public Object notify(NotifyDescriptor descriptor) { hasData = true; return null; } } // end of DD }
1,860
324
/* * 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.jclouds.cloudstack.features; import java.util.Set; import org.jclouds.cloudstack.domain.ResourceLimit; import org.jclouds.cloudstack.internal.BaseCloudStackApiLiveTest; import org.testng.annotations.Test; /** * Tests behavior of {@code LimitApi} */ @Test(groups = "live", singleThreaded = true, testName = "LimitApiLiveTest") public class LimitApiLiveTest extends BaseCloudStackApiLiveTest { public void testListResourceLimits() { final Set<ResourceLimit> resourceLimits = client.getLimitApi().listResourceLimits(); for (ResourceLimit resourceLimit : resourceLimits) { checkResourceLimit(resourceLimit); } } private void checkResourceLimit(ResourceLimit resourceLimit) { assert resourceLimit.getAccount() != null : resourceLimit; assert resourceLimit.getDomain() != null : resourceLimit; assert resourceLimit.getResourceType() != ResourceLimit.ResourceType.UNRECOGNIZED : resourceLimit; } }
498
2,338
// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \ // RUN: -config='{CheckOptions: [ \ // RUN: {key: readability-identifier-naming.ParameterCase, value: CamelCase}, \ // RUN: {key: readability-identifier-naming.IgnoreMainLikeFunctions, value: true} \ // RUN: ]}' int mainLike(int argc, char **argv); int mainLike(int argc, char **argv, const char **env); int mainLike(int argc, const char **argv); int mainLike(int argc, const char **argv, const char **env); int mainLike(int argc, char *argv[]); int mainLike(int argc, const char *argv[]); int mainLike(int argc, char *argv[], char *env[]); int mainLike(int argc, const char *argv[], const char *env[]); void notMain(int argc, char **argv); // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:31: warning: invalid case style for parameter 'argv' void notMain(int argc, char **argv, char **env); // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:31: warning: invalid case style for parameter 'argv' // CHECK-MESSAGES: :[[@LINE-3]]:44: warning: invalid case style for parameter 'env' int notMain(int argc, char **argv, char **env, int Extra); // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:30: warning: invalid case style for parameter 'argv' // CHECK-MESSAGES: :[[@LINE-3]]:43: warning: invalid case style for parameter 'env' int notMain(int argc, char **argv, int Extra); // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:30: warning: invalid case style for parameter 'argv' int notMain(int argc, char *argv); // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:29: warning: invalid case style for parameter 'argv' int notMain(unsigned argc, char **argv); // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:35: warning: invalid case style for parameter 'argv' int notMain(long argc, char *argv); // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:30: warning: invalid case style for parameter 'argv' int notMain(int argc, char16_t **argv); // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:34: warning: invalid case style for parameter 'argv' int notMain(int argc, char argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:28: warning: invalid case style for parameter 'argv' typedef char myFunChar; typedef int myFunInt; typedef char **myFunCharPtr; typedef long myFunLong; myFunInt mainLikeTypedef(myFunInt argc, myFunChar **argv); int mainLikeTypedef(int argc, myFunCharPtr argv); int notMainTypedef(myFunLong argc, char **argv); // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:43: warning: invalid case style for parameter 'argv' // Don't flag as name contains the word main int myMainFunction(int argc, char *argv[]); // This is fine, named with wmain and has wchar ptr. int wmainLike(int argc, wchar_t *argv[]); // Flag this as has signature of main, but named as wmain. int wmainLike(int argc, char *argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:31: warning: invalid case style for parameter 'argv' struct Foo { Foo(int argc, char *argv[]) {} // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:23: warning: invalid case style for parameter 'argv' int mainPub(int argc, char *argv[]); static int mainPubStatic(int argc, char *argv[]); protected: int mainProt(int argc, char *argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:32: warning: invalid case style for parameter 'argv' static int mainProtStatic(int argc, char *argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:45: warning: invalid case style for parameter 'argv' private: int mainPriv(int argc, char *argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:32: warning: invalid case style for parameter 'argv' static int mainPrivStatic(int argc, char *argv[]); // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: invalid case style for parameter 'argc' // CHECK-MESSAGES: :[[@LINE-2]]:45: warning: invalid case style for parameter 'argv' };
1,785
1,056
/* * 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.netbeans.modules.refactoring.java.plugins; import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.PrimitiveTypeTree; import com.sun.source.tree.Tree; import com.sun.source.util.TreePath; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.LinkedList; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Logger; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.type.TypeKind; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.TreePathHandle; import org.netbeans.modules.refactoring.api.Problem; import org.netbeans.modules.refactoring.api.ProgressEvent; import org.netbeans.modules.refactoring.api.RenameRefactoring; import org.netbeans.modules.refactoring.java.RefactoringUtils; import org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin; import org.netbeans.modules.refactoring.java.ui.JavaRenameProperties; import org.netbeans.modules.refactoring.spi.RefactoringElementsBag; import org.netbeans.spi.gototest.TestLocator; import org.netbeans.spi.gototest.TestLocator.LocationResult; import org.openide.filesystems.FileObject; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.lookup.Lookups; /** * * @author <NAME> */ public class RenameTestClassRefactoringPlugin extends JavaRefactoringPlugin { public static final EnumSet<ElementKind> SUPPORTED = EnumSet.of(ElementKind.CLASS, ElementKind.ENUM, ElementKind.INTERFACE, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD); private RenameRefactoring refactoring; private TreePathHandle treePathHandle; private RenameRefactoring[] renameDelegates; /** Creates a new instance of RenamePropertyRefactoringPlugin */ public RenameTestClassRefactoringPlugin(RenameRefactoring rename) { this.refactoring = rename; treePathHandle = rename.getRefactoringSource().lookup(TreePathHandle.class); } @Override protected JavaSource getJavaSource(Phase phase) { return JavaSource.forFileObject(treePathHandle.getFileObject()); } @Override public Problem checkParameters() { if (!isRenameTestClass() && !isRenameTestClassMethod()) { return null; } initDelegates(); Problem p = null; for (RenameRefactoring delegate : renameDelegates) { p = JavaPluginUtils.chainProblems(p, delegate.checkParameters()); if (p != null && p.isFatal()) { return p; } } return JavaPluginUtils.chainProblems(p, super.checkParameters()); } @Override public Problem fastCheckParameters() { if (!isRenameTestClass() && !isRenameTestClassMethod()) { return null; } initDelegates(); Problem p = null; for (RenameRefactoring delegate : renameDelegates) { FileObject delegateFile = delegate.getRefactoringSource().lookup(FileObject.class); if(!isRenameTestClassMethod()) { delegate.setNewName(newName(treePathHandle.getFileObject(), delegateFile, refactoring.getNewName())); } p = JavaPluginUtils.chainProblems(p, delegate.fastCheckParameters()); if (p != null && p.isFatal()) { return p; } } return JavaPluginUtils.chainProblems(p, super.fastCheckParameters()); } @Override protected Problem preCheck(CompilationController javac) throws IOException { if (!isRenameTestClass() && !isRenameTestClassMethod()) { return null; } initDelegates(); Problem p = null; for (RenameRefactoring delegate : renameDelegates) { p = JavaPluginUtils.chainProblems(p, delegate.preCheck()); if (p != null && p.isFatal()) { return p; } } return JavaPluginUtils.chainProblems(p, super.preCheck(javac)); } @Override public Problem prepare(RefactoringElementsBag reb) { if (!isRenameTestClass() && !isRenameTestClassMethod()) { return null; } initDelegates(); fireProgressListenerStart(ProgressEvent.START, renameDelegates.length); Problem p = null; for (RenameRefactoring delegate : renameDelegates) { p = JavaPluginUtils.chainProblems(p, delegate.prepare(reb.getSession())); if (p != null && p.isFatal()) { return p; } fireProgressListenerStep(); } fireProgressListenerStop(); return p; } private boolean isRenameTestClass() { JavaRenameProperties renameProps = refactoring.getContext().lookup(JavaRenameProperties.class); if (renameProps != null && renameProps.isIsRenameTestClass()) { return true; } return false; } private boolean isRenameTestClassMethod() { JavaRenameProperties renameProps = refactoring.getContext().lookup(JavaRenameProperties.class); if (renameProps != null && renameProps.isIsRenameTestClassMethod()) { return true; } return false; } private boolean inited = false; private void initDelegates() { if (inited) { return; } final List<RenameRefactoring> renameRefactoringsList = Collections.synchronizedList(new LinkedList<RenameRefactoring>()); final ElementKind elementKind = treePathHandle.getElementHandle().getKind(); if(SUPPORTED.contains(elementKind)) { final FileObject fileObject = treePathHandle.getFileObject(); Collection<? extends TestLocator> testLocators = Lookup.getDefault().lookupAll(TestLocator.class); for (final TestLocator testLocator : testLocators) { if(testLocator.appliesTo(fileObject)) { if(testLocator.asynchronous()) { CountDownLatch latch = new CountDownLatch(1); testLocator.findOpposite(fileObject, -1, new TestLocator.LocationListener() { @Override public void foundLocation(FileObject fo, LocationResult location) { try { if(elementKind == ElementKind.CLASS) { addIfMatch(location, testLocator, fo, renameRefactoringsList); } else if(elementKind == ElementKind.METHOD) { addIfMatchMethod(location, testLocator, renameRefactoringsList); } } finally { latch.countDown(); } } }); try { latch.await(10000000000L, TimeUnit.NANOSECONDS); } catch (InterruptedException ex) { Logger.getLogger(RenamePropertyRefactoringPlugin.class.getName()) .fine("Finding test class took too long, or it was interupted"); //NOI18N } } else { LocationResult location = testLocator.findOpposite(fileObject, -1); if (elementKind == ElementKind.METHOD) { addIfMatchMethod(location, testLocator, renameRefactoringsList); } else { addIfMatch(location, testLocator, fileObject, renameRefactoringsList); } } } } } renameDelegates = renameRefactoringsList.toArray(new RenameRefactoring[0]); inited = true; } private static String newName(FileObject testedFile, FileObject testFile, String newName) { String testedName = testedFile.getName(); String testName = testFile.getName(); return testName.replace(testedName, newName); } private void addIfMatch(LocationResult location, final TestLocator testLocator, final FileObject fileObject, final List<RenameRefactoring> renameRefactoringsList) { if(location.getFileObject() != null && testLocator.getFileType(location.getFileObject()).equals(TestLocator.FileType.TEST)) { RenameRefactoring renameRefactoring = new RenameRefactoring(Lookups.singleton(location.getFileObject())); renameRefactoring.setNewName(newName(fileObject, location.getFileObject(), refactoring.getNewName())); renameRefactoring.setSearchInComments(true); renameRefactoringsList.add(renameRefactoring); } } private void addIfMatchMethod(final LocationResult location, final TestLocator testLocator, final List<RenameRefactoring> renameRefactoringsList) { if(location.getFileObject() != null && testLocator.getFileType(location.getFileObject()).equals(TestLocator.FileType.TEST)) { try { JavaSource.forFileObject(location.getFileObject()).runUserActionTask(new Task<CompilationController>() { @Override public void run(CompilationController javac) throws Exception { javac.toPhase(JavaSource.Phase.RESOLVED); final Element methodElement = treePathHandle.resolveElement(javac); String methodName = methodElement.getSimpleName().toString(); String testMethodName = RefactoringUtils.getTestMethodName(methodName); CompilationUnitTree cut = javac.getCompilationUnit(); Tree classTree = cut.getTypeDecls().get(0); List<? extends Tree> members = ((ClassTree) classTree).getMembers(); for (int i = 0; i < members.size(); i++) { Tree member = members.get(i); if(member.getKind() != Tree.Kind.METHOD) { continue; } MethodTree methodTree = (MethodTree) member; if (methodTree.getName().contentEquals(testMethodName) && methodTree.getReturnType().getKind() == Tree.Kind.PRIMITIVE_TYPE && ((PrimitiveTypeTree) methodTree.getReturnType()).getPrimitiveTypeKind() == TypeKind.VOID) { // test method should at least be void classTree = ((ClassTree) classTree).getMembers().get(i); TreePath tp = TreePath.getPath(cut, classTree); RenameRefactoring renameRefactoring = new RenameRefactoring(Lookups.singleton(TreePathHandle.create(tp, javac))); renameRefactoring.setNewName(RefactoringUtils.getTestMethodName(refactoring.getNewName())); renameRefactoring.setSearchInComments(true); renameRefactoringsList.add(renameRefactoring); break; } } } }, true); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } } }
5,376
3,172
# Copyright (c) 2018 PaddlePaddle Authors. 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 cloudpickle import subprocess import os from parl.utils import SerializeError, DeserializeError __all__ = ['dumps_argument', 'loads_argument', 'dumps_return', 'loads_return'] try: import pyarrow pyarrow_installed = True except ImportError: pyarrow_installed = False if pyarrow_installed: # Reference: https://github.com/apache/arrow/blob/f88474c84e7f02e226eb4cc32afef5e2bbc6e5b4/python/pyarrow/tests/test_serialization.py#L658-L682 def _serialize_serializable(obj): return {"type": type(obj), "data": obj.__dict__} def _deserialize_serializable(obj): val = obj["type"].__new__(obj["type"]) val.__dict__.update(obj["data"]) return val context = pyarrow.default_serialization_context() # support deserialize in another environment context.set_pickle(cloudpickle.dumps, cloudpickle.loads) # support serialize and deserialize custom class context.register_type( object, "object", custom_serializer=_serialize_serializable, custom_deserializer=_deserialize_serializable) # if pyarrow is installed, parl will use pyarrow to serialize/deserialize objects. serialize = lambda data: pyarrow.serialize(data, context=context).to_buffer() deserialize = lambda data: pyarrow.deserialize(data, context=context) else: # if pyarrow is not installed, parl will use cloudpickle to serialize/deserialize objects. serialize = lambda data: cloudpickle.dumps(data) deserialize = lambda data: cloudpickle.loads(data) def dumps_argument(*args, **kwargs): """ Serialize arguments passed to a function. args: *args, **kwargs are general a commonly used representation of arguments in python. Returns: Implementation-dependent object in bytes. """ try: ret = serialize([args, kwargs]) except Exception as e: raise SerializeError(e) return ret def loads_argument(data): """ Restore bytes data to their initial data formats. Args: data: the output of `dumps_argument`. Returns: deserialized arguments [args, kwargs] like the input of `dumps_argument`, args is a tuple, and kwargs is a dict """ try: ret = deserialize(data) except Exception as e: raise DeserializeError(e) return ret def dumps_return(data): """ Serialize the return data of a function. Args: data: the output of a function. Returns: Implementation-dependent object in bytes. """ try: ret = serialize(data) except Exception as e: raise SerializeError(e) return ret def loads_return(data): """ Deserialize the data generated by `dumps_return`. Args: data: the output of `dumps_return` Returns: deserialized data """ try: ret = deserialize(data) except Exception as e: raise DeserializeError(e) return ret
1,291
590
from functools import partial from graphql.utilities import build_schema from graphql.validation.rules.possible_type_extensions import PossibleTypeExtensionsRule from .harness import assert_sdl_validation_errors assert_errors = partial(assert_sdl_validation_errors, PossibleTypeExtensionsRule) assert_valid = partial(assert_errors, errors=[]) def describe_validate_possible_type_extensions(): def no_extensions(): assert_valid( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject """ ) def one_extension_per_type(): assert_valid( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject extend scalar FooScalar @dummy extend type FooObject @dummy extend interface FooInterface @dummy extend union FooUnion @dummy extend enum FooEnum @dummy extend input FooInputObject @dummy """ ) def many_extensions_per_type(): assert_valid( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject extend scalar FooScalar @dummy extend type FooObject @dummy extend interface FooInterface @dummy extend union FooUnion @dummy extend enum FooEnum @dummy extend input FooInputObject @dummy extend scalar FooScalar @dummy extend type FooObject @dummy extend interface FooInterface @dummy extend union FooUnion @dummy extend enum FooEnum @dummy extend input FooInputObject @dummy """ ) def extending_unknown_type(): message = ( "Cannot extend type 'Unknown' because it is not defined." " Did you mean 'Known'?" ) assert_errors( """ type Known extend scalar Unknown @dummy extend type Unknown @dummy extend interface Unknown @dummy extend union Unknown @dummy extend enum Unknown @dummy extend input Unknown @dummy """, [ {"message": message, "locations": [(4, 27)]}, {"message": message, "locations": [(5, 25)]}, {"message": message, "locations": [(6, 30)]}, {"message": message, "locations": [(7, 26)]}, {"message": message, "locations": [(8, 25)]}, {"message": message, "locations": [(9, 26)]}, ], ) def does_not_consider_non_type_definitions(): message = "Cannot extend type 'Foo' because it is not defined." assert_errors( """ query Foo { __typename } fragment Foo on Query { __typename } directive @Foo on SCHEMA extend scalar Foo @dummy extend type Foo @dummy extend interface Foo @dummy extend union Foo @dummy extend enum Foo @dummy extend input Foo @dummy """, [ {"message": message, "locations": [(6, 27)]}, {"message": message, "locations": [(7, 25)]}, {"message": message, "locations": [(8, 30)]}, {"message": message, "locations": [(9, 26)]}, {"message": message, "locations": [(10, 25)]}, {"message": message, "locations": [(11, 26)]}, ], ) def extending_with_different_kinds(): assert_errors( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject extend type FooScalar @dummy extend interface FooObject @dummy extend union FooInterface @dummy extend enum FooUnion @dummy extend input FooEnum @dummy extend scalar FooInputObject @dummy """, [ { "message": "Cannot extend non-object type 'FooScalar'.", "locations": [(2, 13), (9, 13)], }, { "message": "Cannot extend non-interface type 'FooObject'.", "locations": [(3, 13), (10, 13)], }, { "message": "Cannot extend non-union type 'FooInterface'.", "locations": [(4, 13), (11, 13)], }, { "message": "Cannot extend non-enum type 'FooUnion'.", "locations": [(5, 13), (12, 13)], }, { "message": "Cannot extend non-input object type 'FooEnum'.", "locations": [(6, 13), (13, 13)], }, { "message": "Cannot extend non-scalar type 'FooInputObject'.", "locations": [(7, 13), (14, 13)], }, ], ) def extending_types_within_existing_schema(): schema = build_schema( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject """ ) sdl = """ extend scalar FooScalar @dummy extend type FooObject @dummy extend interface FooInterface @dummy extend union FooUnion @dummy extend enum FooEnum @dummy extend input FooInputObject @dummy """ assert_valid(sdl, schema=schema) def extending_unknown_types_within_existing_schema(): schema = build_schema("type Known") sdl = """ extend scalar Unknown @dummy extend type Unknown @dummy extend interface Unknown @dummy extend union Unknown @dummy extend enum Unknown @dummy extend input Unknown @dummy """ message = ( "Cannot extend type 'Unknown' because it is not defined." " Did you mean 'Known'?" ) assert_errors( sdl, [ {"message": message, "locations": [(2, 27)]}, {"message": message, "locations": [(3, 25)]}, {"message": message, "locations": [(4, 30)]}, {"message": message, "locations": [(5, 26)]}, {"message": message, "locations": [(6, 25)]}, {"message": message, "locations": [(7, 26)]}, ], schema, ) def extending_types_with_different_kinds_within_existing_schema(): schema = build_schema( """ scalar FooScalar type FooObject interface FooInterface union FooUnion enum FooEnum input FooInputObject """ ) sdl = """ extend type FooScalar @dummy extend interface FooObject @dummy extend union FooInterface @dummy extend enum FooUnion @dummy extend input FooEnum @dummy extend scalar FooInputObject @dummy """ assert_errors( sdl, [ { "message": "Cannot extend non-object type 'FooScalar'.", "locations": [(2, 13)], }, { "message": "Cannot extend non-interface type 'FooObject'.", "locations": [(3, 13)], }, { "message": "Cannot extend non-union type 'FooInterface'.", "locations": [(4, 13)], }, { "message": "Cannot extend non-enum type 'FooUnion'.", "locations": [(5, 13)], }, { "message": "Cannot extend non-input object type 'FooEnum'.", "locations": [(6, 13)], }, { "message": "Cannot extend non-scalar type 'FooInputObject'.", "locations": [(7, 13)], }, ], schema, )
4,637
661
from pseudo.middlewares.middleware import Middleware from pseudo.pseudo_tree import Node, method_call BUILTIN_SIMPLE = {'Int', 'String', 'Void', 'Exception', 'Float', 'Boolean', 'CppIterator', 'ifstream', 'istreambuf_iterator<char>', 'Library'} class CppPointerMiddleware(Middleware): ''' converts variables allocated with `new` to pointers if a variable is allocated with `new`, it's type T is transformed to Pointer[T] and the method calls on it are transformed to pointer_method_calls ''' @classmethod def process(cls, tree): return cls(tree).transform(tree) def __init__(self, tree): self.tree = tree def after(self, node, in_block=False, assignment=None): node.pseudo_type = self.process_type(node.pseudo_type) if node.type == 'method_call': if not node.receiver.pseudo_type: node.receiver = node.receiver.name if node.type == 'method_call' and isinstance(node.receiver, str): input(node.y) if node.type == 'method_call' and isinstance(node.receiver.pseudo_type, list) and node.receiver.pseudo_type[0] == 'Pointer': node.type = 'pointer_method_call' return node def process_type(self, t): if isinstance(t, list) and t[0] != 'Pointer': return [t[0]] + [self.process_type(a) for a in t[1:]] elif t and t not in BUILTIN_SIMPLE and not t.endswith('Error'): return ['Pointer', t] else: return t
635
11,351
<reponame>LearnJavaByus/eureka<filename>eureka-client/src/main/java/com/netflix/discovery/shared/transport/jersey/SSLSocketFactoryAdapter.java package com.netflix.discovery.shared.transport.jersey; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.conn.ssl.X509HostnameVerifier; import org.apache.http.protocol.HttpContext; /** * Adapts a version 4.3+ {@link SSLConnectionSocketFactory} to a pre 4.3 * {@link SSLSocketFactory}. This allows {@link HttpClient}s built using the * deprecated pre 4.3 APIs to use SSL improvements from 4.3, e.g. SNI. * * @author <NAME> * */ public class SSLSocketFactoryAdapter extends SSLSocketFactory { private final SSLConnectionSocketFactory factory; public SSLSocketFactoryAdapter(SSLConnectionSocketFactory factory) { // super's dependencies are dummies, and will delegate all calls to the // to the overridden methods super(DummySSLSocketFactory.INSTANCE, DummyX509HostnameVerifier.INSTANCE); this.factory = factory; } public SSLSocketFactoryAdapter(SSLConnectionSocketFactory factory, HostnameVerifier hostnameVerifier) { super(DummySSLSocketFactory.INSTANCE, new WrappedX509HostnameVerifier(hostnameVerifier)); this.factory = factory; } @Override public Socket createSocket(final HttpContext context) throws IOException { return factory.createSocket(context); } @Override public Socket connectSocket( final int connectTimeout, final Socket socket, final HttpHost host, final InetSocketAddress remoteAddress, final InetSocketAddress localAddress, final HttpContext context) throws IOException { return factory.connectSocket(connectTimeout, socket, host, remoteAddress, localAddress, context); } @Override public Socket createLayeredSocket( final Socket socket, final String target, final int port, final HttpContext context) throws IOException { return factory.createLayeredSocket(socket, target, port, context); } private static class DummySSLSocketFactory extends javax.net.ssl.SSLSocketFactory { private static final DummySSLSocketFactory INSTANCE = new DummySSLSocketFactory(); @Override public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { throw new UnsupportedOperationException(); } @Override public String[] getDefaultCipherSuites() { throw new UnsupportedOperationException(); } @Override public String[] getSupportedCipherSuites() { throw new UnsupportedOperationException(); } @Override public Socket createSocket(String host, int port) throws IOException, UnknownHostException { throw new UnsupportedOperationException(); } @Override public Socket createSocket(InetAddress host, int port) throws IOException { throw new UnsupportedOperationException(); } @Override public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException { throw new UnsupportedOperationException(); } @Override public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { throw new UnsupportedOperationException(); } } private static class DummyX509HostnameVerifier implements X509HostnameVerifier { private static final DummyX509HostnameVerifier INSTANCE = new DummyX509HostnameVerifier(); @Override public boolean verify(String hostname, SSLSession session) { throw new UnsupportedOperationException(); } @Override public void verify(String host, SSLSocket ssl) throws IOException { throw new UnsupportedOperationException(); } @Override public void verify(String host, X509Certificate cert) throws SSLException { throw new UnsupportedOperationException(); } @Override public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException { throw new UnsupportedOperationException(); } } private static class WrappedX509HostnameVerifier extends DummyX509HostnameVerifier { HostnameVerifier hostnameVerifier; private WrappedX509HostnameVerifier(HostnameVerifier hostnameVerifier) { this.hostnameVerifier = hostnameVerifier; } @Override public boolean verify(String hostname, SSLSession session) { return hostnameVerifier.verify(hostname, session); } } }
1,963
3,209
<reponame>unFYDP/CIHP_PGN from .transformer import TensorFlowTransformer from .network import Network
32
738
from django.core.management.base import BaseCommand from crits.core.sector import Sector from crits.core.class_mapper import class_from_type class Command(BaseCommand): """ Script Class. """ def handle(self, *args, **options): """ Script Execution. """ sectors = {} types = ['Actor', 'Campaign', 'Certificate', 'Domain', 'Email', 'Event', 'Indicator', 'IP', 'PCAP', 'RawData', 'Sample', 'Signature', 'Target'] for otype in types: klass = class_from_type(otype) if not klass: continue objs = klass.objects().only('sectors') for obj in objs: for sector in obj.sectors: if not sector: continue # Avoid empty strings if sector not in sectors: sectors[sector] = Sector() sectors[sector].name = sector setattr(sectors[sector], otype, 1) else: sectors[sector][otype] += 1 # Drop all existing sectors Sector.objects().delete_one() for sector in sectors.values(): sector.save()
622
2,981
<reponame>kjthegod/chromium<gh_stars>1000+ { "name": { "message": "<NAME>", "description": "Назив екстензије у манифесту." }, "description": { "message": "Приказује првих 5 вести са '$Google$ Вести - главне вести' у прозорчићу.", "description": "Опис екстензије у манифесту.", "placeholders": { "google": { "content": "Google", "example": "Google" } } }, "default_title": { "message": "$Google$ Вести", "description": "Назив дугмета екстензије.", "placeholders": { "google": { "content": "Google", "example": "Google" } } }, "unknown_title": { "message": "Непознат наслов", "description": "Непознат наслов вести." }, "error": { "message": "Грешка - $error$", "description": "Општи облик грешке.", "placeholders": { "error": { "content": "$1", "example": "фид је недоступан." } } }, "failed_to_fetch_rss": { "message": "фид је недоступан.", "description": "Порука грешке коју види корисник када је фид недоступан." }, "not_a_valid_feed": { "message": "неисправан фид.", "description": "Порука грешке коју види корисник када је фид неисправан." }, "more_stories": { "message": "Ка $Google$ Вестима \u00BB", "description": "Назив везе ка још вести.", "placeholders": { "google": { "content": "Google", "example": "Google" } } } }
965
2,603
<reponame>NoMaY-jp/FreeRTOS /* * FreeRTOS V202107.00 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * https://www.FreeRTOS.org * https://www.github.com/FreeRTOS * * 1 tab == 4 spaces! */ /* FreeRTOS kernel includes. */ #include <FreeRTOS.h> #include <task.h> #include <queue.h> #include <stdio.h> #include "riscv-virt.h" #include "ns16550.h" /* Priorities used by the tasks. */ #define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) /* The rate at which data is sent to the queue. The 200ms value is converted to ticks using the pdMS_TO_TICKS() macro. */ #define mainQUEUE_SEND_FREQUENCY_MS pdMS_TO_TICKS( 1000 ) /* The maximum number items the queue can hold. The priority of the receiving task is above the priority of the sending task, so the receiving task will preempt the sending task and remove the queue items each time the sending task writes to the queue. Therefore the queue will never have more than one item in it at any time, and even with a queue length of 1, the sending task will never find the queue full. */ #define mainQUEUE_LENGTH ( 1 ) /*-----------------------------------------------------------*/ /* The queue used by both tasks. */ static QueueHandle_t xQueue = NULL; /*-----------------------------------------------------------*/ static void prvQueueSendTask( void *pvParameters ) { TickType_t xNextWakeTime; const unsigned long ulValueToSend = 100UL; const char * const pcMessage1 = "Transfer1"; const char * const pcMessage2 = "Transfer2"; int f = 1; /* Remove compiler warning about unused parameter. */ ( void ) pvParameters; /* Initialise xNextWakeTime - this only needs to be done once. */ xNextWakeTime = xTaskGetTickCount(); for( ;; ) { char buf[40]; sprintf( buf, "%d: %s: %s", xGetCoreID(), pcTaskGetName( xTaskGetCurrentTaskHandle() ), ( f ) ? pcMessage1 : pcMessage2 ); vSendString( buf ); f = !f; /* Place this task in the blocked state until it is time to run again. */ vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_FREQUENCY_MS ); /* Send to the queue - causing the queue receive task to unblock and toggle the LED. 0 is used as the block time so the sending operation will not block - it shouldn't need to block as the queue should always be empty at this point in the code. */ xQueueSend( xQueue, &ulValueToSend, 0U ); } } /*-----------------------------------------------------------*/ static void prvQueueReceiveTask( void *pvParameters ) { unsigned long ulReceivedValue; const unsigned long ulExpectedValue = 100UL; const char * const pcMessage1 = "Blink1"; const char * const pcMessage2 = "Blink2"; const char * const pcFailMessage = "Unexpected value received\r\n"; int f = 1; /* Remove compiler warning about unused parameter. */ ( void ) pvParameters; for( ;; ) { char buf[40]; /* Wait until something arrives in the queue - this task will block indefinitely provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h. */ xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY ); /* To get here something must have been received from the queue, but is it the expected value? If it is, toggle the LED. */ if( ulReceivedValue == ulExpectedValue ) { sprintf( buf, "%d: %s: %s", xGetCoreID(), pcTaskGetName( xTaskGetCurrentTaskHandle() ), ( f ) ? pcMessage1 : pcMessage2 ); vSendString( buf ); f = !f; ulReceivedValue = 0U; } else { vSendString( pcFailMessage ); } } } /*-----------------------------------------------------------*/ int main_blinky( void ) { vSendString( "Hello FreeRTOS!" ); /* Create the queue. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); if( xQueue != NULL ) { /* Start the two tasks as described in the comments at the top of this file. */ xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE * 2U, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL ); xTaskCreate( prvQueueSendTask, "Tx", configMINIMAL_STACK_SIZE * 2U, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL ); } vTaskStartScheduler(); return 0; }
1,705
2,571
// *************************************************************** // Copyright (c) 2021 Jittor. All Rights Reserved. // Maintainers: // <NAME> <<EMAIL>> // <NAME> <<EMAIL>>. // // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. // *************************************************************** #include "common.h" #include "var.h" #include "ops/reduce_op.h" #include "opt/tuner/reduce_tuner.h" #include "opt/pass_manager.h" #include "opt/pass/loop_var_analyze_pass.h" #include "opt/pass/split_loop_pass.h" namespace jittor { DECLARE_FLAG(int, l1_cache_size); void ReduceTuner::run(PassManager* pm, TunerManager* tm) { confidence = 0; FusedOp* fo=tm->oc->op; if (!fo) return; if (fo->flags.get(NodeFlags::_cuda)) return; int rd=0; map<int,int> dim_map; for (uint i=0; i<fo->ops.size(); i++) { Op* op = fo->ops[i]; if (op->name() == string("reindex_reduce")) return; if (op->type() == OpType::reduce) { rd = 1; auto mask = ((ReduceOp*)op)->reduce_mask; for (uint j=0; (1<<j)<=mask; j++) if (mask>>j&1) dim_map[j] = 1; } } if (!rd) return; auto* lva_pass = pm->get_pass<LoopVarAnalyzePass>("loop_var_analyze"); auto* sl_pass = pm->get_pass<SplitLoopPass>("split_loop"); if (!sl_pass || !lva_pass) return; auto number_of_ranges = lva_pass->number_of_ranges; if (number_of_ranges<2) return; confidence = 20; if (number_of_ranges>2) confidence = 9; for (auto iter = dim_map.begin(); iter != dim_map.end(); iter++) if (iter->first != 0) confidence = 9; int var_size = 0; map<size_t, int> var_map_input, var_map_output; for (uint i=0; i<fo->vars.size(); i++) if (fo->vars[i].type == 0){ Var* var = fo->vars[i].var; if (var_map_input.count((size_t)var)) continue; var_map_input[(size_t)var] = 1; var_size += var->dsize(); } else if (fo->vars[i].type == 2){ Var* var = fo->vars[i].var; if (var_map_output.count((size_t)var)) continue; var_map_output[(size_t)var] = 1; var_size += var->dsize(); } int st = -1; for (int i = l1_cache_size/var_size; i; st++, i>>=1); add_candidate("split1", 1<<st); add_candidate("order0", 0); add_candidate("order1", 1); for (int i=2; i<=number_of_ranges; i++) add_candidate("order"+S(i), 0); } }
1,130
348
<filename>docs/data/leg-t1/003/00301019.json {"nom":"Beaulon","circ":"1ère circonscription","dpt":"Allier","inscrits":1305,"abs":665,"votants":640,"blancs":23,"nuls":7,"exp":610,"res":[{"nuance":"COM","nom":"<NAME>","voix":170},{"nuance":"REM","nom":"M<NAME>","voix":169},{"nuance":"LR","nom":"<NAME>-<NAME>","voix":127},{"nuance":"FN","nom":"Mme <NAME>","voix":67},{"nuance":"SOC","nom":"Mme <NAME>","voix":33},{"nuance":"DVG","nom":"<NAME>","voix":10},{"nuance":"DLF","nom":"<NAME>","voix":10},{"nuance":"EXG","nom":"<NAME>","voix":7},{"nuance":"ECO","nom":"<NAME>","voix":6},{"nuance":"DIV","nom":"Mme <NAME>","voix":4},{"nuance":"DIV","nom":"<NAME>","voix":4},{"nuance":"DVG","nom":"Mme <NAME>","voix":3}]}
287
746
package jp.mixi.practice.serializable; import java.util.Calendar; import java.util.Random; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.text.format.DateFormat; public class NetworkClient { private Random rand = new Random(); public String getUser(int userId) { return createUser(userId).toString(); } public String getFriends() { JSONArray array = new JSONArray(); for (int i = 0; i < 10; i++) { array.put(createUser(rand.nextInt(10000))); } return array.toString(); } private JSONObject createUser(int userId) { try { JSONObject json = new JSONObject(); json.put("id", userId); json.put("name", "user_" + userId); if (rand.nextBoolean()) { json.put("age", rand.nextInt(100)); } if (rand.nextBoolean()) { json.put("keyword", "keyword_" + userId); } CharSequence postedTime = DateFormat.format("yyyy-MM-dd hh:mm:ss", getPastedTime(-1 * rand.nextInt(100))); JSONObject status = new JSONObject(); status.put("postedTime", postedTime); status.put("text", "しぶやなう"); json.put("status", status); return json; } catch (JSONException e) { return null; } } private Calendar getPastedTime(int addDate){ Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, addDate); return cal; } }
741
2,542
<filename>src/test/current/source/NativeReplicatorStack/TpccService/OrderKey.h // ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once namespace TpccService { class OrderKey : public KObject<OrderKey> , public KShared<OrderKey> { K_FORCE_SHARED(OrderKey) public: static NTSTATUS Create( __in KAllocator& allocator, __out SPtr& result); // Hash function. Return the hash code of DistrictKey::SPtr static ULONG Hash(__in const OrderKey::SPtr& key); PROPERTY(int, warehouse_, Warehouse) PROPERTY(int, district_, District) PROPERTY(int, customer_, Customer) PROPERTY(LONG64, order_, Order) private: int warehouse_; int district_; int customer_; LONG64 order_; }; }
401
674
<reponame>slaveuser/honest-profiler20190422 /** * Copyright (c) 2014 <NAME> (<EMAIL>) * <p> * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * <p> * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * <p> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **/ package com.insightfullogic.honest_profiler.ports.console; import com.insightfullogic.honest_profiler.core.profiles.Profile; import com.insightfullogic.honest_profiler.core.profiles.ProfileListener; import java.io.PrintStream; import static com.insightfullogic.honest_profiler.ports.console.ProfileFormat.ALL; public class ProfileView implements ProfileListener { private final Console output; private ProfileFormat profileFormat = ALL; public ProfileView(Console output) { this.output = output; } @Override public void accept(Profile profile) { PrintStream out = output.stream(); printHeader(profile, out); out.println(); profileFormat.printProfile(profile, out); out.println(); } private void printHeader(Profile profile, PrintStream out) { out.print("Number of stack traces: "); out.print(Integer.toString(profile.getTraceCount())); } public void setProfileFormat(ProfileFormat profileFormat) { this.profileFormat = profileFormat; } }
703
1,695
/* * 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 io.trino.memory; import org.weakref.jmx.JmxException; import org.weakref.jmx.MBeanExporter; import org.weakref.jmx.ObjectNames; import javax.annotation.PreDestroy; import javax.inject.Inject; import static java.util.Objects.requireNonNull; public final class LocalMemoryManagerExporter { public static final String EXPORTED_POOL_NAME = "general"; private final MBeanExporter exporter; private final boolean poolExported; @Inject public LocalMemoryManagerExporter(LocalMemoryManager memoryManager, MBeanExporter exporter) { this.exporter = requireNonNull(exporter, "exporter is null"); boolean poolExportedLocal = false; try { this.exporter.exportWithGeneratedName(memoryManager.getMemoryPool(), MemoryPool.class, EXPORTED_POOL_NAME); poolExportedLocal = true; } catch (JmxException e) { // ignored } this.poolExported = poolExportedLocal; } @PreDestroy public void destroy() { if (!poolExported) { return; } String objectName = ObjectNames.builder(MemoryPool.class, EXPORTED_POOL_NAME).build(); try { exporter.unexport(objectName); } catch (JmxException e) { // ignored } } }
695
335
{ "word": "Make", "definitions": [ "The manufacturer or trade name of a product.", "The structure or composition of something.", "The making of electrical contact." ], "parts-of-speech": "Noun" }
91
653
<reponame>who7708/NaiveChat<gh_stars>100-1000 package org.itstack.naive.chat.client.socket; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import org.itstack.naive.chat.codec.ObjDecoder; import org.itstack.naive.chat.codec.ObjEncoder; /** * 微信公众号:bugstack虫洞栈 | 欢迎关注学习专题案例 * 论坛:http://bugstack.cn * Create by 小傅哥 on @2020 */ public class MyChannelInitializer extends ChannelInitializer<SocketChannel> { @Override protected void initChannel(SocketChannel channel) throws Exception { // 对象传输处理[解码] channel.pipeline().addLast(new ObjDecoder()); // 在管道中添加我们自己的接收数据实现方法 // ... // 对象传输处理[编码] channel.pipeline().addLast(new ObjEncoder()); } }
407
3,459
<reponame>ianclawson/Provenance /******************************************************************************/ /* Mednafen - Multi-system Emulator */ /******************************************************************************/ /* CDAFReader_FLAC.cpp: ** Copyright (C) 2020 Mednafen Team ** ** 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 program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software Foundation, Inc., ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <mednafen/mednafen.h> #include "CDAFReader.h" #include "CDAFReader_FLAC.h" //#include <FLAC/all.h> namespace Mednafen { class CDAFReader_FLAC final : public CDAFReader { public: CDAFReader_FLAC(Stream *fp); ~CDAFReader_FLAC(); uint64 Read_(int16 *buffer, uint64 frames) override; bool Seek_(uint64 frame_offset) override; uint64 FrameCount(void) override; FLAC__StreamDecoderReadStatus read_cb(FLAC__byte* data, size_t* count); FLAC__StreamDecoderSeekStatus seek_cb(FLAC__uint64 offset); FLAC__StreamDecoderTellStatus tell_cb(FLAC__uint64* offset); FLAC__StreamDecoderLengthStatus length_cb(FLAC__uint64* size); FLAC__bool eof_cb(void); FLAC__StreamDecoderWriteStatus write_cb(const FLAC__Frame* frame, const FLAC__int32* const* buf); void metadata_cb(const FLAC__StreamMetadata* meta); void error_cb(FLAC__StreamDecoderErrorStatus status); private: Stream *fw; bool eof; uint64 num_frames; FLAC__StreamDecoder* dec; uint32 decbuf_alloced; uint32 decbuf_size; uint32 decbuf_read_offs; std::unique_ptr<int16[]> decbuf; }; INLINE FLAC__StreamDecoderReadStatus CDAFReader_FLAC::read_cb(FLAC__byte* data, size_t* count) { if(!*count) return FLAC__STREAM_DECODER_READ_STATUS_ABORT; try { const size_t to_read = *count; size_t did_read = fw->read(data, to_read, false); *count = did_read; eof |= did_read < to_read; if(to_read && !did_read) return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; } catch(...) { return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } } INLINE FLAC__StreamDecoderSeekStatus CDAFReader_FLAC::seek_cb(FLAC__uint64 offset) { try { fw->seek(offset, SEEK_SET); eof = false; return FLAC__STREAM_DECODER_SEEK_STATUS_OK; } catch(...) { return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; } } INLINE FLAC__StreamDecoderTellStatus CDAFReader_FLAC::tell_cb(FLAC__uint64* offset) { try { *offset = fw->tell(); return FLAC__STREAM_DECODER_TELL_STATUS_OK; } catch(...) { return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; } } INLINE FLAC__StreamDecoderLengthStatus CDAFReader_FLAC::length_cb(FLAC__uint64* size) { try { *size = fw->size(); return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; } catch(...) { return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; } } INLINE FLAC__bool CDAFReader_FLAC::eof_cb(void) { return eof; } INLINE FLAC__StreamDecoderWriteStatus CDAFReader_FLAC::write_cb(const FLAC__Frame* frame, const FLAC__int32*const* buf) { try { const unsigned num_ch = frame->header.channels; const unsigned bits_per_sample = frame->header.bits_per_sample; const uint32 new_decbuf_size = frame->header.blocksize; //printf("blocksize=%u, channels=%u bits_per_sample=%u\n", frame->header.blocksize, frame->header.channels, frame->header.bits_per_sample); assert(num_ch); assert(decbuf_read_offs == decbuf_size); if(decbuf_alloced < new_decbuf_size) { decbuf.reset(); decbuf_alloced = 0; // decbuf.reset(new int16[2 * new_decbuf_size]); decbuf_alloced = new_decbuf_size; } decbuf_read_offs = 0; decbuf_size = new_decbuf_size; for(uint32 i = 0; i < new_decbuf_size; i++) { int16 out_l, out_r; //printf("%08x\n", buf[0][i]); out_l = out_r = ((uint32)buf[0][i] << (32 - bits_per_sample)) >> 16; if(num_ch >= 2) out_r = ((uint32)buf[1][i] << (32 - bits_per_sample)) >> 16; decbuf[i * 2 + 0] = out_l; decbuf[i * 2 + 1] = out_r; } } catch(...) { return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; } return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } INLINE void CDAFReader_FLAC::metadata_cb(const FLAC__StreamMetadata* meta) { } INLINE void CDAFReader_FLAC::error_cb(FLAC__StreamDecoderErrorStatus status) { } static FLAC__StreamDecoderReadStatus C_read_cb(const FLAC__StreamDecoder* dec, FLAC__byte* data, size_t* count, void* pdata) { return ((CDAFReader_FLAC*)pdata)->read_cb(data, count); } static FLAC__StreamDecoderSeekStatus C_seek_cb(const FLAC__StreamDecoder* dec, FLAC__uint64 offset, void* pdata) { return ((CDAFReader_FLAC*)pdata)->seek_cb(offset); } static FLAC__StreamDecoderTellStatus C_tell_cb(const FLAC__StreamDecoder* dec, FLAC__uint64* offset, void* pdata) { return ((CDAFReader_FLAC*)pdata)->tell_cb(offset); } static FLAC__StreamDecoderLengthStatus C_length_cb(const FLAC__StreamDecoder* dec, FLAC__uint64* size, void* pdata) { return ((CDAFReader_FLAC*)pdata)->length_cb(size); } static FLAC__bool C_eof_cb(const FLAC__StreamDecoder* dec, void* pdata) { return ((CDAFReader_FLAC*)pdata)->eof_cb(); } static FLAC__StreamDecoderWriteStatus C_write_cb(const FLAC__StreamDecoder* dec, const FLAC__Frame* frame, const FLAC__int32* const* buf, void* pdata) { return ((CDAFReader_FLAC*)pdata)->write_cb(frame, buf); } static void C_metadata_cb(const FLAC__StreamDecoder* dec, const FLAC__StreamMetadata* meta, void* pdata) { return ((CDAFReader_FLAC*)pdata)->metadata_cb(meta); } static void C_error_cb(const FLAC__StreamDecoder* dec, FLAC__StreamDecoderErrorStatus status, void* pdata) { return ((CDAFReader_FLAC*)pdata)->error_cb(status); } CDAFReader_FLAC::CDAFReader_FLAC(Stream *fp) : fw(fp), eof(false), num_frames(0), dec(nullptr), decbuf_alloced(0), decbuf_size(0), decbuf_read_offs(0) { uint8 magic[0x4]; //bool is_ogg = false; if(fp->read(magic, 0x4) != 0x4) throw 0; //is_ogg = !memcmp(magic, "OggS", 4); if(memcmp(magic, "fLaC", 4) /*&& !is_ogg*/) throw 0; fp->rewind(); // // // try { if(!(dec = FLAC__stream_decoder_new())) throw MDFN_Error(0, _("Error creating FLAC stream decoder.")); // FLAC__StreamDecoderInitStatus init_status; //if(is_ogg) // init_status = FLAC__stream_decoder_init_ogg_stream(dec, C_read_cb, C_seek_cb, C_tell_cb, C_length_cb, C_eof_cb, C_write_cb, C_metadata_cb, C_error_cb, this); //else init_status = FLAC__stream_decoder_init_stream(dec, C_read_cb, C_seek_cb, C_tell_cb, C_length_cb, C_eof_cb, C_write_cb, C_metadata_cb, C_error_cb, this); if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) { if(init_status == FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER) throw 0; // throw MDFN_Error(0, _("Error initializing FLAC stream decoder: %s"), FLAC__StreamDecoderInitStatusString[init_status]); } if(!FLAC__stream_decoder_process_until_end_of_metadata(dec)) throw MDFN_Error(0, _("Error reading/processing FLAC metadata.")); //printf("%s\n", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(dec)]); if(!(num_frames = FLAC__stream_decoder_get_total_samples(dec))) throw MDFN_Error(0, _("FLAC total sample count is zero.")); } catch(...) { if(dec) FLAC__stream_decoder_delete(dec); throw; } } CDAFReader_FLAC::~CDAFReader_FLAC() { if(dec) { FLAC__stream_decoder_delete(dec); dec = nullptr; } } uint64 CDAFReader_FLAC::Read_(int16 *buffer, uint64 frames) { uint64 ret = 0; while(frames) { if(decbuf_read_offs == decbuf_size) { if(!FLAC__stream_decoder_process_single(dec)) { //printf("FLAC__stream_decoder_process_single failed; decstate=%s\n", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(dec)]); if(decbuf_read_offs == decbuf_size) break; } if(FLAC__stream_decoder_get_state(dec) == FLAC__STREAM_DECODER_END_OF_STREAM) { //printf("End of stream?\n"); if(decbuf_read_offs == decbuf_size) break; } } // // //printf("%d %d\n", decbuf_size, decbuf_read_offs); uint32 frames_to_copy = std::min<uint64>(frames, decbuf_size - decbuf_read_offs); memcpy(buffer, decbuf.get() + decbuf_read_offs * 2, frames_to_copy * sizeof(int16) * 2); decbuf_read_offs += frames_to_copy; buffer += frames_to_copy * 2; ret += frames_to_copy; frames -= frames_to_copy; } return ret; } bool CDAFReader_FLAC::Seek_(uint64 frame_offset) { decbuf_read_offs = 0; decbuf_size = 0; if(!FLAC__stream_decoder_seek_absolute(dec, frame_offset)) { //printf("FLAC__stream_decoder_seek_absolute() failed; decstate=%s\n", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(dec)]); if(FLAC__stream_decoder_get_state(dec) == FLAC__STREAM_DECODER_SEEK_ERROR) { //printf("flac seek error\n"); decbuf_read_offs = 0; decbuf_size = 0; FLAC__stream_decoder_reset(dec); } return false; } return true; } uint64 CDAFReader_FLAC::FrameCount(void) { return num_frames; } CDAFReader* CDAFR_FLAC_Open(Stream* fp) { return new CDAFReader_FLAC(fp); } }
3,761
503
// // PieCharts.h // PieCharts // // Created by <NAME> on 03/01/2017. // Copyright © 2017 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for PieCharts. FOUNDATION_EXPORT double PieChartsVersionNumber; //! Project version string for PieCharts. FOUNDATION_EXPORT const unsigned char PieChartsVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <PieCharts/PublicHeader.h>
149
1,157
<gh_stars>1000+ #pragma once #include <maxtest/ccdefs.hh> namespace maxtest { int create_tcp_socket(); char* get_ip(const char* host); char* read_sc(int sock); int send_so(int sock, char* data); char* cdc_auth_srt(char* user, char* password); int setnonblocking(int sock); int get_x_fl_from_json(const char* line, long long int* x1, long long int* fl); }
150
348
<reponame>chamberone/Leaflet.PixiOverlay {"nom":"Obersoultzbach","circ":"7ème circonscription","dpt":"Bas-Rhin","inscrits":343,"abs":186,"votants":157,"blancs":2,"nuls":3,"exp":152,"res":[{"nuance":"LR","nom":"<NAME>","voix":101},{"nuance":"REM","nom":"<NAME>","voix":51}]}
111
1,655
#include "LinearTransmittance.hpp" #include "sampling/UniformPathSampler.hpp" #include "math/MathUtil.hpp" #include "io/JsonObject.hpp" #include "Memory.hpp" namespace Tungsten { LinearTransmittance::LinearTransmittance() : _maxT(1.0f) { } void LinearTransmittance::fromJson(JsonPtr value, const Scene &scene) { Transmittance::fromJson(value, scene); value.getField("max_t", _maxT); } rapidjson::Value LinearTransmittance::toJson(Allocator &allocator) const { return JsonObject{Transmittance::toJson(allocator), allocator, "type", "linear", "max_t", _maxT }; } Vec3f LinearTransmittance::surfaceSurface(const Vec3f &tau) const { return 1.0f - min(tau/_maxT, Vec3f(1.0f)); } Vec3f LinearTransmittance::surfaceMedium(const Vec3f &tau) const { Vec3f result(1.0f/_maxT); for (int i = 0; i < 3; ++i) if (tau[i] > _maxT) result[i] = 0.0f; return result; } Vec3f LinearTransmittance::mediumSurface(const Vec3f &tau) const { Vec3f result(1.0f); for (int i = 0; i < 3; ++i) if (tau[i] > _maxT) result[i] = 0.0f; return result; } Vec3f LinearTransmittance::mediumMedium(const Vec3f &tau) const { Vec3f result; for (int i = 0; i < 3; ++i) result[i] = std::abs(tau[i] - _maxT) < 1e-3f ? 1.0f : 0.0f; return result; } float LinearTransmittance::sigmaBar() const { return 1.0f/_maxT; } bool LinearTransmittance::isDirac() const { return true; } float LinearTransmittance::sampleSurface(PathSampleGenerator &sampler) const { return _maxT*sampler.next1D(); } float LinearTransmittance::sampleMedium(PathSampleGenerator &/*sampler*/) const { return _maxT; } }
759
746
<reponame>VishalS711/protege package org.protege.editor.owl.ui.renderer.conf; import org.protege.editor.core.Fonts; import org.protege.editor.core.ui.preferences.PreferencesLayoutPanel; import org.protege.editor.owl.ui.preferences.OWLPreferencesPanel; import org.protege.editor.owl.ui.renderer.OWLModelManagerEntityRenderer; import org.protege.editor.owl.ui.renderer.OWLRendererPreferences; import org.protege.editor.owl.ui.renderer.plugin.RendererPlugin; import org.semanticweb.owlapi.model.OWLRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.swing.*; import java.awt.*; import java.util.LinkedHashMap; import java.util.Map; /** * Author: <NAME><br> * The University Of Manchester<br> * Medical Informatics Group<br> * Date: 08-Jun-2006<br><br> * <EMAIL><br> * www.cs.man.ac.uk/~horridgm<br><br> */ public class RendererPreferencesPanel extends OWLPreferencesPanel { private final Logger logger = LoggerFactory.getLogger(RendererPreferencesPanel.class); private Map<JRadioButton, RendererPlugin> buttonToRendererMap = new LinkedHashMap<>(); private JList annotationPropertiesList; private JCheckBox highlightAOStatementsCheckBox; private JCheckBox showHyperlinksCheckBox; private JCheckBox highlightKeyWordsCheckBox; private JSpinner fontSizeSpinner; private JButton configureButton; private RendererPlugin originalRendererPlugin; private boolean dirty = false; public void applyChanges() { OWLRendererPreferences prefs = OWLRendererPreferences.getInstance(); prefs.setHighlightActiveOntologyStatements(highlightAOStatementsCheckBox.isSelected()); prefs.setRenderHyperlinks(showHyperlinksCheckBox.isSelected()); prefs.setHighlightKeyWords(highlightKeyWordsCheckBox.isSelected()); Integer fontSize = (Integer) fontSizeSpinner.getValue(); prefs.setFontSize(fontSize); if (isDirty()){ RendererPlugin plugin = getSelectedRendererPlugin(); try { prefs.setRendererPlugin(plugin); OWLModelManagerEntityRenderer ren = plugin.newInstance(); getOWLModelManager().refreshRenderer(); Fonts.updateUIDefaultsFontSize(fontSize); } catch (Exception e) { throw new OWLRuntimeException(e); } } SwingUtilities.updateComponentTreeUI(getOWLEditorKit().getWorkspace()); } public void initialise() throws Exception { setLayout(new BorderLayout()); PreferencesLayoutPanel layoutPanel = new PreferencesLayoutPanel(); add(layoutPanel, BorderLayout.NORTH); createRendererSelectionPanel(layoutPanel); layoutPanel.addSeparator(); layoutPanel.addGroup("Appearance"); OWLRendererPreferences prefs = OWLRendererPreferences.getInstance(); highlightAOStatementsCheckBox = new JCheckBox("Highlight active ontology statements", prefs.isHighlightActiveOntologyStatements()); showHyperlinksCheckBox = new JCheckBox("Show hyperlinks in components that support them", prefs.isRenderHyperlinks()); highlightKeyWordsCheckBox = new JCheckBox("Highlight keywords", prefs.isHighlightKeyWords()); layoutPanel.addGroupComponent(highlightAOStatementsCheckBox); layoutPanel.addGroupComponent(showHyperlinksCheckBox); layoutPanel.addGroupComponent(highlightKeyWordsCheckBox); layoutPanel.addSeparator(); layoutPanel.addGroup("Font size"); fontSizeSpinner = new JSpinner(new SpinnerNumberModel(prefs.getFontSize(), 1, 120, 1)); layoutPanel.addGroupComponent(fontSizeSpinner); JButton resetFontSizeButton = new JButton("Reset font"); resetFontSizeButton.addActionListener(e -> resetFont()); layoutPanel.addIndentedGroupComponent(resetFontSizeButton); } protected void resetFont() { OWLRendererPreferences prefs = OWLRendererPreferences.getInstance(); prefs.setFontSize(OWLRendererPreferences.DEFAULT_FONT_SIZE); fontSizeSpinner.setValue(OWLRendererPreferences.DEFAULT_FONT_SIZE); } private void createRendererSelectionPanel(PreferencesLayoutPanel layoutPanel) { OWLRendererPreferences prefs = OWLRendererPreferences.getInstance(); for (RendererPlugin plugin : prefs.getRendererPlugins()) { addRenderer(plugin.getName(), plugin); } layoutPanel.addGroup("Entity rendering"); ButtonGroup bg = new ButtonGroup(); for (JRadioButton button : buttonToRendererMap.keySet()){ bg.add(button); layoutPanel.addGroupComponent(button); button.addChangeListener(e -> updateRendererButtons()); } configureButton = new JButton("Configure..."); configureButton.addActionListener(e -> { RendererPlugin plugin = getSelectedRendererPlugin(); try { if (plugin != null && plugin.newInstance().configure(getOWLEditorKit())) { dirty = true; } } catch (Exception cnfe) { logger.error("An error occurred whilst instantiating a renderer preferences panel plugin: {}", cnfe); } }); layoutPanel.addIndentedGroupComponent(configureButton); updateRendererButtons(); } private void addRenderer(String label, RendererPlugin plugin) { RendererPlugin currentPlugin = OWLRendererPreferences.getInstance().getRendererPlugin(); JRadioButton button = new JRadioButton(label, plugin.equals(currentPlugin)); buttonToRendererMap.put(button, plugin); } private void updateRendererButtons() { RendererPlugin plugin = getSelectedRendererPlugin(); if (plugin != null) { try { configureButton.setEnabled(plugin.newInstance().isConfigurable()); } catch (Exception e) { logger.error("An error occurred whilst updating the state of a renderer plugin: {}", e); configureButton.setEnabled(false); } } } public void dispose() { } public boolean isDirty() { return dirty || (getSelectedRendererPlugin() != null && !getSelectedRendererPlugin().equals(originalRendererPlugin)); } public RendererPlugin getSelectedRendererPlugin() { for (JRadioButton button : buttonToRendererMap.keySet()){ if (button.isSelected()){ return buttonToRendererMap.get(button); } } return null; } }
2,643
1,144
package de.metas.contracts.inoutcandidate; /* * #%L * de.metas.contracts * %% * Copyright (C) 2015 metas GmbH * %% * 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 program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-2.0.html>. * #L% */ import java.util.Properties; import org.adempiere.inout.util.DeliveryGroupCandidate; import org.adempiere.inout.util.DeliveryLineCandidate; import org.adempiere.inout.util.IShipmentSchedulesDuringUpdate; import org.adempiere.model.PlainContextAware; import org.adempiere.util.lang.impl.TableRecordReference; import org.slf4j.Logger; import org.slf4j.MDC.MDCCloseable; import de.metas.contracts.model.I_C_SubscriptionProgress; import de.metas.contracts.model.X_C_SubscriptionProgress; import de.metas.i18n.IMsgBL; import de.metas.inoutcandidate.api.ShipmentSchedulesMDC; import de.metas.inoutcandidate.spi.IShipmentSchedulesAfterFirstPassUpdater; import de.metas.logging.LogManager; import de.metas.order.DeliveryRule; import de.metas.util.Check; import de.metas.util.Services; import lombok.ToString; /** * * @author ts * @see "<a href='http://dewiki908/mediawiki/index.php?title=Auftrag_versenden_mit_Abo-Lieferung_(2009_0027_G62)'>(2009 0027 G62)</a>" * */ @ToString public class ShipmentScheduleSubscriptionProcessor implements IShipmentSchedulesAfterFirstPassUpdater { public static final String MSG_OPEN_INVOICE_1P = "ShipmentSchedule_OpenInvoice_1P"; public static final String MSG_WITH_NEXT_SUBSCRIPTION = "ShipmentSchedule_WithNextSubscription"; private static final Logger logger = LogManager.getLogger(ShipmentScheduleSubscriptionProcessor.class); @Override public void doUpdateAfterFirstPass( final Properties ctx, final IShipmentSchedulesDuringUpdate candidates) { for (final DeliveryGroupCandidate groupCandidate : candidates.getCandidates()) { for (final DeliveryLineCandidate lineCandidate : groupCandidate.getLines()) { if (lineCandidate.isDiscarded()) { // this line won't be delivered anyways. Nothing to do continue; } try (final MDCCloseable mdcClosable = ShipmentSchedulesMDC.putShipmentScheduleId(lineCandidate.getShipmentScheduleId())) { handleWithNextSubscription(ctx, candidates, lineCandidate); } } } } private void handleWithNextSubscription( final Properties ctx, final IShipmentSchedulesDuringUpdate candidates, final DeliveryLineCandidate lineCandidate) { if (!DeliveryRule.WITH_NEXT_SUBSCRIPTION_DELIVERY.equals(lineCandidate.getDeliveryRule())) { // this line doesn't need to be delivered together with a subscription delivery -> nothing to do return; } // find out there are subscription delivery lines final boolean atLeastOneSubscription = hasSubscriptionDelivery(ctx, candidates, lineCandidate); if (!atLeastOneSubscription) { logger.debug("Discard lineCandidate because there is no subscription delivery to piggyback on"); candidates.addStatusInfo(lineCandidate, Services.get(IMsgBL.class).getMsg(ctx, MSG_WITH_NEXT_SUBSCRIPTION)); lineCandidate.setDiscarded(); } } private boolean hasSubscriptionDelivery( final Properties ctx, final IShipmentSchedulesDuringUpdate candidates, final DeliveryLineCandidate inOutLine) { final DeliveryGroupCandidate inOut = inOutLine.getGroup(); boolean atLeastOneSubscription = false; for (final DeliveryLineCandidate currentLine : inOut.getLines()) { if (currentLine == inOutLine) { continue; } if (currentLine.isDiscarded()) { // 'currentLine' won't be delivered anyways, it is irrelevant here continue; } // find out if 'currentLine' has an open subscription delivery // (which means that it is to be delivered right now) final TableRecordReference scheduleReference = inOutLine.getReferenced(); if (I_C_SubscriptionProgress.Table_Name.equals(scheduleReference.getTableName())) { final I_C_SubscriptionProgress sp = scheduleReference.getModel(PlainContextAware.newWithThreadInheritedTrx(ctx), I_C_SubscriptionProgress.class); final String status = sp.getStatus(); Check.assume(X_C_SubscriptionProgress.STATUS_Open.equals(status), "{} referenced by {} doesn't have status {}", sp, inOutLine, status); atLeastOneSubscription = true; break; } } return atLeastOneSubscription; } }
1,644
971
<reponame>weijietong/noisepage<gh_stars>100-1000 #include "messenger/connection_destination.h" #include "spdlog/fmt/fmt.h" namespace noisepage::messenger { ConnectionDestination ConnectionDestination::MakeTCP(std::string target_name, std::string_view hostname, int port) { return ConnectionDestination(std::move(target_name), fmt::format("tcp://{}:{}", hostname, port)); } ConnectionDestination ConnectionDestination::MakeIPC(std::string target_name, std::string_view pathname) { return ConnectionDestination(std::move(target_name), fmt::format("ipc://{}", pathname)); } ConnectionDestination ConnectionDestination::MakeInProc(std::string target_name, std::string_view endpoint) { return ConnectionDestination(std::move(target_name), fmt::format("inproc://{}", endpoint)); } } // namespace noisepage::messenger
262
348
{"nom":"Saint-Félix","circ":"1ère circonscription","dpt":"Allier","inscrits":266,"abs":142,"votants":124,"blancs":11,"nuls":3,"exp":110,"res":[{"nuance":"REM","nom":"<NAME>","voix":64},{"nuance":"COM","nom":"<NAME>","voix":46}]}
90
1,085
from .framework import ( selenium_test, SeleniumTestCase ) class LoginTestCase(SeleniumTestCase): @selenium_test def test_logging_in(self): email = self._get_random_email() self.register(email) self.logout_if_needed() self.home() self.submit_login(email, assert_valid=True) self.assert_no_error_message() assert self.is_logged_in() @selenium_test def test_invalid_logins(self): bad_emails = ['<EMAIL>', 'test', '', "'; SELECT * FROM galaxy_user WHERE 'u' = 'u';"] for bad_email in bad_emails: self.home() self.submit_login(bad_email, assert_valid=False) self.assert_error_message() @selenium_test def test_invalid_passwords(self): bad_passwords = ['<PASSWORD>', '', '; SELECT * FROM galaxy_user'] for bad_password in bad_passwords: self.home() self.submit_login(self._get_random_email(), password=<PASSWORD>, assert_valid=False) self.assert_error_message() @selenium_test def test_wrong_password(self): email = self._get_random_email() self.register(email) self.logout_if_needed() self.home() self.submit_login(email, password="<PASSWORD>", assert_valid=False) self.assert_error_message()
604
880
/** * Copyright 2019 <NAME> * * 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 ch.qos.logback.core.net.ssl.mock; import ch.qos.logback.core.net.ssl.SSLConfigurable; public class MockSSLConfigurable implements SSLConfigurable { private static final String[] EMPTY = new String[0]; private String[] defaultProtocols = EMPTY; private String[] supportedProtocols = EMPTY; private String[] enabledProtocols = EMPTY; private String[] defaultCipherSuites = EMPTY; private String[] supportedCipherSuites = EMPTY; private String[] enabledCipherSuites = EMPTY; private boolean needClientAuth; private boolean wantClientAuth; public String[] getDefaultProtocols() { return defaultProtocols; } public void setDefaultProtocols(String[] defaultProtocols) { this.defaultProtocols = defaultProtocols; } public String[] getSupportedProtocols() { return supportedProtocols; } public void setSupportedProtocols(String[] supportedProtocols) { this.supportedProtocols = supportedProtocols; } public String[] getEnabledProtocols() { return enabledProtocols; } public void setEnabledProtocols(String[] enabledProtocols) { this.enabledProtocols = enabledProtocols; } public String[] getDefaultCipherSuites() { return defaultCipherSuites; } public void setDefaultCipherSuites(String[] defaultCipherSuites) { this.defaultCipherSuites = defaultCipherSuites; } public String[] getSupportedCipherSuites() { return supportedCipherSuites; } public void setSupportedCipherSuites(String[] supportedCipherSuites) { this.supportedCipherSuites = supportedCipherSuites; } public String[] getEnabledCipherSuites() { return enabledCipherSuites; } public void setEnabledCipherSuites(String[] enabledCipherSuites) { this.enabledCipherSuites = enabledCipherSuites; } public boolean isNeedClientAuth() { return needClientAuth; } public void setNeedClientAuth(boolean needClientAuth) { this.needClientAuth = needClientAuth; } public boolean isWantClientAuth() { return wantClientAuth; } public void setWantClientAuth(boolean wantClientAuth) { this.wantClientAuth = wantClientAuth; } }
820
392
<filename>apollo-backend/src/main/java/io/logz/apollo/controllers/DeployableVersionController.java package io.logz.apollo.controllers; import com.google.common.base.Joiner; import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import io.logz.apollo.common.HttpStatus; import io.logz.apollo.dao.DeployableVersionDao; import io.logz.apollo.models.DeployableVersion; import io.logz.apollo.scm.CommitDetails; import io.logz.apollo.scm.GithubConnector; import org.apache.commons.lang.StringUtils; import org.rapidoid.annotation.Controller; import org.rapidoid.annotation.GET; import org.rapidoid.annotation.POST; import org.rapidoid.http.Req; import org.rapidoid.security.annotation.LoggedIn; import javax.inject.Inject; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; import java.util.List; import java.util.Optional; import static io.logz.apollo.common.ControllerCommon.assignJsonResponseToReq; import static io.logz.apollo.scm.GithubConnector.getRepoNameFromRepositoryUrl; import static java.util.Objects.requireNonNull; /** * Created by roiravhon on 12/20/16. */ @Controller public class DeployableVersionController { private final DeployableVersionDao deployableVersionDao; private final GithubConnector githubConnector; private final static int LATEST_DEPLOYABLE_VERSIONS_COUNT = 200; public static int MAX_COMMIT_FIELDS_LENGTH = 1000; public static int MAX_COMMIT_MESSAGE_LENGTH = 10000; private static int MAX_GET_LAST_COMMIT_COUNT = 5; public static String UNKNOWN_COMMIT_FIELD = "Unknown"; @Inject public DeployableVersionController(DeployableVersionDao deployableVersionDao, GithubConnector githubConnector) { this.deployableVersionDao = requireNonNull(deployableVersionDao); this.githubConnector = requireNonNull(githubConnector); } @LoggedIn @GET("/deployable-version") public List<DeployableVersion> getAllDeployableVersion() { return deployableVersionDao.getAllDeployableVersions(); } @LoggedIn @GET("/deployable-version/{id}") public DeployableVersion getDeployableVersion(int id) { return deployableVersionDao.getDeployableVersion(id); } @LoggedIn @GET("/deployable-version/sha/{sha}/service/{serviceId}") public DeployableVersion getDeployableVersionFromSha(String sha, int serviceId) { return deployableVersionDao.getDeployableVersionFromSha(sha, serviceId); } @LoggedIn @GET("/deployable-version/latest/service/{serviceId}") public List<DeployableVersion> getLatestDeployableVersionsByServiceId(int serviceId) { return deployableVersionDao.getLatestDeployableVersionsByServiceId(serviceId, LATEST_DEPLOYABLE_VERSIONS_COUNT); } @LoggedIn @GET("/deployable-version/multi-service/{serviceIdsCsv}") public List<DeployableVersion> getDeployableVersionForMultiServices(String serviceIdsCsv) { Iterable<String> serviceIds = Splitter.on(",").omitEmptyStrings().trimResults().split(serviceIdsCsv); return deployableVersionDao.getDeployableVersionForMultiServices(Joiner.on(",").join(serviceIds), Iterables.size(serviceIds)); } @LoggedIn @GET("/deployable-version/sha/{sha}") public List<DeployableVersion> getSuitableDeployableVersionsFromPartialSha(String sha) { return deployableVersionDao.getSuitableDeployableVersionsFromPartialSha(sha); } @LoggedIn @GET("/deployable-version/latest/branch/{branchName}/repofrom/{deployableVersionId}") public DeployableVersion getLatestDeployableVersionOnBranchBasedOnOtherDeployableVersion(String branchName, int deployableVersionId, Req req) { DeployableVersion referenceDeployableVersion = deployableVersionDao.getDeployableVersion(deployableVersionId); String actualRepo = getRepoNameFromRepositoryUrl(referenceDeployableVersion.getGithubRepositoryUrl()); DeployableVersion latestDeployableVersionOnBranch = getLatestDeployableVersionOnBranch(branchName, actualRepo, referenceDeployableVersion.getServiceId()); if (latestDeployableVersionOnBranch == null) { assignJsonResponseToReq(req, HttpStatus.BAD_REQUEST, "Did not found deployable version matching the sha " + latestDeployableVersionOnBranch.getGitCommitSha()); throw new RuntimeException(); } return latestDeployableVersionOnBranch; } private DeployableVersion getLatestDeployableVersionOnBranch(String branchName, String repo, int serviceId) { if (branchName.equals("master")) { return getMasterLastSuccessfulDeployableVersion(repo, serviceId); } return getLatestDeployableVersionOnOtherBranch(repo, branchName,serviceId); } private DeployableVersion getMasterLastSuccessfulDeployableVersion(String repo, int serviceId) { DeployableVersion deployableVersionFromSha = null; List<String> latestCommitsShaOnBranch = githubConnector.getLatestCommitsShaOnMaster(repo, MAX_GET_LAST_COMMIT_COUNT); for (String commit : latestCommitsShaOnBranch) { deployableVersionFromSha = deployableVersionDao.getDeployableVersionFromSha(commit, serviceId); if (deployableVersionFromSha != null) break; } return deployableVersionFromSha; } private DeployableVersion getLatestDeployableVersionOnOtherBranch(String repo, String branchName, int serviceId) { return deployableVersionDao.getDeployableVersionFromSha(githubConnector.getLatestCommitShaOnBranch(repo, branchName), serviceId); } @POST("/deployable-version") public void addDeployableVersion(String gitCommitSha, String githubRepositoryUrl, int serviceId, Req req) { // Avoid duplicate entry errors DeployableVersion existingDeployableVersion = deployableVersionDao.getDeployableVersionFromSha(gitCommitSha, serviceId); if (existingDeployableVersion != null) { assignJsonResponseToReq(req, HttpStatus.CREATED, existingDeployableVersion); return; } DeployableVersion newDeployableVersion = new DeployableVersion(); // Getting the commit details String actualRepo = getRepoNameFromRepositoryUrl(githubRepositoryUrl); newDeployableVersion.setGitCommitSha(gitCommitSha); newDeployableVersion.setGithubRepositoryUrl(githubRepositoryUrl); newDeployableVersion.setServiceId(serviceId); // Will be deleted after fixing GitHub mock - https://github.com/logzio/apollo/issues/132 if(githubRepositoryUrl.contains("http://test.com/logzio/")) { newDeployableVersion.setCommitDate(Date.from(LocalDateTime.now(ZoneId.of("UTC")).atZone(ZoneId.systemDefault()).toInstant())); } // Just to protect tests from reaching github rate limit if (githubRepositoryUrl.contains("github.com")) { Optional<CommitDetails> commit = githubConnector.getCommitDetails(actualRepo, gitCommitSha); if (commit.isPresent()) { CommitDetails commitDetails = commit.get(); newDeployableVersion.setCommitUrl(commitDetails.getCommitUrl()); newDeployableVersion.setCommitMessage(commitDetails.getCommitMessage()); newDeployableVersion.setCommitDate(commitDetails.getCommitDate()); newDeployableVersion.setCommitterAvatarUrl(commitDetails.getCommitterAvatarUrl()); newDeployableVersion.setCommitterName(commitDetails.getCommitterName()); String commitMessage = newDeployableVersion.getCommitMessage(); newDeployableVersion.setCommitMessage(commitMessage == null ? UNKNOWN_COMMIT_FIELD : StringUtils.abbreviate(commitMessage, MAX_COMMIT_MESSAGE_LENGTH)); String commitSha = newDeployableVersion.getGitCommitSha(); newDeployableVersion.setGitCommitSha(commitSha == null ? UNKNOWN_COMMIT_FIELD : StringUtils.abbreviate(commitSha, MAX_COMMIT_FIELDS_LENGTH)); String commitUrl = newDeployableVersion.getCommitUrl(); newDeployableVersion.setCommitUrl(commitUrl == null ? UNKNOWN_COMMIT_FIELD : StringUtils.abbreviate(commitUrl, MAX_COMMIT_FIELDS_LENGTH)); String commitGithubRepositoryUrl = newDeployableVersion.getGithubRepositoryUrl(); newDeployableVersion.setGithubRepositoryUrl(commitGithubRepositoryUrl == null ? UNKNOWN_COMMIT_FIELD : StringUtils.abbreviate(commitGithubRepositoryUrl, MAX_COMMIT_FIELDS_LENGTH)); String committerAvatarUrl = newDeployableVersion.getCommitterAvatarUrl(); newDeployableVersion.setCommitterAvatarUrl(committerAvatarUrl == null ? UNKNOWN_COMMIT_FIELD : StringUtils.abbreviate(committerAvatarUrl, MAX_COMMIT_FIELDS_LENGTH)); String committerName = newDeployableVersion.getCommitterName(); newDeployableVersion.setCommitterName(committerName == null ? UNKNOWN_COMMIT_FIELD :StringUtils.abbreviate(committerName, MAX_COMMIT_FIELDS_LENGTH)); } else { assignJsonResponseToReq(req, HttpStatus.INTERNAL_SERVER_ERROR, "Could not get commit details from GitHub, make sure your GitHub user is well defined."); return; } } deployableVersionDao.addDeployableVersion(newDeployableVersion); assignJsonResponseToReq(req, HttpStatus.CREATED, newDeployableVersion); } }
3,445
322
<gh_stars>100-1000 # # Copyright 2019 <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # This file is part of acados. # # The 2-Clause BSD License # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. 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. # # 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 HOLDER 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.; # # author: <NAME> from tracks.readDataFcn import getTrack from time2spatial import transformProj2Orig,transformOrig2Proj from matplotlib import cm import matplotlib.pyplot as plt import numpy as np def plotTrackProj(simX,filename='LMS_Track.txt', T_opt=None): # load track s=simX[:,0] n=simX[:,1] alpha=simX[:,2] v=simX[:,3] distance=0.12 # transform data [x, y, _, _] = transformProj2Orig(s, n, alpha, v,filename) # plot racetrack map #Setup plot plt.figure() plt.ylim(bottom=-1.75,top=0.35) plt.xlim(left=-1.1,right=1.6) plt.ylabel('y[m]') plt.xlabel('x[m]') # Plot center line [Sref,Xref,Yref,Psiref,_]=getTrack(filename) plt.plot(Xref,Yref,'--',color='k') # Draw Trackboundaries Xboundleft=Xref-distance*np.sin(Psiref) Yboundleft=Yref+distance*np.cos(Psiref) Xboundright=Xref+distance*np.sin(Psiref) Yboundright=Yref-distance*np.cos(Psiref) plt.plot(Xboundleft,Yboundleft,color='k',linewidth=1) plt.plot(Xboundright,Yboundright,color='k',linewidth=1) plt.plot(x,y, '-b') # Draw driven trajectory heatmap = plt.scatter(x,y, c=v, cmap=cm.rainbow, edgecolor='none', marker='o') cbar = plt.colorbar(heatmap, fraction=0.035) cbar.set_label("velocity in [m/s]") ax = plt.gca() ax.set_aspect('equal', 'box') # Put markers for s values xi=np.zeros(9) yi=np.zeros(9) xi1=np.zeros(9) yi1=np.zeros(9) xi2=np.zeros(9) yi2=np.zeros(9) for i in range(int(Sref[-1]) + 1): try: k = list(Sref).index(i + min(abs(Sref - i))) except: k = list(Sref).index(i - min(abs(Sref - i))) [_,nrefi,_,_]=transformOrig2Proj(Xref[k],Yref[k],Psiref[k],0) [xi[i],yi[i],_,_]=transformProj2Orig(Sref[k],nrefi+0.24,0,0) # plt.text(xi[i], yi[i], f'{i}m', fontsize=12,horizontalalignment='center',verticalalignment='center') plt.text(xi[i], yi[i], '{}m'.format(i), fontsize=12,horizontalalignment='center',verticalalignment='center') [xi1[i],yi1[i],_,_]=transformProj2Orig(Sref[k],nrefi+0.12,0,0) [xi2[i],yi2[i],_,_]=transformProj2Orig(Sref[k],nrefi+0.15,0,0) plt.plot([xi1[i],xi2[i]],[yi1[i],yi2[i]],color='black') def plotRes(simX,simU,t): # plot results plt.figure() plt.subplot(2, 1, 1) plt.step(t, simU[:,0], color='r') plt.step(t, simU[:,1], color='g') plt.title('closed-loop simulation') plt.legend(['dD','ddelta']) plt.ylabel('u') plt.xlabel('t') plt.grid(True) plt.subplot(2, 1, 2) plt.plot(t, simX[:,:]) plt.ylabel('x') plt.xlabel('t') plt.legend(['s','n','alpha','v','D','delta']) plt.grid(True) def plotalat(simX,simU,constraint,t): Nsim=t.shape[0] plt.figure() alat=np.zeros(Nsim) for i in range(Nsim): alat[i]=constraint.alat(simX[i,:],simU[i,:]) plt.plot(t,alat) plt.plot([t[0],t[-1]],[constraint.alat_min, constraint.alat_min],'k--') plt.plot([t[0],t[-1]],[constraint.alat_max, constraint.alat_max],'k--') plt.legend(['alat','alat_min/max']) plt.xlabel('t') plt.ylabel('alat[m/s^2]')
2,094