code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
--- layout: post title: 'InstallShield X ์‚ฌ์šฉ๋ฒ• 2. ์ธ์Šคํ†จ๋Ÿฌ ๋นŒ๋“œํ•˜๊ธฐ' author: xinics date: 2010-05-12 12:15 tags: [InstallShield] --- # ์ธ์Šคํ†จ๋Ÿฌ ๋นŒ๋“œ ## ๋ฆด๋ฆฌ์ฆˆ ๊ตฌ์„ฑ ์ƒ๋‹จ์˜ ๋ฉ”๋‰ด์—์„œ Build -> Release Wizard๋ฅผ ์„ ํƒํ•˜์—ฌ, ์ธ์Šคํ†จ๋Ÿฌ์˜ ๋ฐฐํฌ ๋ฐฉ์‹์„ ์„ค์ •ํ•˜๊ณ , ์ธ์Šคํ†จ๋Ÿฌ๋ฅผ ์ž‘์„ฑํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image1.png) * ๋ฐฐํฌํ•  ์ด๋ฆ„์„ ์ง€์ •ํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image2.png) * ์ธ์Šคํ†จ๋Ÿฌ๋ฅผ ๋ฐฐํฌํ•  ๋ฏธ๋””์–ด๋ฅผ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image3.png) * ๋‹จ์ผ ์„ค์น˜ํŒŒ์ผ์„ ์ƒ์„ฑํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image4.png) * ์„ค์น˜์‹œ ์•”ํ˜ธ๋ฅผ ์‚ฌ์šฉํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image5.png) * ํ”„๋กœ๊ทธ๋žจ์ด ์ง€์›ํ•˜๋Š” ํ”Œ๋žซํผ์„ ์„ค์ •ํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image6.png) * ์ง€์›ํ•  ์–ธ์–ด๋ฅผ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image7.png) * ์ธ์Šคํ†จ๋Ÿฌ์— ํฌํ•จ๋  feature๋“ค์„ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image8.png) * feature๋“ค์„ ์–ด๋–ค์‹์œผ๋กœ ๋ฏธ๋””์–ด์— ์ €์žฅํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒํ•œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image9.png) * ์–ด๋–ค UI๋ฅผ ์‚ฌ์šฉํ•  ๊ฒƒ์ธ์ง€ ์„ ํƒํ•œ๋‹ค. ๋‹ค์Œ์˜ ๋ช‡๊ฐ€์ง€ ๊ณผ์ •๋“ค์€ ๊ทธ๋ƒฅ ๋„˜์–ด๊ฐ€๋„ ์ƒ๊ด€์—†๋‹ค. ์˜จ๋ผ์ธ ์„ค์น˜๋‚˜, ์„œ๋ช… ๋“ฑ์„ ์„ค์ •ํ•˜๋Š” ๊ณผ์ •์ด๋‹ค. ![createImage](/files/2010/05/12/Part-2/image10.png) * ๋ฆด๋ฆฌ์ฆˆ ์„ค์ • ์ข…๋ฃŒ ํ•˜๋‹จ์˜ Build the Release๋ฅผ ์ฒดํฌ ํ›„ ๋งˆ์น˜๋ฉด, ๋ฐ”๋กœ ๋นŒ๋“œ๊ฐ€ ๋œ๋‹ค. ![createImage](/files/2010/05/12/Part-2/image11.png)
PaulJo/pauljo.github.io
_posts/2010-05-12-Howto-InstallShieldX-2.Build-Installer.md
Markdown
apache-2.0
1,652
package de.kevinschie.SimulatorListener; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.ObjectInputStream; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.net.URL; import java.net.URLConnection; public class SimulationListener { ObjectInputStream ois; Socket socket; public void listenToSimulator() { try{ new Thread("Device Listener") { public void run() { try ( Socket echoSocket = new Socket("0.0.0.0", 50001); BufferedReader in = new BufferedReader( new InputStreamReader(echoSocket.getInputStream())); ) { System.out.println("TEST"); String line; while ((line = in.readLine()) != null) { System.out.println("echo: " + line); } } catch(Exception ex) { ex.printStackTrace(); } }; }.start(); } catch (Exception ex) { ex.printStackTrace(); } /*try{ System.out.println("Listener lรคuft........."); URL oracle = new URL("http://0.0.0.0:50001/"); URLConnection yc = oracle.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( yc.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); } catch(Exception ex) { ex.printStackTrace(); }*/ /*try { final ServerSocket serverSocket = new ServerSocket(50001); new Thread("Device Listener") { public void run() { try ( ServerSocket serverSocket = new ServerSocket(50001); Socket clientSocket = serverSocket.accept(); PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); BufferedReader in = new BufferedReader( new InputStreamReader(clientSocket.getInputStream())); ) { System.out.println(in.readLine()); } catch (Exception e) { e.printStackTrace(); } }; }.start(); } catch (Exception ex) { ex.printStackTrace(); }*/ } }
kevinschie/carGateway
src/de/kevinschie/SimulatorListener/SimulationListener.java
Java
apache-2.0
2,431
/* ### * IP: GHIDRA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ghidra.feature.vt.api.db; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.ADDRESS_SOURCE_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.ASSOCIATION_KEY_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.DESTINATION_ADDRESS_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.MARKUP_TYPE_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.ORIGINAL_DESTINATION_VALUE_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.SOURCE_ADDRESS_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.SOURCE_VALUE_COL; import static ghidra.feature.vt.api.db.VTMatchMarkupItemTableDBAdapter.MarkupTableDescriptor.STATUS_COL; import ghidra.feature.vt.api.impl.MarkupItemStorage; import ghidra.feature.vt.api.main.VTSession; import ghidra.feature.vt.api.markuptype.VTMarkupTypeFactory; import ghidra.feature.vt.api.util.Stringable; import ghidra.program.database.map.AddressMap; import ghidra.program.model.address.Address; import ghidra.program.model.listing.Program; import ghidra.util.exception.VersionException; import ghidra.util.task.TaskMonitor; import java.io.IOException; import db.*; public class VTMatchMarkupItemTableDBAdapterV0 extends VTMatchMarkupItemTableDBAdapter { private Table table; public VTMatchMarkupItemTableDBAdapterV0(DBHandle dbHandle) throws IOException { table = dbHandle.createTable(TABLE_NAME, TABLE_SCHEMA, INDEXED_COLUMNS); } public VTMatchMarkupItemTableDBAdapterV0(DBHandle dbHandle, OpenMode openMode, TaskMonitor monitor) throws VersionException { table = dbHandle.getTable(TABLE_NAME); if (table == null) { throw new VersionException("Missing Table: " + TABLE_NAME); } else if (table.getSchema().getVersion() != 0) { throw new VersionException("Expected version 0 for table " + TABLE_NAME + " but got " + table.getSchema().getVersion()); } } @Override public DBRecord createMarkupItemRecord(MarkupItemStorage markupItem) throws IOException { DBRecord record = TABLE_SCHEMA.createRecord(table.getKey()); VTAssociationDB association = (VTAssociationDB) markupItem.getAssociation(); VTSession manager = association.getSession(); Program sourceProgram = manager.getSourceProgram(); Program destinationProgram = manager.getDestinationProgram(); record.setLongValue(ASSOCIATION_KEY_COL.column(), association.getKey()); record.setString(ADDRESS_SOURCE_COL.column(), markupItem.getDestinationAddressSource()); record.setLongValue(SOURCE_ADDRESS_COL.column(), getAddressID(sourceProgram, markupItem.getSourceAddress())); Address destinationAddress = markupItem.getDestinationAddress(); if (destinationAddress != null) { record.setLongValue(DESTINATION_ADDRESS_COL.column(), getAddressID(destinationProgram, markupItem.getDestinationAddress())); } record.setShortValue(MARKUP_TYPE_COL.column(), (short) VTMarkupTypeFactory.getID(markupItem.getMarkupType())); record.setString(SOURCE_VALUE_COL.column(), Stringable.getString( markupItem.getSourceValue(), sourceProgram)); record.setString(ORIGINAL_DESTINATION_VALUE_COL.column(), Stringable.getString( markupItem.getDestinationValue(), destinationProgram)); record.setByteValue(STATUS_COL.column(), (byte) markupItem.getStatus().ordinal()); table.putRecord(record); return record; } private long getAddressID(Program program, Address address) { AddressMap addressMap = program.getAddressMap(); return addressMap.getKey(address, false); } @Override public void removeMatchMarkupItemRecord(long key) throws IOException { table.deleteRecord(key); } @Override public RecordIterator getRecords() throws IOException { return table.iterator(); } @Override public RecordIterator getRecords(long associationKey) throws IOException { LongField longField = new LongField(associationKey); return table.indexIterator(ASSOCIATION_KEY_COL.column(), longField, longField, true); } @Override public DBRecord getRecord(long key) throws IOException { return table.getRecord(key); } @Override void updateRecord(DBRecord record) throws IOException { table.putRecord(record); } @Override public int getRecordCount() { return table.getRecordCount(); } }
NationalSecurityAgency/ghidra
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/db/VTMatchMarkupItemTableDBAdapterV0.java
Java
apache-2.0
5,056
package liquibase.datatype.core; import liquibase.database.Database; import liquibase.database.core.DB2Database; import liquibase.database.core.DerbyDatabase; import liquibase.database.core.FirebirdDatabase; import liquibase.database.core.HsqlDatabase; import liquibase.database.core.InformixDatabase; import liquibase.database.core.MSSQLDatabase; import liquibase.database.core.MySQLDatabase; import liquibase.database.core.OracleDatabase; import liquibase.database.core.SQLiteDatabase; import liquibase.database.core.SybaseASADatabase; import liquibase.database.core.SybaseDatabase; import liquibase.datatype.DataTypeInfo; import liquibase.datatype.DatabaseDataType; import liquibase.datatype.LiquibaseDataType; import liquibase.exception.UnexpectedLiquibaseException; import liquibase.statement.DatabaseFunction; @DataTypeInfo(name = "boolean", aliases = {"java.sql.Types.BOOLEAN", "java.lang.Boolean", "bit"}, minParameters = 0, maxParameters = 0, priority = LiquibaseDataType.PRIORITY_DEFAULT) public class BooleanType extends LiquibaseDataType { @Override public DatabaseDataType toDatabaseDataType(Database database) { if (database instanceof DB2Database || database instanceof FirebirdDatabase) { return new DatabaseDataType("SMALLINT"); } else if (database instanceof MSSQLDatabase) { return new DatabaseDataType("BIT"); } else if (database instanceof MySQLDatabase) { if (getRawDefinition().toLowerCase().startsWith("bit")) { return new DatabaseDataType("BIT", getParameters()); } return new DatabaseDataType("BIT", 1); } else if (database instanceof OracleDatabase) { return new DatabaseDataType("NUMBER", 1); } else if (database instanceof SybaseASADatabase || database instanceof SybaseDatabase) { return new DatabaseDataType("BIT"); } else if (database instanceof DerbyDatabase) { if (((DerbyDatabase) database).supportsBooleanDataType()) { return new DatabaseDataType("BOOLEAN"); } else { return new DatabaseDataType("SMALLINT"); } } else if (database instanceof HsqlDatabase) { return new DatabaseDataType("BOOLEAN"); } return super.toDatabaseDataType(database); } @Override public String objectToSql(Object value, Database database) { if (value == null || value.toString().equalsIgnoreCase("null")) { return null; } String returnValue; if (value instanceof String) { if (((String) value).equalsIgnoreCase("true") || value.equals("1") || value.equals("t") || ((String) value).equalsIgnoreCase(this.getTrueBooleanValue(database))) { returnValue = this.getTrueBooleanValue(database); } else if (((String) value).equalsIgnoreCase("false") || value.equals("0") || value.equals("f") || ((String) value).equalsIgnoreCase(this.getFalseBooleanValue(database))) { returnValue = this.getFalseBooleanValue(database); } else { throw new UnexpectedLiquibaseException("Unknown boolean value: " + value); } } else if (value instanceof Long) { if (Long.valueOf(1).equals(value)) { returnValue = this.getTrueBooleanValue(database); } else { returnValue = this.getFalseBooleanValue(database); } } else if (value instanceof Number) { if (value.equals(1)) { returnValue = this.getTrueBooleanValue(database); } else { returnValue = this.getFalseBooleanValue(database); } } else if (value instanceof DatabaseFunction) { return value.toString(); } else if (value instanceof Boolean) { if (((Boolean) value)) { returnValue = this.getTrueBooleanValue(database); } else { returnValue = this.getFalseBooleanValue(database); } } else { throw new UnexpectedLiquibaseException("Cannot convert type "+value.getClass()+" to a boolean value"); } return returnValue; } protected boolean isNumericBoolean(Database database) { if (database instanceof DerbyDatabase) { return !((DerbyDatabase) database).supportsBooleanDataType(); } return database instanceof DB2Database || database instanceof FirebirdDatabase || database instanceof MSSQLDatabase || database instanceof MySQLDatabase || database instanceof OracleDatabase || database instanceof SQLiteDatabase || database instanceof SybaseASADatabase || database instanceof SybaseDatabase; } /** * The database-specific value to use for "false" "boolean" columns. */ public String getFalseBooleanValue(Database database) { if (isNumericBoolean(database)) { return "0"; } if (database instanceof InformixDatabase) { return "'f'"; } return "FALSE"; } /** * The database-specific value to use for "true" "boolean" columns. */ public String getTrueBooleanValue(Database database) { if (isNumericBoolean(database)) { return "1"; } if (database instanceof InformixDatabase) { return "'t'"; } return "TRUE"; } //sqllite // } else if (columnTypeString.toLowerCase(Locale.ENGLISH).contains("boolean") || // columnTypeString.toLowerCase(Locale.ENGLISH).contains("binary")) { // type = new BooleanType("BOOLEAN"); }
adriens/liquibase
liquibase-core/src/main/java/liquibase/datatype/core/BooleanType.java
Java
apache-2.0
5,817
package client import ( "io" "time" "github.com/docker/engine-api/types" "github.com/docker/engine-api/types/container" "github.com/docker/engine-api/types/filters" "github.com/docker/engine-api/types/network" "github.com/docker/engine-api/types/registry" "github.com/docker/engine-api/types/swarm" "golang.org/x/net/context" ) // CommonAPIClient is the common methods between stable and experimental versions of APIClient. type CommonAPIClient interface { ContainerAPIClient ImageAPIClient NodeAPIClient NetworkAPIClient ServiceAPIClient SwarmAPIClient SystemAPIClient VolumeAPIClient ClientVersion() string ServerVersion(ctx context.Context) (types.Version, error) UpdateClientVersion(v string) } // ContainerAPIClient defines API client methods for the containers type ContainerAPIClient interface { ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (types.ContainerCreateResponse, error) ContainerDiff(ctx context.Context, container string) ([]types.ContainerChange, error) ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.ContainerExecCreateResponse, error) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) ContainerKill(ctx context.Context, container, signal string) error ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) ContainerPause(ctx context.Context, container string) error ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error ContainerRename(ctx context.Context, container, newContainerName string) error ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) ContainerStats(ctx context.Context, container string, stream bool) (io.ReadCloser, error) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error ContainerStop(ctx context.Context, container string, timeout *time.Duration) error ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) ContainerUnpause(ctx context.Context, container string) error ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) error ContainerWait(ctx context.Context, container string) (int, error) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error } // ImageAPIClient defines API client methods for the images type ImageAPIClient interface { ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) ImageHistory(ctx context.Context, image string) ([]types.ImageHistory, error) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) ImageInspectWithRaw(ctx context.Context, image string, getSize bool) (types.ImageInspect, []byte, error) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.Image, error) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) ImageTag(ctx context.Context, image, ref string) error } // NetworkAPIClient defines API client methods for the networks type NetworkAPIClient interface { NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) NetworkRemove(ctx context.Context, networkID string) error } // NodeAPIClient defines API client methods for the nodes type NodeAPIClient interface { NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error } // ServiceAPIClient defines API client methods for the services type ServiceAPIClient interface { ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) ServiceInspectWithRaw(ctx context.Context, serviceID string) (swarm.Service, []byte, error) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) ServiceRemove(ctx context.Context, serviceID string) error ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) error TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) } // SwarmAPIClient defines API client methods for the swarm type SwarmAPIClient interface { SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error SwarmLeave(ctx context.Context, force bool) error SwarmInspect(ctx context.Context) (swarm.Swarm, error) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error } // SystemAPIClient defines API client methods for the system type SystemAPIClient interface { Events(ctx context.Context, options types.EventsOptions) (io.ReadCloser, error) Info(ctx context.Context) (types.Info, error) RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error) } // VolumeAPIClient defines API client methods for the volumes type VolumeAPIClient interface { VolumeCreate(ctx context.Context, options types.VolumeCreateRequest) (types.Volume, error) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error) VolumeRemove(ctx context.Context, volumeID string, force bool) error }
thaJeztah/engine-api
client/interface.go
GO
apache-2.0
8,469
package esilatest /* 200 ok object */ type GetCorporationsCorporationIdKillmailsRecent200Ok struct { /* A hash of this killmail */ KillmailHash string `json:"killmail_hash,omitempty"` /* ID of this killmail */ KillmailId int32 `json:"killmail_id,omitempty"` }
antihax/mock-esi
latest/go/model_get_corporations_corporation_id_killmails_recent_200_ok.go
GO
apache-2.0
269
# Copyright 2021 Google 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. """Utilities for generating BigQuery data querying scirpts.""" from google.cloud import aiplatform as vertex_ai def _get_source_query(bq_dataset_name, bq_table_name, ml_use, limit=None): query = f""" SELECT IF(trip_month IS NULL, -1, trip_month) trip_month, IF(trip_day IS NULL, -1, trip_day) trip_day, IF(trip_day_of_week IS NULL, -1, trip_day_of_week) trip_day_of_week, IF(trip_hour IS NULL, -1, trip_hour) trip_hour, IF(trip_seconds IS NULL, -1, trip_seconds) trip_seconds, IF(trip_miles IS NULL, -1, trip_miles) trip_miles, IF(payment_type IS NULL, 'NA', payment_type) payment_type, IF(pickup_grid IS NULL, 'NA', pickup_grid) pickup_grid, IF(dropoff_grid IS NULL, 'NA', dropoff_grid) dropoff_grid, IF(euclidean IS NULL, -1, euclidean) euclidean, IF(loc_cross IS NULL, 'NA', loc_cross) loc_cross""" if ml_use: query += f""", tip_bin FROM {bq_dataset_name}.{bq_table_name} WHERE ML_use = '{ml_use}' """ else: query += f""" FROM {bq_dataset_name}.{bq_table_name} """ if limit: query += f"LIMIT {limit}" return query def get_training_source_query( project, region, dataset_display_name, ml_use, limit=None ): vertex_ai.init(project=project, location=region) dataset = vertex_ai.TabularDataset.list( filter=f"display_name={dataset_display_name}", order_by="update_time" )[-1] bq_source_uri = dataset.gca_resource.metadata["inputConfig"]["bigquerySource"][ "uri" ] _, bq_dataset_name, bq_table_name = bq_source_uri.replace("g://", "").split(".") return _get_source_query(bq_dataset_name, bq_table_name, ml_use, limit) def get_serving_source_query(bq_dataset_name, bq_table_name, limit=None): return _get_source_query(bq_dataset_name, bq_table_name, ml_use=None, limit=limit)
GoogleCloudPlatform/mlops-with-vertex-ai
src/common/datasource_utils.py
Python
apache-2.0
2,483
<?php if(isset($_SESSION["bird"])) { $bird_info = $_SESSION["bird"]; $observers_list = $db->get_observers($bird_info["id_kentish_plover"]); $observers_array = array(); while($observers = $observers_list->fetch()) { array_push($observers_array, array( "date" => $observers["date"], "town" => $observers["town"], "name" => $observers["last_name"] . ' ' . $observers["first_name"] )); } $to_replace = array("\"", "'"); $replace_by = array("ยฃdqot;", "ยฃsqot;"); $bird_info_json = str_replace($to_replace, $replace_by, json_encode($bird_info)); $observers_list_json = str_replace($to_replace, $replace_by, json_encode($observers_array)); ?> <h2>Rรฉsultat de la requรชte</h2> <form method="post" action="core/pdf_creator.php"> <input type="hidden" name="bird_infos" value='<?php echo $bird_info_json ?>'> <input type="hidden" name="observers_list" value='<?php echo $observers_list_json ?>'> <button type="submit" class="btn btn-warning">Obtenir une version PDF</button> </form> <div class="row"> <div class="col-sm-4 padding-content"> <img src="statics/pictures/gonm_logo.jpg" class="img-responsive"> </div> <div class="col-sm-4"> <h2> Historique des observations d'un Gravelot ร  Collier interrompu baguรฉ couleur <i>Charadrius alexandrinus</i> </h2> </div> <div class="col-sm-4 padding-content"> <img src="statics/pictures/plover_2.jpg" class="img-responsive"> </div> </div> <div class="row padding-content"> <div class="col-sm-5"> <div class="col-sm-12"> <table class="table"> <tbody> <tr> <td class="strong">Bague acier</td> <td><?php echo $bird_info["metal_ring"]; ?></td> </tr> <tr> <td class="strong">Numรฉro de la bague</td> <td><?php echo $bird_info["number"]; ?></td> </tr> <tr> <td class="strong">Couleur de la bague</td> <td><?php echo $bird_info["color"]; ?></td> </tr> <tr> <td class="strong">Date du baguage</td> <td><?php echo $bird_info["date"]; ?></td> </tr> <tr> <td class="strong">Age</td> <td><?php echo $bird_info["age"]; ?></td> </tr> <tr> <td class="strong">Sexe</td> <td><?php echo $bird_info["sex"]; ?></td> </tr> <tr> <td class="strong">Lieu de baguage</td> <td><?php echo $bird_info["town"]; ?></td> </tr> <tr> <td class="strong">Bagueur</td> <td><?php echo $bird_info["observer"]; ?></td> </tr> </tbody> </table> </div> <div class="col-sm-12"> <img src="statics/pictures/mnhn.jpg" class="img-responsive"> </div> <div class="col-sm-12"> <img src="statics/pictures/logo_warning.jpg" class="img-responsive"> </div> </div> <div class="col-sm-7"> <table class="table table-striped"> <thead> <tr> <th>Date</th> <th>Lieu d'observation</th> <th>Observateur</th> </tr> </thead> <tbody> <?php $observers_list = $db->get_observers($bird_info["id_kentish_plover"]); while($observers = $observers_list->fetch()) { ?> <tr> <td> <?php $mysql_date = strtotime($observers["date"]); echo date('d-m-Y', $mysql_date); ?> </td> <td><?php echo $observers["town"]; ?></td> <td><?php echo $observers["last_name"] . " " . $observers["first_name"]; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <?php unset($_SESSION["bird"]); } else { header("Location: index.php?url=form"); } ?>
Carmain/Banding-tracking
content/obs_sheet.php
PHP
apache-2.0
3,621
"""Insteon base entity.""" import functools import logging from pyinsteon import devices from homeassistant.core import callback from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, async_dispatcher_send, ) from homeassistant.helpers.entity import DeviceInfo, Entity from .const import ( DOMAIN, SIGNAL_ADD_DEFAULT_LINKS, SIGNAL_LOAD_ALDB, SIGNAL_PRINT_ALDB, SIGNAL_REMOVE_ENTITY, SIGNAL_SAVE_DEVICES, STATE_NAME_LABEL_MAP, ) from .utils import print_aldb_to_log _LOGGER = logging.getLogger(__name__) class InsteonEntity(Entity): """INSTEON abstract base entity.""" def __init__(self, device, group): """Initialize the INSTEON binary sensor.""" self._insteon_device_group = device.groups[group] self._insteon_device = device def __hash__(self): """Return the hash of the Insteon Entity.""" return hash(self._insteon_device) @property def should_poll(self): """No polling needed.""" return False @property def address(self): """Return the address of the node.""" return str(self._insteon_device.address) @property def group(self): """Return the INSTEON group that the entity responds to.""" return self._insteon_device_group.group @property def unique_id(self) -> str: """Return a unique ID.""" if self._insteon_device_group.group == 0x01: uid = self._insteon_device.id else: uid = f"{self._insteon_device.id}_{self._insteon_device_group.group}" return uid @property def name(self): """Return the name of the node (used for Entity_ID).""" # Set a base description if (description := self._insteon_device.description) is None: description = "Unknown Device" # Get an extension label if there is one extension = self._get_label() if extension: extension = f" {extension}" return f"{description} {self._insteon_device.address}{extension}" @property def extra_state_attributes(self): """Provide attributes for display on device card.""" return {"insteon_address": self.address, "insteon_group": self.group} @property def device_info(self) -> DeviceInfo: """Return device information.""" return DeviceInfo( identifiers={(DOMAIN, str(self._insteon_device.address))}, manufacturer="Smart Home", model=f"{self._insteon_device.model} ({self._insteon_device.cat!r}, 0x{self._insteon_device.subcat:02x})", name=f"{self._insteon_device.description} {self._insteon_device.address}", sw_version=f"{self._insteon_device.firmware:02x} Engine Version: {self._insteon_device.engine_version}", via_device=(DOMAIN, str(devices.modem.address)), ) @callback def async_entity_update(self, name, address, value, group): """Receive notification from transport that new data exists.""" _LOGGER.debug( "Received update for device %s group %d value %s", address, group, value, ) self.async_write_ha_state() async def async_added_to_hass(self): """Register INSTEON update events.""" _LOGGER.debug( "Tracking updates for device %s group %d name %s", self.address, self.group, self._insteon_device_group.name, ) self._insteon_device_group.subscribe(self.async_entity_update) load_signal = f"{self.entity_id}_{SIGNAL_LOAD_ALDB}" self.async_on_remove( async_dispatcher_connect(self.hass, load_signal, self._async_read_aldb) ) print_signal = f"{self.entity_id}_{SIGNAL_PRINT_ALDB}" async_dispatcher_connect(self.hass, print_signal, self._print_aldb) default_links_signal = f"{self.entity_id}_{SIGNAL_ADD_DEFAULT_LINKS}" async_dispatcher_connect( self.hass, default_links_signal, self._async_add_default_links ) remove_signal = f"{self._insteon_device.address.id}_{SIGNAL_REMOVE_ENTITY}" self.async_on_remove( async_dispatcher_connect( self.hass, remove_signal, functools.partial(self.async_remove, force_remove=True), ) ) async def async_will_remove_from_hass(self): """Unsubscribe to INSTEON update events.""" _LOGGER.debug( "Remove tracking updates for device %s group %d name %s", self.address, self.group, self._insteon_device_group.name, ) self._insteon_device_group.unsubscribe(self.async_entity_update) async def _async_read_aldb(self, reload): """Call device load process and print to log.""" await self._insteon_device.aldb.async_load(refresh=reload) self._print_aldb() async_dispatcher_send(self.hass, SIGNAL_SAVE_DEVICES) def _print_aldb(self): """Print the device ALDB to the log file.""" print_aldb_to_log(self._insteon_device.aldb) def _get_label(self): """Get the device label for grouped devices.""" label = "" if len(self._insteon_device.groups) > 1: if self._insteon_device_group.name in STATE_NAME_LABEL_MAP: label = STATE_NAME_LABEL_MAP[self._insteon_device_group.name] else: label = f"Group {self.group:d}" return label async def _async_add_default_links(self): """Add default links between the device and the modem.""" await self._insteon_device.async_add_default_links()
aronsky/home-assistant
homeassistant/components/insteon/insteon_entity.py
Python
apache-2.0
5,749
package com.monkeyk.os.service.dto; import com.monkeyk.os.domain.oauth.ClientDetails; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * 2016/6/8 * * @author Shengzhao Li */ public class ClientDetailsListDto implements Serializable { private static final long serialVersionUID = -6327364441565670231L; private String clientId; private List<ClientDetailsDto> clientDetailsDtos = new ArrayList<>(); public ClientDetailsListDto() { } public ClientDetailsListDto(String clientId, List<ClientDetails> list) { this.clientId = clientId; this.clientDetailsDtos = ClientDetailsDto.toDtos(list); } public int getSize() { return clientDetailsDtos.size(); } public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public List<ClientDetailsDto> getClientDetailsDtos() { return clientDetailsDtos; } public void setClientDetailsDtos(List<ClientDetailsDto> clientDetailsDtos) { this.clientDetailsDtos = clientDetailsDtos; } }
monkeyk/oauth2-shiro
authz/src/main/java/com/monkeyk/os/service/dto/ClientDetailsListDto.java
Java
apache-2.0
1,151
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ package org.nd4j.api.loader; import java.io.Serializable; /** * A factory interface for getting {@link Source} objects given a String path * @author Alex Black */ public interface SourceFactory extends Serializable { Source getSource(String path); }
RobAltena/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/api/loader/SourceFactory.java
Java
apache-2.0
1,022
package ch.sourcepond.utils.fileobserver.impl; import static org.mockito.Mockito.mock; import ch.sourcepond.utils.fileobserver.impl.dispatcher.DefaultEventDispatcher; import ch.sourcepond.utils.fileobserver.impl.replay.DefaultEventReplayFactory; /** * @author rolandhauser * */ public class DefaultWorkspaceTest { private final WorkspaceDirectory dir = mock(WorkspaceDirectory.class); private final DefaultEventReplayFactory evenrplFactory = mock(DefaultEventReplayFactory.class); private final DefaultEventDispatcher dispatcher = mock(DefaultEventDispatcher.class); }
SourcePond/fileobserver-impl
src/test/java/ch/sourcepond/utils/fileobserver/impl/DefaultWorkspaceTest.java
Java
apache-2.0
578
//MongoDB script to Update the Wing Directors list. //The list includes Wing Directors and Assistants only. // //History: // 15Nov21 MEG Clean spaces from email addresses. // 07Mar21 MEG Exclude assistants // 27Jan21 MEG Created. var DEBUG = false; var db = db.getSiblingDB( 'NHWG'); // Google Group of interest var baseGroupName = 'nh-wing-directors'; var googleGroup = baseGroupName + '@nhwg.cap.gov'; // Mongo collection that holds all wing groups var groupsCollection = 'GoogleGroups'; // Aggregation pipeline find all wing staff members as var memberPipeline = [ // Stage 1 - find ALL directors and assistants { $match: { Duty:/director/i, Asst: 0, } }, // Stage 2 { $lookup: // join Google account record { from: "Google", localField: "CAPID", foreignField: "customSchemas.Member.CAPID", as: "member" } }, // Stage 3 { // flatten array $unwind: { path : "$member", preserveNullAndEmptyArrays : false // optional } }, // Stage 4 { $project: { CAPID:1, Duty:1, Asst:1, Director: "$member.name.fullName", Email: "$member.primaryEmail", } }, ]; // Aggregate a list of all emails for the Google group of interest // Exlcuding MANAGER & OWNER roles, no group aristocrats var groupMemberPipeline = [ { "$match" : { "group" : googleGroup, "role" : 'MEMBER', } }, { "$project" : { "email" : "$email" } } ]; // pipeline options var options = { "allowDiskUse" : false }; function isActiveMember( capid ) { // Check to see if member is active. // This function needs to be changed for each group depending // on what constitutes "active". var m = db.getCollection( "Member").findOne( { "CAPID": capid, "MbrStatus": "ACTIVE" } ); if ( m == null ) { return false; } return true; } function isGroupMember( group, email ) { // Check if email is already in the group var email = email.toLowerCase(); var rx = new RegExp( email, 'i' ); return db.getCollection( groupsCollection ).findOne( { 'group': group, 'email': rx } ); } function addMembers( collection, pipeline, options, group ) { // Scans looking for active members // if member is not currently on the mailing list generate gam command to add member. // returns a list of members qualified to be on the list regardless of inclusion. var list = []; // the set of possible group members // Get the list of all qualified potential members for the list var cursor = db.getCollection( collection ).aggregate( pipeline, options ); while ( cursor.hasNext() ) { var m = cursor.next(); var email = m.Email.toLowerCase().replace( / /g, "" ); if ( ! isActiveMember( m.CAPID ) ) { continue; } if ( ! list.includes( email ) ) { list.push( email ); } if ( isGroupMember( googleGroup, m.Email ) ) { continue; } // Print gam command to add new member print("gam update group", googleGroup, "add member", email ); } return list; } function removeMembers( collection, pipeline, options, group, authMembers ) { // compare each member of the group against the authList // check active status, if not generate a gam command to remove member. // collection - name of collection holding all Google Group info // pipeline - array containing the pipeline to extract members of the target group // options - options for aggregations pipeline var m = db.getCollection( collection ).aggregate( pipeline, options ); while ( m.hasNext() ) { var e = m.next().email.toLowerCase().replace( / /g, "" ); DEBUG && print("DEBUG::removeMembers::email",e); var rgx = new RegExp( e, "i" ); if ( authMembers.includes( e ) ) { continue; } var r = db.getCollection( 'MbrContact' ).findOne( { Type: 'EMAIL', Priority: 'PRIMARY', Contact: rgx } ); if ( r ) { var a = db.getCollection( 'Member' ).findOne( { CAPID: r.CAPID } ); DEBUG && print("DEBUG::removeMembers::Member.CAPID",a.CAPID,"NameLast:",a.NameLast,"NameFirst:",a.NameFirst); if ( a ) { print( '#INFO:', a.CAPID, a.NameLast, a.NameFirst, a.NameSuffix ); print( 'gam update group', googleGroup, 'delete member', e ); } } } } // Main here print("# Update group:", googleGroup ); print("# Add new members"); var theAuthList = addMembers( "DutyPosition", memberPipeline, options, googleGroup ); DEBUG == true && print("DEBUG::theAuthList:", theAuthList); print( "# Remove inactive members") ; removeMembers( "GoogleGroups", groupMemberPipeline, options, googleGroup, theAuthList );
ifrguy/NHWG-MIMS
src/Groups/wing_directors.js
JavaScript
apache-2.0
4,806
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jul 17 13:50:51 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.security.security_domain.authentication.LoginModuleStackSupplier (BOM: * : All 2.5.0.Final API)</title> <meta name="date" content="2019-07-17"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.security.security_domain.authentication.LoginModuleStackSupplier (BOM: * : All 2.5.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.5.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/authentication/class-use/LoginModuleStackSupplier.html" target="_top">Frames</a></li> <li><a href="LoginModuleStackSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.security.security_domain.authentication.LoginModuleStackSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.security.security_domain.authentication.LoginModuleStackSupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">LoginModuleStackSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.security.security_domain">org.wildfly.swarm.config.security.security_domain</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.security.security_domain"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">LoginModuleStackSupplier</a> in <a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/package-summary.html">org.wildfly.swarm.config.security.security_domain</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/package-summary.html">org.wildfly.swarm.config.security.security_domain</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">LoginModuleStackSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/JaspiAuthentication.html" title="type parameter in JaspiAuthentication">T</a></code></td> <td class="colLast"><span class="typeNameLabel">JaspiAuthentication.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/JaspiAuthentication.html#loginModuleStack-org.wildfly.swarm.config.security.security_domain.authentication.LoginModuleStackSupplier-">loginModuleStack</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">LoginModuleStackSupplier</a>&nbsp;supplier)</code> <div class="block">Install a supplied LoginModuleStack object to the list of subresources</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/security/security_domain/authentication/LoginModuleStackSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain.authentication">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.5.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/authentication/class-use/LoginModuleStackSupplier.html" target="_top">Frames</a></li> <li><a href="LoginModuleStackSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.5.0.Final/apidocs/org/wildfly/swarm/config/security/security_domain/authentication/class-use/LoginModuleStackSupplier.html
HTML
apache-2.0
8,608
package ec.master.assignment1.selection.impl; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; import ec.master.assignment1.model.Individual; import ec.master.assignment1.selection.Selector; /** * @ClassName: FPSelection * @Description: implementation of fitness proportional selection * @date 17/08/2015 11:15:33 pm * */ public class FPSelection implements Selector { /** * The method is do fitness proportional selection * @return selected list */ public List<Individual> doSelection(List<Individual> individuals, int groupSize, int resultSize) { Collections.shuffle(individuals); ArrayList<Individual> selectedIndividuals = new ArrayList<Individual>(resultSize); double sum = 0; //sum all the fitness of each individual for(int i=0;i<individuals.size();i++){ sum += individuals.get(i).getFitness(); } Random random = new Random(); double compare; //select populationSize individuals for (int p = 0; p < resultSize; p++) { compare = random.nextDouble()*sum; for(int i=0;i<individuals.size();i++){ compare -= individuals.get(i).getFitness(); //choose individual when compared value is >former fitness && <later fitness if(compare<=0){ selectedIndividuals.add(individuals.get(i)); break; } } } return selectedIndividuals; } }
nettree/EC
EC_Assignment1/src/ec/master/assignment1/selection/impl/FPSelection.java
Java
apache-2.0
1,373
/* * Copyright 2017 Nobuki HIRAMINE * * 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.hiramine.modelfileloader; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.StringTokenizer; import android.util.Log; public class StlFileLoader { public static MFLModel load( String strPath, OnProgressListener onProgressListener ) { File file = new File( strPath ); if( 0 == file.length() ) { return null; } // ใƒ•ใ‚กใƒผใ‚นใƒˆใƒ‘ใƒผใ‚น๏ผˆ่ฆ็ด ๆ•ฐใ‚ซใ‚ฆใƒณใƒˆ๏ผ‰ int[] aiCountTriangle = new int[1]; int[] aiCountLine = new int[1]; if( !parse_first( strPath, aiCountTriangle, aiCountLine ) ) { return null; } // ้ ˜ๅŸŸ็ขบไฟ if( 0 == aiCountTriangle[0] ) { return null; } float[] af3Vertex = new float[aiCountTriangle[0] * 3 * 3]; // af3Vertexใฏใ€3ใคใฎใƒ‡ใƒผใ‚ฟใงไธ€ใคใฎ้ ‚็‚นใ€ใ•ใ‚‰ใซใใ‚ŒใŒ3ใคใงไธ€ใคใฎไธ‰่ง’ๅฝข // ใ‚ปใ‚ซใƒณใƒ‰ใƒ‘ใƒผใ‚น๏ผˆๅ€ค่ฉฐใ‚๏ผ‰ if( !parse_second( strPath, af3Vertex, aiCountLine[0], onProgressListener ) ) { return null; } // ้ ˜ๅŸŸ็ขบไฟใ€ใƒ‡ใƒผใ‚ฟๆง‹็ฏ‰ MFLModel model = new MFLModel(); model.iCountVertex = af3Vertex.length / 3; model.af3Vertex = af3Vertex; model.iCountTriangle = model.iCountVertex / 3; model.aIndexedTriangle = new MFLIndexedTriangle[model.iCountTriangle]; for( int iIndexTriangle = 0; iIndexTriangle < model.iCountTriangle; ++iIndexTriangle ) { model.aIndexedTriangle[iIndexTriangle] = new MFLIndexedTriangle(); model.aIndexedTriangle[iIndexTriangle].i3IndexVertex[0] = (short)( iIndexTriangle * 3 + 0 ); model.aIndexedTriangle[iIndexTriangle].i3IndexVertex[1] = (short)( iIndexTriangle * 3 + 1 ); model.aIndexedTriangle[iIndexTriangle].i3IndexVertex[2] = (short)( iIndexTriangle * 3 + 2 ); } model.iCountNormal = 0; model.af3Normal = null; model.aMaterial = null; model.groupRoot = new MFLGroup( "" ); model.groupRoot.iCountTriangle = model.iCountTriangle; model.groupRoot.aiIndexTriangle = new int[model.groupRoot.iCountTriangle]; for( int iIndexTriangle = 0; iIndexTriangle < model.groupRoot.iCountTriangle; ++iIndexTriangle ) { model.groupRoot.aiIndexTriangle[iIndexTriangle] = iIndexTriangle; } return model; } private static boolean parse_first( String strPath, int[] aiCountTriangle, int[] aiCountLine ) { // ใ‚คใƒณใƒ—ใƒƒใƒˆใฎใƒใ‚งใƒƒใ‚ฏ if( null == aiCountTriangle || null == aiCountLine ) { return false; } // ใ‚ขใ‚ฆใƒˆใƒ—ใƒƒใƒˆใฎๅˆๆœŸๅŒ– aiCountTriangle[0] = 0; aiCountLine[0] = 0; try { // ่ชญใฟๅ–ใ‚Š BufferedReader br = new BufferedReader( new FileReader( strPath ) ); int iIndexTriangle = 0; int iIndexLine = 0; while( true ) { ++iIndexLine; String strReadString = br.readLine(); if( null == strReadString ) { break; } StringTokenizer stReadString = new StringTokenizer( strReadString, ", \t\r\n" ); if( !stReadString.hasMoreTokens() ) { continue; } String token = stReadString.nextToken(); if( token.equalsIgnoreCase( "endfacet" ) ) { ++iIndexTriangle; continue; } } br.close(); aiCountTriangle[0] = iIndexTriangle; aiCountLine[0] = iIndexLine; return true; } catch( Exception e ) { Log.e( "StlFileLoader", "parse_first error : " + e ); return false; } } private static boolean parse_second( String strPath, float[] af3Vertex, int iCountLine, OnProgressListener onProgressListener ) { // ใ‚คใƒณใƒ—ใƒƒใƒˆใฎใƒใ‚งใƒƒใ‚ฏ if( null == af3Vertex ) { return false; } try { // ่ชญใฟๅ–ใ‚Š BufferedReader br = new BufferedReader( new FileReader( strPath ) ); int iIndexTriangle = 0; int iIndexLine = 0; int iIndex3 = 0; while( true ) { if( null != onProgressListener && 0 == iIndexLine % 100 ) { if( !onProgressListener.updateProgress( iIndexLine, iCountLine ) ) { // ใƒฆใƒผใ‚ถใƒผๆ“ไฝœใซใ‚ˆใ‚‹ๅ‡ฆ็†ไธญๆญข Log.d( "LoaderStlFile", "Cancelled" ); return false; } } ++iIndexLine; String strReadString = br.readLine(); if( null == strReadString ) { break; } StringTokenizer stReadString = new StringTokenizer( strReadString, ", \t\r\n" ); if( !stReadString.hasMoreTokens() ) { continue; } String token = stReadString.nextToken(); if( token.equalsIgnoreCase( "vertex" ) ) { if( 3 <= iIndex3 ) { continue; } af3Vertex[iIndexTriangle * 9 + iIndex3 * 3 + 0] = Float.valueOf( stReadString.nextToken() ); af3Vertex[iIndexTriangle * 9 + iIndex3 * 3 + 1] = Float.valueOf( stReadString.nextToken() ); af3Vertex[iIndexTriangle * 9 + iIndex3 * 3 + 2] = Float.valueOf( stReadString.nextToken() ); ++iIndex3; continue; } else if( token.equalsIgnoreCase( "facet" ) ) { // ้ขๆณ•็ทšใƒ™ใ‚ฏใƒˆใƒซ iIndex3 = 0; continue; } else if( token.equalsIgnoreCase( "endfacet" ) ) { ++iIndexTriangle; continue; } else if( token.equalsIgnoreCase( "solid" ) ) { // ใ‚ฝใƒชใƒƒใƒ‰ๅ continue; } } br.close(); return true; } catch( Exception e ) { Log.e( "StlFileLoader", "parse_second error : " + e ); return false; } } }
nobukihiramine/ModelViewerTutorial
app/src/main/java/com/hiramine/modelfileloader/StlFileLoader.java
Java
apache-2.0
6,007
๏ปฟusing System; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; using Newtonsoft.Json; namespace GovITHub.Auth.Common.Services.Impl { /// <summary> /// Base email sender /// </summary> public abstract class BaseEmailSender : IEmailSender { public EmailProviderSettings Settings { get; set; } protected ILogger<EmailService> Logger { get; set; } protected IHostingEnvironment Env { get; set; } public abstract Task SendEmailAsync(string email, string subject, string message); public BaseEmailSender(EmailProviderSettings settingsValue, ILogger<EmailService> logger, IHostingEnvironment env) { this.Logger = logger; this.Env = env; Settings = settingsValue; } /// <summary> /// Build settings /// </summary> /// <param name="settingsValue">settings</param> protected virtual void Build(string settingsValue) { if (string.IsNullOrEmpty(settingsValue)) { throw new ArgumentNullException("settings"); } Settings = JsonConvert.DeserializeObject<EmailProviderSettings>(settingsValue); if (string.IsNullOrEmpty(Settings.Address)) { throw new ArgumentNullException("settings.Address"); } } } }
gov-ithub/auth-sso
src/GovITHub.Auth.Common/Services/Impl/BaseEmailSender.cs
C#
apache-2.0
1,437
// Copyright 2022 Google 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 com.google.api.ads.admanager.jaxws.v202202; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * * An error that occurs while parsing {@link Statement} objects. * * * <p>Java class for StatementError complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="StatementError"> * &lt;complexContent> * &lt;extension base="{https://www.google.com/apis/ads/publisher/v202202}ApiError"> * &lt;sequence> * &lt;element name="reason" type="{https://www.google.com/apis/ads/publisher/v202202}StatementError.Reason" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StatementError", propOrder = { "reason" }) public class StatementError extends ApiError { @XmlSchemaType(name = "string") protected StatementErrorReason reason; /** * Gets the value of the reason property. * * @return * possible object is * {@link StatementErrorReason } * */ public StatementErrorReason getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link StatementErrorReason } * */ public void setReason(StatementErrorReason value) { this.reason = value; } }
googleads/googleads-java-lib
modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202202/StatementError.java
Java
apache-2.0
2,266
#Stormpath is Joining Okta We are incredibly excited to announce that [Stormpath is joining forces with Okta](https://stormpath.com/blog/stormpaths-new-path?utm_source=github&utm_medium=readme&utm-campaign=okta-announcement). Please visit [the Migration FAQs](https://stormpath.com/oktaplusstormpath?utm_source=github&utm_medium=readme&utm-campaign=okta-announcement) for a detailed look at what this means for Stormpath users. We're available to answer all questions at [support@stormpath.com](mailto:support@stormpath.com). # The content in this repo has moved # ## Everything that was here has now been integrated into [stormpath-sdk-java](https://github.com/stormpath/stormpath-sdk-java) since 1.0.RC5 ##
stormpath/stormpath-spring-security-example
README.md
Markdown
apache-2.0
713
๏ปฟusing System; using NUnit.Framework; using PCLActivitySet.Domain.Recurrence; using PCLActivitySet.Dto.Recurrence; namespace PCLActivitySet.Test.Domain.Recurrence { [TestFixture] public class DateProjectionTest { [Test] public void TranslateProjectionType() { const int periodCount = 1; const EMonth month = EMonth.February; const int dayOfMonth = 3; const EDaysOfWeekExt dayOfWeekExt = EDaysOfWeekExt.Thursday; const EDaysOfWeekFlags dayOfWeekFlags = EDaysOfWeekFlags.Friday; const EWeeksInMonth weekInMonth = EWeeksInMonth.Last; DateProjection prj = new DateProjection(EDateProjectionType.Daily) { PeriodCount = periodCount, Month = month, DayOfMonth = dayOfMonth, DaysOfWeekExt = dayOfWeekExt, DaysOfWeekFlags = dayOfWeekFlags, WeeksInMonth = weekInMonth, }; prj.ProjectionType = EDateProjectionType.Weekly; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Weekly")); prj.ProjectionType = EDateProjectionType.Monthly; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Monthly")); prj.ProjectionType = EDateProjectionType.MonthlyRelative; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Monthly Relative")); prj.ProjectionType = EDateProjectionType.Yearly; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Yearly")); prj.ProjectionType = EDateProjectionType.YearlyRelative; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Yearly Relative")); prj.ProjectionType = EDateProjectionType.Daily; Assert.That(DateProjection.ToShortDescription(prj), Is.EqualTo("Daily")); Assert.That(prj.PeriodCount, Is.EqualTo(periodCount)); Assert.That(prj.Month, Is.EqualTo(month)); Assert.That(prj.DayOfMonth, Is.EqualTo(dayOfMonth)); Assert.That(prj.DaysOfWeekExt, Is.EqualTo(dayOfWeekExt)); Assert.That(prj.DaysOfWeekFlags, Is.EqualTo(dayOfWeekFlags)); Assert.That(prj.WeeksInMonth, Is.EqualTo(weekInMonth)); Assert.That(DateProjection.ToShortDescription(null), Is.EqualTo("None")); } [Test] public void TranslateToInvalidProjectionType() { var prj = new DateProjection(); Assert.That(() => prj.ProjectionType = (EDateProjectionType) int.MaxValue, Throws.TypeOf<InvalidOperationException>()); } } }
Merlin9999/PCLActivitySet
src/PCLActivitySet/PCLActivitySet.Test/Domain/Recurrence/DateProjectionTest.cs
C#
apache-2.0
2,704
๏ปฟusing System; using CJia.Net.Communication; using CJia.Net.Tcp; using CJia.Net.Communication.Messengers; using CJia.Net.Client; namespace CJia.Net.Server { /// <summary> /// Represents a client from a perspective of a server. /// </summary> public interface IServerClient : IMessenger { /// <summary> /// This event is raised when client disconnected from server. /// </summary> event EventHandler Disconnected; /// <summary> /// Unique identifier for this client in server. /// </summary> long ClientId { get; } ///<summary> /// Gets endpoint of remote application. ///</summary> CJiaEndPoint RemoteEndPoint { get; } /// <summary> /// Gets the current communication state. /// </summary> CommunicationStates CommunicationState { get; } /// <summary> /// Disconnects from server. /// </summary> void Disconnect(); } }
leborety/CJia
CJia.Framework/CJia.Net/Server/IServerClient.cs
C#
apache-2.0
1,018
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: sample-weight-meta.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='sample-weight-meta.proto', package='com.webank.ai.fate.common.mlmodel.buffer', syntax='proto3', serialized_options=_b('B\025SampleWeightMetaProto'), serialized_pb=_b('\n\x18sample-weight-meta.proto\x12(com.webank.ai.fate.common.mlmodel.buffer\"S\n\x10SampleWeightMeta\x12\x10\n\x08need_run\x18\x01 \x01(\x08\x12\x1a\n\x12sample_weight_name\x18\x02 \x01(\t\x12\x11\n\tnormalize\x18\x03 \x01(\x08\x42\x17\x42\x15SampleWeightMetaProtob\x06proto3') ) _SAMPLEWEIGHTMETA = _descriptor.Descriptor( name='SampleWeightMeta', full_name='com.webank.ai.fate.common.mlmodel.buffer.SampleWeightMeta', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='need_run', full_name='com.webank.ai.fate.common.mlmodel.buffer.SampleWeightMeta.need_run', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sample_weight_name', full_name='com.webank.ai.fate.common.mlmodel.buffer.SampleWeightMeta.sample_weight_name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='normalize', full_name='com.webank.ai.fate.common.mlmodel.buffer.SampleWeightMeta.normalize', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=70, serialized_end=153, ) DESCRIPTOR.message_types_by_name['SampleWeightMeta'] = _SAMPLEWEIGHTMETA _sym_db.RegisterFileDescriptor(DESCRIPTOR) SampleWeightMeta = _reflection.GeneratedProtocolMessageType('SampleWeightMeta', (_message.Message,), { 'DESCRIPTOR' : _SAMPLEWEIGHTMETA, '__module__' : 'sample_weight_meta_pb2' # @@protoc_insertion_point(class_scope:com.webank.ai.fate.common.mlmodel.buffer.SampleWeightMeta) }) _sym_db.RegisterMessage(SampleWeightMeta) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
FederatedAI/FATE
python/federatedml/protobuf/generated/sample_weight_meta_pb2.py
Python
apache-2.0
3,206
/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package io.kubernetes.client.openapi.models; /** Generated */ public interface V1beta1CronJobSpecFluent< A extends io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent<A>> extends io.kubernetes.client.fluent.Fluent<A> { public java.lang.String getConcurrencyPolicy(); public A withConcurrencyPolicy(java.lang.String concurrencyPolicy); public java.lang.Boolean hasConcurrencyPolicy(); /** Method is deprecated. use withConcurrencyPolicy instead. */ @java.lang.Deprecated public A withNewConcurrencyPolicy(java.lang.String original); public java.lang.Integer getFailedJobsHistoryLimit(); public A withFailedJobsHistoryLimit(java.lang.Integer failedJobsHistoryLimit); public java.lang.Boolean hasFailedJobsHistoryLimit(); /** * This method has been deprecated, please use method buildJobTemplate instead. * * @return The buildable object. */ @java.lang.Deprecated public io.kubernetes.client.openapi.models.V1beta1JobTemplateSpec getJobTemplate(); public io.kubernetes.client.openapi.models.V1beta1JobTemplateSpec buildJobTemplate(); public A withJobTemplate(io.kubernetes.client.openapi.models.V1beta1JobTemplateSpec jobTemplate); public java.lang.Boolean hasJobTemplate(); public io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<A> withNewJobTemplate(); public io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<A> withNewJobTemplateLike(io.kubernetes.client.openapi.models.V1beta1JobTemplateSpec item); public io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<A> editJobTemplate(); public io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<A> editOrNewJobTemplate(); public io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<A> editOrNewJobTemplateLike(io.kubernetes.client.openapi.models.V1beta1JobTemplateSpec item); public java.lang.String getSchedule(); public A withSchedule(java.lang.String schedule); public java.lang.Boolean hasSchedule(); /** Method is deprecated. use withSchedule instead. */ @java.lang.Deprecated public A withNewSchedule(java.lang.String original); public java.lang.Long getStartingDeadlineSeconds(); public A withStartingDeadlineSeconds(java.lang.Long startingDeadlineSeconds); public java.lang.Boolean hasStartingDeadlineSeconds(); public java.lang.Integer getSuccessfulJobsHistoryLimit(); public A withSuccessfulJobsHistoryLimit(java.lang.Integer successfulJobsHistoryLimit); public java.lang.Boolean hasSuccessfulJobsHistoryLimit(); public java.lang.Boolean getSuspend(); public A withSuspend(java.lang.Boolean suspend); public java.lang.Boolean hasSuspend(); public interface JobTemplateNested<N> extends io.kubernetes.client.fluent.Nested<N>, io.kubernetes.client.openapi.models.V1beta1JobTemplateSpecFluent< io.kubernetes.client.openapi.models.V1beta1CronJobSpecFluent.JobTemplateNested<N>> { public N and(); public N endJobTemplate(); } }
kubernetes-client/java
fluent/src/main/java/io/kubernetes/client/openapi/models/V1beta1CronJobSpecFluent.java
Java
apache-2.0
3,688
package com.github.hayataka.hibernatevalidatorsample.context; import java.io.Closeable; /** * tryใงใฎresourceCloseใ‚’่กŒใ†ใŸใ‚ใฎไป•็ต„ * @author hayakawatakahiko */ interface AutoCloseable extends Closeable { /** * ้–‹ๆ”พใ™ในใใƒชใ‚ฝใƒผใ‚นใ‚’้–‰ใ˜ใ‚‹ๅ‡ฆ็†. */ void close(); }
hayataka/hibernateValidatorSample
src/main/java/com/github/hayataka/hibernatevalidatorsample/context/AutoCloseable.java
Java
apache-2.0
297
// +build windows package handlers import ( "syscall" "golang.org/x/crypto/ssh" ) var SyscallSignals = map[ssh.Signal]syscall.Signal{ ssh.SIGABRT: syscall.SIGABRT, ssh.SIGALRM: syscall.SIGALRM, ssh.SIGFPE: syscall.SIGFPE, ssh.SIGHUP: syscall.SIGHUP, ssh.SIGILL: syscall.SIGILL, ssh.SIGINT: syscall.SIGINT, ssh.SIGKILL: syscall.SIGKILL, ssh.SIGPIPE: syscall.SIGPIPE, ssh.SIGQUIT: syscall.SIGQUIT, ssh.SIGSEGV: syscall.SIGSEGV, ssh.SIGTERM: syscall.SIGTERM, } var SSHSignals = map[syscall.Signal]ssh.Signal{ syscall.SIGABRT: ssh.SIGABRT, syscall.SIGALRM: ssh.SIGALRM, syscall.SIGFPE: ssh.SIGFPE, syscall.SIGHUP: ssh.SIGHUP, syscall.SIGILL: ssh.SIGILL, syscall.SIGINT: ssh.SIGINT, syscall.SIGKILL: ssh.SIGKILL, syscall.SIGPIPE: ssh.SIGPIPE, syscall.SIGQUIT: ssh.SIGQUIT, syscall.SIGSEGV: ssh.SIGSEGV, syscall.SIGTERM: ssh.SIGTERM, }
cloudfoundry-incubator/diego-ssh-windows
handlers/signals_windows.go
GO
apache-2.0
867
/* * Copyright 2005-2017 Dozer Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.dozer.vo.interfacerecursion; /** * @author Christoph Goldner */ public interface UserPrime { String getFirstName(); void setFirstName(String aFirstName); String getLastName(); void setLastName(String aLastName); UserGroupPrime getUserGroup(); void setUserGroup(UserGroupPrime aUserGroup); }
STRiDGE/dozer
core/src/test/java/org/dozer/vo/interfacerecursion/UserPrime.java
Java
apache-2.0
973
<html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ATan</title></head> <body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000"> <font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">ATan()</font></b></p> <p><b>่ฏญๆณ•</b></p><blockquote> Result.f = <font color="#3A3966"><b>ATan</b></font>(Value.f)</blockquote> </blockquote> <b>ๆฆ‚่ฆ</b><br><blockquote> Returns the arc-tangent of the specified value. </blockquote><p><b>ๅ‚ๆ•ฐ</b></p><blockquote> <style type="text/css"> table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; } table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; } </style> <table width="90%" class="parameters"> <tr><td width="10%"><i>Value.f</i></td> <td width="90%"> The input value. Its range is not limited. </td></tr> </table> </blockquote><p><b>่ฟ”ๅ›žๅ€ผ</b></p><blockquote> Returns the resulting angle in radian. It can be transformed into degrees using the <a href="degree.html">Degree()</a> function. </blockquote><p><b>ๅค‡ๆณจ</b></p><blockquote> This is the inverse function of <a href="tan.html">Tan()</a>. This function can handle <a href="../reference/variables.html">float and double</a> values. </blockquote><p><b>็คบไพ‹</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">ATan</font>(1) <font color="#3A3966">; will display '0.785398' (pi/4)</font> </font></pre> </blockquote><p><b>ๅ‚้˜…</b></p><blockquote> <a href="tan.html">Tan()</a>, <a href="atanh.html">ATanH()</a>, <a href="degree.html">Degree()</a> </Blockquote><p><b>ๅทฒๆ”ฏๆŒๆ“ไฝœ็ณป็ปŸ </b><Blockquote>ๆ‰€ๆœ‰</Blockquote></p><center>&lt;- <a href=asinh.html>ASinH()</a> - <a href="index.html">Math Index</a> - <a href="atan2.html">ATan2()</a> -&gt;<br><br> </body></html>
PureBasicCN/PureBasicPreference
target_dir/documentation/math/atan.html
HTML
apache-2.0
2,010
// Copyright 2012 the V8 project authors. 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 Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <iostream> // NOLINT(readability/streams) #include "src/v8.h" #include "test/cctest/cctest.h" #include "src/arm/simulator-arm.h" #include "src/base/utils/random-number-generator.h" #include "src/disassembler.h" #include "src/factory.h" #include "src/macro-assembler.h" #include "src/ostreams.h" using namespace v8::base; using namespace v8::internal; // Define these function prototypes to match JSEntryFunction in execution.cc. typedef Object* (*F1)(int x, int p1, int p2, int p3, int p4); typedef Object* (*F2)(int x, int y, int p2, int p3, int p4); typedef Object* (*F3)(void* p0, int p1, int p2, int p3, int p4); typedef Object* (*F4)(void* p0, void* p1, int p2, int p3, int p4); typedef Object* (*F5)(uint32_t p0, void* p1, void* p2, int p3, int p4); #define __ assm. TEST(0) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); __ add(r0, r0, Operand(r1)); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F2 f = FUNCTION_CAST<F2>(code->entry()); int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, 3, 4, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(7, res); } TEST(1) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label L, C; __ mov(r1, Operand(r0)); __ mov(r0, Operand::Zero()); __ b(&C); __ bind(&L); __ add(r0, r0, Operand(r1)); __ sub(r1, r1, Operand(1)); __ bind(&C); __ teq(r1, Operand::Zero()); __ b(ne, &L); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, 100, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(5050, res); } TEST(2) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label L, C; __ mov(r1, Operand(r0)); __ mov(r0, Operand(1)); __ b(&C); __ bind(&L); __ mul(r0, r1, r0); __ sub(r1, r1, Operand(1)); __ bind(&C); __ teq(r1, Operand::Zero()); __ b(ne, &L); __ mov(pc, Operand(lr)); // some relocated stuff here, not executed __ RecordComment("dead code, just testing relocations"); __ mov(r0, Operand(isolate->factory()->true_value())); __ RecordComment("dead code, just testing immediate operands"); __ mov(r0, Operand(-1)); __ mov(r0, Operand(0xFF000000)); __ mov(r0, Operand(0xF0F0F0F0)); __ mov(r0, Operand(0xFFF0FFFF)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, 10, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(3628800, res); } TEST(3) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { int i; char c; int16_t s; } T; T t; Assembler assm(isolate, NULL, 0); Label L, C; __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ mov(r4, Operand(r0)); __ ldr(r0, MemOperand(r4, offsetof(T, i))); __ mov(r2, Operand(r0, ASR, 1)); __ str(r2, MemOperand(r4, offsetof(T, i))); __ ldrsb(r2, MemOperand(r4, offsetof(T, c))); __ add(r0, r2, Operand(r0)); __ mov(r2, Operand(r2, LSL, 2)); __ strb(r2, MemOperand(r4, offsetof(T, c))); __ ldrsh(r2, MemOperand(r4, offsetof(T, s))); __ add(r0, r2, Operand(r0)); __ mov(r2, Operand(r2, ASR, 3)); __ strh(r2, MemOperand(r4, offsetof(T, s))); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.i = 100000; t.c = 10; t.s = 1000; int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(101010, res); CHECK_EQ(100000/2, t.i); CHECK_EQ(10*4, t.c); CHECK_EQ(1000/8, t.s); } TEST(4) { // Test the VFP floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double a; double b; double c; double d; double e; double f; double g; double h; int i; double j; double m; double n; float o; float p; float x; float y; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the doubles and floats. Assembler assm(isolate, NULL, 0); Label L, C; if (CpuFeatures::IsSupported(VFPv3)) { CpuFeatureScope scope(&assm, VFPv3); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ mov(r4, Operand(r0)); __ vldr(d6, r4, offsetof(T, a)); __ vldr(d7, r4, offsetof(T, b)); __ vadd(d5, d6, d7); __ vstr(d5, r4, offsetof(T, c)); __ vmla(d5, d6, d7); __ vmls(d5, d5, d6); __ vmov(r2, r3, d5); __ vmov(d4, r2, r3); __ vstr(d4, r4, offsetof(T, b)); // Load t.x and t.y, switch values, and store back to the struct. __ vldr(s0, r4, offsetof(T, x)); __ vldr(s1, r4, offsetof(T, y)); __ vmov(s2, s0); __ vmov(s0, s1); __ vmov(s1, s2); __ vstr(s0, r4, offsetof(T, x)); __ vstr(s1, r4, offsetof(T, y)); // Move a literal into a register that can be encoded in the instruction. __ vmov(d4, 1.0); __ vstr(d4, r4, offsetof(T, e)); // Move a literal into a register that requires 64 bits to encode. // 0x3ff0000010000000 = 1.000000059604644775390625 __ vmov(d4, 1.000000059604644775390625); __ vstr(d4, r4, offsetof(T, d)); // Convert from floating point to integer. __ vmov(d4, 2.0); __ vcvt_s32_f64(s1, d4); __ vstr(s1, r4, offsetof(T, i)); // Convert from integer to floating point. __ mov(lr, Operand(42)); __ vmov(s1, lr); __ vcvt_f64_s32(d4, s1); __ vstr(d4, r4, offsetof(T, f)); // Convert from fixed point to floating point. __ mov(lr, Operand(2468)); __ vmov(s8, lr); __ vcvt_f64_s32(d4, 2); __ vstr(d4, r4, offsetof(T, j)); // Test vabs. __ vldr(d1, r4, offsetof(T, g)); __ vabs(d0, d1); __ vstr(d0, r4, offsetof(T, g)); __ vldr(d2, r4, offsetof(T, h)); __ vabs(d0, d2); __ vstr(d0, r4, offsetof(T, h)); // Test vneg. __ vldr(d1, r4, offsetof(T, m)); __ vneg(d0, d1); __ vstr(d0, r4, offsetof(T, m)); __ vldr(d1, r4, offsetof(T, n)); __ vneg(d0, d1); __ vstr(d0, r4, offsetof(T, n)); // Test vmov for single-precision immediates. __ vmov(s0, 0.25f); __ vstr(s0, r4, offsetof(T, o)); __ vmov(s0, -16.0f); __ vstr(s0, r4, offsetof(T, p)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.a = 1.5; t.b = 2.75; t.c = 17.17; t.d = 0.0; t.e = 0.0; t.f = 0.0; t.g = -2718.2818; t.h = 31415926.5; t.i = 0; t.j = 0; t.m = -2718.2818; t.n = 123.456; t.x = 4.5; t.y = 9.0; Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); CHECK_EQ(-16.0f, t.p); CHECK_EQ(0.25f, t.o); CHECK_EQ(-123.456, t.n); CHECK_EQ(2718.2818, t.m); CHECK_EQ(2, t.i); CHECK_EQ(2718.2818, t.g); CHECK_EQ(31415926.5, t.h); CHECK_EQ(617.0, t.j); CHECK_EQ(42.0, t.f); CHECK_EQ(1.0, t.e); CHECK_EQ(1.000000059604644775390625, t.d); CHECK_EQ(4.25, t.c); CHECK_EQ(-4.1875, t.b); CHECK_EQ(1.5, t.a); CHECK_EQ(4.5f, t.y); CHECK_EQ(9.0f, t.x); } } TEST(5) { // Test the ARMv7 bitfield instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); if (CpuFeatures::IsSupported(ARMv7)) { CpuFeatureScope scope(&assm, ARMv7); // On entry, r0 = 0xAAAAAAAA = 0b10..10101010. __ ubfx(r0, r0, 1, 12); // 0b00..010101010101 = 0x555 __ sbfx(r0, r0, 0, 5); // 0b11..111111110101 = -11 __ bfc(r0, 1, 3); // 0b11..111111110001 = -15 __ mov(r1, Operand(7)); __ bfi(r0, r1, 3, 3); // 0b11..111111111001 = -7 __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>( CALL_GENERATED_CODE(isolate, f, 0xAAAAAAAA, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(-7, res); } } TEST(6) { // Test saturating instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); __ usat(r1, 8, Operand(r0)); // Sat 0xFFFF to 0-255 = 0xFF. __ usat(r2, 12, Operand(r0, ASR, 9)); // Sat (0xFFFF>>9) to 0-4095 = 0x7F. __ usat(r3, 1, Operand(r0, LSL, 16)); // Sat (0xFFFF<<16) to 0-1 = 0x0. __ add(r0, r1, Operand(r2)); __ add(r0, r0, Operand(r3)); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>( CALL_GENERATED_CODE(isolate, f, 0xFFFF, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(382, res); } enum VCVTTypes { s32_f64, u32_f64 }; static void TestRoundingMode(VCVTTypes types, VFPRoundingMode mode, double value, int expected, bool expected_exception = false) { Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label wrong_exception; __ vmrs(r1); // Set custom FPSCR. __ bic(r2, r1, Operand(kVFPRoundingModeMask | kVFPExceptionMask)); __ orr(r2, r2, Operand(mode)); __ vmsr(r2); // Load value, convert, and move back result to r0 if everything went well. __ vmov(d1, value); switch (types) { case s32_f64: __ vcvt_s32_f64(s0, d1, kFPSCRRounding); break; case u32_f64: __ vcvt_u32_f64(s0, d1, kFPSCRRounding); break; default: UNREACHABLE(); break; } // Check for vfp exceptions __ vmrs(r2); __ tst(r2, Operand(kVFPExceptionMask)); // Check that we behaved as expected. __ b(&wrong_exception, expected_exception ? eq : ne); // There was no exception. Retrieve the result and return. __ vmov(r0, s0); __ mov(pc, Operand(lr)); // The exception behaviour is not what we expected. // Load a special value and return. __ bind(&wrong_exception); __ mov(r0, Operand(11223344)); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); ::printf("res = %d\n", res); CHECK_EQ(expected, res); } TEST(7) { CcTest::InitializeVM(); // Test vfp rounding modes. // s32_f64 (double to integer). TestRoundingMode(s32_f64, RN, 0, 0); TestRoundingMode(s32_f64, RN, 0.5, 0); TestRoundingMode(s32_f64, RN, -0.5, 0); TestRoundingMode(s32_f64, RN, 1.5, 2); TestRoundingMode(s32_f64, RN, -1.5, -2); TestRoundingMode(s32_f64, RN, 123.7, 124); TestRoundingMode(s32_f64, RN, -123.7, -124); TestRoundingMode(s32_f64, RN, 123456.2, 123456); TestRoundingMode(s32_f64, RN, -123456.2, -123456); TestRoundingMode(s32_f64, RN, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(s32_f64, RN, (kMaxInt + 0.49), kMaxInt); TestRoundingMode(s32_f64, RN, (kMaxInt + 1.0), kMaxInt, true); TestRoundingMode(s32_f64, RN, (kMaxInt + 0.5), kMaxInt, true); TestRoundingMode(s32_f64, RN, static_cast<double>(kMinInt), kMinInt); TestRoundingMode(s32_f64, RN, (kMinInt - 0.5), kMinInt); TestRoundingMode(s32_f64, RN, (kMinInt - 1.0), kMinInt, true); TestRoundingMode(s32_f64, RN, (kMinInt - 0.51), kMinInt, true); TestRoundingMode(s32_f64, RM, 0, 0); TestRoundingMode(s32_f64, RM, 0.5, 0); TestRoundingMode(s32_f64, RM, -0.5, -1); TestRoundingMode(s32_f64, RM, 123.7, 123); TestRoundingMode(s32_f64, RM, -123.7, -124); TestRoundingMode(s32_f64, RM, 123456.2, 123456); TestRoundingMode(s32_f64, RM, -123456.2, -123457); TestRoundingMode(s32_f64, RM, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(s32_f64, RM, (kMaxInt + 0.5), kMaxInt); TestRoundingMode(s32_f64, RM, (kMaxInt + 1.0), kMaxInt, true); TestRoundingMode(s32_f64, RM, static_cast<double>(kMinInt), kMinInt); TestRoundingMode(s32_f64, RM, (kMinInt - 0.5), kMinInt, true); TestRoundingMode(s32_f64, RM, (kMinInt + 0.5), kMinInt); TestRoundingMode(s32_f64, RZ, 0, 0); TestRoundingMode(s32_f64, RZ, 0.5, 0); TestRoundingMode(s32_f64, RZ, -0.5, 0); TestRoundingMode(s32_f64, RZ, 123.7, 123); TestRoundingMode(s32_f64, RZ, -123.7, -123); TestRoundingMode(s32_f64, RZ, 123456.2, 123456); TestRoundingMode(s32_f64, RZ, -123456.2, -123456); TestRoundingMode(s32_f64, RZ, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(s32_f64, RZ, (kMaxInt + 0.5), kMaxInt); TestRoundingMode(s32_f64, RZ, (kMaxInt + 1.0), kMaxInt, true); TestRoundingMode(s32_f64, RZ, static_cast<double>(kMinInt), kMinInt); TestRoundingMode(s32_f64, RZ, (kMinInt - 0.5), kMinInt); TestRoundingMode(s32_f64, RZ, (kMinInt - 1.0), kMinInt, true); // u32_f64 (double to integer). // Negative values. TestRoundingMode(u32_f64, RN, -0.5, 0); TestRoundingMode(u32_f64, RN, -123456.7, 0, true); TestRoundingMode(u32_f64, RN, static_cast<double>(kMinInt), 0, true); TestRoundingMode(u32_f64, RN, kMinInt - 1.0, 0, true); TestRoundingMode(u32_f64, RM, -0.5, 0, true); TestRoundingMode(u32_f64, RM, -123456.7, 0, true); TestRoundingMode(u32_f64, RM, static_cast<double>(kMinInt), 0, true); TestRoundingMode(u32_f64, RM, kMinInt - 1.0, 0, true); TestRoundingMode(u32_f64, RZ, -0.5, 0); TestRoundingMode(u32_f64, RZ, -123456.7, 0, true); TestRoundingMode(u32_f64, RZ, static_cast<double>(kMinInt), 0, true); TestRoundingMode(u32_f64, RZ, kMinInt - 1.0, 0, true); // Positive values. // kMaxInt is the maximum *signed* integer: 0x7fffffff. static const uint32_t kMaxUInt = 0xffffffffu; TestRoundingMode(u32_f64, RZ, 0, 0); TestRoundingMode(u32_f64, RZ, 0.5, 0); TestRoundingMode(u32_f64, RZ, 123.7, 123); TestRoundingMode(u32_f64, RZ, 123456.2, 123456); TestRoundingMode(u32_f64, RZ, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(u32_f64, RZ, (kMaxInt + 0.5), kMaxInt); TestRoundingMode(u32_f64, RZ, (kMaxInt + 1.0), static_cast<uint32_t>(kMaxInt) + 1); TestRoundingMode(u32_f64, RZ, (kMaxUInt + 0.5), kMaxUInt); TestRoundingMode(u32_f64, RZ, (kMaxUInt + 1.0), kMaxUInt, true); TestRoundingMode(u32_f64, RM, 0, 0); TestRoundingMode(u32_f64, RM, 0.5, 0); TestRoundingMode(u32_f64, RM, 123.7, 123); TestRoundingMode(u32_f64, RM, 123456.2, 123456); TestRoundingMode(u32_f64, RM, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(u32_f64, RM, (kMaxInt + 0.5), kMaxInt); TestRoundingMode(u32_f64, RM, (kMaxInt + 1.0), static_cast<uint32_t>(kMaxInt) + 1); TestRoundingMode(u32_f64, RM, (kMaxUInt + 0.5), kMaxUInt); TestRoundingMode(u32_f64, RM, (kMaxUInt + 1.0), kMaxUInt, true); TestRoundingMode(u32_f64, RN, 0, 0); TestRoundingMode(u32_f64, RN, 0.5, 0); TestRoundingMode(u32_f64, RN, 1.5, 2); TestRoundingMode(u32_f64, RN, 123.7, 124); TestRoundingMode(u32_f64, RN, 123456.2, 123456); TestRoundingMode(u32_f64, RN, static_cast<double>(kMaxInt), kMaxInt); TestRoundingMode(u32_f64, RN, (kMaxInt + 0.49), kMaxInt); TestRoundingMode(u32_f64, RN, (kMaxInt + 0.5), static_cast<uint32_t>(kMaxInt) + 1); TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.49), kMaxUInt); TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.5), kMaxUInt, true); TestRoundingMode(u32_f64, RN, (kMaxUInt + 1.0), kMaxUInt, true); } TEST(8) { // Test VFP multi load/store with ia_w. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double a; double b; double c; double d; double e; double f; double g; double h; } D; D d; typedef struct { float a; float b; float c; float d; float e; float f; float g; float h; } F; F f; // Create a function that uses vldm/vstm to move some double and // single precision values around in memory. Assembler assm(isolate, NULL, 0); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, a)))); __ vldm(ia_w, r4, d0, d3); __ vldm(ia_w, r4, d4, d7); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, a)))); __ vstm(ia_w, r4, d6, d7); __ vstm(ia_w, r4, d0, d5); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, a)))); __ vldm(ia_w, r4, s0, s3); __ vldm(ia_w, r4, s4, s7); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, a)))); __ vstm(ia_w, r4, s6, s7); __ vstm(ia_w, r4, s0, s5); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 fn = FUNCTION_CAST<F4>(code->entry()); d.a = 1.1; d.b = 2.2; d.c = 3.3; d.d = 4.4; d.e = 5.5; d.f = 6.6; d.g = 7.7; d.h = 8.8; f.a = 1.0; f.b = 2.0; f.c = 3.0; f.d = 4.0; f.e = 5.0; f.f = 6.0; f.g = 7.0; f.h = 8.0; Object* dummy = CALL_GENERATED_CODE(isolate, fn, &d, &f, 0, 0, 0); USE(dummy); CHECK_EQ(7.7, d.a); CHECK_EQ(8.8, d.b); CHECK_EQ(1.1, d.c); CHECK_EQ(2.2, d.d); CHECK_EQ(3.3, d.e); CHECK_EQ(4.4, d.f); CHECK_EQ(5.5, d.g); CHECK_EQ(6.6, d.h); CHECK_EQ(7.0f, f.a); CHECK_EQ(8.0f, f.b); CHECK_EQ(1.0f, f.c); CHECK_EQ(2.0f, f.d); CHECK_EQ(3.0f, f.e); CHECK_EQ(4.0f, f.f); CHECK_EQ(5.0f, f.g); CHECK_EQ(6.0f, f.h); } TEST(9) { // Test VFP multi load/store with ia. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double a; double b; double c; double d; double e; double f; double g; double h; } D; D d; typedef struct { float a; float b; float c; float d; float e; float f; float g; float h; } F; F f; // Create a function that uses vldm/vstm to move some double and // single precision values around in memory. Assembler assm(isolate, NULL, 0); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, a)))); __ vldm(ia, r4, d0, d3); __ add(r4, r4, Operand(4 * 8)); __ vldm(ia, r4, d4, d7); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, a)))); __ vstm(ia, r4, d6, d7); __ add(r4, r4, Operand(2 * 8)); __ vstm(ia, r4, d0, d5); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, a)))); __ vldm(ia, r4, s0, s3); __ add(r4, r4, Operand(4 * 4)); __ vldm(ia, r4, s4, s7); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, a)))); __ vstm(ia, r4, s6, s7); __ add(r4, r4, Operand(2 * 4)); __ vstm(ia, r4, s0, s5); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 fn = FUNCTION_CAST<F4>(code->entry()); d.a = 1.1; d.b = 2.2; d.c = 3.3; d.d = 4.4; d.e = 5.5; d.f = 6.6; d.g = 7.7; d.h = 8.8; f.a = 1.0; f.b = 2.0; f.c = 3.0; f.d = 4.0; f.e = 5.0; f.f = 6.0; f.g = 7.0; f.h = 8.0; Object* dummy = CALL_GENERATED_CODE(isolate, fn, &d, &f, 0, 0, 0); USE(dummy); CHECK_EQ(7.7, d.a); CHECK_EQ(8.8, d.b); CHECK_EQ(1.1, d.c); CHECK_EQ(2.2, d.d); CHECK_EQ(3.3, d.e); CHECK_EQ(4.4, d.f); CHECK_EQ(5.5, d.g); CHECK_EQ(6.6, d.h); CHECK_EQ(7.0f, f.a); CHECK_EQ(8.0f, f.b); CHECK_EQ(1.0f, f.c); CHECK_EQ(2.0f, f.d); CHECK_EQ(3.0f, f.e); CHECK_EQ(4.0f, f.f); CHECK_EQ(5.0f, f.g); CHECK_EQ(6.0f, f.h); } TEST(10) { // Test VFP multi load/store with db_w. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double a; double b; double c; double d; double e; double f; double g; double h; } D; D d; typedef struct { float a; float b; float c; float d; float e; float f; float g; float h; } F; F f; // Create a function that uses vldm/vstm to move some double and // single precision values around in memory. Assembler assm(isolate, NULL, 0); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, h)) + 8)); __ vldm(db_w, r4, d4, d7); __ vldm(db_w, r4, d0, d3); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(D, h)) + 8)); __ vstm(db_w, r4, d0, d5); __ vstm(db_w, r4, d6, d7); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, h)) + 4)); __ vldm(db_w, r4, s4, s7); __ vldm(db_w, r4, s0, s3); __ add(r4, r1, Operand(static_cast<int32_t>(offsetof(F, h)) + 4)); __ vstm(db_w, r4, s0, s5); __ vstm(db_w, r4, s6, s7); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 fn = FUNCTION_CAST<F4>(code->entry()); d.a = 1.1; d.b = 2.2; d.c = 3.3; d.d = 4.4; d.e = 5.5; d.f = 6.6; d.g = 7.7; d.h = 8.8; f.a = 1.0; f.b = 2.0; f.c = 3.0; f.d = 4.0; f.e = 5.0; f.f = 6.0; f.g = 7.0; f.h = 8.0; Object* dummy = CALL_GENERATED_CODE(isolate, fn, &d, &f, 0, 0, 0); USE(dummy); CHECK_EQ(7.7, d.a); CHECK_EQ(8.8, d.b); CHECK_EQ(1.1, d.c); CHECK_EQ(2.2, d.d); CHECK_EQ(3.3, d.e); CHECK_EQ(4.4, d.f); CHECK_EQ(5.5, d.g); CHECK_EQ(6.6, d.h); CHECK_EQ(7.0f, f.a); CHECK_EQ(8.0f, f.b); CHECK_EQ(1.0f, f.c); CHECK_EQ(2.0f, f.d); CHECK_EQ(3.0f, f.e); CHECK_EQ(4.0f, f.f); CHECK_EQ(5.0f, f.g); CHECK_EQ(6.0f, f.h); } TEST(11) { // Test instructions using the carry flag. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { int32_t a; int32_t b; int32_t c; int32_t d; } I; I i; i.a = 0xabcd0001; i.b = 0xabcd0000; Assembler assm(isolate, NULL, 0); // Test HeapObject untagging. __ ldr(r1, MemOperand(r0, offsetof(I, a))); __ mov(r1, Operand(r1, ASR, 1), SetCC); __ adc(r1, r1, Operand(r1), LeaveCC, cs); __ str(r1, MemOperand(r0, offsetof(I, a))); __ ldr(r2, MemOperand(r0, offsetof(I, b))); __ mov(r2, Operand(r2, ASR, 1), SetCC); __ adc(r2, r2, Operand(r2), LeaveCC, cs); __ str(r2, MemOperand(r0, offsetof(I, b))); // Test corner cases. __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r1, ASR, 1), SetCC); // Set the carry. __ adc(r3, r1, Operand(r2)); __ str(r3, MemOperand(r0, offsetof(I, c))); __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r2, ASR, 1), SetCC); // Unset the carry. __ adc(r3, r1, Operand(r2)); __ str(r3, MemOperand(r0, offsetof(I, d))); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy = CALL_GENERATED_CODE(isolate, f, &i, 0, 0, 0, 0); USE(dummy); CHECK_EQ(static_cast<int32_t>(0xabcd0001), i.a); CHECK_EQ(static_cast<int32_t>(0xabcd0000) >> 1, i.b); CHECK_EQ(0x00000000, i.c); CHECK_EQ(static_cast<int32_t>(0xffffffff), i.d); } TEST(12) { // Test chaining of label usages within instructions (issue 1644). CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label target; __ b(eq, &target); __ b(ne, &target); __ bind(&target); __ nop(); } TEST(13) { // Test VFP instructions using registers d16-d31. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); if (!CpuFeatures::IsSupported(VFP32DREGS)) { return; } typedef struct { double a; double b; double c; double x; double y; double z; double i; double j; double k; uint32_t low; uint32_t high; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the doubles and floats. Assembler assm(isolate, NULL, 0); Label L, C; if (CpuFeatures::IsSupported(VFPv3)) { CpuFeatureScope scope(&assm, VFPv3); __ stm(db_w, sp, r4.bit() | lr.bit()); // Load a, b, c into d16, d17, d18. __ mov(r4, Operand(r0)); __ vldr(d16, r4, offsetof(T, a)); __ vldr(d17, r4, offsetof(T, b)); __ vldr(d18, r4, offsetof(T, c)); __ vneg(d25, d16); __ vadd(d25, d25, d17); __ vsub(d25, d25, d18); __ vmul(d25, d25, d25); __ vdiv(d25, d25, d18); __ vmov(d16, d25); __ vsqrt(d17, d25); __ vneg(d17, d17); __ vabs(d17, d17); __ vmla(d18, d16, d17); // Store d16, d17, d18 into a, b, c. __ mov(r4, Operand(r0)); __ vstr(d16, r4, offsetof(T, a)); __ vstr(d17, r4, offsetof(T, b)); __ vstr(d18, r4, offsetof(T, c)); // Load x, y, z into d29-d31. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, x)))); __ vldm(ia_w, r4, d29, d31); // Swap d29 and d30 via r registers. __ vmov(r1, r2, d29); __ vmov(d29, d30); __ vmov(d30, r1, r2); // Convert to and from integer. __ vcvt_s32_f64(s1, d31); __ vcvt_f64_u32(d31, s1); // Store d29-d31 into x, y, z. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, x)))); __ vstm(ia_w, r4, d29, d31); // Move constants into d20, d21, d22 and store into i, j, k. __ vmov(d20, 14.7610017472335499); __ vmov(d21, 16.0); __ mov(r1, Operand(372106121)); __ mov(r2, Operand(1079146608)); __ vmov(d22, VmovIndexLo, r1); __ vmov(d22, VmovIndexHi, r2); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, i)))); __ vstm(ia_w, r4, d20, d22); // Move d22 into low and high. __ vmov(r4, VmovIndexLo, d22); __ str(r4, MemOperand(r0, offsetof(T, low))); __ vmov(r4, VmovIndexHi, d22); __ str(r4, MemOperand(r0, offsetof(T, high))); __ ldm(ia_w, sp, r4.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.a = 1.5; t.b = 2.75; t.c = 17.17; t.x = 1.5; t.y = 2.75; t.z = 17.17; Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); CHECK_EQ(14.7610017472335499, t.a); CHECK_EQ(3.84200491244266251, t.b); CHECK_EQ(73.8818412254460241, t.c); CHECK_EQ(2.75, t.x); CHECK_EQ(1.5, t.y); CHECK_EQ(17.0, t.z); CHECK_EQ(14.7610017472335499, t.i); CHECK_EQ(16.0, t.j); CHECK_EQ(73.8818412254460241, t.k); CHECK_EQ(372106121u, t.low); CHECK_EQ(1079146608u, t.high); } } TEST(14) { // Test the VFP Canonicalized Nan mode. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double left; double right; double add_result; double sub_result; double mul_result; double div_result; } T; T t; // Create a function that makes the four basic operations. Assembler assm(isolate, NULL, 0); // Ensure FPSCR state (as JSEntryStub does). Label fpscr_done; __ vmrs(r1); __ tst(r1, Operand(kVFPDefaultNaNModeControlBit)); __ b(ne, &fpscr_done); __ orr(r1, r1, Operand(kVFPDefaultNaNModeControlBit)); __ vmsr(r1); __ bind(&fpscr_done); __ vldr(d0, r0, offsetof(T, left)); __ vldr(d1, r0, offsetof(T, right)); __ vadd(d2, d0, d1); __ vstr(d2, r0, offsetof(T, add_result)); __ vsub(d2, d0, d1); __ vstr(d2, r0, offsetof(T, sub_result)); __ vmul(d2, d0, d1); __ vstr(d2, r0, offsetof(T, mul_result)); __ vdiv(d2, d0, d1); __ vstr(d2, r0, offsetof(T, div_result)); __ mov(pc, Operand(lr)); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.left = bit_cast<double>(kHoleNanInt64); t.right = 1; t.add_result = 0; t.sub_result = 0; t.mul_result = 0; t.div_result = 0; Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); const uint32_t kArmNanUpper32 = 0x7ff80000; const uint32_t kArmNanLower32 = 0x00000000; #ifdef DEBUG const uint64_t kArmNanInt64 = (static_cast<uint64_t>(kArmNanUpper32) << 32) | kArmNanLower32; CHECK(kArmNanInt64 != kHoleNanInt64); #endif // With VFP2 the sign of the canonicalized Nan is undefined. So // we remove the sign bit for the upper tests. CHECK_EQ(kArmNanUpper32, (bit_cast<int64_t>(t.add_result) >> 32) & 0x7fffffff); CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.add_result) & 0xffffffffu); CHECK_EQ(kArmNanUpper32, (bit_cast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.sub_result) & 0xffffffffu); CHECK_EQ(kArmNanUpper32, (bit_cast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.mul_result) & 0xffffffffu); CHECK_EQ(kArmNanUpper32, (bit_cast<int64_t>(t.div_result) >> 32) & 0x7fffffff); CHECK_EQ(kArmNanLower32, bit_cast<int64_t>(t.div_result) & 0xffffffffu); } #define CHECK_EQ_SPLAT(field, ex) \ CHECK_EQ(ex, t.field[0]); \ CHECK_EQ(ex, t.field[1]); \ CHECK_EQ(ex, t.field[2]); \ CHECK_EQ(ex, t.field[3]); #define CHECK_EQ_32X4(field, ex0, ex1, ex2, ex3) \ CHECK_EQ(ex0, t.field[0]); \ CHECK_EQ(ex1, t.field[1]); \ CHECK_EQ(ex2, t.field[2]); \ CHECK_EQ(ex3, t.field[3]); #define CHECK_ESTIMATE(expected, tolerance, value) \ CHECK_LT((expected) - (tolerance), value); \ CHECK_GT((expected) + (tolerance), value); #define CHECK_ESTIMATE_SPLAT(field, ex, tol) \ CHECK_ESTIMATE(ex, tol, t.field[0]); \ CHECK_ESTIMATE(ex, tol, t.field[1]); \ CHECK_ESTIMATE(ex, tol, t.field[2]); \ CHECK_ESTIMATE(ex, tol, t.field[3]); #define INT32_TO_FLOAT(val) \ std::round(static_cast<float>(bit_cast<int32_t>(val))) #define UINT32_TO_FLOAT(val) \ std::round(static_cast<float>(bit_cast<uint32_t>(val))) TEST(15) { // Test the Neon instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { uint32_t src0; uint32_t src1; uint32_t src2; uint32_t src3; uint32_t src4; uint32_t src5; uint32_t src6; uint32_t src7; uint32_t dst0; uint32_t dst1; uint32_t dst2; uint32_t dst3; uint32_t dst4; uint32_t dst5; uint32_t dst6; uint32_t dst7; uint32_t srcA0; uint32_t srcA1; uint32_t dstA0; uint32_t dstA1; uint32_t dstA2; uint32_t dstA3; uint32_t dstA4; uint32_t dstA5; uint32_t dstA6; uint32_t dstA7; uint32_t lane_test[4]; uint64_t vmov_to_scalar1, vmov_to_scalar2; uint32_t vmov_from_scalar_s8, vmov_from_scalar_u8; uint32_t vmov_from_scalar_s16, vmov_from_scalar_u16; uint32_t vmov_from_scalar_32; uint32_t vmov[4], vmvn[4]; int32_t vcvt_s32_f32[4]; uint32_t vcvt_u32_f32[4]; float vcvt_f32_s32[4], vcvt_f32_u32[4]; uint32_t vdup8[4], vdup16[4], vdup32[4]; float vabsf[4], vnegf[4]; uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4]; uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4]; uint32_t veor[4], vand[4], vorr[4]; float vdupf[4], vaddf[4], vsubf[4], vmulf[4]; uint32_t vmin_s8[4], vmin_u16[4], vmin_s32[4]; uint32_t vmax_s8[4], vmax_u16[4], vmax_s32[4]; uint32_t vadd8[4], vadd16[4], vadd32[4]; uint32_t vsub8[4], vsub16[4], vsub32[4]; uint32_t vmul8[4], vmul16[4], vmul32[4]; uint32_t vceq[4], vceqf[4], vcgef[4], vcgtf[4]; uint32_t vcge_s8[4], vcge_u16[4], vcge_s32[4]; uint32_t vcgt_s8[4], vcgt_u16[4], vcgt_s32[4]; float vrecpe[4], vrecps[4], vrsqrte[4], vrsqrts[4]; float vminf[4], vmaxf[4]; uint32_t vtst[4], vbsl[4]; uint32_t vext[4]; uint32_t vzip8a[4], vzip8b[4], vzip16a[4], vzip16b[4], vzip32a[4], vzip32b[4]; uint32_t vrev64_32[4], vrev64_16[4], vrev64_8[4]; uint32_t vrev32_16[4], vrev32_8[4]; uint32_t vrev16_8[4]; uint32_t vtbl[2], vtbx[2]; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the doubles, floats, and SIMD values. Assembler assm(isolate, NULL, 0); if (CpuFeatures::IsSupported(NEON)) { CpuFeatureScope scope(&assm, NEON); __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); // Move 32 bytes with neon. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, src0)))); __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dst0)))); __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); // Expand 8 bytes into 8 words(16 bits). __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); __ vmovl(NeonU8, q0, d0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA0)))); __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); // The same expansion, but with different source and destination registers. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, srcA0)))); __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); __ vmovl(NeonU8, q1, d1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, dstA4)))); __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); // ARM core register to scalar. __ mov(r4, Operand(0xfffffff8)); __ vmov(d0, 0); __ vmov(NeonS8, d0, 1, r4); __ vmov(NeonS16, d0, 1, r4); __ vmov(NeonS32, d0, 1, r4); __ vstr(d0, r0, offsetof(T, vmov_to_scalar1)); __ vmov(d0, 0); __ vmov(NeonS8, d0, 3, r4); __ vmov(NeonS16, d0, 3, r4); __ vstr(d0, r0, offsetof(T, vmov_to_scalar2)); // Scalar to ARM core register. __ mov(r4, Operand(0xffffff00)); __ mov(r5, Operand(0xffffffff)); __ vmov(d0, r4, r5); __ vmov(NeonS8, r4, d0, 1); __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s8))); __ vmov(NeonU8, r4, d0, 1); __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u8))); __ vmov(NeonS16, r4, d0, 1); __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_s16))); __ vmov(NeonU16, r4, d0, 1); __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_u16))); __ vmov(NeonS32, r4, d0, 1); __ str(r4, MemOperand(r0, offsetof(T, vmov_from_scalar_32))); // vmov for q-registers. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmov(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmov)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vmvn. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmvn(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmvn)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vcvt for q-registers. __ vmov(s0, -1.5); __ vmov(s1, -1); __ vmov(s2, 1); __ vmov(s3, 1.5); __ vcvt_s32_f32(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_s32_f32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vcvt_u32_f32(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_u32_f32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(kMinInt)); __ mov(r5, Operand(kMaxInt)); __ vmov(d0, r4, r5); __ mov(r4, Operand(kMaxUInt32)); __ mov(r5, Operand(kMinInt + 1)); __ vmov(d1, r4, r5); // q0 = [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] __ vcvt_f32_s32(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_s32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vcvt_f32_u32(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcvt_f32_u32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vdup (integer). __ mov(r4, Operand(0xa)); __ vdup(Neon8, q0, r4); __ vdup(Neon16, q1, r4); __ vdup(Neon32, q2, r4); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup8)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdup32)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); // vdup (float). __ vmov(s0, -1.0); __ vdup(q0, s0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vdupf)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); // vabs (float). __ vmov(s0, -1.0); __ vmov(s1, -0.0); __ vmov(s2, 0.0); __ vmov(s3, 1.0); __ vabs(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabsf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vneg (float). __ vneg(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vnegf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vabs (integer). __ mov(r4, Operand(0x7f7f7f7f)); __ mov(r5, Operand(0x01010101)); __ vmov(d0, r4, r5); __ mov(r4, Operand(0xffffffff)); __ mov(r5, Operand(0x80808080)); __ vmov(d1, r4, r5); __ vabs(Neon8, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vabs(Neon16, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vabs(Neon32, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vabs_s32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vneg (integer). __ vneg(Neon8, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vneg(Neon16, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vneg(Neon32, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vneg_s32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // veor. __ mov(r4, Operand(0xaa)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0x55)); __ vdup(Neon16, q1, r4); __ veor(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, veor)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vand. __ mov(r4, Operand(0xff)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0xfe)); __ vdup(Neon16, q1, r4); __ vand(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vand)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vorr. __ mov(r4, Operand(0xaa)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0x55)); __ vdup(Neon16, q1, r4); __ vorr(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vorr)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vmin (float). __ vmov(s4, 2.0); __ vdup(q0, s4); __ vmov(s4, 1.0); __ vdup(q1, s4); __ vmin(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vminf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vmax (float). __ vmov(s4, 2.0); __ vdup(q0, s4); __ vmov(s4, 1.0); __ vdup(q1, s4); __ vmax(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmaxf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vadd (float). __ vmov(s4, 1.0); __ vdup(q0, s4); __ vdup(q1, s4); __ vadd(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vaddf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vsub (float). __ vmov(s4, 2.0); __ vdup(q0, s4); __ vmov(s4, 1.0); __ vdup(q1, s4); __ vsub(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsubf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vmul (float). __ vmov(s4, 2.0); __ vdup(q0, s4); __ vdup(q1, s4); __ vmul(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmulf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vrecpe. __ vmov(s4, 2.0); __ vdup(q0, s4); __ vrecpe(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrecpe)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vrecps. __ vmov(s4, 2.0); __ vdup(q0, s4); __ vmov(s4, 1.5); __ vdup(q1, s4); __ vrecps(q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrecps)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vrsqrte. __ vmov(s4, 4.0); __ vdup(q0, s4); __ vrsqrte(q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrsqrte)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vrsqrts. __ vmov(s4, 2.0); __ vdup(q0, s4); __ vmov(s4, 2.5); __ vdup(q1, s4); __ vrsqrts(q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrsqrts)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vceq (float). __ vmov(s4, 1.0); __ vdup(q0, s4); __ vdup(q1, s4); __ vceq(q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceqf)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vcge (float). __ vmov(s0, 1.0); __ vmov(s1, -1.0); __ vmov(s2, -0.0); __ vmov(s3, 0.0); __ vdup(q1, s3); __ vcge(q2, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcgef)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vcgt(q2, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcgtf)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); // vmin/vmax integer. __ mov(r4, Operand(0x03)); __ vdup(Neon16, q0, r4); __ vdup(Neon8, q1, r4); __ vmin(NeonS8, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmin_s8)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vmax(NeonS8, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmax_s8)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ mov(r4, Operand(0xff)); __ vdup(Neon16, q0, r4); __ vdup(Neon8, q1, r4); __ vmin(NeonU16, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmin_u16)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vmax(NeonU16, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmax_u16)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ mov(r4, Operand(0xff)); __ vdup(Neon32, q0, r4); __ vdup(Neon8, q1, r4); __ vmin(NeonS32, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmin_s32)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vmax(NeonS32, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmax_s32)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); // vadd (integer). __ mov(r4, Operand(0x81)); __ vdup(Neon8, q0, r4); __ mov(r4, Operand(0x82)); __ vdup(Neon8, q1, r4); __ vadd(Neon8, q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x8001)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0x8002)); __ vdup(Neon16, q1, r4); __ vadd(Neon16, q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x80000001)); __ vdup(Neon32, q0, r4); __ mov(r4, Operand(0x80000002)); __ vdup(Neon32, q1, r4); __ vadd(Neon32, q1, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vsub (integer). __ mov(r4, Operand(0x01)); __ vdup(Neon8, q0, r4); __ mov(r4, Operand(0x03)); __ vdup(Neon8, q1, r4); __ vsub(Neon8, q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x0001)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0x0003)); __ vdup(Neon16, q1, r4); __ vsub(Neon16, q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x00000001)); __ vdup(Neon32, q0, r4); __ mov(r4, Operand(0x00000003)); __ vdup(Neon32, q1, r4); __ vsub(Neon32, q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vmul (integer). __ mov(r4, Operand(0x02)); __ vdup(Neon8, q0, r4); __ vmul(Neon8, q1, q0, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x0002)); __ vdup(Neon16, q0, r4); __ vmul(Neon16, q1, q0, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ mov(r4, Operand(0x00000002)); __ vdup(Neon32, q0, r4); __ vmul(Neon32, q1, q0, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vceq. __ mov(r4, Operand(0x03)); __ vdup(Neon8, q0, r4); __ vdup(Neon16, q1, r4); __ vceq(Neon8, q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vceq)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vcge/vcgt (integer). __ mov(r4, Operand(0x03)); __ vdup(Neon16, q0, r4); __ vdup(Neon8, q1, r4); __ vcge(NeonS8, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcge_s8)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vcgt(NeonS8, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcgt_s8)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ mov(r4, Operand(0xff)); __ vdup(Neon16, q0, r4); __ vdup(Neon8, q1, r4); __ vcge(NeonU16, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcge_u16)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vcgt(NeonU16, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcgt_u16)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ mov(r4, Operand(0xff)); __ vdup(Neon32, q0, r4); __ vdup(Neon8, q1, r4); __ vcge(NeonS32, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcge_s32)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); __ vcgt(NeonS32, q2, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vcgt_s32)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); // vtst. __ mov(r4, Operand(0x03)); __ vdup(Neon8, q0, r4); __ mov(r4, Operand(0x02)); __ vdup(Neon16, q1, r4); __ vtst(Neon8, q1, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vtst)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vbsl. __ mov(r4, Operand(0x00ff)); __ vdup(Neon16, q0, r4); __ mov(r4, Operand(0x01)); __ vdup(Neon8, q1, r4); __ mov(r4, Operand(0x02)); __ vdup(Neon8, q2, r4); __ vbsl(q0, q1, q2); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vbsl)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); // vext. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmov(q1, q0); __ vext(q2, q0, q1, 3); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vext)))); __ vst1(Neon8, NeonListOperand(q2), NeonMemOperand(r4)); // vzip. __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmov(q1, q0); __ vzip(Neon8, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip8a)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip8b)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmov(q1, q0); __ vzip(Neon16, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip16a)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip16b)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vmov(q1, q0); __ vzip(Neon32, q0, q1); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip32a)))); __ vst1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vzip32b)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vrev64/32/16 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, lane_test)))); __ vld1(Neon8, NeonListOperand(q0), NeonMemOperand(r4)); __ vrev64(Neon32, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_32)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vrev64(Neon16, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vrev64(Neon8, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev64_8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vrev32(Neon16, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev32_16)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vrev32(Neon8, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev32_8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); __ vrev16(Neon8, q1, q0); __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vrev16_8)))); __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); // vtb[l/x]. __ mov(r4, Operand(0x06040200)); __ mov(r5, Operand(0xff050301)); __ vmov(d2, r4, r5); // d2 = ff05030106040200 __ vtbl(d0, NeonListOperand(d2, 1), d2); __ vstr(d0, r0, offsetof(T, vtbl)); __ vtbx(d2, NeonListOperand(d2, 1), d2); __ vstr(d2, r0, offsetof(T, vtbx)); // Restore and return. __ ldm(ia_w, sp, r4.bit() | r5.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.src0 = 0x01020304; t.src1 = 0x11121314; t.src2 = 0x21222324; t.src3 = 0x31323334; t.src4 = 0x41424344; t.src5 = 0x51525354; t.src6 = 0x61626364; t.src7 = 0x71727374; t.dst0 = 0; t.dst1 = 0; t.dst2 = 0; t.dst3 = 0; t.dst4 = 0; t.dst5 = 0; t.dst6 = 0; t.dst7 = 0; t.srcA0 = 0x41424344; t.srcA1 = 0x81828384; t.dstA0 = 0; t.dstA1 = 0; t.dstA2 = 0; t.dstA3 = 0; t.dstA4 = 0; t.dstA5 = 0; t.dstA6 = 0; t.dstA7 = 0; t.lane_test[0] = 0x03020100; t.lane_test[1] = 0x07060504; t.lane_test[2] = 0x0b0a0908; t.lane_test[3] = 0x0f0e0d0c; Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); CHECK_EQ(0x01020304u, t.dst0); CHECK_EQ(0x11121314u, t.dst1); CHECK_EQ(0x21222324u, t.dst2); CHECK_EQ(0x31323334u, t.dst3); CHECK_EQ(0x41424344u, t.dst4); CHECK_EQ(0x51525354u, t.dst5); CHECK_EQ(0x61626364u, t.dst6); CHECK_EQ(0x71727374u, t.dst7); CHECK_EQ(0x00430044u, t.dstA0); CHECK_EQ(0x00410042u, t.dstA1); CHECK_EQ(0x00830084u, t.dstA2); CHECK_EQ(0x00810082u, t.dstA3); CHECK_EQ(0x00430044u, t.dstA4); CHECK_EQ(0x00410042u, t.dstA5); CHECK_EQ(0x00830084u, t.dstA6); CHECK_EQ(0x00810082u, t.dstA7); CHECK_EQ(0xfffffff8fff8f800u, t.vmov_to_scalar1); CHECK_EQ(0xfff80000f8000000u, t.vmov_to_scalar2); CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s8); CHECK_EQ(0xFFu, t.vmov_from_scalar_u8); CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_s16); CHECK_EQ(0xFFFFu, t.vmov_from_scalar_u16); CHECK_EQ(0xFFFFFFFFu, t.vmov_from_scalar_32); CHECK_EQ_32X4(vmov, 0x03020100u, 0x07060504u, 0x0b0a0908u, 0x0f0e0d0cu); CHECK_EQ_32X4(vmvn, 0xfcfdfeffu, 0xf8f9fafbu, 0xf4f5f6f7u, 0xf0f1f2f3u); CHECK_EQ_SPLAT(vdup8, 0x0a0a0a0au); CHECK_EQ_SPLAT(vdup16, 0x000a000au); CHECK_EQ_SPLAT(vdup32, 0x0000000au); CHECK_EQ_SPLAT(vdupf, -1.0); // src: [-1, -1, 1, 1] CHECK_EQ_32X4(vcvt_s32_f32, -1, -1, 1, 1); CHECK_EQ_32X4(vcvt_u32_f32, 0u, 0u, 1u, 1u); // src: [kMinInt, kMaxInt, kMaxUInt32, kMinInt + 1] CHECK_EQ_32X4(vcvt_f32_s32, INT32_TO_FLOAT(kMinInt), INT32_TO_FLOAT(kMaxInt), INT32_TO_FLOAT(kMaxUInt32), INT32_TO_FLOAT(kMinInt + 1)); CHECK_EQ_32X4(vcvt_f32_u32, UINT32_TO_FLOAT(kMinInt), UINT32_TO_FLOAT(kMaxInt), UINT32_TO_FLOAT(kMaxUInt32), UINT32_TO_FLOAT(kMinInt + 1)); CHECK_EQ_32X4(vabsf, 1.0, 0.0, 0.0, 1.0); CHECK_EQ_32X4(vnegf, 1.0, 0.0, -0.0, -1.0); // src: [0x7f7f7f7f, 0x01010101, 0xffffffff, 0x80808080] CHECK_EQ_32X4(vabs_s8, 0x7f7f7f7fu, 0x01010101u, 0x01010101u, 0x80808080u); CHECK_EQ_32X4(vabs_s16, 0x7f7f7f7fu, 0x01010101u, 0x00010001u, 0x7f807f80u); CHECK_EQ_32X4(vabs_s32, 0x7f7f7f7fu, 0x01010101u, 0x00000001u, 0x7f7f7f80u); CHECK_EQ_32X4(vneg_s8, 0x81818181u, 0xffffffffu, 0x01010101u, 0x80808080u); CHECK_EQ_32X4(vneg_s16, 0x80818081u, 0xfefffeffu, 0x00010001u, 0x7f807f80u); CHECK_EQ_32X4(vneg_s32, 0x80808081u, 0xfefefeffu, 0x00000001u, 0x7f7f7f80u); CHECK_EQ_SPLAT(veor, 0x00ff00ffu); CHECK_EQ_SPLAT(vand, 0x00fe00feu); CHECK_EQ_SPLAT(vorr, 0x00ff00ffu); CHECK_EQ_SPLAT(vaddf, 2.0); CHECK_EQ_SPLAT(vminf, 1.0); CHECK_EQ_SPLAT(vmaxf, 2.0); CHECK_EQ_SPLAT(vsubf, -1.0); CHECK_EQ_SPLAT(vmulf, 4.0); CHECK_ESTIMATE_SPLAT(vrecpe, 0.5f, 0.1f); // 1 / 2 CHECK_EQ_SPLAT(vrecps, -1.0f); // 2 - (2 * 1.5) CHECK_ESTIMATE_SPLAT(vrsqrte, 0.5f, 0.1f); // 1 / sqrt(4) CHECK_EQ_SPLAT(vrsqrts, -1.0f); // (3 - (2 * 2.5)) / 2 CHECK_EQ_SPLAT(vceqf, 0xffffffffu); // [0] >= [-1, 1, -0, 0] CHECK_EQ_32X4(vcgef, 0u, 0xffffffffu, 0xffffffffu, 0xffffffffu); CHECK_EQ_32X4(vcgtf, 0u, 0xffffffffu, 0u, 0u); // [0, 3, 0, 3, ...] and [3, 3, 3, 3, ...] CHECK_EQ_SPLAT(vmin_s8, 0x00030003u); CHECK_EQ_SPLAT(vmax_s8, 0x03030303u); // [0x00ff, 0x00ff, ...] and [0xffff, 0xffff, ...] CHECK_EQ_SPLAT(vmin_u16, 0x00ff00ffu); CHECK_EQ_SPLAT(vmax_u16, 0xffffffffu); // [0x000000ff, 0x000000ff, ...] and [0xffffffff, 0xffffffff, ...] CHECK_EQ_SPLAT(vmin_s32, 0xffffffffu); CHECK_EQ_SPLAT(vmax_s32, 0xffu); CHECK_EQ_SPLAT(vadd8, 0x03030303u); CHECK_EQ_SPLAT(vadd16, 0x00030003u); CHECK_EQ_SPLAT(vadd32, 0x00000003u); CHECK_EQ_SPLAT(vsub8, 0xfefefefeu); CHECK_EQ_SPLAT(vsub16, 0xfffefffeu); CHECK_EQ_SPLAT(vsub32, 0xfffffffeu); CHECK_EQ_SPLAT(vmul8, 0x04040404u); CHECK_EQ_SPLAT(vmul16, 0x00040004u); CHECK_EQ_SPLAT(vmul32, 0x00000004u); CHECK_EQ_SPLAT(vceq, 0x00ff00ffu); // [0, 3, 0, 3, ...] >= [3, 3, 3, 3, ...] CHECK_EQ_SPLAT(vcge_s8, 0x00ff00ffu); CHECK_EQ_SPLAT(vcgt_s8, 0u); // [0x00ff, 0x00ff, ...] >= [0xffff, 0xffff, ...] CHECK_EQ_SPLAT(vcge_u16, 0u); CHECK_EQ_SPLAT(vcgt_u16, 0u); // [0x000000ff, 0x000000ff, ...] >= [0xffffffff, 0xffffffff, ...] CHECK_EQ_SPLAT(vcge_s32, 0xffffffffu); CHECK_EQ_SPLAT(vcgt_s32, 0xffffffffu); CHECK_EQ_SPLAT(vtst, 0x00ff00ffu); CHECK_EQ_SPLAT(vbsl, 0x02010201u); CHECK_EQ_32X4(vext, 0x06050403u, 0x0a090807u, 0x0e0d0c0bu, 0x0201000fu); CHECK_EQ_32X4(vzip8a, 0x01010000u, 0x03030202u, 0x05050404u, 0x07070606u); CHECK_EQ_32X4(vzip8b, 0x09090808u, 0x0b0b0a0au, 0x0d0d0c0cu, 0x0f0f0e0eu); CHECK_EQ_32X4(vzip16a, 0x01000100u, 0x03020302u, 0x05040504u, 0x07060706u); CHECK_EQ_32X4(vzip16b, 0x09080908u, 0x0b0a0b0au, 0x0d0c0d0cu, 0x0f0e0f0eu); CHECK_EQ_32X4(vzip32a, 0x03020100u, 0x03020100u, 0x07060504u, 0x07060504u); CHECK_EQ_32X4(vzip32b, 0x0b0a0908u, 0x0b0a0908u, 0x0f0e0d0cu, 0x0f0e0d0cu); // src: 0 1 2 3 4 5 6 7 8 9 a b c d e f (little endian) CHECK_EQ_32X4(vrev64_32, 0x07060504u, 0x03020100u, 0x0f0e0d0cu, 0x0b0a0908u); CHECK_EQ_32X4(vrev64_16, 0x05040706u, 0x01000302u, 0x0d0c0f0eu, 0x09080b0au); CHECK_EQ_32X4(vrev64_8, 0x04050607u, 0x00010203u, 0x0c0d0e0fu, 0x08090a0bu); CHECK_EQ_32X4(vrev32_16, 0x01000302u, 0x05040706u, 0x09080b0au, 0x0d0c0f0eu); CHECK_EQ_32X4(vrev32_8, 0x00010203u, 0x04050607u, 0x08090a0bu, 0x0c0d0e0fu); CHECK_EQ_32X4(vrev16_8, 0x02030001u, 0x06070405u, 0x0a0b0809u, 0x0e0f0c0du); CHECK_EQ(0x05010400u, t.vtbl[0]); CHECK_EQ(0x00030602u, t.vtbl[1]); CHECK_EQ(0x05010400u, t.vtbx[0]); CHECK_EQ(0xff030602u, t.vtbx[1]); } } TEST(16) { // Test the pkh, uxtb, uxtab and uxtb16 instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { uint32_t src0; uint32_t src1; uint32_t src2; uint32_t dst0; uint32_t dst1; uint32_t dst2; uint32_t dst3; uint32_t dst4; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the doubles and floats. Assembler assm(isolate, NULL, 0); __ stm(db_w, sp, r4.bit() | lr.bit()); __ mov(r4, Operand(r0)); __ ldr(r0, MemOperand(r4, offsetof(T, src0))); __ ldr(r1, MemOperand(r4, offsetof(T, src1))); __ pkhbt(r2, r0, Operand(r1, LSL, 8)); __ str(r2, MemOperand(r4, offsetof(T, dst0))); __ pkhtb(r2, r0, Operand(r1, ASR, 8)); __ str(r2, MemOperand(r4, offsetof(T, dst1))); __ uxtb16(r2, r0, 8); __ str(r2, MemOperand(r4, offsetof(T, dst2))); __ uxtb(r2, r0, 8); __ str(r2, MemOperand(r4, offsetof(T, dst3))); __ ldr(r0, MemOperand(r4, offsetof(T, src2))); __ uxtab(r2, r0, r1, 8); __ str(r2, MemOperand(r4, offsetof(T, dst4))); __ ldm(ia_w, sp, r4.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); t.src0 = 0x01020304; t.src1 = 0x11121314; t.src2 = 0x11121300; t.dst0 = 0; t.dst1 = 0; t.dst2 = 0; t.dst3 = 0; t.dst4 = 0; Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); CHECK_EQ(0x12130304u, t.dst0); CHECK_EQ(0x01021213u, t.dst1); CHECK_EQ(0x00010003u, t.dst2); CHECK_EQ(0x00000003u, t.dst3); CHECK_EQ(0x11121313u, t.dst4); } TEST(17) { // Test generating labels at high addresses. // Should not assert. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); // Generate a code segment that will be longer than 2^24 bytes. Assembler assm(isolate, NULL, 0); for (size_t i = 0; i < 1 << 23 ; ++i) { // 2^23 __ nop(); } Label target; __ b(eq, &target); __ bind(&target); __ nop(); } #define TEST_SDIV(expected_, dividend_, divisor_) \ t.dividend = dividend_; \ t.divisor = divisor_; \ t.result = 0; \ dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); \ CHECK_EQ(expected_, t.result); TEST(sdiv) { // Test the sdiv. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); struct T { int32_t dividend; int32_t divisor; int32_t result; } t; if (CpuFeatures::IsSupported(SUDIV)) { CpuFeatureScope scope(&assm, SUDIV); __ mov(r3, Operand(r0)); __ ldr(r0, MemOperand(r3, offsetof(T, dividend))); __ ldr(r1, MemOperand(r3, offsetof(T, divisor))); __ sdiv(r2, r0, r1); __ str(r2, MemOperand(r3, offsetof(T, result))); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy; TEST_SDIV(0, kMinInt, 0); TEST_SDIV(0, 1024, 0); TEST_SDIV(1073741824, kMinInt, -2); TEST_SDIV(kMinInt, kMinInt, -1); TEST_SDIV(5, 10, 2); TEST_SDIV(3, 10, 3); TEST_SDIV(-5, 10, -2); TEST_SDIV(-3, 10, -3); TEST_SDIV(-5, -10, 2); TEST_SDIV(-3, -10, 3); TEST_SDIV(5, -10, -2); TEST_SDIV(3, -10, -3); USE(dummy); } } #undef TEST_SDIV #define TEST_UDIV(expected_, dividend_, divisor_) \ t.dividend = dividend_; \ t.divisor = divisor_; \ t.result = 0; \ dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); \ CHECK_EQ(expected_, t.result); TEST(udiv) { // Test the udiv. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); struct T { uint32_t dividend; uint32_t divisor; uint32_t result; } t; if (CpuFeatures::IsSupported(SUDIV)) { CpuFeatureScope scope(&assm, SUDIV); __ mov(r3, Operand(r0)); __ ldr(r0, MemOperand(r3, offsetof(T, dividend))); __ ldr(r1, MemOperand(r3, offsetof(T, divisor))); __ sdiv(r2, r0, r1); __ str(r2, MemOperand(r3, offsetof(T, result))); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy; TEST_UDIV(0u, 0, 0); TEST_UDIV(0u, 1024, 0); TEST_UDIV(5u, 10, 2); TEST_UDIV(3u, 10, 3); USE(dummy); } } #undef TEST_UDIV TEST(smmla) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ smmla(r1, r1, r2, r3); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(), z = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, z, 0); CHECK_EQ(bits::SignedMulHighAndAdd32(x, y, z), r); USE(dummy); } } TEST(smmul) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ smmul(r1, r1, r2); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, 0, 0); CHECK_EQ(bits::SignedMulHigh32(x, y), r); USE(dummy); } } TEST(sxtb) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ sxtb(r1, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, 0, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<int8_t>(x)), r); USE(dummy); } } TEST(sxtab) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ sxtab(r1, r2, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<int8_t>(x)) + y, r); USE(dummy); } } TEST(sxth) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ sxth(r1, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, 0, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<int16_t>(x)), r); USE(dummy); } } TEST(sxtah) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ sxtah(r1, r2, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<int16_t>(x)) + y, r); USE(dummy); } } TEST(uxtb) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ uxtb(r1, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, 0, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<uint8_t>(x)), r); USE(dummy); } } TEST(uxtab) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ uxtab(r1, r2, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<uint8_t>(x)) + y, r); USE(dummy); } } TEST(uxth) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ uxth(r1, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, 0, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<uint16_t>(x)), r); USE(dummy); } } TEST(uxtah) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); RandomNumberGenerator* const rng = isolate->random_number_generator(); Assembler assm(isolate, nullptr, 0); __ uxtah(r1, r2, r1); __ str(r1, MemOperand(r0)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); for (size_t i = 0; i < 128; ++i) { int32_t r, x = rng->NextInt(), y = rng->NextInt(); Object* dummy = CALL_GENERATED_CODE(isolate, f, &r, x, y, 0, 0); CHECK_EQ(static_cast<int32_t>(static_cast<uint16_t>(x)) + y, r); USE(dummy); } } #define TEST_RBIT(expected_, input_) \ t.input = input_; \ t.result = 0; \ dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); \ CHECK_EQ(static_cast<uint32_t>(expected_), t.result); TEST(rbit) { CcTest::InitializeVM(); Isolate* const isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, nullptr, 0); if (CpuFeatures::IsSupported(ARMv7)) { CpuFeatureScope scope(&assm, ARMv7); typedef struct { uint32_t input; uint32_t result; } T; T t; __ ldr(r1, MemOperand(r0, offsetof(T, input))); __ rbit(r1, r1); __ str(r1, MemOperand(r0, offsetof(T, result))); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef OBJECT_PRINT code->Print(std::cout); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy = NULL; TEST_RBIT(0xffffffff, 0xffffffff); TEST_RBIT(0x00000000, 0x00000000); TEST_RBIT(0xffff0000, 0x0000ffff); TEST_RBIT(0xff00ff00, 0x00ff00ff); TEST_RBIT(0xf0f0f0f0, 0x0f0f0f0f); TEST_RBIT(0x1e6a2c48, 0x12345678); USE(dummy); } } TEST(code_relative_offset) { // Test extracting the offset of a label from the beginning of the code // in a register. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); // Initialize a code object that will contain the code. Handle<Object> code_object(isolate->heap()->undefined_value(), isolate); Assembler assm(isolate, NULL, 0); Label start, target_away, target_faraway; __ stm(db_w, sp, r4.bit() | r5.bit() | lr.bit()); // r3 is used as the address zero, the test will crash when we load it. __ mov(r3, Operand::Zero()); // r5 will be a pointer to the start of the code. __ mov(r5, Operand(code_object)); __ mov_label_offset(r4, &start); __ mov_label_offset(r1, &target_faraway); __ str(r1, MemOperand(sp, kPointerSize, NegPreIndex)); __ mov_label_offset(r1, &target_away); // Jump straight to 'target_away' the first time and use the relative // position the second time. This covers the case when extracting the // position of a label which is linked. __ mov(r2, Operand::Zero()); __ bind(&start); __ cmp(r2, Operand::Zero()); __ b(eq, &target_away); __ add(pc, r5, r1); // Emit invalid instructions to push the label between 2^8 and 2^16 // instructions away. The test will crash if they are reached. for (int i = 0; i < (1 << 10); i++) { __ ldr(r3, MemOperand(r3)); } __ bind(&target_away); // This will be hit twice: r0 = r0 + 5 + 5. __ add(r0, r0, Operand(5)); __ ldr(r1, MemOperand(sp, kPointerSize, PostIndex), ne); __ add(pc, r5, r4, LeaveCC, ne); __ mov(r2, Operand(1)); __ b(&start); // Emit invalid instructions to push the label between 2^16 and 2^24 // instructions away. The test will crash if they are reached. for (int i = 0; i < (1 << 21); i++) { __ ldr(r3, MemOperand(r3)); } __ bind(&target_faraway); // r0 = r0 + 5 + 5 + 11 __ add(r0, r0, Operand(11)); __ ldm(ia_w, sp, r4.bit() | r5.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), code_object); F1 f = FUNCTION_CAST<F1>(code->entry()); int res = reinterpret_cast<int>(CALL_GENERATED_CODE(isolate, f, 21, 0, 0, 0, 0)); ::printf("f() = %d\n", res); CHECK_EQ(42, res); } TEST(msr_mrs) { // Test msr and mrs. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); // Create a helper function: // void TestMsrMrs(uint32_t nzcv, // uint32_t * result_conditionals, // uint32_t * result_mrs); __ msr(CPSR_f, Operand(r0)); // Test that the condition flags have taken effect. __ mov(r3, Operand(0)); __ orr(r3, r3, Operand(1 << 31), LeaveCC, mi); // N __ orr(r3, r3, Operand(1 << 30), LeaveCC, eq); // Z __ orr(r3, r3, Operand(1 << 29), LeaveCC, cs); // C __ orr(r3, r3, Operand(1 << 28), LeaveCC, vs); // V __ str(r3, MemOperand(r1)); // Also check mrs, ignoring everything other than the flags. __ mrs(r3, CPSR); __ and_(r3, r3, Operand(kSpecialCondition)); __ str(r3, MemOperand(r2)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F5 f = FUNCTION_CAST<F5>(code->entry()); Object* dummy = nullptr; USE(dummy); #define CHECK_MSR_MRS(n, z, c, v) \ do { \ uint32_t nzcv = (n << 31) | (z << 30) | (c << 29) | (v << 28); \ uint32_t result_conditionals = -1; \ uint32_t result_mrs = -1; \ dummy = CALL_GENERATED_CODE(isolate, f, nzcv, &result_conditionals, \ &result_mrs, 0, 0); \ CHECK_EQ(nzcv, result_conditionals); \ CHECK_EQ(nzcv, result_mrs); \ } while (0); // N Z C V CHECK_MSR_MRS(0, 0, 0, 0); CHECK_MSR_MRS(0, 0, 0, 1); CHECK_MSR_MRS(0, 0, 1, 0); CHECK_MSR_MRS(0, 0, 1, 1); CHECK_MSR_MRS(0, 1, 0, 0); CHECK_MSR_MRS(0, 1, 0, 1); CHECK_MSR_MRS(0, 1, 1, 0); CHECK_MSR_MRS(0, 1, 1, 1); CHECK_MSR_MRS(1, 0, 0, 0); CHECK_MSR_MRS(1, 0, 0, 1); CHECK_MSR_MRS(1, 0, 1, 0); CHECK_MSR_MRS(1, 0, 1, 1); CHECK_MSR_MRS(1, 1, 0, 0); CHECK_MSR_MRS(1, 1, 0, 1); CHECK_MSR_MRS(1, 1, 1, 0); CHECK_MSR_MRS(1, 1, 1, 1); #undef CHECK_MSR_MRS } TEST(ARMv8_float32_vrintX) { // Test the vrintX floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { float input; float ar; float nr; float mr; float pr; float zr; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the floats. Assembler assm(isolate, NULL, 0); Label L, C; if (CpuFeatures::IsSupported(ARMv8)) { CpuFeatureScope scope(&assm, ARMv8); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ mov(r4, Operand(r0)); // Test vrinta __ vldr(s6, r4, offsetof(T, input)); __ vrinta(s5, s6); __ vstr(s5, r4, offsetof(T, ar)); // Test vrintn __ vldr(s6, r4, offsetof(T, input)); __ vrintn(s5, s6); __ vstr(s5, r4, offsetof(T, nr)); // Test vrintp __ vldr(s6, r4, offsetof(T, input)); __ vrintp(s5, s6); __ vstr(s5, r4, offsetof(T, pr)); // Test vrintm __ vldr(s6, r4, offsetof(T, input)); __ vrintm(s5, s6); __ vstr(s5, r4, offsetof(T, mr)); // Test vrintz __ vldr(s6, r4, offsetof(T, input)); __ vrintz(s5, s6); __ vstr(s5, r4, offsetof(T, zr)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy = nullptr; USE(dummy); #define CHECK_VRINT(input_val, ares, nres, mres, pres, zres) \ t.input = input_val; \ dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); \ CHECK_EQ(ares, t.ar); \ CHECK_EQ(nres, t.nr); \ CHECK_EQ(mres, t.mr); \ CHECK_EQ(pres, t.pr); \ CHECK_EQ(zres, t.zr); CHECK_VRINT(-0.5, -1.0, -0.0, -1.0, -0.0, -0.0) CHECK_VRINT(-0.6, -1.0, -1.0, -1.0, -0.0, -0.0) CHECK_VRINT(-1.1, -1.0, -1.0, -2.0, -1.0, -1.0) CHECK_VRINT(0.5, 1.0, 0.0, 0.0, 1.0, 0.0) CHECK_VRINT(0.6, 1.0, 1.0, 0.0, 1.0, 0.0) CHECK_VRINT(1.1, 1.0, 1.0, 1.0, 2.0, 1.0) float inf = std::numeric_limits<float>::infinity(); CHECK_VRINT(inf, inf, inf, inf, inf, inf) CHECK_VRINT(-inf, -inf, -inf, -inf, -inf, -inf) CHECK_VRINT(-0.0, -0.0, -0.0, -0.0, -0.0, -0.0) // Check NaN propagation. float nan = std::numeric_limits<float>::quiet_NaN(); t.input = nan; dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); CHECK_EQ(bit_cast<int32_t>(nan), bit_cast<int32_t>(t.ar)); CHECK_EQ(bit_cast<int32_t>(nan), bit_cast<int32_t>(t.nr)); CHECK_EQ(bit_cast<int32_t>(nan), bit_cast<int32_t>(t.mr)); CHECK_EQ(bit_cast<int32_t>(nan), bit_cast<int32_t>(t.pr)); CHECK_EQ(bit_cast<int32_t>(nan), bit_cast<int32_t>(t.zr)); #undef CHECK_VRINT } } TEST(ARMv8_vrintX) { // Test the vrintX floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { double input; double ar; double nr; double mr; double pr; double zr; } T; T t; // Create a function that accepts &t, and loads, manipulates, and stores // the doubles and floats. Assembler assm(isolate, NULL, 0); Label L, C; if (CpuFeatures::IsSupported(ARMv8)) { CpuFeatureScope scope(&assm, ARMv8); __ mov(ip, Operand(sp)); __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ mov(r4, Operand(r0)); // Test vrinta __ vldr(d6, r4, offsetof(T, input)); __ vrinta(d5, d6); __ vstr(d5, r4, offsetof(T, ar)); // Test vrintn __ vldr(d6, r4, offsetof(T, input)); __ vrintn(d5, d6); __ vstr(d5, r4, offsetof(T, nr)); // Test vrintp __ vldr(d6, r4, offsetof(T, input)); __ vrintp(d5, d6); __ vstr(d5, r4, offsetof(T, pr)); // Test vrintm __ vldr(d6, r4, offsetof(T, input)); __ vrintm(d5, d6); __ vstr(d5, r4, offsetof(T, mr)); // Test vrintz __ vldr(d6, r4, offsetof(T, input)); __ vrintz(d5, d6); __ vstr(d5, r4, offsetof(T, zr)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy = nullptr; USE(dummy); #define CHECK_VRINT(input_val, ares, nres, mres, pres, zres) \ t.input = input_val; \ dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); \ CHECK_EQ(ares, t.ar); \ CHECK_EQ(nres, t.nr); \ CHECK_EQ(mres, t.mr); \ CHECK_EQ(pres, t.pr); \ CHECK_EQ(zres, t.zr); CHECK_VRINT(-0.5, -1.0, -0.0, -1.0, -0.0, -0.0) CHECK_VRINT(-0.6, -1.0, -1.0, -1.0, -0.0, -0.0) CHECK_VRINT(-1.1, -1.0, -1.0, -2.0, -1.0, -1.0) CHECK_VRINT(0.5, 1.0, 0.0, 0.0, 1.0, 0.0) CHECK_VRINT(0.6, 1.0, 1.0, 0.0, 1.0, 0.0) CHECK_VRINT(1.1, 1.0, 1.0, 1.0, 2.0, 1.0) double inf = std::numeric_limits<double>::infinity(); CHECK_VRINT(inf, inf, inf, inf, inf, inf) CHECK_VRINT(-inf, -inf, -inf, -inf, -inf, -inf) CHECK_VRINT(-0.0, -0.0, -0.0, -0.0, -0.0, -0.0) // Check NaN propagation. double nan = std::numeric_limits<double>::quiet_NaN(); t.input = nan; dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.ar)); CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.nr)); CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.mr)); CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.pr)); CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.zr)); #undef CHECK_VRINT } } TEST(ARMv8_vsel) { // Test the vsel floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); // Used to indicate whether a condition passed or failed. static constexpr float kResultPass = 1.0f; static constexpr float kResultFail = -kResultPass; struct ResultsF32 { float vseleq_; float vselge_; float vselgt_; float vselvs_; // The following conditions aren't architecturally supported, but the // assembler implements them by swapping the inputs. float vselne_; float vsellt_; float vselle_; float vselvc_; }; struct ResultsF64 { double vseleq_; double vselge_; double vselgt_; double vselvs_; // The following conditions aren't architecturally supported, but the // assembler implements them by swapping the inputs. double vselne_; double vsellt_; double vselle_; double vselvc_; }; if (CpuFeatures::IsSupported(ARMv8)) { CpuFeatureScope scope(&assm, ARMv8); // Create a helper function: // void TestVsel(uint32_t nzcv, // ResultsF32* results_f32, // ResultsF64* results_f64); __ msr(CPSR_f, Operand(r0)); __ vmov(s1, kResultPass); __ vmov(s2, kResultFail); __ vsel(eq, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vseleq_)); __ vsel(ge, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselge_)); __ vsel(gt, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselgt_)); __ vsel(vs, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselvs_)); __ vsel(ne, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselne_)); __ vsel(lt, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vsellt_)); __ vsel(le, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselle_)); __ vsel(vc, s0, s1, s2); __ vstr(s0, r1, offsetof(ResultsF32, vselvc_)); __ vmov(d1, kResultPass); __ vmov(d2, kResultFail); __ vsel(eq, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vseleq_)); __ vsel(ge, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselge_)); __ vsel(gt, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselgt_)); __ vsel(vs, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselvs_)); __ vsel(ne, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselne_)); __ vsel(lt, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vsellt_)); __ vsel(le, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselle_)); __ vsel(vc, d0, d1, d2); __ vstr(d0, r2, offsetof(ResultsF64, vselvc_)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F5 f = FUNCTION_CAST<F5>(code->entry()); Object* dummy = nullptr; USE(dummy); STATIC_ASSERT(kResultPass == -kResultFail); #define CHECK_VSEL(n, z, c, v, vseleq, vselge, vselgt, vselvs) \ do { \ ResultsF32 results_f32; \ ResultsF64 results_f64; \ uint32_t nzcv = (n << 31) | (z << 30) | (c << 29) | (v << 28); \ dummy = CALL_GENERATED_CODE(isolate, f, nzcv, &results_f32, &results_f64, \ 0, 0); \ CHECK_EQ(vseleq, results_f32.vseleq_); \ CHECK_EQ(vselge, results_f32.vselge_); \ CHECK_EQ(vselgt, results_f32.vselgt_); \ CHECK_EQ(vselvs, results_f32.vselvs_); \ CHECK_EQ(-vseleq, results_f32.vselne_); \ CHECK_EQ(-vselge, results_f32.vsellt_); \ CHECK_EQ(-vselgt, results_f32.vselle_); \ CHECK_EQ(-vselvs, results_f32.vselvc_); \ CHECK_EQ(vseleq, results_f64.vseleq_); \ CHECK_EQ(vselge, results_f64.vselge_); \ CHECK_EQ(vselgt, results_f64.vselgt_); \ CHECK_EQ(vselvs, results_f64.vselvs_); \ CHECK_EQ(-vseleq, results_f64.vselne_); \ CHECK_EQ(-vselge, results_f64.vsellt_); \ CHECK_EQ(-vselgt, results_f64.vselle_); \ CHECK_EQ(-vselvs, results_f64.vselvc_); \ } while (0); // N Z C V vseleq vselge vselgt vselvs CHECK_VSEL(0, 0, 0, 0, kResultFail, kResultPass, kResultPass, kResultFail); CHECK_VSEL(0, 0, 0, 1, kResultFail, kResultFail, kResultFail, kResultPass); CHECK_VSEL(0, 0, 1, 0, kResultFail, kResultPass, kResultPass, kResultFail); CHECK_VSEL(0, 0, 1, 1, kResultFail, kResultFail, kResultFail, kResultPass); CHECK_VSEL(0, 1, 0, 0, kResultPass, kResultPass, kResultFail, kResultFail); CHECK_VSEL(0, 1, 0, 1, kResultPass, kResultFail, kResultFail, kResultPass); CHECK_VSEL(0, 1, 1, 0, kResultPass, kResultPass, kResultFail, kResultFail); CHECK_VSEL(0, 1, 1, 1, kResultPass, kResultFail, kResultFail, kResultPass); CHECK_VSEL(1, 0, 0, 0, kResultFail, kResultFail, kResultFail, kResultFail); CHECK_VSEL(1, 0, 0, 1, kResultFail, kResultPass, kResultPass, kResultPass); CHECK_VSEL(1, 0, 1, 0, kResultFail, kResultFail, kResultFail, kResultFail); CHECK_VSEL(1, 0, 1, 1, kResultFail, kResultPass, kResultPass, kResultPass); CHECK_VSEL(1, 1, 0, 0, kResultPass, kResultFail, kResultFail, kResultFail); CHECK_VSEL(1, 1, 0, 1, kResultPass, kResultPass, kResultFail, kResultPass); CHECK_VSEL(1, 1, 1, 0, kResultPass, kResultFail, kResultFail, kResultFail); CHECK_VSEL(1, 1, 1, 1, kResultPass, kResultPass, kResultFail, kResultPass); #undef CHECK_VSEL } } TEST(ARMv8_vminmax_f64) { // Test the vminnm and vmaxnm floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); struct Inputs { double left_; double right_; }; struct Results { double vminnm_; double vmaxnm_; }; if (CpuFeatures::IsSupported(ARMv8)) { CpuFeatureScope scope(&assm, ARMv8); // Create a helper function: // void TestVminmax(const Inputs* inputs, // Results* results); __ vldr(d1, r0, offsetof(Inputs, left_)); __ vldr(d2, r0, offsetof(Inputs, right_)); __ vminnm(d0, d1, d2); __ vstr(d0, r1, offsetof(Results, vminnm_)); __ vmaxnm(d0, d1, d2); __ vstr(d0, r1, offsetof(Results, vmaxnm_)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 f = FUNCTION_CAST<F4>(code->entry()); Object* dummy = nullptr; USE(dummy); #define CHECK_VMINMAX(left, right, vminnm, vmaxnm) \ do { \ Inputs inputs = {left, right}; \ Results results; \ dummy = CALL_GENERATED_CODE(isolate, f, &inputs, &results, 0, 0, 0); \ /* Use a bit_cast to correctly identify -0.0 and NaNs. */ \ CHECK_EQ(bit_cast<uint64_t>(vminnm), bit_cast<uint64_t>(results.vminnm_)); \ CHECK_EQ(bit_cast<uint64_t>(vmaxnm), bit_cast<uint64_t>(results.vmaxnm_)); \ } while (0); double nan_a = bit_cast<double>(UINT64_C(0x7ff8000000000001)); double nan_b = bit_cast<double>(UINT64_C(0x7ff8000000000002)); CHECK_VMINMAX(1.0, -1.0, -1.0, 1.0); CHECK_VMINMAX(-1.0, 1.0, -1.0, 1.0); CHECK_VMINMAX(0.0, -1.0, -1.0, 0.0); CHECK_VMINMAX(-1.0, 0.0, -1.0, 0.0); CHECK_VMINMAX(-0.0, -1.0, -1.0, -0.0); CHECK_VMINMAX(-1.0, -0.0, -1.0, -0.0); CHECK_VMINMAX(0.0, 1.0, 0.0, 1.0); CHECK_VMINMAX(1.0, 0.0, 0.0, 1.0); CHECK_VMINMAX(0.0, 0.0, 0.0, 0.0); CHECK_VMINMAX(-0.0, -0.0, -0.0, -0.0); CHECK_VMINMAX(-0.0, 0.0, -0.0, 0.0); CHECK_VMINMAX(0.0, -0.0, -0.0, 0.0); CHECK_VMINMAX(0.0, nan_a, 0.0, 0.0); CHECK_VMINMAX(nan_a, 0.0, 0.0, 0.0); CHECK_VMINMAX(nan_a, nan_b, nan_a, nan_a); CHECK_VMINMAX(nan_b, nan_a, nan_b, nan_b); #undef CHECK_VMINMAX } } TEST(ARMv8_vminmax_f32) { // Test the vminnm and vmaxnm floating point instructions. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); struct Inputs { float left_; float right_; }; struct Results { float vminnm_; float vmaxnm_; }; if (CpuFeatures::IsSupported(ARMv8)) { CpuFeatureScope scope(&assm, ARMv8); // Create a helper function: // void TestVminmax(const Inputs* inputs, // Results* results); __ vldr(s1, r0, offsetof(Inputs, left_)); __ vldr(s2, r0, offsetof(Inputs, right_)); __ vminnm(s0, s1, s2); __ vstr(s0, r1, offsetof(Results, vminnm_)); __ vmaxnm(s0, s1, s2); __ vstr(s0, r1, offsetof(Results, vmaxnm_)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 f = FUNCTION_CAST<F4>(code->entry()); Object* dummy = nullptr; USE(dummy); #define CHECK_VMINMAX(left, right, vminnm, vmaxnm) \ do { \ Inputs inputs = {left, right}; \ Results results; \ dummy = CALL_GENERATED_CODE(isolate, f, &inputs, &results, 0, 0, 0); \ /* Use a bit_cast to correctly identify -0.0 and NaNs. */ \ CHECK_EQ(bit_cast<uint32_t>(vminnm), bit_cast<uint32_t>(results.vminnm_)); \ CHECK_EQ(bit_cast<uint32_t>(vmaxnm), bit_cast<uint32_t>(results.vmaxnm_)); \ } while (0); float nan_a = bit_cast<float>(UINT32_C(0x7fc00001)); float nan_b = bit_cast<float>(UINT32_C(0x7fc00002)); CHECK_VMINMAX(1.0f, -1.0f, -1.0f, 1.0f); CHECK_VMINMAX(-1.0f, 1.0f, -1.0f, 1.0f); CHECK_VMINMAX(0.0f, -1.0f, -1.0f, 0.0f); CHECK_VMINMAX(-1.0f, 0.0f, -1.0f, 0.0f); CHECK_VMINMAX(-0.0f, -1.0f, -1.0f, -0.0f); CHECK_VMINMAX(-1.0f, -0.0f, -1.0f, -0.0f); CHECK_VMINMAX(0.0f, 1.0f, 0.0f, 1.0f); CHECK_VMINMAX(1.0f, 0.0f, 0.0f, 1.0f); CHECK_VMINMAX(0.0f, 0.0f, 0.0f, 0.0f); CHECK_VMINMAX(-0.0f, -0.0f, -0.0f, -0.0f); CHECK_VMINMAX(-0.0f, 0.0f, -0.0f, 0.0f); CHECK_VMINMAX(0.0f, -0.0f, -0.0f, 0.0f); CHECK_VMINMAX(0.0f, nan_a, 0.0f, 0.0f); CHECK_VMINMAX(nan_a, 0.0f, 0.0f, 0.0f); CHECK_VMINMAX(nan_a, nan_b, nan_a, nan_a); CHECK_VMINMAX(nan_b, nan_a, nan_b, nan_b); #undef CHECK_VMINMAX } } template <typename T, typename Inputs, typename Results> static F4 GenerateMacroFloatMinMax(MacroAssembler& assm) { T a = T::from_code(0); // d0/s0 T b = T::from_code(1); // d1/s1 T c = T::from_code(2); // d2/s2 // Create a helper function: // void TestFloatMinMax(const Inputs* inputs, // Results* results); Label ool_min_abc, ool_min_aab, ool_min_aba; Label ool_max_abc, ool_max_aab, ool_max_aba; Label done_min_abc, done_min_aab, done_min_aba; Label done_max_abc, done_max_aab, done_max_aba; // a = min(b, c); __ vldr(b, r0, offsetof(Inputs, left_)); __ vldr(c, r0, offsetof(Inputs, right_)); __ FloatMin(a, b, c, &ool_min_abc); __ bind(&done_min_abc); __ vstr(a, r1, offsetof(Results, min_abc_)); // a = min(a, b); __ vldr(a, r0, offsetof(Inputs, left_)); __ vldr(b, r0, offsetof(Inputs, right_)); __ FloatMin(a, a, b, &ool_min_aab); __ bind(&done_min_aab); __ vstr(a, r1, offsetof(Results, min_aab_)); // a = min(b, a); __ vldr(b, r0, offsetof(Inputs, left_)); __ vldr(a, r0, offsetof(Inputs, right_)); __ FloatMin(a, b, a, &ool_min_aba); __ bind(&done_min_aba); __ vstr(a, r1, offsetof(Results, min_aba_)); // a = max(b, c); __ vldr(b, r0, offsetof(Inputs, left_)); __ vldr(c, r0, offsetof(Inputs, right_)); __ FloatMax(a, b, c, &ool_max_abc); __ bind(&done_max_abc); __ vstr(a, r1, offsetof(Results, max_abc_)); // a = max(a, b); __ vldr(a, r0, offsetof(Inputs, left_)); __ vldr(b, r0, offsetof(Inputs, right_)); __ FloatMax(a, a, b, &ool_max_aab); __ bind(&done_max_aab); __ vstr(a, r1, offsetof(Results, max_aab_)); // a = max(b, a); __ vldr(b, r0, offsetof(Inputs, left_)); __ vldr(a, r0, offsetof(Inputs, right_)); __ FloatMax(a, b, a, &ool_max_aba); __ bind(&done_max_aba); __ vstr(a, r1, offsetof(Results, max_aba_)); __ bx(lr); // Generate out-of-line cases. __ bind(&ool_min_abc); __ FloatMinOutOfLine(a, b, c); __ b(&done_min_abc); __ bind(&ool_min_aab); __ FloatMinOutOfLine(a, a, b); __ b(&done_min_aab); __ bind(&ool_min_aba); __ FloatMinOutOfLine(a, b, a); __ b(&done_min_aba); __ bind(&ool_max_abc); __ FloatMaxOutOfLine(a, b, c); __ b(&done_max_abc); __ bind(&ool_max_aab); __ FloatMaxOutOfLine(a, a, b); __ b(&done_max_aab); __ bind(&ool_max_aba); __ FloatMaxOutOfLine(a, b, a); __ b(&done_max_aba); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = assm.isolate()->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif return FUNCTION_CAST<F4>(code->entry()); } TEST(macro_float_minmax_f64) { // Test the FloatMin and FloatMax macros. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); MacroAssembler assm(isolate, NULL, 0, CodeObjectRequired::kYes); struct Inputs { double left_; double right_; }; struct Results { // Check all register aliasing possibilities in order to exercise all // code-paths in the macro assembler. double min_abc_; double min_aab_; double min_aba_; double max_abc_; double max_aab_; double max_aba_; }; F4 f = GenerateMacroFloatMinMax<DwVfpRegister, Inputs, Results>(assm); Object* dummy = nullptr; USE(dummy); #define CHECK_MINMAX(left, right, min, max) \ do { \ Inputs inputs = {left, right}; \ Results results; \ dummy = CALL_GENERATED_CODE(isolate, f, &inputs, &results, 0, 0, 0); \ /* Use a bit_cast to correctly identify -0.0 and NaNs. */ \ CHECK_EQ(bit_cast<uint64_t>(min), bit_cast<uint64_t>(results.min_abc_)); \ CHECK_EQ(bit_cast<uint64_t>(min), bit_cast<uint64_t>(results.min_aab_)); \ CHECK_EQ(bit_cast<uint64_t>(min), bit_cast<uint64_t>(results.min_aba_)); \ CHECK_EQ(bit_cast<uint64_t>(max), bit_cast<uint64_t>(results.max_abc_)); \ CHECK_EQ(bit_cast<uint64_t>(max), bit_cast<uint64_t>(results.max_aab_)); \ CHECK_EQ(bit_cast<uint64_t>(max), bit_cast<uint64_t>(results.max_aba_)); \ } while (0) double nan_a = bit_cast<double>(UINT64_C(0x7ff8000000000001)); double nan_b = bit_cast<double>(UINT64_C(0x7ff8000000000002)); CHECK_MINMAX(1.0, -1.0, -1.0, 1.0); CHECK_MINMAX(-1.0, 1.0, -1.0, 1.0); CHECK_MINMAX(0.0, -1.0, -1.0, 0.0); CHECK_MINMAX(-1.0, 0.0, -1.0, 0.0); CHECK_MINMAX(-0.0, -1.0, -1.0, -0.0); CHECK_MINMAX(-1.0, -0.0, -1.0, -0.0); CHECK_MINMAX(0.0, 1.0, 0.0, 1.0); CHECK_MINMAX(1.0, 0.0, 0.0, 1.0); CHECK_MINMAX(0.0, 0.0, 0.0, 0.0); CHECK_MINMAX(-0.0, -0.0, -0.0, -0.0); CHECK_MINMAX(-0.0, 0.0, -0.0, 0.0); CHECK_MINMAX(0.0, -0.0, -0.0, 0.0); CHECK_MINMAX(0.0, nan_a, nan_a, nan_a); CHECK_MINMAX(nan_a, 0.0, nan_a, nan_a); CHECK_MINMAX(nan_a, nan_b, nan_a, nan_a); CHECK_MINMAX(nan_b, nan_a, nan_b, nan_b); #undef CHECK_MINMAX } TEST(macro_float_minmax_f32) { // Test the FloatMin and FloatMax macros. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); MacroAssembler assm(isolate, NULL, 0, CodeObjectRequired::kYes); struct Inputs { float left_; float right_; }; struct Results { // Check all register aliasing possibilities in order to exercise all // code-paths in the macro assembler. float min_abc_; float min_aab_; float min_aba_; float max_abc_; float max_aab_; float max_aba_; }; F4 f = GenerateMacroFloatMinMax<SwVfpRegister, Inputs, Results>(assm); Object* dummy = nullptr; USE(dummy); #define CHECK_MINMAX(left, right, min, max) \ do { \ Inputs inputs = {left, right}; \ Results results; \ dummy = CALL_GENERATED_CODE(isolate, f, &inputs, &results, 0, 0, 0); \ /* Use a bit_cast to correctly identify -0.0 and NaNs. */ \ CHECK_EQ(bit_cast<uint32_t>(min), bit_cast<uint32_t>(results.min_abc_)); \ CHECK_EQ(bit_cast<uint32_t>(min), bit_cast<uint32_t>(results.min_aab_)); \ CHECK_EQ(bit_cast<uint32_t>(min), bit_cast<uint32_t>(results.min_aba_)); \ CHECK_EQ(bit_cast<uint32_t>(max), bit_cast<uint32_t>(results.max_abc_)); \ CHECK_EQ(bit_cast<uint32_t>(max), bit_cast<uint32_t>(results.max_aab_)); \ CHECK_EQ(bit_cast<uint32_t>(max), bit_cast<uint32_t>(results.max_aba_)); \ } while (0) float nan_a = bit_cast<float>(UINT32_C(0x7fc00001)); float nan_b = bit_cast<float>(UINT32_C(0x7fc00002)); CHECK_MINMAX(1.0f, -1.0f, -1.0f, 1.0f); CHECK_MINMAX(-1.0f, 1.0f, -1.0f, 1.0f); CHECK_MINMAX(0.0f, -1.0f, -1.0f, 0.0f); CHECK_MINMAX(-1.0f, 0.0f, -1.0f, 0.0f); CHECK_MINMAX(-0.0f, -1.0f, -1.0f, -0.0f); CHECK_MINMAX(-1.0f, -0.0f, -1.0f, -0.0f); CHECK_MINMAX(0.0f, 1.0f, 0.0f, 1.0f); CHECK_MINMAX(1.0f, 0.0f, 0.0f, 1.0f); CHECK_MINMAX(0.0f, 0.0f, 0.0f, 0.0f); CHECK_MINMAX(-0.0f, -0.0f, -0.0f, -0.0f); CHECK_MINMAX(-0.0f, 0.0f, -0.0f, 0.0f); CHECK_MINMAX(0.0f, -0.0f, -0.0f, 0.0f); CHECK_MINMAX(0.0f, nan_a, nan_a, nan_a); CHECK_MINMAX(nan_a, 0.0f, nan_a, nan_a); CHECK_MINMAX(nan_a, nan_b, nan_a, nan_a); CHECK_MINMAX(nan_b, nan_a, nan_b, nan_b); #undef CHECK_MINMAX } TEST(unaligned_loads) { // All supported ARM targets allow unaligned accesses. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); typedef struct { uint32_t ldrh; uint32_t ldrsh; uint32_t ldr; } T; T t; Assembler assm(isolate, NULL, 0); __ ldrh(ip, MemOperand(r1, r2)); __ str(ip, MemOperand(r0, offsetof(T, ldrh))); __ ldrsh(ip, MemOperand(r1, r2)); __ str(ip, MemOperand(r0, offsetof(T, ldrsh))); __ ldr(ip, MemOperand(r1, r2)); __ str(ip, MemOperand(r0, offsetof(T, ldr))); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 f = FUNCTION_CAST<F4>(code->entry()); Object* dummy = nullptr; USE(dummy); #ifndef V8_TARGET_LITTLE_ENDIAN #error This test assumes a little-endian layout. #endif uint64_t data = UINT64_C(0x84838281807f7e7d); dummy = CALL_GENERATED_CODE(isolate, f, &t, &data, 0, 0, 0); CHECK_EQ(0x00007e7du, t.ldrh); CHECK_EQ(0x00007e7du, t.ldrsh); CHECK_EQ(0x807f7e7du, t.ldr); dummy = CALL_GENERATED_CODE(isolate, f, &t, &data, 1, 0, 0); CHECK_EQ(0x00007f7eu, t.ldrh); CHECK_EQ(0x00007f7eu, t.ldrsh); CHECK_EQ(0x81807f7eu, t.ldr); dummy = CALL_GENERATED_CODE(isolate, f, &t, &data, 2, 0, 0); CHECK_EQ(0x0000807fu, t.ldrh); CHECK_EQ(0xffff807fu, t.ldrsh); CHECK_EQ(0x8281807fu, t.ldr); dummy = CALL_GENERATED_CODE(isolate, f, &t, &data, 3, 0, 0); CHECK_EQ(0x00008180u, t.ldrh); CHECK_EQ(0xffff8180u, t.ldrsh); CHECK_EQ(0x83828180u, t.ldr); } TEST(unaligned_stores) { // All supported ARM targets allow unaligned accesses. CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); __ strh(r3, MemOperand(r0, r2)); __ str(r3, MemOperand(r1, r2)); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F4 f = FUNCTION_CAST<F4>(code->entry()); Object* dummy = nullptr; USE(dummy); #ifndef V8_TARGET_LITTLE_ENDIAN #error This test assumes a little-endian layout. #endif { uint64_t strh = 0; uint64_t str = 0; dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 0, 0xfedcba98, 0); CHECK_EQ(UINT64_C(0x000000000000ba98), strh); CHECK_EQ(UINT64_C(0x00000000fedcba98), str); } { uint64_t strh = 0; uint64_t str = 0; dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 1, 0xfedcba98, 0); CHECK_EQ(UINT64_C(0x0000000000ba9800), strh); CHECK_EQ(UINT64_C(0x000000fedcba9800), str); } { uint64_t strh = 0; uint64_t str = 0; dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 2, 0xfedcba98, 0); CHECK_EQ(UINT64_C(0x00000000ba980000), strh); CHECK_EQ(UINT64_C(0x0000fedcba980000), str); } { uint64_t strh = 0; uint64_t str = 0; dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 3, 0xfedcba98, 0); CHECK_EQ(UINT64_C(0x000000ba98000000), strh); CHECK_EQ(UINT64_C(0x00fedcba98000000), str); } } TEST(vswp) { if (!CpuFeatures::IsSupported(NEON)) return; CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); typedef struct { uint64_t vswp_d0; uint64_t vswp_d1; uint64_t vswp_d30; uint64_t vswp_d31; uint32_t vswp_q4[4]; uint32_t vswp_q5[4]; } T; T t; __ stm(db_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | lr.bit()); uint64_t one = bit_cast<uint64_t>(1.0); __ mov(r5, Operand(one >> 32)); __ mov(r4, Operand(one & 0xffffffff)); uint64_t minus_one = bit_cast<uint64_t>(-1.0); __ mov(r7, Operand(minus_one >> 32)); __ mov(r6, Operand(minus_one & 0xffffffff)); __ vmov(d0, r4, r5); // d0 = 1.0 __ vmov(d1, r6, r7); // d1 = -1.0 __ vswp(d0, d1); __ vstr(d0, r0, offsetof(T, vswp_d0)); __ vstr(d1, r0, offsetof(T, vswp_d1)); if (CpuFeatures::IsSupported(VFP32DREGS)) { __ vmov(d30, r4, r5); // d30 = 1.0 __ vmov(d31, r6, r7); // d31 = -1.0 __ vswp(d30, d31); __ vstr(d30, r0, offsetof(T, vswp_d30)); __ vstr(d31, r0, offsetof(T, vswp_d31)); } // q-register swap. const uint32_t test_1 = 0x01234567; const uint32_t test_2 = 0x89abcdef; __ mov(r4, Operand(test_1)); __ mov(r5, Operand(test_2)); // TODO(bbudge) replace with vdup when implemented. __ vmov(d8, r4, r4); __ vmov(d9, r4, r4); // q4 = [1.0, 1.0] __ vmov(d10, r5, r5); __ vmov(d11, r5, r5); // q5 = [-1.0, -1.0] __ vswp(q4, q5); __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q4)))); __ vst1(Neon8, NeonListOperand(q4), NeonMemOperand(r6)); __ add(r6, r0, Operand(static_cast<int32_t>(offsetof(T, vswp_q5)))); __ vst1(Neon8, NeonListOperand(q5), NeonMemOperand(r6)); __ ldm(ia_w, sp, r4.bit() | r5.bit() | r6.bit() | r7.bit() | pc.bit()); __ bx(lr); CodeDesc desc; assm.GetCode(&desc); Handle<Code> code = isolate->factory()->NewCode( desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); #ifdef DEBUG OFStream os(stdout); code->Print(os); #endif F3 f = FUNCTION_CAST<F3>(code->entry()); Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); USE(dummy); CHECK_EQ(minus_one, t.vswp_d0); CHECK_EQ(one, t.vswp_d1); if (CpuFeatures::IsSupported(VFP32DREGS)) { CHECK_EQ(minus_one, t.vswp_d30); CHECK_EQ(one, t.vswp_d31); } CHECK_EQ(t.vswp_q4[0], test_2); CHECK_EQ(t.vswp_q4[1], test_2); CHECK_EQ(t.vswp_q4[2], test_2); CHECK_EQ(t.vswp_q4[3], test_2); CHECK_EQ(t.vswp_q5[0], test_1); CHECK_EQ(t.vswp_q5[1], test_1); CHECK_EQ(t.vswp_q5[2], test_1); CHECK_EQ(t.vswp_q5[3], test_1); } TEST(regress4292_b) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label end; __ mov(r0, Operand(isolate->factory()->infinity_value())); for (int i = 0; i < 1020; ++i) { __ b(hi, &end); } __ bind(&end); } TEST(regress4292_bl) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label end; __ mov(r0, Operand(isolate->factory()->infinity_value())); for (int i = 0; i < 1020; ++i) { __ bl(hi, &end); } __ bind(&end); } TEST(regress4292_blx) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); Label end; __ mov(r0, Operand(isolate->factory()->infinity_value())); for (int i = 0; i < 1020; ++i) { __ blx(&end); } __ bind(&end); } TEST(regress4292_CheckConstPool) { CcTest::InitializeVM(); Isolate* isolate = CcTest::i_isolate(); HandleScope scope(isolate); Assembler assm(isolate, NULL, 0); __ mov(r0, Operand(isolate->factory()->infinity_value())); __ BlockConstPoolFor(1019); for (int i = 0; i < 1019; ++i) __ nop(); __ vldr(d0, MemOperand(r0, 0)); } #undef __
hkernbach/arangodb
3rdParty/V8/v5.7.492.77/test/cctest/test-assembler-arm.cc
C++
apache-2.0
114,323
title: Build your App with Crate on IBM Softlayer description: heroImg: wrapper-hero-frontpage {% extends "base.html" %} {% block header %} <div class="wrapper wrapper-hero landing-page" id="{{ heroImg }}"> <div class="container"> <h1>Using Crate with IBM Softlayer</h1> <a href="{% url '/install/cloud/softlayer.html' %}" class="btn btn-fp-white">Get your cluster<br />up and running now!</a> </div> </div> {% endblock %} {% block body %} <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-sm-12"> <p>Crate is a scalable distributed database. Simply <a href="{% url '/install/cloud/softlayer.html' %}">install a Crate cluster on Softlayer</a> instances and make the unwieldy centralized database a thing of the past.</p> </div> <div class="col-sm-12"> <p>Crate is the perfect combination for a highly scalable, distributed data store which enables you to focus on developing your product and worry less about maintaining your database cluster.</p> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>Crate is simple to set up, scale, and query</h2> </div> </div> <div class="row"> <div class="col-sm-4"> <img class="img-responsive thumbnail" src="{% media '/media/1503/cloud_everywhere.png' %}" /> </div> <div class="col-sm-8"> <ul> <li>Ideal for use in containerized, platform agnostic environments like Docker</li> <li>Optimized for all major cloud platforms</li> <li>No more unwieldy big centralized databases โ€“ Crate runs on your application servers</li> <li>Crate uses familiar SQL Syntax</li> <li><strong><a href="{% url '/install/cloud/softlayer.html' %}">Get started with Crate and Softlayer now &raquo;</a></strong></li> </ul> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>Simple administration</h2> </div> </div> <div class="row"> <div class="col-sm-4"> <img class="img-responsive thumbnail" src="{% media '/media/1503/cloud_admin.png' %}" /> </div> <div class="col-sm-8"> <ul> <li>Friendly Admin UI shows the status of your cluster at any time</li> <li>SQL console included</li> <li>Auto scaling, self healing and re-balancing. We automatically take care of failed nodes, but most of the time nodes don't fail, clusters are scaled as required.</li> <li><strong><a href="{% url '/install/cloud/softlayer.html' %}">Get started with Crate and Softlayer now &raquo;</a></strong></li> </ul> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>Scale easily from millions to billions of records</h2> </div> </div> <div class="row"> <div class="col-sm-4"> <img class="img-responsive thumbnail" src="{% media '/media/1503/cloud_scale.png' %}" /> </div> <div class="col-sm-8"> <ul> <li>Takes care of synchronization, sharding, scaling, and replication even for mammoth data sets</li> <li>A true shared nothing architecture, with Crate all nodes are equal</li> <li>Queries are automatically parallelized across all nodes, resulting in sub-second queries on tabular data and semi-structured records</li> <li>When running out of power, just add new nodes with a few command line inputs, Crate takes care of the rest</li> <li><strong><a href="{% url '/install/cloud/softlayer.html' %}">Get started with Crate and Softlayer now &raquo;</a></strong></li> </ul> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>Open source</h2> </div> </div> <div class="row"> <div class="col-sm-4"> <img class="img-responsive thumbnail" src="{% media '/media/1503/cloud_open-source.png' %}" /> </div> <div class="col-sm-8"> <ul> <li>Crate is Open Source</li> <li>A true shared nothing architecture, with Crate all nodes are equal</li> <li>Crate uses a variety of battle tested open source components: Presto, Elasticsearch, Lucene, Netty</li> <li>We invest in and support Open Source communities</li> <li><strong><a href="{% url '/install/cloud/softlayer.html' %}">Get started with Crate and Softlayer now &raquo;</a></strong></li> </ul> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom wrapper-bg-primary"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2 class="text-center">Get your cluster up and running in no time!</h2> <p class="text-center"> <a href="{% url '/install/cloud/softlayer.html' %}" class="btn btn-black btn-lg">Start your cluster now!</a> </p> <p class="text-center"> <a href="{% url '/about/contact.html' %}" class="black-link">Any questions? Feel free to get in touch with us</a> </p> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom wrapper-bg-gray"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2 class="text-center">Crate has been built to support these five requirements</h2> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom"> <div class="container"> <div class="row"> <div class="col-lg-4 col-sm-6"> <p class="text-center"> <h2>Storing Documents</h2> <img class="img-responsive thumbnail" src="{% media '/media/1503/icon_document.png' %}" /> </p> <p>Crate utilizes the indexing engine Lucene for storing documents.</p> </div> <div class="col-lg-4 col-sm-6"> <p class="text-center"> <h2>Storing Blobs</h2> <img class="img-responsive thumbnail" src="{% media '/media/1503/icon_blob.png' %}" /> </p> <p>Blob storage is done transparently, using the Crate blob implementation, which distributes and replicates blobs evenly across all nodes.</p> </div> <div class="col-lg-4 col-sm-6"> <p class="text-center"> <h2>Finding Documents</h2> <img class="img-responsive thumbnail" src="{% media '/media/1503/icon_search.png' %}" /> </p> <p>Crate uses Elasticsearch for fulltext search โ€“ thatโ€™s pretty much the best there is for speed.</p> </div> </div> <div class="row"> <div class="col-lg-4 col-sm-6 col-xs-offset-2"> <p class="text-center"> <h2>Real time data analytics using SQL</h2> <img class="img-responsive thumbnail" src="{% media '/media/1503/icon_analytics.png' %}" /> </p> <p>Crate enables real time data analytics using SQL through the distributed query analyzer, planner and execution engine in real time.</p> </div> <div class="col-lg-4 col-sm-6"> <p class="text-center"> <h2>Make changes without re-doing everything</h2> <img class="img-responsive thumbnail" src="{% media '/media/1503/icon_restructure.png' %}" /> </p> <p>Remember when restructuring an entire relational database was possible using a single SQL script? Crate allows you to put the result of a query directly into one or more indices. This requirement is more essential in document based databases, where data is often stored in a highly denormalized format.</p> </div> </div> </div> </div> <div class="wrapper wrapper-border wrapper-border-bottom wrapper-bg-gray"> <div class="container"> <div class="row"> <div class="col-lg-12"> <p class="text-center"> <a href="{% url '/about/contact.html' %}" class="black-link">Any questions? Feel free to get in touch with us</a> </p> </div> </div> </div> </div> {% endblock %}
jomolinare/crate-web
crate/pages/softlayer/index.html
HTML
apache-2.0
8,436
package ludum.mighty.ld36.animations; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureRegion; import ludum.mighty.ld36.settings.DefaultValues; public class AnimatorSonicBoom { private Texture kidTexture; private TextureRegion[][] kidTR; private TextureRegion[][] kidTRflip; public Animation animUP, animDOWN, animLEFT, animRIGHT, animStopUP, animStopDOWN, animStopLEFT, animStopRIGHT, animNE, animNW, animSE, animSW, animStopNE, animStopNW, animStopSE, animStopSW, anim; public AnimatorSonicBoom(String textureSheet) { kidTexture = new Texture(textureSheet); kidTR = TextureRegion.split(kidTexture, DefaultValues.TILESIZE, DefaultValues.TILESIZE); kidTRflip = TextureRegion.split(kidTexture, DefaultValues.TILESIZE, DefaultValues.TILESIZE); kidTRflip[2][7].flip(true, false); kidTRflip[2][8].flip(true, false); kidTRflip[2][9].flip(true, false); kidTRflip[3][7].flip(true, false); kidTRflip[3][8].flip(true, false); kidTRflip[3][9].flip(true, false); kidTRflip[4][7].flip(true, false); kidTRflip[4][8].flip(true, false); kidTRflip[4][9].flip(true, false); // Create animations for movement animDOWN = new Animation(0.25f, kidTR[5][7], kidTR[5][8], kidTR[5][9], kidTR[5][7]); animRIGHT = new Animation(0.25f, kidTR[4][7], kidTR[4][8], kidTR[4][9], kidTR[4][7]); animUP = new Animation(0.25f, kidTR[1][7], kidTR[1][8], kidTR[1][9], kidTR[1][7]); animLEFT = new Animation(0.25f, kidTRflip[4][7], kidTRflip[4][8], kidTRflip[4][9], kidTRflip[4][7]); animNE = new Animation(0.25f, kidTR[2][7], kidTR[2][8], kidTR[2][9], kidTR[2][7]); animNW = new Animation(0.25f, kidTRflip[2][7], kidTRflip[2][8], kidTRflip[2][9], kidTRflip[2][7]); animSE = new Animation(0.25f, kidTR[3][7], kidTR[3][8], kidTR[3][9], kidTR[3][7]); animSW = new Animation(0.25f, kidTRflip[3][7], kidTRflip[3][8], kidTRflip[3][9], kidTRflip[3][7]); animStopDOWN = new Animation(0.25f, kidTR[5][7]); animStopRIGHT = new Animation(0.25f, kidTR[4][7]); animStopUP = new Animation(0.25f, kidTR[1][7]); animStopLEFT = new Animation(0.25f, kidTRflip[4][7]); animStopNE = new Animation(0.25f, kidTR[2][7]); animStopNW = new Animation(0.25f, kidTRflip[2][7]); animStopSE = new Animation(0.25f, kidTR[3][7]); animStopSW = new Animation(0.25f, kidTRflip[3][7]); // Set initial position of the kid anim = animStopDOWN; } }
punkto/mightyLD36
core/src/ludum/mighty/ld36/animations/AnimatorSonicBoom.java
Java
apache-2.0
2,485
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Nov 14 23:55:11 UTC 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> org.apache.hadoop.mapreduce.tools Class Hierarchy (Apache Hadoop Main 2.5.2 API) </TITLE> <META NAME="date" CONTENT="2014-11-14"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.apache.hadoop.mapreduce.tools Class Hierarchy (Apache Hadoop Main 2.5.2 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/hadoop/mapreduce/task/annotation/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/hadoop/mapreduce/v2/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/mapreduce/tools/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> Hierarchy For Package org.apache.hadoop.mapreduce.tools </H2> </CENTER> <DL> <DT><B>Package Hierarchies:</B><DD><A HREF="../../../../../overview-tree.html">All Packages</A></DL> <HR> <H2> Class Hierarchy </H2> <UL> <LI TYPE="circle">java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL> <LI TYPE="circle">org.apache.hadoop.conf.<A HREF="../../../../../org/apache/hadoop/conf/Configured.html" title="class in org.apache.hadoop.conf"><B>Configured</B></A> (implements org.apache.hadoop.conf.<A HREF="../../../../../org/apache/hadoop/conf/Configurable.html" title="interface in org.apache.hadoop.conf">Configurable</A>) <UL> <LI TYPE="circle">org.apache.hadoop.mapreduce.tools.<A HREF="../../../../../org/apache/hadoop/mapreduce/tools/CLI.html" title="class in org.apache.hadoop.mapreduce.tools"><B>CLI</B></A> (implements org.apache.hadoop.util.<A HREF="../../../../../org/apache/hadoop/util/Tool.html" title="interface in org.apache.hadoop.util">Tool</A>) </UL> </UL> </UL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/hadoop/mapreduce/task/annotation/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/hadoop/mapreduce/v2/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/mapreduce/tools/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2014 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
hsh075623201/hadoop
share/doc/hadoop/api/org/apache/hadoop/mapreduce/tools/package-tree.html
HTML
apache-2.0
7,112
#include "arg_conversion.h" #include "command_buffer.h" static command_buffer buffer; int piss_off(int a, double b) { return printf("piss_off called with %d, %f\n", a, b); } static const char piss_off_usage[] = "piss_off int double\nYell numbers!"; void kill_player(const std::string& name) { printf("Killing player \"%s\"\n", name.c_str()); } static const char kill_usage[] = "kill player_name"; int main() { function_mapping fm; fm.add_mapping("howdy", piss_off, piss_off_usage); fm.add_mapping("kill", kill_player, kill_usage); buffer.push_command("howdy 5 6.2"); buffer.push_command("no_such_command arg1"); buffer.push_command("kill jared 5"); buffer.push_command("kill jared"); fm.execute_command(buffer.pop_command()); fm.execute_command(buffer.pop_command()); fm.execute_command(buffer.pop_command()); fm.execute_command(buffer.pop_command()); }
n00btime/gen_wrapper
my_test.cpp
C++
apache-2.0
871
package es.tid.pce.client.management; import java.net.ServerSocket; import java.util.Timer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import es.tid.pce.client.emulator.AutomaticTesterStatistics; import es.tid.pce.client.emulator.Emulator; import es.tid.pce.client.tester.InformationRequest; public class AutomaticTesterManagementSever extends Thread { private Logger log; private Timer timer; private Timer printStatisticsTimer; // private Timer planificationTimer; private AutomaticTesterStatistics stats; private InformationRequest informationRequest; private Emulator emulator; // private PCCPCEPSession PCEsession; // private PCCPCEPSession PCEsessionVNTM; public AutomaticTesterManagementSever(/*PCCPCEPSession PCEsession,PCCPCEPSession PCEsessionVNTM,*/Timer timer, Timer printStatisticsTimer, /*Timer planificationTimer,*/AutomaticTesterStatistics stats, InformationRequest info){ log =LoggerFactory.getLogger("PCCClient"); this.timer = timer; this.stats=stats; this.informationRequest=info; this.printStatisticsTimer =printStatisticsTimer; // this.planificationTimer=planificationTimer; // this.PCEsession=PCEsession; // this.PCEsessionVNTM=PCEsessionVNTM; } public AutomaticTesterManagementSever(Emulator emulator){ log =LoggerFactory.getLogger("PCCClient"); this.emulator=emulator; } public void run(){ ServerSocket serverSocket = null; boolean listening=true; int port =emulator.getTesterParams().getManagementClientPort(); try { log.info("Listening on port "+port); serverSocket = new ServerSocket(port); } catch (Exception e){ log.error("Could not listen management on port "+port); e.printStackTrace(); return; } try { while (listening) { if (emulator==null) new AutomaticTesterManagementSession(serverSocket.accept(),timer,printStatisticsTimer,stats,/*PCEsession,PCEsessionVNTM,*/informationRequest,informationRequest.calculateLoad()).start(); else new AutomaticTesterManagementSession(serverSocket.accept(),emulator); } serverSocket.close(); } catch (Exception e) { e.printStackTrace(); } } }
telefonicaid/netphony-gmpls-emulator
src/main/java/es/tid/pce/client/management/AutomaticTesterManagementSever.java
Java
apache-2.0
2,161
package com.joey.bak.base.ui; import android.app.Activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.joe.zatuji.MyApplication; import com.joe.zatuji.R; import com.joe.zatuji.base.BasePresenter; import com.joe.zatuji.base.LoadingView; import com.joe.zatuji.utils.KToast; import com.joe.zatuji.utils.TUtil; import com.joe.zatuji.view.LoadingDialog; import com.squareup.leakcanary.RefWatcher; /** * Created by Joe on 2016/4/16. */ public abstract class BaseFragment<T extends BasePresenter> extends android.support.v4.app.Fragment implements LoadingView { protected Activity mActivity; protected View mRootView; protected AlertDialog dialog; protected MyApplication myApplication; protected LoadingDialog mLoadingDialog; protected T mPresenter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.mActivity=getActivity(); this.myApplication= (MyApplication) mActivity.getApplication(); //initLeakCanary(); onSaveFragmentInstance(savedInstanceState); initLoading(); } private static final String STATE_SAVE_IS_HIDDEN = "STATE_SAVE_IS_HIDDEN"; private void onSaveFragmentInstance(Bundle savedInstanceState) { if (savedInstanceState != null) { boolean isSupportHidden = savedInstanceState.getBoolean(STATE_SAVE_IS_HIDDEN); FragmentTransaction ft = getFragmentManager().beginTransaction(); if (isSupportHidden) { ft.hide(this); } else { ft.show(this); } ft.commit(); } } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(STATE_SAVE_IS_HIDDEN,isHidden()); } protected void initLeakCanary(){ RefWatcher refWatcher = MyApplication.getRefWatcher(mActivity); refWatcher.watch(this); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); this.mActivity=getActivity(); } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mRootView = inflater.inflate(getLayout(),null); initPM(); initView(); initPresenter(); initListener(); return mRootView; } protected void initPM() { mPresenter = TUtil.getT(this,0); if(mPresenter!=null) mPresenter.onStart(); } protected void initLoading() { dialog = new AlertDialog.Builder(mActivity).create(); } protected void initListener() { } protected abstract int getLayout(); protected void initView(){ } protected abstract void initPresenter(); @Override public void showLoading() { View loadingView=View.inflate(mActivity, R.layout.dialog_loading,null); dialog.setContentView(loadingView); dialog.show(); } @Override public void doneLoading() { if(mLoadingDialog!=null){ mLoadingDialog.dismiss(); } // dialog.dismiss(); } @Override public void showError(String str) { KToast.show(str); } protected void showEmptyView(){ } public void showLoading(String msg){ if(mLoadingDialog==null) mLoadingDialog = new LoadingDialog(mActivity,msg); mLoadingDialog.setMessage(msg); mLoadingDialog.show(); } @Override public void onDestroy() { super.onDestroy(); if(mPresenter!=null) mPresenter.onRemove(); } protected View findView(int id){ return mRootView.findViewById(id); } }
JoeSteven/HuaBan
bak/src/main/java/com/joey/bak/base/ui/BaseFragment.java
Java
apache-2.0
3,988
/*! * ${copyright} */ // Provides control sap.ui.commons.HorizontalDivider. sap.ui.define([ './library', 'sap/ui/core/Control', './HorizontalDividerRenderer' ], function(library, Control, HorizontalDividerRenderer) { "use strict"; // shortcut for sap.ui.commons.HorizontalDividerHeight var HorizontalDividerHeight = library.HorizontalDividerHeight; // shortcut for sap.ui.commons.HorizontalDividerType var HorizontalDividerType = library.HorizontalDividerType; /** * Constructor for a new HorizontalDivider. * * @param {string} [sId] id for the new control, generated automatically if no id is given * @param {object} [mSettings] initial settings for the new control * * @class * Divides the screen in visual areas. * @extends sap.ui.core.Control * @version ${version} * * @constructor * @public * @deprecated Since version 1.38. * @alias sap.ui.commons.HorizontalDivider * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var HorizontalDivider = Control.extend("sap.ui.commons.HorizontalDivider", /** @lends sap.ui.commons.HorizontalDivider.prototype */ { metadata : { library : "sap.ui.commons", deprecated: true, properties : { /** * Defines the width of the divider. */ width : {type : "sap.ui.core.CSSSize", group : "Appearance", defaultValue : '100%'}, /** * Defines the type of the divider. */ type : {type : "sap.ui.commons.HorizontalDividerType", group : "Appearance", defaultValue : HorizontalDividerType.Area}, /** * Defines the height of the divider. */ height : {type : "sap.ui.commons.HorizontalDividerHeight", group : "Appearance", defaultValue : HorizontalDividerHeight.Medium} } }}); // No Behaviour return HorizontalDivider; });
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/HorizontalDivider.js
JavaScript
apache-2.0
1,812
/* * 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 mina.udp.perf; import java.io.IOException; import java.net.InetSocketAddress; import java.util.concurrent.atomic.AtomicInteger; import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IdleStatus; import org.apache.mina.core.session.IoSession; import org.apache.mina.transport.socket.DatagramSessionConfig; import org.apache.mina.transport.socket.nio.NioDatagramAcceptor; /** * An UDP server used for performance tests. * * It does nothing fancy, except receiving the messages, and counting the number of * received messages. * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class UdpServer extends IoHandlerAdapter { /** The listening port (check that it's not already in use) */ public static final int PORT = 18567; /** The number of message to receive */ public static final int MAX_RECEIVED = 100000; /** The starting point, set when we receive the first message */ private static long t0; /** A counter incremented for every recieved message */ private AtomicInteger nbReceived = new AtomicInteger(0); /** * {@inheritDoc} */ @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { cause.printStackTrace(); session.close(true); } /** * {@inheritDoc} */ @Override public void messageReceived(IoSession session, Object message) throws Exception { int nb = nbReceived.incrementAndGet(); if (nb == 1) { t0 = System.currentTimeMillis(); } if (nb == MAX_RECEIVED) { long t1 = System.currentTimeMillis(); System.out.println("-------------> end " + (t1 - t0)); } if (nb % 10000 == 0) { System.out.println("Received " + nb + " messages"); } // If we want to MapDB.test the write operation, uncomment this line session.write(message); } /** * {@inheritDoc} */ @Override public void sessionClosed(IoSession session) throws Exception { System.out.println("Session closed..."); // Reinitialize the counter and expose the number of received messages System.out.println("Nb message received : " + nbReceived.get()); nbReceived.set(0); } /** * {@inheritDoc} */ @Override public void sessionCreated(IoSession session) throws Exception { System.out.println("Session created..."); } /** * {@inheritDoc} */ @Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { System.out.println("Session idle..."); } /** * {@inheritDoc} */ @Override public void sessionOpened(IoSession session) throws Exception { System.out.println("Session Opened..."); } /** * Create the UDP server */ public UdpServer() throws IOException { NioDatagramAcceptor acceptor = new NioDatagramAcceptor(); acceptor.setHandler(this); // The logger, if needed. Commented atm //DefaultIoFilterChainBuilder chain = acceptor.getFilterChain(); //chain.addLast("logger", new LoggingFilter()); DatagramSessionConfig dcfg = acceptor.getSessionConfig(); acceptor.bind(new InetSocketAddress(PORT)); System.out.println("Server started..."); } /** * The entry point. */ public static void main(String[] args) throws IOException { new UdpServer(); } }
iloveyou416068/CookNIOServer
demos/mina/src/mina/udp/perf/UdpServer.java
Java
apache-2.0
4,387
/* * Copyright (C) 2011-2016 Intel Corporation. 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. * */ #include <assert.h> #include "parserfactory.h" #include "util.h" #include "elf32parser.h" #include "elf64parser.h" namespace { bin_fmt_t check_elf_format(const uint8_t* start_addr, uint64_t len) { assert(start_addr != NULL); const Elf32_Ehdr* ehdr = (const Elf32_Ehdr *) start_addr; if (len < sizeof(Elf32_Ehdr)) return BF_UNKNOWN; if (strncmp((const char *)ehdr->e_ident, ELFMAG, SELFMAG) != 0) return BF_UNKNOWN; switch (ehdr->e_ident[EI_CLASS]) { case ELFCLASS32: return BF_ELF32; case ELFCLASS64: return BF_ELF64; default: return BF_UNKNOWN; } } } namespace binparser { /* Note, the `start_addr' should NOT be NULL! */ BinParser* get_parser(const uint8_t* start_addr, uint64_t len) { assert(start_addr != NULL); bin_fmt_t bf = BF_UNKNOWN; bf = check_elf_format(start_addr, len); if (bf == BF_ELF64) return new Elf64Parser(start_addr, len); /* Doesn't matter whether it is an ELF32 shared library or not, * here we just make sure that the factory method won't return * NULL. */ return new Elf32Parser(start_addr, len); } }
shwetasshinde24/Panoply
patched-driver-sdk/customSDK/psw/urts/parser/parserfactory.cpp
C++
apache-2.0
2,856
# Hypoestes spicata Nees SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Acanthaceae/Hypoestes/Hypoestes spicata/README.md
Markdown
apache-2.0
172
# Eupatorium heptaneurum Urb. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Koanophyllon heptaneurum/ Syn. Eupatorium heptaneurum/README.md
Markdown
apache-2.0
184
# Schefflera pullei Harms SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Araliaceae/Schefflera/Schefflera brassaiella/ Syn. Schefflera pullei/README.md
Markdown
apache-2.0
180
# GitHub Users [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) **GitHub Users** is an evaluation project. My task was to quickly build a small Android app to find GitHub users and show their details. The app has offline cache for network responses. # Screenshots ![SmartphoneMain](readme_screenshots/smartphone_main.png "Screenshot from smartphone") ![SmartphoneDetail](readme_screenshots/smartphone_detail.png "Screenshot from smartphone") ![Tablet](readme_screenshots/tablet.png "Screenshot from tablet") # Libraries used * [ButterKnife](https://github.com/JakeWharton/butterknife) - Fields and methods binding for Android views * [Dagger 2](https://github.com/google/dagger) - A fast dependency injector for Android and Java * [Volley](https://github.com/google/volley) - A networking library for Android # What is missing - Testing (for example using Mockito and Espresso), - Taking care of GitHub API pagination (now it's max 100 items per response) # License Copyright 2017 Szymon Koper 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.
sakydpozrux/GitHubUsers
README.md
Markdown
apache-2.0
1,606
/** * ProductPage.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.google.api.ads.dfp.v201306; /** * Captures a page of {@link ProductDto} objects. */ public class ProductPage implements java.io.Serializable { /* The size of the total result set to which this page belongs. */ private java.lang.Integer totalResultSetSize; /* The absolute index in the total result set on which this page * begins. */ private java.lang.Integer startIndex; /* The collection of products contained within this page. */ private com.google.api.ads.dfp.v201306.Product[] results; public ProductPage() { } public ProductPage( java.lang.Integer totalResultSetSize, java.lang.Integer startIndex, com.google.api.ads.dfp.v201306.Product[] results) { this.totalResultSetSize = totalResultSetSize; this.startIndex = startIndex; this.results = results; } /** * Gets the totalResultSetSize value for this ProductPage. * * @return totalResultSetSize * The size of the total result set to which this page belongs. */ public java.lang.Integer getTotalResultSetSize() { return totalResultSetSize; } /** * Sets the totalResultSetSize value for this ProductPage. * * @param totalResultSetSize * The size of the total result set to which this page belongs. */ public void setTotalResultSetSize(java.lang.Integer totalResultSetSize) { this.totalResultSetSize = totalResultSetSize; } /** * Gets the startIndex value for this ProductPage. * * @return startIndex * The absolute index in the total result set on which this page * begins. */ public java.lang.Integer getStartIndex() { return startIndex; } /** * Sets the startIndex value for this ProductPage. * * @param startIndex * The absolute index in the total result set on which this page * begins. */ public void setStartIndex(java.lang.Integer startIndex) { this.startIndex = startIndex; } /** * Gets the results value for this ProductPage. * * @return results * The collection of products contained within this page. */ public com.google.api.ads.dfp.v201306.Product[] getResults() { return results; } /** * Sets the results value for this ProductPage. * * @param results * The collection of products contained within this page. */ public void setResults(com.google.api.ads.dfp.v201306.Product[] results) { this.results = results; } public com.google.api.ads.dfp.v201306.Product getResults(int i) { return this.results[i]; } public void setResults(int i, com.google.api.ads.dfp.v201306.Product _value) { this.results[i] = _value; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ProductPage)) return false; ProductPage other = (ProductPage) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.totalResultSetSize==null && other.getTotalResultSetSize()==null) || (this.totalResultSetSize!=null && this.totalResultSetSize.equals(other.getTotalResultSetSize()))) && ((this.startIndex==null && other.getStartIndex()==null) || (this.startIndex!=null && this.startIndex.equals(other.getStartIndex()))) && ((this.results==null && other.getResults()==null) || (this.results!=null && java.util.Arrays.equals(this.results, other.getResults()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getTotalResultSetSize() != null) { _hashCode += getTotalResultSetSize().hashCode(); } if (getStartIndex() != null) { _hashCode += getStartIndex().hashCode(); } if (getResults() != null) { for (int i=0; i<java.lang.reflect.Array.getLength(getResults()); i++) { java.lang.Object obj = java.lang.reflect.Array.get(getResults(), i); if (obj != null && !obj.getClass().isArray()) { _hashCode += obj.hashCode(); } } } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ProductPage.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "ProductPage")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("totalResultSetSize"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "totalResultSetSize")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("startIndex"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "startIndex")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("results"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "results")); elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201306", "Product")); elemField.setMinOccurs(0); elemField.setNillable(false); elemField.setMaxOccursUnbounded(true); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
google-code-export/google-api-dfp-java
src/com/google/api/ads/dfp/v201306/ProductPage.java
Java
apache-2.0
7,681
<?php // Heading $_['heading_title'] = 'Quแป‘c Gia'; // Text $_['text_success'] = 'Hoร n tแบฅt: Bแบกn ฤ‘รฃ sแปญa ฤ‘แป•i cรกc Quแป‘c Gia!'; $_['text_list'] = 'Danh sรกch cรกc Quแป‘c gia'; $_['text_add'] = 'Thรชm Quแป‘c gia'; $_['text_edit'] = 'Sแปญa Quแป‘c Gia'; // Column $_['column_name'] = 'Tรชn Quแป‘c Gia'; $_['column_iso_code_2'] = 'Mรฃ ISO (2)'; $_['column_iso_code_3'] = 'Mรฃ ISO (3)'; $_['column_action'] = 'Thao tรกc'; // Entry $_['entry_name'] = 'Tรชn Quแป‘c Gia:'; $_['entry_iso_code_2'] = 'Mรฃ ISO (2):'; $_['entry_iso_code_3'] = 'Mรฃ ISO (3):'; $_['entry_address_format'] = 'ฤแป‹nh dแบกng ฤ‘แป‹a chแป‰ :'; $_['entry_postcode_required']= 'Yรชu cแบงu mรฃ vรนng:'; $_['entry_status'] = 'Tรฌnh trแบกng:'; // Help $_['help_address_format'] = 'Hแป = {firstname}<br />Tรชn = {lastname}<br />Cรดng ty = {company}<br />ฤแป‹a chแป‰ 1 = {address_1}<br />ฤแป‹a chแป‰ 2 = {address_2}<br />Quแบญn, Huyแป‡n = {city}<br />Mรฃ vรนng = {postcode}<br />Tแป‰nh, Thร nh phแป‘ = {zone}<br />Mรฃ Tแป‰nh, Thร nh phแป‘ = {zone_code}<br />Quแป‘c Gia = {country}'; // Error $_['error_permission'] = 'Cแบฃnh bรกo: Bแบกn khรดng ฤ‘ฦฐแปฃc phรฉp sแปญa ฤ‘แป•i cรกc quแป‘c gia!'; $_['error_name'] = 'Tรชn quแป‘c gia phแบฃi lแป›n hฦกn 3 vร  nhแป hฦกn 128 kรฝ tแปฑ!'; $_['error_default'] = 'Cแบฃnh bรกo: Bแบกn khรดng thแปƒ xรณa Quแป‘c gia nร y!'; $_['error_store'] = 'Cแบฃnh bรกo: Bแบกn khรดng thแปƒ xรณa Quแป‘c gia nร y vรฌ nรณ ฤ‘ang ฤ‘ฦฐแปฃc thiแบฟt lแบญp cho gian hร ng %s!'; $_['error_address'] = 'Cแบฃnh bรกo: Bแบกn khรดng thแปƒ xรณa Quแป‘c gia nร y!'; $_['error_affiliate'] = 'Cแบฃnh bรกo: Nฦฐแป›c nร y khรดng thแปƒ bแป‹ xรณa khi nรณ hiแป‡n thแปi ฤ‘ฦฐแปฃc gรกn tแป›i %s chi nhรกnh.!'; $_['error_zone'] = 'Cแบฃnh bรกo: Quแป‘c gia nร y cรณ thแปƒ khรดng bแป‹ xรณa!'; $_['error_zone_to_geo_zone'] = 'Cแบฃnh bรกo: Quแป‘c gia nร y cรณ thแปƒ khรดng bแป‹ xรณa!'; ?>
duythanhitc/ShopCartClean
admin/language/vi-vn/localisation/country.php
PHP
apache-2.0
2,084
<?php /** * Copyright 2015 Xenofon Spafaridis * * 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. */ //Show all errors error_reporting(E_ALL); ini_set('display_errors', '1'); //This autoload path is for loading current version of phramework require __DIR__ . '/../vendor/autoload.php'; //define controller namespace, as shortcut define('NS', '\\Phramework\\Examples\\API\\Controllers\\'); use \Phramework\Phramework; /** * @package examples/post * Define APP as function */ $APP = function () { //Include settings $settings = include __DIR__ . '/../settings.php'; $URIStrategy = new \Phramework\URIStrategy\URITemplate([ ['book/', NS . 'BookController', 'GET', Phramework::METHOD_GET], ['book/{id}', NS . 'BookController', 'GETSingle', Phramework::METHOD_GET], ['book/', NS . 'BookController', 'POST', Phramework::METHOD_POST] ]); //Initialize API $phramework = new Phramework($settings, $URIStrategy); unset($settings); Phramework::setViewer( \Phramework\Viewers\JSON::class ); //Execute API $phramework->invoke(); }; /** * Execute APP */ $APP();
phramework/examples-api
public/index.php
PHP
apache-2.0
1,649
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute -- Copyright [2016-2017] EMBL-European Bioinformatics Institute -- -- 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. ## Add data_types to source table CREATE TABLE tmp_source_type ( source_id INT, source_type VARCHAR(255) ); INSERT INTO tmp_source_type SELECT s.source_id, 'variation' FROM source s, variation v WHERE s.source_id = v.source_id GROUP BY s.source_id; INSERT INTO tmp_source_type SELECT s.source_id, 'variation_synonym' FROM source s, variation_synonym v WHERE s.source_id = v.source_id GROUP BY s.source_id; INSERT INTO tmp_source_type select s.source_id, 'structural_variation' FROM source s, structural_variation v WHERE s.source_id = v.source_id GROUP BY s.source_id; INSERT INTO tmp_source_type SELECT s.source_id, 'phenotype_feature' FROM source s, phenotype_feature v WHERE s.source_id = v.source_id GROUP BY s.source_id; INSERT INTO tmp_source_type SELECT s.source_id, 'study' FROM source s, study v WHERE s.source_id = v.source_id GROUP BY s.source_id; CREATE TABLE tmp_source_type_grouped SELECT source_id, group_concat(source_type) AS data_types FROM tmp_source_type GROUP BY source_id; ALTER TABLE source ADD data_types SET('variation','variation_synonym','structural_variation','phenotype_feature','study') NULL DEFAULT NULL; UPDATE source s, tmp_source_type_grouped t SET s.data_types = t.data_types WHERE s.source_id = t.source_id; DROP TABLE tmp_source_type; DROP TABLE tmp_source_type_grouped; #patch identifier INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_73_74_d.sql|Add data_types to source table');
willmclaren/ensembl-variation
sql/patch_73_74_d.sql
SQL
apache-2.0
2,196
// This file was automatically generated. Do not modify. 'use strict'; goog.provide('Blockly.Msg.fr'); goog.require('Blockly.Msg'); Blockly.Msg.ADD_COMMENT = "Ajouter un commentaire"; Blockly.Msg.AUTH = "Veuillez autoriser cette application ร  permettre la sauvegarde de votre travail et ร  lโ€™autoriser d'รชtre partagรฉ par vous."; Blockly.Msg.CHANGE_VALUE_TITLE = "Modifier la valeur :"; Blockly.Msg.CHAT = "Discutez avec votre collaborateur en tapant dans cette zoneย !"; Blockly.Msg.CLEAN_UP = "Nettoyer les blocs"; Blockly.Msg.COLLAPSE_ALL = "Rรฉduire les blocs"; Blockly.Msg.COLLAPSE_BLOCK = "Rรฉduire le bloc"; Blockly.Msg.COLOUR_BLEND_COLOUR1 = "couleur 1"; Blockly.Msg.COLOUR_BLEND_COLOUR2 = "couleur 2"; Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/"; Blockly.Msg.COLOUR_BLEND_RATIO = "taux"; Blockly.Msg.COLOUR_BLEND_TITLE = "mรฉlanger"; Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Mรฉlange deux couleurs dans une proportion donnรฉe (de 0.0 ร  1.0)."; Blockly.Msg.COLOUR_PICKER_HELPURL = "https://fr.wikipedia.org/wiki/Couleur"; Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Choisir une couleur dans la palette."; Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; Blockly.Msg.COLOUR_RANDOM_TITLE = "couleur alรฉatoire"; Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Choisir une couleur au hasard."; Blockly.Msg.COLOUR_RGB_BLUE = "bleu"; Blockly.Msg.COLOUR_RGB_GREEN = "vert"; Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html"; Blockly.Msg.COLOUR_RGB_RED = "rouge"; Blockly.Msg.COLOUR_RGB_TITLE = "colorier avec"; Blockly.Msg.COLOUR_RGB_TOOLTIP = "Crรฉer une couleur avec la quantitรฉ spรฉcifiรฉe de rouge, vert et bleu. Les valeurs doivent รชtre comprises entre 0 et 100."; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "quitter la boucle"; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "passer ร  lโ€™itรฉration de boucle suivante"; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Sortir de la boucle englobante."; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Sauter le reste de cette boucle, et poursuivre avec lโ€™itรฉration suivante."; Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Attention : Ce bloc ne devrait รชtre utilisรฉ que dans une boucle."; Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; Blockly.Msg.CONTROLS_FOREACH_TITLE = "pour chaque รฉlรฉment %1 dans la liste %2"; Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Pour chaque รฉlรฉment dโ€™une liste, assigner la valeur de lโ€™รฉlรฉment ร  la variable '%1', puis exรฉcuter des instructions."; Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; Blockly.Msg.CONTROLS_FOR_TITLE = "compter avec %1 de %2 ร  %3 par %4"; Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Faire prendre ร  la variable ยซโ€ฏ%1โ€ฏยป les valeurs depuis le nombre de dรฉbut jusquโ€™au nombre de fin, en sโ€™incrรฉmentant du pas spรฉcifiรฉ, et exรฉcuter les instructions spรฉcifiรฉes."; Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Ajouter une condition au bloc si."; Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Ajouter une condition finale fourre-tout au bloc si."; Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Ajouter, supprimer ou rรฉordonner les sections pour reconfigurer ce bloc si."; Blockly.Msg.CONTROLS_IF_MSG_ELSE = "sinon"; Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "sinon si"; Blockly.Msg.CONTROLS_IF_MSG_IF = "si"; Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Si une valeur est vraie, alors exรฉcuter certains ordres."; Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Si une valeur est vraie, alors exรฉcuter le premier bloc dโ€™ordres. Sinon, exรฉcuter le second bloc dโ€™ordres."; Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Si la premiรจre valeur est vraie, alors exรฉcuter le premier bloc dโ€™ordres. Sinon, si la seconde valeur est vraie, exรฉcuter le second bloc dโ€™ordres."; Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Si la premiรจre valeur est vraie, alors exรฉcuter le premier bloc dโ€™ordres. Sinon, si la seconde valeur est vraie, exรฉcuter le second bloc dโ€™ordres. Si aucune des valeurs nโ€™est vraie, exรฉcuter le dernier bloc dโ€™ordres."; Blockly.Msg.CONTROLS_REPEAT_HELPURL = "http://fr.wikipedia.org/wiki/Boucle_for"; Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "faire"; Blockly.Msg.CONTROLS_REPEAT_TITLE = "rรฉpรฉter %1 fois"; Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Exรฉcuter des instructions plusieurs fois."; Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat"; Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "rรฉpรฉter jusquโ€™ร "; Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "rรฉpรฉter tant que"; Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Tant quโ€™une valeur est fausse, alors exรฉcuter des instructions."; Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Tant quโ€™une valeur est vraie, alors exรฉcuter des instructions."; Blockly.Msg.DELETE_ALL_BLOCKS = "Supprimer ces %1 blocsโ€ฏ?"; Blockly.Msg.DELETE_BLOCK = "Supprimer le bloc"; Blockly.Msg.DELETE_X_BLOCKS = "Supprimer %1 blocs"; Blockly.Msg.DISABLE_BLOCK = "Dรฉsactiver le bloc"; Blockly.Msg.DUPLICATE_BLOCK = "Dupliquer"; Blockly.Msg.ENABLE_BLOCK = "Activer le bloc"; Blockly.Msg.EXPAND_ALL = "Dรฉvelopper les blocs"; Blockly.Msg.EXPAND_BLOCK = "Dรฉvelopper le bloc"; Blockly.Msg.EXTERNAL_INPUTS = "Entrรฉes externes"; Blockly.Msg.HELP = "Aide"; Blockly.Msg.INLINE_INPUTS = "Entrรฉes en ligne"; Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "crรฉer une liste vide"; Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Renvoyer une liste, de longueur 0, ne contenant aucun enregistrement"; Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "liste"; Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Ajouter, supprimer, ou rรฉordonner les sections pour reconfigurer ce bloc de liste."; Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "crรฉer une liste avec"; Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Ajouter un รฉlรฉment ร  la liste."; Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Crรฉer une liste avec un nombre quelconque dโ€™รฉlรฉments."; Blockly.Msg.LISTS_GET_INDEX_FIRST = "premier"; Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# depuis la fin"; Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#"; Blockly.Msg.LISTS_GET_INDEX_GET = "obtenir"; Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "obtenir et supprimer"; Blockly.Msg.LISTS_GET_INDEX_LAST = "dernier"; Blockly.Msg.LISTS_GET_INDEX_RANDOM = "alรฉatoire"; Blockly.Msg.LISTS_GET_INDEX_REMOVE = "supprimer"; Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Renvoie le premier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "Renvoie lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le dernier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "Renvoie lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le premier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Renvoie le dernier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Renvoie un รฉlรฉment au hasard dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Supprime et renvoie le premier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "Supprime et renvoie lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le dernier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "Supprime et renvoie lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le premier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Supprime et renvoie le dernier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Supprime et renvoie un รฉlรฉment au hasard dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Supprime le premier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "Supprime lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le dernier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "Supprime lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le premier รฉlรฉment."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Supprime le dernier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Supprime un รฉlรฉment au hasard dans une liste."; Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "jusquโ€™ร  # depuis la fin"; Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "jusquโ€™ร  #"; Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "jusquโ€™ร  la fin"; Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "obtenir la sous-liste depuis le dรฉbut"; Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "obtenir la sous-liste depuis # depuis la fin"; Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "obtenir la sous-liste depuis #"; Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Crรฉe une copie de la partie spรฉcifiรฉe dโ€™une liste."; Blockly.Msg.LISTS_INDEX_OF_FIRST = "trouver la premiรจre occurrence de lโ€™รฉlรฉment"; Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; Blockly.Msg.LISTS_INDEX_OF_LAST = "trouver la derniรจre occurrence de lโ€™รฉlรฉment"; Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Renvoie lโ€™index de la premiรจre/derniรจre occurrence de lโ€™รฉlรฉment dans la liste. Renvoie 0 si l'รฉlรฉment n'est pas trouvรฉ."; Blockly.Msg.LISTS_INLIST = "dans la liste"; Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 est vide"; Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Renvoie vrai si la liste est vide."; Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; Blockly.Msg.LISTS_LENGTH_TITLE = "longueur de %1"; Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Renvoie la longueur dโ€™une liste."; Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; Blockly.Msg.LISTS_REPEAT_TITLE = "crรฉer une liste avec lโ€™รฉlรฉment %1 rรฉpรฉtรฉ %2 fois"; Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Crรฉe une liste consistant en la valeur fournie rรฉpรฉtรฉe le nombre de fois indiquรฉ."; Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "comme"; Blockly.Msg.LISTS_SET_INDEX_INSERT = "insรฉrer en"; Blockly.Msg.LISTS_SET_INDEX_SET = "mettre"; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Insรจre lโ€™รฉlรฉment au dรฉbut dโ€™une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "Insรจre lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le dernier รฉlรฉment."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "Insรจre lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le premier รฉlรฉment."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Ajouter lโ€™รฉlรฉment ร  la fin dโ€™une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Insรจre lโ€™รฉlรฉment au hasard dans une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Fixe le premier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Fixe lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le dernier รฉlรฉment."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Fixe lโ€™รฉlรฉment ร  la position indiquรฉe dans une liste. #1 est le premier รฉlรฉment."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Fixe le dernier รฉlรฉment dans une liste."; Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Fixe un รฉlรฉment au hasard dans une liste."; Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "croissant"; Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "dรฉcroissant"; Blockly.Msg.LISTS_SORT_TITLE = "trier %1 %2 %3"; Blockly.Msg.LISTS_SORT_TOOLTIP = "Trier une copie dโ€™une liste."; Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabรฉtique, en ignorant la casse"; Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numรฉrique"; Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabรฉtique"; Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "crรฉer une liste depuis le texte"; Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "crรฉer un texte depuis la liste"; Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Rรฉunir une liste de textes en un seul, en les sรฉparant par un sรฉparateur."; Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Couper un texte en une liste de textes, en coupant ร  chaque sรฉparateur."; Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "avec le sรฉparateur"; Blockly.Msg.LOGIC_BOOLEAN_FALSE = "faux"; Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Renvoie soit vrai soit faux."; Blockly.Msg.LOGIC_BOOLEAN_TRUE = "vrai"; Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://fr.wikipedia.org/wiki/Inegalite_(mathematiques)"; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Renvoyer vrai si les deux entrรฉes sont รฉgales."; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Renvoyer vrai si la premiรจre entrรฉe est plus grande que la seconde."; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Renvoyer vrai si la premiรจre entrรฉe est plus grande ou รฉgale ร  la seconde."; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Renvoyer vrai si la premiรจre entrรฉe est plus petite que la seconde."; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Renvoyer vrai si la premiรจre entrรฉe est plus petite ou รฉgale ร  la seconde."; Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Renvoyer vrai si les deux entrรฉes sont diffรฉrentes."; Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; Blockly.Msg.LOGIC_NEGATE_TITLE = "pas %1"; Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Renvoie vrai si lโ€™entrรฉe est fausse. Renvoie faux si lโ€™entrรฉe est vraie."; Blockly.Msg.LOGIC_NULL = "nul"; Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; Blockly.Msg.LOGIC_NULL_TOOLTIP = "Renvoie nul."; Blockly.Msg.LOGIC_OPERATION_AND = "et"; Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; Blockly.Msg.LOGIC_OPERATION_OR = "ou"; Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Renvoyer vrai si les deux entrรฉes sont vraies."; Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Renvoyer vrai si au moins une des entrรฉes est vraie."; Blockly.Msg.LOGIC_TERNARY_CONDITION = "test"; Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://en.wikipedia.org/wiki/%3F:"; Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "si faux"; Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "si vrai"; Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Vรฉrifier la condition dans 'test'. Si elle est vraie, renvoie la valeur 'si vrai'โ€ฏ; sinon renvoie la valeur 'si faux'."; Blockly.Msg.MATH_ADDITION_SYMBOL = "+"; Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://fr.wikipedia.org/wiki/Arithmetique"; Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Renvoie la somme des deux nombres."; Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Renvoie le quotient des deux nombres."; Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Renvoie la diffรฉrence des deux nombres."; Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Renvoie le produit des deux nombres."; Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Renvoie le premier nombre รฉlevรฉ ร  la puissance du second."; Blockly.Msg.MATH_CHANGE_HELPURL = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter"; Blockly.Msg.MATH_CHANGE_TITLE = "incrรฉmenter %1 de %2"; Blockly.Msg.MATH_CHANGE_TOOLTIP = "Ajouter un nombre ร  la variable '%1'."; Blockly.Msg.MATH_CONSTANT_HELPURL = "https://en.wikipedia.org/wiki/Mathematical_constant"; Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Renvoie une des constantes courantes : ฯ€ (3.141โ€ฆ), e (2.718โ€ฆ), ฯ† (1.618โ€ฆ), sqrt(2) (1.414โ€ฆ), sqrt(ยฝ) (0.707โ€ฆ), ou โˆž (infini)."; Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_%28graphics%29"; Blockly.Msg.MATH_CONSTRAIN_TITLE = "contraindre %1 entre %2 et %3"; Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Contraindre un nombre ร  รชtre entre les limites spรฉcifiรฉes (incluses)."; Blockly.Msg.MATH_DIVISION_SYMBOL = "รท"; Blockly.Msg.MATH_IS_DIVISIBLE_BY = "est divisible par"; Blockly.Msg.MATH_IS_EVEN = "est pair"; Blockly.Msg.MATH_IS_NEGATIVE = "est nรฉgatif"; Blockly.Msg.MATH_IS_ODD = "est impair"; Blockly.Msg.MATH_IS_POSITIVE = "est positif"; Blockly.Msg.MATH_IS_PRIME = "est premier"; Blockly.Msg.MATH_IS_TOOLTIP = "Vรฉrifier si un nombre est pair, impair, premier, entier, positif, nรฉgatif, ou sโ€™il est divisible par un certain nombre. Renvoie vrai ou faux."; Blockly.Msg.MATH_IS_WHOLE = "est entier"; Blockly.Msg.MATH_MODULO_HELPURL = "https://en.wikipedia.org/wiki/Modulo_operation"; Blockly.Msg.MATH_MODULO_TITLE = "reste de %1 รท %2"; Blockly.Msg.MATH_MODULO_TOOLTIP = "Renvoyer le reste de la division euclidienne des deux nombres."; Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "ร—"; Blockly.Msg.MATH_NUMBER_HELPURL = "https://fr.wikipedia.org/wiki/Nombre"; Blockly.Msg.MATH_NUMBER_TOOLTIP = "Un nombre."; Blockly.Msg.MATH_ONLIST_HELPURL = ""; Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "moyenne de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "maximum de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "mรฉdiane de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "minimum de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "majoritaires de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "รฉlรฉment alรฉatoire de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "รฉcart-type de la liste"; Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "somme de la liste"; Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Renvoyer la moyenne (arithmรฉtique) des valeurs numรฉriques dans la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Renvoyer le plus grand nombre dans la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Renvoyer le nombre mรฉdian de la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Renvoyer le plus petit nombre dans la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Renvoyer une liste des รฉlรฉment(s) le(s) plus courant(s) dans la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Renvoyer un รฉlรฉment dans la liste au hasard."; Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Renvoyer lโ€™รฉcart-type de la liste."; Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Renvoyer la somme de tous les nombres dans la liste."; Blockly.Msg.MATH_POWER_SYMBOL = "^"; Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation"; Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "fraction alรฉatoire"; Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Renvoyer une fraction alรฉatoire entre 0.0 (inclus) et 1.0 (exclus)."; Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation"; Blockly.Msg.MATH_RANDOM_INT_TITLE = "entier alรฉatoire entre %1 et %2"; Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Renvoyer un entier alรฉatoire entre les deux limites spรฉcifiรฉes, incluses."; Blockly.Msg.MATH_ROUND_HELPURL = "https://en.wikipedia.org/wiki/Rounding"; Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "arrondir"; Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "arrondir par dรฉfaut"; Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "arrondir par excรจs"; Blockly.Msg.MATH_ROUND_TOOLTIP = "Arrondir un nombre au-dessus ou au-dessous."; Blockly.Msg.MATH_SINGLE_HELPURL = "https://fr.wikipedia.org/wiki/Racine_carree"; Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "valeur absolue"; Blockly.Msg.MATH_SINGLE_OP_ROOT = "racine carrรฉe"; Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Renvoie la valeur absolue dโ€™un nombre."; Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Renvoie e ร  la puissance dโ€™un nombre."; Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Renvoie le logarithme naturel dโ€™un nombre."; Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Renvoie le logarithme base 10 dโ€™un nombre."; Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Renvoie lโ€™opposรฉ dโ€™un nombre"; Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Renvoie 10 ร  la puissance dโ€™un nombre."; Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Renvoie la racine carrรฉe dโ€™un nombre."; Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-"; Blockly.Msg.MATH_TRIG_ACOS = "acos"; Blockly.Msg.MATH_TRIG_ASIN = "asin"; Blockly.Msg.MATH_TRIG_ATAN = "atan"; Blockly.Msg.MATH_TRIG_COS = "cos"; Blockly.Msg.MATH_TRIG_HELPURL = "https://en.wikipedia.org/wiki/Trigonometric_functions"; Blockly.Msg.MATH_TRIG_SIN = "sin"; Blockly.Msg.MATH_TRIG_TAN = "tan"; Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Renvoie lโ€™arccosinus dโ€™un nombre."; Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Renvoie lโ€™arcsinus dโ€™un nombre."; Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Renvoie lโ€™arctangente dโ€™un nombre."; Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Renvoie le cosinus dโ€™un angle en degrรฉs (pas en radians)."; Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Renvoie le sinus dโ€™un angle en degrรฉs (pas en radians)."; Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Renvoie la tangente dโ€™un angle en degrรฉs (pas en radians)."; Blockly.Msg.ME = "Moi"; Blockly.Msg.NEW_VARIABLE = "Nouvelle variableโ€ฆ"; Blockly.Msg.NEW_VARIABLE_TITLE = "Nouveau nom de la variable :"; Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "autoriser les ordres"; Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "avec :"; Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "http://fr.wikipedia.org/wiki/Proc%C3%A9dure_%28informatique%29"; Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Exรฉcuter la fonction '%1' dรฉfinie par lโ€™utilisateur."; Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Exรฉcuter la fonction '%1' dรฉfinie par lโ€™utilisateur et utiliser son rรฉsultat."; Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "avec :"; Blockly.Msg.PROCEDURES_CREATE_DO = "Crรฉer '%1'"; Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Dรฉcrire cette fonctionโ€ฆ"; Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "faire quelque chose"; Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "pour"; Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Crรฉe une fonction sans sortie."; Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "retour"; Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Crรฉe une fonction avec une sortie."; Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Attention : Cette fonction a des paramรจtres en double."; Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Surligner la dรฉfinition de la fonction"; Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause"; Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Si une valeur est vraie, alors renvoyer une seconde valeur."; Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Attention : Ce bloc pourrait nโ€™รชtre utilisรฉ que dans une dรฉfinition de fonction."; Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "nom de lโ€™entrรฉe :"; Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Ajouter une entrรฉe ร  la fonction."; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "entrรฉes"; Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Ajouter, supprimer, ou rรฉarranger les entrรฉes de cette fonction."; Blockly.Msg.REDO = "Refaire"; Blockly.Msg.REMOVE_COMMENT = "Supprimer un commentaire"; Blockly.Msg.RENAME_VARIABLE = "Renommer la variableโ€ฆ"; Blockly.Msg.RENAME_VARIABLE_TITLE = "Renommer toutes les variables ยซย %1ย ยป en :"; Blockly.Msg.TEXT_APPEND_APPENDTEXT = "ajouter le texte"; Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; Blockly.Msg.TEXT_APPEND_TO = "ร "; Blockly.Msg.TEXT_APPEND_TOOLTIP = "Ajouter du texte ร  la variable '%1'."; Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "en minuscules"; Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "en Majuscule Au Dรฉbut De Chaque Mot"; Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "en MAJUSCULES"; Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Renvoyer une copie du texte dans une autre casse."; Blockly.Msg.TEXT_CHARAT_FIRST = "obtenir la premiรจre lettre"; Blockly.Msg.TEXT_CHARAT_FROM_END = "obtenir la lettre # depuis la fin"; Blockly.Msg.TEXT_CHARAT_FROM_START = "obtenir la lettre #"; Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text"; Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "dans le texte"; Blockly.Msg.TEXT_CHARAT_LAST = "obtenir la derniรจre lettre"; Blockly.Msg.TEXT_CHARAT_RANDOM = "obtenir une lettre au hasard"; Blockly.Msg.TEXT_CHARAT_TAIL = ""; Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Renvoie la lettre ร  la position indiquรฉe."; Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Ajouter un รฉlรฉment au texte."; Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "joindre"; Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Ajouter, supprimer, ou rรฉordonner des sections pour reconfigurer ce bloc de texte."; Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "jusquโ€™ร  la lettre # depuis la fin"; Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "jusquโ€™ร  la lettre #"; Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "jusquโ€™ร  la derniรจre lettre"; Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "dans le texte"; Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "obtenir la sous-chaรฎne depuis la premiรจre lettre"; Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "obtenir la sous-chaรฎne depuis la lettre # depuis la fin"; Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "obtenir la sous-chaรฎne depuis la lettre #"; Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Renvoie une partie indiquรฉe du texte."; Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "dans le texte"; Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "trouver la premiรจre occurrence de la chaรฎne"; Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "trouver la derniรจre occurrence de la chaรฎne"; Blockly.Msg.TEXT_INDEXOF_TAIL = ""; Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Renvoie lโ€™index de la premiรจre/derniรจre occurrence de la premiรจre chaรฎne dans la seconde. Renvoie 0 si la chaรฎne nโ€™est pas trouvรฉe."; Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 est vide"; Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Renvoie vrai si le texte fourni est vide."; Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation"; Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "crรฉer un texte avec"; Blockly.Msg.TEXT_JOIN_TOOLTIP = "Crรฉer un morceau de texte en agrรฉgeant un nombre quelconque dโ€™รฉlรฉments."; Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; Blockly.Msg.TEXT_LENGTH_TITLE = "longueur de %1"; Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Renvoie le nombre de lettres (espaces compris) dans le texte fourni."; Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; Blockly.Msg.TEXT_PRINT_TITLE = "afficher %1"; Blockly.Msg.TEXT_PRINT_TOOLTIP = "Afficher le texte, le nombre ou une autre valeur spรฉcifiรฉ."; Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Demander un nombre ร  lโ€™utilisateur."; Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Demander un texte ร  lโ€™utilisateur."; Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "invite pour un nombre avec un message"; Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "invite pour un texte avec un message"; Blockly.Msg.TEXT_TEXT_HELPURL = "https://en.wikipedia.org/wiki/String_(computer_science)"; Blockly.Msg.TEXT_TEXT_TOOLTIP = "Une lettre, un mot ou une ligne de texte."; Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "supprimer les espaces des deux cรดtรฉs"; Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "supprimer les espaces du cรดtรฉ gauche"; Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "supprimer les espaces du cรดtรฉ droit"; Blockly.Msg.TEXT_TRIM_TOOLTIP = "Renvoyer une copie du texte avec les espaces supprimรฉs dโ€™un bout ou des deux."; Blockly.Msg.TODAY = "Aujourd'hui"; Blockly.Msg.UNDO = "Annuler"; Blockly.Msg.VARIABLES_DEFAULT_NAME = "รฉlรฉment"; Blockly.Msg.VARIABLES_GET_CREATE_SET = "Crรฉer 'fixer %1'"; Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; Blockly.Msg.VARIABLES_GET_TOOLTIP = "Renvoie la valeur de cette variable."; Blockly.Msg.VARIABLES_SET = "fixer %1 ร  %2"; Blockly.Msg.VARIABLES_SET_CREATE_GET = "Crรฉer 'obtenir %1'"; Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; Blockly.Msg.VARIABLES_SET_TOOLTIP = "Fixe cette variable pour quโ€™elle soit รฉgale ร  la valeur de lโ€™entrรฉe."; Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME; Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE; Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF; Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO; Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO; Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE; Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE; Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST; Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST; Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO; Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF; Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL; Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO; Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST; Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO; Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME; Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME; Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME; Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST; Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT; // Ardublockly strings Blockly.Msg.ARD_ANALOGREAD = "Lecture du signal analogique #"; Blockly.Msg.ARD_ANALOGREAD_TIP = "Valeur de retour entre 0 et 1024"; Blockly.Msg.ARD_ANALOGWRITE = "Ecriture du signal analogique #"; Blockly.Msg.ARD_ANALOGWRITE_TIP = "Ecrit une valeur analogique comprise entre 0 et 255 sur un port PWM spรฉcifique"; Blockly.Msg.ARD_BUILTIN_LED = "Configurer la DEL"; Blockly.Msg.ARD_BUILTIN_LED_TIP = "Allumer ou รฉteindre la DEL de la carte"; Blockly.Msg.ARD_COMPONENT_WARN1 = "A %1 configuration block with the same %2 name must be added to use this block!"; // untranslated Blockly.Msg.ARD_DEFINE = "Dรฉfinir"; Blockly.Msg.ARD_DIGITALREAD = "Lecture du signal numรฉrique #"; Blockly.Msg.ARD_DIGITALREAD_TIP = "Lecture de la valeur d'un signal numรฉrique: HAUT ou BAS"; Blockly.Msg.ARD_DIGITALWRITE = "Configuration du signal numรฉrique #"; Blockly.Msg.ARD_DIGITALWRITE_TIP = " Ecriture de la valeur HAUT ou BAS du signal numรฉrique #"; Blockly.Msg.ARD_FUN_RUN_LOOP = "Arduino boucle infinie:"; Blockly.Msg.ARD_FUN_RUN_SETUP = "Arduino exรฉcute en premier:"; Blockly.Msg.ARD_FUN_RUN_TIP = "Definition de la configuration de l'Arduino: fonctions setup() et loop()."; Blockly.Msg.ARD_HIGH = "HAUT"; Blockly.Msg.ARD_HIGHLOW_TIP = " Configuration d'un signal ร  l'รฉtat HAUT ou BAS"; Blockly.Msg.ARD_LOW = "BAS"; Blockly.Msg.ARD_MAP = "Converti"; Blockly.Msg.ARD_MAP_TIP = "Converti un nombre de la plage [0-1024]."; Blockly.Msg.ARD_MAP_VAL = "valeur de [0-"; Blockly.Msg.ARD_NOTONE = "Eteindre la tonalitรฉ du signal #"; Blockly.Msg.ARD_NOTONE_PIN = "PAS de Signal de tonalitรฉ #"; Blockly.Msg.ARD_NOTONE_PIN_TIP = "Arret de la gรฉnรฉration de tonalitรฉ (son)sur un signal"; Blockly.Msg.ARD_NOTONE_TIP = "Eteindre / Activer la tonalitรฉ du signal selectionรฉ"; Blockly.Msg.ARD_PIN_WARN1 = "Signal %1 est utilisรฉ pour %2 alors que signal %3. Dรฉjร  utilisรฉ en tant que %4."; Blockly.Msg.ARD_PULSETIMEOUT_TIP = "Mesure la durรฉe d'une pulsation sur le signal selectionรฉ, dans le delai imparti"; Blockly.Msg.ARD_PULSE_READ = "mesure %1 impulsion sur le signal #%2"; Blockly.Msg.ARD_PULSE_READ_TIMEOUT = "mesure %1 impulsion sur le signal #%2 (dรฉlai de retard %3 ฮผs)"; Blockly.Msg.ARD_PULSE_TIP = "Mesure la durรฉe d'une pulsation sur le signal selectionรฉ."; Blockly.Msg.ARD_SERIAL_BPS = "bps"; Blockly.Msg.ARD_SERIAL_PRINT = "imprimer"; Blockly.Msg.ARD_SERIAL_PRINT_NEWLINE = "ajouter une nouvelle ligne"; Blockly.Msg.ARD_SERIAL_PRINT_TIP = "Imprime les donnรฉes sur la console sรฉrie en texte lisible ASCII."; Blockly.Msg.ARD_SERIAL_PRINT_WARN = "Un bloc de configuration pour %1 doit รชtre ajoutรฉ ร  l'espace de travail afin d'utiliser ce bloc!"; Blockly.Msg.ARD_SERIAL_SETUP = "Configuration"; Blockly.Msg.ARD_SERIAL_SETUP_TIP = "Choisir la vitesse d'un pรฉriphรฉrique sรฉrie"; Blockly.Msg.ARD_SERIAL_SPEED = ": vitesse"; Blockly.Msg.ARD_SERVO_READ = "Lecture du signal# du SERVO"; Blockly.Msg.ARD_SERVO_READ_TIP = "Lecture d'un angle du SERVO"; Blockly.Msg.ARD_SERVO_WRITE = "Configurer SERVO sur Patte"; Blockly.Msg.ARD_SERVO_WRITE_DEG_180 = "Degrรฉs (0~180)"; Blockly.Msg.ARD_SERVO_WRITE_TIP = "Configurer un SERVO ร  un angle donnรฉ"; Blockly.Msg.ARD_SERVO_WRITE_TO = "vers"; Blockly.Msg.ARD_SETTONE = "Dรฉfinir une tonalitรฉ sur le signal #"; Blockly.Msg.ARD_SPI_SETUP = "Configuration"; Blockly.Msg.ARD_SPI_SETUP_CONF = "configuration:"; Blockly.Msg.ARD_SPI_SETUP_DIVIDE = "Division de frรฉquence"; Blockly.Msg.ARD_SPI_SETUP_LSBFIRST = "LSBFIRST"; Blockly.Msg.ARD_SPI_SETUP_MODE = "mode SPI (idle - edge)"; Blockly.Msg.ARD_SPI_SETUP_MODE0 = "0 (Bas - Descendant)"; Blockly.Msg.ARD_SPI_SETUP_MODE1 = "1 (Bas - Montant)"; Blockly.Msg.ARD_SPI_SETUP_MODE2 = "2 (Haut - Descendant)"; Blockly.Msg.ARD_SPI_SETUP_MODE3 = "3 (Haut - Montant)"; Blockly.Msg.ARD_SPI_SETUP_MSBFIRST = "MSBFIRST"; Blockly.Msg.ARD_SPI_SETUP_SHIFT = "dรฉcalage de donnรฉes"; Blockly.Msg.ARD_SPI_SETUP_TIP = "Configuration du pรฉriphรฉrique SPI."; Blockly.Msg.ARD_SPI_TRANSRETURN_TIP = "Envoie d'un message SPI ร  un esclave prรฉcis et recuperation de la donnรฉe."; Blockly.Msg.ARD_SPI_TRANS_NONE = "vide"; Blockly.Msg.ARD_SPI_TRANS_SLAVE = "vers le signal esclave"; Blockly.Msg.ARD_SPI_TRANS_TIP = "Envoie d'un message SPI ร  un esclave prรฉcis."; Blockly.Msg.ARD_SPI_TRANS_VAL = "transfert"; Blockly.Msg.ARD_SPI_TRANS_WARN1 = "Un bloc de configuration pour %1 doit รชtre ajoutรฉ ร  l'espace de travail afin d'utiliser ce bloc!"; Blockly.Msg.ARD_SPI_TRANS_WARN2 = "L'ancienne valeur du signal %1 n'est plus disponible."; Blockly.Msg.ARD_STEPPER_COMPONENT = "stepper"; // untranslated Blockly.Msg.ARD_STEPPER_DEFAULT_NAME = "MyStepper"; // untranslated Blockly.Msg.ARD_STEPPER_FOUR_PINS = "4"; Blockly.Msg.ARD_STEPPER_MOTOR = "Moteur pas-ร -pas:"; Blockly.Msg.ARD_STEPPER_NUMBER_OF_PINS = "Number of pins"; // untranslated Blockly.Msg.ARD_STEPPER_PIN1 = "signal1 #"; Blockly.Msg.ARD_STEPPER_PIN2 = "signal2 #"; Blockly.Msg.ARD_STEPPER_PIN3 = "signal3 #"; Blockly.Msg.ARD_STEPPER_PIN4 = "signal4 #"; Blockly.Msg.ARD_STEPPER_REVOLVS = "Combien de pas par tour"; Blockly.Msg.ARD_STEPPER_SETUP = "Configuration"; Blockly.Msg.ARD_STEPPER_SETUP_TIP = "Configuration d'un moteur pas-ร -pas: signaux et autres paramรจtres."; Blockly.Msg.ARD_STEPPER_SPEED = "Configuration de la vitesse(rpm) ร "; Blockly.Msg.ARD_STEPPER_STEP = "Dรฉplacement grace au moteur pas-ร -pas"; Blockly.Msg.ARD_STEPPER_STEPS = "pas"; Blockly.Msg.ARD_STEPPER_STEP_TIP = "Configurer le moteur pas-ร -pas avec un nombre prรฉcis de pas."; Blockly.Msg.ARD_STEPPER_TWO_PINS = "2"; Blockly.Msg.ARD_TIME_DELAY = "Dรฉlai d'attente de"; Blockly.Msg.ARD_TIME_DELAY_MICROS = "microsecondes"; Blockly.Msg.ARD_TIME_DELAY_MICRO_TIP = "Attendre un dรฉlai prรฉcis en microsecondes"; Blockly.Msg.ARD_TIME_DELAY_TIP = "Attendre un dรฉlai prรฉcis en millisecondes"; Blockly.Msg.ARD_TIME_INF = "Attente sans fin (fin du programme)"; Blockly.Msg.ARD_TIME_INF_TIP = "Attente indรฉfinie, arrรชt du programme."; Blockly.Msg.ARD_TIME_MICROS = "Temps รฉcoulรฉ (microsecondes)"; Blockly.Msg.ARD_TIME_MICROS_TIP = "Renvoie le temps en microseconds depuis le lancement de ce programme sur la carte Arduino. Doit รชtre stockรฉ dans un Entier long positif"; Blockly.Msg.ARD_TIME_MILLIS = "Temps รฉcoulรฉ (millisecondes)"; Blockly.Msg.ARD_TIME_MILLIS_TIP = "Renvoie le temps en milliseconds depuis le lancement de ce programme sur la carte Arduino. Doit รชtre stockรฉ dans un Entier long positif"; Blockly.Msg.ARD_TIME_MS = "millisecondes"; Blockly.Msg.ARD_TONEFREQ = "ร  la frequence"; Blockly.Msg.ARD_TONE_FREQ = "frequence"; Blockly.Msg.ARD_TONE_PIN = "Signal de tonalitรฉ #"; Blockly.Msg.ARD_TONE_PIN_TIP = "Gรฉnรฉration de tonalitรฉ (son)sur un signal"; Blockly.Msg.ARD_TONE_TIP = " Configurer le signal de tonalitรฉ dans la plage: 31 - 65535"; Blockly.Msg.ARD_TONE_WARNING = "La frรฉquence doit รชtre dans la plage 31 - 65535"; Blockly.Msg.ARD_TYPE_ARRAY = "Tableau"; Blockly.Msg.ARD_TYPE_BOOL = "Boolรฉen"; Blockly.Msg.ARD_TYPE_CHAR = "Charactรจre"; Blockly.Msg.ARD_TYPE_CHILDBLOCKMISSING = "Dรฉpendance manquante"; Blockly.Msg.ARD_TYPE_DECIMAL = "Dรฉcimal"; Blockly.Msg.ARD_TYPE_LONG = "Entier long"; Blockly.Msg.ARD_TYPE_NULL = "Null"; Blockly.Msg.ARD_TYPE_NUMBER = "Entier"; Blockly.Msg.ARD_TYPE_SHORT = "Entier court"; Blockly.Msg.ARD_TYPE_TEXT = "Texte"; Blockly.Msg.ARD_TYPE_UNDEF = "Non dรฉfini"; Blockly.Msg.ARD_VAR_AS = "comme"; Blockly.Msg.ARD_VAR_AS_TIP = "Configure une valeur ร  un type prรฉcis"; Blockly.Msg.ARD_WRITE_TO = "ร "; Blockly.Msg.NEW_INSTANCE = "New instance..."; // untranslated Blockly.Msg.NEW_INSTANCE_TITLE = "New instance name:"; // untranslated Blockly.Msg.RENAME_INSTANCE = "Rename instance..."; // untranslated Blockly.Msg.RENAME_INSTANCE_TITLE = "Rename all '%1' instances to:"; // untranslated
carlosperate/ardublockly
blockly/msg/js/fr.js
JavaScript
apache-2.0
39,135
/* * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.storagegateway.model; /** * <p> * A JSON object containing the following fields: * </p> * * <ul> * <li> GatewayARN </li> * <li> DescribeMaintenanceStartTimeOutput$DayOfWeek </li> * <li> DescribeMaintenanceStartTimeOutput$HourOfDay </li> * <li> DescribeMaintenanceStartTimeOutput$MinuteOfHour </li> * <li> DescribeMaintenanceStartTimeOutput$Timezone </li> * * </ul> */ public class DescribeMaintenanceStartTimeResult { /** * The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>50 - 500<br/> */ private String gatewayARN; /** * A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 23<br/> */ private Integer hourOfDay; /** * A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 59<br/> */ private Integer minuteOfHour; /** * An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 6<br/> */ private Integer dayOfWeek; /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 */ private String timezone; /** * The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>50 - 500<br/> * * @return The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. */ public String getGatewayARN() { return gatewayARN; } /** * The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>50 - 500<br/> * * @param gatewayARN The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. */ public void setGatewayARN(String gatewayARN) { this.gatewayARN = gatewayARN; } /** * The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Length: </b>50 - 500<br/> * * @param gatewayARN The Amazon Resource Name (ARN) of the gateway. Use the * <a>ListGateways</a> operation to return a list of gateways for your * account and region. * * @return A reference to this updated object so that method calls can be chained * together. */ public DescribeMaintenanceStartTimeResult withGatewayARN(String gatewayARN) { this.gatewayARN = gatewayARN; return this; } /** * A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 23<br/> * * @return A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. */ public Integer getHourOfDay() { return hourOfDay; } /** * A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 23<br/> * * @param hourOfDay A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. */ public void setHourOfDay(Integer hourOfDay) { this.hourOfDay = hourOfDay; } /** * A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 23<br/> * * @param hourOfDay A number between 0 and 23 that represents the hour of day. The hour of * day is in the time zone of the gateway. * * @return A reference to this updated object so that method calls can be chained * together. */ public DescribeMaintenanceStartTimeResult withHourOfDay(Integer hourOfDay) { this.hourOfDay = hourOfDay; return this; } /** * A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 59<br/> * * @return A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. */ public Integer getMinuteOfHour() { return minuteOfHour; } /** * A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 59<br/> * * @param minuteOfHour A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. */ public void setMinuteOfHour(Integer minuteOfHour) { this.minuteOfHour = minuteOfHour; } /** * A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 59<br/> * * @param minuteOfHour A number between 0 and 59 that represents the minute of hour. The * minute of hour is in the time zone of the gateway. * * @return A reference to this updated object so that method calls can be chained * together. */ public DescribeMaintenanceStartTimeResult withMinuteOfHour(Integer minuteOfHour) { this.minuteOfHour = minuteOfHour; return this; } /** * An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 6<br/> * * @return An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. */ public Integer getDayOfWeek() { return dayOfWeek; } /** * An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 6<br/> * * @param dayOfWeek An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. */ public void setDayOfWeek(Integer dayOfWeek) { this.dayOfWeek = dayOfWeek; } /** * An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Range: </b>0 - 6<br/> * * @param dayOfWeek An ordinal number between 0 and 6 that represents the day of the week, * where 0 represents Sunday and 6 represents Saturday. The day of week * is in the time zone of the gateway. * * @return A reference to this updated object so that method calls can be chained * together. */ public DescribeMaintenanceStartTimeResult withDayOfWeek(Integer dayOfWeek) { this.dayOfWeek = dayOfWeek; return this; } /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 * * @return One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * * @see GatewayTimezone */ public String getTimezone() { return timezone; } /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 * * @param timezone One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * * @see GatewayTimezone */ public void setTimezone(String timezone) { this.timezone = timezone; } /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 * * @param timezone One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * * @return A reference to this updated object so that method calls can be chained * together. * * @see GatewayTimezone */ public DescribeMaintenanceStartTimeResult withTimezone(String timezone) { this.timezone = timezone; return this; } /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 * * @param timezone One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * * @see GatewayTimezone */ public void setTimezone(GatewayTimezone timezone) { this.timezone = timezone.toString(); } /** * One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * <p> * Returns a reference to this object so that method calls can be chained together. * <p> * <b>Constraints:</b><br/> * <b>Allowed Values: </b>GMT-12:00, GMT-11:00, GMT-10:00, GMT-9:00, GMT-8:00, GMT-7:00, GMT-6:00, GMT-5:00, GMT-4:00, GMT-3:30, GMT-3:00, GMT-2:00, GMT-1:00, GMT, GMT+1:00, GMT+2:00, GMT+3:00, GMT+3:30, GMT+4:00, GMT+4:30, GMT+5:00, GMT+5:30, GMT+5:45, GMT+6:00, GMT+7:00, GMT+8:00, GMT+9:00, GMT+9:30, GMT+10:00, GMT+11:00, GMT+12:00 * * @param timezone One of the <a>GatewayTimezone</a> values that indicates the time zone * that is set for the gateway. The start time and day of week specified * should be in the time zone of the gateway. * * @return A reference to this updated object so that method calls can be chained * together. * * @see GatewayTimezone */ public DescribeMaintenanceStartTimeResult withTimezone(GatewayTimezone timezone) { this.timezone = timezone.toString(); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (gatewayARN != null) sb.append("GatewayARN: " + gatewayARN + ", "); if (hourOfDay != null) sb.append("HourOfDay: " + hourOfDay + ", "); if (minuteOfHour != null) sb.append("MinuteOfHour: " + minuteOfHour + ", "); if (dayOfWeek != null) sb.append("DayOfWeek: " + dayOfWeek + ", "); if (timezone != null) sb.append("Timezone: " + timezone + ", "); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode()); hashCode = prime * hashCode + ((getHourOfDay() == null) ? 0 : getHourOfDay().hashCode()); hashCode = prime * hashCode + ((getMinuteOfHour() == null) ? 0 : getMinuteOfHour().hashCode()); hashCode = prime * hashCode + ((getDayOfWeek() == null) ? 0 : getDayOfWeek().hashCode()); hashCode = prime * hashCode + ((getTimezone() == null) ? 0 : getTimezone().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeMaintenanceStartTimeResult == false) return false; DescribeMaintenanceStartTimeResult other = (DescribeMaintenanceStartTimeResult)obj; if (other.getGatewayARN() == null ^ this.getGatewayARN() == null) return false; if (other.getGatewayARN() != null && other.getGatewayARN().equals(this.getGatewayARN()) == false) return false; if (other.getHourOfDay() == null ^ this.getHourOfDay() == null) return false; if (other.getHourOfDay() != null && other.getHourOfDay().equals(this.getHourOfDay()) == false) return false; if (other.getMinuteOfHour() == null ^ this.getMinuteOfHour() == null) return false; if (other.getMinuteOfHour() != null && other.getMinuteOfHour().equals(this.getMinuteOfHour()) == false) return false; if (other.getDayOfWeek() == null ^ this.getDayOfWeek() == null) return false; if (other.getDayOfWeek() != null && other.getDayOfWeek().equals(this.getDayOfWeek()) == false) return false; if (other.getTimezone() == null ^ this.getTimezone() == null) return false; if (other.getTimezone() != null && other.getTimezone().equals(this.getTimezone()) == false) return false; return true; } }
frsyuki/aws-sdk-for-java
src/main/java/com/amazonaws/services/storagegateway/model/DescribeMaintenanceStartTimeResult.java
Java
apache-2.0
18,484
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.conf import settings from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import authenticate from zerver.decorator import authenticated_json_post_view, has_request_variables, REQ from zerver.lib.actions import do_change_password, \ do_change_full_name, do_change_enable_desktop_notifications, \ do_change_enter_sends, do_change_enable_sounds, \ do_change_enable_offline_email_notifications, do_change_enable_digest_emails, \ do_change_enable_offline_push_notifications, do_change_autoscroll_forever, \ do_change_default_desktop_notifications, \ do_change_enable_stream_desktop_notifications, do_change_enable_stream_sounds, \ do_regenerate_api_key, do_change_avatar_source, do_change_twenty_four_hour_time, do_change_left_side_userlist from zerver.lib.avatar import avatar_url from zerver.lib.response import json_success, json_error from zerver.lib.upload import upload_avatar_image from zerver.lib.validator import check_bool from zerver.models import UserProfile from zerver.lib.rest import rest_dispatch as _rest_dispatch rest_dispatch = csrf_exempt((lambda request, *args, **kwargs: _rest_dispatch(request, globals(), *args, **kwargs))) def name_changes_disabled(realm): return settings.NAME_CHANGES_DISABLED or realm.name_changes_disabled @authenticated_json_post_view @has_request_variables def json_change_ui_settings(request, user_profile, autoscroll_forever=REQ(validator=check_bool, default=None), default_desktop_notifications=REQ(validator=check_bool, default=None)): result = {} if autoscroll_forever is not None and \ user_profile.autoscroll_forever != autoscroll_forever: do_change_autoscroll_forever(user_profile, autoscroll_forever) result['autoscroll_forever'] = autoscroll_forever if default_desktop_notifications is not None and \ user_profile.default_desktop_notifications != default_desktop_notifications: do_change_default_desktop_notifications(user_profile, default_desktop_notifications) result['default_desktop_notifications'] = default_desktop_notifications return json_success(result) @authenticated_json_post_view @has_request_variables def json_change_settings(request, user_profile, full_name=REQ(), old_password=REQ(default=""), new_password=REQ(default=""), confirm_password=REQ(default="")): if new_password != "" or confirm_password != "": if new_password != confirm_password: return json_error(_("New password must match confirmation password!")) if not authenticate(username=user_profile.email, password=old_password): return json_error(_("Wrong password!")) do_change_password(user_profile, new_password) result = {} if user_profile.full_name != full_name and full_name.strip() != "": if name_changes_disabled(user_profile.realm): # Failingly silently is fine -- they can't do it through the UI, so # they'd have to be trying to break the rules. pass else: new_full_name = full_name.strip() if len(new_full_name) > UserProfile.MAX_NAME_LENGTH: return json_error(_("Name too long!")) do_change_full_name(user_profile, new_full_name) result['full_name'] = new_full_name return json_success(result) @authenticated_json_post_view @has_request_variables def json_time_setting(request, user_profile, twenty_four_hour_time=REQ(validator=check_bool, default=None)): result = {} if twenty_four_hour_time is not None and \ user_profile.twenty_four_hour_time != twenty_four_hour_time: do_change_twenty_four_hour_time(user_profile, twenty_four_hour_time) result['twenty_four_hour_time'] = twenty_four_hour_time return json_success(result) @authenticated_json_post_view @has_request_variables def json_left_side_userlist(request, user_profile, left_side_userlist=REQ(validator=check_bool, default=None)): result = {} if left_side_userlist is not None and \ user_profile.left_side_userlist != left_side_userlist: do_change_left_side_userlist(user_profile, left_side_userlist) result['left_side_userlist'] = left_side_userlist return json_success(result) @authenticated_json_post_view @has_request_variables def json_change_notify_settings(request, user_profile, enable_stream_desktop_notifications=REQ(validator=check_bool, default=None), enable_stream_sounds=REQ(validator=check_bool, default=None), enable_desktop_notifications=REQ(validator=check_bool, default=None), enable_sounds=REQ(validator=check_bool, default=None), enable_offline_email_notifications=REQ(validator=check_bool, default=None), enable_offline_push_notifications=REQ(validator=check_bool, default=None), enable_digest_emails=REQ(validator=check_bool, default=None)): result = {} # Stream notification settings. if enable_stream_desktop_notifications is not None and \ user_profile.enable_stream_desktop_notifications != enable_stream_desktop_notifications: do_change_enable_stream_desktop_notifications( user_profile, enable_stream_desktop_notifications) result['enable_stream_desktop_notifications'] = enable_stream_desktop_notifications if enable_stream_sounds is not None and \ user_profile.enable_stream_sounds != enable_stream_sounds: do_change_enable_stream_sounds(user_profile, enable_stream_sounds) result['enable_stream_sounds'] = enable_stream_sounds # PM and @-mention settings. if enable_desktop_notifications is not None and \ user_profile.enable_desktop_notifications != enable_desktop_notifications: do_change_enable_desktop_notifications(user_profile, enable_desktop_notifications) result['enable_desktop_notifications'] = enable_desktop_notifications if enable_sounds is not None and \ user_profile.enable_sounds != enable_sounds: do_change_enable_sounds(user_profile, enable_sounds) result['enable_sounds'] = enable_sounds if enable_offline_email_notifications is not None and \ user_profile.enable_offline_email_notifications != enable_offline_email_notifications: do_change_enable_offline_email_notifications(user_profile, enable_offline_email_notifications) result['enable_offline_email_notifications'] = enable_offline_email_notifications if enable_offline_push_notifications is not None and \ user_profile.enable_offline_push_notifications != enable_offline_push_notifications: do_change_enable_offline_push_notifications(user_profile, enable_offline_push_notifications) result['enable_offline_push_notifications'] = enable_offline_push_notifications if enable_digest_emails is not None and \ user_profile.enable_digest_emails != enable_digest_emails: do_change_enable_digest_emails(user_profile, enable_digest_emails) result['enable_digest_emails'] = enable_digest_emails return json_success(result) @authenticated_json_post_view def json_set_avatar(request, user_profile): if len(request.FILES) != 1: return json_error(_("You must upload exactly one avatar.")) user_file = list(request.FILES.values())[0] upload_avatar_image(user_file, user_profile, user_profile.email) do_change_avatar_source(user_profile, UserProfile.AVATAR_FROM_USER) user_avatar_url = avatar_url(user_profile) json_result = dict( avatar_url = user_avatar_url ) return json_success(json_result) @has_request_variables def regenerate_api_key(request, user_profile): do_regenerate_api_key(user_profile) json_result = dict( api_key = user_profile.api_key ) return json_success(json_result) @has_request_variables def change_enter_sends(request, user_profile, enter_sends=REQ('enter_sends', validator=check_bool)): do_change_enter_sends(user_profile, enter_sends) return json_success()
peiwei/zulip
zerver/views/user_settings.py
Python
apache-2.0
9,076
import path from 'path' import chromedriver from 'chromedriver' import webdriver from 'selenium-webdriver' import electronPath from 'electron-prebuilt' import homeStyles from '../app/components/Home.css' import counterStyles from '../app/components/Counter.css' chromedriver.start() // on port 9515 process.on('exit', chromedriver.stop) const delay = time => new Promise(resolve => setTimeout(resolve, time)) describe('main window', function spec() { this.timeout(5000) before(async () => { await delay(1000) // wait chromedriver start time this.driver = new webdriver.Builder() .usingServer('http://localhost:9515') .withCapabilities({ chromeOptions: { binary: electronPath, args: ['app=' + path.resolve()], }, }) .forBrowser('electron') .build() }) after(async () => { await this.driver.quit() }) const findCounter = () => { return this.driver.findElement(webdriver.By.className(counterStyles.counter)) } const findButtons = () => { return this.driver.findElements(webdriver.By.className(counterStyles.btn)) } it('should open window', async () => { const title = await this.driver.getTitle() expect(title).to.equal('Hello Electron React!') }) it('should to Counter with click "to Counter" link', async () => { const link = await this.driver.findElement(webdriver.By.css(`.${homeStyles.container} > a`)) link.click() const counter = await findCounter() expect(await counter.getText()).to.equal('0') }) it('should display updated count after increment button click', async () => { const buttons = await findButtons() buttons[0].click() const counter = await findCounter() expect(await counter.getText()).to.equal('1') }) it('should display updated count after descrement button click', async () => { const buttons = await findButtons() const counter = await findCounter() buttons[1].click() // - expect(await counter.getText()).to.equal('0') }) it('shouldnt change if even and if odd button clicked', async () => { const buttons = await findButtons() const counter = await findCounter() buttons[2].click() // odd expect(await counter.getText()).to.equal('0') }) it('should change if odd and if odd button clicked', async () => { const buttons = await findButtons() const counter = await findCounter() buttons[0].click() // + buttons[2].click() // odd expect(await counter.getText()).to.equal('2') }) it('should change if async button clicked and a second later', async () => { const buttons = await findButtons() const counter = await findCounter() buttons[3].click() // async expect(await counter.getText()).to.equal('2') await this.driver.wait(() => counter.getText().then(text => text === '3') , 1000, 'count not as expected') }) it('should back to home if back button clicked', async () => { const link = await this.driver.findElement(webdriver.By.css(`.${counterStyles.backButton} > a`)) link.click() await this.driver.findElement(webdriver.By.className(homeStyles.container)) }) })
3-strand-code/3sc-desktop
test/e2e.js
JavaScript
apache-2.0
3,188
# 2017-02-10 ### ้˜ถๆฎตๆ€ป็ป“ * ไธ่ƒฝๅฟๅ—ไนฐ็š„sshๆˆ–่€…vpnไบ†๏ผŒ่‡ชๅทฑawsๆญไธ€ไธช๏ผŒไป˜่ดนไนŸๆฒก้—ฎ้ข˜ใ€‚
hitdavid/David
2017-02-10.md
Markdown
apache-2.0
115
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Sat Aug 23 20:46:19 CST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Interface org.xclcharts.event.touch.IChartTouch</title> <meta name="date" content="2014-08-23"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.xclcharts.event.touch.IChartTouch"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/xclcharts/event/touch/IChartTouch.html" title="interface in org.xclcharts.event.touch">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/xclcharts/event/touch/class-use/IChartTouch.html" target="_top">Frames</a></li> <li><a href="IChartTouch.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.xclcharts.event.touch.IChartTouch" class="title">Uses of Interface<br>org.xclcharts.event.touch.IChartTouch</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/xclcharts/event/touch/IChartTouch.html" title="interface in org.xclcharts.event.touch">IChartTouch</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.xclcharts.event.touch">org.xclcharts.event.touch</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.xclcharts.event.touch"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/xclcharts/event/touch/IChartTouch.html" title="interface in org.xclcharts.event.touch">IChartTouch</a> in <a href="../../../../../org/xclcharts/event/touch/package-summary.html">org.xclcharts.event.touch</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../org/xclcharts/event/touch/package-summary.html">org.xclcharts.event.touch</a> that implement <a href="../../../../../org/xclcharts/event/touch/IChartTouch.html" title="interface in org.xclcharts.event.touch">IChartTouch</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/xclcharts/event/touch/ChartTouch.html" title="class in org.xclcharts.event.touch">ChartTouch</a></strong></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/xclcharts/event/touch/IChartTouch.html" title="interface in org.xclcharts.event.touch">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/xclcharts/event/touch/class-use/IChartTouch.html" target="_top">Frames</a></li> <li><a href="IChartTouch.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
tangjilv/news-project
doc/org/xclcharts/event/touch/class-use/IChartTouch.html
HTML
apache-2.0
6,106
package com.example.apkdownloadspeedtest; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DBHelper_downloader extends SQLiteOpenHelper { public DBHelper_downloader(Context context) { //"download.db" is the name of database super(context, "download.db", null, 1); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table IF NOT EXISTS download_info(" + "task_id integer," + "thread_id integer," + "start_pos integer," + "end_pos integer," + "cur_pos integer," + "seg_size integer," + "complete_size integer," + "is_done integer," + "url text," + "primary key(url, thread_id)" + ")" ); } @Override public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) { // TODO Auto-generated method stub } }
princegyw/Personal-Utils
keep-old/FileDownloader_v5.0/DBHelper_downloader.java
Java
apache-2.0
929
package com.ogove.hr.Activities.Notification; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import com.ogove.hr.R; public class NotificationDepartmentCreate extends AppCompatActivity implements View.OnClickListener{ private EditText ndcTitle,ndcContent; private Button ndcCreate; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_notification_department_create); addControl(); } private void addControl() { ndcCreate = (Button) findViewById(R.id.ndcCreate); ndcTitle = (EditText) findViewById(R.id.ndcTitle); ndcContent = (EditText) findViewById(R.id.ndcContent); ndcCreate.setOnClickListener(this); ndcTitle.setOnClickListener(this); ndcContent.setOnClickListener(this); } @Override public void onClick(View v) { } }
LyokoVN/HRManager
app/src/main/java/com/ogove/hr/Activities/Notification/NotificationDepartmentCreate.java
Java
apache-2.0
1,077
<!DOCTYPE html> <html lang="ID"> <head> <style id="antiClickjack">body{display:none !important;}</style> <script type="text/javascript"> if (self === top) { var antiClickjack = document.getElementById("antiClickjack"); antiClickjack.parentNode.removeChild(antiClickjack); } else { top.location = self.location; } </script> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <title>Cashier | Champion-FX.com</title> <meta name="description" content="Access the world markets through one powerful all in one platform. The best choice for the modern trader where the client is king." /> <meta property="og:title" content="Champion-FX.com" /> <meta property="og:type" content="website" /> <meta property="og:image" content="/champion-static/images/cfx-animated-links.gif" /> <link rel="icon" type="image/png" sizes="16x16" href="/champion-static/images/favicons/CFX_favicon16.png" /> <link rel="icon" type="image/png" sizes="32x32" href="/champion-static/images/favicons/CFX_favicon32.png" /> <link rel="stylesheet" href="https://style.champion-fx.com/binary.css?vyr5n3yj" /> <link rel="stylesheet" href="/champion-static/css/style.min.css?vyr5n3yj" /> <script src="/champion-static/js/bundle.js?vyr5n3yj" type="text/javascript"></script> <script src="https://style.champion-fx.com/binary.js?vyr5n3yj" type="text/javascript"></script> </head> <body> <!--email_off--> <div id="top_group" class="logged-in"> <div id="msg_notification" class="notice-msg center-text"></div> <div id="topbar" class="primary-color-dark logged-in"> <div class="container"> <div class="row"> <div class="col-sm-12 topbar-container flex-items-sm-middle"> <div class="topbar-contacts"> <ul> <li class="last hidden-lg-up"> <a href="/champion-static/id/contact.html"> <span class="fx-topbar fx-contact"></span> </a> </li> <li class="last hidden-lg-down"> <a href="/champion-static/id/contact.html">Contact Us</a> </li> <li class="FX__Header__cta invisible logged-out hidden-lg-down"> <a class="btn-login button-secondary" href="javascript:;">Log In</a> </li> </ul> </div> <div class="invisible"> <div class="languages"> <ul id="display_language"> <li class="EN"> <span class="world world-white"></span> <span class="language">English</span> <span class="nav-caret"></span> </li> </ul> <ul id="select_language"> <li class="EN"> <span class="world world-black"></span> <span class="language">English</span> <span class="nav-caret"></span> </li> <li class="ID">Indonesia</li> <li class="DE">Deutsch</li> <li class="EN invisible">English</li> <li class="ES">Espaรฑol</li> <li class="FR">Franรงais</li> <li class="IT">Italiano</li> <li class="PL">Polski</li> <li class="PT">Portuguรชs</li> <li class="RU">ะ ัƒััะบะธะน</li> <li class="VI">Tiแบฟng Viแป‡t</li> <li class="ZH_CN">็ฎ€ไฝ“ไธญๆ–‡</li> <li class="ZH_TW">็น้ซ”ไธญๆ–‡</li> </ul> </div> </div> </div> </div> </div> </div> <div id="header"> <nav class="navbar"> <div class="container"> <span class="navbar__toggle logged-in" id="toggle-menu" href="button"></span> <a class="navbar__brand fx-logo logged-in" href="/champion-static/id/home.html"> <span class="fx-logo__icon--light"></span> <span class="fx-logo__wordmark--light"></span> </a> <div class="notify logged-in invisible"></div> <div class="navbar__nav has-accounts"> <ul class="navbar__nav__menu account-dropdown logged-in invisible"> <li> <a class="navbar__nav__toggle account-info" href="javascript:;"> <div class="mt-show invisible">MetaTrader 5</div> <div class="account-id mt-hide"></div> <div class="vertical-center"> <span class="account-balance mt-hide"></span> <span class="account-type mt-hide"></span> </div> </a> <ul class="navbar__nav__menu account-list"> <div class="login-id-list"></div> <li><a href="/champion-static/id/new-account/real.html" class="upgrade invisible">Upgrade to<br />Real Account</a></li> <li class="mt-hide invisible"><a href="/champion-static/id/user/metatrader.html"><span class="fx fx-mt5-o"></span>MetaTrader 5</a></li> <li class="hidden-lg-down"><a href="javascript:;" class="btn-logout logout">Sign out</a></li> </ul> </li> </ul> <ul class="navbar__nav__menu invisible logged-out"> <li> <a href="/champion-static/id/about-us.html" > <span class="fx fx-about"></span> About Us </a> </li> <li> <a href="javascript:;" class="navbar__nav__toggle"> <span class="fx fx-mt5-o"></span> MetaTrader 5 </a> <ul class="navbar__nav__menu invisible logged-out"> <li> <a href="/champion-static/id/trading-platform/metatrader-5.html" > About MT5 </a> </li> <li> <a href="/champion-static/id/trading-platform/mt5-types-of-accounts.html" > Types of accounts </a> </li> <li> <a href="/champion-static/id/forex.html" > Forex </a> </li> <li> <a href="/champion-static/id/cfd.html" > CFDs </a> </li> <li> <a href="/champion-static/id/metals.html" > Metals </a> </li> <li> <a href="/champion-static/id/economic-calendar.html" > Economic calendar </a> </li> </ul> </li> <li> <a href="javascript:;" class="navbar__nav__toggle"> <span class="fx fx-binary"></span> Binary Options </a> <ul class="navbar__nav__menu invisible logged-out"> <li> <a href="/champion-static/id/binary-options.html" > About binary options </a> </li> <li> <a href="/champion-static/id/types-of-accounts.html" > Types of accounts </a> </li> </ul> </li> <li> <a href="/champion-static/id/trading-platform.html" > <span class="fx fx-trading"></span> Trading platforms </a> </li> <li> <a href="/champion-static/id/partnerships.html" > <span class="fx fx-partnership"></span> Partnerships </a> </li> </ul> <ul class="navbar__nav__menu invisible logged-in"> <li class="mt-hide"> <a href="/champion-static/id/user/settings.html" > <span class="fx fx-setting"></span> Settings </a> </li> <li class="mt-show"> <a href="/champion-static/id/user/metatrader.html" > <span class="fx fx-setting"></span> Settings </a> </li> <li class="mt-hide"> <a href="/champion-static/id/cashier.html" > <span class="fx fx-dollar"></span> Cashier </a> </li> <li class="hidden-lg-up"> <a href="/champion-static/id/about-us.html" > <span class="fx fx-about"></span> About Us </a> </li> <li class="hidden-lg-up"> <a href="javascript:;" class="navbar__nav__toggle"> <span class="fx fx-mt5-o"></span> MetaTrader 5 </a> <ul class="navbar__nav__menu invisible logged-in"> <li> <a href="/champion-static/id/trading-platform/metatrader-5.html" > About MT5 </a> </li> <li> <a href="/champion-static/id/trading-platform/mt5-types-of-accounts.html" > Types of accounts </a> </li> <li> <a href="/champion-static/id/forex.html" > Forex </a> </li> <li> <a href="/champion-static/id/cfd.html" > CFDs </a> </li> <li> <a href="/champion-static/id/metals.html" > Metals </a> </li> <li> <a href="/champion-static/id/economic-calendar.html" > Economic calendar </a> </li> </ul> </li> <li class="hidden-lg-up"> <a href="javascript:;" class="navbar__nav__toggle"> <span class="fx fx-binary"></span> Binary Options </a> <ul class="navbar__nav__menu invisible logged-in"> <li> <a href="/champion-static/id/binary-options.html" > About binary options </a> </li> <li> <a href="/champion-static/id/types-of-accounts.html" > Types of accounts </a> </li> </ul> </li> <li class="mt-hide"> <a href="/champion-static/id/trading-platform/champion-trader.html" > <span class="fx fx-trading"></span> Trading platform </a> </li> <li class="mt-show"> <a href="/champion-static/id/trading-platform/mt5-platforms.html" > <span class="fx fx-trading"></span> Trading platforms </a> </li> <li class="hidden-lg-down"> <a href="https://academy.champion-fx.com/" target="_blank" > <span class="fx fx-mt5-o"></span> Academy </a> </li> <li class="hidden-lg-up"> <a href="/champion-static/id/partnerships.html" > <span class="fx fx-partnership"></span> Partnerships </a> </li> <li class="btn-logout logout invisible hidden-lg-up logged-in"> <a href="javascript:;" > <span class="fx fx-signout"></span> Sign out </a> </li> </ul> </div> <div class="navbar__button-group toggle-signup-modal logged-out invisible"> <a class="hidden-lg-up " href="javascript:;"><img src="/champion-static/images/signup/login.svg"/></a> <a class="button-secondary hidden-lg-down" href="javascript:;"><span>Sign Up</span></a </div> </div> </nav> </div> </div> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-K79SQVR" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script data-cfasync="false">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-K79SQVR');</script> <!-- End Google Tag Manager --> <main class="page-content" aria-label="Content" id="champion-container"> <div class="wrapper" id="champion-content"> <div class="fx-section"> <div class="container"> <h1 class="main-title" >Cashier</h1> <div class="fx-cashier"> <div id="fx-virtual" class="row invisible"> <div class="col-md-12"> <h3>Get more virtual money</h3> </div> <div class="col-md-2"> <div class="fx-md fx-virtual-money"></div> </div> <div class="col-md-10"> <div class="row"> <p>You can request more virtual money if your virtual balance falls below USD 1,000</p> </div> <div class="row"> <a class="button button_large" href="/champion-static/id/cashier/top-up-virtual.html" id="VRT_topup_link"> <span>Get USD 10,000.00</span> </a> </div> </div> </div> <div id="fx-real" class="row"> <div class="col-md-12"> <h3>Bank-wire, credit card, e-cash wallet</h3> </div> <div class="col-md-2"> <div class="fx-md fx-ecw"></div> </div> <div class="col-md-10"> <p>Manage the funds in your ChampionFX real account. You can deposit and withdraw funds via bank wire, credit card, or e-cash.</p> <p>Not sure if your preferred payment methods is supported? Refer to our list of available <a href="/champion-static/id/cashier/payment-methods.html">payment methods</a> to find out.</p> <div> <a class="button button_large invisible" href="/champion-static/id/cashier/forward.html#deposit" id="deposit-btn"> <span>Deposit</span> </a> <a class="button button_large invisible" href="/champion-static/id/cashier/forward.html#withdraw" id="withdraw-btn"> <span>Withdraw</span> </a> </div> </div> </div> </div> </div> </div> </div> </main> <footer id="footer" class="fx-footer primary-color content-inverse-color"> <div id="footer-menu" class=""> <div class="container"> <div class="row"> <div class="col-sm-10 col-xs-12"> <div class="row"> <div class="col-xs-6 col-md-3"> <div> <h4>ChampionFX</h4> <div class="separator-line-thin-gray"></div> <ul> <li class=""><a href="/champion-static/id/about-us.html">About Us</a></li> <li class=""><a href="/champion-static/id/contact.html">Contact Us</a></li> <li class=""><a href="/champion-static/id/licensing.html">License</a></li> <li class="mt-hide"><a href="/champion-static/id/terms-and-conditions.html">Terms and Conditions</a></li> <li class="mt-show invisible"><a href="/champion-static/id/terms-and-conditions.html#legal-cfd">Terms and Conditions</a></li> <li class=""><a href="/champion-static/id/cashier/payment-methods.html">Payment Methods</a></li> </ul> </div> </div> <div class="col-xs-6 col-md-3"> <div> <h4>Partnerships</h4> <div class="separator-line-thin-gray"></div> <ul> <li class=""><a href="/champion-static/id/partnerships-ib.html">Introducing Broker (IB)</a></li> <li class=""><a href="/champion-static/id/liquidity-solutions.html">Liquidity Solutions</a></li> <li class=""><a href="/champion-static/id/multiple-accounts-manager.html">Multiple Accounts Manager (MAM)</a></li> <li class=""><a href="/champion-static/id/partnerships-affiliate.html">Affiliate Programme</a></li> <li class=""><a href="/champion-static/id/partnerships-contributor.html">Content Contributor</a></li> </ul> </div> </div> <div class="col-xs-6 col-md-3 mt-show"> <div> <h4>MetaTrader 5</h4> <div class="separator-line-thin-gray"></div> <ul> <li class=""><a href="/champion-static/id/forex.html">Forex</a></li> <li class=""><a href="/champion-static/id/cfd.html">CFDs</a></li> <li class=""><a href="/champion-static/id/metals.html">Metals</a></li> <li class=""><a href="/champion-static/id/trading-platform/mt5-types-of-accounts.html">Types of accounts</a></li> <li class=""><a href="/champion-static/id/trading-platform/mt5-platforms.html">MetaTrader 5 trading platforms</a></li> </ul> </div> </div> <div class="col-xs-6 col-md-3 mt-hide"> <div> <h4>Binary options</h4> <div class="separator-line-thin-gray"></div> <ul> <li class=""><a href="/champion-static/id/binary-options.html">About binary options</a></li> <li class=""><a href="/champion-static/id/types-of-accounts.html">Types of accounts</a></li> <li class=""><a href="/champion-static/id/trading-platform/champion-trader.html">Binary options trading platforms</a></li> <li class=""><a href="/champion-static/id/trading-times.html">Trading Times</a></li> </ul> </div> </div> <div class="col-xs-6 col-md-3"> </div> </div> </div> <div class="col-sm-2 col-xs-12"> <ul class="social-network"> <li> <a href="https://www.facebook.com/champion.fx" target="_blank"> <img src="/champion-static/images/symbols/fb.svg" alt=""> </a> </li> <li> <a href="https://twitter.com/champion_fx" target="_blank"> <img src="/champion-static/images/symbols/t.svg" alt=""> </a> </li> <li> <a href="https://www.youtube.com/channel/UCBqTu-uQkmaIh5wgBswo2TA" target="_blank"> <img src="/champion-static/images/symbols/yt.svg" alt=""> </a> </li> <li> <a href="https://t.me/championfx" target="_blank"> <img src="/champion-static/images/symbols/telegram.svg" alt=""> </a> </li> </ul> </div> </div> </div> </div> <div id="footer-regulatory" class="primary-color-dark"> <div class="container"> <div class="row"> <div class="col-sm"> High Risk Investment Warning: Trading foreign exchange and/or contracts for differences on margin carries a very high level of risk, and may not be suitable for all investors. There is a possibility that you could sustain a loss in excess of your deposited funds. Accordingly, you should not speculate with capital that you cannot afford to lose. Before deciding to trade the products offered via this website you should carefully consider your financial objectives, needs and level of trading experience. In particular, you should be aware of all the risks associated with trading on margin. Furthermore, Champion FX does not issue advice, recommendations or opinions in relation to acquiring, holding or disposing of any financial products, and all services are provided on an execution only basis. </div> </div> <div class="row"> <div class="col-sm"> ChampionFX is not available to residents of Australia, Bosnia and Herzegovina, Costa Rica, Democratic People's Republic of Korea (DPRK), any European Union country, Ethiopia, Guyana, Hong Kong, Iran, Iraq, Japan, Jersey, Malaysia, Syria, Uganda, USA, Vanuatu, and Yemen. </div> </div> </div> </div> <div id="footer-last" class="primary-color-dark"> <div class="container"> <div class="row"> <div class="col-sm"> &copy; 2017 Champion FX </div> </div> </div> </div> <div id="end_note" class="invisible hidden-xs-down"></div> </footer> <div class="modal"> <div class="modal--wrapper row"> <div class="modal__header"> <a href="javascript:;" class="close"></a> </div> <div class="modal__body col-xs-12 col-md-4 visible-md-down"> <img src="/champion-static/images/signup/crown.svg"/> <h4>Trade with us where the client is always the KING.</h4> <div class="row hidden-sm-down"> <div class="col-xs-3 flex-sm-middle"> <img src="/champion-static/images/signup/tight_spread_with_no_commission.svg"/> </div> <div class="col-xs-9 flex-sm-middle"> <p>Tight spreads with no commission</p> </div> </div> <div class="row hidden-sm-down"> <div class="col-xs-3 flex-sm-middle"> <img src="/champion-static/images/signup/low_latency_and_fast_execution.svg"/> </div> <div class="col-xs-9 flex-sm-middle"> <p>Low latency & fast execution</p> </div> </div> <div class="row hidden-sm-down"> <div class="col-xs-3 flex-sm-middle"> <img src="/champion-static/images/signup/flexible_leverage_up_to_1_1000.svg"/> </div> <div class="col-xs-9 flex-sm-middle"> <p>Flexible leverage up to 1:1,000</p> </div> </div> </div> <div class="modal__form_wrapper col-xs-12 col-md-8"> <h1>Sign up now!</h1> <!-- <p>Sorry, we are disabling this feature at the moment.</p> --> <form id="verify-email-form" class="frm-verify-email"> <input class="clean-input primary-input" autocomplete="off" name="email" id="email" maxlength="50" placeholder="Enter your email"> <span class="error-msg invisible" id="signup_error"></span> <button class="button" id="btn-verify-email" type="submit">Submit</button> <p>or</p> <a id="google-signup" href="javascript:;" class="button-secondary"> <span class="fx google-signup">Sign up with Google</span> </a> </form> <div class="separator hidden-sm-up"></div> <p>Already have an account? <a class="btn-login hidden-sm-down" href="javascript:;">Log In</a></p> <button class="btn-login button-secondary hidden-sm-up" type="submit">Log In</button> </div> <div class="modal__form_message col-xs-12 col-md-8 invisible"> <h2>Thank you for signing up!</h2> <img src="/champion-static/images/signup/check_email.svg"/> <p>Please check your email to complete the registration process.</p> </div> </div> </div> <!--/email_off--> </body> </html>
ashkanx-champion/champion-static
id/cashier.html
HTML
apache-2.0
26,701
package demo.suites.shootouts import demo.Util._ import demo.{Libraries, suites} import japgolly.scalajs.benchmark._ import japgolly.scalajs.benchmark.gui._ import japgolly.scalajs.react.vdom.html_<^._ import monocle.macros.GenIso object FreeMonadShootout { type BM = Benchmark[Int] sealed abstract class Lib(val name: String) { def freeFoldMap: BM def freeMapSuspension: BM } object Cats extends Lib(Libraries.Cats.fullName) { override def freeFoldMap = suites.cats.FreeMonads.bmFn0FoldMap override def freeMapSuspension = suites.cats.FreeMonads.bmFn0Compile } object Scalaz extends Lib(Libraries.Scalaz.fullName) { override def freeFoldMap = suites.scalaz.FreeMonads.bmFn0FoldMap override def freeMapSuspension = suites.scalaz.FreeMonads.bmFn0MapSuspension } case class Params(lib: Lib, size: Int) { override def toString = s"${lib.name} @ $size" } val param1 = GuiParam.enumOf[Lib]("Library", Cats, Scalaz)(_.name) val param2 = GuiParam.int("Size", 500) val iso = GenIso.fields[Params] val params = GuiParams.combine2(iso)(param1, param2) val suite = Suite[Params]("Free monads")( Benchmark.derive("Free --> Fn0 (foldMap)", (_: Params).lib.freeFoldMap )(_.size), Benchmark.derive("Free --> Fn0 (mapSuspension)", (_: Params).lib.freeMapSuspension)(_.size)) val guiSuite = GuiSuite(suite, params).describe( <.div( <.div("Shootout between free monad implementations."), linkToSource(sourceFilename))) }
japgolly/scalajs-benchmark
demo/src/main/scala/demo/suites/shootouts/FreeMonadShootout.scala
Scala
apache-2.0
1,518
/* * 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.drill.exec.store.hive; import com.fasterxml.jackson.annotation.JacksonInject; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.exec.store.StoragePluginRegistry; import java.io.IOException; import java.util.List; /** * Extension of {@link HiveSubScan} which support reading Hive tables using Drill's native parquet reader. */ @JsonTypeName("hive-drill-native-parquet-sub-scan") public class HiveDrillNativeParquetSubScan extends HiveSubScan { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HiveDrillNativeParquetSubScan.class); @JsonCreator public HiveDrillNativeParquetSubScan(@JacksonInject StoragePluginRegistry registry, @JsonProperty("userName") String userName, @JsonProperty("splits") List<List<String>> splits, @JsonProperty("hiveReadEntry") HiveReadEntry hiveReadEntry, @JsonProperty("splitClasses") List<String> splitClasses, @JsonProperty("columns") List<SchemaPath> columns, @JsonProperty("hiveStoragePluginConfig") HiveStoragePluginConfig hiveStoragePluginConfig) throws IOException, ExecutionSetupException, ReflectiveOperationException { super(registry, userName, splits, hiveReadEntry, splitClasses, columns, hiveStoragePluginConfig); } public HiveDrillNativeParquetSubScan(final HiveSubScan subScan) throws IOException, ExecutionSetupException, ReflectiveOperationException { super(subScan.getUserName(), subScan.getSplits(), subScan.getHiveReadEntry(), subScan.getSplitClasses(), subScan.getColumns(), subScan.getStoragePlugin()); } }
KulykRoman/drill
contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveDrillNativeParquetSubScan.java
Java
apache-2.0
2,845
/* * Copyright (c) 2012-2018, Peter Abeles. All Rights Reserved. * * This file is part of DDogleg (http://ddogleg.org). * * 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.ddogleg.fitting.modelset; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author Peter Abeles */ public class TestModelManagerDefault { @Test public void basic() { ModelManagerDefault<Dummy> alg = new ModelManagerDefault<Dummy>(Dummy.class); Dummy a = alg.createModelInstance(); Dummy b = alg.createModelInstance(); assertTrue(a!=b); a.value = 5; alg.copyModel(a,b); assertEquals(5,a.value); assertEquals(5,b.value); } public static class Dummy { public int value; public Dummy() { } public void set(Dummy src ) { value = src.value; } } }
lessthanoptimal/ddogleg
test/org/ddogleg/fitting/modelset/TestModelManagerDefault.java
Java
apache-2.0
1,395
/* * 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.wicket.settings; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Map; import org.apache.wicket.Application; import org.apache.wicket.Component; import org.apache.wicket.IResourceFactory; import org.apache.wicket.Localizer; import org.apache.wicket.core.util.resource.locator.IResourceStreamLocator; import org.apache.wicket.core.util.resource.locator.ResourceStreamLocator; import org.apache.wicket.core.util.resource.locator.caching.CachingResourceStreamLocator; import org.apache.wicket.css.ICssCompressor; import org.apache.wicket.javascript.IJavaScriptCompressor; import org.apache.wicket.markup.head.PriorityFirstComparator; import org.apache.wicket.markup.head.ResourceAggregator.RecordedHeaderItem; import org.apache.wicket.markup.html.IPackageResourceGuard; import org.apache.wicket.markup.html.SecurePackageResourceGuard; import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy; import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; import org.apache.wicket.request.resource.caching.NoOpResourceCachingStrategy; import org.apache.wicket.request.resource.caching.version.CachingResourceVersion; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.request.resource.caching.version.LastModifiedResourceVersion; import org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion; import org.apache.wicket.request.resource.caching.version.RequestCycleCachedResourceVersion; import org.apache.wicket.resource.IPropertiesFactoryContext; import org.apache.wicket.resource.PropertiesFactory; import org.apache.wicket.resource.loader.ClassStringResourceLoader; import org.apache.wicket.resource.loader.ComponentStringResourceLoader; import org.apache.wicket.resource.loader.IStringResourceLoader; import org.apache.wicket.resource.loader.InitializerStringResourceLoader; import org.apache.wicket.resource.loader.PackageStringResourceLoader; import org.apache.wicket.resource.loader.ValidatorStringResourceLoader; import org.apache.wicket.util.file.IFileCleaner; import org.apache.wicket.util.file.IResourceFinder; import org.apache.wicket.util.lang.Args; import org.apache.wicket.util.lang.Generics; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.time.Duration; import org.apache.wicket.util.watch.IModificationWatcher; import org.apache.wicket.util.watch.ModificationWatcher; /** * Class for resource related settings * <p> * <i>resourcePollFrequency </i> (defaults to no polling frequency) - Frequency at which resources * should be polled for changes. * <p> * <i>resourceFinders</i> - Add/modify this to alter the search path for resources. * <p> * <i>useDefaultOnMissingResource </i> (defaults to true) - Set to true to return a default value if * available when a required string resource is not found. If set to false then the * throwExceptionOnMissingResource flag is used to determine how to behave. If no default is * available then this is the same as if this flag were false * <p> * <i>A ResourceStreamLocator </i>- An Application's ResourceStreamLocator is used to find resources * such as images or markup files. You can supply your own ResourceStreamLocator if your prefer to * store your application's resources in a non-standard location (such as a different filesystem * location, a particular JAR file or even a database) by overriding the getResourceLocator() * method. * <p> * <i>Resource Factories </i>- Resource factories can be used to create resources dynamically from * specially formatted HTML tag attribute values. For more details, see {@link IResourceFactory}, * {@link org.apache.wicket.markup.html.image.resource.DefaultButtonImageResourceFactory} and * especially {@link org.apache.wicket.markup.html.image.resource.LocalizedImageResource}. * <p> * <i>A Localizer </i> The getLocalizer() method returns an object encapsulating all of the * functionality required to access localized resources. For many localization problems, even this * will not be required, as there are convenience methods available to all components: * {@link org.apache.wicket.Component#getString(String key)} and * {@link org.apache.wicket.Component#getString(String key, org.apache.wicket.model.IModel model)}. * <p> * <i>stringResourceLoaders </i>- A chain of <code>IStringResourceLoader</code> instances that are * searched in order to obtain string resources used during localization. By default the chain is * set up to first search for resources against a particular component (e.g. page etc.) and then * against the application. * </p> * * @author Jonathan Locke * @author Chris Turner * @author Eelco Hillenius * @author Juergen Donnerstag * @author Johan Compagner * @author Igor Vaynberg (ivaynberg) * @author Martijn Dashorst * @author James Carman */ public class ResourceSettings implements IPropertiesFactoryContext { /** I18N support */ private Localizer localizer; /** Map to look up resource factories by name */ private final Map<String, IResourceFactory> nameToResourceFactory = Generics.newHashMap(); /** The package resource guard. */ private IPackageResourceGuard packageResourceGuard = new SecurePackageResourceGuard( new SecurePackageResourceGuard.SimpleCache(100)); /** The factory to be used for the property files */ private org.apache.wicket.resource.IPropertiesFactory propertiesFactory; /** Filesystem Path to search for resources */ private List<IResourceFinder> resourceFinders = new ArrayList<IResourceFinder>(); /** Frequency at which files should be polled */ private Duration resourcePollFrequency = null; /** resource locator for this application */ private IResourceStreamLocator resourceStreamLocator; /** ModificationWatcher to watch for changes in markup files */ private IModificationWatcher resourceWatcher; /** * A cleaner that removes files asynchronously. * <p> * Used internally to remove the temporary files created by FileUpload functionality. */ private IFileCleaner fileCleaner; /** Chain of string resource loaders to use */ private final List<IStringResourceLoader> stringResourceLoaders = Generics.newArrayList(6); /** Flags used to determine how to behave if resources are not found */ private boolean throwExceptionOnMissingResource = true; /** Determines behavior of string resource loading if string is missing */ private boolean useDefaultOnMissingResource = true; /** Default cache duration */ private Duration defaultCacheDuration = WebResponse.MAX_CACHE_DURATION; /** The JavaScript compressor */ private IJavaScriptCompressor javascriptCompressor; /** The Css compressor */ private ICssCompressor cssCompressor; /** escape string for '..' within resource keys */ private String parentFolderPlaceholder = "::"; // resource caching strategy private IResourceCachingStrategy resourceCachingStrategy; // application these settings are bound to private final Application application; private boolean useMinifiedResources = true; private Comparator<? super RecordedHeaderItem> headerItemComparator = new PriorityFirstComparator( false); private boolean encodeJSessionId = false; /** * Configures Wicket's default ResourceLoaders.<br> * For an example in {@code FooApplication} let {@code bar.Foo} extend {@link Component}, this * results in the following ordering: * <dl> * <dt>component specific</dt> * <dd> * <ul> * <li>bar/Foo.properties</li> * <li>org/apache/wicket/Component.properties</li> * </ul> * </dd> * <dt>package specific</dt> * <dd> * <ul> * <li>bar/package.properties</li> * <li>package.properties (on Foo's class loader)</li> * <li>org/apache/wicket/package.properties</li> * <li>org/apache/package.properties</li> * <li>org/package.properties</li> * <li>package.properties (on Component's class loader)</li> * </ul> * </dd> * <dt>application specific</dt> * <dd> * <ul> * <li>FooApplication.properties</li> * <li>Application.properties</li> * </ul> * </dd> * <dt>validator specific</dt> * <dt>Initializer specific</dt> * <dd> * <ul> * <li>bar.Foo.properties (Foo implementing IInitializer)</li> * </ul> * </dd> * </dl> * * @param application */ public ResourceSettings(final Application application) { this.application = application; stringResourceLoaders.add(new ComponentStringResourceLoader()); stringResourceLoaders.add(new PackageStringResourceLoader()); stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass())); stringResourceLoaders.add(new ValidatorStringResourceLoader()); stringResourceLoaders.add(new InitializerStringResourceLoader(application.getInitializers())); } /** * Adds a resource factory to the list of factories to consult when generating resources * automatically * * @param name * The name to give to the factory * @param resourceFactory * The resource factory to add * @return {@code this} object for chaining */ public ResourceSettings addResourceFactory(final String name, IResourceFactory resourceFactory) { nameToResourceFactory.put(name, resourceFactory); return this; } @Override public Localizer getLocalizer() { if (localizer == null) { localizer = new Localizer(); } return localizer; } /** * Gets the {@link org.apache.wicket.markup.html.PackageResourceGuard package resource guard}. * * @return The package resource guard */ public IPackageResourceGuard getPackageResourceGuard() { return packageResourceGuard; } /** * Get the property factory which will be used to load property files * * @return PropertiesFactory */ public org.apache.wicket.resource.IPropertiesFactory getPropertiesFactory() { if (propertiesFactory == null) { propertiesFactory = new PropertiesFactory(this); } return propertiesFactory; } /** * @param name * Name of the factory to get * @return The IResourceFactory with the given name. */ public IResourceFactory getResourceFactory(final String name) { return nameToResourceFactory.get(name); } /** * Gets the resource finders to use when searching for resources. By default, a finder that * looks in the classpath root is configured. {@link org.apache.wicket.protocol.http.WebApplication} adds the classpath * directory META-INF/resources. To configure additional search paths or filesystem paths, add * to this list. * * @return Returns the resourceFinders. */ public List<IResourceFinder> getResourceFinders() { return resourceFinders; } /** * @return Returns the resourcePollFrequency. */ public Duration getResourcePollFrequency() { return resourcePollFrequency; } @Override public IResourceStreamLocator getResourceStreamLocator() { if (resourceStreamLocator == null) { // Create compound resource locator using source path from // application settings resourceStreamLocator = new ResourceStreamLocator(getResourceFinders()); resourceStreamLocator = new CachingResourceStreamLocator(resourceStreamLocator); } return resourceStreamLocator; } @Override public IModificationWatcher getResourceWatcher(boolean start) { if (resourceWatcher == null && start) { synchronized (this) { if (resourceWatcher == null) { final Duration pollFrequency = getResourcePollFrequency(); if (pollFrequency != null) { resourceWatcher = new ModificationWatcher(pollFrequency); } } } } return resourceWatcher; } /** * Sets the resource watcher * * @param watcher * @return {@code this} object for chaining */ public ResourceSettings setResourceWatcher(IModificationWatcher watcher) { resourceWatcher = watcher; return this; } /** * @return the a cleaner which can be used to remove files asynchronously. */ public IFileCleaner getFileCleaner() { return fileCleaner; } /** * Sets a cleaner that can be used to remove files asynchronously. * <p> * Used internally to delete the temporary files created by FileUpload functionality * * @param fileUploadCleaner * the actual cleaner implementation. Can be <code>null</code> * @return {@code this} object for chaining */ public ResourceSettings setFileCleaner(IFileCleaner fileUploadCleaner) { fileCleaner = fileUploadCleaner; return this; } /** * @return mutable list of all available string resource loaders */ public List<IStringResourceLoader> getStringResourceLoaders() { return stringResourceLoaders; } public boolean getThrowExceptionOnMissingResource() { return throwExceptionOnMissingResource; } /** * @return Whether to use a default value (if available) when a missing resource is requested */ public boolean getUseDefaultOnMissingResource() { return useDefaultOnMissingResource; } /** * Sets the localizer which will be used to find property values. * * @param localizer * @since 1.3.0 * @return {@code this} object for chaining */ public ResourceSettings setLocalizer(final Localizer localizer) { this.localizer = localizer; return this; } /** * Sets the {@link org.apache.wicket.markup.html.PackageResourceGuard package resource guard}. * * @param packageResourceGuard * The package resource guard * @return {@code this} object for chaining */ public ResourceSettings setPackageResourceGuard(IPackageResourceGuard packageResourceGuard) { this.packageResourceGuard = Args.notNull(packageResourceGuard, "packageResourceGuard"); return this; } /** * Set the property factory which will be used to load property files * * @param factory * @return {@code this} object for chaining */ public ResourceSettings setPropertiesFactory(org.apache.wicket.resource.IPropertiesFactory factory) { propertiesFactory = factory; return this; } /** * Sets the finders to use when searching for resources. By default, the resources are located * on the classpath. To add additional search paths, add to the list given by * {@link #getResourceFinders()}. Use this method if you want to completely exchange the list of * resource finders. * * @param resourceFinders * The resourceFinders to set * @return {@code this} object for chaining */ public ResourceSettings setResourceFinders(final List<IResourceFinder> resourceFinders) { Args.notNull(resourceFinders, "resourceFinders"); this.resourceFinders = resourceFinders; // Cause resource locator to get recreated resourceStreamLocator = null; return this; } /** * Sets the resource polling frequency. This is the duration of time between checks of resource * modification times. If a resource, such as an HTML file, has changed, it will be reloaded. * The default is one second in 'development' mode and 'never' in deployment mode. * * @param resourcePollFrequency * Frequency at which to poll resources or <code>null</code> if polling should be * disabled * @return {@code this} object for chaining */ public ResourceSettings setResourcePollFrequency(final Duration resourcePollFrequency) { this.resourcePollFrequency = resourcePollFrequency; return this; } /** * /** * Sets the resource stream locator for this application * * Consider wrapping <code>resourceStreamLocator</code> in {@link CachingResourceStreamLocator}. * This way the locator will not be asked more than once for {@link IResourceStream}s which do * not exist. * @param resourceStreamLocator * new resource stream locator * * @see #getResourceStreamLocator() * @return {@code this} object for chaining */ public ResourceSettings setResourceStreamLocator(IResourceStreamLocator resourceStreamLocator) { this.resourceStreamLocator = resourceStreamLocator; return this; } /** * @param throwExceptionOnMissingResource * @return {@code this} object for chaining */ public ResourceSettings setThrowExceptionOnMissingResource(final boolean throwExceptionOnMissingResource) { this.throwExceptionOnMissingResource = throwExceptionOnMissingResource; return this; } /** * @param useDefaultOnMissingResource * Whether to use a default value (if available) when a missing resource is requested * @return {@code this} object for chaining */ public ResourceSettings setUseDefaultOnMissingResource(final boolean useDefaultOnMissingResource) { this.useDefaultOnMissingResource = useDefaultOnMissingResource; return this; } /** * Get the the default cache duration for resources. * <p/> * * @return cache duration (Duration.NONE will be returned if caching is disabled) * * @see org.apache.wicket.util.time.Duration#NONE */ public final Duration getDefaultCacheDuration() { return defaultCacheDuration; } /** * Set the the default cache duration for resources. * <p/> * Based on RFC-2616 this should not exceed one year. If you set Duration.NONE caching will be * disabled. * * @param duration * default cache duration in seconds * * @see org.apache.wicket.util.time.Duration#NONE * @see org.apache.wicket.request.http.WebResponse#MAX_CACHE_DURATION * @return {@code this} object for chaining */ public final ResourceSettings setDefaultCacheDuration(Duration duration) { Args.notNull(duration, "duration"); defaultCacheDuration = duration; return this; } /** * Get the javascript compressor to remove comments and whitespace characters from javascripts * * @return whether the comments and whitespace characters will be stripped from resources served * through {@link org.apache.wicket.request.resource.JavaScriptPackageResource * JavaScriptPackageResource}. Null is a valid value. */ public IJavaScriptCompressor getJavaScriptCompressor() { return javascriptCompressor; } /** * Set the javascript compressor implemententation use e.g. by * {@link org.apache.wicket.request.resource.JavaScriptPackageResource * JavaScriptPackageResource}. A typical implementation will remove comments and whitespace. But * a no-op implementation is available as well. * * @param compressor * The implementation to be used * @return The old value * @return {@code this} object for chaining */ public IJavaScriptCompressor setJavaScriptCompressor(IJavaScriptCompressor compressor) { IJavaScriptCompressor old = javascriptCompressor; javascriptCompressor = compressor; return old; } /** * Get the CSS compressor to remove comments and whitespace characters from css resources * * @return whether the comments and whitespace characters will be stripped from resources served * through {@link org.apache.wicket.request.resource.CssPackageResource * CssPackageResource}. Null is a valid value. */ public ICssCompressor getCssCompressor() { return cssCompressor; } /** * Set the CSS compressor implemententation use e.g. by * {@link org.apache.wicket.request.resource.CssPackageResource CssPackageResource}. A typical * implementation will remove comments and whitespace. But a no-op implementation is available * as well. * * @param compressor * The implementation to be used * @return The old value * @return {@code this} object for chaining */ public ICssCompressor setCssCompressor(ICssCompressor compressor) { ICssCompressor old = cssCompressor; cssCompressor = compressor; return old; } /** * Placeholder string for '..' within resource urls (which will be crippled by the browser and * not work anymore). Note that by default the placeholder string is <code>::</code>. Resources * are protected by a {@link org.apache.wicket.markup.html.IPackageResourceGuard * IPackageResourceGuard} implementation such as * {@link org.apache.wicket.markup.html.PackageResourceGuard} which you may use or extend based * on your needs. * * @return placeholder */ public String getParentFolderPlaceholder() { return parentFolderPlaceholder; } /** * Placeholder string for '..' within resource urls (which will be crippled by the browser and * not work anymore). Note that by default the placeholder string is <code>null</code> and thus * will not allow to access parent folders. That is by purpose and for security reasons (see * Wicket-1992). In case you really need it, a good value for placeholder would e.g. be "$up$". * Resources additionally are protected by a * {@link org.apache.wicket.markup.html.IPackageResourceGuard IPackageResourceGuard} * implementation such as {@link org.apache.wicket.markup.html.PackageResourceGuard} which you * may use or extend based on your needs. * * @see #getParentFolderPlaceholder() * * @param sequence * character sequence which must not be ambiguous within urls * @return {@code this} object for chaining */ public ResourceSettings setParentFolderPlaceholder(final String sequence) { parentFolderPlaceholder = sequence; return this; } /** * gets the resource caching strategy * * @return strategy */ public IResourceCachingStrategy getCachingStrategy() { if (resourceCachingStrategy == null) { final IResourceVersion resourceVersion; if (application.usesDevelopmentConfig()) { // development mode: // use last-modified timestamp of packaged resource for resource caching // cache the version information for the lifetime of the current http request resourceVersion = new RequestCycleCachedResourceVersion( new LastModifiedResourceVersion()); } else { // deployment mode: // use message digest over resource content for resource caching // cache the version information for the lifetime of the application resourceVersion = new CachingResourceVersion(new MessageDigestResourceVersion()); } // cache resource with a version string in the filename resourceCachingStrategy = new FilenameWithVersionResourceCachingStrategy( resourceVersion); } return resourceCachingStrategy; } /** * sets the resource caching strategy * * @param strategy * instance of resource caching strategy * * @see IResourceCachingStrategy * @return {@code this} object for chaining */ public ResourceSettings setCachingStrategy(IResourceCachingStrategy strategy) { if (strategy == null) { throw new NullPointerException( "It is not allowed to set the resource caching strategy to value NULL. " + "Please use " + NoOpResourceCachingStrategy.class.getName() + " instead."); } resourceCachingStrategy = strategy; return this; } /** * Sets whether to use pre-minified resources when available. Minified resources are detected by * name. The minified version of {@code x.js} is expected to be called {@code x.min.js}. For css * files, the same convention is used: {@code x.min.css} is the minified version of * {@code x.css}. When this is null, minified resources will only be used in deployment * configuration. * * @param useMinifiedResources * The new value for the setting * @return {@code this} object for chaining */ public ResourceSettings setUseMinifiedResources(boolean useMinifiedResources) { this.useMinifiedResources = useMinifiedResources; return this; } /** * @return Whether pre-minified resources will be used. */ public boolean getUseMinifiedResources() { return useMinifiedResources; } /** * @return The comparator used to sort header items. */ public Comparator<? super RecordedHeaderItem> getHeaderItemComparator() { return headerItemComparator; } /** * Sets the comparator used by the {@linkplain org.apache.wicket.markup.head.ResourceAggregator resource aggregator} for * sorting header items. It should be noted that sorting header items may break resource * dependencies. This comparator should therefore at least respect dependencies declared by * resource references. By default, items are sorted using the {@link PriorityFirstComparator}. * * @param headerItemComparator * The comparator used to sort header items, when null, header items will not be * sorted. * @return {@code this} object for chaining */ public ResourceSettings setHeaderItemComparator(Comparator<? super RecordedHeaderItem> headerItemComparator) { this.headerItemComparator = headerItemComparator; return this; } /** * A flag indicating whether static resources should have <tt>jsessionid</tt> encoded in their * url. * * @return {@code true} if the jsessionid should be encoded in the url for resources * implementing * {@link org.apache.wicket.request.resource.caching.IStaticCacheableResource} when the * cookies are disabled and there is an active http session. */ public boolean isEncodeJSessionId() { return encodeJSessionId; } /** * Sets a flag indicating whether the jsessionid should be encoded in the url for resources * implementing {@link org.apache.wicket.request.resource.caching.IStaticCacheableResource} when * the cookies are disabled and there is an active http session. * * @param encodeJSessionId * {@code true} when the jsessionid should be encoded, {@code false} - otherwise * @return {@code this} object for chaining */ public ResourceSettings setEncodeJSessionId(boolean encodeJSessionId) { this.encodeJSessionId = encodeJSessionId; return this; } }
dashorst/wicket
wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java
Java
apache-2.0
26,459
/* * Copyright (C) 2016 Intel Corporation * * 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 OptimizationTests.Devirtualization.InvokeInterfaceIntTryCatchFinally; class Main { public static int div(int d) { return 1 / d; } public static int runTest() { try { return div(0); } catch (Exception e) { // ignore } finally { CondVirtBase test = new CondVirtExt(); int result = test.getThingies(); return result; } } public static void main(String[] args) { int result = runTest(); System.out.println("Result " + result); } }
android-art-intel/Nougat
art-extension/opttests/src/OptimizationTests/Devirtualization/InvokeInterfaceIntTryCatchFinally/Main.java
Java
apache-2.0
1,187
/** * */ package org.apache.hadoop.hdfs.server.namenodeFBT.lock; import org.apache.hadoop.hdfs.server.namenodeFBT.Response; /** * @author hanhlh * */ public final class EndLockResponse extends Response { /** * */ private static final long serialVersionUID = 1L; /** * EndLockRequest ยคร‹ร‚รยคยนยครซยฟยทยคยทยคยคยฑรพร…รบยฅยชยฅร–ยฅยธยฅยงยฅยฏยฅรˆยครฒร€ยธร€ยฎยคยทยครžยคยน. * ยฑรพร…รบยครฒรˆยฏร€ยธยคยตยคยปยคยฟยธยถยฐรธยครˆยครŠยครซ * รร—ยตรกยฅยชยฅร–ยฅยธยฅยงยฅยฏยฅรˆ (EndLockRequest) ยครฒรยฟยคยจยครซร‰ยฌรร—ยคยฌยคยขยครชยครžยคยน. * * @param request ยฑรพร…รบยคร‹ยตยฏยฐรธยคยนยครซรร—ยตรกยฅยชยฅร–ยฅยธยฅยงยฅยฏยฅรˆ (EndLockRequest) */ public EndLockResponse(EndLockRequest request) { super(request); } }
hanhlh/hadoop-0.20.2_FatBTree
src/hdfs/org/apache/hadoop/hdfs/server/namenodeFBT/lock/EndLockResponse.java
Java
apache-2.0
646
# coding=utf-8 from ..base import BitbucketBase class BitbucketCloudBase(BitbucketBase): def __init__(self, url, *args, **kwargs): """ Init the rest api wrapper :param url: string: The base url used for the rest api. :param *args: list: The fixed arguments for the AtlassianRestApi. :param **kwargs: dict: The keyword arguments for the AtlassianRestApi. :return: nothing """ expected_type = kwargs.pop("expected_type", None) super(BitbucketCloudBase, self).__init__(url, *args, **kwargs) if expected_type is not None and not expected_type == self.get_data("type"): raise ValueError("Expected type of data is [{}], got [{}].".format(expected_type, self.get_data("type"))) def get_link(self, link): """ Get a link from the data. :param link: string: The link identifier :return: The requested link or None if it isn't present """ links = self.get_data("links") if links is None or link not in links: return None return links[link]["href"] def _get_paged(self, url, params=None, data=None, flags=None, trailing=None, absolute=False): """ Used to get the paged data :param url: string: The url to retrieve :param params: dict (default is None): The parameters :param data: dict (default is None): The data :param flags: string[] (default is None): The flags :param trailing: bool (default is None): If True, a trailing slash is added to the url :param absolute: bool (default is False): If True, the url is used absolute and not relative to the root :return: A generator object for the data elements """ if params is None: params = {} while True: response = super(BitbucketCloudBase, self).get( url, trailing=trailing, params=params, data=data, flags=flags, absolute=absolute, ) if "values" not in response: return for value in response.get("values", []): yield value url = response.get("next") if url is None: break # From now on we have absolute URLs absolute = True return
MattAgile/atlassian-python-api
atlassian/bitbucket/cloud/base.py
Python
apache-2.0
2,467
/* * Copyright 2002-2014 the original author or 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 org.springframework.messaging.handler.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation which indicates that a method parameter should be bound to a message header. * * @author Rossen Stoyanchev * @since 4.0 */ @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Header { /** * The name of the request header to bind to. */ String value() default ""; /** * Whether the header is required. * <p>Default is {@code true}, leading to an exception if the header missing. Switch this * to {@code false} if you prefer a {@code null} in case of the header missing. */ boolean required() default true; /** * The default value to use as a fallback. Supplying a default value implicitly * sets {@link #required} to {@code false}. */ String defaultValue() default ValueConstants.DEFAULT_NONE; }
qobel/esoguproject
spring-framework/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/Header.java
Java
apache-2.0
1,673
FROM progrium/busybox ADD kube2consul / CMD ["/kube2consul"]
CAP-ALL/kube2consul
Dockerfile
Dockerfile
apache-2.0
61
๏ปฟ/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/elasticbeanstalk/ElasticBeanstalk_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace ElasticBeanstalk { namespace Model { /** * <p>Specify criteria to restrict the results when listing custom platforms.</p> * <p>The filter is evaluated as the expression:</p> <p> <code>Type</code> * <code>Operator</code> <code>Values[i]</code> </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/PlatformFilter">AWS * API Reference</a></p> */ class AWS_ELASTICBEANSTALK_API PlatformFilter { public: PlatformFilter(); PlatformFilter(const Aws::Utils::Xml::XmlNode& xmlNode); PlatformFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline const Aws::String& GetType() const{ return m_type; } /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline void SetType(const Aws::String& value) { m_typeHasBeenSet = true; m_type = value; } /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline void SetType(Aws::String&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline void SetType(const char* value) { m_typeHasBeenSet = true; m_type.assign(value); } /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline PlatformFilter& WithType(const Aws::String& value) { SetType(value); return *this;} /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline PlatformFilter& WithType(Aws::String&& value) { SetType(std::move(value)); return *this;} /** * <p>The custom platform attribute to which the filter values are applied.</p> * <p>Valid Values: <code>PlatformName</code> | <code>PlatformVersion</code> | * <code>PlatformStatus</code> | <code>PlatformOwner</code> </p> */ inline PlatformFilter& WithType(const char* value) { SetType(value); return *this;} /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline const Aws::String& GetOperator() const{ return m_operator; } /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline bool OperatorHasBeenSet() const { return m_operatorHasBeenSet; } /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline void SetOperator(const Aws::String& value) { m_operatorHasBeenSet = true; m_operator = value; } /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline void SetOperator(Aws::String&& value) { m_operatorHasBeenSet = true; m_operator = std::move(value); } /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline void SetOperator(const char* value) { m_operatorHasBeenSet = true; m_operator.assign(value); } /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline PlatformFilter& WithOperator(const Aws::String& value) { SetOperator(value); return *this;} /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline PlatformFilter& WithOperator(Aws::String&& value) { SetOperator(std::move(value)); return *this;} /** * <p>The operator to apply to the <code>Type</code> with each of the * <code>Values</code>.</p> <p> Valid Values: <code>=</code> (equal to) | * <code>!=</code> (not equal to) | <code>&lt;</code> (less than) | * <code>&lt;=</code> (less than or equal to) | <code>&gt;</code> (greater than) | * <code>&gt;=</code> (greater than or equal to) | <code>contains</code> | * <code>begins_with</code> | <code>ends_with</code> </p> */ inline PlatformFilter& WithOperator(const char* value) { SetOperator(value); return *this;} /** * <p>The list of values applied to the custom platform attribute.</p> */ inline const Aws::Vector<Aws::String>& GetValues() const{ return m_values; } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline bool ValuesHasBeenSet() const { return m_valuesHasBeenSet; } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline void SetValues(const Aws::Vector<Aws::String>& value) { m_valuesHasBeenSet = true; m_values = value; } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline void SetValues(Aws::Vector<Aws::String>&& value) { m_valuesHasBeenSet = true; m_values = std::move(value); } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline PlatformFilter& WithValues(const Aws::Vector<Aws::String>& value) { SetValues(value); return *this;} /** * <p>The list of values applied to the custom platform attribute.</p> */ inline PlatformFilter& WithValues(Aws::Vector<Aws::String>&& value) { SetValues(std::move(value)); return *this;} /** * <p>The list of values applied to the custom platform attribute.</p> */ inline PlatformFilter& AddValues(const Aws::String& value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline PlatformFilter& AddValues(Aws::String&& value) { m_valuesHasBeenSet = true; m_values.push_back(std::move(value)); return *this; } /** * <p>The list of values applied to the custom platform attribute.</p> */ inline PlatformFilter& AddValues(const char* value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; } private: Aws::String m_type; bool m_typeHasBeenSet; Aws::String m_operator; bool m_operatorHasBeenSet; Aws::Vector<Aws::String> m_values; bool m_valuesHasBeenSet; }; } // namespace Model } // namespace ElasticBeanstalk } // namespace Aws
cedral/aws-sdk-cpp
aws-cpp-sdk-elasticbeanstalk/include/aws/elasticbeanstalk/model/PlatformFilter.h
C
apache-2.0
11,152
# The Explainer Augments (enlarge or increase) text with the definitions (a concise explanation of the meaning of a word or phrase or symbol) of words (the words that are spoken) not found in the [Basic English](https://en.wiktionary.org/wiki/Appendix:1000_basic_English_words) word list. An entry in [NaNoGenMo 2016](https://github.com/NaNoGenMo/2016). To generate new work, navigate to your project directory from the command line and run: python explain.py MobyDick.txt References ========== Heart of Darkness ----------------- The Project Gutenberg eBook of Heart of Darkness, by Joseph Conrad: http://www.gutenberg.org/ebooks/526 This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.net NLTK ---- NLTK -- the Natural Language Toolkit -- is a suite of open source Python modules, data sets and tutorials supporting research and development in Natural Language Processing. https://github.com/nltk/nltk/blob/develop/LICENSE.txt License ======= Copyright 2016 Emily Daniels 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.
emdaniels/the-explainer
README.md
Markdown
apache-2.0
1,716
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); exports.getMatchedParams = getMatchedParams; exports.getQueryParams = getQueryParams; exports.createRoute = createRoute; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var parametersPattern = /(:[^\/]+)/g; // Some utility functions. Exported just to be able to test them easily function getMatchedParams(route, path) { var matches = path.match(route.matcher); if (!matches) { return false; } return route.params.reduce(function (acc, param, idx) { acc[param] = decodeURIComponent(matches[idx + 1]); return acc; }, {}); }; function getQueryParams(query) { return query.split('&').filter(function (p) { return p.length; }).reduce(function (acc, part) { var _part$split = part.split('='); var _part$split2 = _slicedToArray(_part$split, 2); var key = _part$split2[0]; var value = _part$split2[1]; acc[decodeURIComponent(key)] = decodeURIComponent(value); return acc; }, {}); }; function createRoute(name, path, handler) { var matcher = new RegExp(path.replace(parametersPattern, '([^\/]+)') + '$'); var params = (path.match(parametersPattern) || []).map(function (x) { return x.substring(1); }); return { name: name, path: path, handler: handler, matcher: matcher, params: params }; }; var findRouteParams = function findRouteParams(routes, path) { var params = void 0; var route = routes.find(function (r) { return params = getMatchedParams(r, path); }); return { route: route, params: params }; }; var parseUrl = function parseUrl(url) { var _url$split = url.split('?'); var _url$split2 = _slicedToArray(_url$split, 2); var path = _url$split2[0]; var queryString = _url$split2[1]; return { path: path, queryString: queryString }; }; var stripPrefix = function stripPrefix(url, prefix) { return url.replace(new RegExp('^' + prefix), ''); }; // The actual Router as the default export of the module var Router = function () { function Router() { _classCallCheck(this, Router); this.routes = []; this.prefix = ''; } // Adds a route with an _optional_ name, a path and a handler function _createClass(Router, [{ key: 'add', value: function add(name, path, handler) { if (arguments.length == 2) { this.add.apply(this, [''].concat(Array.prototype.slice.call(arguments))); } else { this.routes.push(createRoute(name, path, handler)); } return this; } }, { key: 'setPrefix', value: function setPrefix(prefix) { this.prefix = prefix; return this; } }, { key: 'dispatch', value: function dispatch(url) { var _parseUrl = parseUrl(stripPrefix(url, this.prefix)); var path = _parseUrl.path; var queryString = _parseUrl.queryString; var query = getQueryParams(queryString || ''); var _findRouteParams = findRouteParams(this.routes, path); var route = _findRouteParams.route; var params = _findRouteParams.params; if (route) { route.handler({ params: params, query: query }); return route; } return false; } }, { key: 'getCurrentRoute', value: function getCurrentRoute(url) { var _parseUrl2 = parseUrl(stripPrefix(url, this.prefix)); var path = _parseUrl2.path; var queryString = _parseUrl2.queryString; var rp = findRouteParams(this.routes, path); return rp && rp.route; } }, { key: 'formatUrl', value: function formatUrl(routeName) { var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var query = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; var route = this.routes.find(function (r) { return r.name === routeName; }); if (!route) { return ''; } var queryString = Object.keys(query).map(function (k) { return [k, query[k]]; }).map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2); var k = _ref2[0]; var v = _ref2[1]; return encodeURIComponent(k) + '=' + encodeURIComponent(v); }).join('&'); var path = this.prefix + route.path.replace(parametersPattern, function (match) { return params[match.substring(1)]; }); return queryString.length ? path + '?' + queryString : path; } }]); return Router; }(); exports.default = Router; ;
jmhdez/minimal-router
lib/Router.js
JavaScript
apache-2.0
5,579
package Entity; import android.os.Parcel; import android.os.Parcelable; /** * Created by liangchenzhou on 25/08/16. */ public class SpeciesKingdom implements Parcelable { private String kingdom; private String scientificName; public SpeciesKingdom() { } public SpeciesKingdom(String kingdom, String scientificName) { this.kingdom = kingdom; this.scientificName = scientificName; } public String getKingdom() { return kingdom; } public void setKingdom(String kingdom) { this.kingdom = kingdom; } public String getScientificName() { return scientificName; } public void setScientificName(String scientificName) { this.scientificName = scientificName; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(this.kingdom); parcel.writeString(this.scientificName); } public static final Parcelable.Creator<SpeciesKingdom> CREATOR = new Creator<SpeciesKingdom>() { @Override public SpeciesKingdom createFromParcel(Parcel source) { return new SpeciesKingdom(source.readString(), source.readString()); } @Override public SpeciesKingdom[] newArray(int size) { return new SpeciesKingdom[size]; } }; }
lawrencezcc/Moneco-V6
app/src/main/java/Entity/SpeciesKingdom.java
Java
apache-2.0
1,421
from django.core.files import locks from django.core.urlresolvers import reverse from django.db.models import Count, F, Q, Min from django.template import RequestContext, TemplateDoesNotExist from django.template.loader import get_template, select_template from django.utils import timezone from django.views.decorators.clickjacking import xframe_options_exempt from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_GET, require_POST from django.http import HttpResponse, Http404, HttpResponseBadRequest from datetime import datetime from base64 import b64encode import pytz import json import os import logging import random import uuid import numpy as np from basecrowd.interface import CrowdRegistry from basecrowd.models import TaskGroupRetainerStatus from basecrowd.models import RetainerPoolStatus from basecrowd.tasks import gather_answer logger = logging.getLogger('crowd_server') @require_POST @csrf_exempt def create_task_group(request, crowd_name): """ See README.md for API. """ # get the interface implementation from the crowd name. interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) # Response dictionaries correct_response = {'status': 'ok'} wrong_response = {'status': 'wrong'} # Parse information contained in the URL json_dict = request.POST.get('data') # Validate the format. if not interface.validate_create_request(json_dict): wrong_response['reason'] = 'Invalid request data.' return HttpResponse(json.dumps(wrong_response)) # Pull out important data fields json_dict = json.loads(json_dict) configuration = json_dict['configuration'] group_id = json_dict['group_id'] group_context = json.dumps(json_dict['group_context']) content = json_dict['content'] point_identifiers = content.keys() # Create a new group for the tasks. if model_spec.group_model.objects.filter(group_id=group_id).exists(): wrong_response['reason'] = 'Group id %s is already in use.' % group_id return HttpResponse(json.dumps(wrong_response)) current_group = model_spec.group_model( group_id=group_id, tasks_finished=0, callback_url=configuration['callback_url'], group_context=group_context, crowd_config=json.dumps(configuration.get(crowd_name, {})), global_config=json.dumps(configuration)) # Call the group hook function, then save the new group to the database. interface.group_pre_save(current_group) current_group.save() # Build crowd tasks from the group if 'retainer_pool' in configuration: # Retainer pool tasks # The specified crowd must support retainer pools retainer_pool_model = model_spec.retainer_pool_model if not retainer_pool_model: wrong_response['reason'] = 'Crowd does not support retainer pools.' return HttpResponse(json.dumps(wrong_response)) # Create or find the retainer pool. retainer_config = configuration['retainer_pool'] create_pool = retainer_config['create_pool'] pool_id = retainer_config.get('pool_id', '') if create_pool: (retainer_pool, created) = retainer_pool_model.objects.get_or_create( external_id=pool_id, defaults={ 'capacity': retainer_config['pool_size'], 'status': RetainerPoolStatus.RECRUITING, }) if created == False: # pool id already taken wrong_response['reason'] = 'Pool id %s already in use' % pool_id return HttpResponse(json.dumps(wrong_response)) else: try: retainer_pool = retainer_pool_model.objects.get( external_id=pool_id) # TODO: Make sure this pool is compatible with the new task group except retainer_pool_model.DoesNotExist: # clean up current_group.delete() wrong_response['reason'] = 'Pool %s does not exist' % pool_id return HttpResponse(json.dumps(wrong_response)) current_group.retainer_pool = retainer_pool # Don't call interface.create_task, the `post_retainer_tasks` celery # task will do so. # Batch and create the tasks. batch_size = configuration['task_batch_size'] for i in range(0, len(point_identifiers), batch_size): batch_point_ids = point_identifiers[i:i+batch_size] batch_content = { j: content[j] for j in batch_point_ids } task_id = str(uuid.uuid4()) # generate a random id for this task task = model_spec.task_model( task_type=configuration['task_type'], data=json.dumps(batch_content), create_time=timezone.now(), task_id=task_id, group=current_group, num_assignments=configuration['num_assignments'], is_retainer=True, ) interface.task_pre_save(task) task.save() #for point_id, point_content in content.iteritems(): # task_id = str(uuid.uuid4()) # generate a random id for this task # task = model_spec.task_model( # task_type=configuration['task_type'], # data=json.dumps({point_id: point_content}), # create_time=pytz.utc.localize(datetime.now()), # task_id=task_id, # group=current_group, # num_assignments=configuration['num_assignments'], # is_retainer=True, # ) # interface.task_pre_save(task) # task.save() # start the work right away if the pool is ready if retainer_pool.status in [RetainerPoolStatus.IDLE, RetainerPoolStatus.ACTIVE]: current_group.retainer_pool_status = TaskGroupRetainerStatus.RUNNING retainer_pool.status = RetainerPoolStatus.ACTIVE retainer_pool.save() else: current_group.retainer_pool_status = TaskGroupRetainerStatus.WAITING current_group.save() else: # Not retainer, create a task for each batch of points. for i in range(0, len(point_identifiers), configuration['task_batch_size']): # build the batch current_content = {} for j in range(i, i + configuration['task_batch_size']): if j >= len(point_identifiers): break current_content[point_identifiers[j]] = content[ point_identifiers[j]] current_content = json.dumps(current_content) # Call the create task hook current_task_id = interface.create_task(configuration, current_content) # Build the task object current_task = model_spec.task_model( task_type=configuration['task_type'], data=current_content, create_time=pytz.utc.localize(datetime.now()), task_id=current_task_id, group=current_group, num_assignments=configuration['num_assignments']) # Call the pre-save hook, then save the task to the database. interface.task_pre_save(current_task) current_task.save() return HttpResponse(json.dumps(correct_response)) # Delete all tasks from the system. def purge_tasks(request, crowd_name): interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) tasks = model_spec.task_model.objects.all() # Call the delete hook, then delete the tasks from our database. # TODO: clean up retainer pool tasks correctly. interface.delete_tasks(tasks) tasks.delete() return HttpResponse('ok') # we need this view to load in AMT's iframe, so disable Django's built-in # clickjacking protection. @xframe_options_exempt @require_GET def get_assignment(request, crowd_name): # get the interface implementation from the crowd name. interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) logger.info('Non-retainer worker requested task assignment.') # get assignment context context = interface.get_assignment_context(request) try: interface.require_context( context, ['task_id', 'is_accepted'], ValueError('Task id unavailable in assignment request context.')) except ValueError: # This task is no longer available (due to a race condition). # Return the 'No available tasks' template. template = get_scoped_template(crowd_name, 'unavailable.html') return HttpResponse(template.render(RequestContext(request, {}))) return _get_assignment(request, crowd_name, interface, model_spec, context) def _get_assignment(request, crowd_name, interface, model_spec, context, **custom_template_context): # Retrieve the task based on task_id from the database try: current_task = (model_spec.task_model.objects .select_related('group') .get(task_id=context['task_id'])) task_group = current_task.group except model_spec.task_model.DoesNotExist: response_str = ''' <html><head></head><body> <h1>Error: Expired Task!</h1> <p>Task %s has expired, and isn't currently available for work. <b>Please return this task</b> and pick up a new one.</p> </body></html> ''' % context['task_id'] return HttpResponse(response_str) # Save the information of this worker worker_id = context.get('worker_id') if worker_id: try: current_worker = model_spec.worker_model.objects.get( worker_id=worker_id) except model_spec.worker_model.DoesNotExist: current_worker = model_spec.worker_model( worker_id=worker_id) # Call the pre-save hook, the save to the database interface.worker_pre_save(current_worker) current_worker.save() else: current_worker = None is_accepted = context.get('is_accepted', False) # If this is a retainer task, add the worker to the pool (if the worker # isn't already in the pool, i.e., they're trying to accept multiple HITs # for the same pool). if current_task.task_type == 'retainer': # TODO: consider making this all pools (i.e., a worker can't be in # more than one pool at a time). pool = task_group.retainer_pool if ((pool.active_workers.filter(worker_id=worker_id).exists() or pool.reserve_workers.filter(worker_id=worker_id).exists()) and (current_worker.assignments.filter( task__group__retainer_pool=pool, task__task_type='retainer') .exclude(task=current_task).exists())): response_str = ''' <html><head></head><body> <h1>Error: Multiple pool memberships detected</h1> <p>You can't accept more than one retainer task at a time, and we've detected that you are already active in another retainer task.</p> <p>Please return this task, or leave the pool in your other active task.</p> <p><b>Note:</b> You may see this error if you have recently finished another retainer task. In that case, simply wait 5-10 seconds and refresh this page, and the error should be gone. </p> </body></html> ''' return HttpResponse(response_str) global_config = json.loads(task_group.global_config) retainer_config = global_config['retainer_pool'] exp_config = global_config.get('experimental') churn_thresh = exp_config.get('churn_threshold') if exp_config else None context.update({ 'waiting_rate': retainer_config['waiting_rate'], 'per_task_rate': retainer_config['task_rate'], 'min_required_tasks': retainer_config['min_tasks_per_worker'], 'pool_status': pool.get_status_display(), }) # Relate workers and tasks (after a worker accepts the task). if is_accepted: if not current_worker: raise ValueError("Accepted tasks must have an associated worker.") assignment_id = context['assignment_id'] try: assignment = current_worker.assignments.get(assignment_id=assignment_id) except model_spec.assignment_model.DoesNotExist: assignment = model_spec.assignment_model.objects.create( assignment_id=assignment_id, worker=current_worker, task=current_task) # Add the new worker to the session task's retainer pool. if current_task.task_type == 'retainer': # Put the worker on reserve if the pool is full and we're churning if pool.active_workers.count() >= pool.capacity and churn_thresh is not None: assignment.on_reserve = True else: assignment.on_reserve = False current_worker.pools.add(pool) assignment.save() context.update({ 'wait_time': assignment.time_waited, 'tasks_completed': current_worker.completed_assignments_for_pool_session( current_task).count(), 'understands_retainer': current_worker.understands_retainer, }) else: if not current_task.group.work_start_time: current_task.group.work_start_time = timezone.now() current_task.group.save() # Add task data to the context. content = json.loads(current_task.data) group_context = json.loads(task_group.group_context) crowd_config = json.loads(task_group.crowd_config) context.update(group_context=group_context, content=content, backend_submit_url=interface.get_backend_submit_url(), frontend_submit_url=interface.get_frontend_submit_url(crowd_config), crowd_name=crowd_name) context.update(**custom_template_context) # Load the template and render it. template = get_scoped_template(crowd_name, current_task.task_type + '.html', context=context) return HttpResponse(template.render(RequestContext(request, context))) def get_scoped_template(crowd_name, template_name, context=None): base_template_name = os.path.join(crowd_name, 'base.html') if context is not None: try: t = get_template(base_template_name) except TemplateDoesNotExist: base_template_name = 'basecrowd/base.html' context['base_template_name'] = base_template_name return select_template([ os.path.join(crowd_name, template_name), os.path.join('basecrowd', template_name)]) # When workers submit assignments, we should send data to this view via AJAX # before submitting to AMT. @require_POST @csrf_exempt def post_response(request, crowd_name): # get the interface implementation from the crowd name. interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) # get context from the request context = interface.get_response_context(request) # validate context interface.require_context( context, ['assignment_id', 'task_id', 'worker_id', 'answers'], ValueError("Response context missing required keys.")) # Check if this is a duplicate response assignment_id = context['assignment_id'] if model_spec.assignment_model.objects.filter( assignment_id=assignment_id, finished_at__isnull=False).exists(): return HttpResponse('Duplicate!') # Retrieve the task and worker from the database based on ids. current_task = model_spec.task_model.objects.get(task_id=context['task_id']) assignment = model_spec.assignment_model.objects.get(assignment_id=assignment_id) # Store this response into the database assignment.content = context['answers'] assignment.finished_at = timezone.now() interface.response_pre_save(assignment) assignment.save() # Check if this task has been finished # If we've gotten too many responses, ignore. if (not current_task.is_complete and (current_task.assignments.filter(finished_at__isnull=False).count() >= current_task.num_assignments)): current_task.is_complete = True current_task.pre_celery = timezone.now() current_task.save() gather_answer.delay(current_task.task_id, model_spec) # terminate in progress retainer tasks (model_spec.assignment_model.objects .exclude(task__task_type='retainer') .filter(task=current_task, finished_at__isnull=True) .update(finished_at=timezone.now(), terminated=True)) return HttpResponse('ok') # AJAX call succeded. # Views related to Retainer Pool tasks ####################################### @require_POST @csrf_exempt def ping(request, crowd_name): try: interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) now = timezone.now() # get and validate context context = interface.get_response_context(request) interface.require_context( context, ['task_id', 'worker_id', 'assignment_id'], ValueError("ping context missing required keys.")) task = model_spec.task_model.objects.get(task_id=context['task_id']) worker = model_spec.worker_model.objects.get(worker_id=context['worker_id']) assignment = model_spec.assignment_model.objects.get( assignment_id=context['assignment_id']) pool_status = task.group.retainer_pool.get_status_display() terminate_work = False terminate_worker = assignment.worker_released_at is not None # update waiting time ping_type = request.POST['ping_type'] # Task started waiting, create a new session if ping_type == 'starting': assignment.finish_waiting_session() # Task is waiting, increment wait time. elif ping_type == 'waiting' and pool_status != 'finished': last_ping = assignment.last_ping time_since_last_ping = (now - last_ping).total_seconds() assignment.time_waited_session += time_since_last_ping # Task is working, verify that the assignment hasn't been terminated. elif ping_type == 'working': active_task_id = request.POST.get('active_task', None) if not active_task_id: logger.warning('Ping from %s, but no active task id.' % assignment) terminate_worker = False # Don't kill them if we don't know what they're working on else: try: active_assignment = model_spec.assignment_model.objects.filter( worker=worker, task_id=active_task_id)[0] if active_assignment.terminated: terminate_work = True except IndexError: # No active assignment terminate_worker = False # Don't kill the worker if we don't know what they're working on. # if terminate_worker: # make sure their current task can be recycled # active_assignment.finished_at = now # active_assignment.terminated = True # active_assignment.save() assignment.last_ping = now assignment.save() worker.last_ping = now worker.save() logger.info('ping from worker %s, task %s' % (worker, task)) retainer_config = json.loads(task.group.global_config)['retainer_pool'] data = { 'ping_type': ping_type, 'wait_time': assignment.time_waited, 'tasks_completed': worker.completed_assignments_for_pool_session( task).count(), 'pool_status': pool_status, 'waiting_rate': retainer_config['waiting_rate'], 'per_task_rate': retainer_config['task_rate'], 'min_required_tasks': retainer_config['min_tasks_per_worker'], 'terminate_work': terminate_work, 'terminate_worker': terminate_worker, } return HttpResponse(json.dumps(data), content_type='application/json') except Exception as e: logger.exception(e) raise e @require_GET def assign_retainer_task(request, crowd_name): try: # get the interface implementation from the crowd name. interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) context = interface.get_response_context(request) interface.require_context( context, ['task_id', 'worker_id'], ValueError("retainer assignment context missing required keys.")) try: task = (model_spec.task_model.objects .select_related('group__retainer_pool') .get(task_id=context['task_id'])) group = task.group pool = group.retainer_pool worker = model_spec.worker_model.objects.get(worker_id=context['worker_id']) logger.info('Retainer task %s requested work.' % task) except Exception: # Issue loading models from IDs, finish this assignment return HttpResponse(json.dumps({'start': False, 'pool_status': 'finished'}), content_type='application/json') exp_config = json.loads(group.global_config).get('experimental') if exp_config: straggler_mitigation = exp_config.get('mitigate_stragglers', False) straggler_routing_policy = exp_config.get('straggler_routing_policy', 'random') churn_threshold = exp_config.get('churn_threshold') else: straggler_mitigation = False churn_threshold = None # Acquire an exclusive lock to avoid duplicate assignments lockf = open('/tmp/ASSIGNMENT_LOCK', 'wb') logger.debug("Locking assignment lock...") locks.lock(lockf, locks.LOCK_EX) # Don't assign a task if the worker is on reserve or the pool is inactive. on_reserve = (task.assignments.filter(worker=worker, on_reserve=True).exists() if churn_threshold is not None else False) pool_inactive = pool.status not in (RetainerPoolStatus.ACTIVE, RetainerPoolStatus.REFILLING, RetainerPoolStatus.IDLE) no_work_response = HttpResponse(json.dumps({'start': False, 'pool_status': pool.get_status_display()}), content_type='application/json') if on_reserve: logger.info("Worker on reserve: not assigning work.") return no_work_response if pool_inactive: logger.info("Pool still recruiting or otherwise inactive: not assigning work.") return no_work_response # Look for a task the worker is already assigned to assignment_task = None existing_assignments = (worker.assignments .filter(finished_at__isnull=True) .filter(task__group__retainer_pool=pool) .exclude(task__task_type='retainer')) logger.info('Looking for assignments for retainer worker...') if existing_assignments.exists(): assignment_task = existing_assignments[0].task logger.info('Found an existing assignment for this worker') else: # Look for open tasks incomplete_tasks = ( # incomplete tasks model_spec.task_model.objects.filter(is_complete=False) # in this pool's tasks .filter(group__retainer_pool=pool) # that aren't dummy retainer tasks .exclude(task_type='retainer') # that the worker hasn't worked on already .exclude(assignments__worker=worker)) # First check if the open tasks haven't been assigned to enough workers. # TODO: avoid gross SQL non_terminated_assignments = """ SELECT COUNT(*) FROM %(crowdname)s_%(assignment_model)s WHERE %(crowdname)s_%(assignment_model)s.terminated = False AND %(crowdname)s_%(assignment_model)s.task_id = %(crowdname)s_%(task_model)s.task_id """ % { 'crowdname': crowd_name, 'assignment_model': model_spec.assignment_model.__name__.lower(), 'task_model': model_spec.task_model.__name__.lower(), } open_tasks = incomplete_tasks.extra( where=["num_assignments > (%s)" % non_terminated_assignments]) if open_tasks.exists(): logger.info('Found an unassigned but open task') assignment_task = open_tasks.order_by('?')[0] # Then, check if there in-progress tasks with enough assignments. elif incomplete_tasks.exists(): if not straggler_mitigation: # only assign tasks that have been abandoned # Bad performance characteristics! consider rewriting. active_workers = set(pool.active_workers.all()) abandoned_tasks = [ t for t in incomplete_tasks if len([a for a in t.assignments.select_related('worker').all() if a.worker in active_workers]) < t.num_assignments] if abandoned_tasks: logger.info('Found an assigned but abandoned task.') assignment_task = random.choice(abandoned_tasks) else: logger.info('All tasks are assigned.') # Straggler mitigation else: logger.info('Assigning to an active task for straggler mitigation with policy %s.' % straggler_routing_policy) if straggler_routing_policy == 'random': assignment_task = incomplete_tasks.order_by('?')[0] elif straggler_routing_policy == 'oldest': now = timezone.now() annotated = incomplete_tasks.annotate(start=Min('assignments__assigned_at')) weights = [(now - t.start).total_seconds() for t in annotated] weights = np.array(weights) / sum(weights) assignment_task = np.random.choice(list(annotated), size=1, p=weights)[0] elif straggler_routing_policy == 'young-workers': now = timezone.now() weights = [ 1 / (now - min([a.worker.assignments .filter(task__task_type='retainer', task__group__retainer_pool=pool) .order_by('assigned_at')[0].assigned_at for a in task.assignments.all()])).total_seconds() for task in incomplete_tasks] weights = np.array(weights) / sum(weights) assignment_task = np.random.choice(list(incomplete_tasks), size=1, p=weights)[0] elif straggler_routing_policy == 'fair': # assign to the task with the fewest assignments assignment_task = (incomplete_tasks .extra(select={'n_assignments': non_terminated_assignments}, order_by=['n_assignments']))[0] else: logger.info('Unkown straggler routing policy: %s. Using random instead...' % straggler_routing_policy) assignment_task = incomplete_tasks.order_by('?')[0] # return a url to the assignment if assignment_task: # create the assignment if necessary try: logger.info('Looking up assignment...') assignment = worker.assignments.get( task=assignment_task, worker=worker) if not assignment.retainer_session_task: assignment.retainer_session_task = task assignment.save() except model_spec.assignment_model.DoesNotExist: logger.info('No assignment found: creating new one.') assignment_id = str(uuid.uuid4()) assignment = model_spec.assignment_model.objects.create( assignment_id=assignment_id, worker=worker, task=assignment_task, retainer_session_task=task) if not assignment_task.group.work_start_time: assignment_task.group.work_start_time = timezone.now() assignment_task.group.save() url_args = { 'crowd_name': crowd_name, 'worker_id': worker.worker_id, 'task_id': assignment_task.task_id, } response_data = json.dumps({ 'start': True, 'task_url': reverse('basecrowd:get_retainer_assignment', kwargs=url_args), 'task_id': assignment_task.task_id, 'pool_status': pool.get_status_display() }) logger.info('Linking task to assignment.') return HttpResponse(response_data, content_type='application/json') else: logger.info('No tasks found!') return no_work_response except Exception as e: logger.exception(e) raise e finally: # Release the assignment lock--either an assignment has been created in the DB, or an error occurred. logger.debug("Unlocking assignment lock...") locks.unlock(lockf) lockf.close() # we need this view to load in AMT's iframe, so disable Django's built-in # clickjacking protection. @xframe_options_exempt @require_GET def get_retainer_assignment(request, crowd_name, worker_id, task_id): # get the interface implementation from the crowd name. interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) logger.info('Retainer worker fetched task assignment.') # fetch assignment if it already exists (e.g. the user refreshed the browser). try: assignment_id = model_spec.assignment_model.objects.get( task_id=task_id, worker_id=worker_id).assignment_id except model_spec.assignment_model.DoesNotExist: assignment_id = str(uuid.uuid4()) context = { 'task_id': task_id, 'worker_id': worker_id, 'is_accepted': True, 'assignment_id': assignment_id } return _get_assignment(request, crowd_name, interface, model_spec, context) @require_POST @csrf_exempt def finish_pool(request, crowd_name): pool_id = request.POST.get('pool_id') interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) try: pool = model_spec.retainer_pool_model.objects.get(external_id=pool_id) except model_spec.retainer_pool_model.DoesNotExist: return HttpResponse(json.dumps({'error': 'Invalid pool id'})) _finish_pool(pool, model_spec) logger.info("Retainer pool %s finished" % pool) return HttpResponse(json.dumps({'status': 'ok'})) def _finish_pool(pool, model_spec): # Mark open sessions as interrupted so we don't penalize them unfairly. (model_spec.assignment_model.objects .filter(task__group__retainer_pool=pool, task__task_type='retainer') .exclude(Q(finished_at__isnull=False) & Q(terminated=False)) .update(pool_ended_mid_assignment=True)) pool.status = RetainerPoolStatus.FINISHED pool.finished_at = timezone.now() pool.save() @require_POST @csrf_exempt def understands_retainer(request, crowd_name, worker_id): interface, model_spec = CrowdRegistry.get_registry_entry(crowd_name) try: worker = model_spec.worker_model.objects.get(worker_id=worker_id) except model_spec.worker_model.DoesNotExist: return HttpResponse(json.dumps({'error': 'Invalid worker id'})) worker.understands_retainer = True worker.save() logger.info('%s understands the retainer model.' % worker) return HttpResponse(json.dumps({'status': 'ok'}))
amplab/ampcrowd
ampcrowd/basecrowd/views.py
Python
apache-2.0
33,310
/* * Copyright 2017 Crown Copyright * * 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 stroom.pipeline.xslt; import stroom.docref.DocRef; import stroom.docstore.api.DocumentResourceHelper; import stroom.event.logging.rs.api.AutoLogged; import stroom.pipeline.shared.XsltDoc; import stroom.pipeline.shared.XsltResource; import stroom.util.shared.EntityServiceException; import javax.inject.Inject; import javax.inject.Provider; @AutoLogged class XsltResourceImpl implements XsltResource { private final Provider<XsltStore> xsltStoreProvider; private final Provider<DocumentResourceHelper> documentResourceHelperProvider; @Inject XsltResourceImpl(final Provider<XsltStore> xsltStoreProvider, final Provider<DocumentResourceHelper> documentResourceHelperProvider) { this.xsltStoreProvider = xsltStoreProvider; this.documentResourceHelperProvider = documentResourceHelperProvider; } @Override public XsltDoc fetch(final String uuid) { return documentResourceHelperProvider.get().read(xsltStoreProvider.get(), getDocRef(uuid)); } @Override public XsltDoc update(final String uuid, final XsltDoc doc) { if (doc.getUuid() == null || !doc.getUuid().equals(uuid)) { throw new EntityServiceException("The document UUID must match the update UUID"); } return documentResourceHelperProvider.get().update(xsltStoreProvider.get(), doc); } private DocRef getDocRef(final String uuid) { return DocRef.builder() .uuid(uuid) .type(XsltDoc.DOCUMENT_TYPE) .build(); } }
gchq/stroom
stroom-pipeline/src/main/java/stroom/pipeline/xslt/XsltResourceImpl.java
Java
apache-2.0
2,168
package org.mariotaku.menucomponent.internal.menu; import java.lang.reflect.Method; import java.util.Collection; import android.annotation.SuppressLint; import android.content.Context; import android.view.Menu; import android.view.MenuItem; public class MenuUtils { public static Menu createMenu(final Context context) { return new MenuImpl(context, null, null); } public static Menu createMenu(final Context context, final Collection<MenuItem> items) { return new MenuImpl(context, null, items); } public static Menu createMenu(final Context context, final MenuAdapter adapter) { return new MenuImpl(context, adapter, null); } public static Menu createMenu(final Context context, final MenuAdapter adapter, final Collection<MenuItem> items) { return new MenuImpl(context, adapter, items); } @SuppressLint("InlinedApi") public static int getShowAsActionFlags(final MenuItem item) { if (item == null) throw new NullPointerException(); if (item instanceof MenuItemImpl) return ((MenuItemImpl) item).getShowAsActionFlags(); try { final Method m = item.getClass().getMethod("getShowAsAction"); return (Integer) m.invoke(item); } catch (final Exception e) { return MenuItem.SHOW_AS_ACTION_NEVER; } } }
xiedantibu/Android-MenuComponent
library/src/org/mariotaku/menucomponent/internal/menu/MenuUtils.java
Java
apache-2.0
1,243
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::MobileEngagement module Models # # Defines values for PushModes # module PushModes RealTime = "real-time" OneShot = "one-shot" Manual = "manual" end end end
devigned/azure-sdk-for-ruby
management/azure_mgmt_mobile_engagement/lib/generated/azure_mgmt_mobile_engagement/models/push_modes.rb
Ruby
apache-2.0
389
#include "types.hpp" namespace compiler { }
iamOgunyinka/substance-lang
src/types.cpp
C++
apache-2.0
45
// Code generated by go-swagger; DO NOT EDIT. package repositories // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "net/http" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" strfmt "github.com/go-openapi/strfmt" ) // NewGetRepositoryTreeParams creates a new GetRepositoryTreeParams object // no default values defined in spec. func NewGetRepositoryTreeParams() GetRepositoryTreeParams { return GetRepositoryTreeParams{} } // GetRepositoryTreeParams contains all the bound params for the get repository tree operation // typically these are obtained from a http.Request // // swagger:parameters getRepositoryTree type GetRepositoryTreeParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*The repository's name Required: true In: path */ Name string /*The owner's username Required: true In: path */ Owner string /*The path for the tree In: query */ Path *string /*The ref for the tree In: query */ Ref *string } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface // for simple values it will use straight method calls. // // To ensure default values, the struct must have been initialized with NewGetRepositoryTreeParams() beforehand. func (o *GetRepositoryTreeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { var res []error o.HTTPRequest = r qs := runtime.Values(r.URL.Query()) rName, rhkName, _ := route.Params.GetOK("name") if err := o.bindName(rName, rhkName, route.Formats); err != nil { res = append(res, err) } rOwner, rhkOwner, _ := route.Params.GetOK("owner") if err := o.bindOwner(rOwner, rhkOwner, route.Formats); err != nil { res = append(res, err) } qPath, qhkPath, _ := qs.GetOK("path") if err := o.bindPath(qPath, qhkPath, route.Formats); err != nil { res = append(res, err) } qRef, qhkRef, _ := qs.GetOK("ref") if err := o.bindRef(qRef, qhkRef, route.Formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } // bindName binds and validates parameter Name from path. func (o *GetRepositoryTreeParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.Name = raw return nil } // bindOwner binds and validates parameter Owner from path. func (o *GetRepositoryTreeParams) bindOwner(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.Owner = raw return nil } // bindPath binds and validates parameter Path from query. func (o *GetRepositoryTreeParams) bindPath(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: false // AllowEmptyValue: false if raw == "" { // empty values pass all other validations return nil } o.Path = &raw return nil } // bindRef binds and validates parameter Ref from query. func (o *GetRepositoryTreeParams) bindRef(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: false // AllowEmptyValue: false if raw == "" { // empty values pass all other validations return nil } o.Ref = &raw return nil }
gitpods/gitpods
pkg/api/v1/restapi/operations/repositories/get_repository_tree_parameters.go
GO
apache-2.0
3,756
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() requires = [ 'cdo', 'bokeh', 'ocgis', 'pandas', 'nose', ] classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Science/Research', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: Scientific/Engineering :: Atmospheric Science', ] setup(name='flyingpigeon', version='0.2.0', description='Processes for climate data, indices and extrem events', long_description=README + '\n\n' + CHANGES, classifiers=classifiers, author='Nils Hempelmann', author_email='nils.hempelmann@ipsl.jussieu.fr', url='http://www.lsce.ipsl.fr/', license = "http://www.apache.org/licenses/LICENSE-2.0", keywords='wps flyingpigeon pywps malleefowl ipsl birdhouse conda anaconda', packages=find_packages(), include_package_data=True, zip_safe=False, test_suite='nose.collector', install_requires=requires, entry_points = { 'console_scripts': [ ]} , )
sradanov/flyingpigeon
setup.py
Python
apache-2.0
1,385
/** * ้ข„ๅญ˜่ดน็”จ */ AcctFeeGrid = Ext.extend(Ext.ux.Grid, { border : false, acctFeeStore : null, region : 'center', pageSize : 10, constructor : function() { this.acctFeeStore = new Ext.data.JsonStore({ url:Constant.ROOT_PATH+ "/commons/x/QueryCust!queryAcctPayFee.action", totalProperty:'totalProperty', root:'records', fields : ['acct_type_text', 'acct_type', 'fee_text','is_logoff','is_doc','is_doc_text', 'fee_type', 'fee_type_text', {name : 'real_pay',type : 'float'}, 'create_time','acct_date','device_code','invoice_mode','invoice_book_id','finance_status', 'invoice_code', 'invoice_id', 'pay_type_text','begin_date','prod_invalid_date', 'pay_type', 'status_text', 'status', 'dept_id','dept_name', 'user_id','user_name', 'user_type_text','fee_sn','optr_id','optr_name', 'OPERATE','busi_code','busi_name','create_done_code','data_right', 'busi_optr_id','busi_optr_name','prod_sn','invoice_fee',"doc_type","doc_type_text","invoice_mode_text","allow_done_code",'count_text'] }); this.acctFeeStore.on("load",this.doOperate); var lc = langUtils.main("pay.payfee.columns"); var cm = new Ext.ux.grid.LockingColumnModel({ columns : [ {header:lc[0],dataIndex:'create_done_code',width:80}, {header:lc[1],dataIndex:'busi_name', width:150,renderer:App.qtipValue}, {header:lc[2],dataIndex:'acct_type_text',width:105,renderer:App.qtipValue}, {header:lc[3],dataIndex:'fee_text',width:150,renderer:App.qtipValue}, {header:lc[4],dataIndex:'user_type_text',width:70}, {header:lc[5],dataIndex:'user_name',width:130,renderer:App.qtipValue}, {header:lc[6],dataIndex:'device_code',width:130,renderer:App.qtipValue}, {header:lc[7],dataIndex:'status_text',width:70,renderer:Ext.util.Format.statusShow}, {header:lc[8],dataIndex:'real_pay',width:60,renderer:Ext.util.Format.formatFee}, {header:lc[9],dataIndex:'begin_date',width:125,renderer:Ext.util.Format.dateFormat}, {header:lc[10],dataIndex:'prod_invalid_date',width:125,renderer:Ext.util.Format.dateFormat}, {header:lc[11],dataIndex:'is_doc_text',width:75,renderer:Ext.util.Format.statusShow}, {header:lc[12],dataIndex:'pay_type_text',width:75, renderer:App.qtipValue}, {header:lc[13],dataIndex:'create_time',width:125}, {header:lc[14],dataIndex:'acct_date',width:125}, {header:lc[15],dataIndex:'optr_name',width:90, renderer:App.qtipValue}, {header:lc[16],dataIndex:'dept_name',width:100, renderer:App.qtipValue}, {header:lc[17],dataIndex:'invoice_id',width:80, renderer:App.qtipValue}, // {header:lc[18],dataIndex:'invoice_mode_text',width:80}, {header:lc[19],dataIndex:'doc_type_text',width:90, renderer:App.qtipValue}, {header:lc[20],dataIndex:'busi_optr_name',width:100, renderer:App.qtipValue} ] }); var pageTbar = new Ext.PagingToolbar({store: this.acctFeeStore ,pageSize : this.pageSize}); AcctFeeGrid.superclass.constructor.call(this, { id:'P_ACCT', title : langUtils.main("pay.payfee._title"), loadMask : true, store : this.acctFeeStore, border : false, bbar: pageTbar, disableSelection:true, view: new Ext.ux.grid.ColumnLockBufferView(), sm : new Ext.grid.RowSelectionModel(), cm : cm, tools:[{id:'search',qtip:'ๆŸฅ่ฏข',cls:'tip-target',scope:this,handler:function(){ var comp = this.tools.search; if(this.acctFeeStore.getCount()>0){ if(win)win.close(); win = FilterWindow.addComp(this,[ {text:'ๆ™บ่ƒฝๅกๅท',field:'device_code',type:'textfield'}, {text:'็Šถๆ€',field:'status',showField:'status_text', data:[ {'text':'ๆ‰€ๆœ‰','value':''}, {'text':'ๅทฒๆ”ฏไป˜','value':'PAY'}, {'text':'ๅคฑๆ•ˆ','value':'INVALID'} ] }, {text:'ๅ—็†ๆ—ฅๆœŸ',field:'create_time',type:'datefield'}, {text:'ๅ—็†ไบบ',field:'optr_name',type:'textfield'}, {text:'ๅ‘็ฅจๅท',field:'invoice_id',type:'textfield'} ],700,null,true,"queryFeeInfo"); if(win){ win.setPosition(comp.getX()-win.width, comp.getY()-50);//ๅผนๅ‡บๆก†ๅณๅฏน้ฝ win.show(); } }else{ Alert('่ฏทๅ…ˆๆŸฅ่ฏขๆ•ฐๆฎ๏ผ'); } } }] }); }, initEvents :function(){ this.on("afterrender",function(){ this.swapViews(); },this,{delay:10}); AcctFeeGrid.superclass.initEvents.call(this); }, doOperate:function(){ //ไธๆ˜ฏๅฝ“ๅ‰็™ปๅฝ•ไบบ็š„ไธ่ƒฝ่ฟ›่กŒโ€œๅ†ฒๆญฃโ€ๆ“ไฝœ(ๅŽปๆމไธ็ฌฆๅˆๆกไปถ่กŒ็š„โ€œๅ†ฒๆญฃโ€ๆ“ไฝœๆŒ‰้’ฎ) this.each(function(record){ if(record.get('optr_name') != App.getData().optr['optr_name']){ record.set('OPERATE','F'); } }); this.commitChanges(); }, remoteRefresh : function() { this.refresh(); }, localRefresh : function() { unitRecords = this.getSelectionModel().getSelections(); for (var i in unitRecords) { this.acctFeeStore.remove(unitRecords[i]); } }, refresh:function(){ this.acctFeeStore.baseParams = { residentCustId: App.getData().custFullInfo.cust.cust_id, custStatus : App.data.custFullInfo.cust.status }; // this.acctFeeStore.baseParams['residentCustId'] = App.getData().custFullInfo.cust.cust_id; // this.acctFeeStore.baseParams['custStatus'] = App.data.custFullInfo.cust.status; // this.acctFeeStore.load({params:{start: 0,limit: this.pageSize}}); this.reloadCurrentPage(); } }); /** * ไธšๅŠก่ดน็”จ */ BusiFeeGrid = Ext.extend(Ext.ux.Grid, { border : false, busiFeeStore : null, region : 'center', pageSize : 10, constructor : function() { this.busiFeeStore = new Ext.data.JsonStore({ url : Constant.ROOT_PATH+ "/commons/x/QueryCust!queryBusiPayFee.action", totalProperty:'totalProperty', root:'records', fields : ['create_done_code','fee_text', 'device_type', 'device_type_text', 'device_code', {name : 'should_pay',type : 'int'},'is_doc','is_doc_text', 'pay_type_text', 'pay_type', 'status_text','dept_name','dept_id', 'status', 'invoice_code', 'invoice_id','invoice_mode', 'optr_id','optr_name', {name : 'real_pay',type : 'int'},'fee_sn','create_time','acct_date','deposit', 'data_right','finance_status','invoice_book_id','is_busi_fee', 'busi_optr_id','busi_optr_name','invoice_fee',"doc_type","doc_type_text", "invoice_mode_text",'buy_num','device_model','device_model_name', 'count_text'] }); var lc = langUtils.main("pay.busifee.columns"); var cm = new Ext.ux.grid.LockingColumnModel({ columns : [ {header:lc[0],dataIndex:'create_done_code',width:80}, {header:lc[1],dataIndex:'fee_text',width:110, renderer:App.qtipValue}, {header:lc[2],dataIndex:'device_type_text',width:80}, {header:lc[16],dataIndex:'device_model_name',width:120, renderer:App.qtipValue}, {header:lc[3],dataIndex:'device_code',width:130, renderer:App.qtipValue}, {header:lc[4],dataIndex:'status_text',width:70,renderer:Ext.util.Format.statusShow}, {header:lc[5],dataIndex:'is_doc_text',width:80,renderer:Ext.util.Format.statusShow}, {header:lc[6],dataIndex:'should_pay',width:60,renderer:Ext.util.Format.formatFee}, {header:lc[7],dataIndex:'real_pay',width:60,renderer:Ext.util.Format.formatFee}, {header:lc[17],dataIndex:'count_text',width:120,renderer:App.qtipValue}, {header:lc[15],dataIndex:'buy_num',width:80}, {header:lc[8],dataIndex:'pay_type_text',width:90, renderer:App.qtipValue}, {header:lc[9],dataIndex:'create_time',width:125}, {header:lc[19],dataIndex:'acct_date',width:125}, {header:lc[10],dataIndex:'optr_name',width:90, renderer:App.qtipValue}, {header:lc[11],dataIndex:'dept_name',width:100, renderer:App.qtipValue}, {header:lc[12],dataIndex:'invoice_id',width:90, renderer:App.qtipValue}, // {header:lc[13],dataIndex:'invoice_mode_text',width:80}, {header:lc[14],dataIndex:'doc_type_text',width:90, renderer:App.qtipValue}, {header:lc[18],dataIndex:'busi_optr_name',width:100, renderer:App.qtipValue} ] }); BusiFeeGrid.superclass.constructor.call(this, { id:'P_BUSI', title : langUtils.main("pay.busifee._title"), loadMask : true, store : this.busiFeeStore, border : false, bbar: new Ext.PagingToolbar({store: this.busiFeeStore ,pageSize : this.pageSize}), sm : new Ext.grid.RowSelectionModel(), view: new Ext.ux.grid.ColumnLockBufferView(), cm : cm, listeners:{ scope:this, delay:10, rowdblclick: this.doDblClickRecord, afterrender: this.swapViews }, tools:[{id:'search',qtip:'ๆŸฅ่ฏข',cls:'tip-target',scope:this,handler:function(){ var comp = this.tools.search; if(this.busiFeeStore.getCount()>0){ if(win)win.close(); win = FilterWindow.addComp(this,[ {text:'่ฎพๅค‡็ฑปๅž‹',field:'device_type',showField:'device_type_text', data:[ {'text':'่ฎพๅค‡็ฑปๅž‹','value':''}, {'text':'ๆœบ้กถ็›’','value':'STB'}, {'text':'ๆ™บ่ƒฝๅก','value':'CARD'}, {'text':'MODEM','value':'MODEM'} ] }, {text:'่ฎพๅค‡็ผ–ๅท',field:'device_code',type:'textfield'}, {text:'ๅ—็†ๆ—ฅๆœŸ',field:'create_time',type:'datefield'}, {text:'็Šถๆ€',field:'status',showField:'status_text', data:[ {'text':'ๆ‰€ๆœ‰','value':''}, {'text':'ๅทฒๆ”ฏไป˜','value':'PAY'}, {'text':'ๅคฑๆ•ˆ','value':'INVALID'} ] }, {text:'ๅ—็†ไบบ',field:'optr_name',type:'textfield'}, {text:'ๅ‘็ฅจๅท',field:'invoice_id',type:'textfield'} ],800,null,true,"queryFeeInfo"); if(win){ win.setPosition(comp.getX()-win.width, comp.getY()-50);//ๅผนๅ‡บๆก†ๅณๅฏน้ฝ win.show(); } }else{ Alert('่ฏทๅ…ˆๆŸฅ่ฏขๆ•ฐๆฎ๏ผ'); } } }] }); }, doDblClickRecord : function(grid, rowIndex, e) { var record = grid.getStore().getAt(rowIndex); }, remoteRefresh : function() { this.refresh(); }, refresh:function(){ /*Ext.Ajax.request({ url : Constant.ROOT_PATH+ "/commons/x/QueryCust!queryBusiPayFee.action", scope:this, params:{ residentCustId:App.getData().custFullInfo.cust.cust_id, custStatus : App.data.custFullInfo.cust.status }, success:function(res,opt){ var data = Ext.decode(res.responseText); //PagingMemoryProxy() ไธ€ๆฌกๆ€ง่ฏปๅ–ๆ•ฐๆฎ this.busiFeeStore.proxy = new Ext.data.PagingMemoryProxy(data), //ๆœฌๅœฐๅˆ†้กต this.busiFeeStore.load({params:{start:0,limit:this.pageSize}}); } });*/ // this.busiFeeStore.baseParams['residentCustId'] = App.getData().custFullInfo.cust.cust_id; this.busiFeeStore.baseParams = { residentCustId: App.getData().custFullInfo.cust.cust_id }; // this.busiFeeStore.load({params:{start: 0,limit: this.pageSize}}); this.reloadCurrentPage(); }, localRefresh : function() { unitRecords = this.getSelectionModel().getSelections(); for (var i in unitRecords) { this.busiFeeStore.remove(unitRecords[i]); } } }); /** * ่ฎขๅ•้‡‘้ขๆ˜Ž็ป† */ CfeePayWindow = Ext.extend(Ext.Window, { feeStore:null, constructor: function(){ this.feeStore = new Ext.data.JsonStore({ url : Constant.ROOT_PATH+ "/commons/x/QueryCust!queryFeePayDetail.action", fields: ["real_pay","fee_text","invoice_id","create_done_code"] }) var lc = langUtils.main("pay.feePayDetail.columns"); var columns = [ {header: lc[0], width: 80,sortable:true, dataIndex: 'create_done_code',renderer:App.qtipValue}, {header: lc[1],sortable:true, dataIndex: 'fee_text',renderer:App.qtipValue}, {header: lc[2], width: 70, sortable:true, dataIndex: 'real_pay',renderer:Ext.util.Format.formatFee}, {header: lc[3], width: 80,sortable:true, dataIndex: 'invoice_id',renderer:App.qtipValue} ]; return CfeePayWindow.superclass.constructor.call(this, { layout:"fit", title: langUtils.main("pay.feePayDetail._title"), width: 600, height: 300, resizable: false, maximizable: false, closeAction: 'hide', minimizable: false, items: [{ xtype: 'grid', stripeRows: true, border: false, store: this.feeStore, columns: columns, viewConfig:{forceFit:true}, stateful: true }] }); }, show: function(sn){ this.feeStore.baseParams = { paySn: sn }; this.feeStore.load(); return CfeePayWindow.superclass.show.call(this); } }); FeePayGrid = Ext.extend(Ext.ux.Grid, { feePayStore : null, pageSize : 20, cfeePayWindow:null, feePayData: [], constructor : function() { this.feePayStore = new Ext.data.JsonStore({ url : Constant.ROOT_PATH+ "/commons/x/QueryCust!queryFeePay.action", totalProperty:'totalProperty', root:'records', fields : ['pay_sn','reverse_done_code', 'pay_type', 'pay_type_text', 'done_code', {name : 'usd',type : 'int'},'receipt_id','is_valid_text', 'is_valid', 'payer', 'acct_date','dept_name','dept_id', 'invoice_mode', 'invoice_mode_text', 'remark',{name : 'exchange',type : 'int'}, {name : 'cos',type : 'int'}, 'optr_id','optr_name', {name : 'khr',type : 'int'},'create_time','data_right'] }); var lc = langUtils.main("pay.detail.columns"); var cm = new Ext.ux.grid.LockingColumnModel({ columns : [ {header:lc[0],dataIndex:'pay_sn',width:85,renderer:function(value,metaData,record){ that = this; if(value != ''){ return '<div style="text-decoration:underline;font-weight:bold" onclick="Ext.getCmp(\'P_FEE_PAY\').doTransferFeeShow();" ext:qtitle="" ext:qtip="' + value + '">' + value +'</div>'; }else{ return '<div ext:qtitle="" ext:qtip="' + value + '">' + value +'</div>'; } }}, {header:lc[1],dataIndex:'usd',width:50,renderer:Ext.util.Format.formatFee}, {header:lc[5],dataIndex:'is_valid_text',width:70,renderer:Ext.util.Format.statusShow}, {header:lc[2],dataIndex:'khr',width:50,renderer:Ext.util.Format.formatFee}, {header:lc[3],dataIndex:'exchange',width:70}, {header:lc[4],dataIndex:'cos',width:100,renderer:Ext.util.Format.formatFee}, {header:lc[6],dataIndex:'pay_type_text',width:100}, {header:lc[7],dataIndex:'payer',width:70}, {header:lc[8],dataIndex:'done_code',width:80}, {header:lc[9],dataIndex:'receipt_id',width:100}, // {header:lc[10],dataIndex:'invoice_mode_text',width:80}, {header:lc[11],dataIndex:'create_time',width:125}, {header:lc[12],dataIndex:'optr_name',width:100}, {header:lc[13],dataIndex:'dept_name',width:100} ] }); FeePayGrid.superclass.constructor.call(this, { id:'P_FEE_PAY', title : langUtils.main("pay.detail._title"), region:"east", width:"30%", split:true, loadMask : true, store : this.feePayStore, // border : false, bbar: new Ext.PagingToolbar({store: this.feePayStore ,pageSize : this.pageSize}), sm : new Ext.grid.RowSelectionModel(), view: new Ext.ux.grid.ColumnLockBufferView(), cm : cm, listeners:{ scope:this, delay:10, rowdblclick: this.doDblClickRecord, afterrender: this.swapViews }, tools:[{id:'search',qtip:'ๆŸฅ่ฏข',cls:'tip-target',scope:this,handler:function(){ var comp = this.tools.search; if(this.feePayStore.getCount()>0){ if(win)win.close(); win = FilterWindow.addComp(this,[ {text:'็Šถๆ€',field:'status',showField:'is_valid_text', data:[ {'text':'ๆ‰€ๆœ‰','value':''}, {'text':'ๆœ‰ๆ•ˆ','value':'T'}, {'text':'ๅคฑๆ•ˆ','value':'F'} ] }, {text:'ๅ—็†ๆ—ฅๆœŸ',field:'create_time',type:'datefield'}, {text:'ๅ—็†ไบบ',field:'optr_name',type:'textfield'}, {text:'ๅ‘็ฅจๅท',field:'invoice_id',type:'textfield'} ],580,null,true,"queryFeeInfo"); if(win){ win.setPosition(comp.getX()-win.width, comp.getY()-50);//ๅผนๅ‡บๆก†ๅณๅฏน้ฝ win.show(); } }else{ Alert('่ฏทๅ…ˆๆŸฅ่ฏขๆ•ฐๆฎ๏ผ'); } } }] }); }, doDblClickRecord : function(grid, rowIndex, e) { var record = grid.getStore().getAt(rowIndex); }, remoteRefresh : function() { this.refresh(); }, refresh:function(){ this.feePayStore.baseParams = { residentCustId: App.getData().custFullInfo.cust.cust_id }; // this.busiFeeStore.load({params:{start: 0,limit: this.pageSize}}); this.reloadCurrentPage(); }, localRefresh : function() { unitRecords = this.getSelectionModel().getSelections(); for (var i in unitRecords) { this.feePayStore.remove(unitRecords[i]); } }, doTransferFeeShow:function(){ if(!App.getApp().getCustId()){ Alert('่ฏทๆŸฅ่ฏขๅฎขๆˆทไน‹ๅŽๅ†ๅšๆ“ไฝœ.'); return false; } var recs = this.selModel.getSelections(); if(!recs || recs.length !=1){ Alert('่ฏท้€‰ๆ‹ฉไธ”ไป…้€‰ๆ‹ฉไธ€ๆก่ฎฐๅฝ•!'); return false; } var rec = recs[0]; if(!this.cfeePayWindow){ this.cfeePayWindow = new CfeePayWindow(); } this.cfeePayWindow.show(rec.get('pay_sn')); } }); /** */ PayfeePanel = Ext.extend(BaseInfoPanel, { // ้ขๆฟๅฑžๆ€งๅฎšไน‰ acctFeeGrid : null, busiFeeGrid : null, feePayGrid : null, // other property mask : null, constructor : function() { // ๅญ้ขๆฟๅฎžไพ‹ๅŒ– this.acctFeeGrid = new AcctFeeGrid(); this.busiFeeGrid = new BusiFeeGrid(); this.feePayGrid = new FeePayGrid(); PayfeePanel.superclass.constructor.call(this, { layout:"border", border:false, items:[{ region:"center", layout:"anchor", // border: false, items : [{ layout : 'fit', border : false, anchor : "100% 60%", bodyStyle: 'border-bottom-width: 1px;', items : [this.acctFeeGrid] }, { layout : 'fit', border : false, anchor : "100% 40%", items : [this.busiFeeGrid] }] },this.feePayGrid // { // region:"west", // split:true, // width:"30%", // border: false, // items:[this.feePayGrid] // } ] }); }, refresh : function() { this.acctFeeGrid.remoteRefresh(); this.busiFeeGrid.remoteRefresh(); this.feePayGrid.remoteRefresh(); } }); Ext.reg("payfeepanel", PayfeePanel);
leopardoooo/cambodia
boss-core/src/main/webapp/pages/index/center/PayfeePanel.js
JavaScript
apache-2.0
18,342
package SyTest::HTTPServer::Request; use 5.014; # ${^GLOBAL_PHASE} use base qw( Net::Async::HTTP::Server::Request ); use HTTP::Response; use JSON; my $json = JSON->new->convert_blessed; use constant JSON_MIME_TYPE => "application/json"; use SyTest::CarpByFile; use SyTest::HTTPClient; sub DESTROY { return if ${^GLOBAL_PHASE} eq "DESTRUCT"; my $self = shift or return; return if $self->{__responded}; carp "Destroying unresponded HTTP request to ${\$self->path}"; } sub respond { my $self = shift; $self->{__responded}++; $self->SUPER::respond( @_ ); } sub body_from_json { my $self = shift; if( ( my $type = $self->header( "Content-Type" ) // "" ) ne JSON_MIME_TYPE ) { croak "Cannot ->body_from_json with Content-Type: $type"; } my $decoded = $json->decode( $self->body ); # wrap numeric values with JSON::number to stop them getting turned into # strings when they are printed. $decoded = SyTest::HTTPClient::wrap_numbers( $decoded ); return $decoded; } sub respond_json { my $self = shift; my ( $body, %opts ) = @_; my $response = HTTP::Response->new( $opts{code} // 200 ); $response->add_content( $json->encode( $body )); $response->content_type( JSON_MIME_TYPE ); $response->content_length( length $response->content ); $self->respond( $response ); } sub body_from_form { my $self = shift; if( ( my $type = $self->header( "Content-Type" ) // "" ) ne "application/x-www-form-urlencoded" ) { croak "Cannot ->body_from_form with Content-Type: $type"; } # TODO: Surely there's a neater way than this?? return { URI->new( "http://?" . $self->body )->query_form }; } 1;
matrix-org/sytest
lib/SyTest/HTTPServer/Request.pm
Perl
apache-2.0
1,681
๏ปฟusing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ServiceModel; namespace WcfChatServer { interface IWcfChatClient { [OperationContract(IsOneWay = true)] void onMessageReceived(string username, string message); [OperationContract(IsOneWay = true)] void onServerInfoReceived(int statusCode, string message); } }
jatwigg/wcf-messaging-service
WcfChatServer/Interface1.cs
C#
apache-2.0
439
/* * Copyright (C) 2017-2019 Dremio Corporation * * 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. */ // todo: should have a way to auto-register these (instead of manually maintaining a list) export default [ 'version', 'setting', 'home', 'historyItem', 'space', 'spaces', 'source', 'sources', 'dataset', 'fullDataset', 'datasetUI', 'datasetContext', 'physicalDataset', 'datasetConfig', 'file', 'fileFormat', 'folder', 'jobDetails', 'tableData', 'previewTable', 'user', 'datasetAccelerationSettings', 'provision' ];
dremio/dremio-oss
dac/ui/src/reducers/resources/entityTypes.js
JavaScript
apache-2.0
1,073
/** * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.interestrate; import java.util.List; import java.util.Map; import com.opengamma.analytics.financial.interestrate.future.derivative.BondFuture; import com.opengamma.analytics.financial.interestrate.future.method.BondFutureHullWhiteMethod; import com.opengamma.util.tuple.DoublesPair; /** * Present value curve sensitivity calculator for interest rate instruments using Hull-White (extended Vasicek) one factor model. */ public final class PresentValueCurveSensitivityHullWhiteCalculator extends PresentValueCurveSensitivityCalculator { /** * The instance of the calculator. */ private static final PresentValueCurveSensitivityHullWhiteCalculator INSTANCE = new PresentValueCurveSensitivityHullWhiteCalculator(); /** * Return the instance of the calculator. * @return The calculator. */ public static PresentValueCurveSensitivityHullWhiteCalculator getInstance() { return INSTANCE; } /** * Private constructor. */ private PresentValueCurveSensitivityHullWhiteCalculator() { } /** * The methods. */ private static final BondFutureHullWhiteMethod METHOD_HW = BondFutureHullWhiteMethod.getInstance(); @Override public Map<String, List<DoublesPair>> visitBondFuture(final BondFuture bondFuture, final YieldCurveBundle curves) { return METHOD_HW.presentValueCurveSensitivity(bondFuture, curves).getSensitivities(); } }
charles-cooper/idylfin
src/com/opengamma/analytics/financial/interestrate/PresentValueCurveSensitivityHullWhiteCalculator.java
Java
apache-2.0
1,565
<h1>Pet-Manager</h1> <p>Pet-Manager รฉ uma aplicaรงรฃo que consiste no gerenciamento de uma pet-shop.</p> <p>Pet-Manager: https://pet-manager.herokuapp.com/</p>
repositorioadriano/pet-manager
README.md
Markdown
apache-2.0
161
# Copyright (c) OpenMMLab. All rights reserved. import itertools import numpy as np import torch from .general_data import GeneralData class InstanceData(GeneralData): """Data structure for instance-level annnotations or predictions. Subclass of :class:`GeneralData`. All value in `data_fields` should have the same length. This design refer to https://github.com/facebookresearch/detectron2/blob/master/detectron2/structures/instances.py # noqa E501 Examples: >>> from mmdet.core import InstanceData >>> import numpy as np >>> img_meta = dict(img_shape=(800, 1196, 3), pad_shape=(800, 1216, 3)) >>> results = InstanceData(img_meta) >>> img_shape in results True >>> results.det_labels = torch.LongTensor([0, 1, 2, 3]) >>> results["det_scores"] = torch.Tensor([0.01, 0.7, 0.6, 0.3]) >>> results["det_masks"] = np.ndarray(4, 2, 2) >>> len(results) 4 >>> print(resutls) <InstanceData( META INFORMATION pad_shape: (800, 1216, 3) img_shape: (800, 1196, 3) PREDICTIONS shape of det_labels: torch.Size([4]) shape of det_masks: (4, 2, 2) shape of det_scores: torch.Size([4]) ) at 0x7fe26b5ca990> >>> sorted_results = results[results.det_scores.sort().indices] >>> sorted_results.det_scores tensor([0.0100, 0.3000, 0.6000, 0.7000]) >>> sorted_results.det_labels tensor([0, 3, 2, 1]) >>> print(results[results.scores > 0.5]) <InstanceData( META INFORMATION pad_shape: (800, 1216, 3) img_shape: (800, 1196, 3) PREDICTIONS shape of det_labels: torch.Size([2]) shape of det_masks: (2, 2, 2) shape of det_scores: torch.Size([2]) ) at 0x7fe26b6d7790> >>> results[results.det_scores > 0.5].det_labels tensor([1, 2]) >>> results[results.det_scores > 0.5].det_scores tensor([0.7000, 0.6000]) """ def __setattr__(self, name, value): if name in ('_meta_info_fields', '_data_fields'): if not hasattr(self, name): super().__setattr__(name, value) else: raise AttributeError( f'{name} has been used as a ' f'private attribute, which is immutable. ') else: assert isinstance(value, (torch.Tensor, np.ndarray, list)), \ f'Can set {type(value)}, only support' \ f' {(torch.Tensor, np.ndarray, list)}' if self._data_fields: assert len(value) == len(self), f'the length of ' \ f'values {len(value)} is ' \ f'not consistent with' \ f' the length ' \ f'of this :obj:`InstanceData` ' \ f'{len(self)} ' super().__setattr__(name, value) def __getitem__(self, item): """ Args: item (str, obj:`slice`, obj`torch.LongTensor`, obj:`torch.BoolTensor`): get the corresponding values according to item. Returns: obj:`InstanceData`: Corresponding values. """ assert len(self), ' This is a empty instance' assert isinstance( item, (str, slice, int, torch.LongTensor, torch.BoolTensor)) if isinstance(item, str): return getattr(self, item) if type(item) == int: if item >= len(self) or item < -len(self): raise IndexError(f'Index {item} out of range!') else: # keep the dimension item = slice(item, None, len(self)) new_data = self.new() if isinstance(item, (torch.Tensor)): assert item.dim() == 1, 'Only support to get the' \ ' values along the first dimension.' if isinstance(item, torch.BoolTensor): assert len(item) == len(self), f'The shape of the' \ f' input(BoolTensor)) ' \ f'{len(item)} ' \ f' does not match the shape ' \ f'of the indexed tensor ' \ f'in results_filed ' \ f'{len(self)} at ' \ f'first dimension. ' for k, v in self.items(): if isinstance(v, torch.Tensor): new_data[k] = v[item] elif isinstance(v, np.ndarray): new_data[k] = v[item.cpu().numpy()] elif isinstance(v, list): r_list = [] # convert to indexes from boolTensor if isinstance(item, torch.BoolTensor): indexes = torch.nonzero(item).view(-1) else: indexes = item for index in indexes: r_list.append(v[index]) new_data[k] = r_list else: # item is a slice for k, v in self.items(): new_data[k] = v[item] return new_data @staticmethod def cat(instances_list): """Concat the predictions of all :obj:`InstanceData` in the list. Args: instances_list (list[:obj:`InstanceData`]): A list of :obj:`InstanceData`. Returns: obj:`InstanceData` """ assert all( isinstance(results, InstanceData) for results in instances_list) assert len(instances_list) > 0 if len(instances_list) == 1: return instances_list[0] new_data = instances_list[0].new() for k in instances_list[0]._data_fields: values = [results[k] for results in instances_list] v0 = values[0] if isinstance(v0, torch.Tensor): values = torch.cat(values, dim=0) elif isinstance(v0, np.ndarray): values = np.concatenate(values, axis=0) elif isinstance(v0, list): values = list(itertools.chain(*values)) else: raise ValueError( f'Can not concat the {k} which is a {type(v0)}') new_data[k] = values return new_data def __len__(self): if len(self._data_fields): for v in self.values(): return len(v) else: raise AssertionError('This is an empty `InstanceData`.')
open-mmlab/mmdetection
mmdet/core/data_structures/instance_data.py
Python
apache-2.0
6,926
--- layout: post title: "iOS ๅŠจ็”ปAnimation-4-3: CALayerๅญ็ฑป๏ผšCAShapeLayer" subtitle: "iOS ๅŠจ็”ป Animation" date: 2016-10-18 22:00:00 author: "FishYan" header-img: "img/blog-header.png" catalog: true tags: - iOS - iOS ๅŠจ็”ป --- # iOS ๅŠจ็”ปAnimation-4-3: CALayerๅญ็ฑป๏ผšCAShapeLayer >้ฆ–ๅ…ˆ่ฏดๆ˜Ž๏ผš่ฟ™ๆ˜ฏไธ€็ณปๅˆ—ๆ–‡็ซ ๏ผŒๅ‚่€ƒๆœฌไธ“้ข˜ไธ‹ๅ…ถไป–็š„ๆ–‡็ซ ๆœ‰ๅŠฉไบŽไฝ ๅฏนๆœฌๆ–‡็š„็†่งฃใ€‚ ๅฅฝไน…ๆฒกๆœ‰ๆ›ดๆ–ฐๅšๅฎข๏ผŒๆˆ‘ไนŸๆ˜ฏไธŠ็ญไธ€ๆ—๏ผŒๅ‰ไธ€ๆฎตๆ—ถ้—ดๅทฅไฝœ้‡ๆœ‰็‚นๅคง๏ผŒๆฏ”่พƒๅฟ™๏ผŒไนŸไธ€็›ดๆฒกๆœ‰ๆ—ถ้—ดๅ†™ๅšๅฎขใ€‚ๅฅฝๅœจ้กน็›ฎๅœจไธŠๅ‘จๆœซ็ปˆไบŽ้€š่ฟ‡ๆต‹่ฏ•ไธŠ็บฟไบ†๏ผŒๆœ‰ๅฏไปฅไผ‘ๆฏไธ€ๆฎตๆ—ถ้—ดไบ†ใ€‚ ไธ‹้ข่ฟ›ๅ…ฅๆญฃ้ข˜๏ผšไปŠๅคฉไป‹็ปCAShapeLayer - CAShapeLayerไฝœไธบCALayer(ๅ…ณไบŽCALayerๅ‚่€ƒ๏ผš[iOSๅŠจ็”ปAnimation-4-1:CALayer](http://blog.csdn.net/fish_yan_/article/details/51139953))็š„ๅญ็ฑป๏ผŒไป–ๆœ‰ๅคšไบ†้‚ฃไบ›ๅธธ็”จ็š„APIๅ‘ข๏ผŸ |API | ๆ่ฟฐ | |:-:|:-| | Path | ่ฟ™ๆ˜ฏไธ€ไธชๆฏ”่พƒ้‡่ฆ็š„ๅฑžๆ€ง, ไธŽUIBezier็ป“ๅˆ, ๅฏไปฅ้šๅฟƒๆ‰€ๆฌฒ็š„็ป˜ๅˆถๅ‡บๅ„็งๅ›พๅฝข| |FillColor|ๅกซๅ……้ขœ่‰ฒ(็œ‹ๅๅญ—ๅฐฑๆ‡‚)| |FillRule|ๅกซๅ……่ง„ๅˆ™| |StrokeColor|ๆ่พน้ขœ่‰ฒ| |StrokeStart|ๆ่พน่ตทๅง‹ไฝ็ฝฎ(0.0-1.0)| |StrokeEnd|ๆ่พน็ป“ๆŸไฝ็ฝฎ(0.0-1.0)| |LineCap|็บฟ็ฑปๅž‹(ไธ‹ๆ–นๆœ‰ๅ›พ)| |LineJoin|ๆ‹่ง’็ฑปๅž‹(ไธ‹ๆ–นๆœ‰ๅ›พ)| | LineWidth | ็บฟ็š„ๅฎฝๅบฆ| |MiterLimit |ๆ–œๆŽฅ้™ๅˆถ(Demoไธญๆœ‰่งฃ้‡Š) | LineCap: ![LineCap](http://img.blog.csdn.net/20160412230423621) LineJoin ![LineJoin](http://img.blog.csdn.net/20160412230753846) ๅฆ‚ๆžœ็œ‹่ฟ‡ๆˆ‘็š„ๅšๅฎข้ƒฝ็Ÿฅ้“๏ผŒๆˆ‘ไป‹็ป็š„ๅพˆๅคšไธ€้ƒจๅˆ†ไธœ่ฅฟ้ƒฝๆ˜ฏไปŽๅŸบ็ก€ๅ…ฅๆ‰‹๏ผŒ่ฟ™ไผš่ฎฉๅคงๅฎถๆ„Ÿ่ง‰ๆ•ˆๆžœไธŠ็œ‹่ตทๆฅๅพˆ้…ท็‚ซ็š„ไธœ่ฅฟๅฎž้™…ไธŠๅœจๅฎž็Žฐ่ตทๆฅๅนถไธๅ›ฐ้šพใ€‚ๅฐฑๆฏ”ๅฆ‚่ฏด่ฟ™ไธช ๅ…ˆ็œ‹Demo็š„ๆ•ˆๆžœๅ›พ๏ผš ![่ฟ™้‡Œๅ†™ๅ›พ็‰‡ๆ่ฟฐ](http://img.blog.csdn.net/20160412224731818) ่ฟ™ไธชๅฏๅนถไธๆ˜ฏๆ‰พไบ†ไธ€ไธชๅผงๅฝข็š„ๅ›พ็ป™ไธชๅŠจ็”ป่ฎฉไป–ๅœจ่ฟ™่ฝฌ๏ผŒ่ฟ™ไธชDemoๅนถๆฒกๆœ‰็”จๅˆฐไปปไฝ•ๅ›พ็‰‡็ด ๆ ๅ…ทไฝ“็š„ๅฎž็ŽฐๅŽŸ็†ๆ˜ฏ่ฟ™ๆ ท็š„: ้ฆ–ๅ…ˆไธŠๅ›พ็š„ๅœ†ๆ˜ฏ็”จUIBezier็”ปๅ‡บๆฅ็š„๏ผŒ่™ฝ็„ถไธๆ˜ฏไธ€ไธชๅฎŒๆ•ด็š„ๅœ†๏ผŒไฝ†ๅฎž้™…ไธŠๅฐฑๆ˜ฏไธ€ไธชๅœ†๏ผŒๅชๆ˜ฏๅ‰ฉไฝ™้ƒจๅˆ†ๆฒกๆœ‰้…่‰ฒใ€‚ ```Objective-C let path = UIBezierPath(arcCenter: CGPoint(x: 150.0, y: 150.0), radius: 150, startAngle: 0, endAngle: CGFloat(M_PI * 2), clockwise: true) ``` - ่งฃ้‡Š๏ผš ็ฌฌไธ€ไธชๅ‚ๆ•ฐarcCenter็Œœๅฐฑ็Ÿฅ้“ๆ˜ฏๅœ†ๅฟƒไบ†๏ผŒ ็ฌฌไบŒไธชๅ‚ๆ•ฐ็Œœ๏ผšๅŠๅพ„๏ผŒ ็ฌฌไธ‰ไธชๅ‚ๆ•ฐๅผ€ๅง‹่ง’ๅบฆ๏ผšๅๆ ‡็ณปx่ฝดไธบ0ยฐ ๏ผŒ ็ฌฌๅ››ไธชๅ‚ๆ•ฐ๏ผš็ป“ๆŸ่ง’ๅบฆ๏ผŒ่ทŸๅŽ้ข็ฌฌไบ”ไธชๅ‚ๆ•ฐ่ฟ˜ๆœ‰ๅ…ณ็ณป๏ผŒ ็ฌฌไบ”ไธชๅ‚ๆ•ฐ๏ผšๆ˜ฏๅฆ้กบๆ—ถ้’ˆ๏ผŒtrue้กบๆ—ถ้’ˆ๏ผŒflase้€†ๆ—ถ้’ˆ ๅฆ‚ๆžœๆƒณๆ›ดๆทฑๅ…ฅ็š„ไบ†่งฃUIBezier๏ผŒไธ่ฆๆ€ฅ๏ผŒๅŽ็ปญๆˆ‘ไผšๅ†™ๅšๅฎขๆฅๅธฎๅŠฉๅคงๅฎถไบ†่งฃใ€‚ ๅฅฝไบ†๏ผŒไธ€ไธชๅœ†็”ปๅ‡บๆฅไบ†๏ผŒไฝ†ๆ˜ฏ๏ผŒไนŸๅชๆ˜ฏ็”จไปฃ็ ็”ปๅ‡บๆฅไบ†๏ผŒๆ€Žไนˆ่ฎฉไป–ๆ˜พ็คบๅ‘ข๏ผŸ่ฟ™ๆ˜ฏๅŽๅฐฑ็”จๅˆฐCAShapeLayer็š„pathๅฑžๆ€งไบ† ๅ…ˆๅˆๅง‹ๅŒ–ไธ€ไธชCAShapeLayer ```Objective-C let shapeLayer = CAShapeLayer() shapeLayer.frame = someView.bounds shapeLayer.path = path.CGPath ``` - ่งฃ้‡Š๏ผš ่ฟ™้‡Œ็š„someViewๆ˜ฏๆˆ‘็”จstoryboardๅˆ›ๅปบ็š„็š„ไธ€ไธชView ็„ถๅŽๅฐ†path่ต‹็ป™shapLayer ๅ†™ๅˆฐ่ฟ™่ฟ˜ๆ˜ฏไธๆ˜พ็คบ๏ผŒๅ› ไธบๆฒกๆœ‰้ขœ่‰ฒ๏ผŒไธ‹้ข่ฎพ็ฝฎ้ขœ่‰ฒ ```swift shapeLayer.strokeColor = UIColor.greenColor().CGColor // ่พน็ผ˜็บฟ็š„้ขœ่‰ฒ shapeLayer.fillColor = UIColor.clearColor().CGColor // ้—ญ็Žฏๅกซๅ……็š„้ขœ่‰ฒ shapeLayer.lineCap = kCALineCapSquare // ่พน็ผ˜็บฟ็š„็ฑปๅž‹ /* kCALineCapButt ๅนณ่ง’(ๅˆ‡ๆމๅคšๅ‡บ็š„) kCALineCapRound ๅœ†่ง’ kCALineCapSquare ๅนณ่ง’(่กฅ้ฝ็ฉบ็ผบ) */ ``` ่ฟ˜ๆœ‰็บฟๅฎฝ ```swift shapeLayer.lineWidth = 4.0//่พน็ผ˜็บฟๅฎฝๅบฆ(ๆ˜ฏไปŽ่พน็ผ˜ไฝ็ฝฎๅ‘ไธค่พนๅปถไผธ) ``` ่ฎพ็ฝฎshapeLayer็š„่ตทๅง‹ไฝ็ฝฎๅ’Œ็ปˆๆญขไฝ็ฝฎ ```swift shapeLayer.strokeStart = 0.0//่ตทๅง‹ไฝ็ฝฎ0--1 shapeLayer.strokeEnd = 0.75//็ป“ๆŸไธบๆญข0--1 someView.layer.addSublayer(shapeLayer) ``` ็ปˆไบŽๅ‡บๆฅไบ†๏ผŒไฝ†ๆ˜ฏ่ฟ˜ไธไผšๅŠจ๏ผŒ่ฟ™ๆ˜ฏๅŽๅฐฑ่ฆๅŠ ไธ€ไธชๅŠจ็”ปไบ†๏ผŒๅ…ณไบŽๅŠจ็”ป็š„่ฎฒ่งฃ่ฏท็œ‹ๆœฌไธ“้ข˜ไน‹ๅ‰็š„ๆ–‡็ซ  ```swift //ๆทปๅŠ ๆ—‹่ฝฌๅŠจ็”ป let animation = CABasicAnimation(keyPath: "transform.rotation") animation.duration = 1 animation.fromValue = 0 animation.toValue = M_PI * 2 animation.repeatCount = Float(Int.max) shapeLayer.addAnimation(animation, forKey: nil) ``` ๅˆฐๆญคไฝ็ฝฎๆ•ˆๆžœๅฐฑๅ‡บๆฅไบ†๏ผŒๆ˜ฏไธๆ˜ฏ็œ‹่ตทๆฅๅพˆ็ฎ€ๅ•ๅ‘ข๏ผŒๅ…ถๅฎžไป–ๅฐฑๆ˜ฏ่ฟ™ไนˆ็ฎ€ๅ•๏ผŒไธ่ฆไปฅไธบๆœ‰ๅคšไนˆ็š„้ซ˜ๅคงไธŠ๏ผŒๆˆ–่€…ๅคๆ‚ใ€‚ [Demoไฝ็ฝฎ](https://github.com/fish-yan/CAShapeLayer) ไธ‹้ข่ฟ˜ๆœ‰ไธ€ไธชDemoไผš่ฎฒๅˆฐๅฆๅค–ไธคไธชๆœฌๆ–‡ๆฒกๆœ‰่ฎฒๅˆฐ็š„ๅฑžๆ€งไธๅธธ็”จ๏ผŒๆ•ˆๆžœๆ˜ฏ่ฟ™ๆ ท็š„๏ผŒๅš่ท‘้ฉฌ็ฏๅ€’ๆ˜ฏๆŒบๅฅฝ็Žฉ็š„๏ผŒๅฎž้™…ไธŠๆ˜ฏ่ฟž่ดฏ็š„๏ผŒgifๆ•ˆๆžœไธๅฅฝ๏ผŒ่‡ชๅทฑไธ‹่ฝฝDemo็Žฉๅง ![่ฟ™้‡Œๅ†™ๅ›พ็‰‡ๆ่ฟฐ](http://img.blog.csdn.net/20160412235109120) ็ปƒไน Demo [Demo2](https://github.com/fish-yan/CAShapeLayer1)
fish-yan/fish-yan.github.io
_posts/2016-10-18-CAShapLayer.markdown
Markdown
apache-2.0
4,711
# Narcissus minor var. provincialis VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Amaryllidaceae/Narcissus/Narcissus pseudonarcissus/ Syn. Narcissus minor provincialis/README.md
Markdown
apache-2.0
190
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Sat Sep 28 14:09:52 CEST 2013 --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE> Uses of Package org.apache.solr.internal.csv.writer (Solr 4.5.0 API) </TITLE> <META NAME="date" CONTENT="2013-09-28"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.apache.solr.internal.csv.writer (Solr 4.5.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/solr/internal/csv/writer/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.apache.solr.internal.csv.writer</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../org/apache/solr/internal/csv/writer/package-summary.html">org.apache.solr.internal.csv.writer</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.solr.internal.csv.writer"><B>org.apache.solr.internal.csv.writer</B></A></TD> <TD> Internal classes used for reading/writing CSV&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.solr.internal.csv.writer"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../../../org/apache/solr/internal/csv/writer/package-summary.html">org.apache.solr.internal.csv.writer</A> used by <A HREF="../../../../../../org/apache/solr/internal/csv/writer/package-summary.html">org.apache.solr.internal.csv.writer</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../org/apache/solr/internal/csv/writer/class-use/CSVConfig.html#org.apache.solr.internal.csv.writer"><B>CSVConfig</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The CSVConfig is used to configure the CSV writer</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../../../org/apache/solr/internal/csv/writer/class-use/CSVField.html#org.apache.solr.internal.csv.writer"><B>CSVField</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/solr/internal/csv/writer/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2000-2013 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </BODY> </HTML>
hajimeni/dbflute-solr-example
solr-4.5.0/docs/solr-core/org/apache/solr/internal/csv/writer/package-use.html
HTML
apache-2.0
7,934
๏ปฟusing Lucene.Net.Documents; using Lucene.Net.Index.Extensions; using Lucene.Net.Util.Automaton; using NUnit.Framework; using RandomizedTesting.Generators; using System; using System.Collections.Generic; using Console = Lucene.Net.Util.SystemConsole; namespace Lucene.Net.Search { /* * 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. */ using AttributeSource = Lucene.Net.Util.AttributeSource; using Automaton = Lucene.Net.Util.Automaton.Automaton; using AutomatonTestUtil = Lucene.Net.Util.Automaton.AutomatonTestUtil; using BytesRef = Lucene.Net.Util.BytesRef; using CharacterRunAutomaton = Lucene.Net.Util.Automaton.CharacterRunAutomaton; using CharsRef = Lucene.Net.Util.CharsRef; using Codec = Lucene.Net.Codecs.Codec; using Directory = Lucene.Net.Store.Directory; using Document = Documents.Document; using Field = Field; using FilteredTermsEnum = Lucene.Net.Index.FilteredTermsEnum; using IndexReader = Lucene.Net.Index.IndexReader; using LuceneTestCase = Lucene.Net.Util.LuceneTestCase; using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer; using MockTokenizer = Lucene.Net.Analysis.MockTokenizer; using RandomIndexWriter = Lucene.Net.Index.RandomIndexWriter; using RegExp = Lucene.Net.Util.Automaton.RegExp; using Term = Lucene.Net.Index.Term; using Terms = Lucene.Net.Index.Terms; using TermsEnum = Lucene.Net.Index.TermsEnum; using TestUtil = Lucene.Net.Util.TestUtil; using UnicodeUtil = Lucene.Net.Util.UnicodeUtil; /// <summary> /// Create an index with random unicode terms /// Generates random regexps, and validates against a simple impl. /// </summary> [TestFixture] public class TestRegexpRandom2 : LuceneTestCase { protected internal IndexSearcher searcher1; protected internal IndexSearcher searcher2; private IndexReader reader; private Directory dir; protected internal string fieldName; [SetUp] public override void SetUp() { base.SetUp(); dir = NewDirectory(); fieldName = Random.NextBoolean() ? "field" : ""; // sometimes use an empty string as field name RandomIndexWriter writer = new RandomIndexWriter(Random, dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random, MockTokenizer.KEYWORD, false)).SetMaxBufferedDocs(TestUtil.NextInt32(Random, 50, 1000))); Document doc = new Document(); Field field = NewStringField(fieldName, "", Field.Store.NO); doc.Add(field); List<string> terms = new List<string>(); int num = AtLeast(200); for (int i = 0; i < num; i++) { string s = TestUtil.RandomUnicodeString(Random); field.SetStringValue(s); terms.Add(s); writer.AddDocument(doc); } if (Verbose) { // utf16 order terms.Sort(); Console.WriteLine("UTF16 order:"); foreach (string s in terms) { Console.WriteLine(" " + UnicodeUtil.ToHexString(s)); } } reader = writer.GetReader(); searcher1 = NewSearcher(reader); searcher2 = NewSearcher(reader); writer.Dispose(); } [TearDown] public override void TearDown() { reader.Dispose(); dir.Dispose(); base.TearDown(); } /// <summary> /// a stupid regexp query that just blasts thru the terms </summary> private class DumbRegexpQuery : MultiTermQuery { private readonly Automaton automaton; internal DumbRegexpQuery(Term term, RegExpSyntax flags) : base(term.Field) { RegExp re = new RegExp(term.Text, flags); automaton = re.ToAutomaton(); } protected override TermsEnum GetTermsEnum(Terms terms, AttributeSource atts) { return new SimpleAutomatonTermsEnum(this, terms.GetEnumerator()); } private sealed class SimpleAutomatonTermsEnum : FilteredTermsEnum { private readonly TestRegexpRandom2.DumbRegexpQuery outerInstance; private CharacterRunAutomaton runAutomaton; private readonly CharsRef utf16 = new CharsRef(10); internal SimpleAutomatonTermsEnum(TestRegexpRandom2.DumbRegexpQuery outerInstance, TermsEnum tenum) : base(tenum) { this.outerInstance = outerInstance; runAutomaton = new CharacterRunAutomaton(outerInstance.automaton); SetInitialSeekTerm(new BytesRef("")); } protected override AcceptStatus Accept(BytesRef term) { UnicodeUtil.UTF8toUTF16(term.Bytes, term.Offset, term.Length, utf16); return runAutomaton.Run(utf16.Chars, 0, utf16.Length) ? AcceptStatus.YES : AcceptStatus.NO; } } public override string ToString(string field) { return field.ToString() + automaton.ToString(); } } /// <summary> /// test a bunch of random regular expressions </summary> [Test] public virtual void TestRegexps() { // we generate aweful regexps: good for testing. // but for preflex codec, the test can be very slow, so use less iterations. int num = Codec.Default.Name.Equals("Lucene3x", StringComparison.Ordinal) ? 100 * RandomMultiplier : AtLeast(1000); for (int i = 0; i < num; i++) { string reg = AutomatonTestUtil.RandomRegexp(Random); if (Verbose) { Console.WriteLine("TEST: regexp=" + reg); } AssertSame(reg); } } /// <summary> /// check that the # of hits is the same as from a very /// simple regexpquery implementation. /// </summary> protected internal virtual void AssertSame(string regexp) { RegexpQuery smart = new RegexpQuery(new Term(fieldName, regexp), RegExpSyntax.NONE); DumbRegexpQuery dumb = new DumbRegexpQuery(new Term(fieldName, regexp), RegExpSyntax.NONE); TopDocs smartDocs = searcher1.Search(smart, 25); TopDocs dumbDocs = searcher2.Search(dumb, 25); CheckHits.CheckEqual(smart, smartDocs.ScoreDocs, dumbDocs.ScoreDocs); } } }
NightOwl888/lucenenet
src/Lucene.Net.Tests/Search/TestRegexpRandom2.cs
C#
apache-2.0
7,611
#include <QtGui/QApplication> #include "GameUI.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); GameUI w(QString("XO4"), QSize(256, 256)); w.show(); return a.exec(); }
Dovgalyuk/AIBattle
XO4/Visualizer.cpp
C++
apache-2.0
193
# V1ExecAction ExecAction describes a \"run in container\" action. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **command** | **list[str]** | Command is the command line to execute inside the container, the working directory for the command is root (&#39;/&#39;) in the container&#39;s filesystem. The command is simply exec&#39;d, it is not run inside a shell, so traditional shell instructions (&#39;|&#39;, etc) won&#39;t work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
kubernetes-client/python
kubernetes/docs/V1ExecAction.md
Markdown
apache-2.0
810
/* Copyright (c) 2012 BDT Media Automation GmbH * * 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. * * ScheduleTask.h * * Created on: Jul 23, 2012 * Author: More Zeng */ #pragma once class ScheduleTask { public: ScheduleTask( ScheduleInterface * schedule, const string & tape, int timeout, int priority, int duration); virtual ~ScheduleTask(); void Start(); void RunTask(); bool Finished(); boost::posix_time::ptime Begin(); boost::posix_time::ptime End(); private: ScheduleInterface * schedule_; string tape_; int timeout_; int priority_; auto_ptr<boost::thread> thread_; int duration_; bool finished_; boost::posix_time::ptime begin_; boost::posix_time::ptime end_; };
BDT-GER/SWIFT-TLC
source/Server/tlc-server/bdt/test/ScheduleTask.h
C
apache-2.0
1,351
'use strict' // ** Constants const DEFAULT_HOST = 'localhost'; const DEFAULT_PORT = 8080; // ** Dependencies const WebSocket = require('ws'); // ** Libraries const Service = require('../../lib/Service'); // ** Platform const logger = require('nodus-framework').logging.createLogger(); function logEvents() { var socket = new WebSocket('ws://localhost:3333/'); socket.on('open', function open() { console.log('connected'); socket.send(Date.now().toString(), {mask: true}); }); socket.on('close', function close() { console.log('disconnected'); }); socket.on('message', function message(data, flags) { console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags); setTimeout(function timeout() { socket.send(Date.now().toString(), {mask: true}); }, 500); }); return socket; } // ** Exports module.exports = logEvents;
bradserbu/nodus-server
examples/console/console.js
JavaScript
apache-2.0
935
/** @file Connection_uLimeSDREntry.cpp @author Lime Microsystems @brief Implementation of uLimeSDR board connection. */ #include "ConnectionFT601.h" #include "Logger.h" using namespace lime; #ifdef __unix__ void ConnectionFT601Entry::handle_libusb_events() { struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 250000; while(mProcessUSBEvents.load() == true) { int r = libusb_handle_events_timeout_completed(ctx, &tv, NULL); if(r != 0) lime::error("error libusb_handle_events %s", libusb_strerror(libusb_error(r))); } } #endif // __UNIX__ //! make a static-initialized entry in the registry void __loadConnectionFT601Entry(void) //TODO fixme replace with LoadLibrary/dlopen { static ConnectionFT601Entry FTDIEntry; } ConnectionFT601Entry::ConnectionFT601Entry(void): ConnectionRegistryEntry("FT601") { #ifndef __unix__ //m_pDriver = new CDriverInterface(); #else int r = libusb_init(&ctx); //initialize the library for the session we just declared if(r < 0) lime::error("Init Error %i", r); //there was an error libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation mProcessUSBEvents.store(true); mUSBProcessingThread = std::thread(&ConnectionFT601Entry::handle_libusb_events, this); #endif } ConnectionFT601Entry::~ConnectionFT601Entry(void) { #ifndef __unix__ //delete m_pDriver; #else mProcessUSBEvents.store(false); mUSBProcessingThread.join(); libusb_exit(ctx); #endif } std::vector<ConnectionHandle> ConnectionFT601Entry::enumerate(const ConnectionHandle &hint) { std::vector<ConnectionHandle> handles; #ifndef __unix__ FT_STATUS ftStatus=FT_OK; static DWORD numDevs = 0; ftStatus = FT_CreateDeviceInfoList(&numDevs); if (!FT_FAILED(ftStatus) && numDevs > 0) { DWORD Flags = 0; char SerialNumber[16] = { 0 }; char Description[32] = { 0 }; for (DWORD i = 0; i < numDevs; i++) { ftStatus = FT_GetDeviceInfoDetail(i, &Flags, nullptr, nullptr, nullptr, SerialNumber, Description, nullptr); if (!FT_FAILED(ftStatus)) { ConnectionHandle handle; handle.media = Flags & FT_FLAGS_SUPERSPEED ? "USB 3" : Flags & FT_FLAGS_HISPEED ? "USB 2" : "USB"; handle.name = Description; handle.index = i; handle.serial = SerialNumber; handles.push_back(handle); } } } #else libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices int usbDeviceCount = libusb_get_device_list(ctx, &devs); if (usbDeviceCount < 0) { lime::error("failed to get libusb device list: %s", libusb_strerror(libusb_error(usbDeviceCount))); return handles; } libusb_device_descriptor desc; for(int i=0; i<usbDeviceCount; ++i) { int r = libusb_get_device_descriptor(devs[i], &desc); if(r<0) lime::error("failed to get device description"); int pid = desc.idProduct; int vid = desc.idVendor; if( vid == 0x0403) { if(pid == 0x601F) { libusb_device_handle *tempDev_handle(nullptr); if(libusb_open(devs[i], &tempDev_handle) != 0 || tempDev_handle == nullptr) continue; ConnectionHandle handle; //check operating speed int speed = libusb_get_device_speed(devs[i]); if(speed == LIBUSB_SPEED_HIGH) handle.media = "USB 2.0"; else if(speed == LIBUSB_SPEED_SUPER) handle.media = "USB 3.0"; else handle.media = "USB"; //read device name char data[255]; memset(data, 0, 255); int st = libusb_get_string_descriptor_ascii(tempDev_handle, LIBUSB_CLASS_COMM, (unsigned char*)data, 255); if(st < 0) lime::error("Error getting usb descriptor"); else handle.name = std::string(data, size_t(st)); handle.addr = std::to_string(int(pid))+":"+std::to_string(int(vid)); if (desc.iSerialNumber > 0) { r = libusb_get_string_descriptor_ascii(tempDev_handle,desc.iSerialNumber,(unsigned char*)data, sizeof(data)); if(r<0) lime::error("failed to get serial number"); else handle.serial = std::string(data, size_t(r)); } libusb_close(tempDev_handle); //add handle conditionally, filter by serial number if (hint.serial.empty() or hint.serial == handle.serial) { handles.push_back(handle); } } } } libusb_free_device_list(devs, 1); #endif return handles; } IConnection *ConnectionFT601Entry::make(const ConnectionHandle &handle) { #ifndef __unix__ return new ConnectionFT601(mFTHandle, handle); #else return new ConnectionFT601(ctx, handle); #endif }
romeojulietthotel/LimeSuite
src/ConnectionFTDI/ConnectionFT601Entry.cpp
C++
apache-2.0
5,428
/****************************************************************************** * PROJECT: Network comms library * * MODULE: nw_comms.c * * PURPOSE: Header file for nw_comms.c * * AUTHOR: Paul M. Breen * * DATE: 2000-06-28 * ******************************************************************************/ #ifndef __NW_COMMS_H #define __NW_COMMS_H #include <sys/types.h> #include <sys/socket.h> #include <stdio.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #include <netdb.h> #include <string.h> #include <sys/time.h> #include <sys/ioctl.h> #include <signal.h> /****************************************************************************** * Defines * ******************************************************************************/ #define NW_COMMS_TMO_SECS 15 #define NW_COMMS_TMO_USECS 0 /****************************************************************************** * Function prototypes * ******************************************************************************/ /****************************************************************************** * Function to open a TCP/IP client socket connection * * * * Pre-condition: The server host name (or IP address) and port number are * * passed to the function * * Post-condition: Socket connection is established with server, socket file * * descriptor is returned or -1 on error * ******************************************************************************/ int open_client_socket(char *host, unsigned short int port); /****************************************************************************** * Function to open a TCP/IP server socket connection * * * * Pre-condition: The server host name (or IP address) and port number are * * passed to the function * * Post-condition: Socket is bound to the server address, socket file * * descriptor is returned or -1 on error * ******************************************************************************/ int open_server_socket(char *host, unsigned short int port); /****************************************************************************** * Function to connect client to network server socket * * * * Pre-condition: A valid server host info struct and server port are passed * * to the function * * Post-condition: A connected socket file descriptor to the server or a -1 on * * error is returned * ******************************************************************************/ int create_client_network_socket(struct hostent *hostinfo, unsigned short int port); /****************************************************************************** * Function to create and name a network server socket * * * * Pre-condition: A valid server host info struct and server port are passed * * to the function * * Post-condition: A named socket file descriptor for the server or a -1 on * * error is returned * ******************************************************************************/ int create_server_network_socket(struct hostent *hostinfo, unsigned short int port); /****************************************************************************** * Function to display host information on stdout * * * * Pre-condition: Host info struct is passed to the function * * Post-condition: Contents of the host info struct are displayed on stdout * ******************************************************************************/ void display_hostinfo(struct hostent *hostinfo); /****************************************************************************** * Function to read data on a particular socket fd * * * * Pre-condition: Socket fd, a valid buffer, and the length to read are * * passed to the function * * Post-condition: Data is stored in buffer, and the number of bytes read is * * returned or -1 on error * ******************************************************************************/ int socket_read(int fd, unsigned char *buf, long int len); /****************************************************************************** * Function to write data on a particular socket fd * * * * Pre-condition: Socket fd, a valid buffer, and the length to write are * * passed to the function * * Post-condition: Data from buffer is written on the socket, and the number * * of bytes written is returned or -1 on error * ******************************************************************************/ int socket_write(int fd, unsigned char *buf, long int len); #endif
paul-breen/plc-data-server
include/nw_comms.h
C
apache-2.0
6,245
# Cirsium rosenii Vill. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Cirsium/Cirsium acaulon/ Syn. Cirsium rosenii/README.md
Markdown
apache-2.0
178
package spec import com.googlecode.instinct.locate.ContextFinderImpl import com.googlecode.instinct.runner.TextRunner import java.io.File object SpecificationRunner { private lazy val contextFinder = new ContextFinderImpl(SpecificationRunner.getClass) def main(args: Array[String]) { val classes = contextFinder.getContextNames().map(name => Class.forName(name.getFullyQualifiedName)) TextRunner.runContexts(classes: _*) } }
tomjadams/geoscala
src/spec/scala/spec/SpecificationRunner.scala
Scala
apache-2.0
442
from ajenti.api import * from ajenti.plugins import * info = PluginInfo( title='Resource Manager', icon='link', dependencies=[ ], ) def init(): import server
lupyuen/RaspberryPiImage
usr/share/pyshared/ajenti/plugins/resources/__init__.py
Python
apache-2.0
182
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=type.N403.html"> </head> <body> <p>Redirecting to <a href="type.N403.html">type.N403.html</a>...</p> <script>location.replace("type.N403.html" + location.search + location.hash);</script> </body> </html>
nitro-devs/nitro-game-engine
docs/typenum/consts/N403.t.html
HTML
apache-2.0
297
import Ember from 'ember'; /** * @module ember-osf * @submodule mixins */ /** * Controller mixin that implements common actions performed on nodes. * @class NodeActionsMixin * @extends Ember.Mixin */ export default Ember.Mixin.create({ /** * The node to perform these actions on. If not specified, defaults to the model hook. * @property node * @type DS.Model */ node: null, model: null, _node: Ember.computed.or('node', 'model'), /** * Helper method that affiliates an institution with a node. * * @method _affiliateNode * @private * @param {DS.Model} node Node record * @param {Object} institution Institution record * @return {Promise} Returns a promise that resolves to the updated node with the newly created institution relationship */ _affiliateNode(node, institution) { node.get('affiliatedInstitutions').pushObject(institution); return node.save(); }, actions: { /** * Update a node * * @method updateNode * @param {String} title New title of the node * @param {String} description New Description of the node * @param {String} category New node category * @param {Boolean} isPublic Should this node be publicly-visible? * @return {Promise} Returns a promise that resolves to the updated node */ updateNode(title, description, category, isPublic) { var node = this.get('_node'); if (title) { node.set('title', title); } if (category) { node.set('category', category); } if (description) { node.set('description', description); } if (isPublic !== null) { node.set('public', isPublic); } return node.save(); }, /** * Delete a node * * @method deleteNode * @return {Promise} Returns a promise that resolves after the deletion of the node. */ deleteNode() { var node = this.get('_node'); return node.destroyRecord(); }, /** * Affiliate a node with an institution * * @method affiliateNode * @param {String} institutionId ID of the institutution to be affiliated * @return {Promise} Returns a promise that resolves to the updated node * with the newly affiliated institution relationship */ affiliateNode(institutionId) { var node = this.get('_node'); return this.store.findRecord('institution', institutionId) .then(institution => this._affiliateNode(node, institution)); }, /** * Unaffiliate a node with an institution * * @method unaffiliateNode * @param {Object} institution Institution relationship to be removed from node * @return {Promise} Returns a promise that resolves to the updated node * with the affiliated institution relationship removed. */ unaffiliateNode(institution) { var node = this.get('_node'); node.get('affiliatedInstitutions').removeObject(institution); return node.save(); }, /** * Add a contributor to a node * * @method addContributor * @param {String} userId ID of user that will be a contributor on the node * @param {String} permission User permission level. One of "read", "write", or "admin". Default: "write". * @param {Boolean} isBibliographic Whether user will be included in citations for the node. "default: true" * @param {Boolean} sendEmail Whether user will receive an email when added. "default: true" * @return {Promise} Returns a promise that resolves to the newly created contributor object. */ addContributor(userId, permission, isBibliographic, sendEmail) { // jshint ignore:line return this.get('_node').addContributor(...arguments); }, /** * Bulk add contributors to a node * * @method addContributors * @param {Array} contributors Array of objects containing contributor permission, bibliographic, and userId keys * @param {Boolean} sendEmail Whether user will receive an email when added. "default: true" * @return {Promise} Returns a promise that resolves to an array of added contributors */ addContributors(contributors, sendEmail) { // jshint ignore:line return this.get('_node').addContributors(...arguments); }, /** * Remove a contributor from a node * * @method removeContributor * @param {Object} contributor Contributor relationship that will be removed from node * @return {Promise} Returns a promise that will resolve upon contributor deletion. * User itself will not be removed. */ removeContributor(contributor) { var node = this.get('_node'); return node.removeContributor(contributor); }, /** * Update contributors of a node. Makes a bulk request to the APIv2. * * @method updateContributors * @param {Contributor[]} contributors Contributor relationships on the node. * @param {Object} permissionsChanges Dictionary mapping contributor ids to desired permissions. * @param {Object} bibliographicChanges Dictionary mapping contributor ids to desired bibliographic statuses * @return {Promise} Returns a promise that resolves to the updated node * with edited contributor relationships. */ updateContributors(contributors, permissionsChanges, bibliographicChanges) { // jshint ignore:line return this.get('_node').updateContributors(...arguments); }, /** * Update contributors of a node. Makes a bulk request to the APIv2. * * @method updateContributor * @param {Contributor} contributor relationship on the node. * @param {string} permissions desired permissions. * @param {boolean} bibliographic desired bibliographic statuses * @return {Promise} Returns a promise that resolves to the updated node * with edited contributor relationships. */ updateContributor(contributor, permissions, bibliographic) { // jshint ignore:line return this.get('_node').updateContributor(...arguments); }, /** * Reorder contributors on a node, and manually updates store. * * @method reorderContributors * @param {Object} contributor Contributor record to be modified * @param {Integer} newIndex Contributor's new position in the list * @param {Array} contributors New contributor list in correct order * @return {Promise} Returns a promise that resolves to the updated contributor. */ reorderContributors(contributor, newIndex, contributors) { contributor.set('index', newIndex); return contributor.save().then(() => { contributors.forEach((contrib, index) => { if (contrib.id !== contributor.id) { var payload = contrib.serialize(); payload.data.attributes = { permission: contrib.get('permission'), bibliographic: contrib.get('bibliographic'), index: index }; payload.data.id = contrib.get('id'); this.store.pushPayload(payload); } }); }); }, /** * Add a child (component) to a node. * * @method addChild * @param {String} title Title for the child * @param {String} description Description for the child * @param {String} category Category for the child * @return {Promise} Returns a promise that resolves to the newly created child node. */ addChild(title, description, category) { return this.get('_node').addChild(title, description, category); }, /** * Add a node link (pointer) to another node * * @method addNodeLink * @param {String} targetNodeId ID of the node for which you wish to create a pointer * @return {Promise} Returns a promise that resolves to model for the newly created NodeLink */ addNodeLink(targetNodeId) { var node = this.get('_node'); var nodeLink = this.store.createRecord('node-link', { target: targetNodeId }); node.get('nodeLinks').pushObject(nodeLink); return node.save().then(() => nodeLink); }, /** * Remove a node link (pointer) to another node * * @method removeNodeLink * @param {Object} nodeLink nodeLink record to be destroyed. * @return {Promise} Returns a promise that resolves after the node link has been removed. This does not delete * the target node itself. */ removeNodeLink(nodeLink) { return nodeLink.destroyRecord(); } } });
pattisdr/ember-osf
addon/mixins/node-actions.js
JavaScript
apache-2.0
9,519
package act.app.event; /*- * #%L * ACT Framework * %% * Copyright (C) 2014 - 2017 ActFramework * %% * 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. * #L% */ import act.event.ActEventListener; public interface SysEventListener<EVENT_TYPE extends SysEvent> extends ActEventListener<EVENT_TYPE> { }
actframework/actframework
src/main/java/act/app/event/SysEventListener.java
Java
apache-2.0
816
/* * Copyright 2012 hbz NRW (http://www.hbz-nrw.de/) * * 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 de.nrw.hbz.regal.sync.ingest; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Vector; import javax.xml.XMLConstants; import javax.xml.namespace.NamespaceContext; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import models.ObjectType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import archive.fedora.XmlUtils; import de.nrw.hbz.regal.sync.extern.DigitalEntity; import de.nrw.hbz.regal.sync.extern.DigitalEntityBuilderInterface; import de.nrw.hbz.regal.sync.extern.DigitalEntityRelation; import de.nrw.hbz.regal.sync.extern.Md5Checksum; import de.nrw.hbz.regal.sync.extern.RelatedDigitalEntity; import de.nrw.hbz.regal.sync.extern.StreamType; /** * @author Jan Schnasse schnasse@hbz-nrw.de * */ public class EdowebDigitalEntityBuilder implements DigitalEntityBuilderInterface { final static Logger logger = LoggerFactory .getLogger(EdowebDigitalEntityBuilder.class); Map<String, DigitalEntity> filedIds2DigitalEntity = new HashMap<String, DigitalEntity>(); Map<String, String> groupIds2FileIds = new HashMap<String, String>(); Map<String, List<String>> idmap = new HashMap<String, List<String>>(); @Override public DigitalEntity build(String location, String pid) { DigitalEntity dtlDe = buildSimpleBean(location, pid); if (dtlDe.getStream(StreamType.STRUCT_MAP) != null) { logger.debug(pid + " is a mets object"); dtlDe = prepareMetsStructure(dtlDe); dtlDe = addSiblings(dtlDe); dtlDe = addChildren(dtlDe); } else { dtlDe = addSiblings(dtlDe); dtlDe = addDigitoolChildren(dtlDe); dtlDe = addChildren(dtlDe); } dtlDe = removeEmptyVolumes(dtlDe); return dtlDe; } private DigitalEntity removeEmptyVolumes(final DigitalEntity entity) { DigitalEntity dtlDe = entity; List<RelatedDigitalEntity> result = new Vector<RelatedDigitalEntity>(); List<RelatedDigitalEntity> related = entity.getRelated(); for (RelatedDigitalEntity d : related) { if (DigitalEntityRelation.part_of.toString().equals(d.relation)) { if (ObjectType.volume.toString() .equals(d.entity.getUsageType())) { if (d.entity.getRelated().isEmpty()) continue; } } result.add(d); } dtlDe.setRelated(result); return dtlDe; } DigitalEntity buildSimpleBean(String location, String pid) { DigitalEntity dtlDe = new DigitalEntity(location, pid); dtlDe.setXml(new File(dtlDe.getLocation() + File.separator + pid + ".xml")); Element root = getXmlRepresentation(dtlDe); dtlDe.setLabel(getLabel(root)); loadMetadataStreams(dtlDe, root); setType(dtlDe); dtlDe.setImportedFrom("http://klio.hbz-nrw.de:1801/webclient/DeliveryManager?pid=" + pid + "&custom_att_2=default_viewer"); dtlDe.setCreatedBy("digitool"); try { setCatalogId(dtlDe); logger.debug("p2a: " + pid + "," + dtlDe.getLegacyId()); } catch (CatalogIdNotFoundException e) { logger.debug(pid + "has no catalog id"); } loadDataStream(dtlDe, root); linkToParent(dtlDe); return dtlDe; } /** * Tries to find the catalog id (aleph) * * @param dtlDe * the digital entity */ void setCatalogId(DigitalEntity dtlDe) { try { Element root = XmlUtils.getDocument(dtlDe .getStream(StreamType.MARC).getFile()); XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); xpath.setNamespaceContext(new MarcNamespaceContext()); XPathExpression expr = xpath.compile("//controlfield[@tag='001']"); Object result = expr.evaluate(root, XPathConstants.NODESET); NodeList nodes = (NodeList) result; if (nodes.getLength() != 1) { throw new CatalogIdNotFoundException("Found " + nodes.getLength() + " ids"); } String id = nodes.item(0).getTextContent(); dtlDe.addIdentifier(id); dtlDe.setLegacyId(id); // logger.debug(dtlDe.getPid() + " add id " + id); } catch (Exception e) { throw new CatalogIdNotFoundException(e); } } private void setType(DigitalEntity dtlBean) { Element root = XmlUtils.getDocument(dtlBean.getStream( StreamType.CONTROL).getFile()); XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); try { XPathExpression expr = xpath.compile("//partition_c"); Object result = expr.evaluate(root, XPathConstants.NODESET); NodeList nodes = (NodeList) result; if (nodes.getLength() != 1) { throw new TypeNotFoundException("Found " + nodes.getLength() + " types"); } dtlBean.setType(nodes.item(0).getTextContent()); // logger.debug(dtlBean.getPid() + " setType to: " + // dtlBean.getType()); } catch (XPathExpressionException e) { throw new XPathException(e); } } private DigitalEntity prepareMetsStructure(final DigitalEntity entity) { DigitalEntity dtlDe = entity; dtlDe = createTree(entity); mapGroupIdsToFileIds(entity); return dtlDe; } private void mapGroupIdsToFileIds(DigitalEntity entity) { try { Element root = XmlUtils.getDocument(entity.getStream( StreamType.FILE_SEC).getFile()); XPathFactory xpathFactory = XPathFactory.newInstance(); XPath xpath = xpathFactory.newXPath(); NodeList volumes = (NodeList) xpath.evaluate("/*/*/*/*/*", root, XPathConstants.NODESET); for (int i = 0; i < volumes.getLength(); i++) { Element item = (Element) volumes.item(i); String groupId = item.getAttribute("GROUPID"); String fileId = item.getAttribute("ID"); // logger.debug(groupId + " to " + fileId); groupIds2FileIds.put(groupId, fileId); } } catch (XPathExpressionException e) { logger.warn("", e); } catch (Exception e) { logger.debug("", e); } } // private String normalizeLabel(final String volumeLabel) { // // String[] parts = volumeLabel.split("\\s|-"); // String camelCaseString = ""; // for (String part : parts) { // camelCaseString = camelCaseString + toProperCase(part); // } // return camelCaseString.replace(":", "-").replace("/", "-"); // } // // String toProperCase(String s) { // return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); // } private DigitalEntity createTree(final DigitalEntity entity) { DigitalEntity dtlDe = entity; try { Element root = XmlUtils.getDocument(entity.getStream( StreamType.STRUCT_MAP).getFile()); List<Element> firstLevel = XmlUtils.getElements("/*/*/*/*/*", root, null); logger.debug("create volumes for: " + entity.getPid()); for (Element firstLevelElement : firstLevel) { DigitalEntity v = createDigitalEntity(ObjectType.volume, firstLevelElement.getAttribute("LABEL"), dtlDe.getPid(), dtlDe.getLocation()); v.setOrder(firstLevelElement.getAttribute("ORDER")); dtlDe.addRelated(v, DigitalEntityRelation.part_of.toString()); logger.debug("Create volume " + v.getPid()); List<Element> issues = XmlUtils.getElements("./div", firstLevelElement, null); if (issues == null || issues.isEmpty()) { v.setUsageType(ObjectType.rootElement.toString()); mapFileIdToDigitalEntity(v, firstLevelElement); } else { for (Element issue : issues) { DigitalEntity i = createDigitalEntity( ObjectType.rootElement, issue.getAttribute("LABEL"), v.getPid(), dtlDe.getLocation()); i.setOrder(firstLevelElement.getAttribute("ORDER")); logger.debug("Create issue " + i.getPid()); v.addRelated(i, DigitalEntityRelation.part_of.toString()); mapFileIdToDigitalEntity(i, issue); } } } } catch (XPathException e) { logger.warn(entity.getPid() + " no volumes found."); } catch (Exception e) { logger.debug("", e); } return dtlDe; } private void mapFileIdToDigitalEntity(DigitalEntity de, Element root) { final String regex = ".//fptr"; List<Element> files = XmlUtils.getElements(regex, root, null); for (Element f : files) { String fileId = f.getAttribute("FILEID"); logger.debug("Key: " + fileId + " Value: " + de.getPid()); filedIds2DigitalEntity.put(fileId, de); } } private DigitalEntity createDigitalEntity(ObjectType type, String label, String parentPid, String location) { String prefix = parentPid; String pid = prefix + "-" + getId(prefix); DigitalEntity entity = new DigitalEntity(location + File.separator + pid, pid); entity.setLabel(label); entity.setParentPid(parentPid); entity.setUsageType(type.toString()); return entity; } private String getId(String prefix) { List<String> ids = null; if (idmap.containsKey(prefix)) { ids = idmap.get(prefix); } else { ids = new ArrayList<String>(); } if (ids.size() >= Integer.MAX_VALUE) { throw new java.lang.ArrayIndexOutOfBoundsException( "We have serious problem here!"); } String id = Integer.toString(ids.size()); ids.add(id); idmap.put(prefix, ids); return id; } private void loadDataStream(DigitalEntity dtlDe, Element root) { Node streamRef = root.getElementsByTagName("stream_ref").item(0); String filename = ((Element) streamRef) .getElementsByTagName("file_name").item(0).getTextContent(); File file = new File(dtlDe.getLocation() + File.separator + dtlDe.getPid() + File.separator + filename); String mime = ((Element) streamRef).getElementsByTagName("mime_type") .item(0).getTextContent(); String fileId = ((Element) streamRef).getElementsByTagName("file_id") .item(0).getTextContent(); if (!file.exists()) { logger.error("The file " + filename + " found in DTL Xml does not exist."); return; } logger.debug("found data stream " + file + "," + mime + "," + StreamType.DATA + "," + fileId); dtlDe.setLabel(root.getElementsByTagName("label").item(0) .getTextContent()); dtlDe.addStream(file, mime, StreamType.DATA, fileId, getMd5(file)); } private void loadMetadataStreams(DigitalEntity dtlDe, Element root) { setXmlStream(dtlDe, root.getElementsByTagName("control").item(0), StreamType.CONTROL); dtlDe.setUsageType(root.getElementsByTagName("usage_type").item(0) .getTextContent()); NodeList list = root.getElementsByTagName("md"); for (int i = 0; i < list.getLength(); i++) { Node item = list.item(i); String type = getItemType((Element) item); if (type.compareTo("dc") == 0) { setXmlStream(dtlDe, item, StreamType.DC); } else if (type.compareTo("preservation_md") == 0) { setXmlStream(dtlDe, item, StreamType.PREMIS); } else if (type.compareTo("text_md") == 0) { setXmlStream(dtlDe, item, StreamType.TEXT); } else if (type.compareTo("rights_md") == 0) { setXmlStream(dtlDe, item, StreamType.RIGHTS); } else if (type.compareTo("jhove") == 0) { setXmlStream(dtlDe, item, StreamType.JHOVE); } else if (type.compareTo("changehistory_md") == 0) { setXmlStream(dtlDe, item, StreamType.HIST); } else if (type.compareTo("marc") == 0) { setMarcStream(dtlDe, item, StreamType.MARC); } else if (type.compareTo("metsHdr") == 0) { setXmlStream(dtlDe, item, StreamType.METS_HDR); } else if (type.compareTo("structMap") == 0) { setXmlStream(dtlDe, item, StreamType.STRUCT_MAP); } else if (type.compareTo("fileSec") == 0) { setXmlStream(dtlDe, item, StreamType.FILE_SEC); } } } @SuppressWarnings("deprecation") private void setXmlStream(DigitalEntity dtlDe, Node item, StreamType type) { try { File file = new File(dtlDe.getLocation() + File.separator + "." + dtlDe.getPid() + "_" + type.toString() + ".xml"); File stream = XmlUtils.stringToFile(file, XmlUtils.nodeToString(item)); String md5Hash = getMd5(stream); dtlDe.addStream(stream, "application/xml", type, null, md5Hash); } catch (Exception e) { e.printStackTrace(); } } @SuppressWarnings("deprecation") private void setMarcStream(DigitalEntity dtlDe, Node item, StreamType type) { try { File file = new File(dtlDe.getLocation() + File.separator + "." + dtlDe.getPid() + "_" + type.toString() + ".xml"); File stream = XmlUtils.stringToFile(file, getMarc(item)); String md5Hash = getMd5(stream); dtlDe.addStream(stream, "application/xml", type, null, md5Hash); } catch (Exception e) { e.printStackTrace(); } } private String getMd5(File stream) { Md5Checksum md5 = new Md5Checksum(); return md5.getMd5Checksum(stream); } private String getMarc(Node item) { Element marc = (Element) ((Element) item) .getElementsByTagName("record").item(0); marc.setAttribute("xmlns", "http://www.loc.gov/MARC21/slim"); String xmlStr = XmlUtils.nodeToString(marc); xmlStr = xmlStr.replaceAll("nam 2200000 u 4500", "00000 a2200000 4500"); return xmlStr; } private String getItemType(Element root) { return root.getElementsByTagName("type").item(0).getTextContent(); } private String getLabel(Element root) { List<Element> list = XmlUtils.getElements( "//datafield[@tag='245']/subfield[@code='a']", root, null); if (list != null && !list.isEmpty()) { return list.get(0).getTextContent(); } else { return root.getElementsByTagName("label").item(0).getTextContent(); } } private Element getXmlRepresentation(final DigitalEntity dtlDe) { File digitalEntityFile = new File(dtlDe.getLocation() + File.separator + dtlDe.getPid() + ".xml"); return XmlUtils.getDocument(digitalEntityFile); } private DigitalEntity addSiblings(final DigitalEntity entity) { DigitalEntity dtlDe = entity; Element root; try { root = XmlUtils.getDocument(entity.getXml()); NodeList list = root.getElementsByTagName("relation"); for (int i = 0; i < list.getLength(); i++) { Node item = list.item(i); String relPid = ((Element) item).getElementsByTagName("pid") .item(0).getTextContent(); String usageType = ((Element) item) .getElementsByTagName("usage_type").item(0) .getTextContent(); String type = ((Element) item).getElementsByTagName("type") .item(0).getTextContent(); if (type.compareTo(DigitalEntityRelation.manifestation .toString()) == 0) { DigitalEntity b = buildSimpleBean(entity.getLocation(), relPid); logger.debug("Add sibling " + b.getPid() + " to " + entity.getPid() + " utilizing relation " + usageType); dtlDe.addRelated(b, usageType); } } } catch (Exception e) { logger.warn("", e); } return dtlDe; } private DigitalEntity addChildren(final DigitalEntity entity) { DigitalEntity dtlDe = entity; try { Element root = XmlUtils.getDocument(entity.getXml()); NodeList list = root.getElementsByTagName("relation"); for (int i = 0; i < list.getLength(); i++) { Node item = list.item(i); String relPid = ((Element) item).getElementsByTagName("pid") .item(0).getTextContent(); String usageType = ((Element) item) .getElementsByTagName("usage_type").item(0) .getTextContent(); String type = ((Element) item).getElementsByTagName("type") .item(0).getTextContent(); String mimeType = ((Element) item) .getElementsByTagName("mime_type").item(0) .getTextContent(); if (type.compareTo(DigitalEntityRelation.include.toString()) == 0 && mimeType.equals("application/pdf") && (usageType.compareTo(DigitalEntityRelation.ARCHIVE .toString()) != 0)) { try { DigitalEntity b = build(entity.getLocation(), relPid); b.setUsageType(usageType); addToTree(dtlDe, b); } catch (Exception e) { e.printStackTrace(); } } else if (type.compareTo(DigitalEntityRelation.include .toString()) == 0 && mimeType.equals("application/zip") && (usageType.compareTo(DigitalEntityRelation.VIEW .toString()) != 0)) { try { DigitalEntity b = build(entity.getLocation(), relPid); b.setUsageType(usageType); addToTree(dtlDe, b); } catch (Exception e) { e.printStackTrace(); } } } } catch (Exception e) { logger.warn("", e); } return dtlDe; } private DigitalEntity addDigitoolChildren(final DigitalEntity entity) { DigitalEntity dtlDe = entity; try { Element root = XmlUtils.getDocument(entity.getXml()); NodeList list = root.getElementsByTagName("relation"); for (int i = 0; i < list.getLength(); i++) { Node item = list.item(i); String relPid = ((Element) item).getElementsByTagName("pid") .item(0).getTextContent(); String usageType = ((Element) item) .getElementsByTagName("usage_type").item(0) .getTextContent(); String type = ((Element) item).getElementsByTagName("type") .item(0).getTextContent(); String mimeType = ((Element) item) .getElementsByTagName("mime_type").item(0) .getTextContent(); if (type.compareTo(DigitalEntityRelation.include.toString()) == 0 && mimeType.equals("application/pdf") && (usageType.compareTo(DigitalEntityRelation.ARCHIVE .toString()) != 0)) { try { DigitalEntity b = build(entity.getLocation(), relPid); // logger.debug(b.getPid() + " is child of " // + dtlDe.getPid()); b.setUsageType(usageType); dtlDe.setIsParent(true); b.setParentPid(dtlDe.getPid()); dtlDe.addRelated(b, DigitalEntityRelation.part_of.toString()); } catch (Exception e) { e.printStackTrace(); } } } } catch (Exception e) { logger.warn("", e); } return dtlDe; } private void linkToParent(DigitalEntity dtlDe) { try { Element root = XmlUtils.getDocument(dtlDe.getXml()); NodeList list = root.getElementsByTagName("relation"); for (int i = 0; i < list.getLength(); i++) { Node item = list.item(i); String relPid = ((Element) item).getElementsByTagName("pid") .item(0).getTextContent(); String type = ((Element) item).getElementsByTagName("type") .item(0).getTextContent(); if (type.compareTo(DigitalEntityRelation.part_of.toString()) == 0) { dtlDe.setIsParent(false); dtlDe.setParentPid(relPid); } } } catch (Exception e) { logger.warn("", e); } } private void addToTree(DigitalEntity dtlDe, DigitalEntity related) { DigitalEntity parent = findParent(dtlDe, related); if (parent == null) { logger.info(related.getPid() + " is not longer part of tree."); return; } parent.setIsParent(true); related.setParentPid(parent.getPid()); parent.addRelated(related, DigitalEntityRelation.part_of.toString()); logger.debug(related.getPid() + " is child of " + parent.getPid()); } private DigitalEntity findParent(DigitalEntity dtlDe, DigitalEntity related) { if (!(related.getUsageType().compareTo("VIEW") == 0) && !(related.getUsageType().compareTo("VIEW_MAIN") == 0)) { System.out.println("Related of wrong type: " + related.getPid()); return dtlDe; } String groupId = related.getStream(StreamType.DATA).getFileId(); String fileId = groupIds2FileIds.get(groupId); DigitalEntity parent = this.filedIds2DigitalEntity.get(fileId); if (parent != null) { related.setUsageType(ObjectType.file.toString()); } return parent; } @SuppressWarnings("javadoc") public class MarcNamespaceContext implements NamespaceContext { public String getNamespaceURI(String prefix) { if (prefix == null) throw new NullPointerException("Null prefix"); else if ("marc".equals(prefix)) return "http://www.loc.gov/MARC21/slim"; else if ("xml".equals(prefix)) return XMLConstants.XML_NS_URI; return XMLConstants.NULL_NS_URI; } // This method isn't necessary for XPath processing. public String getPrefix(String uri) { throw new UnsupportedOperationException(); } // This method isn't necessary for XPath processing either. @SuppressWarnings("rawtypes") public Iterator getPrefixes(String uri) { throw new UnsupportedOperationException(); } } @SuppressWarnings({ "javadoc", "serial" }) public class TypeNotFoundException extends RuntimeException { public TypeNotFoundException(String message) { super(message); } } @SuppressWarnings({ "javadoc", "serial" }) public class CatalogIdNotFoundException extends RuntimeException { public CatalogIdNotFoundException(String message) { super(message); } public CatalogIdNotFoundException(Throwable cause) { super(cause); } } @SuppressWarnings({ "javadoc", "serial" }) public class XPathException extends RuntimeException { public XPathException(Throwable cause) { super(cause); } public XPathException(String message, Throwable cause) { super(message, cause); } } }
edoweb/regal-import
edoweb-sync/src/main/java/de/nrw/hbz/regal/sync/ingest/EdowebDigitalEntityBuilder.java
Java
apache-2.0
21,427
/* * Copyright 2007-2020 the original author or 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 net.ymate.platform.configuration.annotation; import net.ymate.platform.core.configuration.IConfigurationProvider; import org.apache.commons.lang3.StringUtils; import java.lang.annotation.*; /** * @author ๅˆ˜้•‡ (suninformation@163.com) on 2020/03/09 16:16 * @since 2.1.0 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface ConfigurationConf { /** * @return ้…็ฝฎไฝ“็ณปๆ น่ทฏๅพ„ */ String configHome() default StringUtils.EMPTY; /** * @return ้กน็›ฎๅ็งฐ */ String projectName() default StringUtils.EMPTY; /** * @return ๆจกๅ—ๅ็งฐ */ String moduleName() default StringUtils.EMPTY; /** * @return ้…็ฝฎๆ–‡ไปถๆฃ€ๆŸฅๆ—ถ้—ด้—ด้š”(ๆฏซ็ง’) */ long checkTimeInterval() default 0; /** * @return ้ป˜่ฎค้…็ฝฎๆ–‡ไปถๅˆ†ๆžๅ™จ */ Class<? extends IConfigurationProvider> providerClass() default IConfigurationProvider.class; }
suninformation/ymate-platform-v2
ymate-platform-configuration/src/main/java/net/ymate/platform/configuration/annotation/ConfigurationConf.java
Java
apache-2.0
1,590
/* * Copyright 2009-2015 Arsen Chaloyan * * 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. */ #include <stdlib.h> /* APR includes */ #include <apr_thread_cond.h> #include <apr_thread_proc.h> /* Common includes */ #include "unimrcp_client.h" #include "mrcp_application.h" #include "mrcp_message.h" #include "mrcp_generic_header.h" /* Recognizer includes */ #include "mrcp_recog_header.h" #include "mrcp_recog_resource.h" /* MPF includes */ #include <mpf_frame_buffer.h> /* APT includes */ #include "apt_nlsml_doc.h" #include "apt_log.h" #include "apt_pool.h" #include "asr_engine.h" typedef enum { INPUT_MODE_NONE, INPUT_MODE_FILE, INPUT_MODE_STREAM } input_mode_e; /** ASR engine on top of UniMRCP client stack */ struct asr_engine_t { /** MRCP client stack */ mrcp_client_t *mrcp_client; /** MRCP client stack */ mrcp_application_t *mrcp_app; /** Memory pool */ apr_pool_t *pool; }; /** ASR session on top of UniMRCP session/channel */ struct asr_session_t { /** Back pointer to engine */ asr_engine_t *engine; /** MRCP session */ mrcp_session_t *mrcp_session; /** MRCP channel */ mrcp_channel_t *mrcp_channel; /** RECOGNITION-COMPLETE message */ mrcp_message_t *recog_complete; /** Input mode (either file or stream) */ input_mode_e input_mode; /** File to read media frames from */ FILE *audio_in; /* Buffer of media frames */ mpf_frame_buffer_t *media_buffer; /** Streaming is in-progress */ apt_bool_t streaming; /** Conditional wait object */ apr_thread_cond_t *wait_object; /** Mutex of the wait object */ apr_thread_mutex_t *mutex; /** Message sent from client stack */ const mrcp_app_message_t *app_message; }; /** Declaration of recognizer audio stream methods */ static apt_bool_t asr_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame); static const mpf_audio_stream_vtable_t audio_stream_vtable = { NULL, NULL, NULL, asr_stream_read, NULL, NULL, NULL, NULL }; static apt_bool_t app_message_handler(const mrcp_app_message_t *app_message); /** Create ASR engine */ ASR_CLIENT_DECLARE(asr_engine_t*) asr_engine_create( const char *root_dir_path, apt_log_priority_e log_priority, apt_log_output_e log_output) { apr_pool_t *pool = NULL; apt_dir_layout_t *dir_layout; asr_engine_t *engine; mrcp_client_t *mrcp_client; mrcp_application_t *mrcp_app; /* create APR pool */ pool = apt_pool_create(); if(!pool) { return NULL; } /* create the structure of default directories layout */ dir_layout = apt_default_dir_layout_create(root_dir_path,pool); /* create singleton logger */ apt_log_instance_create(log_output,log_priority,pool); if((log_output & APT_LOG_OUTPUT_FILE) == APT_LOG_OUTPUT_FILE) { /* open the log file */ const char *log_dir_path = apt_dir_layout_path_get(dir_layout,APT_LAYOUT_LOG_DIR); apt_log_file_open(log_dir_path,"unimrcpclient",MAX_LOG_FILE_SIZE,MAX_LOG_FILE_COUNT,FALSE,pool); } engine = apr_palloc(pool,sizeof(asr_engine_t)); engine->pool = pool; engine->mrcp_client = NULL; engine->mrcp_app = NULL; /* create UniMRCP client stack */ mrcp_client = unimrcp_client_create(dir_layout); if(!mrcp_client) { apt_log_instance_destroy(); apr_pool_destroy(pool); return NULL; } /* create an application */ mrcp_app = mrcp_application_create( app_message_handler, engine, pool); if(!mrcp_app) { mrcp_client_destroy(mrcp_client); apt_log_instance_destroy(); apr_pool_destroy(pool); return NULL; } /* register application in client stack */ mrcp_client_application_register(mrcp_client,mrcp_app,"ASRAPP"); /* start client stack */ if(mrcp_client_start(mrcp_client) != TRUE) { mrcp_client_destroy(mrcp_client); apt_log_instance_destroy(); apr_pool_destroy(pool); return NULL; } engine->mrcp_client = mrcp_client; engine->mrcp_app = mrcp_app; return engine; } /** Destroy ASR engine */ ASR_CLIENT_DECLARE(apt_bool_t) asr_engine_destroy(asr_engine_t *engine) { if(engine->mrcp_client) { /* shutdown client stack */ mrcp_client_shutdown(engine->mrcp_client); /* destroy client stack */ mrcp_client_destroy(engine->mrcp_client); engine->mrcp_client = NULL; engine->mrcp_app = NULL; } /* destroy singleton logger */ apt_log_instance_destroy(); /* destroy APR pool */ apr_pool_destroy(engine->pool); return TRUE; } /** Destroy ASR session */ static apt_bool_t asr_session_destroy_ex(asr_session_t *asr_session, apt_bool_t terminate) { if(terminate == TRUE) { apr_thread_mutex_lock(asr_session->mutex); if(mrcp_application_session_terminate(asr_session->mrcp_session) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); /* the response must be checked to be the valid one */ } apr_thread_mutex_unlock(asr_session->mutex); } if(asr_session->audio_in) { fclose(asr_session->audio_in); asr_session->audio_in = NULL; } if(asr_session->mutex) { apr_thread_mutex_destroy(asr_session->mutex); asr_session->mutex = NULL; } if(asr_session->wait_object) { apr_thread_cond_destroy(asr_session->wait_object); asr_session->wait_object = NULL; } if(asr_session->media_buffer) { mpf_frame_buffer_destroy(asr_session->media_buffer); asr_session->media_buffer = NULL; } return mrcp_application_session_destroy(asr_session->mrcp_session); } /** Open audio input file */ static apt_bool_t asr_input_file_open(asr_session_t *asr_session, const char *input_file) { const apt_dir_layout_t *dir_layout = mrcp_application_dir_layout_get(asr_session->engine->mrcp_app); apr_pool_t *pool = mrcp_application_session_pool_get(asr_session->mrcp_session); char *input_file_path = apt_datadir_filepath_get(dir_layout,input_file,pool); if(!input_file_path) { return FALSE; } if(asr_session->audio_in) { fclose(asr_session->audio_in); asr_session->audio_in = NULL; } asr_session->audio_in = fopen(input_file_path,"rb"); if(!asr_session->audio_in) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Cannot Open [%s]",input_file_path); return FALSE; } return TRUE; } /** MPF callback to read audio frame */ static apt_bool_t asr_stream_read(mpf_audio_stream_t *stream, mpf_frame_t *frame) { asr_session_t *asr_session = stream->obj; if(asr_session && asr_session->streaming == TRUE) { if(asr_session->input_mode == INPUT_MODE_FILE) { if(asr_session->audio_in) { if(fread(frame->codec_frame.buffer,1,frame->codec_frame.size,asr_session->audio_in) == frame->codec_frame.size) { /* normal read */ frame->type |= MEDIA_FRAME_TYPE_AUDIO; } else { /* file is over */ asr_session->streaming = FALSE; } } } if(asr_session->input_mode == INPUT_MODE_STREAM) { if(asr_session->media_buffer) { mpf_frame_buffer_read(asr_session->media_buffer,frame); } } } return TRUE; } /** Create DEFINE-GRAMMAR request */ static mrcp_message_t* define_grammar_message_create(asr_session_t *asr_session, const char *grammar_file_name) { /* create MRCP message */ mrcp_message_t *mrcp_message = mrcp_application_message_create( asr_session->mrcp_session, asr_session->mrcp_channel, RECOGNIZER_DEFINE_GRAMMAR); if(mrcp_message) { mrcp_generic_header_t *generic_header; /* set message body */ const apt_dir_layout_t *dir_layout = mrcp_application_dir_layout_get(asr_session->engine->mrcp_app); apr_pool_t *pool = mrcp_application_session_pool_get(asr_session->mrcp_session); char *grammar_file_path = apt_datadir_filepath_get(dir_layout,grammar_file_name,pool); if(grammar_file_path) { apr_finfo_t finfo; apr_file_t *grammar_file; apt_str_t *content = &mrcp_message->body; if(apr_file_open(&grammar_file,grammar_file_path,APR_FOPEN_READ|APR_FOPEN_BINARY,0,pool) != APR_SUCCESS) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Open Grammar File %s",grammar_file_path); return NULL; } if(apr_file_info_get(&finfo,APR_FINFO_SIZE,grammar_file) != APR_SUCCESS) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Grammar File Info %s",grammar_file_path); apr_file_close(grammar_file); return NULL; } content->length = (apr_size_t)finfo.size; content->buf = (char*) apr_palloc(pool,content->length+1); apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Load Grammar File Content size [%"APR_SIZE_T_FMT" bytes] %s", content->length,grammar_file_path); if(apr_file_read(grammar_file,content->buf,&content->length) != APR_SUCCESS) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Read Grammar File Content %s",grammar_file_path); apr_file_close(grammar_file); return NULL; } content->buf[content->length] = '\0'; apr_file_close(grammar_file); } /* get/allocate generic header */ generic_header = mrcp_generic_header_prepare(mrcp_message); if(generic_header) { /* set generic header fields */ if(mrcp_message->start_line.version == MRCP_VERSION_2) { apt_string_assign(&generic_header->content_type,"application/srgs+xml",mrcp_message->pool); } else { apt_string_assign(&generic_header->content_type,"application/grammar+xml",mrcp_message->pool); } mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE); apt_string_assign(&generic_header->content_id,"demo-grammar",mrcp_message->pool); mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_ID); } } return mrcp_message; } /** Create RECOGNIZE request */ static mrcp_message_t* recognize_message_create(asr_session_t *asr_session) { /* create MRCP message */ mrcp_message_t *mrcp_message = mrcp_application_message_create( asr_session->mrcp_session, asr_session->mrcp_channel, RECOGNIZER_RECOGNIZE); if(mrcp_message) { mrcp_recog_header_t *recog_header; mrcp_generic_header_t *generic_header; /* get/allocate generic header */ generic_header = mrcp_generic_header_prepare(mrcp_message); if(generic_header) { /* set generic header fields */ apt_string_assign(&generic_header->content_type,"text/uri-list",mrcp_message->pool); mrcp_generic_header_property_add(mrcp_message,GENERIC_HEADER_CONTENT_TYPE); /* set message body */ apt_string_assign(&mrcp_message->body,"session:demo-grammar",mrcp_message->pool); } /* get/allocate recognizer header */ recog_header = mrcp_resource_header_prepare(mrcp_message); if(recog_header) { if(mrcp_message->start_line.version == MRCP_VERSION_2) { /* set recognizer header fields */ recog_header->cancel_if_queue = FALSE; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_CANCEL_IF_QUEUE); } recog_header->no_input_timeout = 5000; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_NO_INPUT_TIMEOUT); recog_header->recognition_timeout = 20000; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_RECOGNITION_TIMEOUT); recog_header->speech_complete_timeout = 400; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_SPEECH_COMPLETE_TIMEOUT); recog_header->dtmf_term_timeout = 3000; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_DTMF_TERM_TIMEOUT); recog_header->dtmf_interdigit_timeout = 3000; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_DTMF_INTERDIGIT_TIMEOUT); recog_header->confidence_threshold = 0.5f; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_CONFIDENCE_THRESHOLD); recog_header->start_input_timers = TRUE; mrcp_resource_header_property_add(mrcp_message,RECOGNIZER_HEADER_START_INPUT_TIMERS); } } return mrcp_message; } /** Get NLSML result */ static const char* nlsml_result_get(mrcp_message_t *message) { nlsml_interpretation_t *interpretation; nlsml_instance_t *instance; nlsml_result_t *result = nlsml_result_parse(message->body.buf, message->body.length, message->pool); if(!result) { return NULL; } /* get first interpretation */ interpretation = nlsml_first_interpretation_get(result); if(!interpretation) { return NULL; } /* get first instance */ instance = nlsml_interpretation_first_instance_get(interpretation); if(!instance) { return NULL; } nlsml_instance_swi_suppress(instance); return nlsml_instance_content_generate(instance, message->pool); } /** Application message handler */ static apt_bool_t app_message_handler(const mrcp_app_message_t *app_message) { if((app_message->message_type == MRCP_APP_MESSAGE_TYPE_SIGNALING && app_message->sig_message.message_type == MRCP_SIG_MESSAGE_TYPE_RESPONSE) || app_message->message_type == MRCP_APP_MESSAGE_TYPE_CONTROL) { asr_session_t *asr_session = mrcp_application_session_object_get(app_message->session); if(asr_session) { apr_thread_mutex_lock(asr_session->mutex); asr_session->app_message = app_message; apr_thread_cond_signal(asr_session->wait_object); apr_thread_mutex_unlock(asr_session->mutex); } } return TRUE; } /** Check signaling response */ static apt_bool_t sig_response_check(const mrcp_app_message_t *app_message) { if(!app_message || app_message->message_type != MRCP_APP_MESSAGE_TYPE_SIGNALING) { return FALSE; } return (app_message->sig_message.status == MRCP_SIG_STATUS_CODE_SUCCESS) ? TRUE : FALSE; } /** Check MRCP response */ static apt_bool_t mrcp_response_check(const mrcp_app_message_t *app_message, mrcp_request_state_e state) { mrcp_message_t *mrcp_message = NULL; if(app_message && app_message->message_type == MRCP_APP_MESSAGE_TYPE_CONTROL) { mrcp_message = app_message->control_message; } if(!mrcp_message || mrcp_message->start_line.message_type != MRCP_MESSAGE_TYPE_RESPONSE ) { return FALSE; } if(mrcp_message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS && mrcp_message->start_line.status_code != MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE) { return FALSE; } return (mrcp_message->start_line.request_state == state) ? TRUE : FALSE; } /** Get MRCP event */ static mrcp_message_t* mrcp_event_get(const mrcp_app_message_t *app_message) { mrcp_message_t *mrcp_message = NULL; if(app_message && app_message->message_type == MRCP_APP_MESSAGE_TYPE_CONTROL) { mrcp_message = app_message->control_message; } if(!mrcp_message || mrcp_message->start_line.message_type != MRCP_MESSAGE_TYPE_EVENT) { return NULL; } return mrcp_message; } /** Create ASR session */ ASR_CLIENT_DECLARE(asr_session_t*) asr_session_create(asr_engine_t *engine, const char *profile) { mpf_termination_t *termination; mrcp_channel_t *channel; mrcp_session_t *session; const mrcp_app_message_t *app_message; apr_pool_t *pool; asr_session_t *asr_session; mpf_stream_capabilities_t *capabilities; /* create session */ session = mrcp_application_session_create(engine->mrcp_app,profile,NULL); if(!session) { return NULL; } pool = mrcp_application_session_pool_get(session); asr_session = apr_palloc(pool,sizeof(asr_session_t)); mrcp_application_session_object_set(session,asr_session); /* create source stream capabilities */ capabilities = mpf_source_stream_capabilities_create(pool); /* add codec capabilities (Linear PCM) */ mpf_codec_capabilities_add( &capabilities->codecs, MPF_SAMPLE_RATE_8000, "LPCM"); termination = mrcp_application_audio_termination_create( session, /* session, termination belongs to */ &audio_stream_vtable, /* virtual methods table of audio stream */ capabilities, /* capabilities of audio stream */ asr_session); /* object to associate */ channel = mrcp_application_channel_create( session, /* session, channel belongs to */ MRCP_RECOGNIZER_RESOURCE, /* MRCP resource identifier */ termination, /* media termination, used to terminate audio stream */ NULL, /* RTP descriptor, used to create RTP termination (NULL by default) */ asr_session); /* object to associate */ if(!channel) { mrcp_application_session_destroy(session); return NULL; } asr_session->engine = engine; asr_session->mrcp_session = session; asr_session->mrcp_channel = channel; asr_session->recog_complete = NULL; asr_session->input_mode = INPUT_MODE_NONE; asr_session->streaming = FALSE; asr_session->audio_in = NULL; asr_session->media_buffer = NULL; asr_session->mutex = NULL; asr_session->wait_object = NULL; asr_session->app_message = NULL; /* Create cond wait object and mutex */ apr_thread_mutex_create(&asr_session->mutex,APR_THREAD_MUTEX_DEFAULT,pool); apr_thread_cond_create(&asr_session->wait_object,pool); /* Create media buffer */ asr_session->media_buffer = mpf_frame_buffer_create(160,20,pool); /* Send add channel request and wait for the response */ apr_thread_mutex_lock(asr_session->mutex); app_message = NULL; if(mrcp_application_channel_add(asr_session->mrcp_session,asr_session->mrcp_channel) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); app_message = asr_session->app_message; asr_session->app_message = NULL; } apr_thread_mutex_unlock(asr_session->mutex); if(sig_response_check(app_message) == FALSE) { asr_session_destroy_ex(asr_session,TRUE); return NULL; } return asr_session; } /** Initiate recognition based on specified grammar and input file */ ASR_CLIENT_DECLARE(const char*) asr_session_file_recognize( asr_session_t *asr_session, const char *grammar_file, const char *input_file) { const mrcp_app_message_t *app_message; mrcp_message_t *mrcp_message; app_message = NULL; mrcp_message = define_grammar_message_create(asr_session,grammar_file); if(!mrcp_message) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create DEFINE-GRAMMAR Request"); return NULL; } /* Send DEFINE-GRAMMAR request and wait for the response */ apr_thread_mutex_lock(asr_session->mutex); if(mrcp_application_message_send(asr_session->mrcp_session,asr_session->mrcp_channel,mrcp_message) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); app_message = asr_session->app_message; asr_session->app_message = NULL; } apr_thread_mutex_unlock(asr_session->mutex); if(mrcp_response_check(app_message,MRCP_REQUEST_STATE_COMPLETE) == FALSE) { return NULL; } /* Reset prev recog result (if any) */ asr_session->recog_complete = NULL; app_message = NULL; mrcp_message = recognize_message_create(asr_session); if(!mrcp_message) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create RECOGNIZE Request"); return NULL; } /* Send RECOGNIZE request and wait for the response */ apr_thread_mutex_lock(asr_session->mutex); if(mrcp_application_message_send(asr_session->mrcp_session,asr_session->mrcp_channel,mrcp_message) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); app_message = asr_session->app_message; asr_session->app_message = NULL; } apr_thread_mutex_unlock(asr_session->mutex); if(mrcp_response_check(app_message,MRCP_REQUEST_STATE_INPROGRESS) == FALSE) { return NULL; } /* Open input file and start streaming */ asr_session->input_mode = INPUT_MODE_FILE; if(asr_input_file_open(asr_session,input_file) == FALSE) { return NULL; } asr_session->streaming = TRUE; /* Wait for events either START-OF-INPUT or RECOGNITION-COMPLETE */ do { apr_thread_mutex_lock(asr_session->mutex); app_message = NULL; if(apr_thread_cond_timedwait(asr_session->wait_object,asr_session->mutex, 60 * 1000000) != APR_SUCCESS) { apr_thread_mutex_unlock(asr_session->mutex); return NULL; } app_message = asr_session->app_message; asr_session->app_message = NULL; apr_thread_mutex_unlock(asr_session->mutex); mrcp_message = mrcp_event_get(app_message); if(mrcp_message && mrcp_message->start_line.method_id == RECOGNIZER_RECOGNITION_COMPLETE) { asr_session->recog_complete = mrcp_message; } } while(!asr_session->recog_complete); /* Get results */ return nlsml_result_get(asr_session->recog_complete); } /** Initiate recognition based on specified grammar and input stream */ ASR_CLIENT_DECLARE(const char*) asr_session_stream_recognize( asr_session_t *asr_session, const char *grammar_file) { const mrcp_app_message_t *app_message; mrcp_message_t *mrcp_message; app_message = NULL; mrcp_message = define_grammar_message_create(asr_session,grammar_file); if(!mrcp_message) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create DEFINE-GRAMMAR Request"); return NULL; } /* Send DEFINE-GRAMMAR request and wait for the response */ apr_thread_mutex_lock(asr_session->mutex); if(mrcp_application_message_send(asr_session->mrcp_session,asr_session->mrcp_channel,mrcp_message) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); app_message = asr_session->app_message; asr_session->app_message = NULL; } apr_thread_mutex_unlock(asr_session->mutex); if(mrcp_response_check(app_message,MRCP_REQUEST_STATE_COMPLETE) == FALSE) { return NULL; } /* Reset prev recog result (if any) */ asr_session->recog_complete = NULL; app_message = NULL; mrcp_message = recognize_message_create(asr_session); if(!mrcp_message) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create RECOGNIZE Request"); return NULL; } /* Send RECOGNIZE request and wait for the response */ apr_thread_mutex_lock(asr_session->mutex); if(mrcp_application_message_send(asr_session->mrcp_session,asr_session->mrcp_channel,mrcp_message) == TRUE) { apr_thread_cond_wait(asr_session->wait_object,asr_session->mutex); app_message = asr_session->app_message; asr_session->app_message = NULL; } apr_thread_mutex_unlock(asr_session->mutex); if(mrcp_response_check(app_message,MRCP_REQUEST_STATE_INPROGRESS) == FALSE) { return NULL; } /* Reset media buffer */ mpf_frame_buffer_restart(asr_session->media_buffer); /* Set input mode and start streaming */ asr_session->input_mode = INPUT_MODE_STREAM; asr_session->streaming = TRUE; /* Wait for events either START-OF-INPUT or RECOGNITION-COMPLETE */ do { apr_thread_mutex_lock(asr_session->mutex); app_message = NULL; if(apr_thread_cond_timedwait(asr_session->wait_object,asr_session->mutex, 60 * 1000000) != APR_SUCCESS) { apr_thread_mutex_unlock(asr_session->mutex); return NULL; } app_message = asr_session->app_message; asr_session->app_message = NULL; apr_thread_mutex_unlock(asr_session->mutex); mrcp_message = mrcp_event_get(app_message); if(mrcp_message && mrcp_message->start_line.method_id == RECOGNIZER_RECOGNITION_COMPLETE) { asr_session->recog_complete = mrcp_message; } } while(!asr_session->recog_complete); /* Get results */ return nlsml_result_get(asr_session->recog_complete); } /** Write audio frame to recognize */ ASR_CLIENT_DECLARE(apt_bool_t) asr_session_stream_write( asr_session_t *asr_session, char *data, int size) { mpf_frame_t frame; frame.type = MEDIA_FRAME_TYPE_AUDIO; frame.marker = MPF_MARKER_NONE; frame.codec_frame.buffer = data; frame.codec_frame.size = size; if(mpf_frame_buffer_write(asr_session->media_buffer,&frame) != TRUE) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Write Audio [%d]",size); return FALSE; } return TRUE; } /** Destroy ASR session */ ASR_CLIENT_DECLARE(apt_bool_t) asr_session_destroy(asr_session_t *asr_session) { return asr_session_destroy_ex(asr_session,TRUE); } /** Set log priority */ ASR_CLIENT_DECLARE(apt_bool_t) asr_engine_log_priority_set(apt_log_priority_e log_priority) { return apt_log_priority_set(log_priority); }
syhao/mrcp
platforms/libasr-client/src/asr_engine.c
C
apache-2.0
24,120