code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
#!/usr/bin/env python # Bootstrap installation of Distribute from importlib import import_module import os, sys from distutils.core import setup from distutils.command.install import install from setuptools.command.develop import develop import subprocess # from subprocess import call # command = partial(subprocess.call, shell=True, stdout=sys.stdout, stdin=sys.stdin) def package_env(file_name, strict=False): file_path = os.path.join(os.path.dirname(__file__),file_name) if os.path.exists(file_path) or strict: return open(file_path).read() else: return u'' PACKAGE = u'public-forms' PROJECT = u'public_forms' PROJECT_SLUG = u'public_forms' VERSION = package_env('VERSION') URL = package_env('URL') AUTHOR_AND_EMAIL = [v.strip('>').strip() for v \ in package_env('AUTHOR').split('<mailto:')] if len(AUTHOR_AND_EMAIL)==2: AUTHOR, AUTHOR_EMAIL = AUTHOR_AND_EMAIL else: AUTHOR = AUTHOR_AND_EMAIL AUTHOR_EMAIL = u'' DESC = "feincms extension templated from django.contrib.skeleton.application" PACKAGE_NAMESPACE = [s for s in 'feincms.page.extensions'.strip()\ .strip('"')\ .strip("'")\ .strip()\ .split('.') if s] NSLIST = lambda sep:(sep.join(PACKAGE_NAMESPACE[:i+1]) for i,n in enumerate(PACKAGE_NAMESPACE)) PACKAGE_NAMESPACE_WITH_PACKAGE = PACKAGE_NAMESPACE + [PROJECT_SLUG,] NSLIST_WITH_PACKAGE = lambda sep:(sep.join(PACKAGE_NAMESPACE_WITH_PACKAGE[:i+1]) \ for i,n in enumerate(PACKAGE_NAMESPACE_WITH_PACKAGE)) PACKAGE_DIRS = dict(zip(NSLIST_WITH_PACKAGE('.'), NSLIST_WITH_PACKAGE('/'))) class install_requirements(object): def install_requirements(self): if os.environ.get('INSTALL_SKELETON_REQUIREMENTS', False): for r in self.requirements: if os.path.exists(r): subprocess.call('pip install -r %s'%r, shell=True, stdout=sys.stdout, stderr=sys.stderr) class post_install(install, install_requirements): requirements = ['requirements.txt'] def run(self): install.run(self) self.install_requirements() class post_develop(develop, install_requirements): requirements = ['requirements.txt', 'requirements.dev.txt'] def run(self): develop.run(self) self.install_requirements() if __name__ == '__main__': setup( cmdclass={"install": post_install, "develop": post_develop,}, name=PROJECT, version=VERSION, description=DESC, long_description=package_env('README.rst'), author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, license=package_env('LICENSE'), namespace_packages=list(NSLIST('.')), packages=list(NSLIST_WITH_PACKAGE('.')), package_dir=PACKAGE_DIRS, include_package_data=True, zip_safe=False, test_suite = 'tests', # install_requires=['argparse.extra',], classifiers=[ 'License :: OSI Approved', 'License :: OSI Approved :: GNU General Public License (GPL)', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], )
lamerzan/public-forms
setup.py
Python
gpl-3.0
3,570
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #include "connectionmodel.h" #include "connectionview.h" #include <bindingproperty.h> #include <variantproperty.h> #include <signalhandlerproperty.h> #include <rewritertransaction.h> #include <nodeabstractproperty.h> #include <exception.h> #include <QMessageBox> #include <QTableView> #include <QTimer> #include <QItemEditorFactory> #include <QStyleFactory> namespace { QStringList prependOnForSignalHandler(const QStringList &signalNames) { QStringList signalHandlerNames; foreach (const QString &signalName, signalNames) { QString signalHandlerName = signalName; if (!signalHandlerName.isEmpty()) { QChar firstChar = signalHandlerName.at(0).toUpper(); signalHandlerName[0] = firstChar; signalHandlerName.prepend(QLatin1String("on")); signalHandlerNames.append(signalHandlerName); } } return signalHandlerNames; } QStringList propertyNameListToStringList(const QmlDesigner::PropertyNameList &propertyNameList) { QStringList stringList; foreach (QmlDesigner::PropertyName propertyName, propertyNameList) { stringList << QString::fromUtf8(propertyName); } return stringList; } bool isConnection(const QmlDesigner::ModelNode &modelNode) { return (modelNode.type() == "Connections" || modelNode.type() == "QtQuick.Connections" || modelNode.type() == "Qt.Connections"); } enum ColumnRoles { TargetModelNodeRow = 0, TargetPropertyNameRow = 1, SourceRow = 2 }; } //namespace namespace QmlDesigner { namespace Internal { ConnectionModel::ConnectionModel(ConnectionView *parent) : QStandardItemModel(parent), m_connectionView(parent), m_lock(false) { connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(handleDataChanged(QModelIndex,QModelIndex))); } void ConnectionModel::resetModel() { beginResetModel(); clear(); QStringList labels; labels << tr("Target"); labels << tr("Signal Handler"); labels <<tr("Action"); setHorizontalHeaderLabels(labels); if (connectionView()->isAttached()) { foreach (const ModelNode modelNode, connectionView()->allModelNodes()) { addModelNode(modelNode); } } const int columnWidthTarget = connectionView()->connectionTableView()->columnWidth(0); connectionView()->connectionTableView()->setColumnWidth(0, columnWidthTarget - 80); endResetModel(); } SignalHandlerProperty ConnectionModel::signalHandlerPropertyForRow(int rowNumber) const { const int internalId = data(index(rowNumber, TargetModelNodeRow), Qt::UserRole + 1).toInt(); const QString targetPropertyName = data(index(rowNumber, TargetModelNodeRow), Qt::UserRole + 2).toString(); ModelNode modelNode = connectionView()->modelNodeForInternalId(internalId); if (modelNode.isValid()) return modelNode.signalHandlerProperty(targetPropertyName.toUtf8()); return SignalHandlerProperty(); } void ConnectionModel::addModelNode(const ModelNode &modelNode) { if (isConnection(modelNode)) addConnection(modelNode); } void ConnectionModel::addConnection(const ModelNode &modelNode) { foreach (const AbstractProperty &property, modelNode.properties()) { if (property.isSignalHandlerProperty() && property.name() != "target") { addSignalHandler(property.toSignalHandlerProperty()); } } } void ConnectionModel::addSignalHandler(const SignalHandlerProperty &signalHandlerProperty) { QStandardItem *targetItem; QStandardItem *signalItem; QStandardItem *actionItem; QString idLabel; ModelNode connectionsModelNode = signalHandlerProperty.parentModelNode(); if (connectionsModelNode.bindingProperty("target").isValid()) { idLabel =connectionsModelNode.bindingProperty("target").expression(); } targetItem = new QStandardItem(idLabel); updateCustomData(targetItem, signalHandlerProperty); const QString propertyName = QString::fromUtf8(signalHandlerProperty.name()); const QString source = signalHandlerProperty.source(); signalItem = new QStandardItem(propertyName); QList<QStandardItem*> items; items.append(targetItem); items.append(signalItem); actionItem = new QStandardItem(source); items.append(actionItem); appendRow(items); } void ConnectionModel::removeModelNode(const ModelNode &modelNode) { if (isConnection(modelNode)) removeConnection(modelNode); } void ConnectionModel::removeConnection(const ModelNode & /*modelNode*/) { } void ConnectionModel::updateSource(int row) { SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(row); const QString sourceString = data(index(row, SourceRow)).toString(); RewriterTransaction transaction = connectionView()->beginRewriterTransaction(QByteArrayLiteral("ConnectionModel::updateSource")); try { signalHandlerProperty.setSource(sourceString); transaction.commit(); } catch (Exception &e) { m_exceptionError = e.description(); QTimer::singleShot(200, this, SLOT(handleException())); } } void ConnectionModel::updateSignalName(int rowNumber) { SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(rowNumber); const PropertyName newName = data(index(rowNumber, TargetPropertyNameRow)).toString().toUtf8(); const QString source = signalHandlerProperty.source(); ModelNode connectionNode = signalHandlerProperty.parentModelNode(); if (!newName.isEmpty()) { RewriterTransaction transaction = connectionView()->beginRewriterTransaction(QByteArrayLiteral("ConnectionModel::updateSignalName")); try { connectionNode.signalHandlerProperty(newName).setSource(source); connectionNode.removeProperty(signalHandlerProperty.name()); transaction.commit(); //committing in the try block } catch (Exception &e) { //better save then sorry QMessageBox::warning(0, tr("Error"), e.description()); } QStandardItem* idItem = item(rowNumber, 0); SignalHandlerProperty newSignalHandlerProperty = connectionNode.signalHandlerProperty(newName); updateCustomData(idItem, newSignalHandlerProperty); } else { qWarning() << "BindingModel::updatePropertyName invalid property name"; } } void ConnectionModel::updateTargetNode(int rowNumber) { SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(rowNumber); const QString newTarget = data(index(rowNumber, TargetModelNodeRow)).toString(); ModelNode connectionNode = signalHandlerProperty.parentModelNode(); if (!newTarget.isEmpty()) { RewriterTransaction transaction = connectionView()->beginRewriterTransaction(QByteArrayLiteral("ConnectionModel::updateTargetNode")); try { connectionNode.bindingProperty("target").setExpression(newTarget); transaction.commit(); //committing in the try block } catch (Exception &e) { //better save then sorry QMessageBox::warning(0, tr("Error"), e.description()); } QStandardItem* idItem = item(rowNumber, 0); updateCustomData(idItem, signalHandlerProperty); } else { qWarning() << "BindingModel::updatePropertyName invalid target id"; } } void ConnectionModel::updateCustomData(QStandardItem *item, const SignalHandlerProperty &signalHandlerProperty) { item->setData(signalHandlerProperty.parentModelNode().internalId(), Qt::UserRole + 1); item->setData(signalHandlerProperty.name(), Qt::UserRole + 2); } ModelNode ConnectionModel::getTargetNodeForConnection(const ModelNode &connection) const { BindingProperty bindingProperty = connection.bindingProperty("target"); if (bindingProperty.isValid()) { if (bindingProperty.expression() == QLatin1String("parent")) return connection.parentProperty().parentModelNode(); return connectionView()->modelNodeForId(bindingProperty.expression()); } return ModelNode(); } void ConnectionModel::addConnection() { ModelNode rootModelNode = connectionView()->rootModelNode(); if (rootModelNode.isValid() && rootModelNode.metaInfo().isValid()) { NodeMetaInfo nodeMetaInfo = connectionView()->model()->metaInfo("QtQuick.Connections"); if (nodeMetaInfo.isValid()) { RewriterTransaction transaction = connectionView()->beginRewriterTransaction(QByteArrayLiteral("ConnectionModel::addConnection")); try { ModelNode newNode = connectionView()->createModelNode("QtQuick.Connections", nodeMetaInfo.majorVersion(), nodeMetaInfo.minorVersion()); rootModelNode.nodeAbstractProperty(rootModelNode.metaInfo().defaultPropertyName()).reparentHere(newNode); newNode.signalHandlerProperty("onClicked").setSource(QLatin1String("print(\"clicked\")")); if (connectionView()->selectedModelNodes().count() == 1 && !connectionView()->selectedModelNodes().first().id().isEmpty()) { ModelNode selectedNode = connectionView()->selectedModelNodes().first(); newNode.bindingProperty("target").setExpression(selectedNode.id()); } else { newNode.bindingProperty("target").setExpression(QLatin1String("parent")); } transaction.commit(); } catch (Exception &e) { //better save then sorry QMessageBox::warning(0, tr("Error"), e.description()); } } } } void ConnectionModel::bindingPropertyChanged(const BindingProperty &bindingProperty) { if (isConnection(bindingProperty.parentModelNode())) resetModel(); } void ConnectionModel::variantPropertyChanged(const VariantProperty &variantProperty) { if (isConnection(variantProperty.parentModelNode())) resetModel(); } void ConnectionModel::deleteConnectionByRow(int currentRow) { signalHandlerPropertyForRow(currentRow).parentModelNode().destroy(); } void ConnectionModel::handleException() { QMessageBox::warning(0, tr("Error"), m_exceptionError); resetModel(); } void ConnectionModel::handleDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { if (topLeft != bottomRight) { qWarning() << "ConnectionModel::handleDataChanged multi edit?"; return; } m_lock = true; int currentColumn = topLeft.column(); int currentRow = topLeft.row(); switch (currentColumn) { case TargetModelNodeRow: { updateTargetNode(currentRow); } break; case TargetPropertyNameRow: { updateSignalName(currentRow); } break; case SourceRow: { updateSource(currentRow); } break; default: qWarning() << "ConnectionModel::handleDataChanged column" << currentColumn; } m_lock = false; } ConnectionView *ConnectionModel::connectionView() const { return m_connectionView; } QStringList ConnectionModel::getSignalsForRow(int row) const { QStringList stringList; SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(row); if (signalHandlerProperty.isValid()) { stringList.append(getPossibleSignalsForConnection(signalHandlerProperty.parentModelNode())); } return stringList; } QStringList ConnectionModel::getPossibleSignalsForConnection(const ModelNode &connection) const { QStringList stringList; if (connection.isValid()) { ModelNode targetNode = getTargetNodeForConnection(connection); if (targetNode.isValid() && targetNode.metaInfo().isValid()) { stringList.append(propertyNameListToStringList(targetNode.metaInfo().signalNames())); } } return stringList; } ConnectionDelegate::ConnectionDelegate(QWidget *parent) : QStyledItemDelegate(parent) { static QItemEditorFactory *factory = 0; if (factory == 0) { factory = new QItemEditorFactory; QItemEditorCreatorBase *creator = new QItemEditorCreator<ConnectionComboBox>("text"); factory->registerEditor(QVariant::String, creator); } setItemEditorFactory(factory); } QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { QWidget *widget = QStyledItemDelegate::createEditor(parent, option, index); const ConnectionModel *connectionModel = qobject_cast<const ConnectionModel*>(index.model()); //model->connectionView()->allModelNodes(); ConnectionComboBox *bindingComboBox = qobject_cast<ConnectionComboBox*>(widget); if (!connectionModel) { qWarning() << "ConnectionDelegate::createEditor no model"; return widget; } if (!connectionModel->connectionView()) { qWarning() << "ConnectionDelegate::createEditor no connection view"; return widget; } if (!bindingComboBox) { qWarning() << "ConnectionDelegate::createEditor no bindingComboBox"; return widget; } switch (index.column()) { case TargetModelNodeRow: { foreach (const ModelNode &modelNode, connectionModel->connectionView()->allModelNodes()) { if (!modelNode.id().isEmpty()) { bindingComboBox->addItem(modelNode.id()); } } } break; case TargetPropertyNameRow: { bindingComboBox->addItems(prependOnForSignalHandler(connectionModel->getSignalsForRow(index.row()))); } break; case SourceRow: { ModelNode rootModelNode = connectionModel->connectionView()->rootModelNode(); if (QmlItemNode::isValidQmlItemNode(rootModelNode) && !rootModelNode.id().isEmpty()) { QString itemText = tr("Change to default state"); QString source = QString::fromLatin1("{ %1.state = \"\" }").arg(rootModelNode.id()); bindingComboBox->addItem(itemText, source); foreach (const QmlModelState &state, QmlItemNode(rootModelNode).states().allStates()) { QString itemText = tr("Change state to %1").arg(state.name()); QString source = QString::fromLatin1("{ %1.state = \"%2\" }").arg(rootModelNode.id()).arg(state.name()); bindingComboBox->addItem(itemText, source); } } } break; default: qWarning() << "ConnectionDelegate::createEditor column" << index.column(); } connect(bindingComboBox, SIGNAL(activated(QString)), this, SLOT(emitCommitData(QString))); return widget; } void ConnectionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItem opt = option; opt.state &= ~QStyle::State_HasFocus; QStyledItemDelegate::paint(painter, opt, index); } void ConnectionDelegate::emitCommitData(const QString & /*text*/) { ConnectionComboBox *bindingComboBox = qobject_cast<ConnectionComboBox*>(sender()); emit commitData(bindingComboBox); } ConnectionComboBox::ConnectionComboBox(QWidget *parent) : QComboBox(parent) { static QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("windows"))); setEditable(true); if (style) setStyle(style.data()); } QString ConnectionComboBox::text() const { int index = findText(currentText()); if (index > -1) { QVariant variantData = itemData(index); if (variantData.isValid()) return variantData.toString(); } return currentText(); } void ConnectionComboBox::setText(const QString &text) { setEditText(text); } } // namespace Internal } // namespace QmlDesigner
pivonroll/Qt_Creator
src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.cpp
C++
gpl-3.0
17,074
/* @file SymbolArea.java * * @author marco corvi * @date dec 2012 * * @brief TopoDroid drawing: area symbol * -------------------------------------------------------- * Copyright This software is distributed under GPL-3.0 or later * See the file COPYING. * -------------------------------------------------------- */ package com.topodroid.DistoX; import com.topodroid.utils.TDMath; import com.topodroid.utils.TDLog; import com.topodroid.utils.TDFile; import com.topodroid.utils.TDColor; import com.topodroid.prefs.TDSetting; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Shader.TileMode; class SymbolArea extends Symbol { String mName; int mColor; boolean mCloseHorizontal; boolean mOrientable; // PRIVATE // FIXME AREA_ORIENT double mOrientation; private Paint mPaint; private Path mPath; Bitmap mBitmap; Bitmap mShaderBitmap = null; BitmapShader mShader; // paint bitmap shader TileMode mXMode; TileMode mYMode; @Override public String getName() { return mName; } @Override public Paint getPaint() { return mPaint; } @Override public Path getPath() { return mPath; } @Override public boolean isOrientable() { return mOrientable; } // @Override public boolean isEnabled() { return mEnabled; } // @Override public void setEnabled( boolean enabled ) { mEnabled = enabled; } // @Override public void toggleEnabled() { mEnabled = ! mEnabled; } // FIXME AREA_ORIENT @Override public boolean setAngle( float angle ) { if ( mBitmap == null ) return false; mOrientation = angle; // TDLog.Error( "ERROR area symbol set orientation " + angle + " not supported" ); android.graphics.Matrix m = new android.graphics.Matrix(); m.preRotate( (float)mOrientation ); mShader.setLocalMatrix( m ); return true; } // FIXME AREA_ORIENT @Override public int getAngle() { return (int)mOrientation; } /** * color 0xaarrggbb * level canvas level */ SymbolArea( String name, String th_name, String group, String fname, int color, Bitmap bitmap, TileMode xmode, TileMode ymode, boolean close_horizontal, int level, int rt ) { super( Symbol.TYPE_AREA, th_name, group, fname, rt ); mName = name; mColor = color; mLevel = level; mBitmap = bitmap; mXMode = xmode; mYMode = ymode; mCloseHorizontal = close_horizontal; mOrientable = false; // FIXME AREA_ORIET mOrientation = 0; mPaint = new Paint(); mPaint.setDither(true); mPaint.setColor( mColor ); mPaint.setAlpha( 0x66 ); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth( TDSetting.mLineThickness ); makeShader( mBitmap, mXMode, mYMode, true ); makeAreaPath(); } // FIXME AREA_ORIENT void rotateGradArea( double a ) { if ( mOrientable ) { // TDLog.Error( "ERROR area symbol rotate by " + a + " not implementd" ); // mOrientation += a; // while ( mOrientation >= 360 ) mOrientation -= 360; // while ( mOrientation < 0 ) mOrientation += 360; mOrientation = TDMath.in360( mOrientation + a ); if ( mShader != null ) { android.graphics.Matrix m = new android.graphics.Matrix(); m.preRotate( (float)mOrientation ); mShader.setLocalMatrix( m ); } } } private void makeAreaPath() { mPath = new Path(); if ( mCloseHorizontal ) { mPath.moveTo( -10, -5 ); mPath.cubicTo( -10, 0, -5, 5, 0, 5 ); mPath.cubicTo( 5, 5, 10, 0, 10, -5 ); mPath.close(); } else { mPath.addCircle( 0, 0, 10, Path.Direction.CCW ); } } SymbolArea( String filepath, String fname, String locale, String iso ) { super( Symbol.TYPE_AREA, null, null, fname, Symbol.W2D_DETAIL_SHP ); mOrientable = false; // FIXME AREA_ORIENT mOrientation = 0; readFile( filepath, locale, iso ); makeAreaPath(); } private Bitmap makeBitmap( int[] pxl, int w1, int h1 ) { if ( w1 > 0 && h1 > 0 ) { int w2 = w1 * 2; int h2 = h1 * 2; int[] pxl2 = new int[ w2 * h2 ]; for ( int j=0; j<h1; ++j ) { for ( int i=0; i < w1; ++i ) { pxl2[j*w2+i] = pxl2[j*w2+i+w1] = pxl2[(j+h1)*w2+i] = pxl2[(j+h1)*w2+i+w1] = pxl[j*w1+i]; } } Bitmap bitmap = Bitmap.createBitmap( w2, h2, Bitmap.Config.ARGB_8888 ); bitmap.setPixels( pxl2, 0, w2, 0, 0, w2, h2 ); // bitmap.setPixels( pxl, 0, width, width, 0, width, height ); // bitmap.setPixels( pxl, 0, width, 0, height, width, height ); // bitmap.setPixels( pxl, 0, width, width, height, width, height ); return bitmap; } return null; } private void makeShader( Bitmap bitmap, TileMode xmode, TileMode ymode, boolean subimage ) { if ( bitmap == null ) return; int width = bitmap.getWidth(); int height = bitmap.getHeight(); if ( width > 0 && height > 0 ) { if ( subimage ) { int w1 = width / 2; int h1 = height / 2; mShaderBitmap = Bitmap.createBitmap( bitmap, w1/2, h1/2, w1, h1 ); } mShader = new BitmapShader( mShaderBitmap, xmode, ymode ); mPaint.setShader( mShader ); } } /** create a symbol reading it from a file * The file syntax is * symbol area * name NAME * th_name THERION_NAME * color 0xHHHHHH_COLOR 0xAA_ALPHA * endsymbol */ private void readFile( String filename, String locale, String iso ) { // TDLog.v( "Area read " + filename + " " + locale + " " + iso ); String name = null; String th_name = null; String group = null; int color = 0; int alpha = 0x66; int alpha_bg = 0x33; mBitmap = null; int width = 0; int height = 0; mXMode = TileMode.REPEAT; mYMode = TileMode.REPEAT; int[] pxl = null; String options = null; try { // FileReader fr = TDFile.getFileReader( filename ); // TDLog.Log( TDLog.LOG_IO, "read symbol area file <" + filename + ">" ); FileInputStream fr = TDFile.getFileInputStream( filename ); BufferedReader br = new BufferedReader( new InputStreamReader( fr, iso ) ); boolean insymbol = false; String line; line = br.readLine(); while ( line != null ) { line = line.trim(); String[] vals = line.split(" "); int s = vals.length; for (int k=0; k<s; ++k ) { if ( vals[k].startsWith( "#" ) ) break; if ( vals[k].length() == 0 ) continue; if ( ! insymbol ) { if ( vals[k].equals("symbol") ) { name = null; th_name = null; mColor = TDColor.TRANSPARENT; insymbol = true; } } else { if ( vals[k].equals("name") || vals[k].equals(locale) ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { // TDLog.v( "found name " + vals[k] ); name = (new String( vals[k].getBytes(iso) )).replace("_", " "); // should .trim(); for tab etc. } // TDLog.v( "area name <" + name + "> locale " + locale ); } else if ( vals[k].equals("th_name") ) { // therion name must not have spaces ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { // should .trim(); for tab etc. ? no: require syntax without tabs etc. th_name = deprefix_u( vals[k] ); } } else if ( vals[k].equals("group") ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { group = vals[k]; // should .trim(); for tab etc. ? no: require syntax without tabs etc. } } else if ( vals[k].equals("options") ) { StringBuilder sb = new StringBuilder(); boolean space = false; for ( ++k; k < s; ++k ) { if ( vals[k].length() > 0 ) { if ( space ) { sb.append(" "); } else { space = true; } sb.append( vals[k] ); } } options = sb.toString(); } else if ( vals[k].equals("csurvey") ) { // csurvey <layer> <category> <pen_type> <brush_type> } else if ( vals[k].equals("level") ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { mLevel = ( Integer.parseInt( vals[k] ) ); } catch( NumberFormatException e ) { TDLog.Error("Non-integer level"); } } } else if ( vals[k].equals("roundtrip") ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { mRoundTrip = ( Integer.parseInt( vals[k] ) ); } catch( NumberFormatException e ) { TDLog.Error("Non-integer roundtrip"); } } } else if ( vals[k].equals("color") ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { color = Integer.decode( vals[k] ); } catch( NumberFormatException e ) { TDLog.Error("Non-integer color"); } } ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { alpha = Integer.decode( vals[k] ); } catch( NumberFormatException e ) { TDLog.Error("Non-integer alpha"); } } ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { alpha_bg = Integer.decode( vals[k] ); } catch( NumberFormatException e ) { TDLog.Error("Non-integer alpha-bg"); } } } else if ( vals[k].equals("bitmap") ) { ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { try { width = Integer.parseInt( vals[k] ); ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { height = Integer.parseInt( vals[k] ); mXMode = TileMode.REPEAT; mYMode = TileMode.REPEAT; ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { if ( vals[k].equals("M") ) { mXMode = TileMode.MIRROR; } ++k; while ( k < s && vals[k].length() == 0 ) ++k; if ( k < s ) { if ( vals[k].equals("M") ) { mYMode = TileMode.MIRROR; } } } if ( width > 0 && height > 0 ) { pxl = new int[ width * height]; int col = (color & 0x00ffffff) | ( alpha_bg << 24 ) ; for ( int j=0; j<height; ++j ) { for ( int i=0; i<width; ++i ) pxl[j*width+i] = col; } col = (color & 0x00ffffff) | ( alpha << 24 ); // TDLog.v( "bitmap " + width + " " + height ); for ( int j=0; j<height; ++j ) { line = br.readLine().trim(); // TDLog.v( "bitmap line <" + line + ">" ); if ( line.startsWith("endbitmap") ) { mBitmap = makeBitmap( pxl, width, height ); pxl = null; break; } for ( int i=0; i<width && i <line.length(); ++i ) if ( line.charAt(i) == '1' ) pxl[j*width+i] = col; } } } } catch ( NumberFormatException e ) { TDLog.Error( filename + " parse bitmap error: " + line ); } } } else if ( vals[k].equals("endbitmap") ) { mBitmap = makeBitmap( pxl, width, height ); pxl = null; } else if ( vals[k].equals("orientable") ) { mOrientable = true; } else if ( vals[k].equals("close-horizontal") ) { mCloseHorizontal = true; } else if ( vals[k].equals("endsymbol") ) { if ( name != null && th_name != null ) { // at this point if both are not null, they have both positive length mName = name; setThName( th_name ); mGroup = group; mDefaultOptions = options; mPaint = new Paint(); mPaint.setDither(true); mColor = (alpha << 24) | color; mPaint.setColor( color ); mPaint.setAlpha( alpha ); // mPaint.setStyle(Paint.Style.STROKE); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth( TDSetting.mLineThickness ); } insymbol = false; } } } line = br.readLine(); } } catch ( FileNotFoundException e ) { TDLog.Error( "File not found: " + e.getMessage() ); } catch( IOException e ) { TDLog.Error( "I/O error: " + e.getMessage() ); } makeShader( mBitmap, mXMode, mYMode, true ); } }
marcocorvi/topodroid
src/com/topodroid/DistoX/SymbolArea.java
Java
gpl-3.0
13,878
/***************************************************************************** * Copyright 2014 Christoph Wick * * This file is part of Mencus. * * Mencus 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 3 of the License, or (at your option) any later * version. * * Mencus 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 * Mencus. If not, see http://www.gnu.org/licenses/. *****************************************************************************/ #include "Sprite.hpp" #include "SpriteTransformPipeline.hpp" #include "XMLHelper.hpp" #include "Map.hpp" using namespace XMLHelper; const Ogre::Vector2 CSpriteTexture::DEFAULT_TEXTURE_TOP_LEFT(0, 1); const Ogre::Vector2 CSpriteTexture::DEFAULT_TEXTURE_BOTTOM_RIGHT(1, 0); CSprite::CSprite(CMap &map, const std::string &sID, CEntity *pParent, const CSpriteTransformPipeline *pTransformPipeline, Ogre2dManager *pSpriteManager, const Ogre::Vector2 &vPosition, const Ogre::Vector2 &vSize, const Ogre::Vector2 &vScale, const Ogre::Radian radRotation) : CPhysicsEntity(map, sID, pParent), m_pTransformPipeline(pTransformPipeline), m_pSpriteManager(pSpriteManager), m_radRotation(radRotation), m_pTextureToDraw(&m_Texture), m_Colour(Ogre::ColourValue::White) { setPosition(vPosition); setSize(vSize); setScale(vScale); setRelativeBoundingBox(CBoundingBox2d(Ogre::Vector2::ZERO, vSize * vScale)); } CSprite::CSprite(CMap &map, CEntity *pParent, const CSpriteTransformPipeline *pTransformPipeline, Ogre2dManager *pSpriteManager, const tinyxml2::XMLElement *pElem, const Ogre::Vector2 &vSize) : CPhysicsEntity(map, pParent, pElem, Ogre::Vector2::ZERO, vSize), m_pTransformPipeline(pTransformPipeline), m_pSpriteManager(pSpriteManager), m_radRotation(RealAttribute(pElem, "sp_radRotation", 0)), m_pTextureToDraw(&m_Texture), m_Colour(Ogre::StringConverter::parseColourValue(Attribute(pElem, "sp_colour", "1 1 1 1"), Ogre::ColourValue::White)) { } CSprite::CSprite(const CSprite &src) : CPhysicsEntity(src), m_pSpriteManager(src.m_pSpriteManager), m_radRotation(src.m_radRotation), m_Texture(src.m_Texture), m_pTextureToDraw(src.m_pTextureToDraw), m_Colour(src.m_Colour) { setPosition(src.m_vPosition); setSize(src.m_vSize); setScale(src.m_vScale); setRelativeBoundingBox(src.m_bbRelativeBoundingBox); } CSprite::~CSprite() { } void CSprite::update(Ogre::Real tpf) { CPhysicsEntity::update(tpf); } void CSprite::render(Ogre::Real tpf) { if (!m_bVisible) {return;} //Ogre::LogManager::getSingleton().logMessage("Test1" + Ogre::StringConverter::toString(m_vPosition) + " //// " + Ogre::StringConverter::toString(m_vSize)); Ogre::Vector2 vStart = m_pTransformPipeline->transformPosition(m_vPosition + m_pTextureToDraw->getSpriteOffset()); Ogre::Vector2 vEnd = m_pTransformPipeline->transformPosition(m_vPosition + m_pTextureToDraw->getSpriteOffset() + m_vSize * m_pTextureToDraw->getSpriteScale()); if (!m_pTransformPipeline->isVisible(vStart, vEnd)) { // not visible return; } m_pSpriteManager->spriteBltFull( m_pTextureToDraw->getTexture()->getName(), vStart.x, vStart.y, vEnd.x, vEnd.y, m_pTextureToDraw->getTexturePosTopLeft().x, m_pTextureToDraw->getTexturePosTopLeft().y, m_pTextureToDraw->getTexturePosBottomRight().x, m_pTextureToDraw->getTexturePosBottomRight().y, m_Colour); CPhysicsEntity::render(tpf); } void CSprite::setTexture(const string &sName) { m_Texture.setTexture(Ogre::TextureManager::getSingleton().getByName(sName)); if (m_Texture.getTexture().isNull()) { m_Texture.setTexture(Ogre::TextureManager::getSingleton().load(sName,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)); //throw Ogre::Exception(Ogre::Exception::ERR_FILE_NOT_FOUND, sName + " is not found as a texture!", __FILE__); } } void CSprite::writeToXMLElement(tinyxml2::XMLElement *pElem, EOutputStyle eStyle) const { CPhysicsEntity::writeToXMLElement(pElem, eStyle); using namespace XMLHelper; if (eStyle == OS_FULL) { SetAttribute(pElem, "sp_radRotation", m_radRotation.valueRadians()); SetAttribute<Ogre::ColourValue>(pElem, "sp_colour", m_Colour); } }
ChWick/Mencus
Game/Sprite.cpp
C++
gpl-3.0
4,646
require 'chewy/query/filters' class GamesSearch include ActiveModel::Model attr_accessor :query attr_accessor :platform attr_accessor :type attr_accessor :not_id def index GamesIndex end def search query_string end def expansions_count index.filter(type: { value: 'expansion' }).search_type(:count) end def editions_count index.filter(type: { value: 'edition' }).search_type(:count) end def all if platform.present? index.query(match: { platform_id: platform }) else index.filter { match_all } end end def all_except(edition_ids, expansion_ids) all .filter(not: {terms: {edition_id: edition_ids}}) .filter(not: {terms: {expansion_id: expansion_ids}}) end def query_string if not_id.present? type_query.filter(not: { ids: { values: [not_id] } }) else type_query end end def type_query if type.present? platform_query.filter(type: { value: type }) else platform_query end end def platform_query if platform.present? index_query.filter(term: { platform_id: platform }) else index_query end end def index_query index.query(bool: { should: [ { multi_match: { fields: [:title], query: query, operator: 'AND' } }, { multi_match: { fields: [:title], query: query, fuzziness: 'AUTO', operator: 'AND' } } ] } ) if query.present? end end
internetvideogamelibrary/internetvideogamelibrary-website
app/searches/games_search.rb
Ruby
gpl-3.0
1,857
package com.github.xabgesagtx.mensa.bot.date; import lombok.AllArgsConstructor; import lombok.Getter; import java.time.LocalDate; import java.util.Optional; /** * Wrapper class to hold the search result for a specific date */ @Getter @AllArgsConstructor(staticName = "of") public class DateSearchResult { private final LocalDate date; private final Optional<LocalDate> alternativeDate; public LocalDate getDateToUse() { return alternativeDate.orElse(date); } }
xabgesagtx/mensa-api
mensa-telegram/src/main/java/com/github/xabgesagtx/mensa/bot/date/DateSearchResult.java
Java
gpl-3.0
493
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- /* 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * AP_Compass_HMC5843.cpp - Arduino Library for HMC5843 I2C magnetometer * Code by Jordi Muñoz and Jose Julio. DIYDrones.com * * Sensor is conected to I2C port * Sensor is initialized in Continuos mode (10Hz) * */ #include <AP_HAL/AP_HAL.h> #ifdef HAL_COMPASS_HMC5843_I2C_ADDR #include <assert.h> #include <utility> #include <AP_Math/AP_Math.h> #include <AP_HAL/AP_HAL.h> #include <AP_HAL/utility/sparse-endian.h> #include "AP_Compass_HMC5843.h" #include <AP_InertialSensor/AP_InertialSensor.h> #include <AP_InertialSensor/AuxiliaryBus.h> extern const AP_HAL::HAL& hal; /* * Defaul address: 0x1E */ #define HMC5843_REG_CONFIG_A 0x00 // Valid sample averaging for 5883L #define HMC5843_SAMPLE_AVERAGING_1 (0x00 << 5) #define HMC5843_SAMPLE_AVERAGING_2 (0x01 << 5) #define HMC5843_SAMPLE_AVERAGING_4 (0x02 << 5) #define HMC5843_SAMPLE_AVERAGING_8 (0x03 << 5) // Valid data output rates for 5883L #define HMC5843_OSR_0_75HZ (0x00 << 2) #define HMC5843_OSR_1_5HZ (0x01 << 2) #define HMC5843_OSR_3HZ (0x02 << 2) #define HMC5843_OSR_7_5HZ (0x03 << 2) #define HMC5843_OSR_15HZ (0x04 << 2) #define HMC5843_OSR_30HZ (0x05 << 2) #define HMC5843_OSR_75HZ (0x06 << 2) // Sensor operation modes #define HMC5843_OPMODE_NORMAL 0x00 #define HMC5843_OPMODE_POSITIVE_BIAS 0x01 #define HMC5843_OPMODE_NEGATIVE_BIAS 0x02 #define HMC5843_OPMODE_MASK 0x03 #define HMC5843_REG_CONFIG_B 0x01 #define HMC5883L_GAIN_0_88_GA (0x00 << 5) #define HMC5883L_GAIN_1_30_GA (0x01 << 5) #define HMC5883L_GAIN_1_90_GA (0x02 << 5) #define HMC5883L_GAIN_2_50_GA (0x03 << 5) #define HMC5883L_GAIN_4_00_GA (0x04 << 5) #define HMC5883L_GAIN_4_70_GA (0x05 << 5) #define HMC5883L_GAIN_5_60_GA (0x06 << 5) #define HMC5883L_GAIN_8_10_GA (0x07 << 5) #define HMC5843_GAIN_0_70_GA (0x00 << 5) #define HMC5843_GAIN_1_00_GA (0x01 << 5) #define HMC5843_GAIN_1_50_GA (0x02 << 5) #define HMC5843_GAIN_2_00_GA (0x03 << 5) #define HMC5843_GAIN_3_20_GA (0x04 << 5) #define HMC5843_GAIN_3_80_GA (0x05 << 5) #define HMC5843_GAIN_4_50_GA (0x06 << 5) #define HMC5843_GAIN_6_50_GA (0x07 << 5) #define HMC5843_REG_MODE 0x02 #define HMC5843_MODE_CONTINUOUS 0x00 #define HMC5843_MODE_SINGLE 0x01 #define HMC5843_REG_DATA_OUTPUT_X_MSB 0x03 AP_Compass_HMC5843::AP_Compass_HMC5843(Compass &compass, AP_HMC5843_BusDriver *bus, bool force_external) : AP_Compass_Backend(compass) , _bus(bus) , _force_external(force_external) { } AP_Compass_HMC5843::~AP_Compass_HMC5843() { delete _bus; } AP_Compass_Backend *AP_Compass_HMC5843::probe(Compass &compass, AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev, bool force_external) { AP_HMC5843_BusDriver *bus = new AP_HMC5843_BusDriver_HALDevice(std::move(dev)); if (!bus) { return nullptr; } AP_Compass_HMC5843 *sensor = new AP_Compass_HMC5843(compass, bus, force_external); if (!sensor || !sensor->init()) { delete sensor; return nullptr; } return sensor; } AP_Compass_Backend *AP_Compass_HMC5843::probe_mpu6000(Compass &compass) { AP_InertialSensor &ins = *AP_InertialSensor::get_instance(); AP_HMC5843_BusDriver *bus = new AP_HMC5843_BusDriver_Auxiliary(ins, HAL_INS_MPU60XX_SPI, HAL_COMPASS_HMC5843_I2C_ADDR); if (!bus) { return nullptr; } AP_Compass_HMC5843 *sensor = new AP_Compass_HMC5843(compass, bus, false); if (!sensor || !sensor->init()) { delete sensor; return nullptr; } return sensor; } bool AP_Compass_HMC5843::init() { hal.scheduler->suspend_timer_procs(); AP_HAL::Semaphore *bus_sem = _bus->get_semaphore(); if (!bus_sem || !bus_sem->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { hal.console->printf("HMC5843: Unable to get bus semaphore\n"); goto fail_sem; } if (!_bus->configure()) { hal.console->printf("HMC5843: Could not configure the bus\n"); goto errout; } if (!_detect_version()) { hal.console->printf("HMC5843: Could not detect version\n"); goto errout; } if (!_calibrate()) { hal.console->printf("HMC5843: Could not calibrate sensor\n"); goto errout; } if (!_setup_sampling_mode()) { goto errout; } if (!_bus->start_measurements()) { hal.console->printf("HMC5843: Could not start measurements on bus\n"); goto errout; } _initialised = true; bus_sem->give(); hal.scheduler->resume_timer_procs(); // perform an initial read read(); _compass_instance = register_compass(); set_dev_id(_compass_instance, _product_id); if (_force_external) { set_external(_compass_instance, true); } return true; errout: bus_sem->give(); fail_sem: hal.scheduler->resume_timer_procs(); return false; } /* * Accumulate a reading from the magnetometer * * bus semaphore must not be taken */ void AP_Compass_HMC5843::accumulate() { if (!_initialised) { // someone has tried to enable a compass for the first time // mid-flight .... we can't do that yet (especially as we won't // have the right orientation!) return; } uint32_t tnow = AP_HAL::micros(); if (_accum_count != 0 && (tnow - _last_accum_time) < 13333) { // the compass gets new data at 75Hz return; } if (!_bus->get_semaphore()->take(1)) { // the bus is busy - try again later return; } bool result = _read_sample(); _bus->get_semaphore()->give(); if (!result) { return; } // the _mag_N values are in the range -2048 to 2047, so we can // accumulate up to 15 of them in an int16_t. Let's make it 14 // for ease of calculation. We expect to do reads at 10Hz, and // we get new data at most 75Hz, so we don't expect to // accumulate more than 8 before a read // get raw_field - sensor frame, uncorrected Vector3f raw_field = Vector3f(_mag_x, _mag_y, _mag_z); raw_field *= _gain_scale; // rotate to the desired orientation if (is_external(_compass_instance) && _product_id == AP_COMPASS_TYPE_HMC5883L) { raw_field.rotate(ROTATION_YAW_90); } // rotate raw_field from sensor frame to body frame rotate_field(raw_field, _compass_instance); // publish raw_field (uncorrected point sample) for calibration use publish_raw_field(raw_field, tnow, _compass_instance); // correct raw_field for known errors correct_field(raw_field, _compass_instance); _mag_x_accum += raw_field.x; _mag_y_accum += raw_field.y; _mag_z_accum += raw_field.z; _accum_count++; if (_accum_count == 14) { _mag_x_accum /= 2; _mag_y_accum /= 2; _mag_z_accum /= 2; _accum_count = 7; } _last_accum_time = tnow; } /* * Take accumulated reads from the magnetometer or try to read once if no * valid data * * bus semaphore must not be locked */ void AP_Compass_HMC5843::read() { if (!_initialised) { // someone has tried to enable a compass for the first time // mid-flight .... we can't do that yet (especially as we won't // have the right orientation!) return; } if (_accum_count == 0) { accumulate(); if (_retry_time != 0) { return; } } Vector3f field(_mag_x_accum * _scaling[0], _mag_y_accum * _scaling[1], _mag_z_accum * _scaling[2]); field /= _accum_count; _accum_count = 0; _mag_x_accum = _mag_y_accum = _mag_z_accum = 0; publish_filtered_field(field, _compass_instance); } bool AP_Compass_HMC5843::_setup_sampling_mode() { if (!_bus->register_write(HMC5843_REG_CONFIG_A, _base_config) || !_bus->register_write(HMC5843_REG_CONFIG_B, _gain_config) || !_bus->register_write(HMC5843_REG_MODE, HMC5843_MODE_CONTINUOUS)) { return false; } return true; } /* * Read Sensor data - bus semaphore must be taken */ bool AP_Compass_HMC5843::_read_sample() { struct PACKED { be16_t rx; be16_t ry; be16_t rz; } val; int16_t rx, ry, rz; if (_retry_time > AP_HAL::millis()) { return false; } if (!_bus->block_read(HMC5843_REG_DATA_OUTPUT_X_MSB, (uint8_t *) &val, sizeof(val))){ _retry_time = AP_HAL::millis() + 1000; return false; } rx = be16toh(val.rx); ry = be16toh(val.ry); rz = be16toh(val.rz); if (_product_id == AP_COMPASS_TYPE_HMC5883L) { std::swap(ry, rz); } if (rx == -4096 || ry == -4096 || rz == -4096) { // no valid data available return false; } _mag_x = -rx; _mag_y = ry; _mag_z = -rz; _retry_time = 0; return true; } bool AP_Compass_HMC5843::_detect_version() { _base_config = 0x0; uint8_t try_config = HMC5843_SAMPLE_AVERAGING_8 | HMC5843_OSR_75HZ | HMC5843_OPMODE_NORMAL; if (!_bus->register_write(HMC5843_REG_CONFIG_A, try_config) || !_bus->register_read(HMC5843_REG_CONFIG_A, &_base_config)) { return false; } if (_base_config == try_config) { /* a 5883L supports the sample averaging config */ _product_id = AP_COMPASS_TYPE_HMC5883L; _gain_config = HMC5883L_GAIN_1_30_GA; _gain_scale = (1.0f / 1090) * 1000; } else if (_base_config == (HMC5843_OPMODE_NORMAL | HMC5843_OSR_75HZ)) { _product_id = AP_COMPASS_TYPE_HMC5843; _gain_config = HMC5843_GAIN_1_00_GA; _gain_scale = (1.0f / 1300) * 1000; } else { /* not behaving like either supported compass type */ return false; } return true; } bool AP_Compass_HMC5843::_calibrate() { uint8_t calibration_gain; uint16_t expected_x; uint16_t expected_yz; int numAttempts = 0, good_count = 0; bool success = false; if (_product_id == AP_COMPASS_TYPE_HMC5883L) { calibration_gain = HMC5883L_GAIN_2_50_GA; /* * note that the HMC5883 datasheet gives the x and y expected * values as 766 and the z as 713. Experiments have shown the x * axis is around 766, and the y and z closer to 713. */ expected_x = 766; expected_yz = 713; } else { calibration_gain = HMC5843_GAIN_1_00_GA; expected_x = 715; expected_yz = 715; } uint8_t old_config = _base_config & ~(HMC5843_OPMODE_MASK); while (success == 0 && numAttempts < 25 && good_count < 5) { numAttempts++; // force positiveBias (compass should return 715 for all channels) if (!_bus->register_write(HMC5843_REG_CONFIG_A, old_config | HMC5843_OPMODE_POSITIVE_BIAS)) { // compass not responding on the bus continue; } hal.scheduler->delay(50); // set gains if (!_bus->register_write(HMC5843_REG_CONFIG_B, calibration_gain) || !_bus->register_write(HMC5843_REG_MODE, HMC5843_MODE_SINGLE)) { continue; } // read values from the compass hal.scheduler->delay(50); if (!_read_sample()) { // we didn't read valid values continue; } float cal[3]; // hal.console->printf("mag %d %d %d\n", _mag_x, _mag_y, _mag_z); cal[0] = fabsf(expected_x / (float)_mag_x); cal[1] = fabsf(expected_yz / (float)_mag_y); cal[2] = fabsf(expected_yz / (float)_mag_z); // hal.console->printf("cal=%.2f %.2f %.2f\n", cal[0], cal[1], cal[2]); // we throw away the first two samples as the compass may // still be changing its state from the application of the // strap excitation. After that we accept values in a // reasonable range if (numAttempts <= 2) { continue; } #define IS_CALIBRATION_VALUE_VALID(val) (val > 0.7f && val < 1.35f) if (IS_CALIBRATION_VALUE_VALID(cal[0]) && IS_CALIBRATION_VALUE_VALID(cal[1]) && IS_CALIBRATION_VALUE_VALID(cal[2])) { // hal.console->printf("car=%.2f %.2f %.2f good\n", cal[0], cal[1], cal[2]); good_count++; _scaling[0] += cal[0]; _scaling[1] += cal[1]; _scaling[2] += cal[2]; } #undef IS_CALIBRATION_VALUE_VALID #if 0 /* useful for debugging */ hal.console->printf("MagX: %d MagY: %d MagZ: %d\n", (int)_mag_x, (int)_mag_y, (int)_mag_z); hal.console->printf("CalX: %.2f CalY: %.2f CalZ: %.2f\n", cal[0], cal[1], cal[2]); #endif } if (good_count >= 5) { _scaling[0] = _scaling[0] / good_count; _scaling[1] = _scaling[1] / good_count; _scaling[2] = _scaling[2] / good_count; success = true; } else { /* best guess */ _scaling[0] = 1.0; _scaling[1] = 1.0; _scaling[2] = 1.0; } return success; } /* AP_HAL::I2CDevice implementation of the HMC5843 */ AP_HMC5843_BusDriver_HALDevice::AP_HMC5843_BusDriver_HALDevice(AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev) : _dev(std::move(dev)) { } bool AP_HMC5843_BusDriver_HALDevice::block_read(uint8_t reg, uint8_t *buf, uint32_t size) { return _dev->read_registers(reg, buf, size); } bool AP_HMC5843_BusDriver_HALDevice::register_read(uint8_t reg, uint8_t *val) { return _dev->read_registers(reg, val, 1); } bool AP_HMC5843_BusDriver_HALDevice::register_write(uint8_t reg, uint8_t val) { return _dev->write_register(reg, val); } AP_HAL::Semaphore *AP_HMC5843_BusDriver_HALDevice::get_semaphore() { return _dev->get_semaphore(); } /* HMC5843 on an auxiliary bus of IMU driver */ AP_HMC5843_BusDriver_Auxiliary::AP_HMC5843_BusDriver_Auxiliary(AP_InertialSensor &ins, uint8_t backend_id, uint8_t addr) { /* * Only initialize members. Fails are handled by configure or while * getting the semaphore */ _bus = ins.get_auxiliary_bus(backend_id); if (!_bus) { return; } _slave = _bus->request_next_slave(addr); } AP_HMC5843_BusDriver_Auxiliary::~AP_HMC5843_BusDriver_Auxiliary() { /* After started it's owned by AuxiliaryBus */ if (!_started) { delete _slave; } } bool AP_HMC5843_BusDriver_Auxiliary::block_read(uint8_t reg, uint8_t *buf, uint32_t size) { if (_started) { /* * We can only read a block when reading the block of sample values - * calling with any other value is a mistake */ assert(reg == HMC5843_REG_DATA_OUTPUT_X_MSB); int n = _slave->read(buf); return n == static_cast<int>(size); } int r = _slave->passthrough_read(reg, buf, size); return r > 0 && static_cast<uint32_t>(r) == size; } bool AP_HMC5843_BusDriver_Auxiliary::register_read(uint8_t reg, uint8_t *val) { return _slave->passthrough_read(reg, val, 1) == 1; } bool AP_HMC5843_BusDriver_Auxiliary::register_write(uint8_t reg, uint8_t val) { return _slave->passthrough_write(reg, val) == 1; } AP_HAL::Semaphore *AP_HMC5843_BusDriver_Auxiliary::get_semaphore() { return _bus->get_semaphore(); } bool AP_HMC5843_BusDriver_Auxiliary::configure() { if (!_bus || !_slave) { return false; } return true; } bool AP_HMC5843_BusDriver_Auxiliary::start_measurements() { if (_bus->register_periodic_read(_slave, HMC5843_REG_DATA_OUTPUT_X_MSB, 6) < 0) { return false; } _started = true; return true; } #endif
roger-zhao/ardupilot-3.3
libraries/AP_Compass/AP_Compass_HMC5843.cpp
C++
gpl-3.0
16,360
package com.bitblocker.messenger.ui.view; import android.content.Context; import android.graphics.PointF; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearSmoothScroller; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.util.DisplayMetrics; public class SmoothLinearLayoutManager extends LinearLayoutManager { private static final float MILLISECONDS_PER_INCH = 50f; private Context mContext; public SmoothLinearLayoutManager(Context context) { super(context); mContext = context; } public SmoothLinearLayoutManager(Context context, int orientation, boolean reverseLayout) { super(context, orientation, reverseLayout); mContext = context; } public SmoothLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); mContext = context; } @Override public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, final int position) { super.smoothScrollToPosition(recyclerView, state, position); LinearSmoothScroller smoothScroller = new LinearSmoothScroller(mContext) { //This controls the direction in which smoothScroll looks for your view @Override public PointF computeScrollVectorForPosition(int targetPosition) { return new PointF(0, 1); } //This returns the milliseconds it takes to scroll one pixel. @Override protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) { return MILLISECONDS_PER_INCH / displayMetrics.densityDpi; } }; smoothScroller.setTargetPosition(position); startSmoothScroll(smoothScroller); } }
Dato0011/btb-sms
QKSMS/src/main/java/com/bitblocker/messenger/ui/view/SmoothLinearLayoutManager.java
Java
gpl-3.0
1,903
/* Copyright 2005 Simon Mieth 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.kabeja.dxf.helpers; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author <a href="mailto:simon.mieth@gmx.de>Simon Mieth</a> * */ public class TextDocument { protected List paragraphs = new ArrayList(); /** * Return the pure text content. * * @return the text content */ public String getText() { Iterator i = this.paragraphs.iterator(); StringBuffer buf = new StringBuffer(); while (i.hasNext()) { StyledTextParagraph para = (StyledTextParagraph) i.next(); buf.append(para.getText()); if (para.isNewline()) { buf.append('\n'); } } return buf.toString(); } public void addStyledParagraph(StyledTextParagraph para) { this.paragraphs.add(para); } public Iterator getStyledParagraphIterator() { return this.paragraphs.iterator(); } public int getParagraphCount() { return this.paragraphs.size(); } public StyledTextParagraph getStyleTextParagraph(int i) { return (StyledTextParagraph) this.paragraphs.get(i); } public int getLineCount() { int count = 1; Iterator i = this.paragraphs.iterator(); while (i.hasNext()) { StyledTextParagraph para = (StyledTextParagraph) i.next(); if (para.isNewline()) { count++; } } return count; } public int getMaximumLineLength() { int count = 0; int max = 0; Iterator i = paragraphs.iterator(); while (i.hasNext()) { StyledTextParagraph para = (StyledTextParagraph) i.next(); if (!para.isNewline()) { count += para.getLength(); } else { if (count > max) { max = count; } count = para.getLength(); } } return max; } }
winder/Universal-G-Code-Sender
ugs-platform/ugs-platform-plugin-designer/src/main/java/org/kabeja/dxf/helpers/TextDocument.java
Java
gpl-3.0
2,601
///////////////////////////////////////////////////////////////////////////// // // Project ProjectForge Community Edition // www.projectforge.org // // Copyright (C) 2001-2013 Kai Reinhard (k.reinhard@micromata.de) // // ProjectForge is dual-licensed. // // This community edition 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; version 3 of the License. // // This community edition is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General // Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, see http://www.gnu.org/licenses/. // ///////////////////////////////////////////////////////////////////////////// package org.projectforge.plugins.todo; import org.apache.log4j.Logger; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.spring.injection.annot.SpringBean; import org.projectforge.web.mobile.AbstractMobileEditPage; import org.projectforge.web.mobile.AbstractMobileListPage; public class ToDoMobileEditPage extends AbstractMobileEditPage<ToDoDO, ToDoMobileEditForm, ToDoDao> { private static final long serialVersionUID = 3060701092253890337L; private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(ToDoMobileEditPage.class); @SpringBean(name = "toDoDao") private ToDoDao toDoDao; public ToDoMobileEditPage(final PageParameters parameters) { super(parameters, "toDo"); init(); } @Override protected ToDoDao getBaseDao() { return toDoDao; } @Override protected Logger getLogger() { return log; } @Override protected ToDoMobileEditForm newEditForm(final AbstractMobileEditPage< ? , ? , ? > parentPage, final ToDoDO data) { return new ToDoMobileEditForm(this, data); } @Override protected Class< ? extends AbstractMobileListPage< ? , ? , ? >> getListPageClass() { return ToDoMobileListPage.class; } }
developerleo/ProjectForge-2nd
src/main/java/org/projectforge/plugins/todo/ToDoMobileEditPage.java
Java
gpl-3.0
2,214
<?php get_header(); //include header.php ?> <main id="content"> <?php //THE LOOP if( have_posts() ): ?> <?php while( have_posts() ): the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_post_thumbnail( 'large' , array( 'class' => 'product-image alignright' ) ); ?> <h2 class="entry-title"> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> </h2> <div class="entry-content"> <?php the_meta(); //list of all custom fields ?> <?php the_terms( $post->ID, 'brand', '<b>Brand:</b> ' ); ?> <?php the_terms( $post->ID, 'feature', '<br /><b>Features:</b> ' ); ?> <?php the_content(); ?> </div> </article><!-- end post --> <?php endwhile; ?> <div class="pagination"> <?php if( is_single() ){ //single pagination next_post_link('%link', '&larr; Newer Product: %title ' ); //newer post previous_post_link( '%link', ' Older Product: %title &rarr;' ); //older post }else{ //archive pagination //use pagenavi plugin if it exists if( function_exists('wp_pagenavi') ){ wp_pagenavi(); }else{ next_posts_link('&larr; Older Posts'); //older posts previous_posts_link('Newer Posts &rarr;'); //newer posts } } ?> </div> <?php else: ?> <h2>Sorry, no posts found</h2> <p>Try using the search bar instead</p> <?php endif; //end THE LOOP ?> </main><!-- end #content --> <?php get_sidebar( 'shop' ); //include sidebar.php ?> <?php get_footer(); //include footer.php ?>
melissacabral/awesome-theme-0514
single-product.php
PHP
gpl-3.0
1,554
/************************************************************************* * Copyright 2009-2014 Eucalyptus Systems, Inc. * * 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; version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta * CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need * additional information or have any questions. * * This file may incorporate work covered under the following copyright * and permission notice: * * Software License Agreement (BSD License) * * Copyright (c) 2008, Regents of the University of California * All rights reserved. * * Redistribution and use of this software 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 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. USERS OF THIS SOFTWARE ACKNOWLEDGE * THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL, * COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS SOFTWARE, * AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING * IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA, * SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY, * WHICH IN THE REGENTS' DISCRETION MAY INCLUDE, WITHOUT LIMITATION, * REPLACEMENT OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO * IDENTIFIED, OR WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT * NEEDED TO COMPLY WITH ANY SUCH LICENSES OR RIGHTS. ************************************************************************/ package com.eucalyptus.context; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.apache.log4j.Logger; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.Channels; import org.mule.RequestContext; import org.mule.api.MuleMessage; import com.eucalyptus.BaseException; import com.eucalyptus.http.MappingHttpRequest; import com.eucalyptus.records.EventRecord; import com.eucalyptus.records.EventType; import com.eucalyptus.records.Logs; import com.eucalyptus.util.Consumer; import com.eucalyptus.util.Consumers; import com.eucalyptus.ws.util.ReplyQueue; import edu.ucsb.eucalyptus.msgs.BaseMessage; import edu.ucsb.eucalyptus.msgs.BaseMessageSupplier; import edu.ucsb.eucalyptus.msgs.ExceptionResponseType; import edu.ucsb.eucalyptus.msgs.HasRequest; import static com.eucalyptus.util.Parameters.checkParam; import static org.hamcrest.Matchers.notNullValue; public class Contexts { private static Logger LOG = Logger.getLogger( Contexts.class ); private static int MAX = 8192; private static int CONCUR = MAX / ( Runtime.getRuntime( ).availableProcessors( ) * 2 + 1 ); private static float THRESHOLD = 1.0f; private static ConcurrentMap<String, Context> uuidContexts = new ConcurrentHashMap<String, Context>( MAX, THRESHOLD, CONCUR ); private static ConcurrentMap<Channel, Context> channelContexts = new ConcurrentHashMap<Channel, Context>( MAX, THRESHOLD, CONCUR ); static boolean hasOutstandingRequests( ) { return uuidContexts.keySet( ).size( ) > 0; } public static Context create( MappingHttpRequest request, Channel channel ) { Context ctx = new Context( request, channel ); request.setCorrelationId( ctx.getCorrelationId( ) ); uuidContexts.put( ctx.getCorrelationId( ), ctx ); final Context previousContext = channelContexts.put( channel, ctx ); if ( previousContext != null && previousContext.getCorrelationId() != null ) { uuidContexts.remove( previousContext.getCorrelationId() ); } return ctx; } public static Context update ( Context ctx, final String correlationId) { final String oldId = ctx.getCorrelationId(); uuidContexts.remove(oldId); ctx.setCorrelationId(correlationId); uuidContexts.put( ctx.getCorrelationId( ), ctx ); return ctx; } public static boolean exists( ) { try { lookup( ); return true; } catch ( IllegalContextAccessException ex ) { return false; } } public static boolean exists( Channel channel ) { return channelContexts.containsKey( channel ); } public static Context lookup( Channel channel ) throws NoSuchContextException { if ( !channelContexts.containsKey( channel ) ) { throw new NoSuchContextException( "Found channel context " + channel + " but no corresponding context." ); } else { Context ctx = channelContexts.get( channel ); ctx.setMuleEvent( RequestContext.getEvent( ) ); return Context.maybeImpersonating( ctx ); } } public static boolean exists( String correlationId ) { return correlationId != null && uuidContexts.containsKey( correlationId ); } private static ThreadLocal<Context> tlContext = new ThreadLocal<Context>( ); public static void threadLocal( Context ctx ) {//GRZE: really unhappy these are public. tlContext.set( ctx ); } public static void removeThreadLocal( ) {//GRZE: really unhappy these are public. tlContext.remove( ); } public static <T> Consumer<T> consumerWithCurrentContext( final Consumer<T> consumer ) { return consumerWithContext( consumer, Contexts.lookup() ); } public static <T> Consumer<T> consumerWithContext( final Consumer<T> consumer, final Context context ) { return new Consumer<T>( ) { @Override public void accept( final T t ) { final Context previously = tlContext.get( ); threadLocal( context ); try { consumer.accept( t ); } finally { threadLocal( previously ); } } }; } public static Runnable runnableWithCurrentContext( final Runnable runnable ) { return runnableWithContext( runnable, Contexts.lookup( ) ); } public static Runnable runnableWithContext( final Runnable runnable, final Context context ) { return Consumers.partial( consumerWithContext( Consumers.forRunnable( runnable ), context ), null ); } public static Context lookup( String correlationId ) throws NoSuchContextException { checkParam( "BUG: correlationId is null.", correlationId, notNullValue() ); if ( !uuidContexts.containsKey( correlationId ) ) { throw new NoSuchContextException( "Found correlation id " + correlationId + " but no corresponding context." ); } else { Context ctx = uuidContexts.get( correlationId ); ctx.setMuleEvent( RequestContext.getEvent( ) ); return Context.maybeImpersonating( ctx ); } } public static final Context lookup( ) throws IllegalContextAccessException { Context ctx; if ( ( ctx = tlContext.get( ) ) != null ) { return Context.maybeImpersonating( ctx ); } BaseMessage parent = null; MuleMessage muleMsg = null; if ( RequestContext.getEvent( ) != null && RequestContext.getEvent( ).getMessage( ) != null ) { muleMsg = RequestContext.getEvent( ).getMessage( ); } else if ( RequestContext.getEventContext( ) != null && RequestContext.getEventContext( ).getMessage( ) != null ) { muleMsg = RequestContext.getEventContext( ).getMessage( ); } else { throw new IllegalContextAccessException( "Cannot access context implicitly using lookup(V) outside of a service." ); } Object o = muleMsg.getPayload( ); if ( o != null && o instanceof BaseMessage ) { try { return Contexts.lookup( ( ( BaseMessage ) o ).getCorrelationId( ) ); } catch ( NoSuchContextException e ) { Logs.exhaust( ).error( e, e ); throw new IllegalContextAccessException( "Cannot access context implicitly using lookup(V) when not handling a request.", e ); } } else if ( o != null && o instanceof HasRequest ) { try { return Contexts.lookup( ( ( HasRequest ) o ).getRequest( ).getCorrelationId( ) ); } catch ( NoSuchContextException e ) { Logs.exhaust( ).error( e, e ); throw new IllegalContextAccessException( "Cannot access context implicitly using lookup(V) when not handling a request.", e ); } } else { throw new IllegalContextAccessException( "Cannot access context implicitly using lookup(V) when not handling a request." ); } } public static void clear( String corrId ) { checkParam( "BUG: correlationId is null.", corrId, notNullValue() ); Context ctx = uuidContexts.remove( corrId ); Channel channel = null; if ( ctx != null && ( channel = ctx.getChannel( ) ) != null ) { channelContexts.remove( channel ); } else { LOG.trace( "Context.clear() failed for correlationId=" + corrId ); Logs.extreme( ).trace( "Context.clear() failed for correlationId=" + corrId, new RuntimeException( "Missing reference to channel for the request." ) ); } if ( ctx != null ) { ctx.clear( ); } } public static void clear( Context context ) { if ( context != null ) { clear( context.getCorrelationId( ) ); } } public static Context createWrapped( String dest, final BaseMessage msg ) { if ( uuidContexts.containsKey( msg.getCorrelationId( ) ) ) { return null; } else { Context ctx = new Context( dest, msg ); uuidContexts.put( ctx.getCorrelationId( ), ctx ); return Context.maybeImpersonating( ctx ); } } public static void response( BaseMessage responseMessage ) { response( responseMessage, responseMessage ); } /** * Respond with the given supplier. * * <p>This allows a response with associated details such as an HTTP status * code.</p> * * @param responseMessageSupplier The supplier to use */ public static void response( final BaseMessageSupplier responseMessageSupplier ) { response( responseMessageSupplier, responseMessageSupplier.getBaseMessage() ); } @SuppressWarnings( "unchecked" ) private static void response( final Object message, final BaseMessage responseMessage ) { if ( responseMessage instanceof ExceptionResponseType ) { Logs.exhaust( ).trace( responseMessage ); } String corrId = responseMessage.getCorrelationId( ); try { Context ctx = lookup( corrId ); EventRecord.here( ServiceContext.class, EventType.MSG_REPLY, responseMessage.getCorrelationId( ), responseMessage.getClass( ).getSimpleName( ), String.format( "%.3f ms", ( System.nanoTime( ) - ctx.getCreationTime( ) ) / 1000000.0 ) ).trace( ); Channel channel = ctx.getChannel( ); Channels.write( channel, message ); clear( ctx ); } catch ( NoSuchContextException e ) { LOG.warn( "Received a reply for absent client: No channel to write response message: " + e.getMessage( ) + " for " + responseMessage.getClass( ).getSimpleName( ) ); Logs.extreme( ).debug( responseMessage, e ); } catch ( Exception e ) { LOG.warn( "Error occurred while handling reply: " + responseMessage ); Logs.extreme( ).debug( responseMessage, e ); } } public static void responseError( Throwable cause ) { try { Contexts.responseError( lookup( ).getCorrelationId( ), cause ); } catch ( Exception e ) { LOG.error( e ); Logs.extreme( ).error( cause, cause ); } } public static void responseError( String corrId, Throwable cause ) { try { Context ctx = lookup( corrId ); EventRecord.here( ReplyQueue.class, EventType.MSG_REPLY, cause.getClass( ).getCanonicalName( ), cause.getMessage( ), String.format( "%.3f ms", ( System.nanoTime( ) - ctx.getCreationTime( ) ) / 1000000.0 ) ).trace( ); if (cause.getCause() != null) { Channel channel = ctx.getChannel( ); Channels.write( channel, new ExceptionResponseType( ctx.getRequest( ), cause.getCause( ).getMessage( ), cause.getCause( ) ) ); } if ( !( cause instanceof BaseException ) ) { clear( ctx ); } } catch ( Exception ex ) { LOG.error( ex, ex ); Logs.extreme( ).error( cause, cause ); } } }
davenpcj5542009/eucalyptus
clc/modules/msgs/src/main/java/com/eucalyptus/context/Contexts.java
Java
gpl-3.0
13,850
""" :copyright: (c) 2015 by OpenCredo. :license: GPLv3, see LICENSE for more details. """ import logging import json log = logging.getLogger(__name__) redis_server = None redis_master_server = None def get_redis_slave(): return redis_server def get_redis_master(): return redis_master_server class QueueIterator(object): def __init__(self, queue, start=0): self.q = queue self.iter = iter(range(start, len(self.q))) def __iter__(self): return self def next(self): """ Retrieve the next message in the queue. """ i = self.iter.next() return self.q.get_item(i) class Queue(object): def __init__(self, name, server=None): self.name = name self.server = server or redis_server def size(self): return sum([len(self.server.lindex(self.name, m)) for m in range(0, len(self))]) def put_raw(self, data): self.server.rpush(self.name, data) def get_raw(self): return self.server.lpop(self.name) def put(self, msg): json_msg = json.dumps(msg) self.server.rpush(self.name, json_msg) def get(self, timeout=None): if timeout: result = self.server.blpop(self.name, timeout) if result: result = result[1] else: result = self.server.lpop(self.name) if result: result = json.loads(result) return result def get_item(self, index): msg = self.server.lindex(self.name, index) if msg: msg = json.loads(msg) return msg def __len__(self): return self.server.llen(self.name) def __iter__(self): return QueueIterator(self) def delete(self): return self.server.delete(self.name) class String(object): def __init__(self, server=None, ttl=None): self.server = server or redis_server self.ttl = ttl or 24 * 7 * 3600 # 7 days def set_raw(self, key, msg): self.server.setex(key, msg, self.ttl) def get_raw(self, key): return self.server.get(key) def get(self, key): try: return json.loads(self.get_raw(key)) except TypeError: return None def set(self, key, msg): self.set_raw(key, json.dumps(msg)) def delete(self, key): return self.server.delete(key) class Hash(object): def __init__(self, server=None): self.server = server or redis_server def get(self, name, key): try: return json.loads(self.get_raw(name, key)) except TypeError: return None def set(self, name, key, msg): return self.set_raw(name, key, json.dumps(msg)) def set_raw(self, name, key, msg): return self.server.hset(name, key, msg) def incr(self, name, key, amount=1): return self.server.hincrby(name, key, amount=amount) def get_raw(self, name, key): return self.server.hget(name, key) def get_all_raw(self, name): return self.server.hgetall(name) def get_all(self, name): return dict((k, json.loads(v)) for k, v in self.server.hgetall( name).iteritems()) def keys(self, name): return self.server.hkeys(name) def values(self, name): return [json.loads(x) for x in self.server.hvals(name)] def delete(self, name, *keys): """ delete the hash key """ return self.server.hdel(name, *keys) def remove(self, name): """ delete the hash """ return self.server.delete(name) def exists(self, name, key): return self.server.hexists(name, key) def get_queue(q=None): q = q or Queue return q
rusenask/stubo-app
stubo/cache/queue.py
Python
gpl-3.0
3,776
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using PyTK; using PyTK.Extensions; using PyTK.PlatoUI; using PyTK.Types; using StardewModdingAPI; using StardewValley; using StardewValley.Menus; using System; using System.Collections.Generic; using System.Linq; namespace Portraiture { public class MenuLoader { const int listElementHeight = 128; const int numPortraits = 7; const int listElementWidth = (listElementHeight - margin * 2) * numPortraits + (margin * (numPortraits + 1)); const int elementsPerPage = 3; const int margin = 10; public static void OpenMenu(IClickableMenu prioMenu = null) { PlatoUIMenu menu = null; List<UIElement> folders = new List<UIElement>(); foreach (string folder in TextureLoader.folders) folders.AddOrReplace(GetElementForFolder(folder)); int f = folders.Count; Texture2D circle = PyDraw.getCircle(margin * 9, Color.White); UIElement container = UIElement.GetContainer("PortraitureMenu", 0, UIHelper.GetCentered(0, 0, listElementWidth + margin * 2, listElementHeight * elementsPerPage + margin * 3), 1); UIElement listbox = new UIElement("ListBox", UIHelper.GetCentered(0, 0, listElementWidth + margin * 2, listElementHeight * elementsPerPage + margin * 3), 0, UIHelper.PlainTheme, Color.Black * 0.5f, 1, false); UIElementList list = new UIElementList("PortraitFolders", true, 0, 1, 5, 0, true, UIHelper.GetCentered(0, 0, listElementWidth, listElementHeight * elementsPerPage + margin), UIHelper.GetFixed(0, 0, listElementWidth, listElementHeight), folders.ToArray()); UIElement closeBtn = UIElement.GetImage(circle, Color.White, "CloseBtn", 0.8f, 99, UIHelper.GetAttachedDiagonal(listbox, false, true, margin, -1 * margin, margin * 3, margin * 3)).WithInteractivity(click: (point, right, release, hold, element) => { if (release) menu?.exitThisMenu(); }, hover: (point, hoverIn, element) => { if (hoverIn != element.WasHover) Game1.playSound("smallSelect"); if (hoverIn) element.Opacity = 1f; else element.Opacity = 0.8f; }); closeBtn.Add(UIElement.GetImage(circle, Color.DarkCyan, "CloseBtn_Inner", 1, 0, UIHelper.GetCentered(0, 0, margin, margin))); container.Add(closeBtn); listbox.Add(list); container.Add(listbox); UIElement scrollBar = UIElement.GetContainer("ScrollBarContainer", 0, UIHelper.GetAttachedHorizontal(listbox, false, 1, margin, 0, margin * 2, listElementHeight * 2)); UIElement up = UIElement.GetImage(PyDraw.getFade(margin * 2, margin * 2, Color.White, Color.Gray, false), Color.DarkCyan, "ScrollUp", 1, 0, UIHelper.GetTopCenter()); UIElement down = UIElement.GetImage(PyDraw.getFade(margin * 2, margin * 2, Color.White, Color.Gray, false), Color.DarkCyan, "ScrollDown", 1, 0, UIHelper.GetBottomCenter()); UIElement bar = UIElement.GetImage(PyDraw.getFade(margin * 2, listElementHeight * 2 - margin * 4, Color.White, Color.Gray, false), Color.White, "ScrollBar", 1, 0, UIHelper.GetCentered()); UIElement scrollPoint = UIElement.GetImage(circle, Color.DarkCyan, "ScrollPoint", 1, 0, (t, p) => { int w = p.Bounds.Width; int h = p.Bounds.Height / (f - 2); int x = 0; int y = list.Position * h; return new Rectangle(p.Bounds.X + x, p.Bounds.Y + y, w, h); }); if (f > 3) { bar.Add(scrollPoint.WithBase(list)); scrollBar.Add(up.WithBase(list).WithInteractivity(click: clickScrollBar, hover: hoverScrollBar)); scrollBar.Add(down.WithBase(list).WithInteractivity(click: clickScrollBar, hover: hoverScrollBar)); scrollBar.Add(bar.WithBase(list).WithInteractivity(click: clickScrollBar)); listbox.Add(scrollBar); } menu = UIHelper.OpenMenu("PortraitureMenu", container); menu.exitFunction = new IClickableMenu.onExit(() => { if (prioMenu != null) Game1.activeClickableMenu = prioMenu; }); } public static void hoverScrollBar(Point point, bool hoverIn, UIElement element) { element.Color = hoverIn ? Color.Cyan : Color.DarkCyan; } public static void clickScrollBar(Point point, bool right, bool release, bool hold, UIElement element) { if (!right && release) { bool scrolled = false; if (element.Id == "ScrollUp") scrolled = (element.Base as UIElementList).ChangePosition(-1); if (element.Id == "ScrollDown") scrolled = (element.Base as UIElementList).ChangePosition(1); if (scrolled) Game1.playSound("smallSelect"); } } public static UIElement GetElementForFolder(string folder) { if (folder == null) folder = "Null"; bool active = TextureLoader.getFolderName() == folder; UIElement element = new UIElement(folder, UIHelper.Fill, 0, UIHelper.PlainTheme, Color.White, active ? 1f : 0.75f, false).AsSelectable("Folder", (s, e) => { e.Opacity = s ? 1f : 0.7f; e.GetElementById(e.Id + "_BgName").Color = s ? Color.DarkCyan : Color.Black; if (s) Game1.playSound("coin"); if (e.Base != null) { if (s) foreach (UIElement selected in e.Base.GetSelected()) if (selected != e) selected.Deselect(); if (!s) if ((new List<UIElement>(e.Base.GetSelected())).Count == 0) e.Select(); } if(s) setFolder(e.Id); }).WithInteractivity(hover:(point,hoverIn,e) => { if (e.IsSelected) return; if(hoverIn != e.WasHover) Game1.playSound("smallSelect"); if (hoverIn) e.Opacity = e.IsSelected ? 1f : 0.9f; else e.Opacity = e.IsSelected ? 1f : 0.75f; }); element.IsSelected = active; element.Overflow = true; int LastX = 0; float i = 0; bool scaled = false; if(folder == "Vanilla") { List<NPC> npcs = new List<NPC>(); for (int c = 0; c < numPortraits; c++) { NPC npc = null; while (npc == null || npcs.Contains(npc)) npc = Utility.getRandomTownNPC(); npcs.Add(npc); Texture2D p = Game1.content.Load<Texture2D>(@"Portraits/" + npc.Name); if (p is Texture2D portrait) { Texture2D t = portrait is ScaledTexture2D st ? st.STexture : portrait; int mx = Math.Max(t.Width / 2, 64); Rectangle s = new Rectangle(0, 0, mx, mx); int w = listElementHeight - margin * 2; int x = LastX + margin; LastX = x + w; i++; UIElement pic = UIElement.GetImage(portrait, Color.White, folder + "_Portrait_" + npc.Name, 1f / (i + 1), 0, UIHelper.GetTopLeft(x, margin, w)).WithSourceRectangle(s); element.Add(pic); } } } else foreach (var texture in TextureLoader.pTextures.Where(k => k.Key.StartsWith(folder))) if (texture.Value is Texture2D portrait) { if (i >= numPortraits) { i++; continue; } if (portrait is ScaledTexture2D || scaled) scaled = true; Texture2D t = portrait is ScaledTexture2D st ? st.STexture : portrait; int mx = Math.Max(t.Width / 2, 64); Rectangle s = new Rectangle(0, 0, mx, mx); int w = listElementHeight - margin * 2; int x = LastX + margin; LastX = x + w; i++; UIElement pic = UIElement.GetImage(portrait, Color.White, folder + "_Portrait_" + texture.Key, 1f / (i+1), 0, UIHelper.GetTopLeft(x, margin, w)).WithSourceRectangle(s); element.Add(pic); } UITextElement name = new UITextElement(folder, Game1.smallFont, Color.White,0.5f, 1f, folder + "_Name", 2, UIHelper.GetTopLeft(margin, margin)); UITextElement num = new UITextElement(folder == "Vanilla" ? " " : i.ToString(), Game1.tinyFont, Color.Black,1f, 1f, folder + "_Num", 2, UIHelper.GetBottomRight(-1* margin, -1* margin)); var size = (Game1.smallFont.MeasureString(folder) * 0.5f).toPoint(); var scaleText = scaled ? "128+" : "64"; var scaleSize = (Game1.smallFont.MeasureString("XX") * 0.5f).toPoint(); int sIBSize = Math.Max(scaleSize.X, scaleSize.Y) + margin * 2; Point bgSize = new Point(size.X + margin * 4, size.Y + margin * 2); Texture2D bgName = PyTK.PyDraw.getFade(bgSize.X * 4, bgSize.Y * 4, Color.White * 0.8f, Color.Transparent); UIElement nameBg = UIElement.GetImage(bgName, active ? Color.DarkCyan : Color.Black, folder + "_BgName", 1, 1, UIHelper.GetTopLeft(0, 0, bgSize.X)); UIElement scaleInfoText = new UITextElement(scaleText, Game1.smallFont, Color.White, 0.5f, 1, folder + "_Scale", 2, UIHelper.GetCentered()); UIElement scaleInfoBackground = UIElement.GetImage(PyDraw.getCircle((int)(sIBSize * (scaled ? 4 : 1)), Color.White), Color.LightGray,folder + "_ScaleBG",1,1, UIHelper.GetTopRight(-1 * margin, margin, sIBSize)); scaleInfoBackground.Add(scaleInfoText); element.Add(name); element.Add(num); element.Add(scaleInfoBackground); element.Add(nameBg); return element; } private static void setFolder(string folder) { string current = TextureLoader.getFolderName(); while (TextureLoader.getFolderName() != folder) { TextureLoader.nextFolder(); if (TextureLoader.getFolderName() == current) break; } } } }
Platonymous/Stardew-Valley-Mods
Portraiture/MenuLoader.cs
C#
gpl-3.0
11,359
package de.raptor2101.BattleWorldsKronos.Connector.Gui.Activities; import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import de.raptor2101.BattleWorldsKronos.Connector.AbstractConnectorApp; import de.raptor2101.BattleWorldsKronos.Connector.Data.Entities.Message; import de.raptor2101.BattleWorldsKronos.Connector.Gui.R; import de.raptor2101.BattleWorldsKronos.Connector.Tasks.SendMessageTask; import de.raptor2101.BattleWorldsKronos.Connector.Tasks.SendMessageTask.Result; import de.raptor2101.BattleWorldsKronos.Connector.Tasks.ServerConnectionTask.ResultListener; public abstract class AbstractWriteMessageActivity extends Activity implements ResultListener<Result> { public final static String INTENT_EXTRA_MESSAGE_RESPOND_TO = "RESPONSE_MESSAGE"; private SendMessageTask mTask; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.message_write_activity); View view = (View) findViewById(R.id.text_write_message_respond_box); Message message = (Message) getIntent().getExtras().get(INTENT_EXTRA_MESSAGE_RESPOND_TO); if(message != null){ EditText editText = (EditText) findViewById(R.id.edit_write_message_receiver); editText.setText(message.getAuthorName()); TextView textView = (TextView) findViewById(R.id.text_write_message_respond_text); textView.setText(message.getMessageText()); view.setVisibility(View.VISIBLE); } else{ view.setVisibility(View.GONE); } } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { if (item.getItemId() == R.id.action_send_message) { Message messageRespondTo = (Message) getIntent().getExtras().get(INTENT_EXTRA_MESSAGE_RESPOND_TO); SendMessageTask.Message message = new SendMessageTask.Message(); EditText editText = (EditText) findViewById(R.id.edit_write_message_receiver); if(messageRespondTo == null){ message.setReceiver(editText.getText().toString()); } else { message.setReceiver(messageRespondTo.getAuthorName()); message.setLastMessageId(messageRespondTo.getLastMessageId()); } editText = (EditText) findViewById(R.id.edit_write_message_text); message.setText(editText.getText().toString()); if (mTask != null) { mTask.cancel(true); } mTask = new SendMessageTask((AbstractConnectorApp) this.getApplication(), this); mTask.execute(message); ProgressBar progressBar = getProgressBar(); progressBar.setVisibility(View.VISIBLE); } return super.onMenuItemSelected(featureId, item); } @Override public void handleResult(Result result) { mTask = null; ProgressBar progressBar = getProgressBar(); progressBar.setVisibility(View.GONE); if (result.areAllMessagesSuccesfullySend()) { this.finish(); } else { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.alert_dialog_send_message_error_message); builder.setTitle(R.string.alert_dialog_send_message_error_title); builder.create().show(); } }; protected abstract ProgressBar getProgressBar(); }
raptor2101/BWKConnector.Library.Base
src/de/raptor2101/BattleWorldsKronos/Connector/Gui/Activities/AbstractWriteMessageActivity.java
Java
gpl-3.0
3,444
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Questionnaire and Consent</title> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body> <form name = "questionnaire_form" id = "questionnaire_form" action="questionnaire2.php" method="POST"> <fieldset> <legend><b>3. Questionnaire and Consent</b></legend> <br><br> <label>A. What <a href="explanations.html#interests">interests</a> do you have? (please select at least one)</label><br><br> <hr> <label><a href="explanations.html#arts_and_entertainment">Arts and Entertainment</a></label> <input type='hidden' class="interestsa" value='0' name="arts_and_entertainment"/> <input type='checkbox' class="interestsb" value='1' name="arts_and_entertainment"/><br> <hr> <label><a href="explanations.html#autos_and_vehicles">Autos and Vehicles</a></label> <input type='hidden' class="interestsa" value='0' name="autos_and_vehicles"/> <input type='checkbox' class="interestsb" value='1' name="autos_and_vehicles"/><br> <hr> <label><a href="explanations.html#beauty_and_fitness">Beauty and Fitness</a></label> <input type='hidden' class="interestsa" value='0' name="beauty_and_fitness"/> <input type='checkbox' class="interestsb" value='1' name="beauty_and_fitness"/><br> <hr> <label><a href="explanations.html#books_and_literature">Books and Literature</a></label> <input type='hidden' class="interestsa" value='0' name="books_and_literature"/> <input type='checkbox' class="interestsb" value='1' name="books_and_literature"/><br> <hr> <label><a href="explanations.html#business_and_industrial">Business and Industrial</a></label> <input type='hidden' class="interestsa" value='0' name="business_and_industrial"/> <input type='checkbox' class="interestsb" value='1' name="business_and_industrial"/><br> <hr> <label><a href="explanations.html#computers_and_electronics">Computers and Electronics</a></label> <input type='hidden' class="interestsa" value='0' name="computers_and_electronics"/> <input type='checkbox' class="interestsb" value='1' name="computers_and_electronics"/><br> <hr> <label><a href="explanations.html#finance">Finance</a></label> <input type='hidden' class="interestsa" value='0' name="finance"/> <input type='checkbox' class="interestsb" value='1' name="finance"/><br> <hr> <label><a href="explanations.html#food_and_drink">Food and Drink</a></label> <input type='hidden' class="interestsa" value='0' name="food_and_drink"/> <input type='checkbox' class="interestsb" value='1' name="food_and_drink"/><br> <hr> <label><a href="explanations.html#games">Games</a></label> <input type='hidden' class="interestsa" value='0' name="games"/> <input type='checkbox' class="interestsb" value='1' name="games"/><br> <hr> <label><a href="explanations.html#hobbies_and_leisure">Hobbies and Leisure</a></label> <input type='hidden' class="interestsa" value='0' name="hobbies_and_leisure"/> <input type='checkbox' class="interestsb" value='1' name="hobbies_and_leisure"/><br> <hr> <label><a href="explanations.html#home_and_garden">Home and Garden</a></label> <input type='hidden' class="interestsa" value='0' name="home_and_garden"/> <input type='checkbox' class="interestsb" value='1' name="home_and_garden"/><br> <hr> <label><a href="explanations.html#internet_and_telecom">Internet and Telecom</a></label> <input type='hidden' class="interestsa" value='0' name="internet_and_telecom"/> <input type='checkbox' class="interestsb" value='1' name="internet_and_telecom"/><br> <hr> <label><a href="explanations.html#jobs_and_education">Jobs and Education</a></label> <input type='hidden' class="interestsa" value='0' name="jobs_and_education"/> <input type='checkbox' class="interestsb" value='1' name="jobs_and_education"/><br> <hr> <label><a href="explanations.html#law_and_government">Law and Government</a></label> <input type='hidden' class="interestsa" value='0' name="law_and_government"/> <input type='checkbox' class="interestsb" value='1' name="law_and_government"/><br> <hr> <label><a href="explanations.html#news">News</a></label> <input type='hidden' class="interestsa" value='0' name="news"/> <input type='checkbox' class="interestsb" value='1' name="news"/><br> <hr> <label><a href="explanations.html#online_communities">Online Communities</a></label> <input type='hidden' class="interestsa" value='0' name="online_communities"/> <input type='checkbox' class="interestsb" value='1' name="online_communities"/><br> <hr> <label><a href="explanations.html#people_and_society">People and Society</a></label> <input type='hidden' class="interestsa" value='0' name="people_and_society"/> <input type='checkbox' class="interestsb" value='1' name="people_and_society"/><br> <hr> <label><a href="explanations.html#pets_and_animals">Pets and Animals</a></label> <input type='hidden' class="interestsa" value='0' name="pets_and_animals"/> <input type='checkbox' class="interestsb" value='1' name="pets_and_animals"/><br> <hr> <label><a href="explanations.html#real_estate">Real Estate</a></label> <input type='hidden' class="interestsa" value='0' name="real_estate"/> <input type='checkbox' class="interestsb" value='1' name="real_estate"/><br> <hr> <label><a href="explanations.html#reference">Reference</a></label> <input type='hidden' class="interestsa" value='0' name="reference"/> <input type='checkbox' class="interestsb" value='1' name="reference"/><br> <hr> <label><a href="explanations.html#science">Science</a></label> <input type='hidden' class="interestsa" value='0' name="science"/> <input type='checkbox' class="interestsb" value='1' name="science"/><br> <hr> <label><a href="explanations.html#shopping">Shopping</a></label> <input type='hidden' class="interestsa" value='0' name="shopping"/> <input type='checkbox' class="interestsb" value='1' name="shopping"/><br> <hr> <label><a href="explanations.html#sports">Sports</a></label> <input type='hidden' class="interestsa" value='0' name="sports"/> <input type='checkbox' class="interestsb" value='1' name="sports"/><br> <hr> <label><a href="explanations.html#travel">Travel</a></label> <input type='hidden' class="interestsa" value='0' name="travel"/> <input type='checkbox' class="interestsb" value='1' name="travel"/><br> <hr> <label><a href="explanations.html#world_localities">World Localities</a></label> <input type='hidden' class="interestsa" value='0' name="world_localities"/> <input type='checkbox' class="interestsb" value='1' name="world_localities"/><br> <hr> <br><br> <label>B. What type of <a href="explanations.html#personas">persona</a> are you? (please select at least one)</label><br><br> <hr> <label><a href="explanations.html#business_professionals">Business Professional</a></label> <input type='hidden' class="personasa" value='0' name="business_professionals"/> <input type='checkbox' class="personasb" value='1' name="business_professionals"/><br> <hr> <label><a href="explanations.html#personal_finance_geeks">Personal Finance Geek</a></label> <input type='hidden' class="personasa" value='0' name="personal_finance_geeks"/> <input type='checkbox' class="personasb" value='1' name="personal_finance_geeks"/><br> <hr> <label><a href="explanations.html#real_estate_followers">Real Estate Follower</a></label> <input type='hidden' class="personasa" value='0' name="real_estate_followers"/> <input type='checkbox' class="personasb" value='1' name="real_estate_followers"/><br> <hr> <label><a href="explanations.html#small_business_owners">Small Business Owner</a></label> <input type='hidden' class="personasa" value='0' name="small_business_ownwers"/> <input type='checkbox' class="personasb" value='1' name="small_business_ownwers"/><br> <hr> <label><a href="explanations.html#business_travelers">Business Traveler</a></label> <input type='hidden' class="personasa" value='0' name="business_travelers"/> <input type='checkbox' class="personasb" value='1' name="business_travelers"/><br> <hr> <label><a href="explanations.html#flight_intenders">Flight Intender</a></label> <input type='hidden' class="personasa" value='0' name="flight_intenders"/> <input type='checkbox' class="personasb" value='1' name="flight_intenders"/><br> <hr> <label><a href="explanations.html#leisure_travelers">Leisure Traveler</a></label> <input type='hidden' class="personasa" value='0' name="leisure_travelers"/> <input type='checkbox' class="personasb" value='1' name="leisure_travelers"/><br> <hr> <label><a href="explanations.html#catalog_shoppers">Catalog Shopper</a></label> <input type='hidden' class="personasa" value='0' name="catalog_shoppers"/> <input type='checkbox' class="personasb" value='1' name="catalog_shoppers"/><br> <hr> <label><a href="explanations.html#mobile_payment_makers">Mobile Payment Maker</a></label> <input type='hidden' class="personasa" value='0' name="mobile_payment_makers"/> <input type='checkbox' class="personasb" value='1' name="mobile_payment_makers"/><br> <hr> <label><a href="explanations.html#value_shoppers">Value Shopper</a></label> <input type='hidden' class="personasa" value='0' name="value_shoppers"/> <input type='checkbox' class="personasb" value='1' name="value_shoppers"/><br> <hr> <label><a href="explanations.html#american_football_fans">American Football Fan</a></label> <input type='hidden' class="personasa" value='0' name="american_football_fans"/> <input type='checkbox' class="personasb" value='1' name="american_football_fans"/><br> <hr> <label><a href="explanations.html#avid_runners">Avid Runner</a></label> <input type='hidden' class="personasa" value='0' name="avid_runners"/> <input type='checkbox' class="personasb" value='1' name="avid_runners"/><br> <hr> <label><a href="explanations.html#sports_fans">Sports Fan</a></label> <input type='hidden' class="personasa" value='0' name="sports_fans"/> <input type='checkbox' class="personasb" value='1' name="sports_fans"/><br> <hr> <label><a href="explanations.html#bookworms">Bookworm</a></label> <input type='hidden' class="personasa" value='0' name="bookworms"/> <input type='checkbox' class="personasb" value='1' name="bookworms"/><br> <hr> <label><a href="explanations.html#casual_and_social_gamers">Casual and Social Gamer</a></label> <input type='hidden' class="personasa" value='0' name="casual_and_social_gamers"/> <input type='checkbox' class="personasb" value='1' name="casual_and_social_gamers"/><br> <hr> <label><a href="explanations.html#entertainment_enthusiasts">Entertainment Enthusiast</a></label> <input type='hidden' class="personasa" value='0' name="entertainment_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="entertainment_enthusiasts"/><br> <hr> <label><a href="explanations.html#hardcore_gamers">Hardcore Gamer</a></label> <input type='hidden' class="personasa" value='0' name="hardcore_gamers"/> <input type='checkbox' class="personasb" value='1' name="hardcore_gamers"/><br> <hr> <label><a href="explanations.html#movie_lovers">Movie Lover</a></label> <input type='hidden' class="personasa" value='0' name="movie_lovers"/> <input type='checkbox' class="personasb" value='1' name="movie_lovers"/><br> <hr> <label><a href="explanations.html#music_lovers">Music Lover</a></label> <input type='hidden' class="personasa" value='0' name="music_lovers"/> <input type='checkbox' class="personasb" value='1' name="music_lovers"/><br> <hr> <label><a href="explanations.html#news_and_magazine_readers">News and Magazine Reader</a></label> <input type='hidden' class="personasa" value='0' name="news_and_magazine_readers"/> <input type='checkbox' class="personasb" value='1' name="news_and_magazine_readers"/><br> <hr> <label><a href="explanations.html#slots_players">Slots Player</a></label> <input type='hidden' class="personasa" value='0' name="slots_players"/> <input type='checkbox' class="personasb" value='1' name="slots_players"/><br> <hr> <label><a href="explanations.html#auto_enthusiasts">Auto Enthusiast</a></label> <input type='hidden' class="personasa" value='0' name="auto_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="auto_enthusiasts"/><br> <hr> <label><a href="explanations.html#fashionistas">Fashionista</a></label> <input type='hidden' class="personasa" value='0' name="fashionistas"/> <input type='checkbox' class="personasb" value='1' name="fashionistas"/><br> <hr> <label><a href="explanations.html#food_and_dining_lovers">Food and Dining Lover</a></label> <input type='hidden' class="personasa" value='0' name="food_and_dining_lovers"/> <input type='checkbox' class="personasb" value='1' name="food_and_dining_lovers"/><br> <hr> <label><a href="explanations.html#health_and_fitness_enthusiasts">Health and Fitness Enthusiast</a></label> <input type='hidden' class="personasa" value='0' name="health_and_fitness_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="health_and_fitness_enthusiasts"/><br> <hr> <label><a href="explanations.html#high_net_individuals">High Net Individual</a></label> <input type='hidden' class="personasa" value='0' name="high_net_individuals"/> <input type='checkbox' class="personasb" value='1' name="high_net_individuals"/><br> <hr> <label><a href="explanations.html#home_design_enthusiasts">Home Design Enthusiast</a></label> <input type='hidden' class="personasa" value='0' name="home_design_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="home_design_enthusiasts"/><br> <hr> <label><a href="explanations.html#home_and_garden_pros">Home and Garden Pro</a></label> <input type='hidden' class="personasa" value='0' name="home_and_garden_pros"/> <input type='checkbox' class="personasb" value='1' name="home_and_garden_pros"/><br> <hr> <label><a href="explanations.html#new_mothers">New Mother</a></label> <input type='hidden' class="personasa" value='0' name="new_mothers"/> <input type='checkbox' class="personasb" value='1' name="new_mothers"/><br> <hr> <label><a href="explanations.html#photo_and_video_enthusiasts">Photo and Video Enthusiast</a></label> <input type='hidden' class="personasa" value='0' name="photo_and_video_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="photo_and_video_enthusiasts"/><br> <hr> <label><a href="explanations.html#singles">Single</a></label> <input type='hidden' class="personasa" value='0' name="singles"/> <input type='checkbox' class="personasb" value='1' name="singles"/><br> <hr> <label><a href="explanations.html#social_influencers">Social Influencer</a> <input type='hidden' class="personasa" value='0' name="social_influencers"/> <input type='checkbox' class="personasb" value='1' name="social_influencers"/><br> <hr> <label><a href="explanations.html#tech_and_gadget_enthusiasts">Tech and Gadget Enthusiast</a> <input type='hidden' class="personasa" value='0' name="tech_and_gadget_enthusiasts"/> <input type='checkbox' class="personasb" value='1' name="tech_and_gadget_enthusiasts"/><br> <hr> <label><a href="explanations.html#mothers">Mother</a></label> <input type='hidden' class="personasa" value='0' name="mothers"/> <input type='checkbox' class="personasb" value='1' name="mothers"/><br> <hr> <label><a href="explanations.html#parenting_and_education">Parenting and Education</a> <input type='hidden' class="personasa" value='0' name="parenting_and_education"/> <input type='checkbox' class="personasb" value='1' name="parenting_and_education"/><br> <hr> <label><a href="explanations.html#pet_owners">Pet Owner</a></label> <input type='hidden' class="personasa" value='0' name="pet_owners"/> <input type='checkbox' class="personasb" value='1' name="pet_owners"/><br> <hr> <br><br> <label>C. Please enter your personal information.</label> <br><br> <input type="hidden" id="identifier" input name="identifier" value=" <?php echo $_COOKIE['user_id']; ?>"/> <label>First Name </label> <input type="text" name="first_name" id="first_name"/><br><br> <label>Last Name </label> <input type="text" name="last_name" id="last_name"/><br><br> <label>E-Mail </label> <input type="text" name="e_mail" id="e_mail"/><br><br> <label>Gender </label> <select name="gender" id="gender"> <option value="">Select...</option> <option value="female">Female</option> <option value="male">Male</option> </select><br><br> <label>Age </label> <input type="text" name="age" id="age"/><br><br> <label>Native Language</label> <input type="text" name="native_language" id="native_language"/><br><br> <hr> <br><br> <label>I consent to participate in this study and allow collection of data from the registered devices and browsers according to <a href="consent.pdf" target="_new">these terms</a>.</label><input type="checkbox" input name="consent" value="1"/> <br><br> <label></label><input type="submit" name="submit" value="Submit Questionnaire and Consent"/> </fieldset> </form> <p>Questionnaire and Consent Progress: 1/2</p> <!-- check for valid user input into the sign up form fields, especially, check if the user consented --> <script src="jquery-1.11.1.min.js"></script> <script src="jquery.validate.min.js"></script> <script src="additional-methods.min.js"></script> <script> $( "#questionnaire_form" ).validate({ errorClass: "message_color", groups: { interests: "arts_and_entertainment autos_and_vehicles beauty_and_fitness books_and_literature business_and_industrial computers_and_electronics finance food_and_drink games hobbies_and_leisure home_and_garden internet_and_telecom jobs_and_education law_and_government news online_communities people_and_society pets_and_animals real_estate reference science shopping sports travel world_localities", personas: "business_professionals personal_finance_geeks real_estate_followers small_business_owners business_travelers flight_intenders leisure_travelers catalog_shoppers mobile_payment_makers value_shoppers american_football_fans avid_runners sports_fans bookworms casual_and_social_gamers entertainment_enthusiasts hardcore_gamers movie_lovers music_lovers news_and_magazine_readers slots_players auto_enthusiasts fashionistas food_and_dining_lovers health_and_fitness_enthusiasts high_net_individuals home_design_enthusiasts home_and_garden_pros new_mothers photo_and_video_enthusiasts singles social_influencers tech_and_gadget_enthusiasts mothers parenting_and_education pet_owners" }, rules: { arts_and_entertainment: { require_from_group: [1, ".interestsb"] }, business_professionals: { require_from_group: [1, ".personasb"] }, first_name: { required: true, minlength: 2 }, last_name: { required: true, minlength: 2 }, e_mail: { required: true, email: true }, gender: { required: true }, age: { required: true, digits: true }, native_language: { required: true, minlength: 2 }, consent: { required: true } }, messages: { arts_and_entertainment: { require_from_group: "Please check at least one interest." }, business_professionals: { require_from_group: "Please check at least one persona." } } }); </script> </body> </html>
SebastianZimmeck/Cross_Device_Tracking
Software/Browser_History_Server_Files/questionnaire1.php
PHP
gpl-3.0
20,737
package cr0s.javara.render.map; import org.newdawn.slick.Graphics; import org.newdawn.slick.geom.Point; import cr0s.javara.main.Main; import cr0s.javara.resources.ResourceManager; import cr0s.javara.util.Pos; public class ResourcesLayer { ResourceCell[][] resources; private TileMap map; public ResourcesLayer(TileMap aMap) { this.map = aMap; this.resources = new ResourceCell[this.map.getWidth()][this.map.getHeight()]; } int getAdjacentCellsWith(byte t, int i, int j) { int sum = 0; for (int u = -1; u < 2; u++) { for (int v = -1; v < 2; v++) { if (resources[i + u][j + v] != null && resources[i + u][j + v].type == t) { ++sum; } } } return sum; } public void setInitialDensity() { for (int x = 0; x < this.map.getWidth(); x++) { for (int y = 0; y < this.map.getHeight(); y++) { ResourceCell cell = resources[x][y]; if (cell != null) { int adjacent = getAdjacentCellsWith(cell.type, x, y); int density = lerp(0, cell.maxDensity, adjacent, 9); cell.density = (byte) (density & 0xFF); } } } } public static int lerp(int a, int b, int mul, int div ) { return a + (b - a) * mul / div; } public class ResourceCell { public ResourceCell (byte aType, byte aVariant) { this.type = aType; this.variant = aVariant; this.density = 0; this.maxDensity = (byte) ((aType == 1) ? 12 : 3); } public byte maxDensity; public byte density; public byte type; public byte variant; public String getSpriteName() { if (type == 1) { return "gold0" + (this.variant + 1) + ".tem"; } else if (type == 2) { return "gem0" + (this.variant + 1) + ".tem"; } return null; } public int getFrameIndex() { return lerp(0, maxDensity - 1, density - 1, maxDensity); } } public void renderAll(Graphics g) { // Draw tiles layer for (int y = 0; y < this.map.getHeight(); y++) { for (int x = 0; x < this.map.getWidth(); x++) { if (x < (int) -Main.getInstance().getCamera().offsetX / 24 - 1 || x > (int) -Main.getInstance().getCamera().offsetX / 24 + (int) Main.getInstance().getContainer().getWidth() / 24 + 1) { continue; } if (y < (int) -Main.getInstance().getCamera().offsetY / 24 - 1 || y > (int) -Main.getInstance().getCamera().offsetY / 24 + (int) Main.getInstance().getContainer().getHeight() / 24 + 1) { continue; } if (Main.getInstance().getPlayer().getShroud() != null && Main.getInstance().getPlayer().getShroud().isAreaShrouded(x, y, 2, 2)) { continue; } if (this.resources[x][y] != null) { byte index = (byte) (this.resources[x][y].getFrameIndex() & 0xFF); Point sheetPoint = map.getTheater().getShpTexturePoint(this.resources[x][y].getSpriteName()); int sX = (int) sheetPoint.getX(); int sY = (int) sheetPoint.getY(); if (sX != -1 && sY != -1) { this.map.getTheater().getSpriteSheet().renderInUse(x * 24, y * 24, sX / 24, (sY / 24) + index); } } } } } public void renderCell(int x, int y) { if (this.resources[x][y] != null) { byte index = (byte) (this.resources[x][y].getFrameIndex() & 0xFF); Point sheetPoint = map.getTheater().getShpTexturePoint(this.resources[x][y].getSpriteName()); int sX = (int) sheetPoint.getX(); int sY = (int) sheetPoint.getY(); if (sX != -1 && sY != -1) { this.map.getTheater().getSpriteSheet().renderInUse(x * 24, y * 24, sX / 24, (sY / 24) + index); } } } public boolean isCellEmpty(int x, int y) { return !Main.getInstance().getWorld().getMap().isInMap(x * 24, y * 24) || this.resources[x][y] == null; } public int harvestCell(int x, int y) { ResourceCell resource = this.resources[x][y]; if (resource != null) { if (resource.density >= 0) { resource.density--; if (resource.density <= 0) { this.resources[x][y] = null; } return resource.type; } } return -1; } public boolean isCellEmpty(Point targetCell) { return isCellEmpty((int) targetCell.getX(), (int) targetCell.getY()); } public int harvestCell(Point currentCell) { return harvestCell((int) currentCell.getX(), (int) currentCell.getY()); } public void destroy(Pos tile) { int x = (int) tile.getX(); int y = (int) tile.getY(); this.resources[x][y] = null; } }
Cr0s/JavaRA
src/cr0s/javara/render/map/ResourcesLayer.java
Java
gpl-3.0
4,627
<?php ## # index file ## require('inc/core.php'); ?>
digital-ghost/scanlab
index.php
PHP
gpl-3.0
54
package se.idega.idegaweb.commune.school.presentation; import java.rmi.RemoteException; import java.util.Collection; import java.util.Iterator; import se.idega.idegaweb.commune.presentation.CommuneBlock; import com.idega.block.school.business.SchoolBusiness; import com.idega.block.school.data.School; import com.idega.business.IBOLookup; import com.idega.idegaweb.IWResourceBundle; import com.idega.presentation.IWContext; import com.idega.presentation.Table; import com.idega.presentation.text.Link; import com.idega.presentation.text.Text; import com.idega.user.business.GroupBusiness; import com.idega.user.business.UserBusiness; import com.idega.user.data.Group; import com.idega.user.data.User; /** * @author aron * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class SchoolAdminDirector extends CommuneBlock { GroupBusiness grpBuiz; UserBusiness usrBuiz; SchoolBusiness schoolBuiz; Integer schoolChoiceApproverPageId = null; IWResourceBundle iwrb; public String getBundleIdentifier(){ return CommuneBlock.IW_BUNDLE_IDENTIFIER; } private void init(IWContext iwc) throws RemoteException{ usrBuiz =(UserBusiness) IBOLookup.getServiceInstance(iwc,UserBusiness.class); grpBuiz = (GroupBusiness) IBOLookup.getServiceInstance(iwc,GroupBusiness.class); schoolBuiz = (SchoolBusiness) IBOLookup.getServiceInstance(iwc,SchoolBusiness.class); } public void main(IWContext iwc) throws Exception{ iwrb = getResourceBundle(iwc); if(iwc.isLoggedOn() && schoolChoiceApproverPageId!=null){ init(iwc); int userId = iwc.getUserId(); User user = usrBuiz.getUser(userId); Group rootGroup = schoolBuiz.getRootSchoolAdministratorGroup(); // if user is a SchoolAdministrator if(user.hasRelationTo(rootGroup)){ Collection schools = schoolBuiz.getSchoolHome().findAllBySchoolGroup(user); if(!schools.isEmpty()){ Table T = new Table(); int row = 1; int col = 1; T.add(new Text(iwrb.getLocalizedString("school_choice.links_to_choice_approvers","Links to school choice approvers")),col,row++); Iterator iter = schools.iterator(); while(iter.hasNext()){ School school = (School) iter.next(); T.add(getApproverLink(school),col,row++); } add(T); } /* else add("no schools"); */ } /* else add("has no relation to School admin root group"); */ } /* else add("not logged on"); */ } public Link getApproverLink(School school) { Link L = new Link(school.getName()); L.setPage(this.schoolChoiceApproverPageId.intValue()); L.addParameter(SchoolChoiceApprover.prmSchoolId,school.getPrimaryKey().toString()); return L; } public void setSchoolChoiceApproverPage(int pageId){ this.schoolChoiceApproverPageId = new Integer(pageId); } }
idega/platform2
src/se/idega/idegaweb/commune/school/presentation/SchoolAdminDirector.java
Java
gpl-3.0
2,981
define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred", "dojo/on", "dojo/aspect", "dojo/query", "dojo/has", "./util/misc", "put-selector/put", "xstyle/has-class", "./Grid", "dojo/_base/sniff", "xstyle/css!./css/columnset.css"], function(kernel, declare, lang, Deferred, listen, aspect, query, has, miscUtil, put, hasClass, Grid){ has.add("event-mousewheel", function(global, document, element){ return typeof element.onmousewheel !== "undefined"; }); has.add("event-wheel", function(global, document, element){ var supported = false; // From https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/wheel try{ WheelEvent("wheel"); supported = true; }catch(e){ // empty catch block; prevent debuggers from snagging } return supported; }); var colsetidAttr = "data-dgrid-column-set-id"; hasClass("safari", "ie-7"); function adjustScrollLeft(grid, row){ var scrollLefts = grid._columnSetScrollLefts; function doAdjustScrollLeft(){ query(".dgrid-column-set", row).forEach(function(element){ element.scrollLeft = scrollLefts[element.getAttribute(colsetidAttr)]; }); } if(has("ie") < 8 || has("quirks")){ setTimeout(doAdjustScrollLeft, 1); }else{ doAdjustScrollLeft(); } } function scrollColumnSetTo(grid, columnSetNode, offsetLeft){ var id = columnSetNode.getAttribute(colsetidAttr); var scroller = grid._columnSetScrollers[id]; scroller.scrollLeft = offsetLeft < 0 ? 0 : offsetLeft; } function getColumnSetSubRows(subRows, columnSetId){ // Builds a subRow collection that only contains columns that correspond to // a given column set id. if(!subRows || !subRows.length){ return; } var subset = []; var idPrefix = columnSetId + "-"; for(var i = 0, numRows = subRows.length; i < numRows; i++){ var row = subRows[i]; var subsetRow = []; subsetRow.className = row.className; for(var k = 0, numCols = row.length; k < numCols; k++){ var column = row[k]; // The column id begins with the column set id. if(column.id != null && column.id.indexOf(idPrefix) === 0){ subsetRow.push(column); } } subset.push(subsetRow); } return subset; } var horizMouseWheel = has("event-mousewheel") || has("event-wheel") ? function(grid){ return function(target, listener){ return listen(target, has("event-wheel") ? "wheel" : "mousewheel", function(event){ var node = event.target, deltaX; // WebKit will invoke mousewheel handlers with an event target of a text // node; check target and if it's not an element node, start one node higher // in the tree if(node.nodeType !== 1){ node = node.parentNode; } while(!query.matches(node, ".dgrid-column-set[" + colsetidAttr + "]", target)){ if(node === target || !(node = node.parentNode)){ return; } } // Normalize reported delta value: // wheelDeltaX (webkit, mousewheel) needs to be negated and divided by 3 // deltaX (FF17+, wheel) can be used exactly as-is deltaX = event.deltaX || -event.wheelDeltaX / 3; if(deltaX){ // only respond to horizontal movement listener.call(null, grid, node, deltaX); } }); }; } : function(grid){ return function(target, listener){ return listen(target, ".dgrid-column-set[" + colsetidAttr + "]:MozMousePixelScroll", function(event){ if(event.axis === 1){ // only respond to horizontal movement listener.call(null, grid, this, event.detail); } }); }; }; return declare(null, { // summary: // Provides column sets to isolate horizontal scroll of sets of // columns from each other. This mainly serves the purpose of allowing for // column locking. postCreate: function(){ var self = this; this.inherited(arguments); this.on(horizMouseWheel(this), function(grid, colsetNode, amount){ var id = colsetNode.getAttribute(colsetidAttr), scroller = grid._columnSetScrollers[id], scrollLeft = scroller.scrollLeft + amount; scroller.scrollLeft = scrollLeft < 0 ? 0 : scrollLeft; }); this.on('.dgrid-column-set:dgrid-cellfocusin', function (event) { self._onColumnSetCellFocus(event, this); }); }, columnSets: [], createRowCells: function(tag, each, subRows, object){ var row = put("table.dgrid-row-table"); var tr = put(row, "tbody tr"); for(var i = 0, l = this.columnSets.length; i < l; i++){ // iterate through the columnSets var cell = put(tr, tag + ".dgrid-column-set-cell.dgrid-column-set-" + i + " div.dgrid-column-set[" + colsetidAttr + "=" + i + "]"); var subset = getColumnSetSubRows(subRows || this.subRows , i) || this.columnSets[i]; cell.appendChild(this.inherited(arguments, [tag, each, subset, object])); } return row; }, renderArray: function(){ var grid = this, rows = this.inherited(arguments); Deferred.when(rows, function(rows){ for(var i = 0; i < rows.length; i++){ adjustScrollLeft(grid, rows[i]); } }); return rows; }, renderHeader: function(){ // summary: // Setup the headers for the grid this.inherited(arguments); var columnSets = this.columnSets, domNode = this.domNode, scrollers = this._columnSetScrollers, scrollerContents = this._columnSetScrollerContents = {}, scrollLefts = this._columnSetScrollLefts = {}, grid = this, i, l; function reposition(){ grid._positionScrollers(); } if (scrollers) { // this isn't the first time; destroy existing scroller nodes first for(i in scrollers){ put(scrollers[i], "!"); } } else { // first-time-only operations: hook up event/aspected handlers aspect.after(this, "resize", reposition, true); aspect.after(this, "styleColumn", reposition, true); this._columnSetScrollerNode = put(this.footerNode, "+div.dgrid-column-set-scroller-container"); } // reset to new object to be populated in loop below scrollers = this._columnSetScrollers = {}; for(i = 0, l = columnSets.length; i < l; i++){ this._putScroller(columnSets[i], i); } this._positionScrollers(); }, styleColumnSet: function(colsetId, css){ // summary: // Dynamically creates a stylesheet rule to alter a columnset's style. var rule = this.addCssRule("#" + miscUtil.escapeCssIdentifier(this.domNode.id) + " .dgrid-column-set-" + miscUtil.escapeCssIdentifier(colsetId, "-"), css); this._positionScrollers(); return rule; }, _destroyColumns: function(){ var columnSetsLength = this.columnSets.length, i, j, k, subRowsLength, len, columnSet, subRow, column; for(i = 0; i < columnSetsLength; i++){ columnSet = this.columnSets[i]; for(j = 0, subRowsLength = columnSet.length; j < subRowsLength; j++){ subRow = columnSet[j]; for(k = 0, len = subRow.length; k < len; k++){ column = subRow[k]; if(typeof column.destroy === "function"){ column.destroy(); } } } } this.inherited(arguments); }, configStructure: function(){ // Squash the column sets together so the grid and other dgrid extensions and mixins can // configure the columns and create any needed subrows. this.columns = {}; this.subRows = []; for(var i = 0, l = this.columnSets.length; i < l; i++){ var columnSet = this.columnSets[i]; for(var j = 0; j < columnSet.length; j++){ columnSet[j] = this._configColumns(i + "-" + j + "-", columnSet[j]); } } this.inherited(arguments); }, _positionScrollers: function (){ var domNode = this.domNode, scrollers = this._columnSetScrollers, scrollerContents = this._columnSetScrollerContents, columnSets = this.columnSets, scrollerWidth = 0, numScrollers = 0, // tracks number of visible scrollers (sets w/ overflow) i, l, columnSetElement, contentWidth; for(i = 0, l = columnSets.length; i < l; i++){ // iterate through the columnSets columnSetElement = query('.dgrid-column-set[' + colsetidAttr + '="' + i +'"]', domNode)[0]; scrollerWidth = columnSetElement.offsetWidth; contentWidth = columnSetElement.firstChild.offsetWidth; scrollerContents[i].style.width = contentWidth + "px"; scrollers[i].style.width = scrollerWidth + "px"; if(has("ie") < 9){ // IE seems to need scroll to be set explicitly scrollers[i].style.overflowX = contentWidth > scrollerWidth ? "scroll" : "auto"; } // Keep track of how many scrollbars we're showing if(contentWidth > scrollerWidth){ numScrollers++; } } this._columnSetScrollerNode.style.bottom = this.showFooter ? this.footerNode.offsetHeight + "px" : "0"; // Align bottom of body node depending on whether there are scrollbars this.bodyNode.style.bottom = numScrollers ? (has("dom-scrollbar-height") + (has("ie") ? 1 : 0) + "px") : "0"; }, _putScroller: function (columnSet, i){ // function called for each columnSet var scroller = this._columnSetScrollers[i] = put(this._columnSetScrollerNode, "span.dgrid-column-set-scroller.dgrid-column-set-scroller-" + i + "[" + colsetidAttr + "=" + i +"]"); this._columnSetScrollerContents[i] = put(scroller, "div.dgrid-column-set-scroller-content"); listen(scroller, "scroll", lang.hitch(this, '_onColumnSetScroll')); }, _onColumnSetScroll: function (evt){ var scrollLeft = evt.target.scrollLeft, colSetId = evt.target.getAttribute(colsetidAttr), newScrollLeft; if(this._columnSetScrollLefts[colSetId] != scrollLeft){ query('.dgrid-column-set[' + colsetidAttr + '="' + colSetId + '"],.dgrid-column-set-scroller[' + colsetidAttr + '="' + colSetId + '"]', this.domNode). forEach(function(element, i){ element.scrollLeft = scrollLeft; if(!i){ // Compute newScrollLeft based on actual resulting // value of scrollLeft, which may be different than // what we assigned under certain circumstances // (e.g. Chrome under 33% / 67% / 90% zoom). // Only need to compute this once, as it will be the // same for every row. newScrollLeft = element.scrollLeft; } }); this._columnSetScrollLefts[colSetId] = newScrollLeft; } }, _setColumnSets: function(columnSets){ this._destroyColumns(); this.columnSets = columnSets; this._updateColumns(); }, setColumnSets: function(columnSets){ kernel.deprecated("setColumnSets(...)", 'use set("columnSets", ...) instead', "dgrid 0.4"); this.set("columnSets", columnSets); }, _onColumnSetCellFocus: function(event, columnSetNode){ var focusedNode = event.target; var columnSetId = columnSetNode.getAttribute(colsetidAttr); // columnSetNode's offsetLeft is not always correct, // so get the columnScroller to check offsetLeft against var columnScroller = this._columnSetScrollers[columnSetId]; var elementEdge = focusedNode.offsetLeft - columnScroller.scrollLeft + focusedNode.offsetWidth; if (elementEdge > columnSetNode.offsetWidth || columnScroller.scrollLeft > focusedNode.offsetLeft) { scrollColumnSetTo(this, columnSetNode, focusedNode.offsetLeft); } } }); });
spatialagent001/BlogExamples
example16/js/dojo/dgrid/ColumnSet.js
JavaScript
gpl-3.0
11,189
//--------------------------------------------- // FREQUENCY COUNTER // www.circuit-projects.com // Y.Erol //--------------------------------------------- #include <pic.h> #include <delay.c> __CONFIG(WDTDIS&PWRTEN&LVPDIS&XT); unsigned char kontrol; //--------------------------------------------- // CCP1 INTERRUPT //--------------------------------------------- void interrupt interrupt(void){ TMR1H=0; TMR1L=0; GIE=0; control=1; CCP1IF=0; GIE=1; } //--------------------------------------------- // MAIN PROGRAM //--------------------------------------------- main(void) { unsigned const char number[10]={0x3F,0x06,0x5B, 0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; unsigned char select[4]={1,2,4,8}; unsigned int counter,value,remainder1,remainder2; float frekans; unsigned char a,i,display[5],data; TRISA=0x00; TRISB=0x08; CMCON=0x07; cont=0; PORTA=0; PORTB=0 CCP1IE=1; CCP1CON=0b00000110; T1CON=0b00100001; GIE=1; PEIE=1; for(;;){ counter=256*CCPR1H+CCPR1L; if(control==1)frequency=100000000/counter; if(kontrol==0)frequency=0; if(counter<10000)frequency=0; control=0; for(a=0;a<25;a++){ value=(int)frequency; display[1]=value/1000; remainder1=value-display[1]*1000; display[2]=remainder1/100; remainder2=remainder1-display[2]*100; display[3]=remainder2/10; display[4]=remainder2-display[3]*10; for(i=0;i<4;i++){ PORTB=0; PORTA=0; data=number[display[i+1]]; PORTB=data&0x07; data=data<<1; PORTB=PORTB|(data&0xF0); PORTA=select[i]; DelayMs(3); } } } }
techdude101/code
PIC uC Projects/c/Samples/Frequency-Counter/Frequency-Counter-C.C
C++
gpl-3.0
1,528
@extends('main') @section('page') <div class="container-fluid page-container"> <div class="row"> <div class="col-xs-12"> <h1>ArchStrike Wiki</h1> <div class="breadcrumb"> @if($path == 'index') Home @elseif(preg_match('/\//', $path)) <a href="/wiki">Home</a> <span>&rarr;</span> @set('curr_path', '/wiki') @foreach(explode('/', preg_replace('/\/index$/', '', $path)) as $level) @if($loop->last) {{ ucfirst($level) }} @else @set('curr_path', $curr_path . '/' . $level) <a href="{{ $curr_path }}">{{ ucfirst($level) }}</a> <span>&rarr;</span> @endif @endforeach @else <a href="/wiki">Home</a> <span>&rarr;</span> {{ ucfirst(preg_replace('/\/index$/', '', $path)) }} @endif </div> </div> </div> <div class="row wiki-row"> <div class="col-xs-12"> @include('wiki.' . preg_replace('/\//', '.', $path)) </div> </div> </div> @endsection
ArchStrike/ArchStrike-Website
resources/views/website/wiki.blade.php
PHP
gpl-3.0
1,388
# This file is part of barrioSquare. # # barrioSquare 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 3 of the License, or # (at your option) any later version. # # barrioSquare 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 barrioSquare. If not, see <http://www.gnu.org/licenses/>. # or write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. QPUSHBUTTON_DEFAULT = 'QPushButton { color: #000000; border-radius: 6px; border: 2px solid #8f8f91; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f6f7fa, stop: 1 #dadbde); } QPushButton:pressed {background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #7ec2cc, stop: 1 #defbff); }' QPUSHBUTTON_HIGHLIGHT = 'QPushButton { color: #000000; border-radius: 6px; border: 2px solid #8f8f91; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #7ec2cc, stop: 1 #defbff); } QPushButton:pressed {background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #cccccc, stop: 1 #f6f7fa); }' QLISTWIDGET_DEFAULT = 'QListWidget { color: #000000; background-color: #ffffff; } QListView { color: #000000; background-color: #ffffff; }' # '
chilitechno/barrioSquare
barrioStyles.py
Python
gpl-3.0
1,574
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### import json import bpy import mathutils import bmesh as bm import numpy as np from bpy.props import StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode callback_id = 'node.callback_execnodemod' lines = """\ for i, i2 in zip(V1, V2): append([x + y for x, y in zip(i, i2)]) """.strip().split('\n') def update_wrapper(self, context): try: updateNode(context.node, context) except: ... class SvExecNodeDynaStringItem(bpy.types.PropertyGroup): line = bpy.props.StringProperty(name="line to eval", default="", update=update_wrapper) class SvExecNodeModCallback(bpy.types.Operator): bl_idname = callback_id bl_label = "generic callback" cmd = bpy.props.StringProperty(default='') idx = bpy.props.IntProperty(default=-1) form = bpy.props.StringProperty(default='') def execute(self, context): getattr(context.node, self.cmd)(self) return {'FINISHED'} class SvExecNodeMod(bpy.types.Node, SverchCustomTreeNode): ''' Exec Node Mod''' bl_idname = 'SvExecNodeMod' bl_label = 'Exec Node Mod' bl_icon = 'CONSOLE' text = StringProperty(default='', update=updateNode) dynamic_strings = bpy.props.CollectionProperty(type=SvExecNodeDynaStringItem) def draw_buttons(self, context, layout): row = layout.row(align=True) # add() remove() clear() move() row.operator(callback_id, text='', icon='ZOOMIN').cmd = 'add_new_line' row.operator(callback_id, text='', icon='ZOOMOUT').cmd = 'remove_last_line' row.operator(callback_id, text='', icon='TRIA_UP').cmd = 'shift_up' row.operator(callback_id, text='', icon='TRIA_DOWN').cmd = 'shift_down' row.operator(callback_id, text='', icon='SNAP_ON').cmd = 'delete_blank' row.operator(callback_id, text='', icon='SNAP_OFF').cmd = 'insert_blank' if len(self.dynamic_strings) == 0: return if not context.active_node == self: b = layout.box() col = b.column(align=True) for idx, line in enumerate(self.dynamic_strings): col.prop(self.dynamic_strings[idx], "line", text="", emboss=False) else: col = layout.column(align=True) for idx, line in enumerate(self.dynamic_strings): row = col.row(align=True) row.prop(self.dynamic_strings[idx], "line", text="") # if UI , then opp = row.operator(callback_id, text='', icon='TRIA_DOWN_BAR') opp.cmd = 'insert_line' opp.form = 'below' opp.idx = idx opp2 = row.operator(callback_id, text='', icon='TRIA_UP_BAR') opp2.cmd = 'insert_line' opp2.form = 'above' opp2.idx = idx def draw_buttons_ext(self, context, layout): col = layout.column(align=True) col.operator(callback_id, text='copy to node').cmd = 'copy_from_text' col.prop_search(self, 'text', bpy.data, "texts", text="") row = layout.row() col.operator(callback_id, text='cc code to clipboard').cmd = 'copy_node_text_to_clipboard' def add_new_line(self, context): self.dynamic_strings.add().line = "" def remove_last_line(self, context): if len(self.dynamic_strings) > 1: self.dynamic_strings.remove(len(self.dynamic_strings)-1) def shift_up(self, context): sds = self.dynamic_strings for i in range(len(sds)): sds.move(i+1, i) def shift_down(self, context): sds = self.dynamic_strings L = len(sds) for i in range(L): sds.move(L-i, i-1) def delete_blank(self, context): sds = self.dynamic_strings Lines = [i.line for i in sds if i.line != ""] sds.clear() for i in Lines: sds.add().line = i def insert_blank(self, context): sds = self.dynamic_strings Lines = [i.line for i in sds] sds.clear() for i in Lines: sds.add().line = i if i != "": sds.add().line = "" def copy_from_text(self, context): """ make sure self.dynamic_strings has enough strings to do this """ slines = bpy.data.texts[self.text].lines while len(self.dynamic_strings) < len(slines): self.dynamic_strings.add() for i, i2 in zip(self.dynamic_strings, slines): i.line = i2.body def copy_node_text_to_clipboard(self, context): lines = [d.line for d in self.dynamic_strings] if not lines: return str_lines = "\n".join(lines) bpy.context.window_manager.clipboard = str_lines def insert_line(self, op_props): sds = self.dynamic_strings Lines = [i.line for i in sds] sds.clear() for tidx, i in enumerate(Lines): if op_props.form == 'below': sds.add().line = i if op_props.idx == tidx: sds.add().line = "" else: if op_props.idx == tidx: sds.add().line = "" sds.add().line = i def sv_init(self, context): self.inputs.new('StringsSocket', 'V1') self.inputs.new('StringsSocket', 'V2') self.inputs.new('StringsSocket', 'V3') self.outputs.new('StringsSocket', 'out') # add default strings self.dynamic_strings.add().line = lines[0] self.dynamic_strings.add().line = lines[1] self.dynamic_strings.add().line = "" self.width = 289 def process(self): v1, v2, v3 = self.inputs V1, V2, V3 = v1.sv_get(0), v2.sv_get(0), v3.sv_get(0) out = [] extend = out.extend append = out.append exec('\n'.join([j.line for j in self.dynamic_strings])) self.outputs[0].sv_set(out) def storage_set_data(self, storage): strings_json = storage['string_storage'] lines_list = json.loads(strings_json)['lines'] self.id_data.freeze(hard=True) self.dynamic_strings.clear() for line in lines_list: self.dynamic_strings.add().line = line self.id_data.unfreeze(hard=True) def storage_get_data(self, node_dict): local_storage = {'lines': []} for item in self.dynamic_strings: local_storage['lines'].append(item.line) node_dict['string_storage'] = json.dumps(local_storage) def register(): bpy.utils.register_class(SvExecNodeDynaStringItem) bpy.utils.register_class(SvExecNodeMod) bpy.utils.register_class(SvExecNodeModCallback) def unregister(): bpy.utils.unregister_class(SvExecNodeModCallback) bpy.utils.unregister_class(SvExecNodeMod) bpy.utils.unregister_class(SvExecNodeDynaStringItem)
elfnor/sverchok
nodes/script/multi_exec.py
Python
gpl-3.0
7,709
package fr.xxiiteam.explorer.utils; import java.io.File; import java.io.Serializable; public final class Permissions implements Serializable { private static final long serialVersionUID = 2682238088276963741L; public final boolean ur; public final boolean uw; public final boolean ux; public final boolean gr; public final boolean gw; public final boolean gx; public final boolean or; public final boolean ow; public final boolean ox; public Permissions(String line) { if (line.length() != 10) { throw new IllegalArgumentException("Bad permission line"); } this.ur = line.charAt(1) == 'r'; this.uw = line.charAt(2) == 'w'; this.ux = line.charAt(3) == 'x'; this.gr = line.charAt(4) == 'r'; this.gw = line.charAt(5) == 'w'; this.gx = line.charAt(6) == 'x'; this.or = line.charAt(7) == 'r'; this.ow = line.charAt(8) == 'w'; this.ox = line.charAt(9) == 'x'; } public Permissions(boolean ur, boolean uw, boolean ux, boolean gr, boolean gw, boolean gx, boolean or, boolean ow, boolean ox) { this.ur = ur; this.uw = uw; this.ux = ux; this.gr = gr; this.gw = gw; this.gx = gx; this.or = or; this.ow = ow; this.ox = ox; } public static String toOctalPermission(final Permissions p) { byte user = 0; byte group = 0; byte other = 0; if (p.ur) { user += 4; } if (p.uw) { user += 2; } if (p.ux) { user += 1; } if (p.gr) { group += 4; } if (p.gw) { group += 2; } if (p.gx) { group += 1; } if (p.or) { other += 4; } if (p.ow) { other += 2; } if (p.ox) { other += 1; } return String.valueOf(user) + group + other; } // use this as alternative if no root is available public static String getBasicPermission(File file) { String per = ""; per += file.isDirectory() ? "d" : "-"; per += file.canRead() ? "r" : "-"; per += file.canWrite() ? "w" : "-"; per += file.canExecute() ? "x" : "-"; return per; } }
XXIITEAM/XXII-Explorer
explorer/src/main/java/fr/xxiiteam/explorer/utils/Permissions.java
Java
gpl-3.0
2,409
<?php define('DB_HOST', 'localhost'); define('DB_NAME', 'u453794882_king'); define('DB_USER', 'u453794882_king'); define('DB_PASS', 'gamabeta'); define('DB_CHAR', 'utf8'); class DB { private static $instance; public static function getInstance(){ if(!isset(self::$instance)){ try { self::$instance = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS); self::$instance->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); self::$instance->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); } catch (PDOException $e) { echo $e->getMessage(); } } return self::$instance; } public static function prepare($sql){ return self::getInstance()->prepare($sql); } }
jeffersonmello/kingofeletroOficial
admin/class/DB.php
PHP
gpl-3.0
747
jQuery( function( $ ) { // wc_single_product_params is required to continue, ensure the object exists if ( typeof wc_single_product_params === 'undefined' ) { return false; } // Tabs $( '.woocommerce-tabs > .panel' ).hide(); $( '.woocommerce-tabs ul.tabs li a' ).click( function() { var $tab = $( this ), $tabs_wrapper = $tab.closest( '.woocommerce-tabs' ); $( 'ul.tabs li', $tabs_wrapper ).removeClass( 'active' ); $tabs_wrapper.children('div.panel').hide(); $( 'div' + $tab.attr( 'href' ), $tabs_wrapper).show(); $tab.parent().addClass( 'active' ); return false; }); $( '.woocommerce-tabs' ).each( function() { var hash = window.location.hash, url = window.location.href, tabs = $( this ); if ( hash.toLowerCase().indexOf( "comment-" ) >= 0 ) { $('ul.tabs li.reviews_tab a', tabs ).click(); } else if ( url.indexOf( "comment-page-" ) > 0 || url.indexOf( "cpage=" ) > 0 ) { $( 'ul.tabs li.reviews_tab a', $( this ) ).click(); } else { $( 'ul.tabs li:first a', tabs ).click(); } }); $( 'a.woocommerce-review-link' ).click( function() { $( '.reviews_tab a' ).click(); return true; }); // Star ratings for comments $( '#rating' ).hide().before( '<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>' ); $( 'body' ) .on( 'click', '#respond p.stars a', function() { var $star = $( this ), $rating = $( this ).closest( '#respond' ).find( '#rating' ); $rating.val( $star.text() ); $star.siblings( 'a' ).removeClass( 'active' ); $star.addClass( 'active' ); return false; }) .on( 'click', '#respond #submit', function() { var $rating = $( this ).closest( '#respond' ).find( '#rating' ), rating = $rating.val(); if ( $rating.size() > 0 && ! rating && wc_single_product_params.review_rating_required === 'yes' ) { alert( wc_single_product_params.i18n_required_rating_text ); return false; } }); // prevent double form submission $( 'form.cart' ).submit( function() { $( this ).find( ':submit' ).attr( 'disabled','disabled' ); }); });
shramee/test-ppb
js/wc-single-product.js
JavaScript
gpl-3.0
2,543
/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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 3 of the License, or * (at your option) any later version. * * ColorCode 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 ColorCode. If not, see <http://www.gnu.org/licenses/>. */ #include "cellbtn.h" CellBtn::CellBtn(QWidget *parent) : QToolButton(parent) { setMouseTracking(true); setAttribute(Qt::WA_Hover, true); }
vakkov/ColorCode
cellbtn.cpp
C++
gpl-3.0
915
using System; using System.Collections.Generic; using System.Text; namespace RogueBasin.Triggers { /// <summary> /// When you enter the entrance square /// </summary> public class TreasureRoom : DungeonSquareTrigger { public TreasureRoom() { } public override bool CheckTrigger(int level, Point mapLocation) { //Check we are in the right place if (CheckLocation(level, mapLocation) == false) { return false; } //Otherwise in the right place if (!Triggered) { Game.Base.PlayMovie("treasureRoom", true); Triggered = true; //Teleport the player to the start location on the final level //Increment player level Player player = Game.Dungeon.Player; player.LocationLevel++; //Set vision player.SightRadius = 100; player.LocationMap = Game.Dungeon.Levels[player.LocationLevel].PCStartLocation; Game.Dungeon.MovePCAbsolute(player.LocationLevel, player.LocationMap.x, player.LocationMap.y); } return true; } } }
flend/roguelike
RogueBasin/RogueBasin/Triggers/TreasureRoom.cs
C#
gpl-3.0
1,323
<?php add_shortcode('style', 'style'); function style($options, $content) { return "<style> " . html_entity_decode($content) . "</style>"; }
cemc/cscircles-wp-content
plugins/pybox/shortcode-style.php
PHP
gpl-3.0
146
<?php /****************************************************************** * XLAgenda 4 par Xavier LE QUERE * Contact : support[at]xlagenda.fr * Web : http://www.xlagenda.fr * (C) Xavier LE QUERE, 2003-2013 * Version 4.3 - 16/06/13 * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. *********************************************************************/ echo "<div id=\"cadre_menu\"> <h2>".$lang['common_title_menu']."</h2> <p>\n"; //LIEN CALENDRIER if (!is_included($url_page,$page)) echo "&gt; <a href=\"$url_page\">".$lang['common_link_calendrier']."</a><br />\n"; else echo "&gt; ".$lang['common_link_calendrier']."<br />\n"; //LIEN RECHERCHER if (!is_included($url_recherche,$page)) echo "&gt; <a href=\"$url_recherche\">".$lang['common_link_rechercher']."</a><br />\n"; else echo "&gt; ".$lang['common_link_rechercher']."<br />\n"; //LIENS AJOUTER ET PROPOSER if (isSessionValide()) { echo "&gt; <a href=\"$repertoire_admin/ajouter.php\">".$lang['common_link_ajouter']."</a><br />\n"; } else { if ($menu_ajouter) echo "&gt; <a href=\"$repertoire_admin/index.php?add=yes\">".$lang['common_link_ajouter']."</a><br />\n"; if ($menu_proposer AND !is_included($url_proposition,$page)) echo "&gt; <a href=\"$url_proposition\">".$lang['common_link_proposer']."</a><br />\n"; elseif ($menu_proposer) echo "&gt; ".$lang['common_link_proposer']."<br />\n"; //LIEN DEMANDER UN COMPTE if ($menu_compte AND !is_included($url_compte,$page)) echo "&gt; <a href=\"$url_compte\">".$lang['common_link_compte']."</a><br />\n"; elseif ($menu_compte) echo "&gt; ".$lang['common_link_compte']."<br />\n"; } // LIEN ADMINISTRATION if ($menu_admin) echo "&gt; <a href=\"$repertoire_admin/index.php\">".$lang['common_link_admin']."</a><br />\n"; //LIEN DECONNEXION if (isSessionValide()) echo "&gt; <a href=\"$repertoire_admin/close.php\">".$lang['common_link_deconnexion']."</a>\n"; echo "</p> </div>\n" ?>
chrnoangel/xlagenda
menu.php
PHP
gpl-3.0
2,559
<div id="rewards-header" class="page-header"> <h1>奖惩情况</h1> </div> <!-- /rewards-header --> <div id="rewards-content" class="section"> <div id="rewards-content-header" style="overflow: auto;"> <div id="selector" style="float: left;"> <select id="available-years" class="span2"> <?php foreach ( $available_years as $available_year ) { $year = $available_year['school_year']; echo '<option value="'.$year.'">'.$year.'-'.($year + 1).'学年</option>'; } ?> </select> </div> <!-- /selector --> <div id="add-new" style="float: right; font-size: 13px;"> <img src="<?php echo base_url('/img/icon-add.png') ?>" alt="Icon" /> <a id="add-new-trigger" href="javascript:void(0);">添加记录</a> </div> <!-- /add-new --> </div> <!-- /rewards-content-header --> <div id="list"> <table id="reward-records" class="table table-striped"> <thead> <tr> <td>级别</td> <td>加/减分缘由</td> <td>加减分</td> </tr> </thead> <tbody></tbody> </table> </div> <!-- /list --> <div id="page-error" class="alert alert-error hide"><strong>温馨提示: </strong>未找到可用数据.</div> </div> <!-- /rewards-content --> <!-- New Rewards Modal --> <div id="new-rewards-dialog" class="modal hide dialog"> <div class="modal-header"> <button type="button" class="close">×</button> <h2 id="rewards-dialog-title">添加奖惩情况</h2> </div> <div class="modal-body"> <div id="rewards-notice-message" class="alert alert-warning"> <button type="button" class="close">×</button> <strong>提示: </strong>您正在为<?php echo $current_school_year; ?>-<?php echo ($current_school_year + 1); ?>学年添加奖惩情况记录. 请仔细确认后提交, 因为提交后的内容将无法修改! </div> <div id="rewards-error-message" class="alert alert-error hide"></div> <table id="new-rewards-table" class="table no-border"> <thead> <tr class="no-border"> <td>级别</td> <td>加/减分缘由</td> <td>加减分</td> </tr> </thead> <tbody></tbody> </table> <div id="new-record-trigger" style="padding-left: 8px; font-size: 13px;"> <img src="<?php echo base_url('/img/icon-add.png') ?>" alt="Icon" /> <a id="new-record-trigger" href="javascript:void(0);">添加一行</a> </div> <!-- /new-record-trigger --> </div> <div class="modal-footer"> <button id="add-rewards" class="btn btn-primary">确认</button> <button class="btn btn-cancel">取消</button> </div> </div> <!-- /New Rewards Modal --> <!-- JavaScript for the basic content --> <script type="text/javascript"> $('#available-years').change(function(){ var school_year = $(this).val(); get_reward_records(school_year); }); </script> <script type="text/javascript"> function get_reward_records(school_year) { $.ajax({ type: 'GET', async: true, url: "<?php echo base_url('home/get_reward_records/'); ?>" + school_year, dataType: 'JSON', success: function(result) { $('#reward-records tbody').empty(); if ( result['is_successful'] ) { var total_records = result['records'].length; for ( var i = 0; i < total_records; ++ i ) { $('#reward-records').append( '<tr class="table-datum">' + '<td>' + result['records'][i]['description'] + '</td>' + '<td>' + result['records'][i]['detail'] + '</td>' + '<td>' + result['records'][i]['additional_score'] + '</td>' + '</tr>' ); } set_visible('#page-error', false); set_visible('#list', true); } else { set_visible('#page-error', true); set_visible('#list', false); } } }); } </script> <script type="text/javascript"> function set_visible(element, is_visible) { if ( is_visible ) { $(element).css('display', 'block'); } else { $(element).css('display', 'none'); } set_footer_position(); // which is defined in index.php } </script> <script type="text/javascript"> function add_new_record() { $('#new-rewards-table').append( '<tr class="no-border">' + '<td>' + '<select name="level" style="width: 80px;">' + '<?php foreach ( $reward_levels as $reward_level ) { echo '<option value="'.$reward_level['reward_level_id'].'">'. $reward_level['description'].'</option>'; } ?>' + '</select>' + '</td>' + '<td><input type="text" name="detail" maxlength="255" /></td>' + '<td><input type="text" name="additional-score" /></td>' + '</tr>' ); } </script> <!-- JavaScript for New Rewards Model --> <script type="text/javascript"> $('#add-new-trigger').click(function() { $('#new-rewards-dialog').fadeIn(); }); </script> <script type="text/javascript"> $('#rewards-notice-message .close').click(function() { $('#rewards-notice-message').fadeOut(); }); </script> <script type="text/javascript"> $('.modal-header .close').click(function() { $('#new-rewards-dialog').fadeOut(); }); $('.btn-cancel').click(function() { $('#new-rewards-dialog').fadeOut(); }); </script> <script type="text/javascript"> $('#new-record-trigger').click(function() { add_new_record(); }) </script> <script type="text/javascript"> $('#new-rewards-table').delegate('input[name=additional-score]', 'change', function() { var number_string = $(this).val(); if ( !is_a_number(number_string) ) { $(this).val(''); } }); </script> <script type="text/javascript"> function is_a_number(number_string) { var number_regex = '^[-+]?[0-9]*\.?[0-9]+$'; return number_string.match(number_regex); } </script> <script type="text/javascript"> $('#add-rewards').click(function() { set_loading_mode(true); $('#new-rewards-table > tbody > tr').each(function() { var reward_level_id = $(this).find('select[name=level]').val(), detail = $(this).find('input[name=detail]').val(), additional_score = $(this).find('input[name=additional-score]').val(); if ( !is_empty(detail) && !is_empty(additional_score) ) { add_reward_record(reward_level_id, detail, additional_score); } }); // reload this page load('rewards'); }); </script> <script type="text/javascript"> function set_loading_mode(is_loading) { if ( is_loading ) { $('#new-rewards-dialog :input').attr('disabled', true); } else { $('#new-rewards-dialog :input').removeAttr('disabled'); } } </script> <script type="text/javascript"> function is_empty(str) { if ( !str || str.length == 0 ) { return true; } return !/[^\s]+/.test(str); } </script> <script type="text/javascript"> function add_reward_record(reward_level_id, detail, additional_score) { var post_data = 'reward_level_id=' + reward_level_id + '&detail=' + detail + '&additional_score=' + additional_score; $.ajax({ type: 'POST', async: true, url: "<?php echo base_url('home/add_reward_record/'); ?>", data: post_data, dataType: 'JSON', success: function(result) { }, error: function() { } }); } </script> <!-- Document Ready Function --> <script type="text/javascript"> $(document).ready(function() { // loading reward records var school_year = $('#available-years').val(); get_reward_records(school_year); // add three new lines in new rewards model var NUMBER_OF_LINES = 3; for ( i = 0; i < NUMBER_OF_LINES; ++ i ) { add_new_record(); } }); </script>
zjhzxhz/stumgr
application/views/home/rewards.php
PHP
gpl-3.0
8,887
package net.minecraft.src; import com.google.common.collect.Maps; import java.util.Iterator; import java.util.Map; import java.util.UUID; import java.util.Map.Entry; public class Potion { /** The array of potion types. */ public static final Potion[] potionTypes = new Potion[32]; public static final Potion field_76423_b = null; public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.field_111263_d, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.field_111263_d, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); public static final Potion digSpeed = (new Potion(3, false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); public static final Potion digSlowdown = (new Potion(4, true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); public static final Potion damageBoost = (new PotionAttackDamage(5, false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).func_111184_a(SharedMonsterAttributes.field_111264_e, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3.0D, 2); public static final Potion heal = (new PotionHealth(6, false, 16262179)).setPotionName("potion.heal"); public static final Potion harm = (new PotionHealth(7, true, 4393481)).setPotionName("potion.harm"); public static final Potion jump = (new Potion(8, false, 7889559)).setPotionName("potion.jump").setIconIndex(2, 1); public static final Potion confusion = (new Potion(9, true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); /** The regeneration Potion object. */ public static final Potion regeneration = (new Potion(10, false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); public static final Potion resistance = (new Potion(11, false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); /** The fire resistance Potion object. */ public static final Potion fireResistance = (new Potion(12, false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); /** The water breathing Potion object. */ public static final Potion waterBreathing = (new Potion(13, false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); /** The invisibility Potion object. */ public static final Potion invisibility = (new Potion(14, false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); /** The blindness Potion object. */ public static final Potion blindness = (new Potion(15, true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); /** The night vision Potion object. */ public static final Potion nightVision = (new Potion(16, false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); /** The hunger Potion object. */ public static final Potion hunger = (new Potion(17, true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); /** The weakness Potion object. */ public static final Potion weakness = (new PotionAttackDamage(18, true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).func_111184_a(SharedMonsterAttributes.field_111264_e, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); /** The poison Potion object. */ public static final Potion poison = (new Potion(19, true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); /** The wither Potion object. */ public static final Potion wither = (new Potion(20, true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); public static final Potion field_76434_w = (new PotionHealthBoost(21, false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).func_111184_a(SharedMonsterAttributes.field_111267_a, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); public static final Potion field_76444_x = (new PotionAbsoption(22, false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); public static final Potion field_76443_y = (new PotionHealth(23, false, 16262179)).setPotionName("potion.saturation"); public static final Potion field_76442_z = null; public static final Potion field_76409_A = null; public static final Potion field_76410_B = null; public static final Potion field_76411_C = null; public static final Potion field_76405_D = null; public static final Potion field_76406_E = null; public static final Potion field_76407_F = null; public static final Potion field_76408_G = null; /** The Id of a Potion object. */ public final int id; private final Map field_111188_I = Maps.newHashMap(); /** * This field indicated if the effect is 'bad' - negative - for the entity. */ private final boolean isBadEffect; /** Is the color of the liquid for this potion. */ private final int liquidColor; /** The name of the Potion. */ private String name = ""; /** The index for the icon displayed when the potion effect is active. */ private int statusIconIndex = -1; private double effectiveness; private boolean usable; protected Potion(int par1, boolean par2, int par3) { this.id = par1; potionTypes[par1] = this; this.isBadEffect = par2; if (par2) { this.effectiveness = 0.5D; } else { this.effectiveness = 1.0D; } this.liquidColor = par3; } /** * Sets the index for the icon displayed in the player's inventory when the status is active. */ protected Potion setIconIndex(int par1, int par2) { this.statusIconIndex = par1 + par2 * 8; return this; } /** * returns the ID of the potion */ public int getId() { return this.id; } public void performEffect(EntityLivingBase par1EntityLivingBase, int par2) { if (this.id == regeneration.id) { if (par1EntityLivingBase.func_110143_aJ() < par1EntityLivingBase.func_110138_aP()) { par1EntityLivingBase.heal(1.0F); } } else if (this.id == poison.id) { if (par1EntityLivingBase.func_110143_aJ() > 1.0F) { par1EntityLivingBase.attackEntityFrom(DamageSource.magic, 1.0F); } } else if (this.id == wither.id) { par1EntityLivingBase.attackEntityFrom(DamageSource.wither, 1.0F); } else if (this.id == hunger.id && par1EntityLivingBase instanceof EntityPlayer) { ((EntityPlayer)par1EntityLivingBase).addExhaustion(0.025F * (float)(par2 + 1)); } else if (this.id == field_76443_y.id && par1EntityLivingBase instanceof EntityPlayer) { if (!par1EntityLivingBase.worldObj.isRemote) { ((EntityPlayer)par1EntityLivingBase).getFoodStats().addStats(par2 + 1, 1.0F); } } else if ((this.id != heal.id || par1EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par1EntityLivingBase.isEntityUndead())) { if (this.id == harm.id && !par1EntityLivingBase.isEntityUndead() || this.id == heal.id && par1EntityLivingBase.isEntityUndead()) { par1EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)(6 << par2)); } } else { par1EntityLivingBase.heal((float)Math.max(4 << par2, 0)); } } /** * Hits the provided entity with this potion's instant effect. */ public void affectEntity(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase, int par3, double par4) { int var6; if ((this.id != heal.id || par2EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par2EntityLivingBase.isEntityUndead())) { if (this.id == harm.id && !par2EntityLivingBase.isEntityUndead() || this.id == heal.id && par2EntityLivingBase.isEntityUndead()) { var6 = (int)(par4 * (double)(6 << par3) + 0.5D); if (par1EntityLivingBase == null) { par2EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)var6); } else { par2EntityLivingBase.attackEntityFrom(DamageSource.causeIndirectMagicDamage(par2EntityLivingBase, par1EntityLivingBase), (float)var6); } } } else { var6 = (int)(par4 * (double)(4 << par3) + 0.5D); par2EntityLivingBase.heal((float)var6); } } /** * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) */ public boolean isInstant() { return false; } /** * checks if Potion effect is ready to be applied this tick. */ public boolean isReady(int par1, int par2) { int var3; if (this.id == regeneration.id) { var3 = 50 >> par2; return var3 > 0 ? par1 % var3 == 0 : true; } else if (this.id == poison.id) { var3 = 25 >> par2; return var3 > 0 ? par1 % var3 == 0 : true; } else if (this.id == wither.id) { var3 = 40 >> par2; return var3 > 0 ? par1 % var3 == 0 : true; } else { return this.id == hunger.id; } } /** * Set the potion name. */ public Potion setPotionName(String par1Str) { this.name = par1Str; return this; } /** * returns the name of the potion */ public String getName() { return this.name; } protected Potion setEffectiveness(double par1) { this.effectiveness = par1; return this; } public double getEffectiveness() { return this.effectiveness; } public boolean isUsable() { return this.usable; } /** * Returns the color of the potion liquid. */ public int getLiquidColor() { return this.liquidColor; } public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5) { AttributeModifier var6 = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5); this.field_111188_I.put(par1Attribute, var6); return this; } public void func_111187_a(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { Iterator var4 = this.field_111188_I.entrySet().iterator(); while (var4.hasNext()) { Entry var5 = (Entry)var4.next(); AttributeInstance var6 = par2BaseAttributeMap.func_111151_a((Attribute)var5.getKey()); if (var6 != null) { var6.func_111124_b((AttributeModifier)var5.getValue()); } } } public void func_111185_a(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { Iterator var4 = this.field_111188_I.entrySet().iterator(); while (var4.hasNext()) { Entry var5 = (Entry)var4.next(); AttributeInstance var6 = par2BaseAttributeMap.func_111151_a((Attribute)var5.getKey()); if (var6 != null) { AttributeModifier var7 = (AttributeModifier)var5.getValue(); var6.func_111124_b(var7); var6.func_111121_a(new AttributeModifier(var7.func_111167_a(), this.getName() + " " + par3, this.func_111183_a(par3, var7), var7.func_111169_c())); } } } public double func_111183_a(int par1, AttributeModifier par2AttributeModifier) { return par2AttributeModifier.func_111164_d() * (double)(par1 + 1); } }
herpingdo/Hakkit
net/minecraft/src/Potion.java
Java
gpl-3.0
12,342
'use strict'; var obj = { a: 100, b: 200 }; var myVar = 10; console.log('Before delete'); console.log(obj); console.log(myVar); delete obj.a; //delete myVar;//ERROR console.log('After delete' + obj); console.log(obj); console.log(myVar);
ramezmagdy/NetPull
js/deletingStuff.js
JavaScript
gpl-3.0
242
using System.Collections.Generic; using System.Drawing; namespace NvnTest.Employer { /// <author>Blaise Braye</author> /// <summary> /// GridDrawer is able to draw object inherited from this class, /// a common use case for GridDraw is to call GetSize method first, /// then setting a Rectangle in which the Draw method will be allowed to print. /// It's usefull for everyone because it allows to defines some blocks to be printed /// without modifying library core /// </summary> public abstract class PrintBlock { public virtual RectangleF Rectangle { get; set; } public abstract SizeF GetSize(Graphics g, DocumentMetrics metrics); public abstract void Draw(Graphics g, Dictionary<CodeEnum, string> codes); } }
nvngithub/nvntest
NvnTest.Employer/schedules/report/datagrid print/PrintBlock.cs
C#
gpl-3.0
788
/* jshint expr: true */ !(function($, wysi) { 'use strict'; var templates = function(key, locale, options) { return wysi.tpl[key]({locale: locale, options: options}); }; var Wysihtml5 = function(el, options) { this.el = el; var toolbarOpts = options || defaultOptions; for(var t in toolbarOpts.customTemplates) { wysi.tpl[t] = toolbarOpts.customTemplates[t]; } this.toolbar = this.createToolbar(el, toolbarOpts); this.editor = this.createEditor(options); window.editor = this.editor; $('iframe.wysihtml5-sandbox').each(function(i, el){ $(el.contentWindow).off('focus.wysihtml5').on({ 'focus.wysihtml5' : function(){ $('li.dropdown').removeClass('open'); } }); }); }; Wysihtml5.prototype = { constructor: Wysihtml5, createEditor: function(options) { options = options || {}; // Add the toolbar to a clone of the options object so multiple instances // of the WYISYWG don't break because 'toolbar' is already defined options = $.extend(true, {}, options); options.toolbar = this.toolbar[0]; var editor = new wysi.Editor(this.el[0], options); if(options && options.events) { for(var eventName in options.events) { editor.on(eventName, options.events[eventName]); } } return editor; }, createToolbar: function(el, options) { var self = this; var toolbar = $('<ul/>', { 'class' : 'wysihtml5-toolbar', 'style': 'display:none' }); var culture = options.locale || defaultOptions.locale || 'en'; for(var key in defaultOptions) { var value = false; if(options[key] !== undefined) { if(options[key] === true) { value = true; } } else { value = defaultOptions[key]; } if(value === true) { toolbar.append(templates(key, locale[culture], options)); if(key === 'html') { this.initHtml(toolbar); } if(key === 'link') { this.initInsertLink(toolbar); } if(key === 'image') { this.initInsertImage(toolbar); } } } if(options.toolbar) { for(key in options.toolbar) { toolbar.append(options.toolbar[key]); } } toolbar.find('a[data-wysihtml5-command="formatBlock"]').click(function(e) { var target = e.target || e.srcElement; var el = $(target); self.toolbar.find('.current-font').text(el.html()); }); toolbar.find('a[data-wysihtml5-command="foreColor"]').click(function(e) { var target = e.target || e.srcElement; var el = $(target); self.toolbar.find('.current-color').text(el.html()); }); this.el.before(toolbar); return toolbar; }, initHtml: function(toolbar) { var changeViewSelector = 'a[data-wysihtml5-action="change_view"]'; toolbar.find(changeViewSelector).click(function(e) { toolbar.find('a.btn').not(changeViewSelector).toggleClass('disabled'); }); }, initInsertImage: function(toolbar) { var self = this; var insertImageModal = toolbar.find('.bootstrap-wysihtml5-insert-image-modal'); var urlInput = insertImageModal.find('.bootstrap-wysihtml5-insert-image-url'); var insertButton = insertImageModal.find('a.btn-primary'); var initialValue = urlInput.val(); var caretBookmark; var insertImage = function() { var url = urlInput.val(); urlInput.val(initialValue); self.editor.currentView.element.focus(); if (caretBookmark) { self.editor.composer.selection.setBookmark(caretBookmark); caretBookmark = null; } self.editor.composer.commands.exec('insertImage', url); }; urlInput.keypress(function(e) { if(e.which == 13) { insertImage(); insertImageModal.modal('hide'); } }); insertButton.click(insertImage); insertImageModal.on('shown', function() { urlInput.focus(); }); insertImageModal.on('hide', function() { self.editor.currentView.element.focus(); }); toolbar.find('a[data-wysihtml5-command=insertImage]').click(function() { var activeButton = $(this).hasClass('wysihtml5-command-active'); if (!activeButton) { self.editor.currentView.element.focus(false); caretBookmark = self.editor.composer.selection.getBookmark(); insertImageModal.appendTo('body').modal('show'); insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) { e.stopPropagation(); }); return false; } else { return true; } }); }, initInsertLink: function(toolbar) { var self = this; var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal'); var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url'); var targetInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-target'); var insertButton = insertLinkModal.find('a.btn-primary'); var initialValue = urlInput.val(); var caretBookmark; var insertLink = function() { var url = urlInput.val(); urlInput.val(initialValue); self.editor.currentView.element.focus(); if (caretBookmark) { self.editor.composer.selection.setBookmark(caretBookmark); caretBookmark = null; } var newWindow = targetInput.prop('checked'); self.editor.composer.commands.exec('createLink', { 'href' : url, 'target' : (newWindow ? '_blank' : '_self'), 'rel' : (newWindow ? 'nofollow' : '') }); }; var pressedEnter = false; urlInput.keypress(function(e) { if(e.which == 13) { insertLink(); insertLinkModal.modal('hide'); } }); insertButton.click(insertLink); insertLinkModal.on('shown', function() { urlInput.focus(); }); insertLinkModal.on('hide', function() { self.editor.currentView.element.focus(); }); toolbar.find('a[data-wysihtml5-command=createLink]').click(function() { var activeButton = $(this).hasClass('wysihtml5-command-active'); if (!activeButton) { self.editor.currentView.element.focus(false); caretBookmark = self.editor.composer.selection.getBookmark(); insertLinkModal.appendTo('body').modal('show'); insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) { e.stopPropagation(); }); return false; } else { return true; } }); } }; // these define our public api var methods = { resetDefaults: function() { $.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache); }, bypassDefaults: function(options) { return this.each(function () { var $this = $(this); $this.data('wysihtml5', new Wysihtml5($this, options)); }); }, shallowExtend: function (options) { var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data()); var that = this; return methods.bypassDefaults.apply(that, [settings]); }, deepExtend: function(options) { var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {}); var that = this; return methods.bypassDefaults.apply(that, [settings]); }, init: function(options) { var that = this; return methods.shallowExtend.apply(that, [options]); } }; $.fn.wysihtml5 = function ( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.wysihtml5' ); } }; $.fn.wysihtml5.Constructor = Wysihtml5; var defaultOptions = $.fn.wysihtml5.defaultOptions = { 'font-styles': true, 'color': false, 'emphasis': true, 'lists': true, 'html': false, 'link': true, 'image': true, events: {}, parserRules: { classes: { 'wysiwyg-color-silver' : 1, 'wysiwyg-color-gray' : 1, 'wysiwyg-color-white' : 1, 'wysiwyg-color-maroon' : 1, 'wysiwyg-color-red' : 1, 'wysiwyg-color-purple' : 1, 'wysiwyg-color-fuchsia' : 1, 'wysiwyg-color-green' : 1, 'wysiwyg-color-lime' : 1, 'wysiwyg-color-olive' : 1, 'wysiwyg-color-yellow' : 1, 'wysiwyg-color-navy' : 1, 'wysiwyg-color-blue' : 1, 'wysiwyg-color-teal' : 1, 'wysiwyg-color-aqua' : 1, 'wysiwyg-color-orange' : 1 }, tags: { 'b': {}, 'i': {}, 'strong': {}, 'em': {}, 'p': {}, 'br': {}, 'ol': {}, 'ul': {}, 'li': {}, 'h1': {}, 'h2': {}, 'h3': {}, 'h4': {}, 'h5': {}, 'h6': {}, 'blockquote': {}, 'u': 1, 'img': { 'check_attributes': { 'width': 'numbers', 'alt': 'alt', 'src': 'url', 'height': 'numbers' } }, 'a': { check_attributes: { 'href': 'url' // important to avoid XSS }, 'set_attributes': { 'target': '_blank', 'rel': 'nofollow' } }, 'span': 1, 'div': 1, // to allow save and edit files with code tag hacks 'code': 1, 'pre': 1 } }, locale: 'fr' }; if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') { $.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions); } var locale = $.fn.wysihtml5.locale = {}; })(window.jQuery, window.wysihtml5);
UnsafeDriving/JDIY
web/jdiy/admin/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js
JavaScript
gpl-3.0
10,258
import requests import re def request_by_ip(ip): response = {} request = requests.get("http://www.fairplay.ac/lookup/address/{}".format(ip)) assert request.status_code == 200 output = re.findall("Fairplay Guid: ([a-zA-Z0-9]{5})", request.text) if len(output) == 0: return None response["guid"] = output[0] response["fairshots"] = re.findall("reportFairshot\('(.*?)','(.*?)','(.*?)','(.*?)','(.*?)'", request.text) return response
ohad258/sof2utils
FairplayRequester.py
Python
gpl-3.0
471
module.exports = { //--------------------------------------------------------------------- // Action Name // // This is the name of the action displayed in the editor. //--------------------------------------------------------------------- name: "Leave Voice Channel", //--------------------------------------------------------------------- // Action Section // // This is the section the action will fall into. //--------------------------------------------------------------------- section: "Audio Control", //--------------------------------------------------------------------- // Action Subtitle // // This function generates the subtitle displayed next to the name. //--------------------------------------------------------------------- subtitle: function(data) { return 'The bot leaves voice channel.'; }, //--------------------------------------------------------------------- // Action Fields // // These are the fields for the action. These fields are customized // by creating elements with corresponding IDs in the HTML. These // are also the names of the fields stored in the action's JSON data. //--------------------------------------------------------------------- fields: [], //--------------------------------------------------------------------- // Command HTML // // This function returns a string containing the HTML used for // editting actions. // // The "isEvent" parameter will be true if this action is being used // for an event. Due to their nature, events lack certain information, // so edit the HTML to reflect this. // // The "data" parameter stores constants for select elements to use. // Each is an array: index 0 for commands, index 1 for events. // The names are: sendTargets, members, roles, channels, // messages, servers, variables //--------------------------------------------------------------------- html: function(isEvent, data) { return ''; }, //--------------------------------------------------------------------- // Action Editor Init Code // // When the HTML is first applied to the action editor, this code // is also run. This helps add modifications or setup reactionary // functions for the DOM elements. //--------------------------------------------------------------------- init: function() { }, //--------------------------------------------------------------------- // Action Bot Function // // This is the function for the action within the Bot's Action class. // Keep in mind event calls won't have access to the "msg" parameter, // so be sure to provide checks for variable existance. //--------------------------------------------------------------------- action: function(cache) { const server = cache.server; if(server && server.me.voiceChannel) { server.me.voiceChannel.leave(); } this.callNextAction(cache); }, //--------------------------------------------------------------------- // Action Bot Mod // // Upon initialization of the bot, this code is run. Using the bot's // DBM namespace, one can add/modify existing functions if necessary. // In order to reduce conflictions between mods, be sure to alias // functions you wish to overwrite. //--------------------------------------------------------------------- mod: function(DBM) { } }; // End of module
Bourbbbon/PickleRi6
actions/leave_voice_channel.js
JavaScript
gpl-3.0
3,272
package graph.module.cli; import graph.core.CommonConcepts; import graph.core.CycDAG; import graph.core.DAGEdge; import graph.core.Edge; import graph.core.ErrorEdge; import graph.core.Node; import graph.core.cli.DAGPortHandler; import graph.module.TransitiveIntervalSchemaModule; import java.io.BufferedReader; import java.util.Collection; import org.apache.commons.lang3.StringUtils; import util.Pair; import core.Command; public class PruneCyclesCommand extends Command { @Override public String helpText() { return "{0} : Prompt the knowledge engineer to prune cyclic " + "edges. The user will receive prompts for every cycle " + "and remove an edge by selecting the edge number for " + "every found cycle."; } @Override public String shortDescription() { return "Prompt the knowledge engineer to prune cyclic edges."; } @Override protected void executeImpl() { DAGPortHandler dagHandler = (DAGPortHandler) handler; CycDAG dag = (CycDAG) dagHandler.getDAG(); TransitiveIntervalSchemaModule module = (TransitiveIntervalSchemaModule) dag .getModule(TransitiveIntervalSchemaModule.class); if (module == null) { print("-1|Transitive Interval Schema Module is not in use for this DAG.\n"); return; } print("Scanning DAG for transitive cycles (this may take a few minutes)... "); flushOut(); // Scan the DAG Collection<Pair<DAGEdge, DAGEdge>> cycles = module.identifyCycles(dag .getNodes()); print(cycles.size() + " found!\n"); // For every cycle BufferedReader in = getPortHandler().getReader(); for (Pair<DAGEdge, DAGEdge> cycleEdges : cycles) { try { Node[] rewriteA = new Node[] { CommonConcepts.REWRITE_OF.getNode(dag), cycleEdges.objA_.getNodes()[1], cycleEdges.objA_.getNodes()[2] }; Node[] rewriteB = new Node[] { CommonConcepts.REWRITE_OF.getNode(dag), cycleEdges.objA_.getNodes()[2], cycleEdges.objA_.getNodes()[1] }; print("Ignore (0)\n" + "Remove edge (1): " + cycleEdges.objA_.toString(false) + "\n" + "Remove edge (2): " + cycleEdges.objB_.toString() + "\n" + "Add rewrite (" + StringUtils.join(rewriteA, ' ') + ") (3)\n" + "Add rewrite (" + StringUtils.join(rewriteB, ' ') + ") (4)\n" + "Enter number: "); flushOut(); String index = in.readLine().trim(); int decision = Integer.parseInt(index); DAGEdge edge = null; if (decision == 0) continue; else if (decision == 1) edge = cycleEdges.objA_; else if (decision == 2) edge = cycleEdges.objB_; else if (decision == 3) { Edge result = dag.findOrCreateEdge(rewriteA, null, null, true, false, false); if (result instanceof ErrorEdge) print ("Error adding rewriteEdge: " + result.toString(false)); } else if (decision == 4) { Edge result = dag.findOrCreateEdge(rewriteB, null, null, true, false, false); if (result instanceof ErrorEdge) print ("Error adding rewriteEdge: " + result.toString(false)); } // Removing the edge if (edge != null) { if (!dag.removeEdge(edge, true)) print("Could not removed edge " + cycleEdges.objA_ + "!\n"); print("Removed edge " + cycleEdges.objA_ + "\n"); } } catch (Exception e) { print("Error! Proceeding to next cycle.\n"); } } } }
Effervex/CycDAG
src/graph/module/cli/PruneCyclesCommand.java
Java
gpl-3.0
3,427
using Sudoku; using System; using System.Text.RegularExpressions; namespace SodukuConsoleApp.Command { public class AddTileCommand : SudokuCommand { private const string RowIndexGroupName = "rowIndex"; private const string ColumnIndexGroupName = "columnIndex"; private const string TileValueGroupName = "tileValue"; protected override string CommandPattern => @"add (?<" + RowIndexGroupName + @">\d) (?<" + ColumnIndexGroupName + @">\d) (?<" + TileValueGroupName + @">\d)"; public AddTileCommand(Board board) : base(board) { } public override Action<string> Execute => command => { var arguments = Regex.Match(command, CommandPattern); var rowIndex = int.Parse(arguments.Groups[RowIndexGroupName].Value); var columnIndex = int.Parse(arguments.Groups[ColumnIndexGroupName].Value); var value = int.Parse(arguments.Groups[TileValueGroupName].Value); _board.SetTileValue(rowIndex, columnIndex, value); }; public override string Description => $"Add values using \"{CommandPattern}\""; } }
EpicGuy4000/Sudoku
SodukuConsoleApp/Commands/AddTileCommand.cs
C#
gpl-3.0
1,155
calculaAreaRectangulo = function() { this.resultado.value = parseInt(this.alto.value) * parseInt(this.ancho.value); this.metodoCompartido("EEEEEAH!"); } calculaAreaTriangulo = function() { this.resultado.value = parseInt(this.alto.value) * parseInt(this.ancho.value) / 2; this.metodoCompartido("OOOOOH!"); } calculaAreaElipse = function() { this.resultado.value = (parseInt(this.alto.value) / 2) * (parseInt(this.ancho.value) / 2) * Math.PI; this.metodoCompartido("OOOOOH!"); } function callbackGenerica(mensaje1, mensaje2) { alert("Ya estáaaaa!! \n" + mensaje1 + " - " + mensaje2); } function callbackErrorRe(mensaje1, mensaje2) { alert("¡¡callbackError Rectangulo!! \n" + mensaje1 + " - " + mensaje2); this.kjkj = "" } function callbackErrorTri(mensaje1, mensaje2) { alert("¡¡callbackError Triangulo!! \n" + mensaje1 + " - " + mensaje2); this.kjkj = "" } // Rectangulo var Rectangulo = Figura.Heredar(calculaAreaRectangulo, "Rectangulo", callbackGenerica, callbackErrorRe); // Triangulo var Triangulo = Figura.Heredar(calculaAreaTriangulo, "Triangulo", callbackGenerica, callbackErrorTri); // Elipse var Elipse = Figura.Heredar(calculaAreaElipse, "Elipse", callbackGenerica);
germanux/cursomeanstack
02_js/18_figuras_poo/18_figuras.js
JavaScript
gpl-3.0
1,253
package pl.koziolekweb.lottomat.machine; import pl.koziolekweb.fun.Function0; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; /** * TODO write JAVADOC!!! * User: koziolek */ public abstract class Machine<IN, T> { public T pick() { return getData() .andThen(defensiveCopy()) .andThen(shuffle()) .andThen(drawN()) .andThen(mapToResult()) .apply(null); } protected Function<Collection<IN>, List<IN>> defensiveCopy() { return ArrayList::new; } protected Function<List<IN>, List<IN>> shuffle() { return l -> { Collections.shuffle(l); return l; }; } protected BiFunction<List<IN>, Integer, List<IN>> draw() { return (c, l) -> c.stream().limit(l).collect(Collectors.toList()); } protected Function<List<IN>, List<IN>> drawN() { return l -> draw().apply(l, limit()); } protected abstract Function0<Collection<IN>> getData(); protected abstract Function<Collection<IN>, T> mapToResult(); protected abstract Integer limit(); }
Koziolek/Lottomat
src/main/java/pl/koziolekweb/lottomat/machine/Machine.java
Java
gpl-3.0
1,156
package org.sapia.corus.database.persistence; import org.sapia.corus.client.services.database.RecordMatcher; import org.sapia.corus.client.services.database.persistence.Record; /** * This class implements the {@link RecordMatcher} interface over the * {@link Template} class. * * @author yduchesne * */ public class TemplateMatcher<T> implements RecordMatcher<T> { private Template<T> template; public TemplateMatcher(Template<T> template) { this.template = template; } /** * This method delegates matching to its internal {@link Template}. * * @see Template */ @Override public boolean matches(Record<T> rec) { return template.matches(rec); } }
sapia-oss/corus
modules/server/src/main/java/org/sapia/corus/database/persistence/TemplateMatcher.java
Java
gpl-3.0
694
var searchData= [ ['dnasequencealignment_20_26_25_20dnasequencegenerator',['DNASequenceAlignment &amp;% DNASequenceGenerator',['../md__home_cristianfernando__documentos_git__d_n_a_sequence_alignment__r_e_a_d_m_e.html',1,'']]] ];
crisferlop/DNASequenceAlignment
doc/html/search/pages_0.js
JavaScript
gpl-3.0
231
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: POGOProtos/Data/AssetDigestEntry.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "POGOProtos/Data/AssetDigestEntry.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/port.h> #include <google/protobuf/stubs/once.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> // @@protoc_insertion_point(includes) namespace POGOProtos { namespace Data { namespace { const ::google::protobuf::Descriptor* AssetDigestEntry_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* AssetDigestEntry_reflection_ = NULL; } // namespace void protobuf_AssignDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto() GOOGLE_ATTRIBUTE_COLD; void protobuf_AssignDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto() { protobuf_AddDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "POGOProtos/Data/AssetDigestEntry.proto"); GOOGLE_CHECK(file != NULL); AssetDigestEntry_descriptor_ = file->message_type(0); static const int AssetDigestEntry_offsets_[6] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, asset_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, bundle_name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, checksum_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, size_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, key_), }; AssetDigestEntry_reflection_ = ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( AssetDigestEntry_descriptor_, AssetDigestEntry::default_instance_, AssetDigestEntry_offsets_, -1, -1, -1, sizeof(AssetDigestEntry), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, _internal_metadata_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AssetDigestEntry, _is_default_instance_)); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( AssetDigestEntry_descriptor_, &AssetDigestEntry::default_instance()); } } // namespace void protobuf_ShutdownFile_POGOProtos_2fData_2fAssetDigestEntry_2eproto() { delete AssetDigestEntry::default_instance_; delete AssetDigestEntry_reflection_; } void protobuf_AddDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto() GOOGLE_ATTRIBUTE_COLD; void protobuf_AddDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n&POGOProtos/Data/AssetDigestEntry.proto" "\022\017POGOProtos.Data\"w\n\020AssetDigestEntry\022\020\n" "\010asset_id\030\001 \001(\t\022\023\n\013bundle_name\030\002 \001(\t\022\017\n\007" "version\030\003 \001(\003\022\020\n\010checksum\030\004 \001(\007\022\014\n\004size\030" "\005 \001(\005\022\013\n\003key\030\006 \001(\014b\006proto3", 186); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "POGOProtos/Data/AssetDigestEntry.proto", &protobuf_RegisterTypes); AssetDigestEntry::default_instance_ = new AssetDigestEntry(); AssetDigestEntry::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_POGOProtos_2fData_2fAssetDigestEntry_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_POGOProtos_2fData_2fAssetDigestEntry_2eproto { StaticDescriptorInitializer_POGOProtos_2fData_2fAssetDigestEntry_2eproto() { protobuf_AddDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto(); } } static_descriptor_initializer_POGOProtos_2fData_2fAssetDigestEntry_2eproto_; // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int AssetDigestEntry::kAssetIdFieldNumber; const int AssetDigestEntry::kBundleNameFieldNumber; const int AssetDigestEntry::kVersionFieldNumber; const int AssetDigestEntry::kChecksumFieldNumber; const int AssetDigestEntry::kSizeFieldNumber; const int AssetDigestEntry::kKeyFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 AssetDigestEntry::AssetDigestEntry() : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); // @@protoc_insertion_point(constructor:POGOProtos.Data.AssetDigestEntry) } void AssetDigestEntry::InitAsDefaultInstance() { _is_default_instance_ = true; } AssetDigestEntry::AssetDigestEntry(const AssetDigestEntry& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:POGOProtos.Data.AssetDigestEntry) } void AssetDigestEntry::SharedCtor() { _is_default_instance_ = false; ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; asset_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); bundle_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); version_ = GOOGLE_LONGLONG(0); checksum_ = 0u; size_ = 0; key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } AssetDigestEntry::~AssetDigestEntry() { // @@protoc_insertion_point(destructor:POGOProtos.Data.AssetDigestEntry) SharedDtor(); } void AssetDigestEntry::SharedDtor() { asset_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); bundle_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != default_instance_) { } } void AssetDigestEntry::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* AssetDigestEntry::descriptor() { protobuf_AssignDescriptorsOnce(); return AssetDigestEntry_descriptor_; } const AssetDigestEntry& AssetDigestEntry::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_POGOProtos_2fData_2fAssetDigestEntry_2eproto(); return *default_instance_; } AssetDigestEntry* AssetDigestEntry::default_instance_ = NULL; AssetDigestEntry* AssetDigestEntry::New(::google::protobuf::Arena* arena) const { AssetDigestEntry* n = new AssetDigestEntry; if (arena != NULL) { arena->Own(n); } return n; } void AssetDigestEntry::Clear() { // @@protoc_insertion_point(message_clear_start:POGOProtos.Data.AssetDigestEntry) #if defined(__clang__) #define ZR_HELPER_(f) \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ __builtin_offsetof(AssetDigestEntry, f) \ _Pragma("clang diagnostic pop") #else #define ZR_HELPER_(f) reinterpret_cast<char*>(\ &reinterpret_cast<AssetDigestEntry*>(16)->f) #endif #define ZR_(first, last) do {\ ::memset(&first, 0,\ ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ } while (0) ZR_(version_, size_); asset_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); bundle_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); #undef ZR_HELPER_ #undef ZR_ } bool AssetDigestEntry::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:POGOProtos.Data.AssetDigestEntry) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string asset_id = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_asset_id())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->asset_id().data(), this->asset_id().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "POGOProtos.Data.AssetDigestEntry.asset_id")); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_bundle_name; break; } // optional string bundle_name = 2; case 2: { if (tag == 18) { parse_bundle_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_bundle_name())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->bundle_name().data(), this->bundle_name().length(), ::google::protobuf::internal::WireFormatLite::PARSE, "POGOProtos.Data.AssetDigestEntry.bundle_name")); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_version; break; } // optional int64 version = 3; case 3: { if (tag == 24) { parse_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &version_))); } else { goto handle_unusual; } if (input->ExpectTag(37)) goto parse_checksum; break; } // optional fixed32 checksum = 4; case 4: { if (tag == 37) { parse_checksum: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &checksum_))); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_size; break; } // optional int32 size = 5; case 5: { if (tag == 40) { parse_size: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &size_))); } else { goto handle_unusual; } if (input->ExpectTag(50)) goto parse_key; break; } // optional bytes key = 6; case 6: { if (tag == 50) { parse_key: DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_key())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } success: // @@protoc_insertion_point(parse_success:POGOProtos.Data.AssetDigestEntry) return true; failure: // @@protoc_insertion_point(parse_failure:POGOProtos.Data.AssetDigestEntry) return false; #undef DO_ } void AssetDigestEntry::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:POGOProtos.Data.AssetDigestEntry) // optional string asset_id = 1; if (this->asset_id().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->asset_id().data(), this->asset_id().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "POGOProtos.Data.AssetDigestEntry.asset_id"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->asset_id(), output); } // optional string bundle_name = 2; if (this->bundle_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->bundle_name().data(), this->bundle_name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "POGOProtos.Data.AssetDigestEntry.bundle_name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->bundle_name(), output); } // optional int64 version = 3; if (this->version() != 0) { ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->version(), output); } // optional fixed32 checksum = 4; if (this->checksum() != 0) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(4, this->checksum(), output); } // optional int32 size = 5; if (this->size() != 0) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->size(), output); } // optional bytes key = 6; if (this->key().size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 6, this->key(), output); } // @@protoc_insertion_point(serialize_end:POGOProtos.Data.AssetDigestEntry) } ::google::protobuf::uint8* AssetDigestEntry::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:POGOProtos.Data.AssetDigestEntry) // optional string asset_id = 1; if (this->asset_id().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->asset_id().data(), this->asset_id().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "POGOProtos.Data.AssetDigestEntry.asset_id"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->asset_id(), target); } // optional string bundle_name = 2; if (this->bundle_name().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->bundle_name().data(), this->bundle_name().length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "POGOProtos.Data.AssetDigestEntry.bundle_name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->bundle_name(), target); } // optional int64 version = 3; if (this->version() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->version(), target); } // optional fixed32 checksum = 4; if (this->checksum() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(4, this->checksum(), target); } // optional int32 size = 5; if (this->size() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->size(), target); } // optional bytes key = 6; if (this->key().size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 6, this->key(), target); } // @@protoc_insertion_point(serialize_to_array_end:POGOProtos.Data.AssetDigestEntry) return target; } int AssetDigestEntry::ByteSize() const { // @@protoc_insertion_point(message_byte_size_start:POGOProtos.Data.AssetDigestEntry) int total_size = 0; // optional string asset_id = 1; if (this->asset_id().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->asset_id()); } // optional string bundle_name = 2; if (this->bundle_name().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->bundle_name()); } // optional int64 version = 3; if (this->version() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( this->version()); } // optional fixed32 checksum = 4; if (this->checksum() != 0) { total_size += 1 + 4; } // optional int32 size = 5; if (this->size() != 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->size()); } // optional bytes key = 6; if (this->key().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( this->key()); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void AssetDigestEntry::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:POGOProtos.Data.AssetDigestEntry) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } const AssetDigestEntry* source = ::google::protobuf::internal::DynamicCastToGenerated<const AssetDigestEntry>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:POGOProtos.Data.AssetDigestEntry) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:POGOProtos.Data.AssetDigestEntry) MergeFrom(*source); } } void AssetDigestEntry::MergeFrom(const AssetDigestEntry& from) { // @@protoc_insertion_point(class_specific_merge_from_start:POGOProtos.Data.AssetDigestEntry) if (GOOGLE_PREDICT_FALSE(&from == this)) { ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__); } if (from.asset_id().size() > 0) { asset_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.asset_id_); } if (from.bundle_name().size() > 0) { bundle_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.bundle_name_); } if (from.version() != 0) { set_version(from.version()); } if (from.checksum() != 0) { set_checksum(from.checksum()); } if (from.size() != 0) { set_size(from.size()); } if (from.key().size() > 0) { key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_); } } void AssetDigestEntry::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:POGOProtos.Data.AssetDigestEntry) if (&from == this) return; Clear(); MergeFrom(from); } void AssetDigestEntry::CopyFrom(const AssetDigestEntry& from) { // @@protoc_insertion_point(class_specific_copy_from_start:POGOProtos.Data.AssetDigestEntry) if (&from == this) return; Clear(); MergeFrom(from); } bool AssetDigestEntry::IsInitialized() const { return true; } void AssetDigestEntry::Swap(AssetDigestEntry* other) { if (other == this) return; InternalSwap(other); } void AssetDigestEntry::InternalSwap(AssetDigestEntry* other) { asset_id_.Swap(&other->asset_id_); bundle_name_.Swap(&other->bundle_name_); std::swap(version_, other->version_); std::swap(checksum_, other->checksum_); std::swap(size_, other->size_); key_.Swap(&other->key_); _internal_metadata_.Swap(&other->_internal_metadata_); std::swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata AssetDigestEntry::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = AssetDigestEntry_descriptor_; metadata.reflection = AssetDigestEntry_reflection_; return metadata; } #if PROTOBUF_INLINE_NOT_IN_HEADERS // AssetDigestEntry // optional string asset_id = 1; void AssetDigestEntry::clear_asset_id() { asset_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& AssetDigestEntry::asset_id() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.asset_id) return asset_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_asset_id(const ::std::string& value) { asset_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.asset_id) } void AssetDigestEntry::set_asset_id(const char* value) { asset_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:POGOProtos.Data.AssetDigestEntry.asset_id) } void AssetDigestEntry::set_asset_id(const char* value, size_t size) { asset_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:POGOProtos.Data.AssetDigestEntry.asset_id) } ::std::string* AssetDigestEntry::mutable_asset_id() { // @@protoc_insertion_point(field_mutable:POGOProtos.Data.AssetDigestEntry.asset_id) return asset_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* AssetDigestEntry::release_asset_id() { // @@protoc_insertion_point(field_release:POGOProtos.Data.AssetDigestEntry.asset_id) return asset_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_allocated_asset_id(::std::string* asset_id) { if (asset_id != NULL) { } else { } asset_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), asset_id); // @@protoc_insertion_point(field_set_allocated:POGOProtos.Data.AssetDigestEntry.asset_id) } // optional string bundle_name = 2; void AssetDigestEntry::clear_bundle_name() { bundle_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& AssetDigestEntry::bundle_name() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.bundle_name) return bundle_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_bundle_name(const ::std::string& value) { bundle_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.bundle_name) } void AssetDigestEntry::set_bundle_name(const char* value) { bundle_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:POGOProtos.Data.AssetDigestEntry.bundle_name) } void AssetDigestEntry::set_bundle_name(const char* value, size_t size) { bundle_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:POGOProtos.Data.AssetDigestEntry.bundle_name) } ::std::string* AssetDigestEntry::mutable_bundle_name() { // @@protoc_insertion_point(field_mutable:POGOProtos.Data.AssetDigestEntry.bundle_name) return bundle_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* AssetDigestEntry::release_bundle_name() { // @@protoc_insertion_point(field_release:POGOProtos.Data.AssetDigestEntry.bundle_name) return bundle_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_allocated_bundle_name(::std::string* bundle_name) { if (bundle_name != NULL) { } else { } bundle_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), bundle_name); // @@protoc_insertion_point(field_set_allocated:POGOProtos.Data.AssetDigestEntry.bundle_name) } // optional int64 version = 3; void AssetDigestEntry::clear_version() { version_ = GOOGLE_LONGLONG(0); } ::google::protobuf::int64 AssetDigestEntry::version() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.version) return version_; } void AssetDigestEntry::set_version(::google::protobuf::int64 value) { version_ = value; // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.version) } // optional fixed32 checksum = 4; void AssetDigestEntry::clear_checksum() { checksum_ = 0u; } ::google::protobuf::uint32 AssetDigestEntry::checksum() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.checksum) return checksum_; } void AssetDigestEntry::set_checksum(::google::protobuf::uint32 value) { checksum_ = value; // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.checksum) } // optional int32 size = 5; void AssetDigestEntry::clear_size() { size_ = 0; } ::google::protobuf::int32 AssetDigestEntry::size() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.size) return size_; } void AssetDigestEntry::set_size(::google::protobuf::int32 value) { size_ = value; // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.size) } // optional bytes key = 6; void AssetDigestEntry::clear_key() { key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } const ::std::string& AssetDigestEntry::key() const { // @@protoc_insertion_point(field_get:POGOProtos.Data.AssetDigestEntry.key) return key_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_key(const ::std::string& value) { key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:POGOProtos.Data.AssetDigestEntry.key) } void AssetDigestEntry::set_key(const char* value) { key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:POGOProtos.Data.AssetDigestEntry.key) } void AssetDigestEntry::set_key(const void* value, size_t size) { key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:POGOProtos.Data.AssetDigestEntry.key) } ::std::string* AssetDigestEntry::mutable_key() { // @@protoc_insertion_point(field_mutable:POGOProtos.Data.AssetDigestEntry.key) return key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string* AssetDigestEntry::release_key() { // @@protoc_insertion_point(field_release:POGOProtos.Data.AssetDigestEntry.key) return key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void AssetDigestEntry::set_allocated_key(::std::string* key) { if (key != NULL) { } else { } key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key); // @@protoc_insertion_point(field_set_allocated:POGOProtos.Data.AssetDigestEntry.key) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) } // namespace Data } // namespace POGOProtos // @@protoc_insertion_point(global_scope)
onzlak42/PokemonGo-api-cpp
proto/proto_cpp/POGOProtos/Data/AssetDigestEntry.pb.cc
C++
gpl-3.0
28,078
package edu.isi.bmkeg.lapdf.parser; import java.io.File; import java.io.FileReader; import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.TreeSet; import java.util.concurrent.LinkedBlockingQueue; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.log4j.Logger; import edu.isi.bmkeg.lapdf.extraction.JPedalExtractor; import edu.isi.bmkeg.lapdf.extraction.exceptions.InvalidPopularSpaceValueException; import edu.isi.bmkeg.lapdf.features.HorizontalSplitFeature; import edu.isi.bmkeg.lapdf.model.Block; import edu.isi.bmkeg.lapdf.model.ChunkBlock; import edu.isi.bmkeg.lapdf.model.LapdfDocument; import edu.isi.bmkeg.lapdf.model.PageBlock; import edu.isi.bmkeg.lapdf.model.WordBlock; import edu.isi.bmkeg.lapdf.model.factory.AbstractModelFactory; import edu.isi.bmkeg.lapdf.model.ordering.SpatialOrdering; import edu.isi.bmkeg.lapdf.model.spatial.SpatialEntity; import edu.isi.bmkeg.lapdf.utils.PageImageOutlineRenderer; import edu.isi.bmkeg.lapdf.xml.model.LapdftextXMLChunk; import edu.isi.bmkeg.lapdf.xml.model.LapdftextXMLDocument; import edu.isi.bmkeg.lapdf.xml.model.LapdftextXMLFontStyle; import edu.isi.bmkeg.lapdf.xml.model.LapdftextXMLPage; import edu.isi.bmkeg.lapdf.xml.model.LapdftextXMLWord; import edu.isi.bmkeg.utils.FrequencyCounter; import edu.isi.bmkeg.utils.IntegerFrequencyCounter; import edu.isi.bmkeg.utils.xml.XmlBindingTools; public class RuleBasedParser implements Parser { private static Logger logger = Logger.getLogger(RuleBasedParser.class); private boolean debugImages = false; private ArrayList<PageBlock> pageList; protected JPedalExtractor pageExtractor; //private PDFBoxExtractor pageExtractor; private int idGenerator; private IntegerFrequencyCounter avgHeightFrequencyCounter; private FrequencyCounter fontFrequencyCounter; private int northSouthSpacing; private int eastWestSpacing; private boolean quickly = false; protected AbstractModelFactory modelFactory; protected String path; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public String getPath() { return path; } public void setPath(String path) { this.path = path; } private boolean isDebugImages() { return debugImages; } private void setDebugImages(boolean debugImages) { this.debugImages = debugImages; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public RuleBasedParser(AbstractModelFactory modelFactory) throws Exception { pageList = new ArrayList<PageBlock>(); pageExtractor = new JPedalExtractor(modelFactory); idGenerator = 1; this.avgHeightFrequencyCounter = new IntegerFrequencyCounter(1); this.fontFrequencyCounter = new FrequencyCounter(); this.modelFactory = modelFactory; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @Override public LapdfDocument parse(File file) throws Exception { if( file.getName().endsWith( ".pdf") ) { return this.parsePdf(file); } else if(file.getName().endsWith( "_lapdf.xml")) { return this.parseXml(file); } else { throw new Exception("File type of " + file.getName() + " not *.pdf or *_lapdf.xml"); } } public LapdfDocument parsePdf(File file) throws Exception { LapdfDocument document = null; init(file); List<WordBlock> pageWordBlockList = null; PageBlock pageBlock = null; int pageCounter = 1; document = new LapdfDocument(file); document.setjPedalDecodeFailed(true); String pth = file.getPath(); pth = pth.substring(0, pth.lastIndexOf(".pdf")); File imgDir = new File(pth); if (isDebugImages()) { imgDir.mkdir(); } // // Calling 'hasNext()' get the text from the extractor. // while (pageExtractor.hasNext()) { document.setjPedalDecodeFailed(false); pageBlock = modelFactory.createPageBlock( pageCounter++, pageExtractor.getCurrentPageBoxWidth(), pageExtractor.getCurrentPageBoxHeight(), document); pageList.add(pageBlock); pageWordBlockList = pageExtractor.next(); if(!pageWordBlockList.isEmpty()) { idGenerator = pageBlock.initialize(pageWordBlockList, idGenerator); this.eastWestSpacing = (pageBlock.getMostPopularWordHeightPage()) / 2 + pageBlock.getMostPopularHorizontalSpaceBetweenWordsPage(); this.northSouthSpacing = (pageBlock.getMostPopularWordHeightPage() ) / 2 + pageBlock.getMostPopularVerticalSpaceBetweenWordsPage(); if( this.quickly ) { buildChunkBlocksQuickly(pageWordBlockList, pageBlock); } else { buildChunkBlocksSlowly(pageWordBlockList, pageBlock); } mergeHighlyOverlappedChunkBlocks(pageBlock); if (isDebugImages()) { PageImageOutlineRenderer.dumpChunkTypePageImageToFile( pageBlock, new File(pth + "/_01_afterBuildBlocks" + pageBlock.getPageNumber() + ".png"), file.getName() + "afterBuildBlocks" + pageBlock.getPageNumber() + ".png"); } } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!document.hasjPedalDecodeFailed()) { // initial parse is commplete. String s = file.getName().replaceAll("\\.pdf", ""); Pattern p = Pattern.compile("(\\d+)"); Matcher m = p.matcher(file.getName()); if( m.find() ) { s = m.group(1); } /*for (PageBlock page : pageList) { if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_02_beforeBuildBlocksOverlapDeletion_" + page.getPageNumber() + ".png"), file.getName() + "beforeBuildBlocksOverlapDeletion_" + s + "_" + page.getPageNumber() + ".png", 0); } this.deleteHighlyOverlappedChunkBlocks(page); if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_03_afterBuildBlocksOverlapDeletion_" + page.getPageNumber() + ".png"), file.getName() + "afterBuildBlocksOverlapDeletion_" + s + "_" + page.getPageNumber() + ".png", 0); } this.divideBlocksVertically(page); if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_04_afterVerticalDivide_" + page.getPageNumber() + ".png"), file.getName() + "afterVerticalDivide_" + s + "_" + page.getPageNumber() + ".png", 0); } this.joinLines(page); if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_05_afterJoinLines_" + page.getPageNumber() + ".png"), file.getName() + "afterJoinLines_" + s + "_" + page.getPageNumber() + ".png", 0); } this.divideBlocksHorizontally(page); if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_06_afterHorizontalDivide_" + page.getPageNumber() + ".png"), file.getName() + "afterHorizontalDivide_" + s + "_" + page.getPageNumber() + ".png", 0); } this.deleteHighlyOverlappedChunkBlocks(page); if (isDebugImages()) { PageImageOutlineRenderer.dumpPageImageToFile(page, new File(pth + "/_07_afterOverlapDeletion_" + page.getPageNumber() + ".png"), file.getName() + "/afterOverlapDeletion_" + s + "_" + page.getPageNumber() + ".png", 0); } }*/ document.addPages(pageList); document.calculateBodyTextFrame(); document.calculateMostPopularFontStyles(); } return document; } public LapdfDocument parseXml(File file) throws Exception { FileReader reader = new FileReader(file); return this.parseXml(reader); } public LapdfDocument parseXml(String str) throws Exception { StringReader reader = new StringReader(str); return this.parseXml(reader); } private LapdfDocument parseXml(Reader reader) throws Exception { LapdftextXMLDocument xmlDoc = XmlBindingTools.parseXML(reader, LapdftextXMLDocument.class); List<WordBlock> pageWordBlockList = null; int pageCounter = 1; int id = 0; List<PageBlock> pageList = new ArrayList<PageBlock>(); LapdfDocument document = new LapdfDocument(); Map<Integer, String> fsMap = new HashMap<Integer,String>(); for( LapdftextXMLFontStyle xmlFs : xmlDoc.getFontStyles() ) { fsMap.put( xmlFs.getId(), xmlFs.getFontStyle() ); } for( LapdftextXMLPage xmlPage : xmlDoc.getPages() ) { PageBlock pageBlock = modelFactory.createPageBlock(pageCounter, xmlPage.getW(), xmlPage.getH(), document); pageList.add(pageBlock); List<ChunkBlock> chunkBlockList = new ArrayList<ChunkBlock>(); for( LapdftextXMLChunk xmlChunk : xmlPage.getChunks() ) { String font = xmlChunk.getFont(); List<WordBlock> chunkWords = new ArrayList<WordBlock>(); for( LapdftextXMLWord xmlWord : xmlChunk.getWords() ) { int x1 = xmlWord.getX(); int y1 = xmlWord.getY(); int x2 = xmlWord.getX() + xmlWord.getW(); int y2 = xmlWord.getY() + xmlWord.getH(); WordBlock wordBlock = modelFactory.createWordBlock(x1, y1, x2, y2, 1, font, "", xmlWord.getT(), xmlWord.getI() ); chunkWords.add(wordBlock); pageBlock.add(wordBlock, xmlWord.getId()); wordBlock.setPage(pageBlock); String f = fsMap.get( xmlWord.getfId() ); wordBlock.setFont( f ); String s = fsMap.get( xmlWord.getsId() ); wordBlock.setFontStyle( s ); // add this word's height and font to the counts. document.getAvgHeightFrequencyCounter().add( xmlWord.getH()); document.getFontFrequencyCounter().add( f + ";" + s ); } ChunkBlock chunkBlock = buildChunkBlock(chunkWords, pageBlock); chunkBlockList.add(chunkBlock); pageBlock.add(chunkBlock, xmlChunk.getId()); chunkBlock.setPage(pageBlock); } pageCounter++; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document.addPages(pageList); document.calculateBodyTextFrame(); document.calculateMostPopularFontStyles(); return document; } private void init(File file) throws Exception { pageExtractor.init(file); idGenerator = 1; this.avgHeightFrequencyCounter.reset(); this.fontFrequencyCounter.reset(); pageList.clear(); } /** * Here we build the blocks based on speed, assuming the ordering of words on the page is * in the correct reading order. Thus we start a new block when you move to a new line * with a is if the next line * starts with a different width and a different * @param wordBlocksLeftInPage * @param page */ private void buildChunkBlocksQuickly(List<WordBlock> wordBlocksLeftInPage, PageBlock page) { List<WordBlock> chunkWords = new ArrayList<WordBlock>(); List<ChunkBlock> chunkBlockList1 = new ArrayList<ChunkBlock>(); int minX = 1000, maxX = 0, minY = 1000, maxY = 0; WordBlock prev = null; for( WordBlock word : wordBlocksLeftInPage ) { // add this word's height and font to the counts. page.getDocument().getAvgHeightFrequencyCounter().add( word.getHeight()); page.getDocument().getFontFrequencyCounter().add( word.getFont() + ";" + word.getFontStyle() ); // Is this a new line or // a very widely separated block on the same line? if( prev != null && (word.getY2() > maxY || word.getX1() - maxX > word.getHeight() * 1.5) ) { // 1. Is this new line more than // 0.75 x word.getHeight() // from the chunk so far? boolean lineSeparation = word.getY1() - maxY > word.getHeight() * 0.75; // 2. Is this new line a different font // or a different font size than the // chunk so far? boolean newFont = (word.getFont() != null && !word.getFont().equals(prev.getFont())); boolean newStyle = (word.getFont() != null && !word.getFontStyle().equals(prev.getFontStyle())); // 3. Is this new line outside the // existing minX...maxX limit? boolean outsideX = word.getX1() < minX || word.getX2() > maxX; if( lineSeparation || newFont || newStyle || outsideX ) { ChunkBlock cb1 = buildChunkBlock(chunkWords, page); chunkBlockList1.add(cb1); chunkWords = new ArrayList<WordBlock>(); minX = 1000; maxX = 0; minY = 1000; maxY = 0; prev = null; } } chunkWords.add(word); word.setOrderAddedToChunk(chunkWords.size()); prev = word; if( word.getX1() < minX) minX = word.getX1(); if( word.getX2() > maxX) maxX = word.getX2(); if( word.getY1() < minY) minY = word.getY1(); if( word.getY2() > maxY) maxY = word.getY2(); } ChunkBlock cb1 = buildChunkBlock(chunkWords, page); chunkBlockList1.add(cb1); idGenerator = page.addAll(new ArrayList<SpatialEntity>( chunkBlockList1), idGenerator); } private void buildChunkBlocksSlowly(List<WordBlock> wordBlocksLeftInPage, PageBlock page) { LinkedBlockingQueue<WordBlock> wordBlocksLeftToCheckInChunk = new LinkedBlockingQueue<WordBlock>(); List<WordBlock> chunkWords = new ArrayList<WordBlock>(); List<WordBlock> rotatedWords = new ArrayList<WordBlock>(); int counter; List<ChunkBlock> chunkBlockList1 = new ArrayList<ChunkBlock>(); while (wordBlocksLeftInPage.size() > 0) { int minX = 1000, maxX = 0, minY = 1000, maxY = 0; wordBlocksLeftToCheckInChunk.clear(); // Start off with this word block wordBlocksLeftToCheckInChunk.add(wordBlocksLeftInPage.get(0)); counter = 0; int extra; // Here are all the words we've come across in this run chunkWords.clear(); int chunkTextHeight = -1; // Build a single Chunk here based on overlapping words // keep going while there are still words to work through while (wordBlocksLeftToCheckInChunk.size() != 0) { // // get the top of the stack of words in the queue, // note that we have not yet looked at this word // // look at the top word in the queue WordBlock word = wordBlocksLeftToCheckInChunk.peek(); if( chunkTextHeight == -1 ) { chunkTextHeight = word.getHeight(); } // add this word's height and font to the counts. page.getDocument().getAvgHeightFrequencyCounter().add( word.getHeight()); page.getDocument().getFontFrequencyCounter().add( word.getFont() + ";" + word.getFontStyle() ); // remove this word from the global search wordBlocksLeftInPage.remove(word); // heuristic to correct missing blocking errors for large fonts int eastWest = (int) Math.ceil(word.getHeight() * 0.75); int northSouth = (int) Math.ceil(word.getHeight() * 0.85); // what other words on the page are close to this word // and are still in the block? List<WordBlock> wordsToAddThisIteration = word.readNearbyWords( eastWest, eastWest, northSouth, northSouth); // TODO how to add more precise word features without //word.writeFlushArray(wordsToAddThisIteration); wordsToAddThisIteration.retainAll(wordBlocksLeftInPage); // remove the words we've already looked at wordsToAddThisIteration.removeAll(wordBlocksLeftToCheckInChunk); // or they've already been seen wordsToAddThisIteration.removeAll(chunkWords); // // TODO Add criteria here to improve blocking by // dropping newly found words that should be excluded. // List<WordBlock> wordsToKill = new ArrayList<WordBlock>(); for( WordBlock w : wordsToAddThisIteration) { // They are a different height from the height // of the first word in this chunk +/- 1px // (and outside the current line for the chunk) if( (w.getHeight() > chunkTextHeight + 1 || w.getHeight() < chunkTextHeight - 1) && (w.getY1() < minY || w.getY2() > maxY) ) { wordsToKill.add(w); } } wordsToAddThisIteration.removeAll(wordsToKill); // At this point, these words will be added to this chunk. wordBlocksLeftToCheckInChunk.addAll(wordsToAddThisIteration); // get this word from the queue and add it. WordBlock wb = wordBlocksLeftToCheckInChunk.poll(); chunkWords.add(wb); wb.setOrderAddedToChunk(chunkWords.size()); if( wb.getX1() < minX) minX = wb.getX1(); if( wb.getX2() > maxX) maxX = wb.getX2(); if( wb.getY1() < minY) minY = wb.getY1(); if( wb.getY2() > maxY) maxY = wb.getY2(); } wordBlocksLeftInPage.removeAll(chunkWords); ChunkBlock cb1 = buildChunkBlock(chunkWords, page); chunkBlockList1.add(cb1); } idGenerator = page.addAll(new ArrayList<SpatialEntity>( chunkBlockList1), idGenerator); } private void divideBlocksVertically(PageBlock page) throws InvalidPopularSpaceValueException { List<ChunkBlock> chunkBlockList; String leftRightMidline; boolean leftFlush; boolean rightFlush; chunkBlockList = new ArrayList<ChunkBlock>(page.getAllChunkBlocks(null)); for (ChunkBlock chunky : chunkBlockList) { leftRightMidline = chunky.readLeftRightMidLine(); leftFlush = chunky.isFlush(ChunkBlock.LEFT, chunky.getMostPopularWordHeight() * 2); rightFlush = chunky.isFlush(ChunkBlock.RIGHT, chunky.getMostPopularWordHeight() * 2); int deltaH = chunky.getMostPopularWordHeight() - page.getDocument().readMostPopularWordHeight(); if (ChunkBlock.MIDLINE.equalsIgnoreCase(leftRightMidline) && (leftFlush || rightFlush) && deltaH < 3) { if (verticalSplitCandidate(chunky)) this.splitBlockDownTheMiddle(chunky); } } } private boolean verticalSplitCandidate(ChunkBlock block) throws InvalidPopularSpaceValueException { // 0:x,1:width ArrayList<Integer[]> spaceList = new ArrayList<Integer[]>(); int prevX = 0; int prevW = 0; int currX = 0; int currY = 0; int currW = 0; Integer[] currSpace = new Integer[] { -100, -100 }; Integer[] currWidest = new Integer[] { -100, -100 }; PageBlock parent = (PageBlock) block.getContainer(); List<SpatialEntity> wordBlockList = parent.containsByType(block, SpatialOrdering.MIXED_MODE, WordBlock.class); int pageWidth = parent.getMargin()[2] - parent.getMargin()[0]; int marginHeight = parent.getMargin()[3] - parent.getMargin()[1]; int averageWidth = 0; float spaceWidthToPageWidth = 0; for (int i = 0; i < wordBlockList.size(); i++) { WordBlock wb = (WordBlock) wordBlockList.get(i); // New line started if (i == 0 || Math.abs(((double) (wb.getY1() - currY) / (double) marginHeight)) > 0.01) { currY = wb.getY1(); currX = wb.getX1(); currW = wb.getWidth(); if (currWidest[1] > 0) { spaceList.add(new Integer[] { currWidest[0], currWidest[1] }); } currWidest[0] = -100; currWidest[1] = -100; continue; } // Continuing current line prevX = currX; prevW = currW; currY = wb.getY1(); currX = wb.getX1(); currW = wb.getWidth(); currSpace[1] = currX - (prevX + prevW); currSpace[0] = currX + currW; if (currWidest[1] == -100 || currSpace[1] > currWidest[1]) { currWidest[0] = currSpace[0]; currWidest[1] = currSpace[1]; } } // Criterium for whether the widest spaces are properly lined up: // At least 20% of them have an x position within that differ with less // than 1% to the x position of the previous space. // The average x position doesn't matter! if (spaceList.size() <= 0) return false; // Find average width of the widest spaces and make sure it's at least // as wide as 2.5% of the page width. for (int i = 0; i < spaceList.size(); i++) averageWidth += spaceList.get(i)[1]; averageWidth = averageWidth / spaceList.size(); // spaceWidthToPageWidth = (float) averageWidth / (float) pageWidth; /* * if (spaceWidthToPageWidth > 0.015) return true; else return false; */ if (averageWidth > parent.getMostPopularHorizontalSpaceBetweenWordsPage()) return true; else return false; } private void splitBlockDownTheMiddle(ChunkBlock block) { PageBlock parent = (PageBlock) block.getContainer(); int median = parent.getMedian(); ArrayList<WordBlock> leftBlocks = new ArrayList<WordBlock>(); ArrayList<WordBlock> rigthBlocks = new ArrayList<WordBlock>(); List<SpatialEntity> wordBlockList = parent.containsByType(block, SpatialOrdering.MIXED_MODE, WordBlock.class); String wordBlockLeftRightMidLine; for (int i = 0; i < wordBlockList.size(); i++) { WordBlock wordBlock = (WordBlock) wordBlockList.get(i); wordBlockLeftRightMidLine = wordBlock.readLeftRightMidLine(); if (wordBlockLeftRightMidLine.equals(Block.LEFT)) leftBlocks.add(wordBlock); else if (wordBlockLeftRightMidLine.equals(Block.RIGHT)) rigthBlocks.add(wordBlock); else if (wordBlockLeftRightMidLine.equals(Block.MIDLINE)) { // Assign the current word to the left or right side depending // upon // whether most of the word is on the left or right side of the // median. if (Math.abs(median - wordBlock.getX1()) > Math.abs(wordBlock .getX2() - median)) { wordBlock.resize(wordBlock.getX1(), wordBlock.getY1(), median - wordBlock.getX1(), wordBlock.getHeight()); } else { wordBlock.resize(median, wordBlock.getY1(), wordBlock.getX2() - median, wordBlock.getHeight()); rigthBlocks.add(wordBlock); } } }// END for if (leftBlocks.size() == 0 || rigthBlocks.size() == 0) return; ChunkBlock leftChunkBlock = buildChunkBlock(leftBlocks, parent); ChunkBlock rightChunkBlock = buildChunkBlock(rigthBlocks, parent); SpatialEntity entity = modelFactory.createWordBlock( leftChunkBlock.getX2() + 1, leftChunkBlock.getY1(), rightChunkBlock.getX1() - 1, rightChunkBlock.getY2(), 0, null, null, null, -1); if (parent.intersectsByType(entity, null, WordBlock.class).size() >= 1) { if (block == null) { logger.info("null null"); } for (SpatialEntity wordBlockEntity : wordBlockList) ((Block) wordBlockEntity).setContainer(block); return; } double relative_overlap = leftChunkBlock .getRelativeOverlap(rightChunkBlock); if (relative_overlap < 0.1) { parent.delete(block, block.getId()); parent.add(leftChunkBlock, idGenerator++); parent.add(rightChunkBlock, idGenerator++); } } private ChunkBlock buildChunkBlock(List<WordBlock> wordBlockList, PageBlock pageBlock) { ChunkBlock chunkBlock = null; IntegerFrequencyCounter lineHeightFrequencyCounter = new IntegerFrequencyCounter(1); IntegerFrequencyCounter spaceFrequencyCounter = new IntegerFrequencyCounter(0); FrequencyCounter fontFrequencyCounter = new FrequencyCounter(); FrequencyCounter styleFrequencyCounter = new FrequencyCounter(); for (WordBlock wordBlock : wordBlockList) { lineHeightFrequencyCounter.add(wordBlock.getHeight()); spaceFrequencyCounter.add(wordBlock.getSpaceWidth()); avgHeightFrequencyCounter.add(wordBlock.getHeight()); if( wordBlock.getFont() != null ) { fontFrequencyCounter.add(wordBlock.getFont()); } else { fontFrequencyCounter.add(""); } if( wordBlock.getFont() != null ) { styleFrequencyCounter.add(wordBlock.getFontStyle()); } else { styleFrequencyCounter.add(""); } if (chunkBlock == null) { chunkBlock = modelFactory .createChunkBlock(wordBlock.getX1(), wordBlock.getY1(), wordBlock.getX2(), wordBlock.getY2(), wordBlock.getOrder()); } else { SpatialEntity spatialEntity = chunkBlock.union(wordBlock); chunkBlock.resize(spatialEntity.getX1(), spatialEntity.getY1(), spatialEntity.getWidth(), spatialEntity.getHeight()); } wordBlock.setContainer(chunkBlock); } chunkBlock.setMostPopularWordFont( (String) fontFrequencyCounter.getMostPopular() ); chunkBlock.setMostPopularWordStyle( (String) styleFrequencyCounter.getMostPopular() ); chunkBlock.setMostPopularWordHeight( lineHeightFrequencyCounter.getMostPopular() ); chunkBlock.setMostPopularWordSpaceWidth( spaceFrequencyCounter.getMostPopular() ); chunkBlock.setContainer(pageBlock); return chunkBlock; } private void divideBlocksHorizontally(PageBlock page) { List<ChunkBlock> chunkBlockList; ArrayList<Integer> breaks; chunkBlockList = page.getAllChunkBlocks(SpatialOrdering.MIXED_MODE); for (ChunkBlock chunky : chunkBlockList) { breaks = this.getBreaks(chunky); if (breaks.size() > 0) this.splitBlockByBreaks(chunky, breaks); } } private ArrayList<Integer> getBreaks(ChunkBlock block) { ArrayList<Integer> breaks = new ArrayList<Integer>(); PageBlock parent = (PageBlock) block.getContainer(); int mostPopulareWordHeightOverCorpora = parent.getDocument() .readMostPopularWordHeight(); List<SpatialEntity> wordBlockList = parent.containsByType(block, SpatialOrdering.MIXED_MODE, WordBlock.class); WordBlock firstWordOnLine = (WordBlock) wordBlockList.get(0); WordBlock lastWordOnLine = firstWordOnLine; int lastY = firstWordOnLine.getY1() + firstWordOnLine.getHeight() / 2; int currentY = lastY; String chunkBlockString = ""; ArrayList<Integer> breakCandidates = new ArrayList<Integer>(); ArrayList<HorizontalSplitFeature> featureList = new ArrayList<HorizontalSplitFeature>(); HorizontalSplitFeature feature = new HorizontalSplitFeature(); for (SpatialEntity entity : wordBlockList) { lastY = currentY; WordBlock wordBlock = (WordBlock) entity; currentY = wordBlock.getY1() + wordBlock.getHeight() / 2; if (currentY > lastY + wordBlock.getHeight() / 2) { feature.calculateFeatures(block, firstWordOnLine, lastWordOnLine, chunkBlockString); featureList.add(feature); feature = new HorizontalSplitFeature(); breakCandidates .add((lastWordOnLine.getY2() + wordBlock.getY1()) / 2); firstWordOnLine = wordBlock; lastWordOnLine = wordBlock; chunkBlockString = ""; } feature.addToFrequencyCounters(wordBlock.getFont(), wordBlock.getFontStyle()); chunkBlockString = chunkBlockString + " " + wordBlock.getWord(); lastWordOnLine = wordBlock; } feature.calculateFeatures(block, firstWordOnLine, lastWordOnLine, chunkBlockString); featureList.add(feature); feature = null; HorizontalSplitFeature featureMinusOne; // // What kind of column is this? // // a. Titles and large-font blocks // b. centered titles // c. centered blocks // d. text & titles in left or right columns // e. references // f. figure legends // for (int i = 1; i < featureList.size(); i++) { featureMinusOne = featureList.get(i - 1); feature = featureList.get(i); if (featureMinusOne.isAllCapitals() && !feature.isAllCapitals()) { breaks.add(breakCandidates.get(i - 1)); } else if (!featureMinusOne.isAllCapitals() && feature.isAllCapitals()) { breaks.add(breakCandidates.get(i - 1)); } else if (featureMinusOne.getMostPopularFont() != null && feature.getMostPopularFont() == null) { breaks.add(breakCandidates.get(i - 1)); } else if (featureMinusOne.getMostPopularFont() == null && feature.getMostPopularFont() != null) { breaks.add(breakCandidates.get(i - 1)); } else if (!featureMinusOne.getMostPopularFont().equals( feature.getMostPopularFont()) && !feature.isMixedFont() && !featureMinusOne.isMixedFont()) { breaks.add(breakCandidates.get(i - 1)); } else if (Math.abs(feature.getFirstWordOnLineHeight() - featureMinusOne.getFirstWordOnLineHeight()) > 2) { breaks.add(breakCandidates.get(i - 1)); } else if (Math.abs(feature.getMidYOfLastWordOnLine() - featureMinusOne.getMidYOfLastWordOnLine()) > (feature .getFirstWordOnLineHeight() + featureMinusOne .getFirstWordOnLineHeight()) * 0.75) { breaks.add(breakCandidates.get(i - 1)); } else if (Math.abs(featureMinusOne.getFirstWordOnLineHeight() - mostPopulareWordHeightOverCorpora) <= 2 && Math.abs(feature.getFirstWordOnLineHeight() - mostPopulareWordHeightOverCorpora) <= 2 && Math.abs(featureMinusOne.getMidOffset()) < 10 && Math.abs(featureMinusOne.getExtremLeftOffset()) > 10 && Math.abs(featureMinusOne.getExtremeRightOffset()) > 10 && Math.abs(feature.getExtremLeftOffset()) < 20 && Math.abs(feature.getExtremeRightOffset()) < 10) { breaks.add(breakCandidates.get(i - 1)); } else if (Math.abs(feature.getFirstWordOnLineHeight() - mostPopulareWordHeightOverCorpora) <= 2 && Math.abs(feature.getMidOffset()) < 10 && Math.abs(feature.getExtremLeftOffset()) > 10 && Math.abs(feature.getExtremeRightOffset()) > 10 && Math.abs(featureMinusOne.getExtremLeftOffset()) < 10) { breaks.add(breakCandidates.get(i - 1)); } else if (featureMinusOne.isEndOFLine() && Math.abs(featureMinusOne.getFirstWordOnLineHeight() - mostPopulareWordHeightOverCorpora) <= 2 && (Math.abs(featureMinusOne.getExtremeRightOffset()) > 10 || Math .abs(feature.getExtremLeftOffset()) > 10)) { breaks.add(breakCandidates.get(i - 1)); } } return breaks; } private void splitBlockByBreaks(ChunkBlock block, ArrayList<Integer> breaks) { Collections.sort(breaks); PageBlock parent = (PageBlock) block.getContainer(); List<SpatialEntity> wordBlockList = parent.containsByType(block, SpatialOrdering.MIXED_MODE, WordBlock.class); int y; int breakIndex; List<List<WordBlock>> bigBlockList = new ArrayList<List<WordBlock>>(); for (int j = 0; j < breaks.size() + 1; j++) { List<WordBlock> littleBlockList = new ArrayList<WordBlock>(); bigBlockList.add(littleBlockList); } for (SpatialEntity entity : wordBlockList) { WordBlock wordBlock = (WordBlock) entity; y = wordBlock.getY1() + wordBlock.getHeight() / 2; breakIndex = Collections.binarySearch(breaks, y); if (breakIndex < 0) { breakIndex = -1 * breakIndex - 1; bigBlockList.get(breakIndex).add(wordBlock); } else { bigBlockList.get(breakIndex).add(wordBlock); } } ChunkBlock chunky; TreeSet<ChunkBlock> chunkBlockList = new TreeSet<ChunkBlock>( new SpatialOrdering(SpatialOrdering.MIXED_MODE)); for (List<WordBlock> list : bigBlockList) { if (list.size() == 0) continue; chunky = this.buildChunkBlock(list, parent); chunkBlockList.add(chunky); } parent.delete(block, block.getId()); idGenerator = parent.addAll( new ArrayList<SpatialEntity>(chunkBlockList), idGenerator); } private void joinLines(PageBlock page) { LinkedBlockingQueue<ChunkBlock> chunkBlockList = new LinkedBlockingQueue<ChunkBlock>( page.getAllChunkBlocks(SpatialOrdering.MIXED_MODE)); List wordBlockList; int midY; ChunkBlock chunky = null; List<SpatialEntity> neighbouringChunkBlockList; ChunkBlock neighbouringChunkBlock; ArrayList<SpatialEntity> removalList = new ArrayList<SpatialEntity>(); while (chunkBlockList.size() > 0) { chunky = chunkBlockList.peek(); wordBlockList = page.containsByType(chunky, null, WordBlock.class); if (wordBlockList.size() < 4 && chunky.readNumberOfLine() == 1) { neighbouringChunkBlockList = page.intersectsByType( calculateBoundariesForJoin(chunky, page), SpatialOrdering.MIXED_MODE, ChunkBlock.class); if (neighbouringChunkBlockList.size() <= 1) { chunkBlockList.poll(); continue; } for (SpatialEntity entity : neighbouringChunkBlockList) { neighbouringChunkBlock = (ChunkBlock) entity; if (neighbouringChunkBlock.equals(chunky)) continue; midY = chunky.getY1() + chunky.getHeight() / 2; if (neighbouringChunkBlock.getY1() < midY && neighbouringChunkBlock.getY2() > midY && ((neighbouringChunkBlock.getX2() < chunky .getX1() && neighbouringChunkBlock .readNumberOfLine() < 3) || (neighbouringChunkBlock .getX1() > chunky.getX2() && neighbouringChunkBlock .readNumberOfLine() == 1))) { removalList.add(neighbouringChunkBlock); wordBlockList.addAll(page.containsByType( neighbouringChunkBlock, null, WordBlock.class)); } } if (removalList.size() > 0) { ChunkBlock newChunkBlock = this.buildChunkBlock( wordBlockList, page); page.add(newChunkBlock, idGenerator++); page.delete(chunky, chunky.getId()); chunkBlockList.removeAll(removalList); for (SpatialEntity forDeleteEntity : removalList) { page.delete(forDeleteEntity, forDeleteEntity.getId()); } } } removalList.clear(); chunkBlockList.poll(); } } private SpatialEntity calculateBoundariesForJoin(ChunkBlock chunk, PageBlock parent) { SpatialEntity entity = null; int x1 = 0, x2 = 0, y1 = 0, y2 = 0; int width = parent.getMargin()[2] - parent.getMargin()[0]; int height = parent.getMargin()[3] - parent.getMargin()[1]; String lrm = chunk.readLeftRightMidLine(); width = (int) (width * 0.25); y1 = chunk.getY1(); y2 = chunk.getY2(); if (Block.LEFT.equalsIgnoreCase(lrm)) { // TODO:Use reflection x1 = (chunk.getX1() - width <= 0) ? parent.getMargin()[0] : chunk .getX1() - width; x2 = (chunk.getX2() + width >= parent.getMedian()) ? parent .getMedian() : chunk.getX2() + width; entity = modelFactory.createChunkBlock(x1, y1, x2, y2, 0); } else if (Block.RIGHT.equalsIgnoreCase(lrm)) { x1 = (chunk.getX1() - width <= parent.getMedian()) ? parent .getMedian() : chunk.getX1() - width; x2 = (chunk.getX2() + width >= parent.getMargin()[2]) ? parent .getMargin()[2] : chunk.getX2() + width; entity = modelFactory.createChunkBlock(x1, y1, x2, y2, 0 ); } else { x1 = (chunk.getX1() - width <= 0) ? parent.getMargin()[0] : chunk .getX1() - width; x2 = (chunk.getX2() + width >= parent.getMargin()[2]) ? parent .getMargin()[2] : chunk.getX2() + width; entity = modelFactory.createChunkBlock(x1, y1, x2, y2, 0); } return entity; } private void mergeHighlyOverlappedChunkBlocks(PageBlock page) { List<ChunkBlock> chunkBlockList = page.getAllChunkBlocks( SpatialOrdering.MIXED_MODE); List<SpatialEntity> wordList; SpatialEntity intersectingRectangle; for (SpatialEntity entity : chunkBlockList) { ChunkBlock sourceChunk = (ChunkBlock) entity; List<SpatialEntity> neighbouringChunkBlockList = page.intersectsByType(sourceChunk, SpatialOrdering.MIXED_MODE, ChunkBlock.class); for (SpatialEntity neighbourEntity : neighbouringChunkBlockList) { ChunkBlock neighbourChunk = (ChunkBlock) neighbourEntity; if( neighbourChunk == sourceChunk ) continue; intersectingRectangle = sourceChunk .getIntersectingRectangle(neighbourChunk); double intersectionArea = intersectingRectangle.getHeight() * intersectingRectangle.getWidth(); double sourceArea = (double) (sourceChunk.getWidth() * sourceChunk.getHeight()); double neighborArea = (double) (neighbourChunk.getWidth() * neighbourChunk .getHeight()); double propOfNeighbor = intersectionArea / neighborArea; if (propOfNeighbor > 0.7) { wordList = page.containsByType(neighbourChunk, null, WordBlock.class); for (SpatialEntity wordEntity : wordList) ((Block) wordEntity).setContainer(sourceChunk); page.delete(neighbourChunk, neighbourChunk.getId()); } int pause = 0; } } } }
phatn/lapdftext
src/main/java/edu/isi/bmkeg/lapdf/parser/RuleBasedParser.java
Java
gpl-3.0
35,574
""" """ from __future__ import unicode_literals from django.conf import settings def fikoStatik(request): """ Fiko Statik Adresini(url) Döndürür... Örnek: <script src="{{ FIKO_STATIK_URL }}/pkt/angular/angular.js"></script> Bu İçerik İşleyicinin Aktif Olabilmewsi İçin Aşağıdaki Kodları Settings Dosyanıza Uyarlamanız Gerekmektedir. ```urls.py urlpatterns = [ ... url(r'^fikoStatik/', include(fikoStatik.urls)), ... ] ``` ``` settings.py TEMPLATES = [ { ... 'OPTIONS': { 'context_processors': [ ... 'fikoStatik.icerikIsleyici.fikoStatik.fikoStatik' ... ], }, }, ] ``` """ return dict( FIKO_STATIK_URL=settings.FIKO_STATIK_URL if hasattr(settings, "FIKO_STATIK_URL") else "fikoStatik" )
fikri007/django-fikoStatik
fikoStatik/icerikIsleyici/fikoStatik.py
Python
gpl-3.0
1,063
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file from __future__ import absolute_import import argparse import glob import logging import os import re from ..settings.const import settings from ..helper import split_commandstring, string_decode class Command(object): """base class for commands""" repeatable = False def __init__(self): self.prehook = None self.posthook = None self.undoable = False self.help = self.__doc__ def apply(self, caller): """code that gets executed when this command is applied""" pass class CommandCanceled(Exception): """ Exception triggered when an interactive command has been cancelled """ pass COMMANDS = { 'search': {}, 'envelope': {}, 'bufferlist': {}, 'taglist': {}, 'thread': {}, 'global': {}, } def lookup_command(cmdname, mode): """ returns commandclass, argparser and forced parameters used to construct a command for `cmdname` when called in `mode`. :param cmdname: name of the command to look up :type cmdname: str :param mode: mode identifier :type mode: str :rtype: (:class:`Command`, :class:`~argparse.ArgumentParser`, dict(str->dict)) """ if cmdname in COMMANDS[mode]: return COMMANDS[mode][cmdname] elif cmdname in COMMANDS['global']: return COMMANDS['global'][cmdname] else: return None, None, None def lookup_parser(cmdname, mode): """ returns the :class:`CommandArgumentParser` used to construct a command for `cmdname` when called in `mode`. """ return lookup_command(cmdname, mode)[1] class CommandParseError(Exception): """could not parse commandline string""" pass class CommandArgumentParser(argparse.ArgumentParser): """ :class:`~argparse.ArgumentParser` that raises :class:`CommandParseError` instead of printing to `sys.stderr`""" def exit(self, message): raise CommandParseError(message) def error(self, message): raise CommandParseError(message) class registerCommand(object): """ Decorator used to register a :class:`Command` as handler for command `name` in `mode` so that it can be looked up later using :func:`lookup_command`. Consider this example that shows how a :class:`Command` class definition is decorated to register it as handler for 'save' in mode 'thread' and add boolean and string arguments:: .. code-block:: @registerCommand('thread', 'save', arguments=[ (['--all'], {'action': 'store_true', 'help':'save all'}), (['path'], {'nargs':'?', 'help':'path to save to'})], help='save attachment(s)') class SaveAttachmentCommand(Command): pass """ def __init__(self, mode, name, help=None, usage=None, forced=None, arguments=None): """ :param mode: mode identifier :type mode: str :param name: command name to register as :type name: str :param help: help string summarizing what this command does :type help: str :param usage: overides the auto generated usage string :type usage: str :param forced: keyword parameter used for commands constructor :type forced: dict (str->str) :param arguments: list of arguments given as pairs (args, kwargs) accepted by :meth:`argparse.ArgumentParser.add_argument`. :type arguments: list of (list of str, dict (str->str) """ self.mode = mode self.name = name self.help = help self.usage = usage self.forced = forced or {} self.arguments = arguments or [] def __call__(self, klass): helpstring = self.help or klass.__doc__ argparser = CommandArgumentParser(description=helpstring, usage=self.usage, prog=self.name, add_help=False) for args, kwargs in self.arguments: argparser.add_argument(*args, **kwargs) COMMANDS[self.mode][self.name] = (klass, argparser, self.forced) return klass def commandfactory(cmdline, mode='global'): """ parses `cmdline` and constructs a :class:`Command`. :param cmdline: command line to interpret :type cmdline: str :param mode: mode identifier :type mode: str """ # split commandname and parameters if not cmdline: return None logging.debug('mode:%s got commandline "%s"', mode, cmdline) # allow to shellescape without a space after '!' if cmdline.startswith('!'): cmdline = 'shellescape \'%s\'' % cmdline[1:] cmdline = re.sub(r'"(.*)"', r'"\\"\1\\""', cmdline) try: args = split_commandstring(cmdline) except ValueError as e: raise CommandParseError(str(e)) args = [string_decode(x, 'utf-8') for x in args] logging.debug('ARGS: %s', args) cmdname = args[0] args = args[1:] # unfold aliases # TODO: read from settingsmanager # get class, argparser and forced parameter (cmdclass, parser, forcedparms) = lookup_command(cmdname, mode) if cmdclass is None: msg = 'unknown command: %s' % cmdname logging.debug(msg) raise CommandParseError(msg) parms = vars(parser.parse_args(args)) parms.update(forcedparms) logging.debug('cmd parms %s', parms) # create Command cmd = cmdclass(**parms) # set pre and post command hooks get_hook = settings.get_hook cmd.prehook = get_hook('pre_%s_%s' % (mode, cmdname)) or \ get_hook('pre_global_%s' % cmdname) cmd.posthook = get_hook('post_%s_%s' % (mode, cmdname)) or \ get_hook('post_global_%s' % cmdname) return cmd pyfiles = glob.glob1(os.path.dirname(__file__), '*.py') __all__ = list(filename[:-3] for filename in pyfiles)
geier/alot
alot/commands/__init__.py
Python
gpl-3.0
6,105
# $Id$ import sys import random import math import numpy from itcc.core import ctools __revision__ = '$Rev$' __all__ = ['length', 'angle', 'torsionangle', 'imptor', 'combinecombine', 'xyzatm', 'minidx', 'maxidx', 'weightedmean', 'weightedsd', 'datafreq', 'random_vector', 'all', 'any', 'dissq', 'lensq', 'distance', 'normal'] def normal(a): return a / length(a) def datafreq(data, min_, max_, num): result = [0] * num step = float(max_ - min_)/num for x in data: type_ = int((x - min_)/step) if 0 <= type_ < num: result[type_] += 1 return result def distance(a, b): return length(a-b) def dissq(a, b): return lensq(a-b) def length(a): return math.sqrt(sum(a*a)) def lensq(a): return sum(a*a) def angle(a, b, c): return ctools.angle(tuple(a), tuple(b), tuple(c)) def torsionangle(a, b, c, d): """torsionangle(a, b, c, d) -> angle a, b, c, d are 4 numpy.array return the torsionangle of a-b-c-d in radian, range is (-pi, pi]. if torsionangle is invalid, for example, a == b or b == c or c == d or a == c or b == d, then return float("nan"). """ return ctools.torsionangle(tuple(a), tuple(b), tuple(c), tuple(d)) def imptor(a, b, c, d): '''imptor(a, b, c, d) -> angle a, b, c, d are 4 Scientific.Geometry.Vector return the imptor of a-b-c-d imptor(abcd) is the angle between vector ad and plane abc, crossmulti(ab, ac) is the positive direction. ''' ad = d - a ab = b - a ac = c - a abc = numpy.cross(ab, ac) angle_ = ad.angle(abc) return math.pi - angle_ def combinecombine(cmbs): if not cmbs: yield [] return for x in cmbs[0]: for cc in combinecombine(cmbs[1:]): yield [x] + cc def xyzatm(p1, p2, p3, r, theta, phi): ''' >>> from Scientific.Geometry import Vector >>> import math >>> xyzatm(Vector(0,0,1), Vector(0,0,0), Vector(1,0,0), ... 1, math.radians(90), 0) Vector(1.0,0.0,0.99999999999999989) ''' r12 = normal(p1 - p2) r23 = normal(p2 - p3) rt = numpy.cross(r23, r12) cosine = r12 * r23 sine = math.sqrt(max(1.0 - cosine*cosine, 0.0)) rt /= sine ru = numpy.cross(rt, r12) ts = math.sin(theta) tc = math.cos(theta) ps = math.sin(phi) pc = math.cos(phi) return p1 + (ru * (ts * pc) + rt * (ts * ps) - r12 * tc) * r def minidx(iterable): iterable = iter(iterable) idx = 0 item = iterable.next() for i, x in enumerate(iterable): if x < item: idx = i+1 item = x return idx, item def maxidx(iterable): iterable = iter(iterable) idx = 0 item = iterable.next() for i, x in enumerate(iterable): if x > item: idx = i+1 item = x return idx, item def swapaxes(matrix): rank1 = len(matrix) if rank1 == 0: return [] rank2 = len(matrix[0]) for row in matrix: assert len(row) == rank2 result = [[None] * rank1 for i in range(rank2)] for i in range(rank2): for j in range(rank1): result[i][j] = matrix[j][i] return result def weightedmean(datas, weights): assert len(datas) == len(weights) sum_ = sum([data * weight for data, weight in zip(datas, weights)]) totalweight = sum(weights) return sum_/totalweight def weightedsd(datas, weights): assert len(datas) == len(weights) assert len(datas) > 1 mean_ = weightedmean(datas, weights) sum_ = sum([(data - mean_)**2 * weight \ for data, weight in zip(datas, weights)]) totalweight = sum(weights) return math.sqrt(sum_/totalweight) def any(iterable): for element in iterable: if element: return True return False def all(iterable): for element in iterable: if not element: return False return True def random_vector(length_=1.0): z = random.uniform(-length_, length_) s = math.sqrt(length_*length_ - z*z) theta = random.uniform(0.0, math.pi*2) x = s * math.cos(theta) y = s * math.sin(theta) return (x, y, z) def open_file_or_stdin(ifname): if ifname == '-': return sys.stdin else: return file(ifname) def sorted_(iterable): '''python 2.3 does not support sorted''' res = list(iterable) res.sort() return res def _test(): import doctest doctest.testmod() if __name__ == '__main__': _test()
lidaobing/itcc
itcc/core/tools.py
Python
gpl-3.0
4,560
package com.livingobjects.neo4j.model.export; import com.livingobjects.neo4j.model.iwan.GraphModelConstants; import java.util.Comparator; public final class PropertyNameComparator implements Comparator<String> { public static final PropertyNameComparator PROPERTY_NAME_COMPARATOR = new PropertyNameComparator(); private PropertyNameComparator() { } @Override public int compare(String o1, String o2) { int result = propertyPrecedence(o1) - propertyPrecedence(o2); if (result == 0) { return o1.toLowerCase().compareTo(o2.toLowerCase()); } else { return result; } } public int propertyPrecedence(String prop) { switch (prop) { case GraphModelConstants.TAG: return 0; case GraphModelConstants.ID: return 1; case GraphModelConstants.NAME: return 2; default: return 3; } } }
livingobjects/neo4j-lo-extensions
src/main/java/com/livingobjects/neo4j/model/export/PropertyNameComparator.java
Java
gpl-3.0
994
/* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments Copyright (C) ITsysCOM GmbH This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/> */ package engine import ( "context" "fmt" "net" "sync" "time" "github.com/cgrates/cgrates/utils" amqpv1 "pack.ag/amqp" ) // NewAMQPv1Poster creates a poster for amqpv1 func NewAMQPv1Poster(dialURL string, attempts int) (Poster, error) { URL, qID, err := parseURL(dialURL) if err != nil { return nil, err } return &AMQPv1Poster{ dialURL: URL, queueID: "/" + qID, attempts: attempts, }, nil } // AMQPv1Poster a poster for amqpv1 type AMQPv1Poster struct { sync.Mutex dialURL string queueID string // identifier of the CDR queue where we publish attempts int client *amqpv1.Client } // Close closes the connections func (pstr *AMQPv1Poster) Close() { pstr.Lock() if pstr.client != nil { pstr.client.Close() } pstr.client = nil pstr.Unlock() } // Post is the method being called when we need to post anything in the queue func (pstr *AMQPv1Poster) Post(content []byte, _ string) (err error) { var s *amqpv1.Session fib := utils.Fib() for i := 0; i < pstr.attempts; i++ { if s, err = pstr.newPosterSession(); err == nil { break } // reset client and try again // used in case of closed connection because of idle time if pstr.client != nil { pstr.client.Close() // Make shure the connection is closed before reseting it } pstr.client = nil if i+1 < pstr.attempts { time.Sleep(time.Duration(fib()) * time.Second) } } if err != nil { utils.Logger.Warning(fmt.Sprintf("<AMQPv1Poster> creating new post channel, err: %s", err.Error())) return err } ctx := context.Background() for i := 0; i < pstr.attempts; i++ { sender, err := s.NewSender( amqpv1.LinkTargetAddress(pstr.queueID), ) if err != nil { if i+1 < pstr.attempts { time.Sleep(time.Duration(fib()) * time.Second) } // if pstr.isRecoverableError(err) { // s.Close(ctx) // pstr.client.Close() // pstr.client = nil // stmp, err := pstr.newPosterSession() // if err == nil { // s = stmp // } // } continue } // Send message err = sender.Send(ctx, amqpv1.NewMessage(content)) sender.Close(ctx) if err == nil { break } if i+1 < pstr.attempts { time.Sleep(time.Duration(fib()) * time.Second) } // if pstr.isRecoverableError(err) { // s.Close(ctx) // pstr.client.Close() // pstr.client = nil // stmp, err := pstr.newPosterSession() // if err == nil { // s = stmp // } // } } if err != nil { return } if s != nil { s.Close(ctx) } return } func (pstr *AMQPv1Poster) newPosterSession() (s *amqpv1.Session, err error) { pstr.Lock() defer pstr.Unlock() if pstr.client == nil { var client *amqpv1.Client client, err = amqpv1.Dial(pstr.dialURL) if err != nil { return nil, err } pstr.client = client } return pstr.client.NewSession() } func isRecoverableCloseError(err error) bool { return err == amqpv1.ErrConnClosed || err == amqpv1.ErrLinkClosed || err == amqpv1.ErrSessionClosed } func (pstr *AMQPv1Poster) isRecoverableError(err error) bool { switch err.(type) { case *amqpv1.Error, *amqpv1.DetachError, net.Error: if netErr, ok := err.(net.Error); ok { if !netErr.Temporary() { return false } } default: if !isRecoverableCloseError(err) { return false } } return true }
rinor/cgrates
engine/pstr_amqpv1.go
GO
gpl-3.0
3,986
/*===========================================================================*\ * * * OpenFlipper * * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen * * www.openflipper.org * * * *--------------------------------------------------------------------------- * * This file is part of OpenFlipper. * * * * OpenFlipper is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any later version with the * * following exceptions: * * * * If other files instantiate templates or use macros * * or inline functions from this file, or you compile this file and * * link it with other files to produce an executable, this file does * * not by itself cause the resulting executable to be covered by the * * GNU Lesser General Public License. This exception does not however * * invalidate any other reasons why the executable file might be * * covered by the GNU Lesser General Public License. * * * * OpenFlipper 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 Lesser General Public License for more details. * * * * You should have received a copy of the GNU LesserGeneral Public * * License along with OpenFlipper. If not, * * see <http://www.gnu.org/licenses/>. * * * \*===========================================================================*/ /*===========================================================================*\ * * * $Revision: 15021 $ * * $LastChangedBy: moebius $ * * $Date: 2012-07-16 17:18:19 +0800 (Mon, 16 Jul 2012) $ * * * \*===========================================================================*/ #ifndef POSET_HH #define POSET_HH #include "ACG/Math/Matrix4x4T.hh" #include "ACG/Math/VectorT.hh" #include "ACG/Math/QuaternionT.hh" #include "ACG/Math/DualQuaternionT.hh" template<typename PointT> class SkeletonT; /** * @brief A general pose, used to store the frames of the animation * */ template<typename PointT> class PoseT { template<typename> friend class SkeletonT; template<typename> friend class AnimationT; template<typename> friend class FrameAnimationT; protected: typedef PointT Point; typedef typename Point::value_type Scalar; typedef typename ACG::VectorT<Scalar, 3> Vector; typedef typename ACG::Matrix4x4T<Scalar> Matrix; typedef typename ACG::QuaternionT<Scalar> Quaternion; typedef typename ACG::DualQuaternionT<Scalar> DualQuaternion; public: /// Constructor PoseT(SkeletonT<Point>* _skeleton); /// Copy Constructor PoseT(const PoseT<PointT>& _other); /// Destructor virtual ~PoseT(); // ======================================================================================= /** @anchor PoseEditing * @name Pose editing * These methods update the other coordinate systems, changing the local coordinates will also change the global and vice versa. * @{ */ // ======================================================================================= /// local matrix manipulation /// the local matrix represents a joints orientation/translation in the coordinate frame of the parent joint inline const Matrix& localMatrix(unsigned int _joint) const; void setLocalMatrix(unsigned int _joint, const Matrix &_local, bool _keepLocalChildPositions=true); inline Vector localTranslation(unsigned int _joint); void setLocalTranslation(unsigned int _joint, const Vector &_position, bool _keepLocalChildPositions=true); inline Matrix localMatrixInv(unsigned int _joint) const; /// global matrix manipulation /// the global matrix represents a joints orientation/translation in global coordinates inline const Matrix& globalMatrix(unsigned int _joint) const; void setGlobalMatrix(unsigned int _joint, const Matrix &_global, bool _keepGlobalChildPositions=true); inline Vector globalTranslation(unsigned int _joint); void setGlobalTranslation(unsigned int _joint, const Vector &_position, bool _keepGlobalChildPositions=true); virtual Matrix globalMatrixInv(unsigned int _joint) const; /** @} */ // ======================================================================================= /** * @name Synchronization * Use these methods to keep the pose in sync with the number (and indices) of the joints. * @{ */ // ======================================================================================= /** * \brief Called by the skeleton/animation as a new joint is inserted * * To keep the vectors storing the matrices for the joints in sync with the joints a new entry has to be inserted * in exactly the same place if a new joint is added to the skeleton. This is done here. Derived classes * have to overwrite this method to keep their data members in sync as well. Always call the base class * method first. * * @param _index The new joint is inserted at this position. Insert new joints at the end by passing * SkeletonT<>::jointCount() as parameter. */ virtual void insertJointAt(unsigned int _index); /** * \brief Called by the skeleton/animation as a joint is removed * * To keep the vectors storing the matrices for the joints in sync with the joints exactly the same entry * has to be removed as a joint is removed from the skeleton. This is done here. Derived classes * have to overwrite this method to keep their data members in sync as well. Always call the base class * method first. * * @param _index The new joint is inserted at this position. Insert new joints at the end by passing * SkeletonT<>::jointCount() as parameter. */ virtual void removeJointAt(unsigned int _index); /** @} */ protected: // ======================================================================================= /** @name Coordinate system update methods * These methods propagate the change in one of the coordinate systems into the other. This will * keep intact the children nodes' positions per default (by recursively updating all children.). * This behavior can be influenced via the _keepChildPositions parameter. * @{ */ // ======================================================================================= void updateFromLocal(unsigned int _joint, bool _keepChildPositions=true); void updateFromGlobal(unsigned int _joint, bool _keepChildPositions=true); /** @} */ public: // ======================================================================================= /** @anchor UnifiedMatrices * @name Unified Matrices * Use these methods to gain access to the precalculations performed by this derivation. * @{ */ // ======================================================================================= inline const Matrix& unifiedMatrix(unsigned int _joint); inline const Quaternion& unifiedRotation(unsigned int _joint); inline const DualQuaternion& unifiedDualQuaternion(unsigned int _joint); /** @} */ protected: /// a pointer to the skeleton SkeletonT<PointT>* skeleton_; /// the pose in local coordinates std::vector<Matrix> local_; /// the pose in global coordinates std::vector<Matrix> global_; /// the global pose matrix left-multiplied to the inverse global reference matrix: \f$ M_{pose} \cdot M^{-1}_{reference} \f$ std::vector<Matrix> unified_; /// JointT::PoseT::unified in DualQuaternion representation /// note: the real part of the dual quaternion is the rotation part of the transformation as quaternion std::vector<DualQuaternion> unifiedDualQuaternion_; }; //============================================================================= //============================================================================= #if defined(INCLUDE_TEMPLATES) && !defined(POSET_C) #define POSET_TEMPLATES #include "PoseT.cc" #endif //============================================================================= #endif //=============================================================================
softwarekid/OpenFlipper
ObjectTypes/Skeleton/PoseT.hh
C++
gpl-3.0
9,581
<?php /* "Copyright 2012 A3 Revolution Web Design" This software is distributed under the terms of GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 */ // File Security Check if ( ! defined( 'ABSPATH' ) ) exit; ?> <?php /*----------------------------------------------------------------------------------- WPEC Quick View Custom Template Gallery Tab TABLE OF CONTENTS - var parent_page - var position - var tab_data - __construct() - tab_init() - tab_data() - add_tab() - settings_include() - tab_manager() -----------------------------------------------------------------------------------*/ class WPEC_QV_Custom_Template_Gallery_Tab extends WPEC_QV_Admin_UI { /** * @var string */ private $parent_page = 'wpec-quick-view-custom-template'; /** * @var string * You can change the order show of this tab in list tabs */ private $position = 2; /** * @var array */ private $tab_data; /*-----------------------------------------------------------------------------------*/ /* __construct() */ /* Settings Constructor */ /*-----------------------------------------------------------------------------------*/ public function __construct() { $this->settings_include(); $this->tab_init(); } /*-----------------------------------------------------------------------------------*/ /* tab_init() */ /* Tab Init */ /*-----------------------------------------------------------------------------------*/ public function tab_init() { add_filter( $this->plugin_name . '-' . $this->parent_page . '_settings_tabs_array', array( $this, 'add_tab' ), $this->position ); } /** * tab_data() * Get Tab Data * ============================================= * array ( * 'name' => 'my_tab_name' : (required) Enter your tab name that you want to set for this tab * 'label' => 'My Tab Name' : (required) Enter the tab label * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this tab * ) * */ public function tab_data() { $tab_data = array( 'name' => 'gallery-settings', 'label' => __( 'Gallery Settings', 'wpecquickview' ), 'callback_function' => 'wpec_qv_custom_template_gallery_tab_manager', ); if ( $this->tab_data ) return $this->tab_data; return $this->tab_data = $tab_data; } /*-----------------------------------------------------------------------------------*/ /* add_tab() */ /* Add tab to Admin Init and Parent Page /*-----------------------------------------------------------------------------------*/ public function add_tab( $tabs_array ) { if ( ! is_array( $tabs_array ) ) $tabs_array = array(); $tabs_array[] = $this->tab_data(); return $tabs_array; } /*-----------------------------------------------------------------------------------*/ /* panels_include() */ /* Include form settings panels /*-----------------------------------------------------------------------------------*/ public function settings_include() { // Includes Settings file include_once( $this->admin_plugin_dir() . '/settings/custom-template/gallery-style-settings.php' ); include_once( $this->admin_plugin_dir() . '/settings/custom-template/thumbnails-settings.php' ); } /*-----------------------------------------------------------------------------------*/ /* tab_manager() */ /* Call tab layout from Admin Init /*-----------------------------------------------------------------------------------*/ public function tab_manager() { global $wpec_qv_admin_init; $wpec_qv_admin_init->admin_settings_tab( $this->parent_page, $this->tab_data() ); } } global $wpec_qv_custom_template_gallery_tab; $wpec_qv_custom_template_gallery_tab = new WPEC_QV_Custom_Template_Gallery_Tab(); /** * wpec_qv_custom_template_gallery_tab_manager() * Define the callback function to show tab content */ function wpec_qv_custom_template_gallery_tab_manager() { global $wpec_qv_custom_template_gallery_tab; $wpec_qv_custom_template_gallery_tab->tab_manager(); } ?>
wp-plugins/wp-e-commerce-products-quick-view
admin/tabs/custom-template/gallery-tab.php
PHP
gpl-3.0
4,074
# -*- coding: utf-8 -*- """ Copyright 2008 Serge Matveenko This file is part of PyStarDict. PyStarDict 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 3 of the License, or (at your option) any later version. PyStarDict 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 PyStarDict. If not, see <http://www.gnu.org/licenses/>. @author: Serge Matveenko <s@matveenko.ru> """ import datetime import os import sys """hack in local sources if requested and handle import crash""" if '--local' in sys.argv: sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src')) try: from pystardict import Dictionary except ImportError, e: if __name__ == '__main__': print Exception('No pystardict in PYTHONPATH. Try --local parameter.') exit(1) else: raise e def demo(): milestone1 = datetime.datetime.today() dicts_dir = os.path.join(os.path.dirname(__file__)) dict1 = Dictionary(os.path.join(dicts_dir, 'stardict-quick_eng-rus-2.4.2', 'quick_english-russian')) dict2 = Dictionary(os.path.join(dicts_dir, 'stardict-quick_rus-eng-2.4.2', 'quick_russian-english')) milestone2 = datetime.datetime.today() print '2 dicts load:', milestone2-milestone1 print dict1.idx['test'] print dict2.idx['проверка'] milestone3 = datetime.datetime.today() print '2 cords getters:', milestone3-milestone2 print dict1.dict['test'] print dict2.dict['проверка'] milestone4 = datetime.datetime.today() print '2 direct data getters (w\'out cache):', milestone4-milestone3 print dict1['test'] print dict2['проверка'] milestone5 = datetime.datetime.today() print '2 high level data getters (not cached):', milestone5-milestone4 print dict1['test'] print dict2['проверка'] milestone6 = datetime.datetime.today() print '2 high level data getters (cached):', milestone6-milestone5 # list dictionary keys and dictionary content according to the key for key in dict1.ids.keys(): print dict1.dict[key] if __name__ == '__main__': demo()
lig/pystardict
examples/demo.py
Python
gpl-3.0
2,522
package tmp.generated_javacc; import cide.gast.*; import cide.gparser.*; import cide.greferences.*; import java.util.*; public class AnnotationTypeMemberDeclaration1 extends AnnotationTypeMemberDeclaration { public AnnotationTypeMemberDeclaration1(Modifiers modifiers, Type type, JavaIdentifier javaIdentifier, DefaultValue defaultValue, Token firstToken, Token lastToken) { super(new Property[] { new PropertyOne<Modifiers>("modifiers", modifiers), new PropertyOne<Type>("type", type), new PropertyOne<JavaIdentifier>("javaIdentifier", javaIdentifier), new PropertyZeroOrOne<DefaultValue>("defaultValue", defaultValue) }, firstToken, lastToken); } public AnnotationTypeMemberDeclaration1(Property[] properties, IToken firstToken, IToken lastToken) { super(properties,firstToken,lastToken); } public IASTNode deepCopy() { return new AnnotationTypeMemberDeclaration1(cloneProperties(),firstToken,lastToken); } public Modifiers getModifiers() { return ((PropertyOne<Modifiers>)getProperty("modifiers")).getValue(); } public Type getType() { return ((PropertyOne<Type>)getProperty("type")).getValue(); } public JavaIdentifier getJavaIdentifier() { return ((PropertyOne<JavaIdentifier>)getProperty("javaIdentifier")).getValue(); } public DefaultValue getDefaultValue() { return ((PropertyZeroOrOne<DefaultValue>)getProperty("defaultValue")).getValue(); } }
ckaestne/CIDE
CIDE_Language_JavaCC/src/tmp/generated_javacc/AnnotationTypeMemberDeclaration1.java
Java
gpl-3.0
1,471
/* Simulation for zebrafish segmentation Copyright (C) 2013 Ahmet Ay, Jack Holland, Adriana Sperlea, Sebastian Sangervasi 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* io.cpp contains functions for input and output of files and pipes. All I/O related functions should be placed in this file. */ #include <cerrno> // Needed for errno, EEXIST #include <cstdio> // Needed for fopen, fclose, fseek, ftell, rewind #include <sys/stat.h> // Needed for mkdir #include <unistd.h> // Needed for read, write, close #include "io.hpp" // Function declarations #include "sim.hpp" // Needed for anterior_time #include "main.hpp" using namespace std; extern terminal* term; // Declared in init.cpp /* not_EOL returns whether or not a given character is the end of a line or file (i.e. '\n' or '\0', respectively) parameters: c: the character to check returns: true if c is the end of a line or file, false otherwise notes: When reading input file strings, use this instead of a straight newline check to avoid EOF (end of file) issues. todo: */ bool not_EOL (char c) { return c != '\n' && c != '\0'; } /* store_filename stores the given value in the given field parameters: field: a pointer to the filename's field value: the filename to store returns: nothing notes: The previous field value is freed before assigning the new one. todo: */ void store_filename (char** field, const char* value) { mfree(*field); *field = copy_str(value); } /* create_dir creates a directory with the given path and name parameters: dir: the path and name of the directory to create returns: nothing notes: If the directory already exists, the error about it is suppressed. todo: */ void create_dir (char* dir) { cout << term->blue << "Creating " << term->reset << dir << " directory if necessary . . . "; // Create a directory, allowing the owner and group to read and write but others to only read if (mkdir(dir, 0775) != 0 && errno != EEXIST) { // If the error is that the directory already exists, ignore it cout << term->red << "Couldn't create '" << dir << "' directory!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } term->done(); } /* open_file opens the file with the given name and stores it in the given output file stream parameters: file_pointer: a pointer to the output file stream to open the file with file_name: the path and name of the file to open append: if true, the file will appended to, otherwise any existing data will be overwritten returns: nothing notes: todo: */ void open_file (ofstream* file_pointer, char* file_name, bool append) { try { if (append) { cout << term->blue << "Opening " << term->reset << file_name << " . . . "; file_pointer->open(file_name, fstream::app); } else { cout << term->blue << "Creating " << term->reset << file_name << " . . . "; file_pointer->open(file_name, fstream::out); } } catch (ofstream::failure) { cout << term->red << "Couldn't write to " << file_name << "!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } term->done(); } /* read_file takes an input_data struct and stores the contents of the associated file in a string parameters: ifd: the input_data struct to contain the file name, buffer to store the contents, size of the file, and current index returns: nothing notes: The buffer in ifd will be sized large enough to fit the file todo: */ void read_file (input_data* ifd) { cout << term->blue << "Reading file " << term->reset << ifd->filename << " . . . "; // Open the file for reading FILE* file = fopen(ifd->filename, "r"); if (file == NULL) { cout << term->red << "Couldn't open " << ifd->filename << "!" << term->reset << endl; exit(EXIT_FILE_READ_ERROR); } // Seek to the end of the file, grab its size, and then rewind fseek(file, 0, SEEK_END); long size = ftell(file); ifd->size = size; rewind(file); // Allocate enough memory to contain the whole file ifd->buffer = (char*)mallocate(sizeof(char) * size + 1); // Copy the file's contents into the buffer long result = fread(ifd->buffer, 1, size, file); if (result != size) { cout << term->red << "Couldn't read from " << ifd->filename << term->reset << endl; exit(EXIT_FILE_READ_ERROR); } ifd->buffer[size] = '\0'; // Close the file if (fclose(file) != 0) { cout << term->red << "Couldn't close " << ifd->filename << term->reset << endl; exit(EXIT_FILE_READ_ERROR); } term->done(); } /* parse_param_line reads a line in the given parameter sets buffer and stores it in the given array of doubles parameters: params: the array of doubles to store the parameters in buffer_line: the buffer with the line to read index_buffer: the index of the buffer to start from returns: true if a line was found, false if the end of the file was reached without finding a valid line notes: The buffer should contain one parameter set per line, each set containing comma-separated floating point parameters. Blank lines and lines starting with # will be ignored. Each line must contain the correct number of parameters or the program will exit. index_buffer is a reference, allowing this function to store where it finished parsing. todo: */ bool parse_param_line (double* params, char* buffer_line, int& index_buffer) { static const char* usage_message = "There was an error reading the given parameter sets file."; int index_params = 0; // Current index in params int index_digits = index_buffer; // Index of the start of the digits to read int i = index_buffer; // Current index in buffer_line int line_start = i; // The start of the line, used to tell whether or not a line is empty for (; not_EOL(buffer_line[i]); i++) { if (buffer_line[i] == '#') { // Skip any lines starting with # for(; not_EOL(buffer_line[i]); i++); i++; } else if (buffer_line[i] == ',') { // Indicates the end of the digits to read if (sscanf(buffer_line + index_digits, "%lf", &(params[index_params++])) < 1) { // Convert the string of digits to a double when storing it in params usage(usage_message); } index_digits = i + 1; } } index_buffer = i + 1; if (i - line_start > 0) { // This line has content if (sscanf(buffer_line + index_digits, "%lf", &(params[index_params++])) < 1) { usage(usage_message); } if (index_params != NUM_RATES) { cout << term->red << "The given parameter sets file contains sets with an incorrect number of rates! This simulation requires " << NUM_RATES << " per set but at least one line contains " << index_params << " per set." << term->reset << endl; exit(EXIT_INPUT_ERROR); } return true; } else if (buffer_line[index_buffer] != '\0') { // There are more lines to try to parse return parse_param_line(params, buffer_line, index_buffer); } else { // The end of the buffer was found return false; } } /* parse_ranges_file reads the given buffer and stores every range found in the given ranges array parameters: ranges: the array of pairs in which to store the lower and upper bounds of each range buffer: the buffer with the ranges to read returns: nothing notes: The buffer should contain one range per line, starting the name of the parameter followed by the bracked enclosed lower and then upper bound optionally followed by comments. e.g. 'msh1 [30, 65] comment' The name of the parameter is so humans can conveniently read the file and has no semantic value to this parser. Blank lines and lines starting with # will be ignored. Anything after the upper bound is ignored. todo: */ void parse_ranges_file (pair <double, double> ranges[], char* buffer) { int i = 0; int rate = 0; for (; buffer[i] != '\0'; i++) { // Ignore lines starting with # while (buffer[i] == '#') { while (buffer[i] != '\n' && buffer[i] != '\0') {i++;} i++; } // Ignore whitespace before the opening bracket while (buffer[i] != '[' && buffer[i] != '\0') {i++;} if (buffer[i] == '\0') {break;} i++; // Read the bounds ranges[rate].first = atof(buffer + i); while (buffer[i] != ',') {i++;} i++; ranges[rate].second = atof(buffer + i); if (ranges[rate].first < 0 || ranges[rate].second < 0) { // If the ranges are invalid then set them to 0 ranges[rate].first = 0; ranges[rate].second = 0; } rate++; // Skip any comments until the end of the line while (buffer[i] != '\n' && buffer[i] != '\0') {i++;} } } /* print_passed prints the parameter sets that passed all required conditions of all required mutants parameters: ip: the program's input parameters file_passed: a pointer to the output file stream to open the file with rs: the current simulation's rates to pull the parameter sets from returns: nothing notes: This function prints each parameter separated by a comma, one set per line. todo: */ void print_passed (input_params& ip, ofstream* file_passed, rates& rs) { if (ip.print_passed) { // Print which sets passed only if the user specified it try { *file_passed << rs.rates_base[0]; for (int i = 1; i < NUM_RATES; i++) { *file_passed << "," << rs.rates_base[i]; } *file_passed << endl; } catch (ofstream::failure) { cout << term->red << "Couldn't write to " << ip.passed_file << "!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } } } /* print_concentrations prints the concentration values of every cell at every time step of the given mutant for the given run parameters: ip: the program's input parameters sd: the current simulation's data cl: the current simulation's concentration levels md: mutant data filename_cons: the path and name of the file in which to store the concentration levels set_num: the index of the parameter set whose concentration levels are being printed returns: nothing notes: The first line of the file is the total width then a space then the height of the simulation. Each line after starts with the time step then a space then space-separated concentration levels for every cell ordered by their position relative to the active start of the PSM. If binary mode is set, the file will get the extension .bcons and print raw binary values, not ASCII text. The concentration printed is mutant dependent, but usually mh1. todo: */ void print_concentrations (input_params& ip, sim_data& sd, con_levels& cl, mutant_data& md, char* filename_cons, int set_num) { if (ip.print_cons) { // Print the concentrations only if the user specified it int strlen_set_num = INT_STRLEN(set_num); // How many bytes the ASCII representation of set_num takes char* str_set_num = (char*)mallocate(sizeof(char) * (strlen_set_num + 1)); sprintf(str_set_num, "%d", set_num); char* extension; if (ip.binary_cons_output) { // Binary files get the extension .bcons extension = copy_str(".bcons"); } else { // ASCII files (the default option) get the extension specified by the user extension = copy_str(".cons"); } char* filename_set = (char*)mallocate(sizeof(char) * (strlen(filename_cons) + strlen("set_") + strlen_set_num + strlen(extension) + 1)); sprintf(filename_set, "%sset_%s%s", filename_cons, str_set_num, extension); cout << " "; // Offset the open_file message to preserve horizontal spacing ofstream file_cons; open_file(&file_cons, filename_set, sd.section == SEC_ANT); mfree(filename_set); mfree(str_set_num); mfree(extension); // If the file was just created then prepend the concentration levels with the simulation size if (sd.section == SEC_POST) { if (ip.binary_cons_output) { file_cons.write((char*)(&sd.width_total), sizeof(int)); file_cons.write((char*)(&sd.height), sizeof(int)); } else { file_cons << sd.width_total << " " << sd.height << "\n"; } } // Calculate which time steps to print int step_offset = (sd.section == SEC_ANT) * ((sd.steps_til_growth - sd.time_start) / sd.big_gran + 1); // If the file is being appended to then offset the time steps int start = sd.time_start / sd.big_gran; int end = sd.time_end / sd.big_gran; // Print the concentration levels of every cell at every time step if (ip.binary_cons_output) { for (int j = start; j < end; j++) { int time_step = (j + step_offset) * sd.big_gran; file_cons.write((char*)(&time_step), sizeof(int)); for (int i = 0; i < sd.height; i++) { int num_printed = 0; for (int k = cl.active_start_record[j]; num_printed < sd.width_total; k = WRAP(k - 1, sd.width_total), num_printed++) { float con = cl.cons[md.print_con][j][i * sd.width_total + k]; file_cons.write((char*)(&con), sizeof(float)); } } } } else { for (int j = start; j < end; j++) { int time_step = (j + step_offset) * sd.big_gran; file_cons << time_step << " "; for (int i = 0; i < sd.height; i++) { int num_printed = 0; for (int k = cl.active_start_record[j]; num_printed < sd.width_total; k = WRAP(k - 1, sd.width_total), num_printed++) { file_cons << cl.cons[md.print_con][j][i * sd.width_total + k] << " "; } } file_cons << "\n"; } } } } /* print_cell columns prints the concentrations of a number of columns of cells given by the user to an output file for plotting from the cells birth to their death: ip: the program's input parameters sd: the current simulation's data cl: the current simulation's concentration levels filename_cons: the path and name of the file in which to store the file being created set_num: the index of the parameter set whose concentration levels are being printed returns: nothing notes: The first line of the file is the number of columns printed then a space then the total height of the simulation Each line after starts with the time step then a space then space-separated concentration levels for every cell ordered by their position relative to the active start of the PSM. The number of columns given is relative to the start of the PSM and the cells are traced until one of the columns enters the determined region and is overwritten. The concentration printed is mutant dependent, but usually mh1. todo: */ void print_cell_columns (input_params& ip, sim_data& sd, con_levels &cl, char* filename_cons, int set_num) { if (ip.num_colls_print) { // Print the cells only if the user specified it //cerr << "But why are we here" << endl; int strlen_set_num = INT_STRLEN(set_num); // How many bytes the ASCII representation of set_num takes char* str_set_num = (char*)mallocate(sizeof(char) * (strlen_set_num + 1)); sprintf(str_set_num, "%d", set_num); char* filename_set = (char*)mallocate(sizeof(char) * (strlen(filename_cons) + strlen("set_") + strlen_set_num + strlen(".cells") + 1)); sprintf(filename_set, "%sset_%s.cells", filename_cons, str_set_num); cout << " "; // Offset the open_file message to preserve horizontal spacing ofstream file_cons; open_file(&file_cons, filename_set, false); file_cons << sd.height << " " << ip.num_colls_print << endl; mfree(filename_set); mfree(str_set_num); int time_full = anterior_time(sd, sd.steps_til_growth + (sd.width_total - sd.width_initial - 1) * sd.steps_split) ; // Time after which the PSM is full of cells int time = time_full; double time_point[sd.height * ip.num_colls_print]; // Array for storing all the cells that need to be printed at each time point memset(time_point, 0, sizeof(double) * sd.height * ip.num_colls_print); int first_active_start = cl.active_start_record[time_full]; while ((time < time_full + sd.steps_split) || cl.active_start_record[time] != first_active_start) { file_cons << time - time_full << " "; int col = 0; for (; col < ip.num_colls_print; col++) { int cur_col = WRAP(first_active_start + col, sd.width_total); for (int line = 0; line < sd.height; line++) { time_point[line * ip.num_colls_print + col] = cl.cons[CMH1][time][line * sd.width_total + cur_col]; } if (cur_col == cl.active_start_record[time]) { col++; break; } } // If not all the cells we're following are born yet, fill the rest of the slots with -1 for no data for (; col < ip.num_colls_print; col++) { for (int line = 0; line < sd.height; line++) { time_point[line * ip.num_colls_print + col] = -1; } } for (int cell = 0; cell < sd.height * ip.num_colls_print; cell++) { file_cons << time_point[cell] << " "; } file_cons << endl; time++; } int end_col = WRAP(first_active_start + ip.num_colls_print - 1, sd.width_total); while (cl.active_start_record[time] != WRAP(end_col, sd.width_total)) { int col = 0; file_cons << time - time_full << " "; for (; col < ip.num_colls_print; col++) { int cur_col = WRAP(end_col - col, sd.width_total); if (cur_col == cl.active_start_record[time]) { break; } for (int line = 0; line < sd.height; line++) { time_point[line * ip.num_colls_print + (ip.num_colls_print - col - 1)] = cl.cons[CMH1][time][line * sd.width_total + cur_col]; } } // If not all the cells we're following are still alive, fill the rest of the slots with -1 for no data for (; col < ip.num_colls_print; col++) { for (int line = 0; line < sd.height; line++) { time_point[line * ip.num_colls_print + (ip.num_colls_print - col - 1)] = -1; } } for (int cell = 0; cell < sd.height * ip.num_colls_print; cell++) { file_cons << time_point[cell] << " "; } file_cons << endl; time++; } file_cons.close(); } } /* print_osc_features prints the oscillation features for every mutant of the given run parameters: ip: the program's input parameters file_features: a pointer to the output file stream to open the file with mds: an array of the mutant_data structs for every mutant set_num: the index of the parameter set whose features are being printed num_passed: the number of mutants that passed the parameter set returns: nothing notes: This function sets the precision of file_features to 30, which is higher than the default value. This function prints each feature for each mutant, each feature separated by a comma, one set per line. todo: TODO Print anterior scores. */ void print_osc_features (input_params& ip, ofstream* file_features, mutant_data mds[], int set_num, int num_passed) { if (ip.print_features) { // Print the features only if the user specified it file_features->precision(30); try { *file_features << set_num << ","; for (int i = 0; i < ip.num_active_mutants; i++) { *file_features << mds[i].feat.sync_score_post[IMH1] << "," << mds[i].feat.period_post[IMH1] << "," << mds[i].feat.amplitude_post[IMH1] << "," << (mds[i].feat.period_post[IMH1]) / (mds[MUTANT_WILDTYPE].feat.period_post[IMH1]) << "," << (mds[i].feat.amplitude_post[IMH1]) / (mds[MUTANT_WILDTYPE].feat.amplitude_post[IMH1]) << ","; *file_features << mds[i].feat.sync_score_ant[IMH1] << "," << mds[i].feat.period_ant[IMH1] << "," << mds[i].feat.amplitude_ant[IMH1] << "," << (mds[i].feat.period_ant[IMH1]) / (mds[MUTANT_WILDTYPE].feat.period_ant[IMH1]) << "," << (mds[i].feat.amplitude_ant[IMH1]) / (mds[MUTANT_WILDTYPE].feat.amplitude_ant[IMH1]) << ","; } if (num_passed == ip.num_active_mutants) { *file_features << "PASSED" << endl; } else { *file_features << "FAILED" << endl; } } catch (ofstream::failure) { cout << term->red << "Couldn't write to " << ip.features_file << "!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } } } /* print_conditions prints which conditions each mutant of the given run passed parameters: ip: the program's input parameters file_conditions: a pointer to the output file stream to open the file with mds: an array of the mutant data structs for every mutant set_num: the index of the parameter set whose conditions are being printed returns: nothing notes: This function prints -1, 0, or 1 for each condition for each mutant, each condition separated by a comma, one set per line. todo: */ void print_conditions (input_params& ip, ofstream* file_conditions, mutant_data mds[], int set_num) { if (ip.print_conditions) { // Print the conditions only if the user specified it try { *file_conditions << set_num << ","; for (int i = 0; i < ip.num_active_mutants; i++) { *file_conditions << mds[i].print_name << ","; for (int j = 0; j < NUM_SECTIONS; j++) { for (int k = 0; k < mds[i].num_conditions[j]; k++) { if (mds[i].secs_passed[j]) { // If the mutant was run, print 1 if it passed, 0 if it failed *file_conditions << mds[i].conds_passed[j][k] << ","; } else { // If the mutant was not run, print -1 *file_conditions << "-1,"; } } } } *file_conditions << endl; } catch (ofstream::failure) { cout << term->red << "Couldn't write to " << ip.conditions_file << "!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } } } /* print_scores prints the scores of each mutant run for the given set parameters: ip: the program's input parameters file_scores: a pointer to the output file stream to open the file with set_num: the index of the parameter set whose conditions are being printed scores: the array of scores to print total_score: the sum of all the scores returns: nothing notes: This function prints the set index then score for each mutant then the total score, all separated by commas, one set per line. todo: */ void print_scores (input_params& ip, ofstream* file_scores, int set_num, double scores[], double total_score) { if (ip.print_scores) { try { *file_scores << set_num << ","; for (int i = 0; i < NUM_SECTIONS * ip.num_active_mutants; i++) { *file_scores << scores[i] << ","; } *file_scores << total_score << endl; } catch (ofstream::failure) { cout << term->red << "Couldn't write to " << ip.scores_file << "!" << term->reset << endl; exit(EXIT_FILE_WRITE_ERROR); } } } /* close_if_open closes the given output file stream if it is open parameters: file: a pointer to the output file stream to close returns: nothing notes: todo: */ void close_if_open (ofstream* file) { if (file->is_open()) { file->close(); } } /* read_pipe reads parameter sets from a pipe created by a program interacting with this one parameters: sets: the array of parameter sets in which to store any received sets ip: the program's input parameters returns: nothing notes: The first information piped in must be an integer specifying the number of rates (i.e. parameters) per set that will be piped in. If this number differs from what is expected, the program will exit. The next information piped in must be an integer specifying the number of parameter sets that will be piped in. Each set to be piped in should be sent as a stream of doubles, with each set boundary determined by the previously sent number of rates per set. This function does not create a pipe; it must be created by an external program interfacing with this one. todo: */ void read_pipe (double**& sets, input_params& ip) { // Read how many rates per set will be piped in int num_pars = 0; read_pipe_int(ip.pipe_in, &num_pars); if (num_pars != NUM_RATES) { cout << term->red << "An incorrect number of rates will be piped in! This simulation requires " << NUM_RATES << " rates per set but the sampler is sending " << num_pars << " per set." << term->reset << endl; exit(EXIT_INPUT_ERROR); } // Read how many sets will be piped in int num_sets = 0; read_pipe_int(ip.pipe_in, &num_sets); if (num_sets <= 0) { cout << term->red << "An invalid number of parameter sets will be piped in! The number of sets must be a positive integer but the sampler is sending " << num_sets << "." << term->reset << endl; exit(EXIT_INPUT_ERROR); } ip.num_sets = num_sets; // Read every set and store it as an array of doubles sets = new double*[num_sets]; for (int i = 0; i < num_sets; i++) { sets[i] = new double[NUM_RATES]; read_pipe_set(ip.pipe_in, sets[i]); } } /* read_pipe_int reads an integer from the given pipe and stores it in the given address parameters: fd: the file descriptor identifying the pipe address: the address to store the integer read from the pipe returns: nothing notes: This function assumes that fd identifies a valid pipe end and will exit with an error if it does not. todo: */ void read_pipe_int (int fd, int* address) { if (read(fd, address, sizeof(int)) == -1) { term->failed_pipe_read(); exit(EXIT_PIPE_READ_ERROR); } } /* read_pipe_set reads a parameter set from the given pipe and stores it in the given address parameters: fd: the file descriptor identifying the pipe pars: the array in which to store the set read from the pipe returns: nothing notes: This function assumes that fd identifies a valid pipe end and will exit with an error if it does not. todo: */ void read_pipe_set (int fd, double pars[]) { if (read(fd, pars, sizeof(double) * NUM_RATES) == -1) { term->failed_pipe_read(); exit(EXIT_PIPE_READ_ERROR); } } /* write_pipe writes run scores to a pipe created by a program interacting with this one parameters: score: the array of scores to send ip: the program's input parameters sd: the current simulation's data returns: nothing notes: This function assumes that fd points to a valid pipe and will exit with an error if it does not. todo: */ void write_pipe (double score[], input_params& ip, sim_data& sd) { // Write the maximum possible score an single run can achieve to the pipe write_pipe_double(ip.pipe_out, (sd.no_growth ? sd.max_scores[SEC_POST] : sd.max_score_all)); // Write the scores to the pipe for (int i = 0; i < ip.num_sets; i++) { write_pipe_double(ip.pipe_out, score[i]); } // Close the pipe if (close(ip.pipe_out) == -1) { term->failed_pipe_write(); exit(EXIT_PIPE_WRITE_ERROR); } } /* write_pipe_int writes the given integer to the given pipe parameters: fd: the file descriptor identifying the pipe value: the integer to write to the pipe returns: nothing notes: This function assumes that fd points to a valid pipe and will exit with an error if it does not. todo: */ void write_pipe_double (int fd, double value) { if (write(fd, &value, sizeof(double)) == -1) { term->failed_pipe_write(); exit(EXIT_PIPE_WRITE_ERROR); } }
jerryyjr/cosc445_project
simulation/source/io.cpp
C++
gpl-3.0
26,892
// LinkInfoURI.cpp #include "LinkInfo.h" using namespace MuPDFWinRT; LinkInfoURI::LinkInfoURI(RectF rect, Platform::String^ uri) { m_rect = rect; m_uri = uri; } void LinkInfoURI::AcceptVisitor(LinkInfoVisitor^ visitor) { visitor->VisitURI(this); }
MishaUliutin/MuPDF.WinRT
Src/LinkInfoURI.cpp
C++
gpl-3.0
254
<?php /** * @version $Id: default.php 2013-10-29 * @copyright Copyright (C) 2013 Leonardo Alviarez - Edén Arreaza. All Rights Reserved. * @license GNU General Public License version 3, or later * @note Note : All ini files need to be saved as UTF-8 - No BOM */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.framework'); JHtml::_('bootstrap.framework'); JHtml::_('bootstrap.framework'); $document = JFactory::getDocument(); $document->addStyleSheet('media/com_thorhospedaje/css/th_productor.css'); $document->addStyleSheet('media/com_thorhospedaje/css/jquery-themes/jquery-ui.min.css'); $document->addStyleSheet(JURI::base().'media/jui/css/chosen.css'); $document->addScript('media/com_thorhospedaje/js/jquery-ui.min.js'); $document->addScript(JURI::base().'media/jui/js/chosen.jquery.js'); ?> <div class="mod_th_productor"> <div class="span3"> <br><br><br /><br /> <img style="width:80%;" src="media/com_thorhospedaje/images/posaderos/te_ofrecemos.png" /> </div> <div class="span9"> <br><br> <div class="row-fluid"> <img src="media/com_thorhospedaje/images/productor/ruta_productor.png" /> </div> <h2><?php echo JText::_('TH_POSADERO_MESSAGE_TITLE'); ?></h2> <p><?php echo JText::_('TH_POSADERO_MESSAGE_P1'); ?></p> <p><?php echo JText::_('TH_POSADERO_MESSAGE_P2'); ?></p> <form action="<?php echo JRoute::_("");?>" method="POST" class="form-inline"> <div class="row-fluid box"> <h2><?php echo JText::_('TH_POSADERO_TITLE_LANGUAGE'); ?></h2> <div class="hr"></div> <div class="row-fluid"> <div class="span6"> <div class="control-label"><label title="" for="client-language"><?php echo JText::_('TH_POSADERO_CLIENT_LANGUAGE_LABEL'); ?></label></div> <div class="controls"> <div class="input-append"> <select name="client-language" id="client-language"> <option value=""><?php echo JText::_('TH_POSADERO_CLIENT_LANGUAGE_SELECT'); ?></option> <option value="1"><?php echo JText::_('TH_POSADERO_CLIENT_LANGUAGE_PT'); ?></option> <option value="2"><?php echo JText::_('TH_POSADERO_CLIENT_LANGUAGE_EN'); ?></option> <option value="3"><?php echo JText::_('TH_POSADERO_CLIENT_LANGUAGE_ES'); ?></option> </select> </div> </div> </div> <div class="span5"> <img src="media/com_thorhospedaje/images/posaderos/tip_ayuda_idioma.png" width="100%"/> </div> </div> </div> <!-- Datos de cliente --> <?php echo $this->loadTemplate('client'); ?> <!-- Dirección --> <?php echo $this->loadTemplate('address'); ?> <!-- Hotel --> <?php echo $this->loadTemplate('asset'); ?> <!-- Hotel --> <?php echo $this->loadTemplate('conditions'); ?> <div class="row-fluid"> <div class="span6"> <a href="index.php/contrate-con-nosotros?id=15" target="_self"> <img style="width:60%; float: left;" src="media/com_thorhospedaje/images/comunes/atras.png" width="60%"/> </a> </div> <div class="span6"> <a href="index.php?option=com_thorhospedaje&view=productor&layout=pay" target="_self"> <img style="width:60%; float: right;" src="media/com_thorhospedaje/images/comunes/siguiente.png" width="60%"/> </a> </div> </div> </form> </div> </div>
lalviarez/thor_hospedaje
site/views/productor/tmpl/default.php
PHP
gpl-3.0
3,180
namespace ProcessingTools.Contracts.Services.Data.Geo { using ProcessingTools.Contracts.Filters.Geo; using ProcessingTools.Contracts.Models.Geo; public interface IPostCodesDataService : IDataServiceAsync<IPostCode, IPostCodesFilter> { } }
bozhink/ProcessingTools
src/ProcessingTools/Infrastructure/Contracts/Services.Data/Geo/IPostCodesDataService.cs
C#
gpl-3.0
263
/* * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * * $Revision$ * $Id$ * $HeadURL$ */ #include "bindings.h" #include "globals.h" // ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- void Bindings::SetDefaults() { SetDefaultsCodeBlocks(); SetDefaultsWxWidgets(); SetDefaultsSTL(); SetDefaultsCLibrary(); } void Bindings::SetDefaultsCodeBlocks() { wxString strCodeBlocks = _T( "AbstractJob;backgroundthread.h|" "AddBuildTarget;projectbuildtarget.h|" "AddFile;projectfile.h|" "Agony;backgroundthread.h|" "AnnoyingDialog;annoyingdialog.h|" "AppendArray;globals.h|" "AutoDetectCompilers;autodetectcompilers.h|" "BackgroundThread;backgroundthread.h|" "BackgroundThreadPool;backgroundthread.h|" "BlkAllc;blockallocated.h|" "BlockAllocated;blockallocated.h|" "BlockAllocator;blockallocated.h|" "cbAssert;cbexception.h|" "cbC2U;globals.h|" "cbCodeCompletionPlugin;cbplugin.h|" "cbCompilerPlugin;cbplugin.h|" "cbConfigurationDialog;configurationpanel.h|" "cbConfigurationPanel;configurationpanel.h|" "cbDebuggerPlugin;cbplugin.h|" "cbDirAccessCheck;globals.h|" "cbEditor;cbeditor.h|" "cbEditorPrintout;cbeditorprintout.h|" "cbEventFunctor;cbfunctor.h|" "cbException;cbexception.h|" "cbExecuteProcess;cbexecute.h|" "cbLoadBitmap;globals.h|" "cbMessageBox;globals.h|" "cbMimePlugin;cbplugin.h|" "cbPlugin;cbplugin.h|" "cbProject;cbproject.h|" "cbRead;globals.h|" "cbReadFileContents;globals.h|" "cbSaveTinyXMLDocument;globals.h|" "cbSaveToFile;globals.h|" "cbStyledTextCtrl;cbeditor.h|" "cbSyncExecute;cbexecute.h|" "cbThreadedTask;cbthreadtask.h|" "cbThreadPool;cbthreadpool.h|" "cbThrow;cbexception.h|" "cbTool;cbtool.h|" "cbToolPlugin;cbplugin.h|" "cbU2C;globals.h|" "cbWizardPlugin;cbplugin.h|" "cbWorkerThread;cbthreadpool_extras.h|" "cbWorkspace;cbworkspace.h|" "cbWrite;globals.h|" "CfgMgrBldr;configmanager.h|" "cgCompiler;cbplugin.h|" "cgContribPlugin;cbplugin.h|" "cgCorePlugin;cbplugin.h|" "cgEditor;cbplugin.h|" "cgUnknown;cbplugin.h|" "ChooseDirectory;globals.h|" "clogFull;compiler.h|" "clogNone;compiler.h|" "clogSimple;compiler.h|" "cltError;compiler.h|" "cltInfo;compiler.h|" "cltNormal;compiler.h|" "cltWarning;compiler.h|" "CodeBlocksDockEvent;sdk_events.h|" "CodeBlocksEvent;sdk_events.h|" "CodeBlocksLayoutEvent;sdk_events.h|" "CodeBlocksLogEvent;sdk_events.h|" "CompileOptionsBase;compileoptionsbase.h|" "Compiler;compiler.h|" "CompilerCommandGenerator;compilercommandgenerator.h|" "CompilerFactory;compilerfactory.h|" "CompilerOptions;compileroptions.h|" "CompilerPrograms;compiler.h|" "CompilerSwitches;compiler.h|" "CompilerTool;compiler.h|" "CompilerToolsVector;compiler.h|" "CompileTargetBase;compiletargetbase.h|" "CompOption;compileroptions.h|" "ConfigManager;configmanager.h|" "ConfigureToolsDlg;configuretoolsdlg.h|" "ConfigManagerContainer;configmanager.h|" "ConfirmReplaceDlg;confirmreplacedlg.h|" "CreateDir;globals.h|" "CreateDirRecursively;globals.h|" "CSS;loggers.h|" "Death;backgroundthread.h|" "DelayedDelete;filemanager.h|" "DetectEncodingAndConvert;globals.h|" "DuplicateBuildTarget;projectbuildtarget.h|" "EditArrayFileDlg;editarrayfiledlg.h|" "EditArrayOrderDlg;editarrayorderdlg.h|" "EditArrayStringDlg;editarraystringdlg.h|" "EditKeywordsDlg;editkeywordsdlg.h|" "EditorBase;editorbase.h|" "EditorColourSet;editorcolourset.h|" "EditorConfigurationDlg;editorconfigurationdlg.h|" "EditorHooks;editor_hooks.h|" "EditorLexerLoader;editorlexerloader.h|" "EditorManager;editormanager.h|" "EditPairDlg;editpairdlg.h|" "EditPathDlg;editpathdlg.h|" "EditToolDlg;edittooldlg.h|" "EncodingDetector;encodingdetector.h|" "ExternalDepsDlg;externaldepsdlg.h|" "FileGroups;filegroupsandmasks.h|" "FileLoader;filemanager.h|" "FileLogger;loggers.h|" "FileManager;filemanager.h|" "FileSet;projecttemplateloader.h|" "FileSetFile;projecttemplateloader.h|" "FilesGroupsAndMasks;filegroupsandmasks.h|" "FileTreeData;cbproject.h|" "FileType;globals.h|" "FileTypeOf;globals.h|" "FindDlg;finddlg.h|" "FindReplaceBase;findreplacebase.h|" "GenericMultiLineNotesDlg;genericmultilinenotesdlg.h|" "GetActiveEditor;editorbase.h|" "GetActiveProject;cbproject.h|" "GetArrayFromString;globals.h|" "GetBuiltinActiveEditor;cbeditor.h|" "GetBuiltinEditor;cbeditor.h|" "GetBuildTarget;projectbuildtarget.h|" "GetColourSet;editorcolourset.h|" "GetConfigManager;configmanager.h|" "GetConfigurationPanel;configurationpanel.h|" "GetCurrentlyCompilingTarget;projectbuildtarget.h|" "GetEditor;editorbase.h|" "GetEditorManager;editormanager.h|" "GetFile;projectfile.h|" "GetFileByFilename;projectfile.h|" "GetFileManager;filemanager.h|" "GetLogManager;logmanager.h|" "GetMacrosManager;macrosmanager.h|" "GetMessageManager;messagemanager.h|" "GetNotebook;wx/wxFlatNotebook/wxFlatNotebook.h|" "GetParentProject;cbproject.h|" "GetPersonalityManager;personalitymanager.h|" "GetPlatformsFromString;globals.h|" "GetPluginManager;pluginmanager.h|" "GetProjectConfigurationPanel;configurationpanel.h|" "GetProjectFile;projectfile.h|" "GetProjectManager;projectmanager.h|" "GetProjects;cbproject.h|" "GetScriptingManager;scriptingmanager.h|" "GetStringFromArray;globals.h|" "GetStringFromPlatforms;globals.h|" "GetToolsManager;toolsmanager.h|" "GetTopEditor;gettopeditor.h|" "GetUserVariableManager;uservarmanager.h|" "GetWorkspace;cbworkspace.h|" "HTMLFileLogger;loggers.h|" "IBaseLoader;ibaseloader.h|" "IBaseWorkspaceLoader;ibaseworkspaceloader.h|" "ID;id.h|" "IEventFunctorBase;cbfunctor.h|" "IFunctorBase;cbfunctor.h|" "ImportersGlobals;importer_globals.h|" "IncrementalSelectListDlg;incrementalselectlistdlg.h|" "InfoWindow;infowindow.h|" "IsBuiltinOpen;cbeditor.h|" "ISerializable;configmanager.h|" "IsOpen;cbproject.h|" "IsWindowReallyShown;globals.h|" "JobQueue;backgroundthread.h|" "FileLoader;filemanager.h|" "FileTreeData;cbproject.h|" "ListCtrlLogger;loggers.h|" "LoaderBase;filemanager.h|" "LoadPNGWindows2000Hack;globals.h|" "LoadProject;cbproject.h|" "Logger;logger.h|" "LogManager;logmanager.h|" "LogSlot;logmanager.h|" "MacrosManager;macrosmanager.h|" "MakeCommand;compiletargetbase.h|" "ManagedThread;managerthread.h|" "Manager;manager.h|" "MenuItemsManager;menuitemsmanager.h|" "MessageManager;messagemanager.h|" "Mgr;manager.h|" "MiscTreeItemData;misctreeitemdata.h|" "MultiSelectDlg;multiselectdlg.h|" "NewFromTemplateDlg;newfromtemplatedlg.h|" "NewProject;cbproject.h|" "NormalizePath;globals.h|" "NotifyMissingFile;globals.h|" "NullLoader;filemanager.h|" "NullLogger;logger.h|" "OptionColour;editorcolourset.h|" "OptionSet;editorcolourset.h|" "PCHMode;cbproject.h|" "pchObjectDir;cbproject.h|" "pchSourceDir;cbproject.h|" "pchSourceFile;cbproject.h|" "PlaceWindow;globals.h|" "PersonalityManager;personalitymanager.h|" "pfCustomBuild;projectfile.h|" "pfDetails;projectfile.h|" "PipedProcess;pipedprocess.h|" "PluginElement;pluginmanager.h|" "PluginInfo;pluginmanager.h|" "PluginManager;pluginmanager.h|" "PluginRegistrant;cbplugin.h|" "PluginsConfigurationDlg;pluginsconfigurationdlg.h|" "PluginType;globals.h|" "ProjectBuildTarget;projectbuildtarget.h|" "ProjectDepsDlg;projectdepsdlg.h|" "ProjectFile;projectfile.h|" "ProjectFileOptionsDlg;projectfileoptionsdlg.h|" "ProjectFilesVector;projectfile.h|" "ProjectLayoutLoader;projectlayoutloader.h|" "ProjectLoader;projectloader.h|" "ProjectLoaderHooks;projectloader_hooks.h|" "ProjectManager;projectmanager.h|" "ProjectOptionsDlg;projectoptionsdlg.h|" "ProjectsFileMasksDlg;projectsfilemasksdlg.h|" "ProjectTemplateLoader;projecttemplateloader.h|" "ptCodeCompletion;globals.h|" "ptCompiler;globals.h|" "ptDebugger;globals.h|" "ptMime;globals.h|" "ptNone;globals.h|" "ptOther;globals.h|" "ptTool;globals.h|" "ptWizard;globals.h|" "QuoteStringIfNeeded;globals.h|" "RegExStruct;compiler.h|" "ReplaceDlg;replacedlg.h|" "RestoreTreeState;globals.h|" "SaveTreeState;globals.h|" "ScriptingManager;scriptingmanager.h|" "ScriptSecurityWarningDlg;scriptsecuritywarningdlg.h|" "sdAllGlobal;configmanager.h|" "sdAllKnown;configmanager.h|" "sdAllUser;configmanager.h|" "sdBase;configmanager.h|" "sdConfig;configmanager.h|" "sdCurrent;configmanager.h|" "sdDataGlobal;configmanager.h|" "sdDataUser;configmanager.h|" "sdHome;configmanager.h|" "sdPath;configmanager.h|" "sdPluginsGlobal;configmanager.h|" "sdPluginsUser;configmanager.h|" "sdScriptsGlobal;configmanager.h|" "sdScriptsUser;configmanager.h|" "sdTemp;configmanager.h|" "SearchDirs;configmanager.h|" "SearchResultsLog;searchresultslog.h|" "SelectTargetDlg;selecttargetdlg.h|" "SeqDelete;safedelete.h|" "Stacker;infowindow.h|" "StdoutLogger;loggers.h|" "TemplateManager;templatemanager.h|" "TemplateOption;projecttemplateloader.h|" "TextCtrlLogger;loggers.h|" "TimestampTextCtrlLogger;loggers.h|" "ToolsManager;toolsmanager.h|" "ttCommandsOnly;compiletargetbase.h|" "ttConsoleOnly;compiletargetbase.h|" "ttDynamicLib;compiletargetbase.h|" "ttExecutable;compiletargetbase.h|" "ttNative;compiletargetbase.h|" "ttStaticLib;compiletargetbase.h|" "UnixFilename;globals.h|" "URLEncode;globals.h|" "URLLoader;filemanager.h|" "UsesCommonControls6;globals.h|" "UserVariableManager;uservarmanager.h|" "VirtualBuildTargetsDlg;virtualbuildtargetsdlg.h|" "WorkspaceLoader;workspaceloader.h|" "wxToolBarAddOnXmlHandler;xtra_res.h|" "wxBase64;base64.h|" "wxCrc32;crc32.h"); const wxArrayString arCodeBlocks = GetArrayFromString(strCodeBlocks, _T("|")); for(std::size_t i = 0; i < arCodeBlocks.GetCount(); ++i) { const wxArrayString arTmp = GetArrayFromString(arCodeBlocks.Item(i), _T(";")); AddBinding(_T("CodeBlocks"), arTmp.Item(0), arTmp.Item(1) ); } }// SetDefaultsCodeBlocks void Bindings::SetDefaultsWxWidgets() { ///////////// // v 2.6.4 // ///////////// // All macros wxString strWxWidgets_2_6_4 = _T( "DECLARE_APP;wx/app.h|" "DECLARE_CLASS;wx/object.h|" "DECLARE_ABSTRACT_CLASS;wx/object.h|" "DECLARE_DYNAMIC_CLASS;wx/object.h|" "DECLARE_EVENT_TYPE;wx/event.h|" "DECLARE_EVENT_MACRO;wx/event.h|" "DECLARE_EVENT_TABLE_ENTRY;wx/event.h|" "IMPLEMENT_APP;wx/app.h|" "IMPLEMENT_ABSTRACT_CLASS;wx/object.h|" "IMPLEMENT_ABSTRACT_CLASS2;wx/object.h|" "IMPLEMENT_CLASS;wx/object.h|" "IMPLEMENT_CLASS2;wx/object.h|" "IMPLEMENT_DYNAMIC_CLASS;wx/object.h|" "IMPLEMENT_DYNAMIC_CLASS2;wx/object.h|" "DEFINE_EVENT_TYPE;wx/event.h|" "BEGIN_EVENT_TABLE;wx/event.h|" "END_EVENT_TABLE;wx/event.h|" "EVT_CUSTOM;wx/event.h|" "EVT_CUSTOM_RANGE;wx/event.h|" "EVT_COMMAND;wx/event.h|" "EVT_COMMAND_RANGE;wx/event.h|" "EVT_NOTIFY;wx/event.h|" "EVT_NOTIFY_RANGE;wx/event.h|" "EVT_BUTTON;wx/button.h|" "EVT_CHECKBOX;wx/checkbox.h|" "EVT_CHOICE;wx/choice.h|" "EVT_CHOICE;wx/choice.h|" "EVT_COMBOBOX;wx/combobox.h|" "EVT_LISTBOX;wx/listbox.h|" "EVT_LISTBOX_DCLICK;wx/listbox.h|" "EVT_RADIOBOX;wx/radiobox.h|" "EVT_RADIOBUTTON;wx/radiobut.h|" "EVT_SCROLLBAR;wx/scrolbar.h|" "EVT_SLIDER;wx/slider.h|" "EVT_TOGGLEBUTTON;wx/tglbtn.h|" "WX_APPEND_ARRAY;wx/dynarray.h|" "WX_CLEAR_ARRAY;wx/dynarray.h|" "WX_DECLARE_OBJARRAY;wx/dynarray.h|" "WX_DEFINE_ARRAY;wx/dynarray.h|" "WX_DEFINE_OBJARRAY;wx/dynarray.h|" "WX_DEFINE_SORTED_ARRAY;wx/dynarray.h|" "WX_DECLARE_STRING_HASH_MAP;wx/hashmap.h|" "WX_DECLARE_HASH_MAP;wx/hashmap.h|" "wxASSERT;wx/debug.h|" "wxASSERT_MIN_BITSIZE;wx/debug.h|" "wxASSERT_MSG;wx/debug.h|" "wxBITMAP;wx/gdicmn.h|" "wxCOMPILE_TIME_ASSERT;wx/debug.h|" "wxCOMPILE_TIME_ASSERT2;wx/debug.h|" "wxCRIT_SECT_DECLARE;wx/thread.h|" "wxCRIT_SECT_DECLARE_MEMBER;wx/thread.h|" "wxCRIT_SECT_LOCKER;wx/thread.h|" "wxDYNLIB_FUNCTION;wx/dynlib.h|" "wxENTER_CRIT_SECT;wx/thread.h|" "wxFAIL;wx/debug.h|" "wxFAIL_MSG;wx/debug.h|" "wxICON;wx/gdicmn.h|" "wxLEAVE_CRIT_SECT;wx/thread.h|" "wxLL;wx/longlong.h|" "wxTRANSLATE;wx/intl.h|" "wxULL;wx/longlong.h|" // All ::wx methods "wxBeginBusyCursor;wx/utils.h|" "wxBell;wx/utils.h|" "wxClientDisplayRect;wx/gdicmn.h|" "wxClipboardOpen;wx/clipbrd.h|" "wxCloseClipboard;wx/clipbrd.h|" "wxColourDisplay;wx/gdicmn.h|" "wxConcatFiles;wx/filefn.h|" "wxCopyFile;wx/filefn.h|" "wxCreateDynamicObject;wx/object.h|" "wxCreateFileTipProvider;wx/tipdlg.h|" "wxDDECleanUp;wx/dde.h|" "wxDDEInitialize;wx/dde.h|" "wxDebugMsg;wx/utils.h|" "wxDirExists;wx/filefn.h|" "wxDirSelector;wx/dirdlg.h|" "wxDisplayDepth;wx/gdicmn.h|" "wxDisplaySize;wx/gdicmn.h|" "wxDisplaySizeMM;wx/gdicmn.h|" "wxDos2UnixFilename;wx/filefn.h|" "wxDROP_ICON;wx/dnd.h|" "wxEmptyClipboard;wx/clipbrd.h|" "wxEnableTopLevelWindows;wx/utils.h|" "wxEndBusyCursor;wx/utils.h|" "wxEntry;wx/app.h|" "wxEnumClipboardFormats;wx/clipbrd.h|" "wxError;wx/utils.h|" "wxExecute;wx/utils.h|" "wxExit;wx/app.h|" "wxFatalError;wx/utils.h|" "wxFileExists;wx/filefn.h|" "wxFileModificationTime;wx/filefn.h|" "wxFileNameFromPath;wx/filefn.h|" "wxFileSelector;wx/filedlg.h|" "wxFindFirstFile;wx/filefn.h|" "wxFindMenuItemId;wx/utils.h|" "wxFindNextFile;wx/filefn.h|" "wxFindWindowAtPoint;wx/utils.h|" "wxFindWindowAtPointer;wx/windows.h|" "wxFindWindowByLabel;wx/utils.h|" "wxFindWindowByName;wx/utils.h|" "wxGetActiveWindow;wx/windows.h|" "wxGetApp;wx/app.h|" "wxGetBatteryState;wx/utils.h|" "wxGetClipboardData;wx/clipbrd.h|" "wxGetClipboardFormatName;wx/clipbrd.h|" "wxGetColourFromUser;wx/colordlg.h|" "wxGetCwd;wx/filefn.h|" "wxGetDiskSpace;wx/filefn.h|" "wxGetDisplayName;wx/utils.h|" "wxGetElapsedTime;wx/timer.h|" "wxGetEmailAddress;wx/utils.h|" "wxGetFileKind;wx/filefn.h|" "wxGetFontFromUser;wx/fontdlg.h|" "wxGetFreeMemory;wx/utils.h|" "wxGetFullHostName;wx/utils.h|" "wxGetHomeDir;wx/utils.h|" "wxGetHostName;wx/utils.h|" "wxGetKeyState;wx/utils.h|" "wxGetLocalTime;wx/timer.h|" "wxGetLocalTimeMillis;wx/timer.h|" "wxGetMousePosition;wx/utils.h|" "wxGetMouseState;wx/utils.h|" "wxGetMultipleChoice;wx/choicdlg.h|" "wxGetMultipleChoices;wx/choicdlg.h|" "wxGetNumberFromUser;wx/numdlg.h|" "wxGetOsDescription;wx/utils.h|" "wxGetOSDirectory;wx/filefn.h|" "wxGetOsVersion;wx/utils.h|" "wxGetPasswordFromUser;wx/textdlg.h|" "wxGetPowerType;wx/utils.h|" "wxGetPrinterCommand;wx/dcps.h|" "wxGetPrinterFile;wx/dcps.h|" "wxGetPrinterMode;wx/dcps.h|" "wxGetPrinterOptions;wx/dcps.h|" "wxGetPrinterOrientation;wx/dcps.h|" "wxGetPrinterPreviewCommand;wx/dcps.h|" "wxGetPrinterScaling;wx/dcps.h|" "wxGetPrinterTranslation;wx/dcps.h|" "wxGetProcessId;wx/utils.h|" "wxGetResource;wx/utils.h|" "wxGetSingleChoice;wx/choicdlg.h|" "wxGetSingleChoiceData;wx/choicdlg.h|" "wxGetSingleChoiceIndex;wx/choicdlg.h|" "wxGetStockLabel;wx/stockitem.h|" "wxGetTempFileName;wx/filefn.h|" "wxGetTextFromUser;wx/textdlg.h|" "wxGetTopLevelParent;wx/window.h|" "wxGetTranslation;wx/intl.h|" "wxGetUserHome;wx/utils.h|" "wxGetUserId;wx/utils.h|" "wxGetUserName;wx/utils.h|" "wxGetUTCTime;wx/timer.h|" "wxGetWorkingDirectory;wx/filefn.h|" "wxHandleFatalExceptions;wx/app.h|" "wxInitAllImageHandlers;wx/image.h|" "wxInitialize;wx/app.h|" "wxIsAbsolutePath;wx/filefn.h|" "wxIsBusy;wx/utils.h|" "wxIsClipboardFormatAvailable;wx/clipbrd.h|" "wxIsDebuggerRunning;wx/debug.h|" "wxIsEmpty;wx/wxchar.h|" "wxIsMainThread;wx/thread.h|" "wxIsWild;wx/filefn.h|" "wxKill;wx/app.h|" "wxLaunchDefaultBrowser;wx/utils.h|" "wxLoadUserResource;wx/utils.h|" "wxLogDebug;wx/log.h|" "wxLogError;wx/log.h|" "wxLogFatalError;wx/log.h|" "wxLogMessage;wx/log.h|" "wxLogStatus;wx/log.h|" "wxLogSysError;wx/log.h|" "wxLogTrace;wx/log.h|" "wxLogVerbose;wx/log.h|" "wxLogWarning;wx/log.h|" "wxMakeMetafilePlaceable;wx/gdicmn.h|" "wxMatchWild;wx/filefn.h|" "wxMessageBox;wx/msgdlg.h|" "wxMicroSleep;wx/utils.h|" "wxMilliSleep;wx/utils.h|" "wxMkdir;wx/filefn.h|" "wxMutexGuiEnter;wx/thread.h|" "wxMutexGuiLeave;wx/thread.h|" "wxNewId;wx/utils.h|" "wxNow;wx/utils.h|" "wxOnAssert;wx/debug.h|" "wxOpenClipboard;wx/clipbrd.h|" "wxParseCommonDialogsFilter;wx/filefn.h|" "wxPathOnly;wx/filefn.h|" "wxPostDelete;wx/utils.h|" "wxPostEvent;wx/app.h|" "wxRegisterClipboardFormat;wx/clipbrd.h|" "wxRegisterId;wx/utils.h|" "wxRemoveFile;wx/filefn.h|" "wxRenameFile;wx/filefn.h|" "wxRmdir;wx/filefn.h|" "wxSafeShowMessage;wx/log.h|" "wxSafeYield;wx/utils.h|" "wxSetClipboardData;wx/clipbrd.h|" "wxSetCursor;wx/gdicmn.h|" "wxSetDisplayName;wx/utils.h|" "wxSetPrinterCommand;wx/dcps.h|" "wxSetPrinterFile;wx/dcps.h|" "wxSetPrinterMode;wx/dcps.h|" "wxSetPrinterOptions;wx/dcps.h|" "wxSetPrinterOrientation;wx/dcps.h|" "wxSetPrinterPreviewCommand;wx/dcps.h|" "wxSetPrinterScaling;wx/dcps.h|" "wxSetPrinterTranslation;wx/dcps.h|" "wxSetWorkingDirectory;wx/filefn.h|" "wxShell;wx/utils.h|" "wxShowTip;wx/tipdlg.h|" "wxShutdown;wx/utils.h|" "wxSleep;wx/utils.h|" "wxSnprintf;wx/wxchar.h|" "wxSplitPath;wx/filefn.h|" "wxStartTimer;wx/timer.h|" "wxStrcmp;wx/wxchar.h|" "wxStricmp;wx/wxchar.h|" "wxStringEq;wx/utils.h|" "wxStripMenuCodes;wx/utils.h|" "wxStrlen;wx/wxchar.h|" "wxSysErrorCode;wx/log.h|" "wxSysErrorMsg;wx/log.h|" "wxTrace;wx/memory.h|" "wxTraceLevel;wx/memory.h|" "wxTransferFileToStream;wx/docview.h|" "wxTransferStreamToFile;wx/docview.h|" "wxTrap;wx/debug.h|" "wxUninitialize;wx/app.h|" "wxUnix2DosFilename;wx/filefn.h|" "wxUsleep;wx/utils.h|" "wxVsnprintf;wx/wxchar.h|" "wxWakeUpIdle;wx/app.h|" "wxWriteResource;wx/utils.h|" "wxYield;wx/app.h|" // All ::wx classes "wxAcceleratorEntry;wx/accel.h|" "wxAcceleratorTable;wx/accel.h|" "wxAccessible;wx/access.h|" "wxActivateEvent;wx/event.h|" "wxApp;wx/app.h|" "wxArchiveClassFactory;wx/archive.h|" "wxArchiveEntry;wx/archive.h|" "wxArchiveInputStream;wx/archive.h|" "wxArchiveIterator;wx/archive.h|" "wxArchiveNotifier;wx/archive.h|" "wxArchiveOutputStream;wx/archive.h|" "wxArray;wx/dynarray.h|" "wxArrayString;wx/arrstr.h|" "wxArtProvider;wx/artprov.h|" "wxAutomationObject;wx/msw/ole/automtn.h|" "wxBitmap;wx/bitmap.h|" "wxBitmapButton;wx/bmpbuttn.h|" "wxBitmapDataObject;wx/dataobj.h|" "wxBitmapHandler;wx/bitmap.h|" "wxBoxSizer;wx/sizer.h|" "wxBrush;wx/brush.h|" "wxBrushList;wx/gdicmn.h|" "wxBufferedDC;wx/dcbuffer.h|" "wxBufferedInputStream;wx/stream.h|" "wxBufferedOutputStream;wx/stream.h|" "wxBufferedPaintDC;wx/dcbuffer.h|" "wxBusyCursor;wx/utils.h|" "wxBusyInfo;wx/busyinfo.h|" "wxButton;wx/button.h|" "wxCalculateLayoutEvent;wx/laywin.h|" "wxCalendarCtrl;wx/calctrl.h|" "wxCalendarDateAttr;wx/calctrl.h|" "wxCalendarEvent;wx/calctrl.h|" "wxCaret;wx/caret.h|" "wxCheckBox;wx/checkbox.h|" "wxCheckListBox;wx/checklst.h|" "wxChoice;wx/choice.h|" "wxChoicebook;wx/choicebk.h|" "wxClassInfo;wx/object.h|" "wxClient;wx/ipc.h|" "wxClientData;wx/clntdata.h|" "wxClientDataContainer;wx/clntdata.h|" "wxClientDC;wx/dcclient.h|" "wxClipboard;wx/clipbrd.h|" "wxCloseEvent;wx/event.h|" "wxCmdLineParser;wx/cmdline.h|" "wxColour;wx/colour.h|" "wxColourData;wx/cmndata.h|" "wxColourDatabase;wx/gdicmn.h|" "wxColourDialog;wx/colordlg.h|" "wxComboBox;wx/combobox.h|" "wxCommand;wx/cmdproc.h|" "wxCommandEvent;wx/event.h|" "wxCommandProcessor;wx/cmdproc.h|" "wxCondition;wx/thread.h|" "wxConfigBase;wx/config.h|" "wxConnection;wx/ipc.h|" "wxContextHelp;wx/cshelp.h|" "wxContextHelpButton;wx/cshelp.h|" "wxContextMenuEvent;wx/event.h|" "wxControl;wx/control.h|" "wxControlWithItems;wx/ctrlsub.h|" "wxCountingOutputStream;wx/stream.h|" "wxCriticalSection;wx/thread.h|" "wxCriticalSectionLocker;wx/thread.h|" "wxCSConv;wx/strconv.h|" "wxCurrentTipProvider;wx/tipdlg.h|" "wxCursor;wx/cursor.h|" "wxCustomDataObject;wx/dataobj.h|" "wxDataFormat;wx/dataobj.h|" "wxDataInputStream;wx/datstrm.h|" "wxDataObject;wx/dataobj.h|" "wxDataObjectComposite;wx/dataobj.h|" "wxDataObjectSimple;wx/dataobj.h|" "wxDataOutputStream;wx/datstrm.h|" "wxDateEvent;wx/dateevt.h|" "wxDatePickerCtrl;wx/datectrl.h|" "wxDateSpan;wx/datetime.h|" "wxDateTime;wx/datetime.h|" "wxDb;wx/db.h|" "wxDbColDataPtr;wx/db.h|" "wxDbColDef;wx/db.h|" "wxDbColFor;wx/db.h|" "wxDbColInf;wx/db.h|" "wxDbConnectInf;wx/db.h|" "wxDbGridColInfo;wx/dbgrid.h|" "wxDbGridTableBase;wx/dbgrid.h|" "wxDbIdxDef;wx/db.h|" "wxDbInf;wx/db.h|" "wxDbTable;wx/dbtable.h|" "wxDbTableInf;wx/db.h|" "wxDC;wx/dc.h|" "wxDCClipper;wx/dc.h|" "wxDDEClient;wx/dde.h|" "wxDDEConnection;wx/dde.h|" "wxDDEServer;wx/dde.h|" "wxDebugContext;wx/memory.h|" "wxDebugReport;wx/debugrpt.h|" "wxDebugReportCompress;wx/debugrpt.h|" "wxDebugReportPreview;wx/debugrpt.h|" "wxDebugReportUpload;wx/debugrpt.h|" "wxDebugStreamBuf;wx/memory.h|" "wxDelegateRendererNative;wx/renderer.h|" "wxDialog;wx/dialog.h|" "wxDialUpEvent;wx/dialup.h|" "wxDialUpManager;wx/dialup.h|" "wxDir;wx/dir.h|" "wxDirDialog;wx/dirdlg.h|" "wxDirTraverser;wx/dir.h|" "wxDisplay;wx/display.h|" "wxDllLoader;wx/dynlib.h|" "wxDocChildFrame;wx/docview.h|" "wxDocManager;wx/docview.h|" "wxDocMDIChildFrame;wx/docmdi.h|" "wxDocMDIParentFrame;wx/docmdi.h|" "wxDocParentFrame;wx/docview.h|" "wxDocTemplate;wx/docview.h|" "wxDocument;wx/docview.h|" "wxDragImage;wx/dragimag.h|" "wxDragResult;wx/dnd.h|" "wxDropFilesEvent;wx/event.h|" "wxDropSource;wx/dnd.h|" "wxDropTarget;wx/dnd.h|" "wxDynamicLibrary;wx/dynlib.h|" "wxDynamicLibraryDetails;wx/dynlib.h|" "wxEncodingConverter;wx/encconv.h|" "wxEraseEvent;wx/event.h|" "wxEvent;wx/event.h|" "wxEvtHandler;wx/event.h|" "wxFFile;wx/ffile.h|" "wxFFileInputStream;wx/wfstream.h|" "wxFFileOutputStream;wx/wfstream.h|" "wxFFileStream;wx/wfstream.h|" "wxFile;wx/file.h|" "wxFileConfig;wx/fileconf.h|" "wxFileDataObject;wx/dataobj.h|" "wxFileDialog;wx/filedlg.h|" "wxFileDropTarget;wx/dnd.h|" "wxFileHistory;wx/docview.h|" "wxFileInputStream;wx/wfstream.h|" "wxFileName;wx/filename.h|" "wxFileOutputStream;wx/wfstream.h|" "wxFileStream;wx/wfstream.h|" "wxFileSystem;wx/filesys.h|" "wxFileSystemHandler;wx/filesys.h|" "wxFileType;wx/mimetype.h|" "wxFilterInputStream;wx/stream.h|" "wxFilterOutputStream;wx/stream.h|" "wxFindDialogEvent;wx/fdrepdlg.h|" "wxFindReplaceData;wx/fdrepdlg.h|" "wxFindReplaceDialog;wx/fdrepdlg.h|" "wxFinite;wx/math.h|" "wxFlexGridSizer;wx/sizer.h|" "wxFocusEvent;wx/event.h|" "wxFont;wx/font.h|" "wxFontData;wx/cmndata.h|" "wxFontDialog;wx/fontdlg.h|" "wxFontEnumerator;wx/fontenum.h|" "wxFontList;wx/gdicmn.h|" "wxFontMapper;wx/fontmap.h|" "wxFrame;wx/frame.h|" "wxFSFile;wx/filesys.h|" "wxFTP;wx/protocol/ftp.h|" "wxGauge;wx/gauge.h|" "wxGBPosition;wx/gbsizer.h|" "wxGBSizerItem;wx/gbsizer.h|" "wxGBSpan;wx/gbsizer.h|" "wxGDIObject;wx/gdiobj.h|" "wxGenericDirCtrl;wx/dirctrl.h|" "wxGenericValidator;wx/valgen.h|" "wxGetenv;wx/utils.h|" "wxGetVariantCast;wx/variant.h|" "wxGLCanvas;wx/glcanvas.h|" "wxGLContext;wx/glcanvas.h|" "wxGrid;wx/grid.h|" "wxGridBagSizer;wx/gbsizer.h|" "wxGridCellAttr;wx/grid.h|" "wxGridCellBoolEditor;wx/grid.h|" "wxGridCellBoolRenderer;wx/grid.h|" "wxGridCellChoiceEditor;wx/grid.h|" "wxGridCellEditor;wx/grid.h|" "wxGridCellFloatEditor;wx/grid.h|" "wxGridCellFloatRenderer;wx/grid.h|" "wxGridCellNumberEditor;wx/grid.h|" "wxGridCellNumberRenderer;wx/grid.h|" "wxGridCellRenderer;wx/grid.h|" "wxGridCellStringRenderer;wx/grid.h|" "wxGridCellTextEditor;wx/grid.h|" "wxGridEditorCreatedEvent;wx/grid.h|" "wxGridEvent;wx/grid.h|" "wxGridRangeSelectEvent;wx/grid.h|" "wxGridSizeEvent;wx/grid.h|" "wxGridSizer;wx/sizer.h|" "wxGridTableBase;wx/grid.h|" "wxHashMap;wx/hashmap.h|" "wxHashSet;wx/hashset.h|" "wxHashTable;wx/hash.h|" "wxHelpController;wx/help.h|" "wxHelpControllerHelpProvider;wx/cshelp.h|" "wxHelpEvent;wx/event.h|" "wxHelpProvider;wx/cshelp.h|" "wxHtmlCell;wx/html/htmlcell.h|" "wxHtmlColourCell;wx/html/htmlcell.h|" "wxHtmlContainerCell;wx/html/htmlcell.h|" "wxHtmlDCRenderer;wx/html/htmprint.h|" "wxHtmlEasyPrinting;wx/html/htmprint.h|" "wxHtmlFilter;wx/html/htmlfilt.h|" "wxHtmlHelpController;wx/html/helpctrl.h|" "wxHtmlHelpData;wx/html/helpdata.h|" "wxHtmlHelpFrame;wx/html/helpfrm.h|" "wxHtmlLinkInfo;wx/html/htmlcell.h|" "wxHtmlListBox;wx/htmllbox.h|" "wxHtmlParser;wx/html/htmlpars.h|" "wxHtmlPrintout;wx/html/htmprint.h|" "wxHtmlTag;wx/html/htmltag.h|" "wxHtmlTagHandler;wx/html/htmlpars.h|" "wxHtmlTagsModule;wx/html/winpars.h|" "wxHtmlWidgetCell;wx/html/htmlcell.h|" "wxHtmlWindow;wx/html/htmlwin.h|" "wxHtmlWinParser;wx/html/winpars.h|" "wxHtmlWinTagHandler;wx/html/winpars.h|" "wxHTTP;wx/protocol/http.h|" "wxIcon;wx/icon.h|" "wxIconBundle;wx/iconbndl.h|" "wxIconizeEvent;wx/event.h|" "wxIconLocation;wx/iconloc.h|" "wxIdleEvent;wx/event.h|" "wxImage;wx/image.h|" "wxImageHandler;wx/image.h|" "wxImageList;wx/imaglist.h|" "wxIndividualLayoutConstraint;wx/layout.h|" "wxInitDialogEvent;wx/event.h|" "wxInputStream;wx/stream.h|" "wxIPaddress;wx/socket.h|" "wxIPV4address;wx/socket.h|" "wxIsNaN;wx/math.h|" "wxJoystick;wx/joystick.h|" "wxJoystickEvent;wx/event.h|" "wxKeyEvent;wx/event.h|" "wxLayoutAlgorithm;wx/laywin.h|" "wxLayoutConstraints;wx/layout.h|" "wxList;wx/list.h|" "wxListbook;wx/listbook.h|" "wxListCtrl;wx/listctrl.h|" "wxListEvent;wx/listctrl.h|" "wxListItem;wx/listctrl.h|" "wxListItemAttr;wx/listctrl.h|" "wxListView;wx/listctrl.h|" "wxLocale;wx/intl.h|" "wxLog;wx/log.h|" "wxLogChain;wx/log.h|" "wxLogGui;wx/log.h|" "wxLogNull;wx/log.h|" "wxLogPassThrough;wx/log.h|" "wxLogStderr;wx/log.h|" "wxLogStream;wx/log.h|" "wxLogTextCtrl;wx/log.h|" "wxLogWindow;wx/log.h|" "wxLongLong;wx/longlong.h|" "wxLongLongFmtSpec;wx/longlong.h|" "wxMask;wx/bitmap.h|" "wxMaximizeEvent;wx/event.h|" "wxMBConv;wx/strconv.h|" "wxMBConvFile;wx/strconv.h|" "wxMBConvUTF16;wx/strconv.h|" "wxMBConvUTF32;wx/strconv.h|" "wxMBConvUTF7;wx/strconv.h|" "wxMBConvUTF8;wx/strconv.h|" "wxMDIChildFrame;wx/mdi.h|" "wxMDIClientWindow;wx/mdi.h|" "wxMDIParentFrame;wx/mdi.h|" "wxMediaCtrl;wx/mediactrl.h|" "wxMediaEvent;wx/mediactrl.h|" "wxMemoryBuffer;wx/buffer.h|" "wxMemoryDC;wx/dcmemory.h|" "wxMemoryFSHandler;wx/fs_mem.h|" "wxMemoryInputStream;wx/mstream.h|" "wxMemoryOutputStream;wx/mstream.h|" "wxMenu;wx/menu.h|" "wxMenuBar;wx/menu.h|" "wxMenuEvent;wx/event.h|" "wxMenuItem;wx/menuitem.h|" "wxMessageDialog;wx/msgdlg.h|" "wxMetafile;wx/metafile.h|" "wxMetafileDC;wx/metafile.h|" "wxMimeTypesManager;wx/mimetype.h|" "wxMiniFrame;wx/minifram.h|" "wxMirrorDC;wx/dcmirror.h|" "wxModule;wx/module.h|" "wxMouseCaptureChangedEvent;wx/event.h|" "wxMouseEvent;wx/event.h|" "wxMoveEvent;wx/event.h|" "wxMultiChoiceDialog;wx/choicdlg.h|" "wxMutex;wx/thread.h|" "wxMutexLocker;wx/thread.h|" "wxNode;wx/list.h|" "wxNotebook;wx/notebook.h|" "wxNotebookEvent;wx/notebook.h|" "wxNotebookSizer;wx/sizer.h|" "wxNotifyEvent;wx/event.h|" "wxObjArray;wx/dynarray.h|" "wxObject;wx/object.h|" "wxObjectRefData;wx/object.h|" "wxOpenErrorTraverser;wx/dir.h|" "wxOutputStream;wx/stream.h|" "wxPageSetupDialog;wx/printdlg.h|" "wxPageSetupDialogData;wx/cmndata.h|" "wxPaintDC;wx/dcclient.h|" "wxPaintEvent;wx/event.h|" "wxPalette;wx/palette.h|" "wxPanel;wx/panel.h|" "wxPaperSize;wx/cmndata.h|" "wxPasswordEntryDialog;wx/textdlg.h|" "wxPathList;wx/filefn.h|" "wxPen;wx/pen.h|" "wxPenList;wx/gdicmn.h|" "wxPoint;wx/gdicmn.h|" "wxPostScriptDC;wx/dcps.h|" "wxPreviewCanvas;wx/print.h|" "wxPreviewControlBar;wx/print.h|" "wxPreviewFrame;wx/print.h|" "wxPrintData;wx/cmndata.h|" "wxPrintDialog;wx/printdlg.h|" "wxPrintDialogData;wx/cmndata.h|" "wxPrinter;wx/print.h|" "wxPrinterDC;wx/dcprint.h|" "wxPrintout;wx/print.h|" "wxPrintPreview;wx/print.h|" "wxProcess;wx/process.h|" "wxProgressDialog;wx/progdlg.h|" "wxPropertySheetDialog;wx/propdlg.h|" "wxProtocol;wx/protocol/protocol.h|" "wxQuantize;wx/quantize.h|" "wxQueryLayoutInfoEvent;wx/laywin.h|" "wxRadioBox;wx/radiobox.h|" "wxRadioButton;wx/radiobut.h|" "wxRealPoint;wx/gdicmn.h|" "wxRect;wx/gdicmn.h|" "wxRecursionGuard;wx/recguard.h|" "wxRecursionGuardFlag;wx/recguard.h|" "wxRegEx;wx/regex.h|" "wxRegion;wx/region.h|" "wxRegionIterator;wx/region.h|" "wxRegKey;wx/msw/registry.h|" "wxRendererNative;wx/renderer.h|" "wxRendererVersion;wx/renderer.h|" "wxSashEvent;wx/sashwin.h|" "wxSashLayoutWindow;wx/laywin.h|" "wxSashWindow;wx/sashwin.h|" "wxScopedArray;wx/ptr_scpd.h|" "wxScopedPtr;wx/ptr_scpd.h|" "wxScopedTiedPtr;wx/ptr_scpd.h|" "wxScreenDC;wx/dcscreen.h|" "wxScrollBar;wx/scrolbar.h|" "wxScrolledWindow;wx/scrolwin.h|" "wxScrollEvent;wx/event.h|" "wxScrollWinEvent;wx/event.h|" "wxSemaphore;wx/thread.h|" "wxServer;wx/ipc.h|" "wxSetCursorEvent;wx/event.h|" "wxSetEnv;wx/utils.h|" "wxSimpleHelpProvider;wx/cshelp.h|" "wxSingleChoiceDialog;wx/choicdlg.h|" "wxSingleInstanceChecker;wx/snglinst.h|" "wxSize;wx/gdicmn.h|" "wxSizeEvent;wx/event.h|" "wxSizer;wx/sizer.h|" "wxSizerFlags;wx/sizer.h|" "wxSizerItem;wx/sizer.h|" "wxSlider;wx/slider.h|" "wxSockAddress;wx/socket.h|" "wxSocketBase;wx/socket.h|" "wxSocketClient;wx/socket.h|" "wxSocketEvent;wx/socket.h|" "wxSocketInputStream;wx/sckstrm.h|" "wxSocketOutputStream;wx/sckstrm.h|" "wxSocketServer;wx/socket.h|" "wxSound;wx/sound.h|" "wxSpinButton;wx/spinbutt.h|" "wxSpinCtrl;wx/spinctrl.h|" "wxSpinEvent;wx/spinctrl.h|" "wxSplashScreen;wx/splash.h|" "wxSplitterEvent;wx/splitter.h|" "wxSplitterRenderParams;wx/renderer.h|" "wxSplitterWindow;wx/splitter.h|" "wxStackFrame;wx/stackwalk.h|" "wxStackWalker;wx/stackwalk.h|" "wxStandardPaths;wx/stdpaths.h|" "wxStaticBitmap;wx/statbmp.h|" "wxStaticBox;wx/statbox.h|" "wxStaticLine;wx/statline.h|" "wxStaticText;wx/stattext.h|" "wxStatusBar;wx/statusbr.h|" "wxStdDialogButtonSizer;wx/sizer.h|" "wxStopWatch;wx/stopwatch.h|" "wxStreamBase;wx/stream.h|" "wxStreamBuffer;wx/stream.h|" "wxStreamToTextRedirector;wx/textctrl.h|" "wxString;wx/string.h|" "wxStringBuffer;wx/string.h|" "wxStringBufferLength;wx/string.h|" "wxStringClientData;clntdata.h|" "wxStringInputStream;wx/sstream.h|" "wxStringOutputStream;wx/sstream.h|" "wxStringTokenizer;wx/tokenzr.h|" "wxSystemOptions;wx/sysopt.h|" "wxSystemSettings;wx/settings.h|" "wxTaskBarIcon;wx/taskbar.h|" "wxTCPClient;wx/sckipc.h|" "wxTCPServer;wx/sckipc.h|" "wxTempFile;wx/file.h|" "wxTempFileOutputStream;wx/wfstream.h|" "wxTextAttr;wx/textctrl.h|" "wxTextCtrl;wx/textctrl.h|" "wxTextDataObject;wx/dataobj.h|" "wxTextDropTarget;wx/dnd.h|" "wxTextEntryDialog;wx/textdlg.h|" "wxTextFile;wx/textfile.h|" "wxTextInputStream;wx/txtstrm.h|" "wxTextOutputStream;wx/txtstrm.h|" "wxTextValidator;wx/valtext.h|" "wxTheClipboard;wx/clipbrd.h|" "wxThread;wx/thread.h|" "wxThreadHelper;wx/thread.h|" "wxTimer;wx/timer.h|" "wxTimerEvent;wx/timer.h|" "wxTimeSpan;wx/datetime.h|" "wxTipProvider;wx/tipdlg.h|" "wxTipWindow;wx/tipwin.h|" "wxToggleButton;wx/tglbtn.h|" "wxToolBar;wx/toolbar.h|" "wxToolTip;wx/tooltip.h|" "wxTopLevelWindow;wx/toplevel.h|" "wxTreeCtrl;wx/treectrl.h|" "wxTreeEvent;wx/treectrl.h|" "wxTreeItemData;wx/treectrl.h|" "wxUnsetEnv;wx/utils.h|" "wxUpdateUIEvent;wx/event.h|" "wxURI;wx/uri.h|" "wxURL;wx/url.h|" "wxVaCopy;wx/defs.h|" "wxValidator;wx/validate.h|" "wxVariant;wx/variant.h|" "wxVariantData;wx/variant.h|" "wxView;wx/docview.h|" "wxVListBox;wx/vlbox.h|" "wxVScrolledWindow;wx/vscroll.h|" "wxWindow;wx/window.h|" "wxWizard;wx/wizard.h|" "wxWizardEvent;wx/wizard.h|" "wxWizardPage;wx/wizard.h|" "wxWizardPageSimple;wx/wizard.h|" "wxXmlResource;wx/xrc/xmlres.h|" "wxXmlResourceHandler;wx/xrc/xmlres.h|" "wxZipClassFactory;wx/zipstrm.h|" "wxZipEntry;wx/zipstrm.h|" "wxZipInputStream;wx/zipstrm.h|" "wxZipNotifier;wx/zipstrm.h|" "wxZipOutputStream;wx/zipstrm.h|" "wxZlibInputStream;wx/zstream.h|" "wxZlibOutputStream;wx/zstream.h"); const wxArrayString arWxWidgets_2_6_4 = GetArrayFromString(strWxWidgets_2_6_4, _T("|")); for(std::size_t i = 0; i < arWxWidgets_2_6_4.GetCount(); ++i) { const wxArrayString arTmp = GetArrayFromString(arWxWidgets_2_6_4.Item(i), _T(";")); AddBinding(_T("wxWidgets_2_6_4"), arTmp.Item(0), arTmp.Item(1) ); } ///////////// // v 2.8.8 // ///////////// // All macros wxString strWxWidgets_2_8_8 = _T( "DECLARE_APP;wx/app.h|" "DECLARE_ABSTRACT_CLASS;wx/object.h|" "DECLARE_CLASS;wx/object.h|" "DECLARE_DYNAMIC_CLASS;wx/object.h|" "IMPLEMENT_APP;wx/app.h|" "IMPLEMENT_ABSTRACT_CLASS;wx/object.h|" "IMPLEMENT_ABSTRACT_CLASS2;wx/object.h|" "IMPLEMENT_CLASS;wx/object.h|" "IMPLEMENT_CLASS2;wx/object.h|" "IMPLEMENT_DYNAMIC_CLASS;wx/object.h|" "IMPLEMENT_DYNAMIC_CLASS2;wx/object.h|" "DECLARE_EVENT_TYPE;wx/event.h|" "DECLARE_EVENT_MACRO;wx/event.h|" "DECLARE_EVENT_TABLE_ENTRY;wx/event.h|" "DEFINE_EVENT_TYPE;wx/event.h|" "BEGIN_EVENT_TABLE;wx/event.h|" "END_EVENT_TABLE;wx/event.h|" "EVT_CUSTOM;wx/event.h|" "EVT_CUSTOM_RANGE;wx/event.h|" "EVT_COMMAND;wx/event.h|" "EVT_COMMAND_RANGE;wx/event.h|" "EVT_NOTIFY;wx/event.h|" "EVT_NOTIFY_RANGE;wx/event.h|" "EVT_BUTTON;wx/button.h|" "EVT_CHECKBOX;wx/checkbox.h|" "EVT_CHOICE;wx/choice.h|" "EVT_CHOICE;wx/choice.h|" "EVT_COMBOBOX;wx/combobox.h|" "EVT_LISTBOX;wx/listbox.h|" "EVT_LISTBOX_DCLICK;wx/listbox.h|" "EVT_RADIOBOX;wx/radiobox.h|" "EVT_RADIOBUTTON;wx/radiobut.h|" "EVT_SCROLLBAR;wx/scrolbar.h|" "EVT_SLIDER;wx/slider.h|" "EVT_TOGGLEBUTTON;wx/tglbtn.h|" "WX_APPEND_ARRAY;wx/dynarray.h|" "WX_PREPEND_ARRAY;wx/dynarray.h|" "WX_CLEAR_ARRAY;wx/dynarray.h|" "WX_DECLARE_OBJARRAY;wx/dynarray.h|" "WX_DEFINE_ARRAY;wx/dynarray.h|" "WX_DEFINE_OBJARRAY;wx/dynarray.h|" "WX_DEFINE_SORTED_ARRAY;wx/dynarray.h|" "WX_DECLARE_STRING_HASH_MAP;wx/hashmap.h|" "WX_DECLARE_HASH_MAP;wx/hashmap.h|" "wxASSERT;wx/debug.h|" "wxASSERT_MIN_BITSIZE;wx/debug.h|" "wxASSERT_MSG;wx/debug.h|" "wxBITMAP;wx/gdicmn.h|" "wxCOMPILE_TIME_ASSERT;wx/debug.h|" "wxCOMPILE_TIME_ASSERT2;wx/debug.h|" "wxCRIT_SECT_DECLARE;wx/thread.h|" "wxCRIT_SECT_DECLARE_MEMBER;wx/thread.h|" "wxCRIT_SECT_LOCKER;wx/thread.h|" "wxDYNLIB_FUNCTION;wx/dynlib.h|" "wxENTER_CRIT_SECT;wx/thread.h|" "wxFAIL;wx/debug.h|" "wxFAIL_MSG;wx/debug.h|" "wxICON;wx/gdicmn.h|" "wxLEAVE_CRIT_SECT;wx/thread.h|" "wxLL;wx/longlong.h|" "wxTRANSLATE;wx/intl.h|" "wxULL;wx/longlong.h|" // All ::wx methods "wxAboutBox;wx/aboutdlg.h|" "wxBeginBusyCursor;wx/utils.h|" "wxBell;wx/utils.h|" "wxClientDisplayRect;wx/gdicmn.h|" "wxClipboardOpen;wx/clipbrd.h|" "wxCloseClipboard;wx/clipbrd.h|" "wxColourDisplay;wx/gdicmn.h|" "wxConcatFiles;wx/filefn.h|" "wxCopyFile;wx/filefn.h|" "wxCreateDynamicObject;wx/object.h|" "wxCreateFileTipProvider;wx/tipdlg.h|" "wxDDECleanUp;wx/dde.h|" "wxDDEInitialize;wx/dde.h|" "wxDebugMsg;wx/utils.h|" "wxDirExists;wx/filefn.h|" "wxDirSelector;wx/dirdlg.h|" "wxDisplayDepth;wx/gdicmn.h|" "wxDisplaySize;wx/gdicmn.h|" "wxDisplaySizeMM;wx/gdicmn.h|" "wxDos2UnixFilename;wx/filefn.h|" "wxDROP_ICON;wx/dnd.h|" "wxEmptyClipboard;wx/clipbrd.h|" "wxEnableTopLevelWindows;wx/utils.h|" "wxEndBusyCursor;wx/utils.h|" "wxEntry;wx/app.h|" "wxEntryCleanup;wx/init.h|" "wxEntryStart;wx/init.h|" "wxEnumClipboardFormats;wx/clipbrd.h|" "wxError;wx/utils.h|" "wxExecute;wx/utils.h|" "wxExit;wx/app.h|" "wxFatalError;wx/utils.h|" "wxFileExists;wx/filefn.h|" "wxFileModificationTime;wx/filefn.h|" "wxFileNameFromPath;wx/filefn.h|" "wxFileSelector;wx/filedlg.h|" "wxFindFirstFile;wx/filefn.h|" "wxFindMenuItemId;wx/utils.h|" "wxFindNextFile;wx/filefn.h|" "wxFindWindowAtPoint;wx/utils.h|" "wxFindWindowAtPointer;wx/windows.h|" "wxFindWindowByLabel;wx/utils.h|" "wxFindWindowByName;wx/utils.h|" "wxGenericAboutBox;wx/aboutdlg.h\nwx/generic/aboutdlgg.h|" "wxGetActiveWindow;wx/windows.h|" "wxGetApp;wx/app.h|" "wxGetBatteryState;wx/utils.h|" "wxGetClipboardData;wx/clipbrd.h|" "wxGetClipboardFormatName;wx/clipbrd.h|" "wxGetColourFromUser;wx/colordlg.h|" "wxGetCwd;wx/filefn.h|" "wxGetDiskSpace;wx/filefn.h|" "wxGetDisplayName;wx/utils.h|" "wxGetElapsedTime;wx/timer.h|" "wxGetEmailAddress;wx/utils.h|" "wxGetFileKind;wx/filefn.h|" "wxGetFontFromUser;wx/fontdlg.h|" "wxGetFreeMemory;wx/utils.h|" "wxGetFullHostName;wx/utils.h|" "wxGetHomeDir;wx/utils.h|" "wxGetHostName;wx/utils.h|" "wxGetKeyState;wx/utils.h|" "wxGetLocalTime;wx/timer.h|" "wxGetLocalTimeMillis;wx/timer.h|" "wxGetMousePosition;wx/utils.h|" "wxGetMouseState;wx/utils.h|" "wxGetMultipleChoice;wx/choicdlg.h|" "wxGetMultipleChoices;wx/choicdlg.h|" "wxGetNumberFromUser;wx/numdlg.h|" "wxGetOsDescription;wx/utils.h|" "wxGetOSDirectory;wx/filefn.h|" "wxGetOsVersion;wx/utils.h|" "wxGetPasswordFromUser;wx/textdlg.h|" "wxGetPowerType;wx/utils.h|" "wxGetPrinterCommand;wx/dcps.h|" "wxGetPrinterFile;wx/dcps.h|" "wxGetPrinterMode;wx/dcps.h|" "wxGetPrinterOptions;wx/dcps.h|" "wxGetPrinterOrientation;wx/dcps.h|" "wxGetPrinterPreviewCommand;wx/dcps.h|" "wxGetPrinterScaling;wx/dcps.h|" "wxGetPrinterTranslation;wx/dcps.h|" "wxGetProcessId;wx/utils.h|" "wxGetResource;wx/utils.h|" "wxGetSingleChoice;wx/choicdlg.h|" "wxGetSingleChoiceData;wx/choicdlg.h|" "wxGetSingleChoiceIndex;wx/choicdlg.h|" "wxGetStockLabel;wx/stockitem.h|" "wxGetTempFileName;wx/filefn.h|" "wxGetTextFromUser;wx/textdlg.h|" "wxGetTopLevelParent;wx/window.h|" "wxGetTranslation;wx/intl.h|" "wxGetUserHome;wx/utils.h|" "wxGetUserId;wx/utils.h|" "wxGetUserName;wx/utils.h|" "wxGetUTCTime;wx/timer.h|" "wxGetWorkingDirectory;wx/filefn.h|" "wxHandleFatalExceptions;wx/app.h|" "wxInitAllImageHandlers;wx/image.h|" "wxInitialize;wx/app.h|" "wxIsAbsolutePath;wx/filefn.h|" "wxIsBusy;wx/utils.h|" "wxIsClipboardFormatAvailable;wx/clipbrd.h|" "wxIsDebuggerRunning;wx/debug.h|" "wxIsEmpty;wx/wxchar.h|" "wxIsMainThread;wx/thread.h|" "wxIsPlatform64Bit;wx/utils.h|" "wxIsPlatformLittleEndian;wx/utils.h|" "wxIsWild;wx/filefn.h|" "wxKill;wx/app.h|" "wxLaunchDefaultBrowser;wx/utils.h|" "wxLoadUserResource;wx/utils.h|" "wxLogDebug;wx/log.h|" "wxLogError;wx/log.h|" "wxLogFatalError;wx/log.h|" "wxLogMessage;wx/log.h|" "wxLogStatus;wx/log.h|" "wxLogSysError;wx/log.h|" "wxLogTrace;wx/log.h|" "wxLogVerbose;wx/log.h|" "wxLogWarning;wx/log.h|" "wxMakeMetafilePlaceable;wx/gdicmn.h|" "wxMatchWild;wx/filefn.h|" "wxMessageBox;wx/msgdlg.h|" "wxMicroSleep;wx/utils.h|" "wxMilliSleep;wx/utils.h|" "wxMkdir;wx/filefn.h|" "wxMutexGuiEnter;wx/thread.h|" "wxMutexGuiLeave;wx/thread.h|" "wxNewId;wx/utils.h|" "wxNow;wx/utils.h|" "wxOnAssert;wx/debug.h|" "wxOpenClipboard;wx/clipbrd.h|" "wxParseCommonDialogsFilter;wx/filefn.h|" "wxPathOnly;wx/filefn.h|" "wxPostDelete;wx/utils.h|" "wxPostEvent;wx/app.h|" "wxRegisterClipboardFormat;wx/clipbrd.h|" "wxRegisterId;wx/utils.h|" "wxRemoveFile;wx/filefn.h|" "wxRenameFile;wx/filefn.h|" "wxRmdir;wx/filefn.h|" "wxSafeShowMessage;wx/log.h|" "wxSafeYield;wx/utils.h|" "wxSetClipboardData;wx/clipbrd.h|" "wxSetCursor;wx/gdicmn.h|" "wxSetDisplayName;wx/utils.h|" "wxSetPrinterCommand;wx/dcps.h|" "wxSetPrinterFile;wx/dcps.h|" "wxSetPrinterMode;wx/dcps.h|" "wxSetPrinterOptions;wx/dcps.h|" "wxSetPrinterOrientation;wx/dcps.h|" "wxSetPrinterPreviewCommand;wx/dcps.h|" "wxSetPrinterScaling;wx/dcps.h|" "wxSetPrinterTranslation;wx/dcps.h|" "wxSetWorkingDirectory;wx/filefn.h|" "wxShell;wx/utils.h|" "wxShowTip;wx/tipdlg.h|" "wxShutdown;wx/utils.h|" "wxSleep;wx/utils.h|" "wxSnprintf;wx/wxchar.h|" "wxSplitPath;wx/filefn.h|" "wxStartTimer;wx/timer.h|" "wxStrcmp;wx/wxchar.h|" "wxStricmp;wx/wxchar.h|" "wxStringEq;wx/string.h|" "wxStringMatch;wx/string.h|" "wxStringTokenize;wx/string.h|" "wxStripMenuCodes;wx/utils.h|" "wxStrlen;wx/wxchar.h|" "wxSysErrorCode;wx/log.h|" "wxSysErrorMsg;wx/log.h|" "wxTrace;wx/memory.h|" "wxTraceLevel;wx/memory.h|" "wxTransferFileToStream;wx/docview.h|" "wxTransferStreamToFile;wx/docview.h|" "wxTrap;wx/debug.h|" "wxUninitialize;wx/app.h|" "wxUnix2DosFilename;wx/filefn.h|" "wxUsleep;wx/utils.h|" "wxVsnprintf;wx/wxchar.h|" "wxWakeUpIdle;wx/app.h|" "wxWriteResource;wx/utils.h|" "wxYield;wx/app.h|" // All ::wx classes "wxAboutDialogInfo;wx/aboutdlg.h|" "wxAcceleratorEntry;wx/accel.h|" "wxAcceleratorTable;wx/accel.h|" "wxAccessible;wx/access.h|" "wxActivateEvent;wx/event.h|" "wxActiveXContainer;wx/msw/ole/activex.h|" "wxActiveXEvent;wx/msw/ole/activex.h|" "wxAnimation;wx/animate.h|" "wxAnimationCtrl;wx/animate.h|" "wxApp;wx/app.h|" "wxAppTraits;wx/apptrait.h|" "wxArchiveClassFactory;wx/archive.h|" "wxArchiveEntry;wx/archive.h|" "wxArchiveInputStream;wx/archive.h|" "wxArchiveIterator;wx/archive.h|" "wxArchiveNotifier;wx/archive.h|" "wxArchiveOutputStream;wx/archive.h|" "wxArray;wx/dynarray.h|" "wxArrayString;wx/arrstr.h|" "wxArtProvider;wx/artprov.h|" "wxAuiDockArt;wx/aui/dockart.h|" "wxAuiTabArt;wx/aui/auibook.h|" "wxAuiManager;wx/aui/aui.h|" "wxAuiNotebook;wx/aui/auibook.h|" "wxAuiPaneInfo;wx/aui/aui.h|" "wxAutomationObject;wx/msw/ole/automtn.h|" "wxBitmap;wx/bitmap.h|" "wxBitmapButton;wx/bmpbuttn.h|" "wxBitmapComboBox;wx/bmpcbox.h|" "wxBitmapDataObject;wx/dataobj.h|" "wxBitmapHandler;wx/bitmap.h|" "wxBoxSizer;wx/sizer.h|" "wxBrush;wx/brush.h|" "wxBrushList;wx/gdicmn.h|" "wxBufferedDC;wx/dcbuffer.h|" "wxBufferedInputStream;wx/stream.h|" "wxBufferedOutputStream;wx/stream.h|" "wxBufferedPaintDC;wx/dcbuffer.h|" "wxBusyCursor;wx/utils.h|" "wxBusyInfo;wx/busyinfo.h|" "wxButton;wx/button.h|" "wxCalculateLayoutEvent;wx/laywin.h|" "wxCalendarCtrl;wx/calctrl.h|" "wxCalendarDateAttr;wx/calctrl.h|" "wxCalendarEvent;wx/calctrl.h|" "wxCaret;wx/caret.h|" "wxCheckBox;wx/checkbox.h|" "wxCheckListBox;wx/checklst.h|" "wxChildFocusEvent;wx/event.h|" "wxChoice;wx/choice.h|" "wxChoicebook;wx/choicebk.h|" "wxClassInfo;wx/object.h|" "wxClient;wx/ipc.h|" "wxClientData;wx/clntdata.h|" "wxClientDataContainer;wx/clntdata.h|" "wxClientDC;wx/dcclient.h|" "wxClipboard;wx/clipbrd.h|" "wxClipboardTextEvent;wx/event.h|" "wxCloseEvent;wx/event.h|" "wxCmdLineParser;wx/cmdline.h|" "wxCollapsiblePane;wx/collpane.h|" "wxCollapsiblePaneEvent;wx/collpane.h|" "wxColour;wx/colour.h|" "wxColourData;wx/cmndata.h|" "wxColourDatabase;wx/gdicmn.h|" "wxColourDialog;wx/colordlg.h|" "wxColourPickerCtrl;wx/clrpicker.h|" "wxColourPickerEvent;wx/clrpicker.h|" "wxComboBox;wx/combobox.h|" "wxComboCtrl;wx/combo.h|" "wxComboPopup;wx/combo.h|" "wxCommand;wx/cmdproc.h|" "wxCommandEvent;wx/event.h|" "wxCommandProcessor;wx/cmdproc.h|" "wxCondition;wx/thread.h|" "wxConfigBase;wx/config.h|" "wxConnection;wx/ipc.h|" "wxContextHelp;wx/cshelp.h|" "wxContextHelpButton;wx/cshelp.h|" "wxContextMenuEvent;wx/event.h|" "wxControl;wx/control.h|" "wxControlWithItems;wx/ctrlsub.h|" "wxCountingOutputStream;wx/stream.h|" "wxCriticalSection;wx/thread.h|" "wxCriticalSectionLocker;wx/thread.h|" "wxCSConv;wx/strconv.h|" "wxCursor;wx/cursor.h|" "wxCustomDataObject;wx/dataobj.h|" "wxDataFormat;wx/dataobj.h|" "wxDatagramSocket;wx/socket.h|" "wxDataInputStream;wx/datstrm.h|" "wxDataObject;wx/dataobj.h|" "wxDataObjectComposite;wx/dataobj.h|" "wxDataObjectSimple;wx/dataobj.h|" "wxDataOutputStream;wx/datstrm.h|" "wxDataViewColumn;wx/dataview.h|" "wxDataViewCtrl;wx/dataview.h|" "wxDataViewEvent;wx/dataview.h|" "wxDataViewListModelNotifier;wx/dataview.h|" "wxDataViewModel;wx/dataview.h|" "wxDataViewListModel;wx/dataview.h|" "wxDataViewSortedListModel;wx/dataview.h|" "wxDataViewRenderer;wx/dataview.h|" "wxDataViewTextRenderer;wx/dataview.h|" "wxDataViewProgressRenderer;wx/dataview.h|" "wxDataViewToggleRenderer;wx/dataview.h|" "wxDataViewBitmapRenderer;wx/dataview.h|" "wxDataViewDateRenderer;wx/dataview.h|" "wxDataViewCustomRenderer;wx/dataview.h|" "wxDateEvent;wx/dateevt.h|" "wxDatePickerCtrl;wx/datectrl.h|" "wxDateSpan;wx/datetime.h|" "wxDateTime;wx/datetime.h|" "wxDb;wx/db.h|" "wxDbColDataPtr;wx/db.h|" "wxDbColDef;wx/db.h|" "wxDbColFor;wx/db.h|" "wxDbColInf;wx/db.h|" "wxDbConnectInf;wx/db.h|" "wxDbGridColInfo;wx/dbgrid.h|" "wxDbGridTableBase;wx/dbgrid.h|" "wxDbIdxDef;wx/db.h|" "wxDbInf;wx/db.h|" "wxDbTable;wx/dbtable.h|" "wxDbTableInf;wx/db.h|" "wxDC;wx/dc.h|" "wxDCClipper;wx/dc.h|" "wxDDEClient;wx/dde.h|" "wxDDEConnection;wx/dde.h|" "wxDDEServer;wx/dde.h|" "wxDebugContext;wx/memory.h|" "wxDebugReport;wx/debugrpt.h|" "wxDebugReportCompress;wx/debugrpt.h|" "wxDebugReportPreview;wx/debugrpt.h|" "wxDebugReportPreviewStd;wx/debugrpt.h|" "wxDebugReportUpload;wx/debugrpt.h|" "wxDebugStreamBuf;wx/memory.h|" "wxDelegateRendererNative;wx/renderer.h|" "wxDialog;wx/dialog.h|" "wxDialUpEvent;wx/dialup.h|" "wxDialUpManager;wx/dialup.h|" "wxDir;wx/dir.h|" "wxDirDialog;wx/dirdlg.h|" "wxDirPickerCtrl;wx/filepicker.h|" "wxDirTraverser;wx/dir.h|" "wxDisplay;wx/display.h|" "wxDllLoader;wx/dynlib.h|" "wxDocChildFrame;wx/docview.h|" "wxDocManager;wx/docview.h|" "wxDocMDIChildFrame;wx/docmdi.h|" "wxDocMDIParentFrame;wx/docmdi.h|" "wxDocParentFrame;wx/docview.h|" "wxDocTemplate;wx/docview.h|" "wxDocument;wx/docview.h|" "wxDragImage;wx/dragimag.h|" "wxDragResult;wx/dnd.h|" "wxDropFilesEvent;wx/event.h|" "wxDropSource;wx/dnd.h|" "wxDropTarget;wx/dnd.h|" "wxDynamicLibrary;wx/dynlib.h|" "wxDynamicLibraryDetails;wx/dynlib.h|" "wxEncodingConverter;wx/encconv.h|" "wxEraseEvent;wx/event.h|" "wxEvent;wx/event.h|" "wxEvtHandler;wx/event.h|" "wxFFile;wx/ffile.h|" "wxFFileInputStream;wx/wfstream.h|" "wxFFileOutputStream;wx/wfstream.h|" "wxFFileStream;wx/wfstream.h|" "wxFile;wx/file.h|" "wxFileConfig;wx/fileconf.h|" "wxFileDataObject;wx/dataobj.h|" "wxFileDialog;wx/filedlg.h|" "wxFileDropTarget;wx/dnd.h|" "wxFileHistory;wx/docview.h|" "wxFileInputStream;wx/wfstream.h|" "wxFileName;wx/filename.h|" "wxFileOutputStream;wx/wfstream.h|" "wxFilePickerCtrl;wx/filepicker.h|" "wxFileDirPickerEvent;wx/filepicker.h|" "wxFileStream;wx/wfstream.h|" "wxFileSystem;wx/filesys.h|" "wxFileSystemHandler;wx/filesys.h|" "wxFileType;wx/mimetype.h|" "wxFilterClassFactory;wx/stream.h|" "wxFilterInputStream;wx/stream.h|" "wxFilterOutputStream;wx/stream.h|" "wxFindDialogEvent;wx/fdrepdlg.h|" "wxFindReplaceData;wx/fdrepdlg.h|" "wxFindReplaceDialog;wx/fdrepdlg.h|" "wxFinite;wx/math.h|" "wxFlexGridSizer;wx/sizer.h|" "wxFocusEvent;wx/event.h|" "wxFont;wx/font.h|" "wxFontData;wx/cmndata.h|" "wxFontDialog;wx/fontdlg.h|" "wxFontEnumerator;wx/fontenum.h|" "wxFontList;wx/gdicmn.h|" "wxFontMapper;wx/fontmap.h|" "wxFontPickerCtrl;wx/fontpicker.h|" "wxFontPickerEvent;wx/fontpicker.h|" "wxFrame;wx/frame.h|" "wxFSFile;wx/filesys.h|" "wxFTP;wx/protocol/ftp.h|" "wxGauge;wx/gauge.h|" "wxGBPosition;wx/gbsizer.h|" "wxGBSizerItem;wx/gbsizer.h|" "wxGBSpan;wx/gbsizer.h|" "wxGDIObject;wx/gdiobj.h|" "wxGenericDirCtrl;wx/dirctrl.h|" "wxGenericValidator;wx/valgen.h|" "wxGetenv;wx/utils.h|" "wxGetVariantCast;wx/variant.h|" "wxGLCanvas;wx/glcanvas.h|" "wxGLContext;wx/glcanvas.h|" "wxGraphicsBrush;wx/graphics.h|" "wxGraphicsContext;wx/graphics.h|" "wxGraphicsFont;wx/graphics.h|" "wxGraphicsMatrix;wx/graphics.h|" "wxGraphicsObject;wx/graphics.h|" "wxGraphicsPath;wx/graphics.h|" "wxGraphicsPen;wx/graphics.h|" "wxGraphicsRenderer;wx/graphics.h|" "wxGrid;wx/grid.h|" "wxGridBagSizer;wx/gbsizer.h|" "wxGridCellAttr;wx/grid.h|" "wxGridCellBoolEditor;wx/grid.h|" "wxGridCellBoolRenderer;wx/grid.h|" "wxGridCellChoiceEditor;wx/grid.h|" "wxGridCellEditor;wx/grid.h|" "wxGridCellRenderer;wx/grid.h|" "wxGridCellFloatEditor;wx/grid.h|" "wxGridCellFloatRenderer;wx/grid.h|" "wxGridCellNumberEditor;wx/grid.h|" "wxGridCellNumberRenderer;wx/grid.h|" "wxGridCellStringRenderer;wx/grid.h|" "wxGridCellTextEditor;wx/grid.h|" "wxGridEditorCreatedEvent;wx/grid.h|" "wxGridEvent;wx/grid.h|" "wxGridRangeSelectEvent;wx/grid.h|" "wxGridSizeEvent;wx/grid.h|" "wxGridSizer;wx/sizer.h|" "wxGridTableBase;wx/grid.h|" "wxHashMap;wx/hashmap.h|" "wxHashSet;wx/hashset.h|" "wxHashTable;wx/hash.h|" "wxHelpController;wx/help.h|" "wxHelpControllerHelpProvider;wx/cshelp.h|" "wxHelpEvent;wx/event.h|" "wxHelpProvider;wx/cshelp.h|" "wxHtmlCell;wx/html/htmlcell.h|" "wxHtmlCellEvent;wx/html/htmlwin.h|" "wxHtmlColourCell;wx/html/htmlcell.h|" "wxHtmlContainerCell;wx/html/htmlcell.h|" "wxHtmlDCRenderer;wx/html/htmprint.h|" "wxHtmlEasyPrinting;wx/html/htmprint.h|" "wxHtmlFilter;wx/html/htmlfilt.h|" "wxHtmlHelpController;wx/html/helpctrl.h|" "wxHtmlHelpData;wx/html/helpdata.h|" "wxHtmlHelpDialog;wx/html/helpdlg.h|" "wxHtmlHelpFrame;wx/html/helpfrm.h|" "wxHtmlHelpWindow;wx/html/helpwnd.h|" "wxHtmlModalHelp;wx/html/helpctrl.h|" "wxHtmlLinkInfo;wx/html/htmlcell.h|" "wxHtmlLinkEvent;wx/html/htmlwin.h|" "wxHtmlListBox;wx/htmllbox.h|" "wxHtmlParser;wx/html/htmlpars.h|" "wxHtmlPrintout;wx/html/htmprint.h|" "wxHtmlTag;wx/html/htmltag.h|" "wxHtmlTagHandler;wx/html/htmlpars.h|" "wxHtmlTagsModule;wx/html/winpars.h|" "wxHtmlWidgetCell;wx/html/htmlcell.h|" "wxHtmlWindow;wx/html/htmlwin.h|" "wxHtmlWinParser;wx/html/winpars.h|" "wxHtmlWinTagHandler;wx/html/winpars.h|" "wxHTTP;wx/protocol/http.h|" "wxHyperlinkCtrl;wx/hyperlink.h|" "wxHyperlinkEvent;wx/hyperlink.h|" "wxIcon;wx/icon.h|" "wxIconBundle;wx/iconbndl.h|" "wxIconizeEvent;wx/event.h|" "wxIconLocation;wx/iconloc.h|" "wxIdleEvent;wx/event.h|" "wxImage;wx/image.h|" "wxImageHandler;wx/image.h|" "wxImageList;wx/imaglist.h|" "wxIndividualLayoutConstraint;wx/layout.h|" "wxInitDialogEvent;wx/event.h|" "wxInputStream;wx/stream.h|" "wxIPaddress;wx/socket.h|" "wxIPV4address;wx/socket.h|" "wxIsNaN;wx/math.h|" "wxJoystick;wx/joystick.h|" "wxJoystickEvent;wx/event.h|" "wxKeyEvent;wx/event.h|" "wxLayoutAlgorithm;wx/laywin.h|" "wxLayoutConstraints;wx/layout.h|" "wxList;wx/list.h|" "wxListbook;wx/listbook.h|" "wxListBox;wx/listbox.h|" "wxListCtrl;wx/listctrl.h|" "wxListEvent;wx/listctrl.h|" "wxListItem;wx/listctrl.h|" "wxListItemAttr;wx/listctrl.h|" "wxListView;wx/listctrl.h|" "wxLocale;wx/intl.h|" "wxLog;wx/log.h|" "wxLogChain;wx/log.h|" "wxLogGui;wx/log.h|" "wxLogNull;wx/log.h|" "wxLogPassThrough;wx/log.h|" "wxLogStderr;wx/log.h|" "wxLogStream;wx/log.h|" "wxLogTextCtrl;wx/log.h|" "wxLogWindow;wx/log.h|" "wxLongLong;wx/longlong.h|" "wxLongLongFmtSpec;wx/longlong.h|" "wxMask;wx/bitmap.h|" "wxMaximizeEvent;wx/event.h|" "wxMBConv;wx/strconv.h|" "wxMBConvFile;wx/strconv.h|" "wxMBConvUTF16;wx/strconv.h|" "wxMBConvUTF32;wx/strconv.h|" "wxMBConvUTF7;wx/strconv.h|" "wxMBConvUTF8;wx/strconv.h|" "wxMDIChildFrame;wx/mdi.h|" "wxMDIClientWindow;wx/mdi.h|" "wxMDIParentFrame;wx/mdi.h|" "wxMediaCtrl;wx/mediactrl.h|" "wxMediaEvent;wx/mediactrl.h|" "wxMemoryBuffer;wx/buffer.h|" "wxMemoryDC;wx/dcmemory.h|" "wxMemoryFSHandler;wx/fs_mem.h|" "wxMemoryInputStream;wx/mstream.h|" "wxMemoryOutputStream;wx/mstream.h|" "wxMenu;wx/menu.h|" "wxMenuBar;wx/menu.h|" "wxMenuEvent;wx/event.h|" "wxMenuItem;wx/menuitem.h|" "wxMessageDialog;wx/msgdlg.h|" "wxMetafile;wx/metafile.h|" "wxMetafileDC;wx/metafile.h|" "wxMimeTypesManager;wx/mimetype.h|" "wxMiniFrame;wx/minifram.h|" "wxMirrorDC;wx/dcmirror.h|" "wxModule;wx/module.h|" "wxMouseCaptureChangedEvent;wx/event.h|" "wxMouseCaptureLostEvent;wx/event.h|" "wxMouseEvent;wx/event.h|" "wxMoveEvent;wx/event.h|" "wxMultiChoiceDialog;wx/choicdlg.h|" "wxMutex;wx/thread.h|" "wxMutexLocker;wx/thread.h|" "wxNode;wx/list.h|" "wxNotebook;wx/notebook.h|" "wxNotebookEvent;wx/notebook.h|" "wxNotebookSizer;wx/sizer.h|" "wxNotifyEvent;wx/event.h|" "wxObjArray;wx/dynarray.h|" "wxObject;wx/object.h|" "wxObjectRefData;wx/object.h|" "wxOpenErrorTraverser;wx/dir.h|" "wxOutputStream;wx/stream.h|" "wxOwnerDrawnComboBox;wx/odcombo.h|" "wxPageSetupDialog;wx/printdlg.h|" "wxPageSetupDialogData;wx/cmndata.h|" "wxPaintDC;wx/dcclient.h|" "wxPaintEvent;wx/event.h|" "wxPalette;wx/palette.h|" "wxPanel;wx/panel.h|" "wxPaperSize;wx/cmndata.h|" "wxPasswordEntryDialog;wx/textdlg.h|" "wxPathList;wx/filefn.h|" "wxPen;wx/pen.h|" "wxPenList;wx/gdicmn.h|" "wxPickerBase;wx/pickerbase.h|" "wxPlatformInfo;wx/platinfo.h|" "wxPoint;wx/gdicmn.h|" "wxPostScriptDC;wx/dcps.h|" "wxPowerEvent;wx/power.h|" "wxPreviewCanvas;wx/print.h|" "wxPreviewControlBar;wx/print.h|" "wxPreviewFrame;wx/print.h|" "wxPrintData;wx/cmndata.h|" "wxPrintDialog;wx/printdlg.h|" "wxPrintDialogData;wx/cmndata.h|" "wxPrinter;wx/print.h|" "wxPrinterDC;wx/dcprint.h|" "wxPrintout;wx/print.h|" "wxPrintPreview;wx/print.h|" "wxProcess;wx/process.h|" "wxProcessEvent;wx/process.h|" "wxProgressDialog;wx/progdlg.h|" "wxPropertySheetDialog;wx/propdlg.h|" "wxProtocol;wx/protocol/protocol.h|" "wxQuantize;wx/quantize.h|" "wxQueryLayoutInfoEvent;wx/laywin.h|" "wxRadioBox;wx/radiobox.h|" "wxRadioButton;wx/radiobut.h|" "wxRealPoint;wx/gdicmn.h|" "wxRect;wx/gdicmn.h|" "wxRecursionGuard;wx/recguard.h|" "wxRecursionGuardFlag;wx/recguard.h|" "wxRegEx;wx/regex.h|" "wxRegion;wx/region.h|" "wxRegionIterator;wx/region.h|" "wxRegKey;wx/msw/registry.h|" "wxRendererNative;wx/renderer.h|" "wxRendererVersion;wx/renderer.h|" "wxRichTextAttr;wx/richtext/richtextbuffer.h|" "wxRichTextBuffer;wx/richtext/richtextbuffer.h|" "wxRichTextCharacterStyleDefinition;wx/richtext/richtextstyles.h|" "wxRichTextCtrl;wx/richtext/richtextctrl.h|" "wxRichTextEvent;wx/richtext/richtextctrl.h|" "wxRichTextFileHandler;wx/richtext/richtextbuffer.h|" "wxRichTextFormattingDialog;wx/richtext/richtextformatdlg.h|" "wxRichTextFormattingDialogFactory;wx/richtext/richtextformatdlg.h|" "wxRichTextHeaderFooterData;wx/richtext/richtextprint.h|" "wxRichTextHTMLHandler;wx/richtext/richtexthtml.h|" "wxRichTextListStyleDefinition;wx/richtext/richtextstyles.h|" "wxRichTextParagraphStyleDefinition;wx/richtext/richtextstyles.h|" "wxRichTextPrinting;wx/richtext/richtextprint.h|" "wxRichTextPrintout;wx/richtext/richtextprint.h|" "wxRichTextRange;wx/richtext/richtextbuffer.h|" "wxRichTextStyleDefinition;wx/richtext/richtextstyles.h|" "wxRichTextStyleComboCtrl;wx/richtext/richtextstyles.h|" "wxRichTextStyleListBox;wx/richtext/richtextstyles.h|" "wxRichTextStyleListCtrl;wx/richtext/richtextstyles.h|" "wxRichTextStyleOrganiserDialog;wx/richtext/richtextstyledlg.h|" "wxRichTextStyleSheet;wx/richtext/richtextstyles.h|" "wxRichTextXMLHandler;wx/richtext/richtextxml.h|" "wxSashEvent;wx/sashwin.h|" "wxSashLayoutWindow;wx/laywin.h|" "wxSashWindow;wx/sashwin.h|" "wxScopedArray;wx/ptr_scpd.h|" "wxScopedPtr;wx/ptr_scpd.h|" "wxScopedTiedPtr;wx/ptr_scpd.h|" "wxScreenDC;wx/dcscreen.h|" "wxScrollBar;wx/scrolbar.h|" "wxScrolledWindow;wx/scrolwin.h|" "wxScrollEvent;wx/event.h|" "wxScrollWinEvent;wx/event.h|" "wxSearchCtrl;wx/srchctrl.h|" "wxSemaphore;wx/thread.h|" "wxServer;wx/ipc.h|" "wxSetCursorEvent;wx/event.h|" "wxSetEnv;wx/utils.h|" "wxSimpleHelpProvider;wx/cshelp.h|" "wxSimpleHtmlListBox;wx/htmllbox.h|" "wxSingleChoiceDialog;wx/choicdlg.h|" "wxSingleInstanceChecker;wx/snglinst.h|" "wxSize;wx/gdicmn.h|" "wxSizeEvent;wx/event.h|" "wxSizer;wx/sizer.h|" "wxSizerFlags;wx/sizer.h|" "wxSizerItem;wx/sizer.h|" "wxSlider;wx/slider.h|" "wxSockAddress;wx/socket.h|" "wxSocketBase;wx/socket.h|" "wxSocketClient;wx/socket.h|" "wxSocketEvent;wx/socket.h|" "wxSocketInputStream;wx/sckstrm.h|" "wxSocketOutputStream;wx/sckstrm.h|" "wxSocketServer;wx/socket.h|" "wxSound;wx/sound.h|" "wxSpinButton;wx/spinbutt.h|" "wxSpinCtrl;wx/spinctrl.h|" "wxSpinEvent;wx/spinctrl.h|" "wxSplashScreen;wx/splash.h|" "wxSplitterEvent;wx/splitter.h|" "wxSplitterRenderParams;wx/renderer.h|" "wxSplitterWindow;wx/splitter.h|" "wxStackFrame;wx/stackwalk.h|" "wxStackWalker;wx/stackwalk.h|" "wxStandardPaths;wx/stdpaths.h|" "wxStaticBitmap;wx/statbmp.h|" "wxStaticBox;wx/statbox.h|" "wxStaticBoxSizer;wx/sizer.h|" "wxStaticLine;wx/statline.h|" "wxStaticText;wx/stattext.h|" "wxStatusBar;wx/statusbr.h|" "wxStdDialogButtonSizer;wx/sizer.h|" "wxStopWatch;wx/stopwatch.h|" "wxStreamBase;wx/stream.h|" "wxStreamBuffer;wx/stream.h|" "wxStreamToTextRedirector;wx/textctrl.h|" "wxString;wx/string.h|" "wxStringBuffer;wx/string.h|" "wxStringBufferLength;wx/string.h|" "wxStringClientData;clntdata.h|" "wxStringInputStream;wx/sstream.h|" "wxStringOutputStream;wx/sstream.h|" "wxStringTokenizer;wx/tokenzr.h|" "wxSymbolPickerDialog;wx/richtext/richtextsymboldlg.h|" "wxSysColourChangedEvent;wx/event.h|" "wxSystemOptions;wx/sysopt.h|" "wxSystemSettings;wx/settings.h|" "wxTarClassFactory;wx/tarstrm.h|" "wxTarEntry;wx/tarstrm.h|" "wxTarInputStream;wx/tarstrm.h|" "wxTarOutputStream;wx/tarstrm.h|" "wxTaskBarIcon;wx/taskbar.h|" "wxTCPClient;wx/sckipc.h|" "wxTCPServer;wx/sckipc.h|" "wxTempFile;wx/file.h|" "wxTempFileOutputStream;wx/wfstream.h|" "wxTextAttr;wx/textctrl.h|" "wxTextAttrEx;wx/richtext/richtextbuffer.h|" "wxTextCtrl;wx/textctrl.h|" "wxTextDataObject;wx/dataobj.h|" "wxTextDropTarget;wx/dnd.h|" "wxTextEntryDialog;wx/textdlg.h|" "wxTextFile;wx/textfile.h|" "wxTextInputStream;wx/txtstrm.h|" "wxTextOutputStream;wx/txtstrm.h|" "wxTextValidator;wx/valtext.h|" "wxTheClipboard;wx/clipbrd.h|" "wxThread;wx/thread.h|" "wxThreadHelper;wx/thread.h|" "wxTimer;wx/timer.h|" "wxTimerEvent;wx/timer.h|" "wxTimeSpan;wx/datetime.h|" "wxTipProvider;wx/tipdlg.h|" "wxTipWindow;wx/tipwin.h|" "wxToggleButton;wx/tglbtn.h|" "wxToolBar;wx/toolbar.h|" "wxToolbook;wx/toolbook.h|" "wxToolTip;wx/tooltip.h|" "wxTopLevelWindow;wx/toplevel.h|" "wxTreebook;wx/treebook.h|" "wxTreebookEvent;wx/treebook.h|" "wxTreeCtrl;wx/treectrl.h|" "wxTreeEvent;wx/treectrl.h|" "wxTreeItemData;wx/treectrl.h|" "wxTreeItemId;wx/treebase.h|" "wxUnsetEnv;wx/utils.h|" "wxUpdateUIEvent;wx/event.h|" "wxURI;wx/uri.h|" "wxURL;wx/url.h|" "wxURLDataObject;wx/dataobj.h|" "wxVaCopy;wx/defs.h|" "wxValidator;wx/validate.h|" "wxVariant;wx/variant.h|" "wxVariantData;wx/variant.h|" "wxView;wx/docview.h|" "wxVListBox;wx/vlbox.h|" "wxVScrolledWindow;wx/vscroll.h|" "wxWindow;wx/window.h|" "wxWindowUpdateLocker;wx/wupdlock.h|" "wxWindowCreateEvent;wx/event.h|" "wxWindowDC;wx/dcclient.h|" "wxWindowDestroyEvent;wx/event.h|" "wxWindowDisabler;wx/utils.h|" "wxWizard;wx/wizard.h|" "wxWizardEvent;wx/wizard.h|" "wxWizardPage;wx/wizard.h|" "wxWizardPageSimple;wx/wizard.h|" "wxXmlDocument;wx/xml/xml.h|" "wxXmlNode;wx/xml/xml.h|" "wxXmlProperty;wx/xml/xml.h|" "wxXmlResource;wx/xrc/xmlres.h|" "wxXmlResourceHandler;wx/xrc/xmlres.h|" "wxZipClassFactory;wx/zipstrm.h|" "wxZipEntry;wx/zipstrm.h|" "wxZipInputStream;wx/zipstrm.h|" "wxZipNotifier;wx/zipstrm.h|" "wxZipOutputStream;wx/zipstrm.h|" "wxZlibInputStream;wx/zstream.h|" "wxZlibOutputStream;wx/zstream.h"); const wxArrayString arWxWidgets_2_8_8 = GetArrayFromString(strWxWidgets_2_8_8, _T("|")); for(std::size_t i = 0; i < arWxWidgets_2_8_8.GetCount(); ++i) { const wxArrayString arTmp = GetArrayFromString(arWxWidgets_2_8_8.Item(i), _T(";")); AddBinding(_T("wxWidgets_2_8_8"), arTmp.Item(0), arTmp.Item(1) ); } }// SetDefaultsWxWidgets void Bindings::SetDefaultsSTL() { AddBinding(_T("STL"),_T("adjacent_find"), _T("algorithm")); AddBinding(_T("STL"),_T("binary_search"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_copy_backward"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_fill_n"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_generate_n"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_merge"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_remove_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_remove_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_replace_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_replace_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_reverse_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_rotate_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_set_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_set_intersection"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_set_symmetric_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_set_union"), _T("algorithm")); AddBinding(_T("STL"),_T("checked_unique_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("copy"), _T("algorithm")); AddBinding(_T("STL"),_T("copy_backward"), _T("algorithm")); AddBinding(_T("STL"),_T("count"), _T("algorithm")); AddBinding(_T("STL"),_T("count_if"), _T("algorithm")); AddBinding(_T("STL"),_T("equal"), _T("algorithm")); AddBinding(_T("STL"),_T("equal_range"), _T("algorithm")); AddBinding(_T("STL"),_T("fill"), _T("algorithm")); AddBinding(_T("STL"),_T("fill_n"), _T("algorithm")); AddBinding(_T("STL"),_T("find"), _T("algorithm")); AddBinding(_T("STL"),_T("find_end"), _T("algorithm")); AddBinding(_T("STL"),_T("find_first_of"), _T("algorithm")); AddBinding(_T("STL"),_T("find_if"), _T("algorithm")); AddBinding(_T("STL"),_T("for_each"), _T("algorithm")); AddBinding(_T("STL"),_T("generate"), _T("algorithm")); AddBinding(_T("STL"),_T("generate_n"), _T("algorithm")); AddBinding(_T("STL"),_T("includes"), _T("algorithm")); AddBinding(_T("STL"),_T("inplace_merge"), _T("algorithm")); AddBinding(_T("STL"),_T("iter_swap"), _T("algorithm")); AddBinding(_T("STL"),_T("lexicographical_compare"), _T("algorithm")); AddBinding(_T("STL"),_T("lower_bound"), _T("algorithm")); AddBinding(_T("STL"),_T("make_heap"), _T("algorithm")); AddBinding(_T("STL"),_T("max"), _T("algorithm")); AddBinding(_T("STL"),_T("max_element"), _T("algorithm")); AddBinding(_T("STL"),_T("merge"), _T("algorithm")); AddBinding(_T("STL"),_T("min"), _T("algorithm")); AddBinding(_T("STL"),_T("min_element"), _T("algorithm")); AddBinding(_T("STL"),_T("mismatch"), _T("algorithm")); AddBinding(_T("STL"),_T("next_permutation"), _T("algorithm")); AddBinding(_T("STL"),_T("nth_element"), _T("algorithm")); AddBinding(_T("STL"),_T("partial_sort"), _T("algorithm")); AddBinding(_T("STL"),_T("partial_sort_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("partition"), _T("algorithm")); AddBinding(_T("STL"),_T("pop_heap"), _T("algorithm")); AddBinding(_T("STL"),_T("prev_permutation"), _T("algorithm")); AddBinding(_T("STL"),_T("push_heap"), _T("algorithm")); AddBinding(_T("STL"),_T("random_shuffle"), _T("algorithm")); AddBinding(_T("STL"),_T("remove"), _T("algorithm")); AddBinding(_T("STL"),_T("remove_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("remove_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("remove_if"), _T("algorithm")); AddBinding(_T("STL"),_T("replace"), _T("algorithm")); AddBinding(_T("STL"),_T("replace_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("replace_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("replace_if"), _T("algorithm")); AddBinding(_T("STL"),_T("reverse"), _T("algorithm")); AddBinding(_T("STL"),_T("reverse_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("rotate"), _T("algorithm")); AddBinding(_T("STL"),_T("rotate_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("search"), _T("algorithm")); AddBinding(_T("STL"),_T("search_n"), _T("algorithm")); AddBinding(_T("STL"),_T("set_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("set_intersection"), _T("algorithm")); AddBinding(_T("STL"),_T("set_symmetric_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("set_union"), _T("algorithm")); AddBinding(_T("STL"),_T("sort"), _T("algorithm")); AddBinding(_T("STL"),_T("sort_heap"), _T("algorithm")); AddBinding(_T("STL"),_T("stable_partition"), _T("algorithm")); AddBinding(_T("STL"),_T("stable_sort"), _T("algorithm")); AddBinding(_T("STL"),_T("swap"), _T("algorithm")); AddBinding(_T("STL"),_T("swap_ranges"), _T("algorithm")); AddBinding(_T("STL"),_T("transform"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_copy_backward"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_fill_n"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_generate_n"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_merge"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_remove_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_remove_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_replace_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_replace_copy_if"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_reverse_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_rotate_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_set_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_set_intersection"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_set_symmetric_difference"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_set_union"), _T("algorithm")); AddBinding(_T("STL"),_T("unchecked_unique_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("unique"), _T("algorithm")); AddBinding(_T("STL"),_T("unique_copy"), _T("algorithm")); AddBinding(_T("STL"),_T("upper_bound"), _T("algorithm")); AddBinding(_T("STL"),_T("bitset"), _T("bitset")); AddBinding(_T("STL"),_T("arg"), _T("complex")); AddBinding(_T("STL"),_T("complex"), _T("complex")); AddBinding(_T("STL"),_T("conj"), _T("complex")); AddBinding(_T("STL"),_T("imag"), _T("complex")); AddBinding(_T("STL"),_T("norm"), _T("complex")); AddBinding(_T("STL"),_T("polar"), _T("complex")); AddBinding(_T("STL"),_T("real"), _T("complex")); AddBinding(_T("STL"),_T("deque"), _T("deque")); AddBinding(_T("STL"),_T("bad_exception"), _T("exception")); AddBinding(_T("STL"),_T("exception"), _T("exception")); AddBinding(_T("STL"),_T("set_terminate"), _T("exception")); AddBinding(_T("STL"),_T("set_unexpected"), _T("exception")); AddBinding(_T("STL"),_T("terminate"), _T("exception")); AddBinding(_T("STL"),_T("terminate_handler"), _T("exception")); AddBinding(_T("STL"),_T("uncaught_exception"), _T("exception")); AddBinding(_T("STL"),_T("unexpected"), _T("exception")); AddBinding(_T("STL"),_T("unexpected_handler"), _T("exception")); AddBinding(_T("STL"),_T("basic_filebuf"), _T("fstream")); AddBinding(_T("STL"),_T("basic_fstream"), _T("fstream")); AddBinding(_T("STL"),_T("basic_ifstream"), _T("fstream")); AddBinding(_T("STL"),_T("basic_ofstream"), _T("fstream")); AddBinding(_T("STL"),_T("filebuf"), _T("fstream")); AddBinding(_T("STL"),_T("fstream"), _T("fstream")); AddBinding(_T("STL"),_T("ifstream"), _T("fstream")); AddBinding(_T("STL"),_T("ofstream"), _T("fstream")); AddBinding(_T("STL"),_T("wfilebuf"), _T("fstream")); AddBinding(_T("STL"),_T("wfstream"), _T("fstream")); AddBinding(_T("STL"),_T("wifstream"), _T("fstream")); AddBinding(_T("STL"),_T("wofstream"), _T("fstream")); AddBinding(_T("STL"),_T("binary_function"), _T("functional")); AddBinding(_T("STL"),_T("binary_negate"), _T("functional")); AddBinding(_T("STL"),_T("bind1st"), _T("functional")); AddBinding(_T("STL"),_T("bind2nd"), _T("functional")); AddBinding(_T("STL"),_T("binder1st"), _T("functional")); AddBinding(_T("STL"),_T("binder2nd"), _T("functional")); AddBinding(_T("STL"),_T("const_mem_fun_ref_t"), _T("functional")); AddBinding(_T("STL"),_T("const_mem_fun_t"), _T("functional")); AddBinding(_T("STL"),_T("const_mem_fun1_ref_t"), _T("functional")); AddBinding(_T("STL"),_T("const_mem_fun1_t"), _T("functional")); AddBinding(_T("STL"),_T("divides"), _T("functional")); AddBinding(_T("STL"),_T("equal_to"), _T("functional")); AddBinding(_T("STL"),_T("greater"), _T("functional")); AddBinding(_T("STL"),_T("greater_equal"), _T("functional")); AddBinding(_T("STL"),_T("less"), _T("functional")); AddBinding(_T("STL"),_T("less_equal"), _T("functional")); AddBinding(_T("STL"),_T("logical_and"), _T("functional")); AddBinding(_T("STL"),_T("logical_not"), _T("functional")); AddBinding(_T("STL"),_T("logical_or"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun_ref"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun_ref_t"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun_t"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun1_ref_t"), _T("functional")); AddBinding(_T("STL"),_T("mem_fun1_t"), _T("functional")); AddBinding(_T("STL"),_T("minus"), _T("functional")); AddBinding(_T("STL"),_T("modulus"), _T("functional")); AddBinding(_T("STL"),_T("multiplies"), _T("functional")); AddBinding(_T("STL"),_T("negate"), _T("functional")); AddBinding(_T("STL"),_T("not_equal_to"), _T("functional")); AddBinding(_T("STL"),_T("not1"), _T("functional")); AddBinding(_T("STL"),_T("not2"), _T("functional")); AddBinding(_T("STL"),_T("plus"), _T("functional")); AddBinding(_T("STL"),_T("pointer_to_binary_function"), _T("functional")); AddBinding(_T("STL"),_T("pointer_to_unary_function"), _T("functional")); AddBinding(_T("STL"),_T("ptr_fun"), _T("functional")); AddBinding(_T("STL"),_T("unary_function"), _T("functional")); AddBinding(_T("STL"),_T("unary_negate"), _T("functional")); AddBinding(_T("STL"),_T("hash_compare"), _T("hash_map")); AddBinding(_T("STL"),_T("hash_map"), _T("hash_map")); AddBinding(_T("STL"),_T("hash_multimap"), _T("hash_map")); AddBinding(_T("STL"),_T("value_compare"), _T("hash_map")); AddBinding(_T("STL"),_T("hash_multiset"), _T("hash_set")); AddBinding(_T("STL"),_T("hash_set"), _T("hash_set")); AddBinding(_T("STL"),_T("get_money"), _T("iomanip")); AddBinding(_T("STL"),_T("get_time"), _T("iomanip")); AddBinding(_T("STL"),_T("put_money"), _T("iomanip")); AddBinding(_T("STL"),_T("put_time"), _T("iomanip")); AddBinding(_T("STL"),_T("resetiosflags"), _T("iomanip")); AddBinding(_T("STL"),_T("setbase"), _T("iomanip")); AddBinding(_T("STL"),_T("setfill"), _T("iomanip")); AddBinding(_T("STL"),_T("setiosflags"), _T("iomanip")); AddBinding(_T("STL"),_T("setprecision"), _T("iomanip")); AddBinding(_T("STL"),_T("setw"), _T("iomanip")); AddBinding(_T("STL"),_T("cerr"), _T("iostream")); AddBinding(_T("STL"),_T("cin"), _T("iostream")); AddBinding(_T("STL"),_T("clog"), _T("iostream")); AddBinding(_T("STL"),_T("cout"), _T("iostream")); AddBinding(_T("STL"),_T("endl"), _T("iostream")); AddBinding(_T("STL"),_T("istream"), _T("iostream")); AddBinding(_T("STL"),_T("ostream"), _T("iostream")); AddBinding(_T("STL"),_T("wcerr"), _T("iostream")); AddBinding(_T("STL"),_T("wcin"), _T("iostream")); AddBinding(_T("STL"),_T("wclog"), _T("iostream")); AddBinding(_T("STL"),_T("wcout"), _T("iostream")); AddBinding(_T("STL"),_T("advance"), _T("iterator")); AddBinding(_T("STL"),_T("back_inserter"), _T("iterator")); AddBinding(_T("STL"),_T("distance"), _T("iterator")); AddBinding(_T("STL"),_T("front_inserter"), _T("iterator")); AddBinding(_T("STL"),_T("inserter"), _T("iterator")); AddBinding(_T("STL"),_T("make_move_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("back_insert_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("bidirectional_iterator_tag"), _T("iterator")); AddBinding(_T("STL"),_T("checked_array_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("forward_iterator_tag"), _T("iterator")); AddBinding(_T("STL"),_T("front_insert_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("input_iterator_tag"), _T("iterator")); AddBinding(_T("STL"),_T("insert_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("istream_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("istreambuf_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("iterator"), _T("iterator")); AddBinding(_T("STL"),_T("iterator_traits"), _T("iterator")); AddBinding(_T("STL"),_T("move_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("ostream_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("ostreambuf_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("output_iterator_tag"), _T("iterator")); AddBinding(_T("STL"),_T("random_access_iterator_tag"), _T("iterator")); AddBinding(_T("STL"),_T("reverse_iterator"), _T("iterator")); AddBinding(_T("STL"),_T("float_denorm_style"), _T("limits")); AddBinding(_T("STL"),_T("float_round_style"), _T("limits")); AddBinding(_T("STL"),_T("numeric_limits"), _T("limits")); AddBinding(_T("STL"),_T("list"), _T("list")); AddBinding(_T("STL"),_T("codecvt"), _T("locale")); AddBinding(_T("STL"),_T("codecvt_base"), _T("locale")); AddBinding(_T("STL"),_T("codecvt_byname"), _T("locale")); AddBinding(_T("STL"),_T("collate"), _T("locale")); AddBinding(_T("STL"),_T("collate_byname"), _T("locale")); AddBinding(_T("STL"),_T("ctype"), _T("locale")); AddBinding(_T("STL"),_T("ctype_base"), _T("locale")); AddBinding(_T("STL"),_T("ctype_byname"), _T("locale")); AddBinding(_T("STL"),_T("locale"), _T("locale")); AddBinding(_T("STL"),_T("messages"), _T("locale")); AddBinding(_T("STL"),_T("messages_base"), _T("locale")); AddBinding(_T("STL"),_T("messages_byname"), _T("locale")); AddBinding(_T("STL"),_T("money_base"), _T("locale")); AddBinding(_T("STL"),_T("money_get"), _T("locale")); AddBinding(_T("STL"),_T("money_put"), _T("locale")); AddBinding(_T("STL"),_T("moneypunct"), _T("locale")); AddBinding(_T("STL"),_T("moneypunct_byname"), _T("locale")); AddBinding(_T("STL"),_T("num_get"), _T("locale")); AddBinding(_T("STL"),_T("num_put"), _T("locale")); AddBinding(_T("STL"),_T("numpunct"), _T("locale")); AddBinding(_T("STL"),_T("numpunct_byname"), _T("locale")); AddBinding(_T("STL"),_T("time_base"), _T("locale")); AddBinding(_T("STL"),_T("time_get"), _T("locale")); AddBinding(_T("STL"),_T("time_put_byname"), _T("locale")); AddBinding(_T("STL"),_T("map"), _T("map")); AddBinding(_T("STL"),_T("multimap"), _T("map")); AddBinding(_T("STL"),_T("value_compare"), _T("map")); AddBinding(_T("STL"),_T("allocator"), _T("memory")); AddBinding(_T("STL"),_T("auto_ptr"), _T("memory")); AddBinding(_T("STL"),_T("checked_uninitialized_fill_n"), _T("memory")); AddBinding(_T("STL"),_T("get_temporary_buffer"), _T("memory")); AddBinding(_T("STL"),_T("raw_storage_iterator "), _T("memory")); AddBinding(_T("STL"),_T("return_temporary_buffer"), _T("memory")); AddBinding(_T("STL"),_T("unchecked_uninitialized_fill_n"), _T("memory")); AddBinding(_T("STL"),_T("uninitialized_copy"), _T("memory")); AddBinding(_T("STL"),_T("uninitialized_fill"), _T("memory")); AddBinding(_T("STL"),_T("uninitialized_fill_n"), _T("memory")); AddBinding(_T("STL"),_T("accumulate"), _T("numeric")); AddBinding(_T("STL"),_T("adjacent_difference"), _T("numeric")); AddBinding(_T("STL"),_T("checked_adjacent_difference"), _T("numeric")); AddBinding(_T("STL"),_T("checked_partial_sum"), _T("numeric")); AddBinding(_T("STL"),_T("inner_product"), _T("numeric")); AddBinding(_T("STL"),_T("partial_sum"), _T("numeric")); AddBinding(_T("STL"),_T("unchecked_adjacent_difference"), _T("numeric")); AddBinding(_T("STL"),_T("unchecked_partial_sum"), _T("numeric")); AddBinding(_T("STL"),_T("priority_queue "), _T("queue")); AddBinding(_T("STL"),_T("queue"), _T("queue")); AddBinding(_T("STL"),_T("multiset"), _T("set")); AddBinding(_T("STL"),_T("set"), _T("set")); AddBinding(_T("STL"),_T("basic_istringstream"), _T("sstream")); AddBinding(_T("STL"),_T("basic_ostringstream"), _T("sstream")); AddBinding(_T("STL"),_T("basic_stringbuf"), _T("sstream")); AddBinding(_T("STL"),_T("basic_stringstream"), _T("sstream")); AddBinding(_T("STL"),_T("istringstream"), _T("sstream")); AddBinding(_T("STL"),_T("ostringstream"), _T("sstream")); AddBinding(_T("STL"),_T("stringbuf"), _T("sstream")); AddBinding(_T("STL"),_T("stringstream"), _T("sstream")); AddBinding(_T("STL"),_T("wistringstream"), _T("sstream")); AddBinding(_T("STL"),_T("wostringstream"), _T("sstream")); AddBinding(_T("STL"),_T("wstringbuf"), _T("sstream")); AddBinding(_T("STL"),_T("wstringstream"), _T("sstream")); AddBinding(_T("STL"),_T("stack"), _T("stack")); AddBinding(_T("STL"),_T("domain_error"), _T("stdexcept")); AddBinding(_T("STL"),_T("invalid_argument "), _T("stdexcept")); AddBinding(_T("STL"),_T("length_error"), _T("stdexcept")); AddBinding(_T("STL"),_T("logic_error"), _T("stdexcept")); AddBinding(_T("STL"),_T("out_of_range"), _T("stdexcept")); AddBinding(_T("STL"),_T("overflow_error"), _T("stdexcept")); AddBinding(_T("STL"),_T("range_error"), _T("stdexcept")); AddBinding(_T("STL"),_T("runtime_error "), _T("stdexcept")); AddBinding(_T("STL"),_T("underflow_error "), _T("stdexcept")); AddBinding(_T("STL"),_T("basic_streambuf"), _T("streambuf")); AddBinding(_T("STL"),_T("streambuf"), _T("streambuf")); AddBinding(_T("STL"),_T("wstreambuf"), _T("streambuf")); AddBinding(_T("STL"),_T("basic_string"), _T("string")); AddBinding(_T("STL"),_T("char_traits"), _T("string")); AddBinding(_T("STL"),_T("string"), _T("string")); AddBinding(_T("STL"),_T("wstring"), _T("string")); AddBinding(_T("STL"),_T("istrstream"), _T("strstream")); AddBinding(_T("STL"),_T("ostrstream"), _T("strstream")); AddBinding(_T("STL"),_T("strstream"), _T("strstream")); AddBinding(_T("STL"),_T("strstreambuf"), _T("strstream")); AddBinding(_T("STL"),_T("pair"), _T("utility")); AddBinding(_T("STL"),_T("make_pair"), _T("utility")); AddBinding(_T("STL"),_T("gslice"), _T("valarray")); AddBinding(_T("STL"),_T("gslice_array"), _T("valarray")); AddBinding(_T("STL"),_T("indirect_array"), _T("valarray")); AddBinding(_T("STL"),_T("mask_array"), _T("valarray")); AddBinding(_T("STL"),_T("slice"), _T("valarray")); AddBinding(_T("STL"),_T("slice_array"), _T("valarray")); AddBinding(_T("STL"),_T("valarray"), _T("valarray")); AddBinding(_T("STL"),_T("vector"), _T("vector")); }// SetDefaultsSTL void Bindings::SetDefaultsCLibrary() { AddBinding(_T("C_Library"),_T("assert"), _T("cassert")); AddBinding(_T("C_Library"),_T("isalnum"), _T("cctype")); AddBinding(_T("C_Library"),_T("isalpha"), _T("cctype")); AddBinding(_T("C_Library"),_T("iscntrl"), _T("cctype")); AddBinding(_T("C_Library"),_T("isdigit"), _T("cctype")); AddBinding(_T("C_Library"),_T("isgraph"), _T("cctype")); AddBinding(_T("C_Library"),_T("islower"), _T("cctype")); AddBinding(_T("C_Library"),_T("isprint"), _T("cctype")); AddBinding(_T("C_Library"),_T("ispunct"), _T("cctype")); AddBinding(_T("C_Library"),_T("isspace"), _T("cctype")); AddBinding(_T("C_Library"),_T("isupper"), _T("cctype")); AddBinding(_T("C_Library"),_T("isxdigit"), _T("cctype")); AddBinding(_T("C_Library"),_T("tolower"), _T("cctype")); AddBinding(_T("C_Library"),_T("toupper"), _T("cctype")); AddBinding(_T("C_Library"),_T("setlocale"), _T("clocale")); AddBinding(_T("C_Library"),_T("localeconv"), _T("clocale")); AddBinding(_T("C_Library"),_T("fclose"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fopen"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fflush"), _T("cstdio")); AddBinding(_T("C_Library"),_T("freopen"), _T("cstdio")); AddBinding(_T("C_Library"),_T("setbuf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("setvbuf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fprintf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fscan"), _T("cstdio")); AddBinding(_T("C_Library"),_T("printf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("scanf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("sprintf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("sscanf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("vfprintf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("vprintf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("vsprintf"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fgetc"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fgets"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fputc"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fputs"), _T("cstdio")); AddBinding(_T("C_Library"),_T("getc"), _T("cstdio")); AddBinding(_T("C_Library"),_T("getchar"), _T("cstdio")); AddBinding(_T("C_Library"),_T("gets"), _T("cstdio")); AddBinding(_T("C_Library"),_T("putc"), _T("cstdio")); AddBinding(_T("C_Library"),_T("putchar"), _T("cstdio")); AddBinding(_T("C_Library"),_T("puts"), _T("cstdio")); AddBinding(_T("C_Library"),_T("ungetc"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fread"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fwrite"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fgetpos"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fseek"), _T("cstdio")); AddBinding(_T("C_Library"),_T("fsetpos"), _T("cstdio")); AddBinding(_T("C_Library"),_T("ftell"), _T("cstdio")); AddBinding(_T("C_Library"),_T("rewind"), _T("cstdio")); AddBinding(_T("C_Library"),_T("clearerr"), _T("cstdio")); AddBinding(_T("C_Library"),_T("feof"), _T("cstdio")); AddBinding(_T("C_Library"),_T("ferror"), _T("cstdio")); AddBinding(_T("C_Library"),_T("perrer"), _T("cstdio")); AddBinding(_T("C_Library"),_T("FILE"), _T("cstdio")); AddBinding(_T("C_Library"),_T("abort"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("abs"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("atexit"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("atof"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("atoi"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("atol"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("bsearch"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("calloc"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("div"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("exit"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("free"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("getenv"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("labs"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("ldiv"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("malloc"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("mblen"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("mbstowcs"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("mbtowc"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("qsort"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("rand"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("realloc"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("srand"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("strtod"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("strtol"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("strtoul"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("system"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("wcstombs"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("wctomb"), _T("cstdlib")); AddBinding(_T("C_Library"),_T("memchr"), _T("cstring")); AddBinding(_T("C_Library"),_T("memcmp"), _T("cstring")); AddBinding(_T("C_Library"),_T("memcpy"), _T("cstring")); AddBinding(_T("C_Library"),_T("memmove"), _T("cstring")); AddBinding(_T("C_Library"),_T("memset"), _T("cstring")); AddBinding(_T("C_Library"),_T("strcat"), _T("cstring")); AddBinding(_T("C_Library"),_T("strchr"), _T("cstring")); AddBinding(_T("C_Library"),_T("strcmp"), _T("cstring")); AddBinding(_T("C_Library"),_T("strcoll"), _T("cstring")); AddBinding(_T("C_Library"),_T("strcpy"), _T("cstring")); AddBinding(_T("C_Library"),_T("strcspn"), _T("cstring")); AddBinding(_T("C_Library"),_T("strerror"), _T("cstring")); AddBinding(_T("C_Library"),_T("strlen"), _T("cstring")); AddBinding(_T("C_Library"),_T("strncat"), _T("cstring")); AddBinding(_T("C_Library"),_T("strncmp"), _T("cstring")); AddBinding(_T("C_Library"),_T("strncpy"), _T("cstring")); AddBinding(_T("C_Library"),_T("strpbrk"), _T("cstring")); AddBinding(_T("C_Library"),_T("strrchr"), _T("cstring")); AddBinding(_T("C_Library"),_T("strspn"), _T("cstring")); AddBinding(_T("C_Library"),_T("strstr"), _T("cstring")); AddBinding(_T("C_Library"),_T("strtok"), _T("cstring")); AddBinding(_T("C_Library"),_T("strxfrm"), _T("cstring")); AddBinding(_T("C_Library"),_T("asctime"), _T("ctime")); AddBinding(_T("C_Library"),_T("clock"), _T("ctime")); AddBinding(_T("C_Library"),_T("ctime"), _T("ctime")); AddBinding(_T("C_Library"),_T("difftime"), _T("ctime")); AddBinding(_T("C_Library"),_T("gmtime"), _T("ctime")); AddBinding(_T("C_Library"),_T("localtime"), _T("ctime")); AddBinding(_T("C_Library"),_T("mktime"), _T("ctime")); AddBinding(_T("C_Library"),_T("strftime"), _T("ctime")); AddBinding(_T("C_Library"),_T("time"), _T("ctime")); }// SetDefaultsCLibrary
SaturnSDK/Saturn-SDK-IDE
src/plugins/contrib/headerfixup/defaults.cpp
C++
gpl-3.0
97,104
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.craftercms.security.social.impl; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.craftercms.commons.crypto.CryptoException; import org.craftercms.commons.crypto.TextEncryptor; import org.craftercms.profile.api.Profile; import org.craftercms.profile.api.exceptions.ProfileException; import org.craftercms.profile.api.services.ProfileService; import org.craftercms.security.authentication.Authentication; import org.craftercms.security.authentication.AuthenticationManager; import org.craftercms.security.exception.AuthenticationException; import org.craftercms.security.exception.OAuth2Exception; import org.craftercms.security.social.ProviderLoginSupport; import org.craftercms.security.utils.SecurityUtils; import org.craftercms.security.utils.social.ConnectionUtils; import org.springframework.beans.factory.annotation.Required; import org.springframework.social.connect.Connection; import org.springframework.social.connect.ConnectionFactory; import org.springframework.social.connect.ConnectionFactoryLocator; import org.springframework.social.connect.support.OAuth1ConnectionFactory; import org.springframework.social.connect.support.OAuth2ConnectionFactory; import org.springframework.social.connect.web.ConnectSupport; import org.springframework.util.MultiValueMap; import org.springframework.web.context.request.ServletWebRequest; /** * Default implementation of {@link ProviderLoginSupport}. On {@link #complete(String, String, HttpServletRequest)}, if the * user data of the provider connection corresponds to an existing Crafter Profile user, the profile connection data * will be updated. If a profile doesn't exist, a new one with the connection data will be created. In both cases, the * user is automatically authenticated with Crafter Profile. * * @author avasquez */ public class ProviderLoginSupportImpl implements ProviderLoginSupport { public static final String PARAM_OAUTH_TOKEN = "oauth_token"; public static final String PARAM_CODE = "code"; public static final String PARAM_ERROR = "error"; public static final String PARAM_ERROR_DESCRIPTION = "error_description"; public static final String PARAM_ERROR_URI = "error_uri"; protected ConnectSupport connectSupport; protected ConnectionFactoryLocator connectionFactoryLocator; protected ProfileService profileService; protected AuthenticationManager authenticationManager; protected TextEncryptor textEncryptor; public ProviderLoginSupportImpl() { connectSupport = new ConnectSupport(); } public void setConnectSupport(ConnectSupport connectSupport) { this.connectSupport = connectSupport; } @Required public void setConnectionFactoryLocator(ConnectionFactoryLocator connectionFactoryLocator) { this.connectionFactoryLocator = connectionFactoryLocator; } @Required public void setProfileService(ProfileService profileService) { this.profileService = profileService; } @Required public void setAuthenticationManager(AuthenticationManager authenticationManager) { this.authenticationManager = authenticationManager; } @Required public void setTextEncryptor(TextEncryptor textEncryptor) { this.textEncryptor = textEncryptor; } @Override public String start(String tenant, String providerId, HttpServletRequest request) throws AuthenticationException { return start(tenant, providerId, request, null, null); } @Override public String start(String tenant, String providerId, HttpServletRequest request, MultiValueMap<String, String> additionalUrlParams) throws AuthenticationException { return start(tenant, providerId, request, additionalUrlParams, null); } @Override public String start(String tenant, String providerId, HttpServletRequest request, MultiValueMap<String, String> additionalUrlParams, ConnectSupport connectSupport) throws AuthenticationException { if (connectSupport == null) { connectSupport = this.connectSupport; } ConnectionFactory<?> connectionFactory = getConnectionFactory(providerId); ServletWebRequest webRequest = new ServletWebRequest(request); return connectSupport.buildOAuthUrl(connectionFactory, webRequest, additionalUrlParams); } @Override public Authentication complete(String tenant, String providerId, HttpServletRequest request) throws AuthenticationException { return complete(tenant, providerId, request, null, null, null); } @Override public Authentication complete(String tenant, String providerId, HttpServletRequest request, Set<String> newUserRoles, Map<String, Object> newUserAttributes) throws AuthenticationException { return complete(tenant, providerId, request, newUserRoles, newUserAttributes, null); } @Override public Authentication complete(String tenant, String providerId, HttpServletRequest request, Set<String> newUserRoles, Map<String, Object> newUserAttributes, ConnectSupport connectSupport) throws AuthenticationException { if (connectSupport == null) { connectSupport = this.connectSupport; } Connection<?> connection = completeConnection(connectSupport, providerId, request); if (connection != null) { Profile userData = ConnectionUtils.createProfile(connection); Profile profile = getProfile(tenant, userData); if (profile == null) { if (CollectionUtils.isNotEmpty(newUserRoles)) { userData.getRoles().addAll(newUserRoles); } if (MapUtils.isNotEmpty(newUserAttributes)) { userData.getAttributes().putAll(newUserAttributes); } profile = createProfile(tenant, connection, userData); } else { profile = updateProfileConnectionData(tenant, connection, profile); } Authentication auth = authenticationManager.authenticateUser(profile); SecurityUtils.setAuthentication(request, auth); return auth; } else { return null; } } protected Connection<?> completeConnection(ConnectSupport connectSupport, String providerId, HttpServletRequest request) throws OAuth2Exception { if (StringUtils.isNotEmpty(request.getParameter(PARAM_OAUTH_TOKEN))) { OAuth1ConnectionFactory<?> connectionFactory = (OAuth1ConnectionFactory<?>)getConnectionFactory(providerId); ServletWebRequest webRequest = new ServletWebRequest(request); return connectSupport.completeConnection(connectionFactory, webRequest); } else if (StringUtils.isNotEmpty(request.getParameter(PARAM_CODE))) { OAuth2ConnectionFactory<?> connectionFactory = (OAuth2ConnectionFactory<?>)getConnectionFactory(providerId); ServletWebRequest webRequest = new ServletWebRequest(request); return connectSupport.completeConnection(connectionFactory, webRequest); } else if (StringUtils.isNotEmpty(request.getParameter(PARAM_ERROR))) { String error = request.getParameter(PARAM_ERROR); String errorDescription = request.getParameter(PARAM_ERROR_DESCRIPTION); String errorUri = request.getParameter(PARAM_ERROR_URI); throw new OAuth2Exception(error, errorDescription, errorUri); } else { return null; } } protected ConnectionFactory<?> getConnectionFactory(String providerId) { return connectionFactoryLocator.getConnectionFactory(providerId); } protected Profile getProfile(String tenant, Profile userData) { try { return profileService.getProfileByUsername(tenant, userData.getUsername()); } catch (ProfileException e) { throw new AuthenticationException("Unable to retrieve current profile for user '" + userData.getUsername() + "' of tenant '" + tenant + "'", e); } } protected Profile createProfile(String tenant, Connection<?> connection, Profile userData) { try { ConnectionUtils.addConnectionData(userData, connection.createData(), textEncryptor); return profileService.createProfile(tenant, userData.getUsername(), null, userData.getEmail(), true, userData.getRoles(), userData.getAttributes(), null); } catch (CryptoException | ProfileException e) { throw new AuthenticationException("Unable to create profile of user '" + userData.getUsername() + "' in tenant '" + tenant + "'", e); } } protected Profile updateProfileConnectionData(String tenant, Connection<?> connection, Profile profile) { try { ConnectionUtils.addConnectionData(profile, connection.createData(), textEncryptor); return profileService.updateAttributes(profile.getId().toString(), profile.getAttributes()); } catch (CryptoException | ProfileException e) { throw new AuthenticationException("Unable to update connection data of user '" + profile.getUsername() + "' of tenant '" + tenant + "'", e); } } }
craftercms/profile
security-provider/src/main/java/org/craftercms/security/social/impl/ProviderLoginSupportImpl.java
Java
gpl-3.0
10,511
public enum LiftFloor { None, FirstFloor, SecondFloor, ThirdFloor, FourthFloor, InBetweenFloors };
BardsBeardsBirds/Demo-2
Assets/Scripts/ObjectInteraction/ObjectScripts/LiftFloor.cs
C#
gpl-3.0
101
package ru.juniperbot.common.support.jmx; import org.springframework.jmx.export.naming.MetadataNamingStrategy; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; public class JbMetadataNamingStrategy extends MetadataNamingStrategy { /** * Overrides Spring's naming method and replaced it with our local one. */ @Override public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException { if (beanKey == null) { beanKey = managedBean.getClass().getName(); } ObjectName objectName = super.getObjectName(managedBean, beanKey); if (managedBean instanceof JmxNamedResource) { objectName = buildObjectName((JmxNamedResource) managedBean, objectName.getDomain()); } return objectName; } /** * Construct our object name by calling the methods in {@link JmxNamedResource}. */ private ObjectName buildObjectName(JmxNamedResource namedObject, String domainName) throws MalformedObjectNameException { String[] typeNames = namedObject.getJmxPath(); if (typeNames == null) { throw new MalformedObjectNameException("getJmxPath() is returning null for object " + namedObject); } StringBuilder nameBuilder = new StringBuilder(); nameBuilder.append(domainName); nameBuilder.append(':'); /* * Ok. This is a HACK. It seems like something in the JMX mbean naming process actually sorts the names * lexicographically. The stuff before the '=' character seems to be ignored anyway but it does look ugly. */ boolean needComma = false; int typeNameC = 0; for (String typeName : typeNames) { if (needComma) { nameBuilder.append(','); } // this will come out as 00=partition nameBuilder.append(String.format("%02d", typeNameC)); typeNameC++; nameBuilder.append('='); nameBuilder.append(typeName); needComma = true; } if (needComma) { nameBuilder.append(','); } nameBuilder.append("name="); nameBuilder.append(namedObject.getJmxName()); return ObjectName.getInstance(nameBuilder.toString()); } }
GoldRenard/JuniperBotJ
jb-common/src/main/java/ru/juniperbot/common/support/jmx/JbMetadataNamingStrategy.java
Java
gpl-3.0
2,377
<?php /* * This file is part of the ptech project. * * (c) ptech project <http://github.com/ptech> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ use yii\helpers\Html; use yii\helpers\Url; /** * @var ptech\user\models\User $user * @var ptech\user\models\Token $token */ $passwordUrl = Url::to(['site/update-password','uid'=>$user->auth_key,'token'=>$user->recovery_token],true); ?> <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> Hello <?=$user->username?>, </p> <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> We have received a request to reset the password for your account on <?= Yii::$app->name?> </p> <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> Please click the link below to complete your password reset. </p> <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> <a href="<?=$passwordUrl?>">Reset Password</a> </p> <p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;"> If you did not make this request you can ignore this email. </p>
WFMRDA/WFNM
common/mail/recovery.php
PHP
gpl-3.0
1,675
# Simple program to add the value of $1 and $5 bills in a wallet ''' Multiple line comments can be placed between triple quotations. ''' nFives = 2 nOnes = 3 total = (nFives * 5) + nOnes print "The total is $" + str(total) # Simple program to calculate how much you should be paid at work rate = 10.00 totalHours = 45 regularHours = 40 overTime = totalHours - regularHours salary = (regularHours * rate) + (overTime * rate * 1.5) print "You will be paid $" + str(salary)
geoffmomin/ScratchPad
Python/simplewallet.py
Python
gpl-3.0
479
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Mox.UI.Game { /// <summary> /// Interaction logic for PlayerInfoControl.xaml /// </summary> public partial class PlayerInfoControl : UserControl { public PlayerInfoControl() { InitializeComponent(); } } }
fparadis2/mox
Source/Mox.UI/Project/Views/Game/Player/PlayerInfoControl.xaml.cs
C#
gpl-3.0
631
import csv import requests import pandas as pd from zipfile import ZipFile from io import StringIO URL = 'https://www.quandl.com/api/v3/databases/%(dataset)s/codes' def dataset_url(dataset): return URL % {'dataset': dataset} def download_file(url): r = requests.get(url) if r.status_code == 200: return StringIO(r.text) def unzip(file_): d = unzip_files(file_) return d[list(d.keys())[0]] def unzip_files(file_): d = {} with ZipFile(file_, 'r') as zipfile: for filename in zipfile.namelist(): d[filename] = str(zipfile.read(filename)) return d def csv_rows(str): for row in csv.reader(StringIO(str)): yield row def csv_dicts(str, fieldnames=None): for d in csv.DictReader(StringIO(str), fieldnames=fieldnames): yield d def get_symbols_list(dataset): csv_ = unzip(download_file(dataset_url(dataset))) return map(lambda x: x[0].replace(dataset + '/', ''), csv_rows(csv_)) def get_symbols_dict(dataset): csv_ = unzip(download_file(dataset_url(dataset))) return dict(csv_rows(csv_)) def get_symbols_df(dataset): csv_ = unzip(download_file(dataset_url(dataset))) df = pd.read_csv(StringIO(csv_), header=None, names=['symbol', 'company']) df.symbol = df.symbols.map(lambda x: x.replace(dataset + '/', '')) df.company = df.company.map(lambda x: x.replace('Prices, Dividends, Splits and Trading Volume', '')) return df
briancappello/PyTradeLib
pytradelib/quandl/metadata.py
Python
gpl-3.0
1,451
#include "Global.h" namespace neuro { int x_square_mul; int y_square_mul; int MAPSIZEX = 48; int MAPSIZEY = 40; inline static bool checkMapBounds(Square pos) { if( (pos.getX()>0&&pos.getX()<MAPSIZEX)&& (pos.getY()>0&&pos.getY()<MAPSIZEY) ) { return true; } else { return false; } } unsigned int num_unique = 0; std::string get_unique_name(std::string name) { std::stringstream ss; ss << name << num_unique++; return ss.str(); } }
ChadMcKinney/Entropy
Neurocaster/src/core/Global.cpp
C++
gpl-3.0
512
/* -*-c++-*- * ---------------------------------------------------------------------------- * * PlantGL: The Plant Graphic Library * * Copyright 1995-2007 UMR CIRAD/INRIA/INRA DAP * * File author(s): F. Boudon et al. * * ---------------------------------------------------------------------------- * * GNU General Public Licence * * 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; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * ---------------------------------------------------------------------------- */ #include "util_vector.h" #include "util_math.h" #include "../tool/util_assert.h" #include <iostream> using namespace std; TOOLS_BEGIN_NAMESPACE /* --------------------------------------------------------------------- */ #define __X __data[0] #define __Y __data[1] #define __Z __data[2] #define __W __data[3] /* --------------------------------------------------------------------- */ const Vector2 Vector2::ORIGIN; const Vector2 Vector2::OX(1,0); const Vector2 Vector2::OY(0,1); /* --------------------------------------------------------------------- */ Vector2::Polar::Polar( const real_t& radius, const real_t& theta ) : radius(radius), theta(theta) { } Vector2::Polar::Polar( const Vector2& v ) : radius(hypot(v.x(),v.y())), theta(atan2(v.y(),v.x())) { } bool Vector2::Polar::isValid( ) const { return finite(radius) && finite(theta); } /* --------------------------------------------------------------------- */ Vector2::Vector2( const real_t& x , const real_t& y ) : Tuple2<real_t>(x,y) { GEOM_ASSERT(isValid()); } Vector2::Vector2( const Polar& p ) : Tuple2<real_t>(p.radius * cos(p.theta), p.radius * sin(p.theta)) { GEOM_ASSERT(p.isValid()); GEOM_ASSERT(isValid()); } void Vector2::set( const real_t& x , const real_t& y ) { __X = x; __Y = y; GEOM_ASSERT(isValid()); } void Vector2::set( const Vector2& v ) { __X = v.__X; __Y = v.__Y; GEOM_ASSERT(isValid()); } void Vector2::set( const real_t * v2 ) { __X = v2[0]; __Y = v2[1]; GEOM_ASSERT(isValid()); } void Vector2::set( const Polar& p ) { __X = p.radius * cos(p.theta); __Y = p.radius * sin(p.theta) GEOM_ASSERT(p.isValid()); GEOM_ASSERT(isValid()); } Vector2::~Vector2( ) { } const real_t& Vector2::x( ) const { return __X; } real_t& Vector2::x( ) { return __X; } const real_t& Vector2::y( ) const { return __Y; } real_t& Vector2::y( ) { return __Y; } int Vector2::getMaxAbsCoord() const { return ( fabs(__X) > fabs(__Y) ) ? 0 : 1; } int Vector2::getMinAbsCoord() const { return ( fabs(__X) < fabs(__Y) ) ? 0 : 1; } /* --------------------------------------------------------------------- */ bool Vector2::operator==( const Vector2& v ) const { return normLinf(*this - v) < GEOM_TOLERANCE; } bool Vector2::operator!=( const Vector2& v ) const { return normLinf(*this - v) >= GEOM_TOLERANCE; } Vector2& Vector2::operator+=( const Vector2& v ) { __X += v.__X; __Y += v.__Y; return *this; } Vector2& Vector2::operator-=( const Vector2& v ) { __X -= v.__X; __Y -= v.__Y; return *this; } Vector2& Vector2::operator*=( const real_t& s ) { __X *= s; __Y *= s; return *this; } Vector2& Vector2::operator/=( const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); __X /= s; __Y /= s; return *this; } Vector2 Vector2::operator-( ) const { return Vector2(-__X, -__Y); } Vector2 Vector2::operator+( const Vector2& v) const { return Vector2(*this) += v; } Vector2 Vector2::operator-( const Vector2& v ) const { return Vector2(*this) -= v; } bool Vector2::isNormalized( ) const { return fabs(normSquared(*this) - 1) < GEOM_EPSILON; } bool Vector2::isOrthogonalTo( const Vector2& v ) const { return fabs(dot(*this,v)) < GEOM_EPSILON; } bool Vector2::isValid( ) const { return finite(__X) && finite(__Y); } real_t Vector2::normalize( ) { real_t _norm = norm(*this); if (_norm > GEOM_TOLERANCE) *this /= _norm; return _norm; } Vector2 Vector2::normed( ) const { return direction(*this); } /* --------------------------------------------------------------------- */ Vector2 operator*( const Vector2& v, const real_t& s ) { return Vector2(v) *= s; } Vector2 operator*( const real_t& s, const Vector2& v ) { return Vector2(v) *= s; } ostream& operator<<( ostream& stream, const Vector2& v ) { return stream << "<" << v.__X << "," << v.__Y << ">"; } bool operator<(const Vector2& v1, const Vector2& v2) { if (v1.__X < (v2.__X - GEOM_TOLERANCE)) return true; if (v1.__X > (v2.__X + GEOM_TOLERANCE)) return false; return v1.__Y < (v2.__Y- GEOM_TOLERANCE); } bool strictly_eq( const Vector2& v1, const Vector2& v2 ) { return normLinf(v1 - v2) ==0; } bool strictly_inf(const Vector2& v1, const Vector2& v2) { if (v1.__X < v2.__X) return true; if (v1.__X > v2.__X) return false; return v1.__Y < v2.__Y; } Vector2 operator/( const Vector2& v, const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); return Vector2(v) /= s; } Vector2 abs( const Vector2& v ) { return Vector2(fabs(v.__X),fabs(v.__Y)); } Vector2 direction( const Vector2& v ) { real_t n = norm(v); if (n < GEOM_EPSILON) return v; return v / n; } real_t cross( const Vector2& v1,const Vector2& v2) { return v1.__X*v2.__Y - v1.__Y*v2.__X; } real_t operator^( const Vector2& v1,const Vector2& v2) { return v1.__X*v2.__Y - v1.__Y*v2.__X; } real_t dot( const Vector2& v1, const Vector2& v2 ) { return (v1.__X * v2.__X + v1.__Y * v2.__Y); } real_t operator*( const Vector2& v1, const Vector2& v2 ) { return (v1.__X * v2.__X + v1.__Y * v2.__Y); } Vector2 Max( const Vector2& v1, const Vector2& v2 ) { return Vector2(max(v1.__X,v2.__X),max(v1.__Y,v2.__Y)); } Vector2 Min( const Vector2& v1, const Vector2& v2 ) { return Vector2(min(v1.__X,v2.__X),min(v1.__Y,v2.__Y)); } real_t norm( const Vector2& v ) { return sqrt(normSquared(v)); } real_t normL1( const Vector2& v ) { return sum(abs(v)); } real_t normLinf( const Vector2& v ) { return *(abs(v).getMax()); } real_t normSquared( const Vector2& v ) { return dot(v,v); } real_t sum( const Vector2& v ) { return v.__X + v.__Y; } /* real_t angle( const Vector2& v1 , const Vector2& v2 ) { real_t n = norm(v1)*norm(v2); if(n < GEOM_EPSILON)return 0; return acos(dot(v1,v2)/n); */ real_t angle( const Vector2& v1 , const Vector2& v2 ) { real_t cosinus = v1*v2; //dot(v1,v2) real_t sinus = v1^v2; // cross(v1,v2) return atan2( sinus, cosinus ); } /* --------------------------------------------------------------------- */ const Vector3 Vector3::ORIGIN; const Vector3 Vector3::OX(1,0,0); const Vector3 Vector3::OY(0,1,0); const Vector3 Vector3::OZ(0,0,1); /* --------------------------------------------------------------------- */ Vector3::Cylindrical::Cylindrical( const real_t& radius, const real_t& theta, const real_t& z ) : radius(radius), theta(theta), z(z) { GEOM_ASSERT(isValid()); } Vector3::Cylindrical::Cylindrical( const Vector3& v ) : radius(hypot(v.x(),v.y())), theta(atan2(v.y(),v.x())), z(v.z()) { GEOM_ASSERT(isValid()); } bool Vector3::Cylindrical::isValid( ) const { return finite(radius) && finite(theta) && finite(z); } /* --------------------------------------------------------------------- */ real_t spherical_distance(real_t theta1, real_t phi1, real_t theta2, real_t phi2, real_t radius) { // return radius * acos(sin(theta1)sin(theta2) + cos(theta1)cos(theta2)cos(phi2-phi1)); real_t costheta1 = cos(theta1); real_t costheta2 = cos(theta2); real_t sintheta1 = sin(theta1); real_t sintheta2 = sin(theta2); real_t deltaphi = phi2-phi1; real_t cosdeltaphi = cos(deltaphi); real_t a = (costheta2*sin(deltaphi)); real_t b = (costheta1*sintheta2 - sintheta1*costheta2*cosdeltaphi); real_t c = sqrt(a*a+b*b); real_t d = sintheta1 * sintheta2 + costheta1 * costheta2 * cosdeltaphi; return radius * atan2(c,d); } Vector3::Spherical::Spherical( const real_t& radius, const real_t& theta, const real_t& phi ) : radius(radius), theta(theta), phi(phi) { GEOM_ASSERT(isValid()); } Vector3::Spherical::Spherical( const Vector3& v ) : radius(v.x() * v.x() + v.y() * v.y()), theta(atan2(v.y(),v.x())), phi(0) { phi = atan2(sqrt(radius),v.z()); radius = sqrt(radius + v.z() * v.z()); } bool Vector3::Spherical::isValid( ) const { return finite(radius) && finite(theta) && finite(phi); } real_t Vector3::Spherical::spherical_distance(real_t theta2, real_t phi2) const { return TOOLS(spherical_distance)(theta,phi, theta2,phi2, radius); } /* --------------------------------------------------------------------- */ Vector3::Vector3( const real_t& x, const real_t& y, const real_t& z ) : Tuple3<real_t>(x,y,z) { GEOM_ASSERT(isValid()); } Vector3::Vector3( const Vector2& v, const real_t& z ) : Tuple3<real_t>(v.x(),v.y(),z) { GEOM_ASSERT(v.isValid()); GEOM_ASSERT(isValid()); } Vector3::Vector3( const Cylindrical& c ) : Tuple3<real_t>(c.radius * cos(c.theta), c.radius * sin(c.theta), c.z) { GEOM_ASSERT(c.isValid()); GEOM_ASSERT(isValid()); } Vector3::Vector3( const Spherical& s ) : Tuple3<real_t>(cos(s.theta), sin(s.theta), s.radius * cos(s.phi)) { real_t _tmp = s.radius * sin(s.phi); __X *= _tmp; __Y *= _tmp; GEOM_ASSERT(s.isValid()); GEOM_ASSERT(isValid()); } void Vector3::set( const real_t& x, const real_t& y, const real_t& z ) { __X = x; __Y = y; __Z = z; GEOM_ASSERT(isValid()); } void Vector3::set( const real_t * v3 ) { __X = v3[0]; __Y = v3[1]; __Z = v3[2]; GEOM_ASSERT(isValid()); } void Vector3::set( const Vector2& v, const real_t& z ) { GEOM_ASSERT(v.isValid()); __X = v.x(); __Y = v.y(); __Z = z; GEOM_ASSERT(isValid()); } void Vector3::set( const Cylindrical& c ) { GEOM_ASSERT(c.isValid()); __X = c.radius * cos(c.theta); __Y = c.radius * sin(c.theta); __Z = c.z; GEOM_ASSERT(isValid()); } void Vector3::set( const Spherical& s ) { GEOM_ASSERT(s.isValid()); real_t _tmp = s.radius * sin(s.phi); __X = cos(s.theta) * _tmp; __Y = sin(s.theta) * _tmp; __Z = s.radius * cos(s.phi); GEOM_ASSERT(isValid()); } void Vector3::set( const Vector3& v ) { __X = v.__X; __Y = v.__Y; __Z = v.__Z; GEOM_ASSERT(isValid()); } Vector3::~Vector3( ) { } const real_t& Vector3::x( ) const { return __X; } real_t& Vector3::x( ) { return __X; } const real_t& Vector3::y( ) const { return __Y; } real_t& Vector3::y( ) { return __Y; } const real_t& Vector3::z( ) const { return __Z; } real_t& Vector3::z( ) { return __Z; } /* --------------------------------------------------------------------- */ bool Vector3::operator==( const Vector3& v ) const { return normLinf(*this - v) < GEOM_TOLERANCE; } bool Vector3::operator!=( const Vector3& v ) const { return normLinf(*this - v) >= GEOM_TOLERANCE; } Vector3& Vector3::operator+=( const Vector3& v ) { __X += v.__X; __Y += v.__Y; __Z += v.__Z; return *this; } Vector3& Vector3::operator-=( const Vector3& v ) { __X -= v.__X; __Y -= v.__Y; __Z -= v.__Z; return *this; } Vector3& Vector3::operator*=( const real_t& s ) { __X *= s; __Y *= s; __Z *= s; return *this; } Vector3& Vector3::operator/=( const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); __X /= s; __Y /= s; __Z /= s; return *this; } Vector3 Vector3::operator-( ) const { return Vector3(-__X, -__Y, -__Z); } Vector3 Vector3::operator+( const Vector3& v) const { return Vector3(*this) += v; } Vector3 Vector3::operator-( const Vector3& v ) const { return Vector3(*this) -= v; } bool Vector3::isNormalized( ) const { return fabs(normSquared(*this) - 1) < GEOM_EPSILON; } bool Vector3::isOrthogonalTo( const Vector3& v ) const { return fabs(dot(*this,v)) < GEOM_EPSILON; } bool Vector3::isValid( ) const { return finite(__X) && finite(__Y) && finite(__Z); } real_t Vector3::normalize( ) { real_t _norm = norm(*this); if (_norm > GEOM_TOLERANCE) *this /= _norm; return _norm; } Vector3 Vector3::normed( ) const { return direction(*this); } Vector2 Vector3::project( ) const { return Vector2(__X / __Z,__Y / __Z); } int Vector3::getMaxAbsCoord() const { if( fabs(__X) > fabs(__Y) ) return ( fabs(__X) > fabs(__Z) ) ? 0 : 2; else return ( fabs(__Y) > fabs(__Z) ) ? 1 : 2; } int Vector3::getMinAbsCoord() const { if( fabs(__X) < fabs(__Y) ) return ( fabs(__X) < fabs(__Z) ) ? 0 : 2; else return ( fabs(__Y) < fabs(__Z) ) ? 1 : 2; } Vector3 Vector3::anOrthogonalVector() const { if (fabs(__X) < GEOM_EPSILON) return Vector3(1,0,0); else if (fabs(__Y) < GEOM_EPSILON) return Vector3(0,1,0); else if (fabs(__Z) < GEOM_EPSILON) return Vector3(0,0,1); real_t _norm = norm(*this); if (_norm < GEOM_TOLERANCE) return Vector3(0,0,0);; return TOOLS(Vector3)(-__Y/_norm,__X/_norm,0); } /* --------------------------------------------------------------------- */ Vector3 operator*( const Vector3& v, const real_t& s ) { return Vector3(v) *= s; } Vector3 operator*( const real_t& s, const Vector3& v ) { return Vector3(v) *= s; } Vector3 operator/( const Vector3& v, const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); return Vector3(v) /= s; } ostream& operator<<( ostream& stream, const Vector3& v ) { return stream << "<" << v.__X << "," << v.__Y << "," << v.__Z << ">"; } bool operator<(const Vector3& v1, const Vector3& v2) { if (v1.__X < (v2.__X - GEOM_TOLERANCE)) return true; if (v1.__X > (v2.__X + GEOM_TOLERANCE)) return false; if (v1.__Y < (v2.__Y - GEOM_TOLERANCE)) return true; if (v1.__Y > (v2.__Y + GEOM_TOLERANCE)) return false; return v1.__Z < (v2.__Z - GEOM_TOLERANCE); } bool strictly_eq( const Vector3& v1, const Vector3& v2 ) { return normLinf(v1 - v2) == 0; } bool strictly_inf(const Vector3& v1, const Vector3& v2) { if (v1.__X < v2.__X) return true; if (v1.__X > v2.__X) return false; if (v1.__Y < v2.__Y) return true; if (v1.__Y > v2.__Y) return false; return v1.__Z < v2.__Z ; } Vector3 abs( const Vector3& v ) { return Vector3(fabs(v.__X),fabs(v.__Y),fabs(v.__Z)); } Vector3 cross( const Vector3& v1, const Vector3& v2 ) { return Vector3(v1.__Y * v2.__Z - v1.__Z * v2.__Y, v1.__Z * v2.__X - v1.__X * v2.__Z, v1.__X * v2.__Y - v1.__Y * v2.__X); } Vector3 operator^( const Vector3& v1, const Vector3& v2 ) { return Vector3(v1.__Y * v2.__Z - v1.__Z * v2.__Y, v1.__Z * v2.__X - v1.__X * v2.__Z, v1.__X * v2.__Y - v1.__Y * v2.__X); } Vector3 direction( const Vector3& v ) { real_t n = norm(v); if (n < GEOM_EPSILON) return v; return v / n; } real_t dot( const Vector3& v1, const Vector3& v2 ) { return (v1.__X * v2.__X + v1.__Y * v2.__Y + v1.__Z * v2.__Z); } real_t operator*( const Vector3& v1, const Vector3& v2 ) { return (v1.__X * v2.__X + v1.__Y * v2.__Y + v1.__Z * v2.__Z); } Vector3 Max( const Vector3& v1, const Vector3& v2 ) { return Vector3(max(v1.__X,v2.__X), max(v1.__Y,v2.__Y), max(v1.__Z,v2.__Z)); } Vector3 Min( const Vector3& v1, const Vector3& v2 ) { return Vector3(min(v1.__X,v2.__X), min(v1.__Y,v2.__Y), min(v1.__Z,v2.__Z)); } real_t norm( const Vector3& v ) { return sqrt(normSquared(v)); } real_t normL1( const Vector3& v ) { return sum(abs(v)); } real_t normLinf( const Vector3& v ) { return *(abs(v).getMax()); } real_t normSquared( const Vector3& v ) { return dot(v,v); } real_t sum( const Vector3& v ) { return v.__X + v.__Y + v.__Z; } real_t radialAnisotropicNorm( const Vector3& v, const Vector3& t, real_t alpha, real_t beta ){ real_t a = dot(v,t); Vector3 b = v - a*t; return sqrt(a*a*alpha+beta*normSquared(b)); } real_t anisotropicNorm( const Vector3& v, const Vector3& factors ) { return sqrt(factors.x()*v.x()*v.x()+factors.y()*v.y()*v.y()+factors.z()*v.z()*v.z()); } real_t angle( const Vector3& v1 , const Vector3& v2 ) { double cosinus = dot( v1,v2 ); Vector3 vy = cross( v1, v2 ); double sinus = norm( vy ); return atan2( sinus, cosinus );} real_t angle( const Vector3& v1, const Vector3& v2, const Vector3& axis ) { double cosinus = dot( v1,v2 ); Vector3 vy = cross( v1, v2 ); double sinus = norm( vy ); if( dot( vy, axis ) < 0 ){ return atan2( -sinus, cosinus ); } return atan2( sinus, cosinus ); } /* --------------------------------------------------------------------- */ const Vector4 Vector4::ORIGIN; const Vector4 Vector4::OX(1,0,0,0); const Vector4 Vector4::OY(0,1,0,0); const Vector4 Vector4::OZ(0,0,1,0); const Vector4 Vector4::OW(0,0,0,1); /* --------------------------------------------------------------------- */ Vector4::Vector4( const real_t& x , const real_t& y , const real_t& z , const real_t& w ) : Tuple4<real_t>(x,y,z,w) { GEOM_ASSERT(isValid()); } Vector4::Vector4( const Vector3& v, const real_t& w ) : Tuple4<real_t>(v.x(),v.y(),v.z(),w) { GEOM_ASSERT(v.isValid()); GEOM_ASSERT(isValid()); } Vector4::Vector4( const Vector2& v, const real_t& z , const real_t& w ) : Tuple4<real_t>(v.x(),v.y(),z,w) { GEOM_ASSERT(v.isValid()); GEOM_ASSERT(isValid()); } Vector4::~Vector4( ) { } void Vector4::set( const real_t& x , const real_t& y , const real_t& z , const real_t& w ) { __X = x; __Y = y; __Z = z; __W = w; GEOM_ASSERT(isValid()); } void Vector4::set( const real_t * v4 ) { __X = v4[0]; __Y = v4[1]; __Z = v4[2]; __W = v4[3]; GEOM_ASSERT(isValid()); } void Vector4::set( const Vector3& v, const real_t& w ) { GEOM_ASSERT(v.isValid()); __X = v.x(); __Y = v.y(); __Z = v.z(); __W = w; GEOM_ASSERT(isValid()); } void Vector4::set( const Vector4& v) { GEOM_ASSERT(v.isValid()); __X = v.__X; __Y = v.__Y; __Z = v.__Z; __W = v.__W; GEOM_ASSERT(isValid()); } const real_t& Vector4::x( ) const { return __X; } real_t& Vector4::x( ) { return __X; } const real_t& Vector4::y( ) const { return __Y; } real_t& Vector4::y( ) { return __Y; } const real_t& Vector4::z( ) const { return __Z; } real_t& Vector4::z( ) { return __Z; } const real_t& Vector4::w( ) const { return __W; } real_t& Vector4::w( ) { return __W; } int Vector4::getMaxAbsCoord() const { if ( fabs(__X) > fabs(__Y) ){ if( fabs(__X) > fabs(__Z) ) return ( fabs(__X) > fabs(__W) ) ? 0 : 3; else return ( fabs(__Z) > fabs(__W) ) ? 2 : 3; } else { if( fabs(__Y) > fabs(__Z) ) return ( fabs(__Y) > fabs(__W) ) ? 1 : 3; else return ( fabs(__Z) > fabs(__W) ) ? 2 : 3; } } int Vector4::getMinAbsCoord() const { if ( fabs(__X) < fabs(__Y) ){ if( fabs(__X) < fabs(__Z) ) return ( fabs(__X) < fabs(__W) ) ? 0 : 3; else return ( fabs(__Z) < fabs(__W) ) ? 2 : 3; } else { if( fabs(__Y) < fabs(__Z) ) return ( fabs(__Y) < fabs(__W) ) ? 1 : 3; else return ( fabs(__Z) < fabs(__W) ) ? 2 : 3; } } /* --------------------------------------------------------------------- */ bool Vector4::operator==( const Vector4& v ) const { return normLinf(*this - v) < GEOM_TOLERANCE; } bool Vector4::operator!=( const Vector4& v ) const { return normLinf(*this - v) >= GEOM_TOLERANCE; } Vector4& Vector4::operator+=( const Vector4& v ) { __X += v.__X; __Y += v.__Y; __Z += v.__Z; __W += v.__W; return *this; } Vector4& Vector4::operator-=( const Vector4& v ) { __X -= v.__X; __Y -= v.__Y; __Z -= v.__Z; __W -= v.__W; return *this; } Vector4& Vector4::operator*=( const real_t& s ) { __X *= s; __Y *= s; __Z *= s; __W *= s; return *this; } Vector4& Vector4::operator/=( const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); __X /= s; __Y /= s; __Z /= s; __W /= s; return *this; } Vector4 Vector4::operator-( ) const { return Vector4(-__X, -__Y, -__Z,-__W); } Vector4 Vector4::operator+( const Vector4& v) const { return Vector4(*this) += v; } Vector4 Vector4::operator-( const Vector4& v ) const { return Vector4(*this) -= v; } bool Vector4::isNormalized( ) const { return fabs(normSquared(*this) - 1) < GEOM_EPSILON; } bool Vector4::isOrthogonalTo( const Vector4& v ) const { return fabs(dot(*this,v)) < GEOM_EPSILON; } bool Vector4::isValid( ) const { return finite(__X) && finite(__Y) && finite(__Z) && finite(__W); } real_t Vector4::normalize( ) { real_t _norm = norm(*this); if (_norm > GEOM_TOLERANCE) *this /= _norm; return _norm; } Vector4 Vector4::normed( ) const { return direction(*this); } Vector3 Vector4::project( ) const { GEOM_ASSERT(fabs(__W) > GEOM_TOLERANCE); return Vector3(__X / __W, __Y / __W, __Z / __W); } /* --------------------------------------------------------------------- */ Vector4 operator*( const Vector4& v, const real_t& s ) { return Vector4(v) *= s; } Vector4 operator*( const real_t& s, const Vector4& v ) { return Vector4(v) *= s; } Vector4 operator/( const Vector4& v, const real_t& s ) { GEOM_ASSERT(fabs(s) > GEOM_TOLERANCE); return Vector4(v) /= s; } ostream& operator<<( ostream& stream, const Vector4& v ) { return stream << "<" << v.__X << "," << v.__Y << "," << v.__Z << "," << v.__W << ">"; } bool operator<(const Vector4& v1, const Vector4& v2) { if (v1.__X < (v2.__X - GEOM_TOLERANCE)) return true; if (v1.__X > (v2.__X + GEOM_TOLERANCE)) return false; if (v1.__Y < (v2.__Y - GEOM_TOLERANCE)) return true; if (v1.__Y > (v2.__Y + GEOM_TOLERANCE)) return false; if (v1.__Z < (v2.__Z - GEOM_TOLERANCE)) return true; if (v1.__Z > (v2.__Z + GEOM_TOLERANCE)) return false; return v1.__W < (v2.__W - GEOM_TOLERANCE); } bool strictly_eq( const Vector4& v1, const Vector4& v2 ) { return normLinf(v1 - v2) == 0; } bool strictly_inf(const Vector4& v1, const Vector4& v2) { if (v1.__X < v2.__X) return true; if (v1.__X > v2.__X) return false; if (v1.__Y < v2.__Y) return true; if (v1.__Y > v2.__Y) return false; if (v1.__Z < v2.__Z) return true; if (v1.__Z > v2.__Z) return false; return v1.__W < v2.__W ; } Vector4 abs( const Vector4& v ) { return Vector4(fabs(v.__X),fabs(v.__Y), fabs(v.__Z),fabs(v.__W)); } Vector4 direction( const Vector4& v ) { real_t n = norm(v); if (n < GEOM_EPSILON) return v; return v / n; } real_t dot( const Vector4& v1, const Vector4& v2 ) { return v1.__X * v2.__X + v1.__Y * v2.__Y + v1.__Z * v2.__Z + v1.__W * v2.__W; } real_t operator*( const Vector4& v1, const Vector4& v2 ) { return v1.__X * v2.__X + v1.__Y * v2.__Y + v1.__Z * v2.__Z + v1.__W * v2.__W; } Vector4 Max( const Vector4& v1, const Vector4& v2 ) { return Vector4(max(v1.__X,v2.__X),max(v1.__Y,v2.__Y), max(v1.__Z,v2.__Z),max(v1.__W,v2.__W)); } Vector4 Min( const Vector4& v1, const Vector4& v2 ) { return Vector4(min(v1.__X,v2.__X),min(v1.__Y,v2.__Y), min(v1.__Z,v2.__Z),min(v1.__W,v2.__W)); } real_t norm( const Vector4& v ) { return sqrt(normSquared(v)); } real_t normL1( const Vector4& v ) { return sum(abs(v)); } real_t normLinf( const Vector4& v ) { return *(abs(v).getMax()); } real_t normSquared( const Vector4& v ) { return dot(v,v); } real_t sum( const Vector4& v ) { return v.__X + v.__Y + v.__Z + v.__W; } /* --------------------------------------------------------------------- */ TOOLS_END_NAMESPACE /* --------------------------------------------------------------------- */
mangostaniko/lpy-lsystems-blender-addon
lpy-lsystems-adapted-windows/src/plantgl/math/util_vector.cpp
C++
gpl-3.0
24,241
/** * @file Dunavant.cpp * @brief Functions for Dunavant quadrature (nodes and weights, tabulated) * @author John Burkardt */ # include <cstdlib> # include <iostream> # include <fstream> # include <iomanip> # include <cmath> # include <ctime> # include <cstring> using namespace std; # include "Dunavant.hpp" //****************************************************************************80 int dunavant_degree ( int rule ) //****************************************************************************80 // // Purpose: // // DUNAVANT_DEGREE returns the degree of a Dunavant rule for the triangle. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Output, int DUNAVANT_DEGREE, the polynomial degree of exactness of // the rule. // { int degree; if ( 1 <= rule && rule <= 20 ) { degree = rule; } else { degree = -1; cout << "\n"; cout << "DUNAVANT_DEGREE - Fatal error!\n"; cout << " Illegal RULE = " << rule << "\n"; exit ( 1 ); } return degree; } //****************************************************************************80 int dunavant_order_num ( int rule ) //****************************************************************************80 // // Purpose: // // DUNAVANT_ORDER_NUM returns the order of a Dunavant rule for the triangle. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Output, int DUNAVANT_ORDER_NUM, the order (number of points) of the rule. // { int order; int order_num; int *suborder; int suborder_num; suborder_num = dunavant_suborder_num ( rule ); suborder = dunavant_suborder ( rule, suborder_num ); order_num = 0; for ( order = 0; order < suborder_num; order++ ) { order_num = order_num + suborder[order]; } delete [] suborder; return order_num; } //****************************************************************************80 void dunavant_rule ( int rule, int order_num, double xy[], double w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_RULE returns the points and weights of a Dunavant rule. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Input, int ORDER_NUM, the order (number of points) of the rule. // // Output, double XY[2*ORDER_NUM], the points of the rule. // // Output, double W[ORDER_NUM], the weights of the rule. // { int k; int o; int s; int *suborder; int suborder_num; double *suborder_w; double *suborder_xyz; // // Get the suborder information. // suborder_num = dunavant_suborder_num ( rule ); suborder_xyz = new double[3*suborder_num]; suborder_w = new double[suborder_num]; suborder = dunavant_suborder ( rule, suborder_num ); dunavant_subrule ( rule, suborder_num, suborder_xyz, suborder_w ); // // Expand the suborder information to a full order rule. // o = 0; for ( s = 0; s < suborder_num; s++ ) { if ( suborder[s] == 1 ) { xy[0+o*2] = suborder_xyz[0+s*3]; xy[1+o*2] = suborder_xyz[1+s*3]; w[o] = suborder_w[s]; o = o + 1; } else if ( suborder[s] == 3 ) { for ( k = 0; k < 3; k++ ) { xy[0+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ]; xy[1+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ]; w[o] = suborder_w[s]; o = o + 1; } } else if ( suborder[s] == 6 ) { for ( k = 0; k < 3; k++ ) { xy[0+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ]; xy[1+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ]; w[o] = suborder_w[s]; o = o + 1; } for ( k = 0; k < 3; k++ ) { xy[0+o*2] = suborder_xyz [ i4_wrap(k+1,0,2) + s*3 ]; xy[1+o*2] = suborder_xyz [ i4_wrap(k, 0,2) + s*3 ]; w[o] = suborder_w[s]; o = o + 1; } } else { cout << "\n"; cout << "DUNAVANT_RULE - Fatal error!\n;"; cout << " Illegal SUBORDER(" << s << ") = " << suborder[s] << "\n"; exit ( 1 ); } } delete [] suborder; delete [] suborder_xyz; delete [] suborder_w; return; } //****************************************************************************80 int dunavant_rule_num ( ) //****************************************************************************80 // // Purpose: // // DUNAVANT_RULE_NUM returns the number of Dunavant rules available. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Output, int DUNAVANT_RULE_NUM, the number of rules available. // { int rule_num; rule_num = 20; return rule_num; } //****************************************************************************80 int *dunavant_suborder ( int rule, int suborder_num ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBORDER returns the suborders for a Dunavant rule. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, int DUNAVANT_SUBORDER[SUBORDER_NUM], the suborders of the rule. // { int *suborder; suborder = new int[suborder_num]; if ( rule == 1 ) { suborder[0] = 1; } else if ( rule == 2 ) { suborder[0] = 3; } else if ( rule == 3 ) { suborder[0] = 1; suborder[1] = 3; } else if ( rule == 4 ) { suborder[0] = 3; suborder[1] = 3; } else if ( rule == 5 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; } else if ( rule == 6 ) { suborder[0] = 3; suborder[1] = 3; suborder[2] = 6; } else if ( rule == 7 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 6; } else if ( rule == 8 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 6; } else if ( rule == 9 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 6; } else if ( rule == 10 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 6; suborder[4] = 6; suborder[5] = 6; } else if ( rule == 11 ) { suborder[0] = 3; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 6; suborder[6] = 6; } else if ( rule == 12 ) { suborder[0] = 3; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 6; suborder[6] = 6; suborder[7] = 6; } else if ( rule == 13 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 6; suborder[8] = 6; suborder[9] = 6; } else if ( rule == 14 ) { suborder[0] = 3; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 6; suborder[7] = 6; suborder[8] = 6; suborder[9] = 6; } else if ( rule == 15 ) { suborder[0] = 3; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 6; suborder[7] = 6; suborder[8] = 6; suborder[9] = 6; suborder[10] = 6; } else if ( rule == 16 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 3; suborder[8] = 6; suborder[9] = 6; suborder[10] = 6; suborder[11] = 6; suborder[12] = 6; } else if ( rule == 17 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 3; suborder[8] = 3; suborder[9] = 6; suborder[10] = 6; suborder[11] = 6; suborder[12] = 6; suborder[13] = 6; suborder[14] = 6; } else if ( rule == 18 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 3; suborder[8] = 3; suborder[9] = 3; suborder[10] = 6; suborder[11] = 6; suborder[12] = 6; suborder[13] = 6; suborder[14] = 6; suborder[15] = 6; suborder[16] = 6; } else if ( rule == 19 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 3; suborder[8] = 3; suborder[9] = 6; suborder[10] = 6; suborder[11] = 6; suborder[12] = 6; suborder[13] = 6; suborder[14] = 6; suborder[15] = 6; suborder[16] = 6; } else if ( rule == 20 ) { suborder[0] = 1; suborder[1] = 3; suborder[2] = 3; suborder[3] = 3; suborder[4] = 3; suborder[5] = 3; suborder[6] = 3; suborder[7] = 3; suborder[8] = 3; suborder[9] = 3; suborder[10] = 3; suborder[11] = 6; suborder[12] = 6; suborder[13] = 6; suborder[14] = 6; suborder[15] = 6; suborder[16] = 6; suborder[17] = 6; suborder[18] = 6; } else { cout << "\n"; cout << "DUNAVANT_SUBORDER - Fatal error!\n"; cout << " Illegal RULE = " << rule << "\n"; exit ( 1 ); } return suborder; } //****************************************************************************80 int dunavant_suborder_num ( int rule ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBORDER_NUM returns the number of suborders for a Dunavant rule. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Output, int DUNAVANT_SUBORDER_NUM, the number of suborders of the rule. // { int suborder_num; if ( rule == 1 ) { suborder_num = 1; } else if ( rule == 2 ) { suborder_num = 1; } else if ( rule == 3 ) { suborder_num = 2; } else if ( rule == 4 ) { suborder_num = 2; } else if ( rule == 5 ) { suborder_num = 3; } else if ( rule == 6 ) { suborder_num = 3; } else if ( rule == 7 ) { suborder_num = 4; } else if ( rule == 8 ) { suborder_num = 5; } else if ( rule == 9 ) { suborder_num = 6; } else if ( rule == 10 ) { suborder_num = 6; } else if ( rule == 11 ) { suborder_num = 7; } else if ( rule == 12 ) { suborder_num = 8; } else if ( rule == 13 ) { suborder_num = 10; } else if ( rule == 14 ) { suborder_num = 10; } else if ( rule == 15 ) { suborder_num = 11; } else if ( rule == 16 ) { suborder_num = 13; } else if ( rule == 17 ) { suborder_num = 15; } else if ( rule == 18 ) { suborder_num = 17; } else if ( rule == 19 ) { suborder_num = 17; } else if ( rule == 20 ) { suborder_num = 19; } else { suborder_num = -1; cout << "\n"; cout << "DUNAVANT_SUBORDER_NUM - Fatal error!\n"; cout << " Illegal RULE = " << rule << "\n"; exit ( 1 ); } return suborder_num; } //****************************************************************************80 void dunavant_subrule ( int rule, int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE returns a compressed Dunavant rule. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int RULE, the index of the rule. // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { if ( rule == 1 ) { dunavant_subrule_01 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 2 ) { dunavant_subrule_02 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 3 ) { dunavant_subrule_03 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 4 ) { dunavant_subrule_04 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 5 ) { dunavant_subrule_05 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 6 ) { dunavant_subrule_06 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 7 ) { dunavant_subrule_07 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 8 ) { dunavant_subrule_08 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 9 ) { dunavant_subrule_09 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 10 ) { dunavant_subrule_10 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 11 ) { dunavant_subrule_11 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 12 ) { dunavant_subrule_12 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 13 ) { dunavant_subrule_13 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 14 ) { dunavant_subrule_14 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 15 ) { dunavant_subrule_15 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 16 ) { dunavant_subrule_16 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 17 ) { dunavant_subrule_17 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 18 ) { dunavant_subrule_18 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 19 ) { dunavant_subrule_19 ( suborder_num, suborder_xyz, suborder_w ); } else if ( rule == 20 ) { dunavant_subrule_20 ( suborder_num, suborder_xyz, suborder_w ); } else { cout << "\n"; cout << "DUNAVANT_SUBRULE - Fatal error!\n"; cout << " Illegal RULE = " << rule << "\n"; exit ( 1 ); } return; } //****************************************************************************80 void dunavant_subrule_01 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_01 returns a compressed Dunavant rule 1. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_01[3*1] = { 0.333333333333333, 0.333333333333333, 0.333333333333333 }; double suborder_w_rule_01[1] = { 1.000000000000000 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_01[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_01[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_01[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_01[s]; } return; } //****************************************************************************80 void dunavant_subrule_02 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_02 returns a compressed Dunavant rule 2. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_02[3*1] = { 0.666666666666667, 0.166666666666667, 0.166666666666667 }; double suborder_w_rule_02[1] = { 0.333333333333333 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_02[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_02[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_02[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_02[s]; } return; } //****************************************************************************80 void dunavant_subrule_03 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_03 returns a compressed Dunavant rule 3. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_03[3*2] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000 }; double suborder_w_rule_03[2] = { -0.562500000000000, 0.520833333333333 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_03[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_03[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_03[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_03[s]; } return; } //****************************************************************************80 void dunavant_subrule_04 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_04 returns a compressed Dunavant rule 4. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_04[3*2] = { 0.108103018168070, 0.445948490915965, 0.445948490915965, 0.816847572980459, 0.091576213509771, 0.091576213509771 }; double suborder_w_rule_04[2] = { 0.223381589678011, 0.109951743655322 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_04[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_04[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_04[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_04[s]; } return; } //****************************************************************************80 void dunavant_subrule_05 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_05 returns a compressed Dunavant rule 5. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_05[3*3] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.059715871789770, 0.470142064105115, 0.470142064105115, 0.797426985353087, 0.101286507323456, 0.101286507323456 }; double suborder_w_rule_05[3] = { 0.225000000000000, 0.132394152788506, 0.125939180544827 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_05[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_05[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_05[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_05[s]; } return; } //****************************************************************************80 void dunavant_subrule_06 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_06 returns a compressed Dunavant rule 6. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_06[3*3] = { 0.501426509658179, 0.249286745170910, 0.249286745170910, 0.873821971016996, 0.063089014491502, 0.063089014491502, 0.053145049844817, 0.310352451033784, 0.636502499121399 }; double suborder_w_rule_06[3] = { 0.116786275726379, 0.050844906370207, 0.082851075618374 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_06[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_06[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_06[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_06[s]; } return; } //****************************************************************************80 void dunavant_subrule_07 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_07 returns a compressed Dunavant rule 7. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_07[3*4] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.479308067841920, 0.260345966079040, 0.260345966079040, 0.869739794195568, 0.065130102902216, 0.065130102902216, 0.048690315425316, 0.312865496004874, 0.638444188569810 }; double suborder_w_rule_07[4] = { -0.149570044467682, 0.175615257433208, 0.053347235608838, 0.077113760890257 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_07[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_07[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_07[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_07[s]; } return; } //****************************************************************************80 void dunavant_subrule_08 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_08 returns a compressed Dunavant rule 8. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_08[3*5] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.081414823414554, 0.459292588292723, 0.459292588292723, 0.658861384496480, 0.170569307751760, 0.170569307751760, 0.898905543365938, 0.050547228317031, 0.050547228317031, 0.008394777409958, 0.263112829634638, 0.728492392955404 }; double suborder_w_rule_08[5] = { 0.144315607677787, 0.095091634267285, 0.103217370534718, 0.032458497623198, 0.027230314174435 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_08[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_08[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_08[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_08[s]; } return; } //****************************************************************************80 void dunavant_subrule_09 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_09 returns a compressed Dunavant rule 9. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_09[3*6] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.020634961602525, 0.489682519198738, 0.489682519198738, 0.125820817014127, 0.437089591492937, 0.437089591492937, 0.623592928761935, 0.188203535619033, 0.188203535619033, 0.910540973211095, 0.044729513394453, 0.044729513394453, 0.036838412054736, 0.221962989160766, 0.741198598784498 }; double suborder_w_rule_09[6] = { 0.097135796282799, 0.031334700227139, 0.077827541004774, 0.079647738927210, 0.025577675658698, 0.043283539377289 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_09[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_09[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_09[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_09[s]; } return; } //****************************************************************************80 void dunavant_subrule_10 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_10 returns a compressed Dunavant rule 10. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_10[3*6] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.028844733232685, 0.485577633383657, 0.485577633383657, 0.781036849029926, 0.109481575485037, 0.109481575485037, 0.141707219414880, 0.307939838764121, 0.550352941820999, 0.025003534762686, 0.246672560639903, 0.728323904597411, 0.009540815400299, 0.066803251012200, 0.923655933587500 }; double suborder_w_rule_10[6] = { 0.090817990382754, 0.036725957756467, 0.045321059435528, 0.072757916845420, 0.028327242531057, 0.009421666963733 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_10[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_10[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_10[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_10[s]; } return; } //****************************************************************************80 void dunavant_subrule_11 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_11 returns a compressed Dunavant rule 11. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_11[3*7] = { -0.069222096541517, 0.534611048270758, 0.534611048270758, 0.202061394068290, 0.398969302965855, 0.398969302965855, 0.593380199137435, 0.203309900431282, 0.203309900431282, 0.761298175434837, 0.119350912282581, 0.119350912282581, 0.935270103777448, 0.032364948111276, 0.032364948111276, 0.050178138310495, 0.356620648261293, 0.593201213428213, 0.021022016536166, 0.171488980304042, 0.807489003159792 }; double suborder_w_rule_11[7] = { 0.000927006328961, 0.077149534914813, 0.059322977380774, 0.036184540503418, 0.013659731002678, 0.052337111962204, 0.020707659639141 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_11[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_11[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_11[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_11[s]; } return; } //****************************************************************************80 void dunavant_subrule_12 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_12 returns a compressed Dunavant rule 12. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_12[3*8] = { 0.023565220452390, 0.488217389773805, 0.488217389773805, 0.120551215411079, 0.439724392294460, 0.439724392294460, 0.457579229975768, 0.271210385012116, 0.271210385012116, 0.744847708916828, 0.127576145541586, 0.127576145541586, 0.957365299093579, 0.021317350453210, 0.021317350453210, 0.115343494534698, 0.275713269685514, 0.608943235779788, 0.022838332222257, 0.281325580989940, 0.695836086787803, 0.025734050548330, 0.116251915907597, 0.858014033544073 }; double suborder_w_rule_12[8] = { 0.025731066440455, 0.043692544538038, 0.062858224217885, 0.034796112930709, 0.006166261051559, 0.040371557766381, 0.022356773202303, 0.017316231108659 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_12[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_12[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_12[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_12[s]; } return; } //****************************************************************************80 void dunavant_subrule_13 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_13 returns a compressed Dunavant rule 13. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_13[3*10] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.009903630120591, 0.495048184939705, 0.495048184939705, 0.062566729780852, 0.468716635109574, 0.468716635109574, 0.170957326397447, 0.414521336801277, 0.414521336801277, 0.541200855914337, 0.229399572042831, 0.229399572042831, 0.771151009607340, 0.114424495196330, 0.114424495196330, 0.950377217273082, 0.024811391363459, 0.024811391363459, 0.094853828379579, 0.268794997058761, 0.636351174561660, 0.018100773278807, 0.291730066734288, 0.690169159986905, 0.022233076674090, 0.126357385491669, 0.851409537834241 }; double suborder_w_rule_13[10] = { 0.052520923400802, 0.011280145209330, 0.031423518362454, 0.047072502504194, 0.047363586536355, 0.031167529045794, 0.007975771465074, 0.036848402728732, 0.017401463303822, 0.015521786839045 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_13[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_13[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_13[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_13[s]; } return; } //****************************************************************************80 void dunavant_subrule_14 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_14 returns a compressed Dunavant rule 14. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_14[3*10] = { 0.022072179275643, 0.488963910362179, 0.488963910362179, 0.164710561319092, 0.417644719340454, 0.417644719340454, 0.453044943382323, 0.273477528308839, 0.273477528308839, 0.645588935174913, 0.177205532412543, 0.177205532412543, 0.876400233818255, 0.061799883090873, 0.061799883090873, 0.961218077502598, 0.019390961248701, 0.019390961248701, 0.057124757403648, 0.172266687821356, 0.770608554774996, 0.092916249356972, 0.336861459796345, 0.570222290846683, 0.014646950055654, 0.298372882136258, 0.686980167808088, 0.001268330932872, 0.118974497696957, 0.879757171370171 }; double suborder_w_rule_14[10] = { 0.021883581369429, 0.032788353544125, 0.051774104507292, 0.042162588736993, 0.014433699669777, 0.004923403602400, 0.024665753212564, 0.038571510787061, 0.014436308113534, 0.005010228838501 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_14[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_14[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_14[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_14[s]; } return; } //****************************************************************************80 void dunavant_subrule_15 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_15 returns a compressed Dunavant rule 15. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_15[3*11] = { -0.013945833716486, 0.506972916858243, 0.506972916858243, 0.137187291433955, 0.431406354283023, 0.431406354283023, 0.444612710305711, 0.277693644847144, 0.277693644847144, 0.747070217917492, 0.126464891041254, 0.126464891041254, 0.858383228050628, 0.070808385974686, 0.070808385974686, 0.962069659517853, 0.018965170241073, 0.018965170241073, 0.133734161966621, 0.261311371140087, 0.604954466893291, 0.036366677396917, 0.388046767090269, 0.575586555512814, -0.010174883126571, 0.285712220049916, 0.724462663076655, 0.036843869875878, 0.215599664072284, 0.747556466051838, 0.012459809331199, 0.103575616576386, 0.883964574092416 }; double suborder_w_rule_15[11] = { 0.001916875642849, 0.044249027271145, 0.051186548718852, 0.023687735870688, 0.013289775690021, 0.004748916608192, 0.038550072599593, 0.027215814320624, 0.002182077366797, 0.021505319847731, 0.007673942631049 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_15[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_15[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_15[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_15[s]; } return; } //****************************************************************************80 void dunavant_subrule_16 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_16 returns a compressed Dunavant rule 16. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_16[3*13] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.005238916103123, 0.497380541948438, 0.497380541948438, 0.173061122901295, 0.413469438549352, 0.413469438549352, 0.059082801866017, 0.470458599066991, 0.470458599066991, 0.518892500060958, 0.240553749969521, 0.240553749969521, 0.704068411554854, 0.147965794222573, 0.147965794222573, 0.849069624685052, 0.075465187657474, 0.075465187657474, 0.966807194753950, 0.016596402623025, 0.016596402623025, 0.103575692245252, 0.296555596579887, 0.599868711174861, 0.020083411655416, 0.337723063403079, 0.642193524941505, -0.004341002614139, 0.204748281642812, 0.799592720971327, 0.041941786468010, 0.189358492130623, 0.768699721401368, 0.014317320230681, 0.085283615682657, 0.900399064086661 }; double suborder_w_rule_16[13] = { 0.046875697427642, 0.006405878578585, 0.041710296739387, 0.026891484250064, 0.042132522761650, 0.030000266842773, 0.014200098925024, 0.003582462351273, 0.032773147460627, 0.015298306248441, 0.002386244192839, 0.019084792755899, 0.006850054546542 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_16[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_16[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_16[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_16[s]; } return; } //****************************************************************************80 void dunavant_subrule_17 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_17 returns a compressed Dunavant rule 17. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_17[3*15] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.005658918886452, 0.497170540556774, 0.497170540556774, 0.035647354750751, 0.482176322624625, 0.482176322624625, 0.099520061958437, 0.450239969020782, 0.450239969020782, 0.199467521245206, 0.400266239377397, 0.400266239377397, 0.495717464058095, 0.252141267970953, 0.252141267970953, 0.675905990683077, 0.162047004658461, 0.162047004658461, 0.848248235478508, 0.075875882260746, 0.075875882260746, 0.968690546064356, 0.015654726967822, 0.015654726967822, 0.010186928826919, 0.334319867363658, 0.655493203809423, 0.135440871671036, 0.292221537796944, 0.572337590532020, 0.054423924290583, 0.319574885423190, 0.626001190286228, 0.012868560833637, 0.190704224192292, 0.796427214974071, 0.067165782413524, 0.180483211648746, 0.752351005937729, 0.014663182224828, 0.080711313679564, 0.904625504095608 }; double suborder_w_rule_17[15] = { 0.033437199290803, 0.005093415440507, 0.014670864527638, 0.024350878353672, 0.031107550868969, 0.031257111218620, 0.024815654339665, 0.014056073070557, 0.003194676173779, 0.008119655318993, 0.026805742283163, 0.018459993210822, 0.008476868534328, 0.018292796770025, 0.006665632004165 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_17[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_17[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_17[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_17[s]; } return; } //****************************************************************************80 void dunavant_subrule_18 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_18 returns a compressed Dunavant rule 18. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_18[3*17] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.013310382738157, 0.493344808630921, 0.493344808630921, 0.061578811516086, 0.469210594241957, 0.469210594241957, 0.127437208225989, 0.436281395887006, 0.436281395887006, 0.210307658653168, 0.394846170673416, 0.394846170673416, 0.500410862393686, 0.249794568803157, 0.249794568803157, 0.677135612512315, 0.161432193743843, 0.161432193743843, 0.846803545029257, 0.076598227485371, 0.076598227485371, 0.951495121293100, 0.024252439353450, 0.024252439353450, 0.913707265566071, 0.043146367216965, 0.043146367216965, 0.008430536202420, 0.358911494940944, 0.632657968856636, 0.131186551737188, 0.294402476751957, 0.574410971510855, 0.050203151565675, 0.325017801641814, 0.624779046792512, 0.066329263810916, 0.184737559666046, 0.748933176523037, 0.011996194566236, 0.218796800013321, 0.769207005420443, 0.014858100590125, 0.101179597136408, 0.883962302273467, -0.035222015287949, 0.020874755282586, 1.014347260005363 }; double suborder_w_rule_18[17] = { 0.030809939937647, 0.009072436679404, 0.018761316939594, 0.019441097985477, 0.027753948610810, 0.032256225351457, 0.025074032616922, 0.015271927971832, 0.006793922022963, -0.002223098729920, 0.006331914076406, 0.027257538049138, 0.017676785649465, 0.018379484638070, 0.008104732808192, 0.007634129070725, 0.000046187660794 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_18[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_18[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_18[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_18[s]; } return; } //****************************************************************************80 void dunavant_subrule_19 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_19 returns a compressed Dunavant rule 19. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_19[3*17] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, 0.020780025853987, 0.489609987073006, 0.489609987073006, 0.090926214604215, 0.454536892697893, 0.454536892697893, 0.197166638701138, 0.401416680649431, 0.401416680649431, 0.488896691193805, 0.255551654403098, 0.255551654403098, 0.645844115695741, 0.177077942152130, 0.177077942152130, 0.779877893544096, 0.110061053227952, 0.110061053227952, 0.888942751496321, 0.055528624251840, 0.055528624251840, 0.974756272445543, 0.012621863777229, 0.012621863777229, 0.003611417848412, 0.395754787356943, 0.600633794794645, 0.134466754530780, 0.307929983880436, 0.557603261588784, 0.014446025776115, 0.264566948406520, 0.720987025817365, 0.046933578838178, 0.358539352205951, 0.594527068955871, 0.002861120350567, 0.157807405968595, 0.839331473680839, 0.223861424097916, 0.075050596975911, 0.701087978926173, 0.034647074816760, 0.142421601113383, 0.822931324069857, 0.010161119296278, 0.065494628082938, 0.924344252620784 }; double suborder_w_rule_19[17] = { 0.032906331388919, 0.010330731891272, 0.022387247263016, 0.030266125869468, 0.030490967802198, 0.024159212741641, 0.016050803586801, 0.008084580261784, 0.002079362027485, 0.003884876904981, 0.025574160612022, 0.008880903573338, 0.016124546761731, 0.002491941817491, 0.018242840118951, 0.010258563736199, 0.003799928855302 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_19[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_19[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_19[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_19[s]; } return; } //****************************************************************************80 void dunavant_subrule_20 ( int suborder_num, double suborder_xyz[], double suborder_w[] ) //****************************************************************************80 // // Purpose: // // DUNAVANT_SUBRULE_20 returns a compressed Dunavant rule 20. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 11 December 2006 // // Author: // // John Burkardt // // Reference: // // David Dunavant, // High Degree Efficient Symmetrical Gaussian Quadrature Rules // for the Triangle, // International Journal for Numerical Methods in Engineering, // Volume 21, 1985, pages 1129-1148. // // James Lyness, Dennis Jespersen, // Moderate Degree Symmetric Quadrature Rules for the Triangle, // Journal of the Institute of Mathematics and its Applications, // Volume 15, Number 1, February 1975, pages 19-32. // // Parameters: // // Input, int SUBORDER_NUM, the number of suborders of the rule. // // Output, double SUBORDER_XYZ[3*SUBORDER_NUM], // the barycentric coordinates of the abscissas. // // Output, double SUBORDER_W[SUBORDER_NUM], the suborder weights. // { int s; double suborder_xy_rule_20[3*19] = { 0.333333333333333, 0.333333333333333, 0.333333333333333, -0.001900928704400, 0.500950464352200, 0.500950464352200, 0.023574084130543, 0.488212957934729, 0.488212957934729, 0.089726636099435, 0.455136681950283, 0.455136681950283, 0.196007481363421, 0.401996259318289, 0.401996259318289, 0.488214180481157, 0.255892909759421, 0.255892909759421, 0.647023488009788, 0.176488255995106, 0.176488255995106, 0.791658289326483, 0.104170855336758, 0.104170855336758, 0.893862072318140, 0.053068963840930, 0.053068963840930, 0.916762569607942, 0.041618715196029, 0.041618715196029, 0.976836157186356, 0.011581921406822, 0.011581921406822, 0.048741583664839, 0.344855770229001, 0.606402646106160, 0.006314115948605, 0.377843269594854, 0.615842614456541, 0.134316520547348, 0.306635479062357, 0.559048000390295, 0.013973893962392, 0.249419362774742, 0.736606743262866, 0.075549132909764, 0.212775724802802, 0.711675142287434, -0.008368153208227, 0.146965436053239, 0.861402717154987, 0.026686063258714, 0.137726978828923, 0.835586957912363, 0.010547719294141, 0.059696109149007, 0.929756171556853 }; double suborder_w_rule_20[19] = { 0.033057055541624, 0.000867019185663, 0.011660052716448, 0.022876936356421, 0.030448982673938, 0.030624891725355, 0.024368057676800, 0.015997432032024, 0.007698301815602, -0.000632060497488, 0.001751134301193, 0.016465839189576, 0.004839033540485, 0.025804906534650, 0.008471091054441, 0.018354914106280, 0.000704404677908, 0.010112684927462, 0.003573909385950 }; for ( s = 0; s < suborder_num; s++ ) { suborder_xyz[0+s*3] = suborder_xy_rule_20[0+s*3]; suborder_xyz[1+s*3] = suborder_xy_rule_20[1+s*3]; suborder_xyz[2+s*3] = suborder_xy_rule_20[2+s*3]; } for ( s = 0; s < suborder_num; s++ ) { suborder_w[s] = suborder_w_rule_20[s]; } return; } //****************************************************************************80 void file_name_inc ( char *file_name ) //****************************************************************************80 // // Purpose: // // FILE_NAME_INC increments a partially numeric file name. // // Discussion: // // It is assumed that the digits in the name, whether scattered or // connected, represent a number that is to be increased by 1 on // each call. If this number is all 9's on input, the output number // is all 0's. Non-numeric letters of the name are unaffected. // // If the input string contains no digits, a blank string is returned. // // If a blank string is input, then an error condition results. // // Example: // // Input Output // ----- ------ // "a7to11.txt" "a7to12.txt" (typical case. Last digit incremented) // "a7to99.txt" "a8to00.txt" (last digit incremented, with carry.) // "a9to99.txt" "a0to00.txt" (wrap around) // "cat.txt" " " (no digits to increment) // " " STOP! (error) // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 14 September 2005 // // Author: // // John Burkardt // // Parameters: // // Input/output, character *FILE_NAME, (a pointer to) the character string // to be incremented. // { char c; int change; int i; int lens; lens = s_len_trim ( file_name ); if ( lens <= 0 ) { cout << "\n"; cout << "FILE_NAME_INC - Fatal error!\n"; cout << " Input file name is blank.\n"; exit ( 1 ); } change = 0; for ( i = lens-1; 0 <= i; i-- ) { c = *(file_name+i); if ( '0' <= c && c <= '9' ) { change = change + 1; if ( c == '9' ) { c = '0'; *(file_name+i) = c; } else { c = c + 1; *(file_name+i) = c; return; } } } if ( change == 0 ) { strcpy ( file_name, " " ); } return; } //****************************************************************************80 int i4_max ( int i1, int i2 ) //****************************************************************************80 // // Purpose: // // I4_MAX returns the maximum of two I4's. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 13 October 1998 // // Author: // // John Burkardt // // Parameters: // // Input, int I1, I2, are two integers to be compared. // // Output, int I4_MAX, the larger of I1 and I2. // { int value; if ( i2 < i1 ) { value = i1; } else { value = i2; } return value; } //****************************************************************************80 int i4_min ( int i1, int i2 ) //****************************************************************************80 // // Purpose: // // I4_MIN returns the smaller of two I4's. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 13 October 1998 // // Author: // // John Burkardt // // Parameters: // // Input, int I1, I2, two integers to be compared. // // Output, int I4_MIN, the smaller of I1 and I2. // { int value; if ( i1 < i2 ) { value = i1; } else { value = i2; } return value; } //****************************************************************************80 int i4_modp ( int i, int j ) //****************************************************************************80 // // Purpose: // // I4_MODP returns the nonnegative remainder of I4 division. // // Formula: // // If // NREM = I4_MODP ( I, J ) // NMULT = ( I - NREM ) / J // then // I = J * NMULT + NREM // where NREM is always nonnegative. // // Discussion: // // The MOD function computes a result with the same sign as the // quantity being divided. Thus, suppose you had an angle A, // and you wanted to ensure that it was between 0 and 360. // Then mod(A,360) would do, if A was positive, but if A // was negative, your result would be between -360 and 0. // // On the other hand, I4_MODP(A,360) is between 0 and 360, always. // // Example: // // I J MOD I4_MODP I4_MODP Factorization // // 107 50 7 7 107 = 2 * 50 + 7 // 107 -50 7 7 107 = -2 * -50 + 7 // -107 50 -7 43 -107 = -3 * 50 + 43 // -107 -50 -7 43 -107 = 3 * -50 + 43 // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 26 May 1999 // // Author: // // John Burkardt // // Parameters: // // Input, int I, the number to be divided. // // Input, int J, the number that divides I. // // Output, int I4_MODP, the nonnegative remainder when I is // divided by J. // { int value; if ( j == 0 ) { cout << "\n"; cout << "I4_MODP - Fatal error!\n"; cout << " I4_MODP ( I, J ) called with J = " << j << "\n"; exit ( 1 ); } value = i % j; if ( value < 0 ) { value = value + abs ( j ); } return value; } //****************************************************************************80* int i4_wrap ( int ival, int ilo, int ihi ) //****************************************************************************80* // // Purpose: // // I4_WRAP forces an integer to lie between given limits by wrapping. // // Example: // // ILO = 4, IHI = 8 // // I Value // // -2 8 // -1 4 // 0 5 // 1 6 // 2 7 // 3 8 // 4 4 // 5 5 // 6 6 // 7 7 // 8 8 // 9 4 // 10 5 // 11 6 // 12 7 // 13 8 // 14 4 // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 19 August 2003 // // Author: // // John Burkardt // // Parameters: // // Input, int IVAL, an integer value. // // Input, int ILO, IHI, the desired bounds for the integer value. // // Output, int I4_WRAP, a "wrapped" version of IVAL. // { int jhi; int jlo; int value; int wide; jlo = i4_min ( ilo, ihi ); jhi = i4_max ( ilo, ihi ); wide = jhi + 1 - jlo; if ( wide == 1 ) { value = jlo; } else { value = jlo + i4_modp ( ival - jlo, wide ); } return value; } //****************************************************************************80 double r8_huge ( ) //****************************************************************************80 // // Purpose: // // R8_HUGE returns a "huge" R8. // // Discussion: // // HUGE_VAL is the largest representable legal double precision number, // and is usually defined in math.h, or sometimes in stdlib.h. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 31 August 2004 // // Author: // // John Burkardt // // Parameters: // // Output, double R8_HUGE, a "huge" R8 value. // { return HUGE_VAL; } //****************************************************************************80 int r8_nint ( double x ) //****************************************************************************80 // // Purpose: // // R8_NINT returns the nearest integer to an R8. // // Example: // // X Value // // 1.3 1 // 1.4 1 // 1.5 1 or 2 // 1.6 2 // 0.0 0 // -0.7 -1 // -1.1 -1 // -1.6 -2 // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 26 August 2004 // // Author: // // John Burkardt // // Parameters: // // Input, double X, the value. // // Output, int R8_NINT, the nearest integer to X. // { int s; int value; if ( x < 0.0 ) { s = -1; } else { s = 1; } value = s * ( int ) ( fabs ( x ) + 0.5 ); return value; } //****************************************************************************80 void reference_to_physical_t3 ( double t[], int n, double ref[], double phy[] ) //****************************************************************************80 /* // Purpose: // // REFERENCE_TO_PHYSICAL_T3 maps T3 reference points to physical points. // // Discussion: // // Given the vertices of an order 3 physical triangle and a point // (XSI,ETA) in the reference triangle, the routine computes the value // of the corresponding image point (X,Y) in physical space. // // Note that this routine may also be appropriate for an order 6 // triangle, if the mapping between reference and physical space // is linear. This implies, in particular, that the sides of the // image triangle are straight and that the "midside" nodes in the // physical triangle are literally halfway along the sides of // the physical triangle. // // Reference Element T3: // // | // 1 3 // | |\ // | | \ // S | \ // | | \ // | | \ // 0 1-----2 // | // +--0--R--1--> // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 24 June 2005 // // Author: // // John Burkardt // // Parameters: // // Input, double T[2*3], the coordinates of the vertices. // The vertices are assumed to be the images of (0,0), (1,0) and // (0,1) respectively. // // Input, int N, the number of objects to transform. // // Input, double REF[2*N], points in the reference triangle. // // Output, double PHY[2*N], corresponding points in the // physical triangle. // */ { int i; int j; for ( i = 0; i < 2; i++ ) { for ( j = 0; j < n; j++ ) { phy[i+j*2] = t[i+0*2] * ( 1.0 - ref[0+j*2] - ref[1+j*2] ) + t[i+1*2] * + ref[0+j*2] + t[i+2*2] * + ref[1+j*2]; } } return; } //****************************************************************************80 int s_len_trim ( char *s ) //****************************************************************************80 // // Purpose: // // S_LEN_TRIM returns the length of a string to the last nonblank. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 26 April 2003 // // Author: // // John Burkardt // // Parameters: // // Input, char *S, a pointer to a string. // // Output, int S_LEN_TRIM, the length of the string to the last nonblank. // If S_LEN_TRIM is 0, then the string is entirely blank. // { int n; char *t; n = strlen ( s ); t = s + strlen ( s ) - 1; while ( 0 < n ) { if ( *t != ' ' ) { return n; } t--; n--; } return n; } //****************************************************************************80 void timestamp ( ) //****************************************************************************80 // // Purpose: // // TIMESTAMP prints the current YMDHMS date as a time stamp. // // Example: // // 31 May 2001 09:45:54 AM // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 24 September 2003 // // Author: // // John Burkardt // // Parameters: // // None // { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; size_t len; now = time ( NULL ); tm = localtime ( &now ); len = strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); cout << time_buffer << "\n"; return; # undef TIME_SIZE } //****************************************************************************80 char *timestring ( ) //****************************************************************************80 // // Purpose: // // TIMESTRING returns the current YMDHMS date as a string. // // Example: // // 31 May 2001 09:45:54 AM // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 24 September 2003 // // Author: // // John Burkardt // // Parameters: // // Output, char *TIMESTRING, a string containing the current YMDHMS date. // { # define TIME_SIZE 40 const struct tm *tm; time_t now; char *s; now = time ( NULL ); tm = localtime ( &now ); s = new char[TIME_SIZE]; //size_t len = strftime ( s, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); return s; # undef TIME_SIZE } //****************************************************************************80 double triangle_area ( double t[2*3] ) //****************************************************************************80 // // Purpose: // // TRIANGLE_AREA computes the area of a triangle. // // Discussion: // // If the triangle's vertices are given in counter clockwise order, // the area will be positive. If the triangle's vertices are given // in clockwise order, the area will be negative! // // An earlier version of this routine always returned the absolute // value of the computed area. I am convinced now that that is // a less useful result! For instance, by returning the signed // area of a triangle, it is possible to easily compute the area // of a nonconvex polygon as the sum of the (possibly negative) // areas of triangles formed by node 1 and successive pairs of vertices. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 17 October 2005 // // Author: // // John Burkardt // // Parameters: // // Input, double T[2*3], the vertices of the triangle. // // Output, double TRIANGLE_AREA, the area of the triangle. // { double area; area = 0.5 * ( t[0+0*2] * ( t[1+1*2] - t[1+2*2] ) + t[0+1*2] * ( t[1+2*2] - t[1+0*2] ) + t[0+2*2] * ( t[1+0*2] - t[1+1*2] ) ); return area; } //****************************************************************************80 void triangle_points_plot ( char *file_name, double node_xy[], int node_show, int point_num, double point_xy[], int point_show ) //****************************************************************************80 // // Purpose: // // TRIANGLE_POINTS_PLOT plots a triangle and some points. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 04 October 2006 // // Author: // // John Burkardt // // Parameters: // // Input, char *FILE_NAME, the name of the output file. // // Input, double NODE_XY[2*3], the coordinates of the nodes // of the triangle. // // Input, int NODE_SHOW, // -1, do not show the triangle, or the nodes. // 0, show the triangle, do not show the nodes; // 1, show the triangle and the nodes; // 2, show the triangle, the nodes and number them. // // Input, int POINT_NUM, the number of points. // // Input, double POINT_XY[2*POINT_NUM], the coordinates of the // points. // // Input, int POINT_SHOW, // 0, do not show the points; // 1, show the points; // 2, show the points and number them. // { char *date_time; int circle_size; int delta; ofstream file_unit; int i; int node; int node_num = 3; int point; //char string[40]; double x_max; double x_min; int x_ps; int x_ps_max = 576; int x_ps_max_clip = 594; int x_ps_min = 36; int x_ps_min_clip = 18; double x_scale; double y_max; double y_min; int y_ps; int y_ps_max = 666; int y_ps_max_clip = 684; int y_ps_min = 126; int y_ps_min_clip = 108; double y_scale; date_time = timestring ( ); // // We need to do some figuring here, so that we can determine // the range of the data, and hence the height and width // of the piece of paper. // x_max = -r8_huge ( ); for ( node = 0; node < node_num; node++ ) { if ( x_max < node_xy[0+node*2] ) { x_max = node_xy[0+node*2]; } } for ( point = 0; point < point_num; point++ ) { if ( x_max < point_xy[0+point*2] ) { x_max = point_xy[0+point*2]; } } x_min = r8_huge ( ); for ( node = 0; node < node_num; node++ ) { if ( node_xy[0+node*2] < x_min ) { x_min = node_xy[0+node*2]; } } for ( point = 0; point < point_num; point++ ) { if ( point_xy[0+point*2] < x_min ) { x_min = point_xy[0+point*2]; } } x_scale = x_max - x_min; x_max = x_max + 0.05 * x_scale; x_min = x_min - 0.05 * x_scale; x_scale = x_max - x_min; y_max = -r8_huge ( ); for ( node = 0; node < node_num; node++ ) { if ( y_max < node_xy[1+node*2] ) { y_max = node_xy[1+node*2]; } } for ( point = 0; point < point_num; point++ ) { if ( y_max < point_xy[1+point*2] ) { y_max = point_xy[1+point*2]; } } y_min = r8_huge ( ); for ( node = 0; node < node_num; node++ ) { if ( node_xy[1+node*2] < y_min ) { y_min = node_xy[1+node*2]; } } for ( point = 0; point < point_num; point++ ) { if ( point_xy[1+point*2] < y_min ) { y_min = point_xy[1+point*2]; } } y_scale = y_max - y_min; y_max = y_max + 0.05 * y_scale; y_min = y_min - 0.05 * y_scale; y_scale = y_max - y_min; if ( x_scale < y_scale ) { delta = r8_nint ( ( double ) ( x_ps_max - x_ps_min ) * ( y_scale - x_scale ) / ( 2.0 * y_scale ) ); x_ps_max = x_ps_max - delta; x_ps_min = x_ps_min + delta; x_ps_max_clip = x_ps_max_clip - delta; x_ps_min_clip = x_ps_min_clip + delta; x_scale = y_scale; } else if ( y_scale < x_scale ) { delta = r8_nint ( ( double ) ( y_ps_max - y_ps_min ) * ( x_scale - y_scale ) / ( 2.0 * x_scale ) ); y_ps_max = y_ps_max - delta; y_ps_min = y_ps_min + delta; y_ps_max_clip = y_ps_max_clip - delta; y_ps_min_clip = y_ps_min_clip + delta; y_scale = x_scale; } file_unit.open ( file_name ); if ( !file_unit ) { cout << "\n"; cout << "TRIANGLE_POINTS_PLOT - Fatal error!\n"; cout << " Could not open the output EPS file.\n"; exit ( 1 ); } file_unit << "%//PS-Adobe-3.0 EPSF-3.0\n"; file_unit << "%%Creator: triangulation_order3_plot.C\n"; file_unit << "%%Title: " << file_name << "\n"; file_unit << "%%CreationDate: " << date_time << "\n"; delete [] date_time; file_unit << "%%Pages: 1\n"; file_unit << "%%BoundingBox: " << x_ps_min << " " << y_ps_min << " " << x_ps_max << " " << y_ps_max << "\n"; file_unit << "%%Document-Fonts: Times-Roman\n"; file_unit << "%%LanguageLevel: 1\n"; file_unit << "%%EndComments\n"; file_unit << "%%BeginProlog\n"; file_unit << "/inch {72 mul} def\n"; file_unit << "%%EndProlog\n"; file_unit << "%%Page: 1 1\n"; file_unit << "save\n"; file_unit << "%\n"; file_unit << "% Set the RGB line color to very light gray.\n"; file_unit << "%\n"; file_unit << "0.900 0.900 0.900 setrgbcolor\n"; file_unit << "%\n"; file_unit << "% Draw a gray border around the page.\n"; file_unit << "%\n"; file_unit << "newpath\n"; file_unit << x_ps_min << " " << y_ps_min << " moveto\n"; file_unit << x_ps_max << " " << y_ps_min << " lineto\n"; file_unit << x_ps_max << " " << y_ps_max << " lineto\n"; file_unit << x_ps_min << " " << y_ps_max << " lineto\n"; file_unit << x_ps_min << " " << y_ps_min << " lineto\n"; file_unit << "stroke\n"; file_unit << "%\n"; file_unit << "% Set the RGB color to black.\n"; file_unit << "%\n"; file_unit << "0.000 0.000 0.000 setrgbcolor\n"; file_unit << "%\n"; file_unit << "% Set the font and its size.\n"; file_unit << "%\n"; file_unit << "/Times-Roman findfont\n"; file_unit << "0.50 inch scalefont\n"; file_unit << "setfont\n"; file_unit << "%\n"; file_unit << "% Print a title.\n"; file_unit << "%\n"; file_unit << "% 210 702 moveto\n"; file_unit << "% (Triangulation) show\n"; file_unit << "%\n"; file_unit << "% Define a clipping polygon.\n"; file_unit << "%\n"; file_unit << "newpath\n"; file_unit << x_ps_min_clip << " " << y_ps_min_clip << " moveto\n"; file_unit << x_ps_max_clip << " " << y_ps_min_clip << " lineto\n"; file_unit << x_ps_max_clip << " " << y_ps_max_clip << " lineto\n"; file_unit << x_ps_min_clip << " " << y_ps_max_clip << " lineto\n"; file_unit << x_ps_min_clip << " " << y_ps_min_clip << " lineto\n"; file_unit << "clip newpath\n"; // // Draw the nodes. // if ( 1 <= node_show ) { circle_size = 5; file_unit << "%\n"; file_unit << "% Draw filled dots at the nodes.\n"; file_unit << "%\n"; file_unit << "% Set the RGB color to blue.\n"; file_unit << "%\n"; file_unit << "0.000 0.150 0.750 setrgbcolor\n"; file_unit << "%\n"; for ( node = 0; node < 3; node++ ) { x_ps = r8_nint ( ( ( x_max - node_xy[0+node*2] ) * ( double ) ( x_ps_min ) + ( node_xy[0+node*2] - x_min ) * ( double ) ( x_ps_max ) ) / ( x_max - x_min ) ); y_ps = r8_nint ( ( ( y_max - node_xy[1+node*2] ) * ( double ) ( y_ps_min ) + ( node_xy[1+node*2] - y_min ) * ( double ) ( y_ps_max ) ) / ( y_max - y_min ) ); file_unit << "newpath " << x_ps << " " << y_ps << " " << circle_size << " 0 360 arc closepath fill\n"; } } // // Label the nodes. // if ( 2 <= node_show ) { file_unit << "%\n"; file_unit << "% Label the nodes:\n"; file_unit << "%\n"; file_unit << "% Set the RGB color to darker blue.\n"; file_unit << "%\n"; file_unit << "0.000 0.250 0.850 setrgbcolor\n"; file_unit << "/Times-Roman findfont\n"; file_unit << "0.20 inch scalefont\n"; file_unit << "setfont\n"; file_unit << "%\n"; for ( node = 0; node < node_num; node++ ) { x_ps = r8_nint ( ( ( x_max - node_xy[0+node*2] ) * ( double ) ( x_ps_min ) + ( + node_xy[0+node*2] - x_min ) * ( double ) ( x_ps_max ) ) / ( x_max - x_min ) ); y_ps = r8_nint ( ( ( y_max - node_xy[1+node*2] ) * ( double ) ( y_ps_min ) + ( node_xy[1+node*2] - y_min ) * ( double ) ( y_ps_max ) ) / ( y_max - y_min ) ); file_unit << " " << x_ps << " " << y_ps + 5 << " moveto (" << node+1 << ") show\n"; } } // // Draw the points. // if ( point_num <= 200 ) { circle_size = 5; } else if ( point_num <= 500 ) { circle_size = 4; } else if ( point_num <= 1000 ) { circle_size = 3; } else if ( point_num <= 5000 ) { circle_size = 2; } else { circle_size = 1; } if ( 1 <= point_show ) { file_unit << "%\n"; file_unit << "% Draw filled dots at the points.\n"; file_unit << "%\n"; file_unit << "% Set the RGB color to green.\n"; file_unit << "%\n"; file_unit << "0.150 0.750 0.000 setrgbcolor\n"; file_unit << "%\n"; for ( point = 0; point < point_num; point++ ) { x_ps = r8_nint ( ( ( x_max - point_xy[0+point*2] ) * ( double ) ( x_ps_min ) + ( point_xy[0+point*2] - x_min ) * ( double ) ( x_ps_max ) ) / ( x_max - x_min ) ); y_ps = r8_nint ( ( ( y_max - point_xy[1+point*2] ) * ( double ) ( y_ps_min ) + ( point_xy[1+point*2] - y_min ) * ( double ) ( y_ps_max ) ) / ( y_max - y_min ) ); file_unit << "newpath " << x_ps << " " << y_ps << " " << circle_size << " 0 360 arc closepath fill\n"; } } // // Label the points. // if ( 2 <= point_show ) { file_unit << "%\n"; file_unit << "% Label the point:\n"; file_unit << "%\n"; file_unit << "% Set the RGB color to darker green.\n"; file_unit << "%\n"; file_unit << "0.250 0.850 0.000 setrgbcolor\n"; file_unit << "/Times-Roman findfont\n"; file_unit << "0.20 inch scalefont\n"; file_unit << "setfont\n"; file_unit << "%\n"; for ( point = 0; point < point_num; point++ ) { x_ps = r8_nint ( ( ( x_max - point_xy[0+point*2] ) * ( double ) ( x_ps_min ) + ( + point_xy[0+point*2] - x_min ) * ( double ) ( x_ps_max ) ) / ( x_max - x_min ) ); y_ps = r8_nint ( ( ( y_max - point_xy[1+point*2] ) * ( double ) ( y_ps_min ) + ( point_xy[1+point*2] - y_min ) * ( double ) ( y_ps_max ) ) / ( y_max - y_min ) ); file_unit << " " << x_ps << " " << y_ps + 5 << " moveto (" << point+1 << ") show\n"; } } // // Draw the triangle. // if ( 0 <= node_show ) { file_unit << "%\n"; file_unit << "% Set the RGB color to red.\n"; file_unit << "%\n"; file_unit << "0.900 0.200 0.100 setrgbcolor\n"; file_unit << "%\n"; file_unit << "% Draw the triangle.\n"; file_unit << "%\n"; file_unit << "newpath\n"; for ( i = 0; i <= 3; i++ ) { node = i4_wrap ( i, 0, 2 ); x_ps = ( r8_nint ) ( ( ( x_max - node_xy[0+node*2] ) * ( double ) ( x_ps_min ) + ( node_xy[0+node*2] - x_min ) * ( double ) ( x_ps_max ) ) / ( x_max - x_min ) ); y_ps = ( r8_nint ) ( ( ( y_max - node_xy[1+node*2] ) * ( double ) ( y_ps_min ) + ( node_xy[1+node*2] - y_min ) * ( double ) ( y_ps_max ) ) / ( y_max - y_min ) ); if ( i == 0 ) { file_unit << x_ps << " " << y_ps << " moveto\n"; } else { file_unit << x_ps << " " << y_ps << " lineto\n"; } } file_unit << "stroke\n"; } file_unit << "%\n"; file_unit << "restore showpage\n"; file_unit << "%\n"; file_unit << "% End of page.\n"; file_unit << "%\n"; file_unit << "%%Trailer\n"; file_unit << "%%EOF\n"; file_unit.close ( ); return; }
carlomr/tspeed
lib/src/Dunavant.cpp
C++
gpl-3.0
91,635
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>St. Thomas More - NFCS</title> <link rel="shortcut icon" type="image/x-icon" href="logo.ico"> <!-- google fonts --> <link href='http://fonts.googleapis.com/css?family=Lato:400,300italic,300,700%7CPlayfair+Display:400,700italic%7CRoboto:300%7CMontserrat:400,700%7COpen+Sans:400,300%7CLibre+Baskerville:400,400italic' rel='stylesheet' type='text/css'> <!-- Bootstrap --> <link href="assets/css/bootstrap.min.css" rel="stylesheet"> <link href="assets/css/bootstrap-theme.css" rel="stylesheet"> <link href="assets/css/font-awesome.min.css" rel="stylesheet"> <link href="assets/revolution-slider/css/settings.css" rel="stylesheet"> <link href="assets/css/global.css" rel="stylesheet"> <link href="assets/css/style.css" rel="stylesheet"> <link href="assets/css/responsive.css" rel="stylesheet"> <link href="assets/css/skin.css" rel="stylesheet"> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <!--Header Section Start Here --> <?php include_once ("includes/header.php"); ?> <!-- Header Section End Here --> <!-- site content --> <div id="main"> <!-- Breadcrumb Section Start Here --> <div class="breadcrumb-section"> <div class="container"> <div class="row"> <div class="col-xs-12"> <h1>Portfolio </h1> <ul class="breadcrumb"> <li> <a href="index.php">Home</a> </li> <li class="active"> NFCS </li> </ul> </div> </div> </div> </div> <!-- Breadcrumb Section End Here --> <div class="content-wrapper" id="page-info"> <!-- portfolio detail sections --> <div class="container"> <div class="row"> <div class="col-xs-12"> <header class="page-header section-header text-left"> <h2>NFCS</h2> </header> <!--<div class="portfolio-detail-description">--> <div class="row"> <div class="col-xs-12 col-sm-12"> <section class="slider-wrap flex-slide flexslider"> <ul class="slides"> <li> <img alt="" src="assets/img/portfolio.jpg"> </li> <li> <img alt="" src="assets/img/portfolio.jpg"> </li> </ul> </section> </div> </div> <div class="row portfolio-details"> <div class="col-xs-12"> <div class="detail-description"> <strong class="detail-summary"> Phllus felis purus placerat vel augue vitae aliquam tincidunt dolor sed hendrerit diam in mat tis mollis donecut Phasellus felis purus placerat vel augue vitae, aliquam tincidunt dolor. Sed hendrerit diam in mattis mollis. </strong> <p> Phllus felis purus placerat vel augue vitae aliquam tincidunt dolor sed hendrerit diam in mat tis mollis donecut Phasellus felis purus placerat vel augue vitae, aliquam tincidunt dolor. Sed hendrerit diam in mattis mollis. Donec ut tincidunt magna. Nullam hendrerit pellentesque pellentesque. Sed ultrices arcu non dictum porttitor. Phllus felis purus placerat vel augue vitae aliquam tincidunt dolor sed hendrerit diam in mat tis mollis donecut Phasellus felis purus placerat vel augue vitae, aliquam tincidunt dolor. </p> <p> Phllus felis purus placerat vel augue vitae aliquam tincidunt dolor sed hendrerit diam in mat tis mollis donecut Phasellus felis purus placerat vel augue vitae, aliquam tincidunt dolor. </p> <ul class="list-unstyled yello-icon"> <li> Become genuinely interested in the other person Nam ac leo arcu At eget congu </li> <li> Smile (very important). </li> <li> Remember that a person’s name is to that person tost important sound in any language. </li> <li> Be a good listener Encourage others to talk about themselves congue jptos himenaeos </li> <li> Speak in terms of the other person’s interests Nam ac leo arat Suspendisse eget </li> <li> Make the other person feel important and do it sincerely </li> <li> that a person’s name is to that person the sweetest andound in any language. </li> </ul> <a class="btn btn-default" href="#">BUTTON</a> </div> <div class="page-header section-header clearfix"> <h2>Meet Your <strong> Executives</strong></h2> </div> <div class="bs-example"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> <i class="fa fa-plus-circle fa-minus-circle toggel-icon"></i> President </a></h4> </div> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-5"> <img src="assets/img/img-slide-01.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"> <i class="fa fa-plus-circle toggel-icon"></i> Vice President</a></h4> </div> <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-5"> <img src="assets/img/img-slide-01.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseThree"> <i class="fa fa-plus-circle toggel-icon"></i> General Secretary and Assistant General Secretary </a></h4> </div> <div id="collapseThree" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-8"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!-- end panel--> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseFour"> <i class="fa fa-plus-circle toggel-icon"></i> P.R.O 1 and P.R.O 2 </a></h4> </div> <div id="collapseFour" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-8"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!-- end panel--> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseFive"> <i class="fa fa-plus-circle toggel-icon"></i> Treasurer</a></h4> </div> <div id="collapseFive" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-5"> <img src="assets/img/img-slide-01.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!--end panel--> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseSix"> <i class="fa fa-plus-circle toggel-icon"></i> Financial Secretary</a></h4> </div> <div id="collapseSix" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-5"> <img src="assets/img/img-slide-01.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!-- end panel--> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseSeven"> <i class="fa fa-plus-circle toggel-icon"></i> D.O.S 1 and D.O.S 2 </a></h4> </div> <div id="collapseSeven" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-8"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!-- end panel--> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseSeven"> <i class="fa fa-plus-circle toggel-icon"></i> Welfare 1 and Welfare 2 </a></h4> </div> <div id="collapseSeven" class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-8"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-xs-12 col-sm-3"> <img src="assets/img/portfolio1.jpg" alt=""> </div> <div class="col-xs-12 col-sm-7"> <strong class="article-sammury"> Lorem ipsum dolor sit amet consectetur adipiscing elit Integer feugiat dolor nibh Cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Nam consectetur </strong> <p> Gravida sodales commodo nullam fringilla in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor venenatis quis eu est quisque a pellentesque dui vitae tempus augue curabitu quis mattis mi proin varius sed enim sit amet lobortis In hac </p> <p> Habitasse platea dictumst cras sit amet est eget dui viverra scelerisque duis semper pulvinar in risus ac bibendum aenean hendrerit pharetra nisl Sed sit am etsapien et elit porttitor </p> </div> </div> </div> </div> </div> <!-- end panel--> </div> </div> </div> </div> </div> </div> </div> <!-- sections end --> </div> </div> </div> </div> <!-- site content ends --> <!--Footer Section Start Here --> <?php include_once ("includes/footer.php"); ?> <!--Footer Section End Here --> </div> <script src="assets/js/jquery.min.js"></script> <!-- Bootstrap Js--> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/jquery.easing.min.js"></script> <!--Main Slider Js--> <script src="assets/revolution-slider/js/jquery.themepunch.plugins.min.js"></script> <script src="assets/revolution-slider/js/jquery.themepunch.revolution.js"></script> <!--Main Slider Js End --> <script src="assets/js/jquery.flexslider.js"></script> <script src="assets/js/site.js"></script> </body> </html>
dumebi/thomasmore
nfcs.php
PHP
gpl-3.0
24,874
#include "ThreadPinger.h" #include "Service.h" #undef MSEC_PING_SLEEP_TIME #define MSEC_PING_SLEEP_TIME 5 void ThreadPinger() { while ( true ) { SLEEP ( 5 ); // firstly "hack" the not ping status. A pinged() event will anyway solve this. Service::getMe()->notPinged(); if ( Service::getMe()->getPingCounter() > 5 ) { LOG ( "Daemon highly possible disappeared... trying to re-register\n" ); if ( !Service::getMe()->registerToDaemon() ) { LOG ( "Cannot register to the daemon this run, retrying in 5 seconds\n" ); } else { LOG ( "Succesfully re-registered\n" ); Service::getMe()->pinged(); } } LOG ( "ThreadPinger(): Loop\n" ); SCOPEDLOCK ( dispatcherMutex ); for ( STL_SUBSCRIPTIONINFO::iterator it = subscriptions.begin(); it != subscriptions.end(); ) { CI_RESPONSE response = ( *it )->ci->ping(); if ( response == CI_ERRCANTCONNECT ) { LOG ( "ThreadPinger() : ERROR PINGING '%s'. REMOVING IT.\n", C_STR ( ( *it )->ci->clientIp ) ); delete ( *it ); it = subscriptions.erase ( it ); } else { it++; } } } }
fritzone/pici-nms
Dispatcher/ThreadPinger.cpp
C++
gpl-3.0
1,433
# gensim modules from gensim import utils from gensim.models.doc2vec import LabeledSentence from gensim.models import Doc2Vec # numpy import numpy # shuffle from random import shuffle # logging import logging import os.path import sys import cPickle as pickle program = os.path.basename(sys.argv[0]) logger = logging.getLogger(program) logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s') logging.root.setLevel(level=logging.INFO) logger.info("running %s" % ' '.join(sys.argv)) class LabeledLineSentence(object): def __init__(self, sources): self.sources = sources flipped = {} # make sure that keys are unique for key, value in sources.items(): if value not in flipped: flipped[value] = [key] else: raise Exception('Non-unique prefix encountered') def __iter__(self): for source, prefix in self.sources.items(): with utils.smart_open(source) as fin: for item_no, line in enumerate(fin): yield LabeledSentence(utils.to_unicode(line).split(), [prefix + '_%s' % item_no]) def to_array(self): self.sentences = [] for source, prefix in self.sources.items(): with utils.smart_open(source) as fin: for item_no, line in enumerate(fin): self.sentences.append(LabeledSentence( utils.to_unicode(line).split(), [prefix + '_%s' % item_no])) return self.sentences def sentences_perm(self): shuffle(self.sentences) return self.sentences #sources = {'test-neg.txt':'TEST_NEG', 'test-pos.txt':'TEST_POS', 'train-neg.txt':'TRAIN_NEG', 'train-pos.txt':'TRAIN_POS', 'train-unsup.txt':'TRAIN_UNS'} model.save('./enwiki_quality_train.d2v') model = Doc2Vec.load './enwiki_quality_train.d2v') def convert_array_to_string (data): res = "" for i in range(len(data)): res = res + str (data[i]) if (i < len(data) - 1): res = res + '\t' return res def write_array_to_file (file_name, array_data): f = open (file_name, "w") for i in range (len(array_data)): f.write (str(array_data[i]) + "\n") f.close () qualities = ['FA','GA','B','C','START','STUB'] train_labels = [0] * 23577 train_content_file = "doc2vec_train_content_separated.txt" train_label_file = "doc2vec_train_label_separated.txt" train_cnt = 0 for i in range (len(qualities)): for j in range (30000): key = 'TRAIN_' + qualities[i] + "_" + str(j) if key in model.docvecs: data = model.docvecs[key] if (len(data) == 500): with open(train_content_file, "a") as myfile: myfile.write(convert_array_to_string (data)) myfile.write("\n") train_labels [train_cnt] = qualities[i] train_cnt += 1 write_array_to_file (file_name = train_label_file, array_data = train_labels)
vinhqdang/doc2vec_dnn_wikipedia
code/load_pre_train.py
Python
gpl-3.0
3,073
package de.bu.service.identifierservice.impl; import javax.inject.Inject; import javax.jws.WebMethod; import javax.jws.WebService; import de.bu.service.identifierservice.api.IdentifierBlock; import de.bu.service.identifierservice.api.IdentifierCreationException; @WebService(endpointInterface = "de.bu.service.identifierservice.api.IdentifierCreationService") public class DefaultIdentifierCreationService implements IdentifierCreationService<Long> { @LongIdentifier @Database @Inject private IdentifierReservationTransactionScript<Long> longDatabaseIdentifierReseverationTransactionScript; @WebMethod @Override public Long createSingleIdentifier(String owner) throws IdentifierCreationException { IdentifierBlock<Long> identifierBlock = longDatabaseIdentifierReseverationTransactionScript .createSingleIdentifierBlock(owner); return identifierBlock.getStartValue(); } @WebMethod @Override public IdentifierBlock<Long> createIdentifierBlock(String owner, int size) throws IdentifierCreationException { IdentifierBlock<Long> identifierBlock = longDatabaseIdentifierReseverationTransactionScript .createIdentifierBlock(owner, size); return identifierBlock; } }
pbuchholz/identifierservice
de.bu.service.indentifierservice-impl/src/main/java/de/bu/service/identifierservice/impl/DefaultIdentifierCreationService.java
Java
gpl-3.0
1,222
///////////////////////////////////////////////////////////////////////////////// // // Jobbox WebGUI // Copyright (C) 2014-2015 Komatsu Yuji(Zheng Chuyu) // // 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 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // ///////////////////////////////////////////////////////////////////////////////// Ext.define('Jobbox.controller.editor.Tree', { extend: 'Ext.app.Controller', refs: [{ ref: 'editorTree', selector: 'editorTree' }, { ref: 'editorTreeMenu', selector: 'editorTreeMenu' }, { ref: 'editorTab', selector: 'editorTab' }, { ref: 'editorList', selector: 'editorList' }, { ref: 'editorShow', selector: 'editorShow' }], ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// init: function() { this.control({ 'editorTree': { afterrender: this.onAfterrender, itemclick: this.onItemclick, itemcontextmenu: this.onItemcontextmenu }, 'editorTree treeview': { beforedrop: this.onBeforedrop, drop: this.onDrop }, }); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onAfterrender: function(tree) { var me = this; Ext.create('Jobbox.view.editor.TreeMenu'); Ext.create('Jobbox.view.editor.JobunitFile'); var store = tree.getStore(); store.setRootNode({ id: 0, name: '/', kind: 0, parent_id: 0, }); me.onLoadJobunit(0); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onItemclick: function(view, record, item, index, e) { var me = this; me.onLoadJobunit(record.data.id); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onItemcontextmenu: function(tree, record, item, index, e, eOpts) { var me = this; var menu = me.getEditorTreeMenu(); menu.showAt(e.getXY()); e.stopEvent(); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onBeforedrop: function(node, data, overModel, dropPosition, dropHandlers, eOpts) { var proc = false; dropHandlers.wait = true; data.records.every(function(record) { proc = false; if (overModel.data.id == 0 && record.data.kind >= JOBUNIT_KIND_ROOTJOBNET) { Ext.Msg.alert(I18n.t('views.msg.error'), I18n.t('views.msg.create_rootjobnet')); return false; } if (overModel.data.kind >= JOBUNIT_KIND_ROOTJOBNET && record.data.kind < JOBUNIT_KIND_ROOTJOBNET) { return false; } proc = true; }); if (proc) { dropHandlers.processDrop(); } else { dropHandlers.cancelDrop(); } }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onDrop: function(node, data, overModel, dropPosition, eOpts) { var me = this; data.records.forEach(function(record) { var child = null; if (data.copy) { child = new Jobbox.model.JobunitChild(record.data); } else { child = record; } child.set('parent_id', overModel.data.id); if (child.data.kind >= JOBUNIT_KIND_ROOTJOBNET) { if (overModel.data.kind < JOBUNIT_KIND_ROOTJOBNET) { child.set('kind', JOBUNIT_KIND_ROOTJOBNET); child.set('x', 0); child.set('y', 0); } else { child.set('kind', JOBUNIT_KIND_JOBNET); } } child.save({ failure: function(rec, response) { Ext.Msg.alert(I18n.t('views.msg.error'), I18n.t('views.msg.move_jobunit_failed') + " '" + child.data.name + "'"); me.onLoadJobunit(0); }, }); }); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onLoadJobunit: function(id) { var me = this; // check editing if (jobbox_selected_rootjobnet) { var rootjobnet_id = me.onGetRootjobnet(id); if (rootjobnet_id != jobbox_selected_rootjobnet.data.jobunit_id && jobbox_selected_rootjobnet.data.user_id == jobbox_login_user.data.id) { Ext.Msg.alert(I18n.t('views.msg.error'), I18n.t('views.msg.unlock_rootjobnet')); me.onLoadJobunit(jobbox_selected_parent.data.id); return; } } // expand tree var tree = me.getEditorTree(); var store = tree.getStore(); var node = store.getNodeById(id); store.load({ url: location.pathname + '/jobunits', node: node, callback: function(records, operation, success) { tree.selectPath(node.getPath()); tree.expandPath(node.getPath()); } }); //set tab title var tab = me.getEditorTab(); var title = '/'; if (id > 0) title = node.getPath('name').slice(2); tab.setTitle(title); // reset parent & rootjobnet jobbox_mask.show(); jobbox_selected_parent = null; me.onSetRootjobnet(id); Jobbox.model.Jobunit.load(id, { callback: function() { jobbox_mask.hide(); }, success: function(record) { jobbox_selected_parent = record; // set jobunit information var form = me.getEditorShow(); form.loadRecord(jobbox_selected_parent); // set children if (jobbox_selected_parent['jobbox.model.jobunitsStore']) { jobbox_selected_parent['jobbox.model.jobunitsStore'].sort([{ property: 'kind', direction: 'ASC' }, { property: 'name', direction: 'ASC' }]); var grid = me.getEditorList(); grid.reconfigure(jobbox_selected_parent['jobbox.model.jobunitsStore']); } // set connectors if (jobbox_selected_parent['jobbox.model.connectorsStore']) { jobbox_selected_parent['jobbox.model.connectorsStore'].getProxy().url = location.pathname + '/jobunits/' + jobbox_selected_parent.data.id + '/connectors'; } // set tab icon and active_tab var ctrl = Jobbox.app.getController('editor.Flowchart'); switch (jobbox_selected_parent.data.kind) { case JOBUNIT_KIND_JOBGROUP: { tab.setIcon(location.pathname + '/ext/resources/themes/images/default/tree/folder-open.gif'); tab.setActiveTab('editor_list'); break; } case JOBUNIT_KIND_ROOTJOBNET: case JOBUNIT_KIND_JOBNET: { tab.setIcon(location.pathname + '/images/icons/chart_organisation.png'); tab.setActiveTab('editor_detail'); ctrl.onDrawFlowchart(jobbox_selected_parent); break; } default: { tab.setIcon(location.pathname + '/images/icons/server.png'); tab.setActiveTab('editor_list'); } } } }); }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onGetRootjobnet: function(id) { var me = this; var tree = me.getEditorTree(); var store = tree.getStore(); var node = store.getNodeById(id); if (!node) return 0; while (true) { if (node.data.kind <= JOBUNIT_KIND_ROOTJOBNET || node.data.id == 0) break; node = node.parentNode; } if (node.data.kind != JOBUNIT_KIND_ROOTJOBNET) return 0; return node.data.id; }, ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// onSetRootjobnet: function(id) { var me = this; var tree = me.getEditorTree(); var store = tree.getStore(); var node = store.getNodeById(id); jobbox_selected_rootjobnet = null; if (!node) return; while (true) { if (node.data.kind <= JOBUNIT_KIND_ROOTJOBNET || node.data.id == 0) break; node = node.parentNode; } if (node.data.kind != JOBUNIT_KIND_ROOTJOBNET) return; Jobbox.model.Jobunit.load(node.data.id, { success: function(record) { jobbox_selected_rootjobnet = record['Jobbox.model.RootjobnetHasOneInstance']; jobbox_selected_rootjobnet.getProxy().url = location.pathname + '/jobunits/' + record.data.id + '/rootjobnets'; var ctrl = Jobbox.app.getController('editor.Detail'); ctrl.onSetCheckbox(); } }); }, });
komatsuyuji/jobbox
frontends/public/app/controller/editor/Tree.js
JavaScript
gpl-3.0
10,826
package us.mcpvpmod.config.maze; import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL; import java.io.File; import java.util.ArrayList; import java.util.List; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import us.mcpvpmod.Server; import us.mcpvpmod.game.alerts.SoundAlert; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; public class ConfigMazeSounds extends DummyModContainer { public static String soundStreakEnd; public static String soundStreak; public static String fileName = "mcpvp_maze_sounds.cfg"; private static Configuration config; public ConfigMazeSounds() { config = null; File cfgFile = new File(Loader.instance().getConfigDir(), fileName); config = new Configuration(cfgFile); syncConfig(); } public static Configuration getConfig() { if (config == null) { File cfgFile = new File(Loader.instance().getConfigDir(), fileName); config = new Configuration(cfgFile); } syncConfig(); return config; } public static void syncConfig() { if (config == null) { File cfgFile = new File(Loader.instance().getConfigDir(), fileName); config = new Configuration(cfgFile); } List<String> propOrder = new ArrayList<String>(); Property prop; prop = config.get(CATEGORY_GENERAL, "soundKit", "mob.villager.yes"); prop.setLanguageKey("maze.config.sounds.kit"); propOrder.add(prop.getName()); new SoundAlert("maze.kit", prop.getString(), Server.MAZE); prop = config.get(CATEGORY_GENERAL, "soundPlayerKilled", "mob.villager.yes"); prop.setLanguageKey("maze.config.sounds.playerKilled"); propOrder.add(prop.getName()); new SoundAlert("maze.playerKilled", prop.getString(), Server.MAZE); prop = config.get(CATEGORY_GENERAL, "soundTeamOut", "mob.wither.death, 0.2F"); prop.setLanguageKey("maze.config.sounds.teamOut"); propOrder.add(prop.getName()); new SoundAlert("maze.team.out", prop.getString(), Server.MAZE); prop = config.get(CATEGORY_GENERAL, "soundHunger", "mob.pig.say"); prop.setLanguageKey("maze.config.sounds.hunger"); propOrder.add(prop.getName()); new SoundAlert("maze.hunger", prop.getString(), Server.MAZE); config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder); if (config.hasChanged()) { FMLLog.info("[MCPVP] Syncing configuration for %s", fileName); config.save(); } } }
NomNuggetNom/mcpvp-mod
src/main/java/us/mcpvpmod/config/maze/ConfigMazeSounds.java
Java
gpl-3.0
2,835
#include "UpkeepInstruction.hpp" #include "Instruction/PopulationGrowthInstruction.hpp" #include "Instruction/EndGameInstruction.hpp" #include "Instruction/DecimateGoldInstruction.hpp" UpkeepInstruction::UpkeepInstruction(BoardModel *boardModel) : Instruction(), boardModel(boardModel) {} void UpkeepInstruction::initInstruction() { this->boardModel->printMessage(" "); this->boardModel->printMessage("UPKEEP:"); this->boardModel->printMessage(" "); this->boardModel->printMessage("Decimate unsupported tribes."); this->boardModel->printMessage("A region can support as much tribes as there are Mountains,"); this->boardModel->printMessage("Volcanoes, Farms, Forests and City AV in that region added up."); this->boardModel->decimateUnsupportedTribes(); this->boardModel->printMessage(" "); this->boardModel->printMessage("Press Done to continue..."); this->boardModel->printMessage(" "); } Instruction *UpkeepInstruction::triggerDone() { Instruction *next = new DecimateGoldInstruction(this->boardModel); next->initInstruction(); return next; }
Ryoga-Unryu/pocketciv
Instruction/UpkeepInstruction.cpp
C++
gpl-3.0
1,108
<?php /** * This is part of rampage.php * Copyright (c) 2013 Axel Helmert * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category library * @author Axel Helmert * @copyright Copyright (c) 2013 Axel Helmert * @license http://www.gnu.org/licenses/gpl-3.0.txt GNU General Public License */ namespace rampage\core\view; use rampage\core\resources\ThemeInterface; use Zend\View\Resolver\ResolverInterface as ViewResolverInterface; use Zend\View\Renderer\RendererInterface; class TemplateLocator implements ViewResolverInterface { /** * @var ThemeInterface */ private $theme = null; /** * @param ThemeInterface $theme */ public function __construct(ThemeInterface $theme) { $this->theme = $theme; } /** * {@inheritdoc} * @see \Zend\View\Resolver\ResolverInterface::resolve() */ public function resolve($name, RendererInterface $renderer = null) { $name .= '.phtml'; $file = $this->theme->resolve('template', $name, null, true); if (($file !== false) && $file->isFile() && $file->isReadable()) { return $file->getPathname(); } // TODO: Fallback - about to be removed @list($scope, $path) = explode('/', $name, 2); $file = $this->theme->resolve('template', $path, $scope, true); if (($file === false) || !$file->isFile() || !$file->isReadable()) { return false; } trigger_error(sprintf('Found resource template "@%s". You should prefix them with "@" since this fallback will be removed in the next release!', $name), E_USER_WARNING); return $file->getPathname(); } }
tux-rampage/rampage-php
library/rampage/core/view/TemplateLocator.php
PHP
gpl-3.0
2,284
<?php // This file is part of the Open iframe block for Moodle // // Moodle 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 3 of the License, or // (at your option) any later version. // // Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>. $string['pluginname'] = 'Open Iframe';
davosmith/moodle-block_openiframe
lang/en/block_openiframe.php
PHP
gpl-3.0
735
// Decompiled with JetBrains decompiler // Type: Wb.Lpw.Game.Common.Descriptions.StagingTaskDesc_PlaceNUEDelimiter // Assembly: Wb.Lpw.Game.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null // MVID: 3C4BDCBA-73F8-4BAA-AC19-A98EC2D71189 // Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\Wb.Lpw.Game.Common.dll using Wb.Lpw.Shared.Common.DataTypes; namespace Wb.Lpw.Game.Common.Descriptions { public class StagingTaskDesc_PlaceNUEDelimiter : StagingTaskBaseDesc { public DBBoolean EnableDelimiter; public Vector3 Position; public float Length; public override eStagingTask GetEnum() { return eStagingTask.PlaceNUEDelimiter; } } }
mater06/LEGOChimaOnlineReloaded
LoCO Client Files/Decompressed Client/Extracted DLL/Wb.Lpw.Game.Common/Wb/Lpw/Game/Common/Descriptions/StagingTaskDesc_PlaceNUEDelimiter.cs
C#
gpl-3.0
784
;(function() { 'use strict'; /*this is only to be used in tests, so the same grid doesn't need to be repeated over and over. it is the smallest solvable level that can be produced in Sokoban, but already solved.*/ angular.module('meanieBanApp') .factory('smallestSolvableSolved', smallestSolvableSolved); function smallestSolvableSolved(tileUtility) { return tileUtility.stringGridToChars([ ['wall', 'wall', 'wall', 'wall', 'wall'], ['wall', 'box-docked', 'worker', 'floor', 'wall'], ['wall', 'wall', 'wall', 'wall', 'wall'] ]); } })();
simonwendel/meanieban
client/test/utilities/smallestsolvablesolved.js
JavaScript
gpl-3.0
629
/* _______ __ __ __ ______ __ __ _______ __ __ * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004, 2005, 2006, 2007 Olof Naessén and Per Larsson * * Js_./ * Per Larsson a.k.a finalman _RqZ{a<^_aa * Olof Naessén a.k.a jansem/yakslem _asww7!uY`> )\a// * _Qhm`] _f "'c 1!5m * Visit: http://guichan.darkbits.org )Qk<P ` _: :+' .' "{[ * .)j(] .d_/ '-( P . S * License: (BSD) <Td/Z <fP"5(\"??"\a. .L * Redistribution and use in source and _dV>ws?a-?' ._/L #' * binary forms, with or without )4d[#7r, . ' )d`)[ * modification, are permitted provided _Q-5'5W..j/?' -?!\)cam' * that the following conditions are met: j<<WP+k/);. _W=j f * 1. Redistributions of source code must .$%w\/]Q . ."' . mj$ * retain the above copyright notice, ]E.pYY(Q]>. a J@\ * this list of conditions and the j(]1u<sE"L,. . ./^ ]{a * following disclaimer. 4'_uomm\. )L);-4 (3= * 2. Redistributions in binary form must )_]X{Z('a_"a7'<a"a, ]"[ * reproduce the above copyright notice, #}<]m7`Za??4,P-"'7. ).m * this list of conditions and the ]d2e)Q(<Q( ?94 b- LQ/ * following disclaimer in the <B!</]C)d_, '(<' .f. =C+m * documentation and/or other materials .Z!=J ]e []('-4f _ ) -.)m]' * provided with the distribution. .w[5]' _[ /.)_-"+? _/ <W" * 3. Neither the name of Guichan nor the :$we` _! + _/ . j? * names of its contributors may be used =3)= _f (_yQmWW$#( " * to endorse or promote products derived - W, sQQQQmZQ#Wwa].. * from this software without specific (js, \[QQW$QWW#?!V"". * prior written permission. ]y:.<\.. . * -]n w/ ' [. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT )/ )/ ! * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY < (; sac , ' * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, ]^ .- % * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF c < r * MERCHANTABILITY AND FITNESS FOR A PARTICULAR aga< <La * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 5% )P'-3L * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR _bQf` y`..)a * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ,J?4P'.P"_(\?d'., * EXEMPLARY, OR CONSEQUENTIAL DAMAGES _Pa,)!f/<[]/ ?" * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT _2-..:. .r+_,.. . * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ?a.<%"' " -'.a_ _, * 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 GCN_MOUSELISTENER_HPP #define GCN_MOUSELISTENER_HPP #include "guisan/mouseevent.hpp" #include "guisan/platform.hpp" namespace gcn { /** * Mouse listeners base class. Inorder to use this class you must inherit * from it and implements it's functions. MouseListeners listen for mouse * events on a Widgets. When a Widget recives a mouse event, the * corresponding function in all it's mouse listeners will be called. * * @see Widget::addMouseListener */ class GCN_CORE_DECLSPEC MouseListener { public: /** * Destructor. */ virtual ~MouseListener() = default; /** * Called when the mouse has entered into the widget area. * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mouseEntered(MouseEvent& mouseEvent) { } /** * Called when the mouse has exited the widget area. * * @param mouseEvent describes the event. */ virtual void mouseExited(MouseEvent& mouseEvent) { } /** * Called when a mouse button has been pressed on the widget area. * * NOTE: A mouse press is NOT equal to a mouse click. * Use mouseClickMessage to check for mouse clicks. * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mousePressed(MouseEvent& mouseEvent) { } /** * Called when a mouse button has been released on the widget area. * * @param mouseEvent describes the event. */ virtual void mouseReleased(MouseEvent& mouseEvent) { } /** * Called when a mouse button is pressed and released (clicked) on * the widget area. * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mouseClicked(MouseEvent& mouseEvent) { } /** * Called when the mouse wheel has moved up on the widget area. * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) { } /** * Called when the mouse wheel has moved down on the widget area. * * @param mousEvent describes the event. * @since 0.6.0 */ virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) { } /** * Called when the mouse has moved in the widget area and no mouse button * has been pressed (i.e no widget is being dragged). * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mouseMoved(MouseEvent& mouseEvent) { } /** * Called when the mouse has moved and the mouse has previously been * pressed on the widget. * * @param mouseEvent describes the event. * @since 0.6.0 */ virtual void mouseDragged(MouseEvent& mouseEvent) { } protected: /** * Constructor. * * You should not be able to make an instance of MouseListener, * therefore its constructor is protected. To use MouseListener * you must inherit from this class and implement it's * functions. */ MouseListener() = default; }; } #endif // end GCN_MOUSELISTENER_HPP
HoraceAndTheSpider/amiberry
guisan-dev/include/guisan/mouselistener.hpp
C++
gpl-3.0
6,607
package pl.adjule.web.rest.submission.detail; import lombok.Data; @Data public class AddSubmissionView { private String problemCode; private String userLogin; private String language; private String source; }
kTT/adjule
adjule-ws/src/main/java/pl/adjule/web/rest/submission/detail/AddSubmissionView.java
Java
gpl-3.0
227
define(['jquery', 'system', 'i18n'], function($,_system,i18n){ 'use strict'; var remote = null; function init () { remote = remote || window.apis.services.partition; }; var partial = { myalert: function (msg) { var $alert = $('#myalert'); $alert.off('click', '.js-close'); $alert.find('p.content').text(msg); $alert.modal(); }, getparts: function (data, iso, reflash_parts) { remote.getPartitions(function (disks) { disks = disks.reverse(); if(iso && iso.mode === "usb" ) { disks = _.reject(disks, function (disk) { return disk.path === iso.device.slice(0,8); }) } reflash_parts (data, disks); }); }, method: function (action, iso, args,callback) { init(); var func = remote[action]; var that = this; var msgs = { 1: i18n.gettext('Too many primary partitions.'), 2: i18n.gettext('Too many extended partitions.'), } var test = function (result) { if (result.status && result.status === "success") { that.getparts(result, iso, callback); }else { var msg_tmp = result.reason; var msg = i18n.gettext('Operation fails'); if (msg_tmp && msg_tmp.indexOf('@') === 1) { msg_tmp = msgs[msg_tmp[0]]; msg = msg + ":" + msg_tmp; }; that.myalert(msg); console.log(result); } }; args.push(test); func.apply(null, args); }, //calc the percent the part occupies at the disk calc_percent: function (disks) { var new_disks = _.map(disks, function (disk) { var dsize = disk.size; var exsize, expercent=0, diskpercent=0; _.each(disk.table, function (part){ if (part.ty !== "logical") { part.percent = (part.size/dsize < 0.03) ? 0.03:part.size/dsize; diskpercent += part.percent; if (part.ty === "extended") { exsize = part.size; } }else { part.percent = (part.size/exsize < 0.1) ? 0.1:part.size/exsize; expercent += part.percent; }; }); _.each(disk.table, function (part){ if (part.ty !== "logical") { part.percent = part.percent*100/diskpercent; }else { part.percent = part.percent*100/expercent; } }); return disk; }); return new_disks; }, //render easy and adcanced page render: function (disks, act, locals) { var that = this; var tys, pindex, $disk, tmpPage, actPage, dindex = 0; tys = ["primary", "free", "extended"];//logical is special _.each(disks, function (disk) { pindex = 0; $disk = $('ul.disk[dpath="'+disk.path+'"]'); _.each(disk.table, function (part){ part = that.part_proper(disk.path, disk.unit, part); var args = { pindex:pindex, dindex:dindex, part:part, path:disk.path, type:disk.type, gettext:locals.gettext, }; actPage = ""; if (part.number < 0) { tmpPage = (jade.compile($('#free_part_tmpl')[0].innerHTML))(args); if (act === true) { actPage = (jade.compile($('#create_part_tmpl')[0].innerHTML))(args); } }else{ tmpPage = (jade.compile($('#'+part.ty+'_part_tmpl')[0].innerHTML))(args); if (act === true && part.ty !== "extended") { actPage = (jade.compile($('#edit_part_tmpl')[0].innerHTML))(args); } }; if (_.indexOf(tys, part.ty) > -1) { $disk.append(tmpPage); }else { $disk.find('ul.logicals').append(tmpPage); }; if (part.ty !== "extended") { $disk.find('ul.selectable').last().after(actPage); } if (act === false) { $disk.find('ul.selectable').last().tooltip({title: part.title}); $disk.find('ul.part').prev('button.close').remove(); } pindex++; }); dindex++; }); }, //adjust some properties needed for easy and advanced page //eg:p.size=123.3444445 ===> p.size=123.34 //eg:p.fs=linux(1)-swap ===> p.fs=swap //eg:add:ui_path='sda3',title='sda3 ext4 34.56GB' part_proper: function (path, unit, part){ part.unit = unit; part.size = Number((part.size).toFixed(2)); if (part.number > 0) { part.ui_path = path.slice(5)+part.number; part.fs = part.fs || "Unknow"; part.fs = ((part.fs).match(/swap/g)) ? "swap" : part.fs; part.title = part.ui_path + " " + part.fs + " " + part.size + unit; }else { part.title = i18n.gettext("Free") + " " + part.size+unit; } return part; }, }; return partial; });
sonald/Red-Flag-Linux-Installer
examples/installer/client/assets/js/remote_part.js
JavaScript
gpl-3.0
6,162
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of SableCC. * * See the file "LICENSE" for copyright information and the * * terms and conditions for copying, distribution and * * modification of SableCC. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package org.sablecc.sablecc; import java.util.*; import org.sablecc.sablecc.analysis.*; import org.sablecc.sablecc.node.*; @SuppressWarnings({"rawtypes","unchecked"}) public class AlternativeElementTypes extends DepthFirstAdapter { private Map altElemTypes = new TypedHashMap(StringCast.instance, StringCast.instance); private ResolveIds ids; private String currentAlt; public AlternativeElementTypes(ResolveIds ids) { this.ids = ids; } public Map getMapOfAltElemType() { return altElemTypes; } @Override public void caseAAst(AAst node) {} @Override public void caseAProd(final AProd production) { Object []temp = production.getAlts().toArray(); for(int i = 0; i<temp.length; i++) { ((PAlt)temp[i]).apply(this); } } @Override public void caseAAlt(AAlt node) { currentAlt = (String)ids.names.get(node); Object []temp = node.getElems().toArray(); for(int i = 0; i<temp.length; i++) { ((PElem)temp[i]).apply(this); } } @Override public void inAElem(AElem node) { String elemType = (String)ids.elemTypes.get(node); if(node.getElemName() != null) { altElemTypes.put(currentAlt+"."+node.getElemName().getText(), elemType ); } else { altElemTypes.put(currentAlt+"."+node.getId().getText(), elemType ); } } }
renatocf/MAC0434-PROJECT
external/sablecc-3.7/src/org/sablecc/sablecc/AlternativeElementTypes.java
Java
gpl-3.0
1,765
#include <vector> #include <iostream> #include <algorithm> std::vector<int> modulus(std::vector<int> a); void multiplication(std::vector<int> a, std::vector<int> b) { std::vector<int> c; c.resize(a.size() + b.size() - 1); for (int x = 0; x < b.size(); x++) { for (int y = 0; y < a.size(); y++) { c[x + y] += a[y] * b[x]; } } for (int x = 0; x < c.size(); x++) { c[x] %= 2; } std::cout << std::endl << "\n\tIloczyn przed modulacja: \t\t"; for (int x = 0; x < c.size(); x++) { std::cout << "" << c[x] << ""; } c = modulus(c); std::cout << std::endl << "\tIloczyn po modulacji: \t\t"; for (int x = 0; x < c.size(); x++) { std::cout << "" << c[x] << ""; } std::cout << std::endl << std::endl; }
Tomashnikov/GF_Multiplication
GF_Multiplication/GF_Multiplication/multiplication.cpp
C++
gpl-3.0
730
/* * Copyright 2012 Justin Driggers <jtxdriggers@gmail.com> * * This file is part of Ventriloid. * * Ventriloid 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 3 of the License, or * (at your option) any later version. * * Ventriloid 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 Ventriloid. If not, see <http://www.gnu.org/licenses/>. */ package com.jtxdriggers.android.ventriloid; import java.util.ArrayList; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class ServerAdapter extends SQLiteOpenHelper { public static final String DATABASE_NAME = "ventriloiddata"; public static final int DATABASE_VERSION = 3; public static final String TABLE_SERVERS = "Servers"; public static final String KEY_ID = "ID"; public static final String KEY_USERNAME = "Username"; public static final String KEY_PHONETIC = "Phonetic"; public static final String KEY_SERVERNAME = "Servername"; public static final String KEY_HOSTNAME = "Hostname"; public static final String KEY_PORT = "Port"; public static final String KEY_PASSWORD = "Password"; public static final String CREATE_SERVERS_TABLE = "CREATE TABLE " + TABLE_SERVERS + "(" + KEY_ID + " INTEGER PRIMARY KEY, " + KEY_USERNAME + " TEXT NOT NULL, " + KEY_PHONETIC + " TEXT NOT NULL, " + KEY_SERVERNAME + " TEXT NOT NULL, " + KEY_HOSTNAME + " TEXT NOT NULL, " + KEY_PORT + " INTEGER NOT NULL, " + KEY_PASSWORD + " TEXT NOT NULL);"; public ServerAdapter(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_SERVERS_TABLE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if (oldVersion < 3) { db.execSQL("ALTER TABLE " + TABLE_SERVERS + " RENAME TO ServersTemp;"); db.execSQL(CREATE_SERVERS_TABLE); db.execSQL("INSERT INTO " + TABLE_SERVERS + "(" + KEY_ID + ", " + KEY_USERNAME + ", " + KEY_PHONETIC + ", " + KEY_SERVERNAME + ", " + KEY_HOSTNAME + ", " + KEY_PORT + ", " + KEY_PASSWORD + ") " + "SELECT _id, username, phonetic, " + "servername, hostname, portnumber, password " + "FROM ServersTemp;"); db.execSQL("DROP TABLE IF EXISTS ServersTemp;"); } } public void addServer(Server server) { SQLiteDatabase db = getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_USERNAME, server.getUsername()); values.put(KEY_PHONETIC, server.getPhonetic()); values.put(KEY_SERVERNAME, server.getServername()); values.put(KEY_HOSTNAME, server.getHostname()); values.put(KEY_PORT, server.getPort()); values.put(KEY_PASSWORD, server.getPassword()); db.insert(TABLE_SERVERS, null, values); db.close(); } public Server getServer(int id) { SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.query(true, TABLE_SERVERS, new String[] { KEY_ID, KEY_USERNAME, KEY_PHONETIC, KEY_SERVERNAME, KEY_HOSTNAME, KEY_PORT, KEY_PASSWORD }, KEY_ID + "=" + id, null, null, null, null, null); if (cursor != null) cursor.moveToFirst(); Server server = new Server(Integer.parseInt(cursor.getString(0)), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), Integer.parseInt(cursor.getString(5)), cursor.getString(6)); cursor.close(); db.close(); return server; } public ArrayList<Server> getAllServers() { ArrayList<Server> serverList = new ArrayList<Server>(); String selectQuery = "SELECT * FROM " + TABLE_SERVERS; SQLiteDatabase db = getWritableDatabase(); Cursor cursor = db.rawQuery(selectQuery, null); if (cursor.moveToFirst()) { do { Server server = new Server(); server.setId(Integer.parseInt(cursor.getString(0))); server.setUsername(cursor.getString(1)); server.setPhonetic(cursor.getString(2)); server.setServername(cursor.getString(3)); server.setHostname(cursor.getString(4)); server.setPort(Integer.parseInt(cursor.getString(5))); server.setPassword(cursor.getString(6)); serverList.add(server); } while (cursor.moveToNext()); } cursor.close(); db.close(); return serverList; } public ArrayList<String> getAllServersAsStrings() { ArrayList<String> serverList = new ArrayList<String>(); String selectQuery = "SELECT * FROM " + TABLE_SERVERS; SQLiteDatabase db = getWritableDatabase(); Cursor cursor = db.rawQuery(selectQuery, null); if (cursor.moveToFirst()) { do { Server server = new Server(); server.setUsername(cursor.getString(1)); server.setServername(cursor.getString(3)); server.setHostname(cursor.getString(4)); server.setPort(Integer.parseInt(cursor.getString(5))); serverList.add(server.getServername()); } while (cursor.moveToNext()); } cursor.close(); db.close(); if (serverList.size() < 1) serverList.add("No servers added"); return serverList; } public int getServersCount() { String countQuery = "SELECT * FROM " + TABLE_SERVERS; SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.rawQuery(countQuery, null); int count = cursor.getCount(); cursor.close(); db.close(); return count; } public void updateServer(Server server) { SQLiteDatabase db = getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_USERNAME, server.getUsername()); values.put(KEY_PHONETIC, server.getPhonetic()); values.put(KEY_SERVERNAME, server.getServername()); values.put(KEY_HOSTNAME, server.getHostname()); values.put(KEY_PORT, server.getPort()); values.put(KEY_PASSWORD, server.getPassword()); values.put(KEY_ID, server.getId()); db.update(TABLE_SERVERS, values, KEY_ID + " = " + server.getId(), null); db.close(); } public void deleteServer(Server server) { SQLiteDatabase db = getWritableDatabase(); db.delete(TABLE_SERVERS, KEY_ID + " = ?", new String[] { String.valueOf(server.getId()) }); db.close(); } public void clearServers() { SQLiteDatabase db = getWritableDatabase(); db.delete(TABLE_SERVERS, null, null); db.close(); } }
justindriggers/Ventriloid
com.jtxdriggers.android.ventriloid/src/com/jtxdriggers/android/ventriloid/ServerAdapter.java
Java
gpl-3.0
7,275
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="lb_LU"> <context> <name>QObject</name> <message> <location filename="../main/main.cpp" line="+87"/> <source>LTR</source> <translation type="unfinished"></translation> </message> </context> </TS>
annejan/qtpass
localization/localization_lb_LU.ts
TypeScript
gpl-3.0
312
<?php /** * WooCommerce Account Functions * * Functions for account specific things. * * @author WooThemes * @category Core * @package WooCommerce/Functions * @version 2.6.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Returns the url to the lost password endpoint url. * * @access public * @param string $default_url * @return string */ function wc_lostpassword_url( $default_url = '' ) { $wc_password_reset_url = wc_get_page_permalink( 'myaccount' ); if ( false !== $wc_password_reset_url ) { return wc_get_endpoint_url( 'lost-password', '', $wc_password_reset_url ); } else { return $default_url; } } add_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 1 ); /** * Get the link to the edit account details page. * * @return string */ function wc_customer_edit_account_url() { $edit_account_url = wc_get_endpoint_url( 'edit-account', '', wc_get_page_permalink( 'myaccount' ) ); return apply_filters( 'woocommerce_customer_edit_account_url', $edit_account_url ); } /** * Get the edit address slug translation. * * @param string $id Address ID. * @param bool $flip Flip the array to make it possible to retrieve the values ​​from both sides. * * @return string Address slug i18n. */ function wc_edit_address_i18n( $id, $flip = false ) { $slugs = apply_filters( 'woocommerce_edit_address_slugs', array( 'billing' => sanitize_title( _x( 'billing', 'edit-address-slug', 'woocommerce' ) ), 'shipping' => sanitize_title( _x( 'shipping', 'edit-address-slug', 'woocommerce' ) ) ) ); if ( $flip ) { $slugs = array_flip( $slugs ); } if ( ! isset( $slugs[ $id ] ) ) { return $id; } return $slugs[ $id ]; } /** * Get My Account menu items. * * @since 2.6.0 * @return array */ function wc_get_account_menu_items() { return apply_filters( 'woocommerce_account_menu_items', array( 'dashboard' => __( 'Dashboard', 'woocommerce' ), 'orders' => __( 'Orders', 'woocommerce' ), 'downloads' => __( 'Downloads', 'woocommerce' ), 'edit-address' => __( 'Addresses', 'woocommerce' ), 'payment-methods' => __( 'Payment Methods', 'woocommerce' ), 'edit-account' => __( 'Account Details', 'woocommerce' ), 'customer-logout' => __( 'Logout', 'woocommerce' ), ) ); } /** * Get account menu item classes. * * @since 2.6.0 * @param string $endpoint * @return string */ function wc_get_account_menu_item_classes( $endpoint ) { global $wp; $classes = array( 'woocommerce-MyAccount-navigation-link', 'woocommerce-MyAccount-navigation-link--' . $endpoint, ); // Set current item class. $current = isset( $wp->query_vars[ $endpoint ] ); if ( 'dashboard' === $endpoint && ( isset( $wp->query_vars['page'] ) || empty( $wp->query_vars ) ) ) { $current = true; // Dashboard is not an endpoint, so needs a custom check. } if ( $current ) { $classes[] = 'is-active'; } $classes = apply_filters( 'woocommerce_account_menu_item_classes', $classes, $endpoint ); return implode( ' ', array_map( 'sanitize_html_class', $classes ) ); } /** * Get account endpoint URL. * * @since 2.6.0 * @param string $endpoint * @return string */ function wc_get_account_endpoint_url( $endpoint ) { if ( 'dashboard' === $endpoint ) { return wc_get_page_permalink( 'myaccount' ); } return wc_get_endpoint_url( $endpoint ); } /** * Get My Account > Orders columns. * * @since 2.6.0 * @return array */ function wc_get_account_orders_columns() { $columns = apply_filters( 'woocommerce_account_orders_columns', array( 'order-number' => __( 'Order', 'woocommerce' ), 'order-date' => __( 'Date', 'woocommerce' ), 'order-status' => __( 'Status', 'woocommerce' ), 'order-total' => __( 'Total', 'woocommerce' ), 'order-actions' => '&nbsp;', ) ); // Deprecated filter since 2.6.0. return apply_filters( 'woocommerce_my_account_my_orders_columns', $columns ); } /** * Get My Account > Downloads columns. * * @since 2.6.0 * @return array */ function wc_get_account_downloads_columns() { return apply_filters( 'woocommerce_account_downloads_columns', array( 'download-file' => __( 'File', 'woocommerce' ), 'download-remaining' => __( 'Remaining', 'woocommerce' ), 'download-expires' => __( 'Expires', 'woocommerce' ), 'download-actions' => '&nbsp;', ) ); } /** * Get My Account > Payment methods columns. * * @since 2.6.0 * @return array */ function wc_get_account_payment_methods_columns() { return apply_filters( 'woocommerce_account_payment_methods_columns', array( 'method' => __( 'Method', 'woocommerce' ), 'expires' => __( 'Expires', 'woocommerce' ), 'actions' => '&nbsp;', ) ); } /** * Get My Account > Payment methods types * * @since 2.6.0 * @return array */ function wc_get_account_payment_methods_types() { return apply_filters( 'woocommerce_payment_methods_types', array( 'cc' => __( 'Credit Card', 'woocommerce' ), 'echeck' => __( 'eCheck', 'woocommerce' ), ) ); } /** * Returns an array of a user's saved payments list for output on the account tab. * * @since 2.6 * @param array $list List of payment methods passed from wc_get_customer_saved_methods_list() * @param int $customer_id The customer to fetch payment methods for * @return array Filtered list of customers payment methods */ function wc_get_account_saved_payment_methods_list( $list, $customer_id ) { $payment_tokens = WC_Payment_Tokens::get_customer_tokens( $customer_id ); foreach ( $payment_tokens as $payment_token ) { $delete_url = wc_get_endpoint_url( 'delete-payment-method', $payment_token->get_id() ); $delete_url = wp_nonce_url( $delete_url, 'delete-payment-method-' . $payment_token->get_id() ); $set_default_url = wc_get_endpoint_url( 'set-default-payment-method', $payment_token->get_id() ); $set_default_url = wp_nonce_url( $set_default_url, 'set-default-payment-method-' . $payment_token->get_id() ); $type = strtolower( $payment_token->get_type() ); $list[ $type ][] = array( 'method' => array( 'gateway' => $payment_token->get_gateway_id(), ), 'expires' => esc_html__( 'N/A', 'woocommerce' ), 'is_default' => $payment_token->is_default(), 'actions' => array( 'delete' => array( 'url' => $delete_url, 'name' => esc_html__( 'Delete', 'woocommerce' ), ), ), ); $key = key( array_slice( $list[ $type ], -1, 1, true ) ); if ( ! $payment_token->is_default() ) { $list[ $type ][$key]['actions']['default'] = array( 'url' => $set_default_url, 'name' => esc_html__( 'Make Default', 'woocommerce' ), ); } $list[ $type ][ $key ] = apply_filters( 'woocommerce_payment_methods_list_item', $list[ $type ][ $key ], $payment_token ); } return $list; } add_filter( 'woocommerce_saved_payment_methods_list', 'wc_get_account_saved_payment_methods_list', 10, 2 ); /** * Controls the output for credit cards on the my account page. * * @since 2.6 * @param array $item Individual list item from woocommerce_saved_payment_methods_list * @param WC_Payment_Token $payment_token The payment token associated with this method entry * @return array Filtered item */ function wc_get_account_saved_payment_methods_list_item_cc( $item, $payment_token ) { if ( 'cc' !== strtolower( $payment_token->get_type() ) ) { return $item; } $card_type = $payment_token->get_card_type(); $item['method']['last4'] = $payment_token->get_last4(); $item['method']['brand'] = ( ! empty( $card_type ) ? ucfirst( $card_type ) : esc_html__( 'Credit Card', 'woocommerce' ) ); $item['expires'] = $payment_token->get_expiry_month() . '/' . substr( $payment_token->get_expiry_year(), -2 ); return $item; } add_filter( 'woocommerce_payment_methods_list_item', 'wc_get_account_saved_payment_methods_list_item_cc', 10, 2 ); /** * Controls the output for eChecks on the my account page. * * @since 2.6 * @param array $item Individual list item from woocommerce_saved_payment_methods_list * @param WC_Payment_Token $payment_token The payment token associated with this method entry * @return array Filtered item */ function wc_get_account_saved_payment_methods_list_item_echeck( $item, $payment_token ) { if ( 'echeck' !== strtolower( $payment_token->get_type() ) ) { return $item; } $item['method']['last4'] = $payment_token->get_last4(); $item['method']['brand'] = esc_html__( 'eCheck', 'woocommerce' ); return $item; } add_filter( 'woocommerce_payment_methods_list_item', 'wc_get_account_saved_payment_methods_list_item_echeck', 10, 2 );
SteveHoneyNZ/woocommerce
includes/wc-account-functions.php
PHP
gpl-3.0
8,677
<!-- Give the category a name. --> <p> {!! Form::label('title','Title:') !!} {!! Form::text('title', old('title'), ['class' => 'form-control']) !!} </p> <!-- Give a good description. --> <p> {!! Form::label('description', 'Description:') !!} {!! Form::textarea('description', old('description'), ['class' => 'form-control']) !!} </p> <!-- Provide the slug. A slug is what the browser will read for SEO. --> <p> {!! Form::label('slug','Slug:') !!} {!! Form::text('slug', old('slug'), ['class' => 'form-control']) !!} </p> <!-- Submit the form --> <p> {!! Form::submit($submitButtonText, ['class' => 'btn btn-success']) !!} </p>
pchater/flommerce.dev
resources/views/categories/form.blade.php
PHP
gpl-3.0
627
/* * Copyright (C) 2017 GedMarc * * 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.jwebmp.core.base.servlets; import com.google.inject.Singleton; import com.guicedee.guicedinjection.json.StaticStrings; import com.guicedee.guicedinjection.GuiceContext; import com.guicedee.guicedservlets.GuicedServletKeys; import com.guicedee.logger.LogFactory; import jakarta.servlet.http.HttpServletResponse; import java.util.logging.Level; import java.util.logging.Logger; /** * The base Servlet for the JWebSwing environment. Constructs each page on call * * @author GedMarc * @version 1.1 * @since 2012/10/09 */ @Singleton public class JWebMPServlet extends JWDefaultServlet { /** * The logger for the swing Servlet */ private static final Logger log = LogFactory.getInstance() .getLogger("JWebSwingServlet"); /** * Constructs a new JWebSwing Servlet that is not session aware */ public JWebMPServlet() { //Nothing Needed } /** * When to perform any commands */ @Override public void perform() { HttpServletResponse response = GuiceContext.get(GuicedServletKeys.getHttpServletResponseKey()); sendPage(response); } /** * Sends the page out * * @param response * The response object */ private void sendPage(HttpServletResponse response) { response.setContentType(StaticStrings.HTML_HEADER_DEFAULT_CONTENT_TYPE); writeOutput(getPageHTML(), StaticStrings.HTML_HEADER_DEFAULT_CONTENT_TYPE, StaticStrings.UTF_CHARSET); } /** * Destroys this object and all references to it */ @Override public void destroy() { try { JWebMPServlet.log.log(Level.INFO, "Destroying Servlet JWebMP Servlet and all Static Objects"); GuiceContext.destroy(); } catch (Exception t) { JWebMPServlet.log.log(Level.SEVERE, "Unable to destroy", t); } super.destroy(); } }
GedMarc/JWebSwing
src/main/java/com/jwebmp/core/base/servlets/JWebMPServlet.java
Java
gpl-3.0
2,483
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.iescomercio.tema5.cuentas_bancarias; /** * * @author VESPERTINO */ public class CuentaAhorro extends CuentaCorriente { private double interes; public CuentaAhorro(Titular t, Numero_de_Cuenta nc, double saldo, double interes){ super(t, nc, saldo); this.interes = interes; } public CuentaAhorro(Titular t, Numero_de_Cuenta nc, double interes){ this(t, nc, 15.3, interes); } public CuentaAhorro(Titular t, Numero_de_Cuenta nc){ this(t, nc, 15.3, 2.5); } public double getInteres(){ return interes; } public void calcularInteres(){ ingresar(getSaldo() * (interes / 100)); } }
sagasta95/DAW1
src/com/iescomercio/tema5/cuentas_bancarias/CuentaAhorro.java
Java
gpl-3.0
921
#pragma once #include "GLTexture.hpp" namespace mls { template<GLenum textureType> class GLTextureHandle { GLuint64 m_nHandle = 0u; public: explicit GLTextureHandle(GLuint64 handle = 0u) : m_nHandle(handle) { } explicit GLTextureHandle(const GLTextureBase<textureType>& texture): m_nHandle(glGetTextureHandleNV(texture.glId())) { } explicit operator bool() const { return m_nHandle != 0u; } explicit operator GLuint64() const { return m_nHandle; } bool isResident() const { assert(m_nHandle); return glIsTextureHandleResidentNV(m_nHandle); } void makeResident() const { assert(m_nHandle); return glMakeTextureHandleResidentNV(m_nHandle); } void makeNonResident() const { assert(m_nHandle); return glMakeTextureHandleNonResidentNV(m_nHandle); } }; template<GLenum textureType> class GLImageHandle { GLuint64 m_nHandle = 0u; public: explicit GLImageHandle(GLuint64 handle = 0u) : m_nHandle(handle) { } explicit GLImageHandle(const GLTextureBase<textureType>& texture, GLint level, GLint layer, GLenum format): m_nHandle(glGetImageHandleNV(texture.glId(), level, GL_FALSE, layer, format)) { } explicit GLImageHandle(const GLTextureBase<textureType>& texture, GLint level, GLenum format): m_nHandle(glGetImageHandleNV(texture.glId(), level, GL_TRUE, 0, format)) { } explicit operator bool() const { return m_nHandle != 0u; } explicit operator GLuint64() const { return m_nHandle; } void makeResident(GLenum access) const { glMakeImageHandleResidentNV(m_nHandle, access); } bool isResident() const { return glIsImageHandleResidentNV(m_nHandle); } void makeNonResident() const { glMakeImageHandleNonResidentNV(m_nHandle); } }; using GLTexture2DHandle = GLTextureHandle<GL_TEXTURE_2D>; using GLTexture3DHandle = GLTextureHandle<GL_TEXTURE_3D>; using GLTextureCubeMapHandle = GLTextureHandle<GL_TEXTURE_CUBE_MAP>; using GLTexture2DArrayHandle = GLTextureHandle<GL_TEXTURE_2D_ARRAY>; using GLTextureCubeMapArrayHandle = GLTextureHandle<GL_TEXTURE_CUBE_MAP_ARRAY>; using GLImage2DHandle = GLImageHandle<GL_TEXTURE_2D>; using GLImage3DHandle = GLImageHandle<GL_TEXTURE_3D>; using GLImageCubeMapHandle = GLImageHandle<GL_TEXTURE_CUBE_MAP>; using GLImage2DArrayHandle = GLImageHandle<GL_TEXTURE_2D_ARRAY>; using GLImageCubeMapArrayHandle = GLImageHandle<GL_TEXTURE_CUBE_MAP_ARRAY>; }
Celeborn2BeAlive/melisandre
melisandre/src/melisandre/opengl/utils/GLBindlessTexture.hpp
C++
gpl-3.0
2,692
using System; using System.Collections.Generic; using System.Linq; using ColossalFramework; namespace CWS_MrSlurpExtensions { public class DistrictInfo { public int DistrictID { get; set; } public String DistrictName { get; set; } public DistrictServiceData Population { get; set; } public int TotalBuildingCount { get; set; } public int TotalVehicleCount { get; set; } public int WeeklyTouristVisits { get; set; } public int AverageLandValue { get; set; } public Double Pollution { get; set; } public DistrictDoubleServiceData Jobs { get; set; } public DistrictDoubleServiceData Households { get; set; } public Dictionary<string, DistrictServiceData> Privates { get; set; } public DistrictServiceData Happiness { get; set; } public DistrictServiceData Crime { get; set; } public DistrictServiceData Health { get; set; } public Dictionary<string, DistrictServiceData> Productions { get; set; } public Dictionary<string, DistrictServiceData> Consumptions { get; set; } public Dictionary<string, DistrictServiceData> Educated { get; set; } public DistrictServiceData BirthDeath { get; set; } public Dictionary<string, DistrictServiceData> Students { get; set; } public Dictionary<string, DistrictServiceData> Graduations { get; set; } public Dictionary<string, DistrictServiceData> ImportExport { get; set; } public VehiclesInfo Vehicles { get; set; } public PolicyInfo[] Policies { get; set; } #region servica data structure classes // simple city service data with only name and current value field (most of services) public class ServiceData { public string Name { get; set; } public int Current { get; set; } } // add a second field for city serices that provide the availability value (households/jobs) public class DoubleServiceData : ServiceData { public int Available { get; set; } } public class DistrictServiceData { public int TotalCurrent { get { return Categories.Sum(x=> x.Current); } set {} } public List<ServiceData> Categories { get; set; } } public class DistrictDoubleServiceData { public int TotalCurrent { get { return Categories.Sum(x => x.Current); } set { } } // allow to use a global game value (total power/water production) // or automatic sum private int? totalAvailable; public int TotalAvailable { get { if (totalAvailable.HasValue) return totalAvailable.Value; else return Categories.Sum(x => (x.Available != 0) ? x.Available : x.Current); } set { totalAvailable = value; } } public List<DoubleServiceData> Categories { get; set; } } #endregion public class DistrictServiceDataCollection : Dictionary<string, DistrictServiceData>{} public static IEnumerable<int> GetDistricts() { var districtManager = Singleton<DistrictManager>.instance; return districtManager.GetDistrictIds(); } public static DistrictInfo GetDistrictInfo(int districtID) { var districtManager = Singleton<DistrictManager>.instance; var district = GetDistrict(districtID); if (!district.IsValid()) { return null; } String districtName = String.Empty; if (districtID == 0) { // The district with ID 0 is always the global district. // It receives an auto-generated name by default, but the game always displays the city name instead. districtName = "City"; } else { districtName = districtManager.GetDistrictName(districtID); } var pollution = Math.Round((district.m_groundData.m_finalPollution / (Double) byte.MaxValue), 2); #region data model familly to game service/zone type list & dictionary // // warning these strings match object field names in game models and should not be changed // see specified class to understand // in DistrictPrivateData List<string> ServiceZoneTypes = new List<string> { "Residential", "Commercial", "Industrial", "Office", "Player" }; List<string> NoPlayerZoneTypes = new List<string> { "Residential", "Commercial", "Industrial", "Office" }; List<string> JobServiceZoneTypes = new List<string> { "Commercial", "Industrial", "Office", "Player" }; List<string> ImportExportTypes = new List<string> { "Agricultural", "Forestry", "Goods", "Oil", "Ore" }; // in DistrictProductionData Dictionary<string, string> ProductionsTypes = new Dictionary<string, string> { {"Electricity", "ElectricityCapacity"}, {"Water","WaterCapacity"}, {"Sewage", "SewageCapacity"}, {"GarbageA", "GarbageCapacity"} , {"GarbageC", "GarbageAmount"} , {"Incineration", "IncinerationCapacity"}, {"Cremate", "CremateCapacity"}, {"DeadA", "DeadAmount"}, {"DeadC", "DeadCapacity"}, {"Heal", "HealCapacity"}, {"LowEducation", "Education1Capacity"}, {"MediumEducation", "Education2Capacity"}, {"HighEducation", "Education3Capacity"}, }; // in DistrictConsumptionData // NOTE : consumptions are stored in each kind of service, cool we can create consumption distributions pie Dictionary<string, string> ConsumptionsTypes = new Dictionary<string, string> { {"Dead", "DeadCount"}, {"Sick", "SickCount"}, {"Electricity","ElectricityConsumption"}, {"Water","WaterConsumption"}, {"Sewage","SewageAccumulation"}, {"Garbage","GarbageAccumulation"}, {"Income", "IncomeAccumulation"}, {"WaterPollution", "WaterPollution"}, {"Building", "BuildingCount"}, {"GarbagePiles", "GarbagePiles"}, {"ImportAmount", "ImportAmount"}, }; Dictionary<string, string> PrivateDataTypes = new Dictionary<string, string> { {"Abandoned","AbandonedCount"}, {"BuildingArea","BuildingArea"}, //{"BuildingCount","BuildingCount"}, same data as in DistrictConsumptionData {"Burned","BurnedCount"}, {"EmptyCount","EmptyCount"}, //{"Happiness","Happiness"}, do in diffferent way to be easyly able to display hapiness by type //{"CrimeRate","CrimeRate"}, //{"Health","Health"}, /* to re add if a day I understand usage {"Level","Level"}, {"Level1","Level1"}, {"Level2","Level2"}, {"Level3","Level3"}, {"Level4","Level4"}, {"Level5","Level5"},*/ }; // in DistrictEducationData Dictionary<string, string> EducatedLevels = new Dictionary<string, string> { {"No","educated0"}, {"Low","educated1"}, {"Medium","educated2"}, {"High","educated3"} }; Dictionary<string, string> EducatedDataTypes = new Dictionary<string, string> { {"Total", "Count"}, {"EligibleWorkers", "EligibleWorkers"}, {"Homeless", "Homeless"}, {"Unemployed","Unemployed"}, }; // in DistrictAgeData Dictionary<string, string> GraduationTypes = new Dictionary<string, string> { {"LowEducation","education1"}, {"MediumEducation","education2"}, {"HighEducation","education3"}, }; Dictionary<string, string> StudentTypes = new Dictionary<string, string> { {"LowStudent","student1"}, {"MediumStudent","student2"}, {"HighStudent","student3"}, }; Dictionary<string, string> BirthDeathTypes = new Dictionary<string, string> { {"Births","birth"}, {"Deaths","death"} }; Dictionary<string, string> PopulationType = new Dictionary<string,string>{ {"Childs","child"}, {"Teens","teen"}, {"Youngs","young"}, {"Adults","adult"}, {"Seniors","senior"}, }; #endregion var model = new DistrictInfo { DistrictID = districtID, DistrictName = districtName, #region service data generation Population = new DistrictServiceData{ Categories = new List<ServiceData>(PopulationType.Keys.Select(x => district.GetAgeServiceData(PopulationType[x], x))), }, Happiness = new DistrictServiceData{ Categories = new List<ServiceData>(NoPlayerZoneTypes.Select(y => district.GetPrivateServiceData(y, "Happiness")) ) }, Crime = new DistrictServiceData{ Categories = new List<ServiceData>(NoPlayerZoneTypes.Select(y => district.GetPrivateServiceData(y, "CrimeRate"))) }, Health = new DistrictServiceData{ Categories = new List<ServiceData>(NoPlayerZoneTypes.Select(y => district.GetPrivateServiceData(y, "Health"))) }, // warning double lambda, but pretty magical effect Privates = new Dictionary<string, DistrictServiceData>( PrivateDataTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData>(ServiceZoneTypes.Select(y => district.GetPrivateServiceData(y, PrivateDataTypes[x]))) } ) ), Households = new DistrictDoubleServiceData{Categories = new List<DoubleServiceData>{district.GetCountAndAliveServiceData("residential"),},}, Jobs = new DistrictDoubleServiceData{Categories = new List<DoubleServiceData>(JobServiceZoneTypes.Select(x => district.GetCountAndAliveServiceData(x)))}, ImportExport = new Dictionary<string, DistrictServiceData>{ {"Import", new DistrictServiceData{Categories = new List<ServiceData>(ImportExportTypes.Select(x => district.GetImportExportServiceData("import", x)))}}, {"Export", new DistrictServiceData{Categories = new List<ServiceData>(ImportExportTypes.Select(x => district.GetImportExportServiceData("export", x)))}}, }, Productions = new Dictionary<string,DistrictServiceData>( ProductionsTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData> { district.GetProductionServiceData(x, ProductionsTypes[x]) } } ) ), // warning double lambda, but pretty magical effect Consumptions = new Dictionary<string,DistrictServiceData>( ConsumptionsTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData>(ServiceZoneTypes.Select(y => district.GetConsumptionServiceData(y, ConsumptionsTypes[x]))) } ) ), // warning double lambda, but pretty magical effect Educated = new Dictionary<string, DistrictServiceData>( EducatedDataTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData>(EducatedLevels.Keys.Select(y => district.GetEducatedServiceData(EducatedLevels[y], EducatedDataTypes[x], y))) } ) ), BirthDeath = new DistrictServiceData{ Categories = new List<ServiceData>(BirthDeathTypes.Keys.Select(x => district.GetAgeServiceData(BirthDeathTypes[x], x))), }, Graduations = new Dictionary<string, DistrictServiceData>( GraduationTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData> { district.GetAgeServiceData(GraduationTypes[x]) } } ) ), Students= new Dictionary<string, DistrictServiceData>( StudentTypes.Keys.ToDictionary(x => x, x => new DistrictServiceData { Categories = new List<ServiceData> { district.GetAgeServiceData(StudentTypes[x]) } } ) ), #endregion AverageLandValue = district.GetLandValue(), Pollution = pollution, WeeklyTouristVisits = (int)district.m_tourist1Data.m_averageCount + (int)district.m_tourist2Data.m_averageCount + (int)district.m_tourist3Data.m_averageCount, Policies = GetPolicies().ToArray(), }; if (districtID != 0) { CityInfoRequestHandler.LogMessages("Building vehicles for", districtID.ToString()); model.Vehicles = new VehiclesInfo(districtID); } else { CityInfoRequestHandler.LogMessages("Building vehicles for city"); model.Vehicles = new VehiclesInfo(); } return model; } private static District GetDistrict(int? districtID = null) { if (districtID == null) { districtID = 0; } var districtManager = Singleton<DistrictManager>.instance; var district = districtManager.m_districts.m_buffer[districtID.Value]; return district; } private static IEnumerable<PolicyInfo> GetPolicies() { var policies = EnumHelper.GetValues<DistrictPolicies.Policies>(); var districtManager = Singleton<DistrictManager>.instance; foreach (var policy in policies) { String policyName = Enum.GetName(typeof(DistrictPolicies.Policies), policy); Boolean isEnabled = districtManager.IsCityPolicySet(DistrictPolicies.Policies.AlligatorBan); yield return new PolicyInfo { Name = policyName, Enabled = isEnabled }; } } } }
MrSlurp/CityWebServerExtension
CWS_MrSlurpExtensions/Models/DistrictInfo.cs
C#
gpl-3.0
15,313
package com.abm.mainet.common.jbpm.domain; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.validation.ObjectError; import com.abm.mainet.common.jbpm.util.ResponseType; public class ActionResponse { private ResponseType response; private List<ObjectError> errorList; private String error; private Map<String, String> responseData; private List<? extends Object> dataList; private WorkflowRequest document; //private ComplaintAcknowledgementModel complaintAcknowledgementModel; private Date actionDate; /** * Constructor */ public ActionResponse() { this.responseData = new HashMap<String, String>(); this.dataList = new ArrayList<Object>(); this.errorList = new ArrayList<ObjectError>(); } /** * Constructor with Arguements * * @param response */ public ActionResponse(ResponseType response) { this.response = response; this.responseData = new HashMap<String, String>(); this.errorList = new ArrayList<ObjectError>(); } public Map<String, String> getResponseData() { return responseData; } public void setResponseData(Map<String, String> responseData) { this.responseData = responseData; } public void addResponseData(String key, String data) { responseData.put(key, data); } public String getResponseData(String key) { return responseData.get(key); } public ResponseType getResponse() { return response; } public void setResponse(ResponseType response) { this.response = response; } public List<ObjectError> getErrorList() { return errorList; } public void setErrorList(List<ObjectError> errorList) { this.errorList = errorList; } public String getError() { return error; } public void setError(String error) { this.error = error; } public List<? extends Object> getDataList() { return dataList; } public void setDataList(List<? extends Object> dataList) { this.dataList = dataList; } public WorkflowRequest getDocument() { return document; } public void setDocument(WorkflowRequest document) { this.document = document; } /*public ComplaintAcknowledgementModel getComplaintAcknowledgementModel() { return complaintAcknowledgementModel; } public void setComplaintAcknowledgementModel( ComplaintAcknowledgementModel complaintAcknowledgementModel) { this.complaintAcknowledgementModel = complaintAcknowledgementModel; }*/ public Date getActionDate() { return actionDate; } public void setActionDate(Date actionDate) { this.actionDate = actionDate; } }
abmindiarepomanager/ABMOpenMainet
Mainet1.0/MainetServiceParent/MainetServiceCommon/src/main/java/com/abm/mainet/common/jbpm/domain/ActionResponse.java
Java
gpl-3.0
2,602
package andriell.cxor; public class Constants { public static final String CHARSET = "UTF-8"; public static final int MAX_SIZE = 1048576; }
andriell/cXor
src/main/java/andriell/cxor/Constants.java
Java
gpl-3.0
149
const router = require('express').Router({ mergeParams: true }); const HttpStatus = require('http-status-codes'); const path = '/status'; function health(_, res) { res.status(HttpStatus.OK); res.send('ok'); } function ready(_, res) { res.send('ok'); } router.get('/health', health); router.get('/ready', ready); module.exports = { router, path, };
omarcinp/cronos
src/api/routes/status.js
JavaScript
gpl-3.0
363
package sk.upjs.doctororganizer.Entities; import java.math.BigInteger; public class Patient { private Long id; private String name; private String surname; private String adress; private String date_of_birth; private BigInteger id_number; private String insured_at; private String phone_number; private String email; private String password; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public String getAdress() { return adress; } public void setAdress(String adress) { this.adress = adress; } public String getDate_of_birth() { return date_of_birth; } public void setDate_of_birth(String date_of_birth) { this.date_of_birth = date_of_birth; } public BigInteger getId_number() { return id_number; } public void setId_number(BigInteger id_number) { this.id_number = id_number; } public String getInsured_at() { return insured_at; } public void setInsured_at(String insured_at) { this.insured_at = insured_at; } public String getPhone_number() { return phone_number; } public void setPhone_number(String phone_number) { this.phone_number = phone_number; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String toString() { return "Patient{" + "id=" + id + ", name=" + name + ", surname=" + surname + ", adress=" + adress + ", date_of_birth=" + date_of_birth + ", id_number=" + id_number + ", insured_at=" + insured_at + ", phone_number=" + phone_number + ", email=" + email + ", password=" + password + '}'; } }
mohnanskygabriel/DoctorOrganizer
DoctorOrganizer/src/main/java/sk/upjs/doctororganizer/Entities/Patient.java
Java
gpl-3.0
2,365
#region Copyright ///////////////////////////////////////////////////////////////////////////// // Altaxo: a data processing and data plotting program // Copyright (C) 2014 Dr. Dirk Lellinger // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // ///////////////////////////////////////////////////////////////////////////// #endregion Copyright #nullable enable using System; using System.Collections.Generic; using System.Linq; using System.Text; using Altaxo.Calc.Fourier; namespace Altaxo.Worksheet.Commands.Analysis { /// <summary> /// User options for 2D Fourier transformations. /// </summary> public class RealFourierTransformation2DOptions : Main.SuspendableDocumentLeafNodeWithEventArgs, ICloneable { // Input options protected double _rowIncrementValue; protected bool _isUserDefinedRowIncrementValue; protected double _columnIncrementValue; protected bool _isUserDefinedColumnIncrementValue; protected double? _replacementValueForNaNMatrixElements; protected double? _replacementValueForInfiniteMatrixElements; protected int? _dataPretreatmentCorrectionOrder; protected Altaxo.Calc.Fourier.Windows.IWindows2D? _fourierWindow; // Output options protected RealFourierTransformationOutputKind _kindOfOutputResult = RealFourierTransformationOutputKind.Amplitude; protected bool _centerResult; protected double _resultFractionOfRows = 1; protected double _resultFractionOfColumns = 1; protected bool _outputFrequencyHeaderColumns = true; protected string _frequencyRowHeaderColumnName = string.Empty; protected string _frequencyColumnHeaderColumnName = string.Empty; protected bool _outputPeriodHeaderColumns = false; protected string _periodRowHeaderColumnName = string.Empty; protected string _periodColumnHeaderColumnName = string.Empty; // Helper members - not serialized [NonSerialized] protected string? _rowIncrementMessage; [NonSerialized] protected string? _columnIncrementMessage; public object Clone() { return MemberwiseClone(); } #region Serialization #region Version 0 /// <summary> /// 2014-07-08 initial version. /// </summary> [Altaxo.Serialization.Xml.XmlSerializationSurrogateFor(typeof(RealFourierTransformation2DOptions), 0)] private class XmlSerializationSurrogate0 : Altaxo.Serialization.Xml.IXmlSerializationSurrogate { public virtual void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info) { var s = (RealFourierTransformation2DOptions)obj; info.AddValue("RowIncrementValue", s._rowIncrementValue); info.AddValue("ColumnIncrementValue", s._columnIncrementValue); info.AddValue("ReplacementValueForNaNMatrixElements", s._replacementValueForNaNMatrixElements); info.AddValue("ReplacementValueForInfiniteMatrixElements", s._replacementValueForInfiniteMatrixElements); info.AddValue("DataPretreatmentCorrectionOrder", s._dataPretreatmentCorrectionOrder); info.AddValueOrNull("FourierWindow", s._fourierWindow); info.AddEnum("KindOfOutputResult", s._kindOfOutputResult); info.AddValue("CenterResult", s._centerResult); info.AddValue("ResultFractionOfRows", s._resultFractionOfRows); info.AddValue("ResultFractionOfColumns", s._resultFractionOfColumns); info.AddValue("OutputFrequencyHeaderColumns", s._outputFrequencyHeaderColumns); info.AddValue("FrequencyRowHeaderColumnName", s._frequencyRowHeaderColumnName); info.AddValue("FrequencyColumnHeaderColumnName", s._frequencyColumnHeaderColumnName); info.AddValue("OutputPeriodHeaderColumns", s._outputPeriodHeaderColumns); info.AddValue("PeriodRowHeaderColumnName", s._periodRowHeaderColumnName); info.AddValue("PeriodColumnHeaderColumnName", s._periodColumnHeaderColumnName); } protected virtual RealFourierTransformation2DOptions SDeserialize(object? o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object? parent) { var s = (RealFourierTransformation2DOptions?)o ?? new RealFourierTransformation2DOptions(); s._rowIncrementValue = info.GetDouble("RowIncrementValue"); s._columnIncrementValue = info.GetDouble("ColumnIncrementValue"); s._replacementValueForNaNMatrixElements = info.GetNullableDouble("ReplacementValueForNaNMatrixElements"); s._replacementValueForInfiniteMatrixElements = info.GetNullableDouble("ReplacementValueForInfiniteMatrixElements"); s._dataPretreatmentCorrectionOrder = info.GetNullableInt32("DataPretreatmentCorrectionOrder"); s._fourierWindow = (Altaxo.Calc.Fourier.Windows.IWindows2D?)info.GetValueOrNull("FourierWindow", s); s._kindOfOutputResult = (RealFourierTransformationOutputKind)info.GetEnum("KindOfOutputResult", typeof(RealFourierTransformationOutputKind)); s._centerResult = info.GetBoolean("CenterResult"); s._resultFractionOfRows = info.GetDouble("ResultFractionOfRows"); s._resultFractionOfColumns = info.GetDouble("ResultFractionOfColumns"); s._outputFrequencyHeaderColumns = info.GetBoolean("OutputFrequencyHeaderColumns"); s._frequencyRowHeaderColumnName = info.GetString("FrequencyRowHeaderColumnName"); s._frequencyColumnHeaderColumnName = info.GetString("FrequencyColumnHeaderColumnName"); s._outputPeriodHeaderColumns = info.GetBoolean("OutputPeriodHeaderColumns"); s._periodRowHeaderColumnName = info.GetString("PeriodRowHeaderColumnName"); s._periodColumnHeaderColumnName = info.GetString("PeriodColumnHeaderColumnName"); return s; } public object Deserialize(object? o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object? parent) { var s = SDeserialize(o, info, parent); return s; } } #endregion Version 0 #region Version 1 /// <summary> /// 2015-05-19 Added IsUserDefinedRowIncrementValue and IsUserDefinedColumnIncrementValue /// </summary> [Altaxo.Serialization.Xml.XmlSerializationSurrogateFor(typeof(RealFourierTransformation2DOptions), 1)] private class XmlSerializationSurrogate1 : Altaxo.Serialization.Xml.IXmlSerializationSurrogate { public virtual void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info) { var s = (RealFourierTransformation2DOptions)obj; info.AddValue("IsUserDefinedRowIncrementValue", s._isUserDefinedRowIncrementValue); info.AddValue("RowIncrementValue", s._rowIncrementValue); info.AddValue("IsUserDefinedColumnIncrementValue", s._isUserDefinedColumnIncrementValue); info.AddValue("ColumnIncrementValue", s._columnIncrementValue); info.AddValue("ReplacementValueForNaNMatrixElements", s._replacementValueForNaNMatrixElements); info.AddValue("ReplacementValueForInfiniteMatrixElements", s._replacementValueForInfiniteMatrixElements); info.AddValue("DataPretreatmentCorrectionOrder", s._dataPretreatmentCorrectionOrder); info.AddValueOrNull("FourierWindow", s._fourierWindow); info.AddEnum("KindOfOutputResult", s._kindOfOutputResult); info.AddValue("CenterResult", s._centerResult); info.AddValue("ResultFractionOfRows", s._resultFractionOfRows); info.AddValue("ResultFractionOfColumns", s._resultFractionOfColumns); info.AddValue("OutputFrequencyHeaderColumns", s._outputFrequencyHeaderColumns); info.AddValue("FrequencyRowHeaderColumnName", s._frequencyRowHeaderColumnName); info.AddValue("FrequencyColumnHeaderColumnName", s._frequencyColumnHeaderColumnName); info.AddValue("OutputPeriodHeaderColumns", s._outputPeriodHeaderColumns); info.AddValue("PeriodRowHeaderColumnName", s._periodRowHeaderColumnName); info.AddValue("PeriodColumnHeaderColumnName", s._periodColumnHeaderColumnName); } protected virtual RealFourierTransformation2DOptions SDeserialize(object? o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object? parent) { var s = (o is null ? new RealFourierTransformation2DOptions() : (RealFourierTransformation2DOptions)o); s._isUserDefinedRowIncrementValue = info.GetBoolean("IsUserDefinedRowIncrementValue"); s._rowIncrementValue = info.GetDouble("RowIncrementValue"); s._isUserDefinedColumnIncrementValue = info.GetBoolean("IsUserDefinedColumnIncrementValue"); s._columnIncrementValue = info.GetDouble("ColumnIncrementValue"); s._replacementValueForNaNMatrixElements = info.GetNullableDouble("ReplacementValueForNaNMatrixElements"); s._replacementValueForInfiniteMatrixElements = info.GetNullableDouble("ReplacementValueForInfiniteMatrixElements"); s._dataPretreatmentCorrectionOrder = info.GetNullableInt32("DataPretreatmentCorrectionOrder"); s._fourierWindow = (Altaxo.Calc.Fourier.Windows.IWindows2D?)info.GetValueOrNull("FourierWindow", s); s._kindOfOutputResult = (RealFourierTransformationOutputKind)info.GetEnum("KindOfOutputResult", typeof(RealFourierTransformationOutputKind)); s._centerResult = info.GetBoolean("CenterResult"); s._resultFractionOfRows = info.GetDouble("ResultFractionOfRows"); s._resultFractionOfColumns = info.GetDouble("ResultFractionOfColumns"); s._outputFrequencyHeaderColumns = info.GetBoolean("OutputFrequencyHeaderColumns"); s._frequencyRowHeaderColumnName = info.GetString("FrequencyRowHeaderColumnName"); s._frequencyColumnHeaderColumnName = info.GetString("FrequencyColumnHeaderColumnName"); s._outputPeriodHeaderColumns = info.GetBoolean("OutputPeriodHeaderColumns"); s._periodRowHeaderColumnName = info.GetString("PeriodRowHeaderColumnName"); s._periodColumnHeaderColumnName = info.GetString("PeriodColumnHeaderColumnName"); return s; } public object Deserialize(object? o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object? parent) { var s = SDeserialize(o, info, parent); return s; } } #endregion Version 1 #endregion Serialization public bool IsUserDefinedRowIncrementValue { get { return _isUserDefinedRowIncrementValue; } set { _isUserDefinedRowIncrementValue = value; } } public bool IsUserDefinedColumnIncrementValue { get { return _isUserDefinedColumnIncrementValue; } set { _isUserDefinedColumnIncrementValue = value; } } public double RowIncrementValue { get { return _rowIncrementValue; } set { SetMemberAndRaiseSelfChanged(ref _rowIncrementValue, value); } } public double ColumnIncrementValue { get { return _columnIncrementValue; } set { SetMemberAndRaiseSelfChanged(ref _columnIncrementValue, value); } } public double? ReplacementValueForNaNMatrixElements { get { return _replacementValueForNaNMatrixElements; } set { SetMemberAndRaiseSelfChanged(ref _replacementValueForNaNMatrixElements, value); } } public double? ReplacementValueForInfiniteMatrixElements { get { return _replacementValueForInfiniteMatrixElements; } set { SetMemberAndRaiseSelfChanged(ref _replacementValueForInfiniteMatrixElements, value); } } public int? DataPretreatmentCorrectionOrder { get { return _dataPretreatmentCorrectionOrder; } set { SetMemberAndRaiseSelfChanged(ref _dataPretreatmentCorrectionOrder, value); } } public Altaxo.Calc.Fourier.Windows.IWindows2D? FourierWindow { get { return _fourierWindow; } set { if (!object.ReferenceEquals(_fourierWindow, value)) { _fourierWindow = value; EhSelfChanged(EventArgs.Empty); } } } public Altaxo.Calc.Fourier.RealFourierTransformationOutputKind OutputKind { get { return _kindOfOutputResult; } set { SetMemberEnumAndRaiseSelfChanged(ref _kindOfOutputResult, value); } } public bool CenterResult { get { return _centerResult; } set { SetMemberAndRaiseSelfChanged(ref _centerResult, value); } } public double ResultingFractionOfRowsUsed { get { return _resultFractionOfRows; } set { if (!(value >= 0 && (value <= 1))) throw new ArgumentOutOfRangeException("Value has to be in the range between 0 and 1"); SetMemberAndRaiseSelfChanged(ref _resultFractionOfRows, value); } } public double ResultingFractionOfColumnsUsed { get { return _resultFractionOfColumns; } set { if (!(value >= 0 && (value <= 1))) throw new ArgumentOutOfRangeException("Value has to be in the range between 0 and 1"); SetMemberAndRaiseSelfChanged(ref _resultFractionOfColumns, value); } } public bool OutputFrequencyHeaderColumns { get { return _outputFrequencyHeaderColumns; } set { SetMemberAndRaiseSelfChanged(ref _outputFrequencyHeaderColumns, value); } } public string FrequencyRowHeaderColumnName { get { return _frequencyRowHeaderColumnName; } set { SetMemberAndRaiseSelfChanged(ref _frequencyRowHeaderColumnName, value); } } public string FrequencyColumnHeaderColumnName { get { return _frequencyColumnHeaderColumnName; } set { SetMemberAndRaiseSelfChanged(ref _frequencyColumnHeaderColumnName, value); } } public bool OutputPeriodHeaderColumns { get { return _outputPeriodHeaderColumns; } set { SetMemberAndRaiseSelfChanged(ref _outputPeriodHeaderColumns, value); } } public string PeriodRowHeaderColumnName { get { return _periodRowHeaderColumnName; } set { SetMemberAndRaiseSelfChanged(ref _periodRowHeaderColumnName, value); } } public string PeriodColumnHeaderColumnName { get { return _periodColumnHeaderColumnName; } set { SetMemberAndRaiseSelfChanged(ref _periodColumnHeaderColumnName, value); } } public string? RowIncrementMessage { get { return _rowIncrementMessage; } set { SetMemberAndRaiseSelfChanged(ref _rowIncrementMessage, value); } } public string? ColumnIncrementMessage { get { return _columnIncrementMessage; } set { SetMemberAndRaiseSelfChanged(ref _columnIncrementMessage, value); } } } }
Altaxo/Altaxo
Altaxo/Base/Worksheet/Commands/Analysis/RealFourierTransformation2DOptions.cs
C#
gpl-3.0
14,821
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import socket import sys from argparse import ArgumentParser from setproctitle import setproctitle from amavisvt.config import Configuration BUFFER_SIZE = 4096 class AmavisVTClient(object): def __init__(self, socket_path): self.config = Configuration() self.socket_path = socket_path or self.config.socket_path def execute(self, command, *arguments): logger.debug("Executing command '%s' with args: %s", command, arguments) translate = { 'ping': 'PING', 'scan': 'CONTSCAN', 'report': 'REPORT', } sock = None try: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(self.socket_path) # send absolute paths to amavisvtd absolute_args = [os.path.abspath(p) for p in arguments] s = "%s %s" % (translate.get(command, command.upper()), ' '.join(absolute_args)) payload = s.strip() + "\n" sock.sendall(payload.encode('utf-8')) data = sock.recv(BUFFER_SIZE) return data.decode('utf-8') finally: if sock: sock.close() if __name__ == "__main__": # pragma: no cover setproctitle("amavisvtd") parser = ArgumentParser() parser.add_argument('-v', '--verbose', action='count', help='Increase verbosity', default=2) parser.add_argument('-d', '--debug', action='store_true', default=False, help='Send verbose log messages to stdout too') parser.add_argument('-s', '--socket', help='Socket path') parser.add_argument('command', choices=('ping', 'scan', 'report')) parser.add_argument('command_args', nargs='*') args = parser.parse_args() logging.basicConfig( level=logging.FATAL - (10 * args.verbose), format='%(asctime)s %(levelname)-7s [%(threadName)s] %(message)s', ) logger = logging.getLogger() if not args.debug: for h in logger.handlers: h.setLevel(logging.ERROR) if not args.command.lower() in ('ping', 'scan', 'report'): print("Invalid command: %s" % args.command) sys.exit(1) error = False try: client = AmavisVTClient(args.socket) response = client.execute(args.command, *tuple(args.command_args)) error = response.startswith('ERROR:') print(response) except Exception as ex: error = True logger.exception("Command '%s' failed", args.command) print(ex) finally: sys.exit(int(error))
ercpe/amavisvt
amavisvt/amavisvtc.py
Python
gpl-3.0
2,613