text
stringlengths
2
1.04M
meta
dict
package edu.cmu.cs.stage3.image.codec; /* * The contents of this file are subject to the JAVA ADVANCED IMAGING * SAMPLE INPUT-OUTPUT CODECS AND WIDGET HANDLING SOURCE CODE License * Version 1.0 (the "License"); You may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.sun.com/software/imaging/JAI/index.html * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is JAVA ADVANCED IMAGING SAMPLE INPUT-OUTPUT CODECS * AND WIDGET HANDLING SOURCE CODE. * The Initial Developer of the Original Code is: Sun Microsystems, Inc.. * Portions created by: _______________________________________ * are Copyright (C): _______________________________________ * All Rights Reserved. * Contributor(s): _______________________________________ */ import java.awt.image.ColorModel; import java.awt.image.Raster; import java.awt.image.RenderedImage; import java.io.IOException; import java.io.OutputStream; /** * A partial implementation of the ImageEncoder interface useful for * subclassing. * * <p><b> This class is not a committed part of the JAI API. It may * be removed or changed in future releases of JAI.</b> */ public abstract class ImageEncoderImpl implements ImageEncoder { /** The OutputStream associcted with this ImageEncoder. */ protected OutputStream output; /** The ImageEncodeParam object associcted with this ImageEncoder. */ protected ImageEncodeParam param; /** * Constructs an ImageEncoderImpl with a given OutputStream * and ImageEncoderParam instance. */ public ImageEncoderImpl(OutputStream output, ImageEncodeParam param) { this.output = output; this.param = param; } /** * Returns the current parameters as an instance of the * ImageEncodeParam interface. Concrete implementations of this * interface will return corresponding concrete implementations of * the ImageEncodeParam interface. For example, a JPEGImageEncoder * will return an instance of JPEGEncodeParam. */ public ImageEncodeParam getParam() { return param; } /** * Sets the current parameters to an instance of the * ImageEncodeParam interface. Concrete implementations * of ImageEncoder may throw a RuntimeException if the * params argument is not an instance of the appropriate * subclass or subinterface. For example, a JPEGImageEncoder * will expect param to be an instance of JPEGEncodeParam. */ public void setParam(ImageEncodeParam param) { this.param = param; } /** Returns the OutputStream associated with this ImageEncoder. */ public OutputStream getOutputStream() { return output; } /** * Encodes a Raster with a given ColorModel and writes the output * to the OutputStream associated with this ImageEncoder. */ public void encode(Raster ras, ColorModel cm) throws IOException { RenderedImage im = new SingleTileRenderedImage(ras, cm); encode(im); } /** * Encodes a RenderedImage and writes the output to the * OutputStream associated with this ImageEncoder. */ public abstract void encode(RenderedImage im) throws IOException; }
{ "content_hash": "f8bb1c0da0fd8a654e9a72e74fc25e56", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 73, "avg_line_length": 36.39393939393939, "alnum_prop": 0.665556480710519, "repo_name": "ai-ku/langvis", "id": "768db05b50253866c421f97275ddc7e745c823ac", "size": "4624", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/edu/cmu/cs/stage3/image/codec/ImageEncoderImpl.java", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "1391" }, { "name": "Haskell", "bytes": "1005" }, { "name": "Java", "bytes": "7426611" }, { "name": "Perl", "bytes": "10563" }, { "name": "Python", "bytes": "1744764" }, { "name": "Ruby", "bytes": "691" }, { "name": "Shell", "bytes": "701" } ], "symlink_target": "" }
/** */ package kieker.model.analysismodel.statistics.impl; import kieker.model.analysismodel.statistics.EPrefix; import kieker.model.analysismodel.statistics.SimpleUnit; import kieker.model.analysismodel.statistics.StatisticsPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Simple Unit</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link kieker.model.analysismodel.statistics.impl.SimpleUnitImpl#getPrefix <em>Prefix</em>}</li> * </ul> * * @generated */ public class SimpleUnitImpl extends UnitImpl implements SimpleUnit { /** * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPrefix() * @generated * @ordered */ protected static final EPrefix PREFIX_EDEFAULT = EPrefix.NO_P; /** * The cached value of the '{@link #getPrefix() <em>Prefix</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPrefix() * @generated * @ordered */ protected EPrefix prefix = PREFIX_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SimpleUnitImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return StatisticsPackage.Literals.SIMPLE_UNIT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EPrefix getPrefix() { return prefix; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setPrefix(EPrefix newPrefix) { EPrefix oldPrefix = prefix; prefix = newPrefix == null ? PREFIX_EDEFAULT : newPrefix; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, StatisticsPackage.SIMPLE_UNIT__PREFIX, oldPrefix, prefix)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case StatisticsPackage.SIMPLE_UNIT__PREFIX: return getPrefix(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case StatisticsPackage.SIMPLE_UNIT__PREFIX: setPrefix((EPrefix)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case StatisticsPackage.SIMPLE_UNIT__PREFIX: setPrefix(PREFIX_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case StatisticsPackage.SIMPLE_UNIT__PREFIX: return prefix != PREFIX_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (prefix: "); result.append(prefix); result.append(')'); return result.toString(); } } //SimpleUnitImpl
{ "content_hash": "9a3880df4f33e39931b0b6e97efff8fa", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 116, "avg_line_length": 21.939393939393938, "alnum_prop": 0.6375690607734806, "repo_name": "kieker-monitoring/kieker", "id": "8d260d176310ffa344b2bd0ecfbbe89a9afb336e", "size": "3620", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kieker-model/src-gen/kieker/model/analysismodel/statistics/impl/SimpleUnitImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "61445" }, { "name": "Batchfile", "bytes": "2946" }, { "name": "CSS", "bytes": "24891" }, { "name": "Groovy", "bytes": "6964" }, { "name": "HTML", "bytes": "74073" }, { "name": "Java", "bytes": "7715993" }, { "name": "Makefile", "bytes": "580" }, { "name": "Python", "bytes": "19950" }, { "name": "R", "bytes": "41" }, { "name": "Roff", "bytes": "9860" }, { "name": "Shell", "bytes": "38916" }, { "name": "TeX", "bytes": "1948" }, { "name": "XSLT", "bytes": "7622" }, { "name": "sed", "bytes": "634" } ], "symlink_target": "" }
class OctreePoint { public: Vec3 position; int m_frameIdx; OctreePoint() { } OctreePoint(const Vec3& position) : position(position) { } inline const Vec3& getPosition() const { return position; } inline void setPosition(const Vec3& p) { position = p; } }; #endif
{ "content_hash": "71723c91bb03abb344281b1f52e18292", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 21.076923076923077, "alnum_prop": 0.6970802919708029, "repo_name": "billhj/Etoile2015", "id": "f602800603df18f1736c5914d742533763e6ea61", "size": "507", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "applications/SkeletonViewer/OctreePoint.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "31804" }, { "name": "C++", "bytes": "1162990" } ], "symlink_target": "" }
/* * This is a basic func test for a UseCase application. */ YUI.add('usecases-testi18n-de-tests', function (Y) { var suite = new Y.Test.Suite("UseCases: i18n-de"); suite.add(new Y.Test.Case({ "test i18n-de": function() { var title = Y.one('h2').get('innerHTML'); Y.Assert.areEqual('Hallo!', title.match(/Hallo!/gi)); Y.Assert.areEqual('Sie Ihre Bilder', title.match(/Sie Ihre Bilder/gi)); var imagelink = Y.all('a').item(1).get('href'); Y.Assert.areEqual('http:', imagelink.match(/http:/gi)); Y.Assert.areEqual('/static/usecase/assets', imagelink.match(/\/static\/usecase\/assets/gi)); Y.Intl.add("datatype-date-format", "de", { "x":"%d/%m/%Y" }); Y.Intl.setLang("datatype-date-format", "de"); var mydate = Y.DataType.Date.format(new Date(), {format:"%d/%m/%Y"}); var expecteddate = mydate.slice(0,6)+mydate.slice(8,10); Y.Assert.areEqual(expecteddate.replace(/\//g, "."), title.substr(title.indexOf('-')+2, 8)); } })); Y.Test.Runner.add(suite); }, '0.0.1', {requires: [ 'node', 'node-event-simulate', 'test', 'console', 'intl', 'datatype-date-format' ]});
{ "content_hash": "e3d125fbd1ff6b8f65a67e3002c7f3ea", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 104, "avg_line_length": 42.06666666666667, "alnum_prop": 0.554675118858954, "repo_name": "jeffblack360/mojito", "id": "166f020655ad1c787bdd004f7c51c4cae8cb1e9c", "size": "1262", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "tests/func/usecases/testi18n-de.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "71546" }, { "name": "JavaScript", "bytes": "2724195" }, { "name": "Python", "bytes": "72465" }, { "name": "Ruby", "bytes": "32" }, { "name": "Shell", "bytes": "675" } ], "symlink_target": "" }
#ifndef StyleElement_h #define StyleElement_h #include "CSSStyleSheet.h" namespace WebCore { class Document; class Element; class StyleElement { public: StyleElement(Document*, bool createdByParser); virtual ~StyleElement(); protected: virtual const AtomicString& type() const = 0; virtual const AtomicString& media() const = 0; StyleSheet* sheet() const { return m_sheet.get(); } bool isLoading() const; bool sheetLoaded(Document*); void insertedIntoDocument(Document*, Element*); void removedFromDocument(Document*, Element*); void childrenChanged(Element*); void finishParsingChildren(Element*); RefPtr<CSSStyleSheet> m_sheet; private: void createSheet(Element*, int startLineNumber, const String& text = String()); void process(Element*); bool m_createdByParser; bool m_loading; int m_startLineNumber; }; } #endif
{ "content_hash": "db092fb75f6d57af0dd55ed3e1f9ffca", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 83, "avg_line_length": 20.022222222222222, "alnum_prop": 0.7069922308546059, "repo_name": "mogoweb/webkit_for_android5.1", "id": "4356c1729a427a74607fcb791fff022d4d3a08fe", "size": "1722", "binary": false, "copies": "15", "ref": "refs/heads/master", "path": "webkit/Source/WebCore/dom/StyleElement.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AppleScript", "bytes": "6772" }, { "name": "Assembly", "bytes": "26025" }, { "name": "Awk", "bytes": "2800" }, { "name": "Batchfile", "bytes": "57337" }, { "name": "C", "bytes": "7713030" }, { "name": "C++", "bytes": "153178707" }, { "name": "CMake", "bytes": "192330" }, { "name": "CSS", "bytes": "483041" }, { "name": "Common Lisp", "bytes": "9920" }, { "name": "DIGITAL Command Language", "bytes": "5243" }, { "name": "DTrace", "bytes": "1931" }, { "name": "Go", "bytes": "3744" }, { "name": "HTML", "bytes": "14998422" }, { "name": "Java", "bytes": "1522083" }, { "name": "JavaScript", "bytes": "18008829" }, { "name": "Lex", "bytes": "42554" }, { "name": "Lua", "bytes": "13768" }, { "name": "M4", "bytes": "49839" }, { "name": "Makefile", "bytes": "476166" }, { "name": "Module Management System", "bytes": "9756" }, { "name": "Objective-C", "bytes": "2798053" }, { "name": "Objective-C++", "bytes": "7846322" }, { "name": "PHP", "bytes": "66595" }, { "name": "Perl", "bytes": "1130475" }, { "name": "Perl 6", "bytes": "445215" }, { "name": "Python", "bytes": "5503045" }, { "name": "QML", "bytes": "3331" }, { "name": "QMake", "bytes": "294800" }, { "name": "R", "bytes": "290" }, { "name": "Roff", "bytes": "273562" }, { "name": "Ruby", "bytes": "81928" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "488223" }, { "name": "Yacc", "bytes": "153801" }, { "name": "xBase", "bytes": "328" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="es_DO" version="2.0"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Horuscoin Core</source> <translation>Acerca del Núcleo de Horuscoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Horuscoin Core&lt;/b&gt; version</source> <translation>Versión del &lt;b&gt;Núcleo de Horuscoin&lt;b&gt;</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Este es un software experimental. Distribuido bajo la licencia MIT/X11, vea el archivo adjunto COPYING o http://www.opensource.org/licenses/mit-license.php. Este producto incluye software desarrollado por OpenSSL Project para su uso en el OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por Eric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.</translation> </message> <message> <location filename="../utilitydialog.cpp" line="+29"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>The Horuscoin Core developers</source> <translation>Los desarrolladores del Núcleo de Horuscoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+30"/> <source>Double-click to edit address or label</source> <translation>Haga doble clic para editar una dirección o etiqueta</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Crear una nueva dirección</translation> </message> <message> <location line="+3"/> <source>&amp;New</source> <translation>Nuevo</translation> </message> <message> <location line="+11"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation> </message> <message> <location line="+3"/> <source>&amp;Copy</source> <translation>&amp;Copiar</translation> </message> <message> <location line="+52"/> <source>C&amp;lose</source> <translation>&amp;Cerrar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+74"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar dirección</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="-41"/> <source>Delete the currently selected address from the list</source> <translation>Borrar de la lista la dirección seleccionada</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exportar a un archivo los datos de esta pestaña</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="-27"/> <source>&amp;Delete</source> <translation>&amp;Eliminar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-30"/> <source>Choose the address to send coins to</source> <translation>Escoja la dirección para enviar monedas</translation> </message> <message> <location line="+1"/> <source>Choose the address to receive coins with</source> <translation>Escoja la dirección para recibir monedas</translation> </message> <message> <location line="+5"/> <source>C&amp;hoose</source> <translation>&amp;Escoger</translation> </message> <message> <location line="+6"/> <source>sending addresses</source> <translation>Enviando dirección</translation> </message> <message> <location line="+1"/> <source>receiving addresses</source> <translation>Recibiendo dirección</translation> </message> <message> <location line="+7"/> <source>These are your Horuscoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estas son sus direcciones Horuscoin para enviar pagos. Compruebe siempre la cantidad y la dirección receptora antes de transferir monedas.</translation> </message> <message> <location line="+4"/> <source>These are your Horuscoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation>Estas son sus direcciones de Horuscoin para recibir pagos. Se recomienda utilizar una nueva dirección de recepción para cada transacción.</translation> </message> <message> <location line="+7"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;etiqueta</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+194"/> <source>Export Address List</source> <translation>Exportar la lista de direcciones </translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <location line="+13"/> <source>Exporting Failed</source> <translation>Error exportando</translation> </message> <message> <location line="+1"/> <source>There was an error trying to save the address list to %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+168"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Diálogo de contraseña</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Introducir contraseña</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nueva contraseña</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita la nueva contraseña</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+40"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Introduzca la nueva contraseña de la cartera.&lt;br/&gt;Por favor elija una con &lt;b&gt;10 o más caracteres aleatorios&lt;/b&gt;, u &lt;b&gt;ocho o más palabras&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Cifrar la cartera</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Esta operación requiere su contraseña para desbloquear la cartera</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear cartera</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Esta operación requiere su contraseña para descifrar la cartera.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Descifrar la certare</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Cambiar contraseña</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Introduzca la contraseña anterior de la cartera y la nueva. </translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar cifrado de la cartera</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR HORUSCOINS&lt;/b&gt;!</source> <translation>Atencion: ¡Si cifra su monedero y pierde la contraseña perderá &lt;b&gt;TODOS SUS HORUSCOINS&lt;/b&gt;!&quot;</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>¿Seguro que desea cifrar su monedero?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Cualquier copia de seguridad que haya realizado previamente de su archivo de monedero debe reemplazarse con el nuevo archivo de monedero cifrado. Por razones de seguridad, las copias de seguridad previas del archivo de monedero no cifradas serán inservibles en cuanto comience a usar el nuevo monedero cifrado.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Aviso: ¡La tecla de bloqueo de mayúsculas está activada!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Monedero cifrado</translation> </message> <message> <location line="-56"/> <source>Horuscoin Core will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Horuscoins from being stolen by malware infecting your computer.</source> <translation>Horuscoin se cerrará para finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus horuscoins de robo por malware que infecte su sistema.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Ha fallado el cifrado del monedero</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Ha fallado el cifrado del monedero debido a un error interno. El monedero no ha sido cifrado.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Las contraseñas no coinciden.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Ha fallado el desbloqueo del monedero</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La contraseña introducida para descifrar el monedero es incorrecta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Ha fallado el descifrado del monedero</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Se ha cambiado correctamente la contraseña del monedero.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+295"/> <source>Sign &amp;message...</source> <translation>Firmar &amp;mensaje...</translation> </message> <message> <location line="+335"/> <source>Synchronizing with network...</source> <translation>Sincronizando con la red…</translation> </message> <message> <location line="-407"/> <source>&amp;Overview</source> <translation>&amp;Vista general</translation> </message> <message> <location line="-137"/> <source>Node</source> <translation>Nodo</translation> </message> <message> <location line="+138"/> <source>Show general overview of wallet</source> <translation>Mostrar vista general del monedero</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transacciones</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Examinar el historial de transacciones</translation> </message> <message> <location line="+17"/> <source>E&amp;xit</source> <translation>&amp;Salir</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Salir de la aplicación</translation> </message> <message> <location line="+7"/> <source>Show information about Horuscoin Core</source> <translation>Mostrar información acerca de Horuscoin</translation> </message> <message> <location line="+3"/> <location line="+2"/> <source>About &amp;Qt</source> <translation>Acerca de &amp;Qt</translation> </message> <message> <location line="+2"/> <source>Show information about Qt</source> <translation>Mostrar información acerca de Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opciones...</translation> </message> <message> <location line="+9"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifrar monedero…</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>Copia de &amp;respaldo del monedero...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Cambiar la contraseña…</translation> </message> <message> <location line="+10"/> <source>&amp;Sending addresses...</source> <translation>$Enviando dirección...</translation> </message> <message> <location line="+2"/> <source>&amp;Receiving addresses...</source> <translation>&amp;Recibiendo dirección</translation> </message> <message> <location line="+3"/> <source>Open &amp;URI...</source> <translation>Abrir URI...</translation> </message> <message> <location line="+325"/> <source>Importing blocks from disk...</source> <translation>Importando bloques de disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Reindexando bloques en disco...</translation> </message> <message> <location line="-405"/> <source>Send coins to a Horuscoin address</source> <translation>Enviar monedas a una dirección Horuscoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Horuscoin Core</source> <translation>Modificar las opciones de configuración de Horuscoin</translation> </message> <message> <location line="+12"/> <source>Backup wallet to another location</source> <translation>Copia de seguridad del monedero en otra ubicación</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Ventana de &amp;depuración</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir la consola de depuración y diagnóstico</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensaje...</translation> </message> <message> <location line="+430"/> <source>Horuscoin</source> <translation>Horuscoin</translation> </message> <message> <location line="-643"/> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <location line="+146"/> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Recibir</translation> </message> <message> <location line="+46"/> <location line="+2"/> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar/ocultar</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Mostrar u ocultar la ventana principal</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Cifrar las claves privadas de su monedero</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Horuscoin addresses to prove you own them</source> <translation>Firmar mensajes con sus direcciones Horuscoin para demostrar la propiedad</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Horuscoin addresses</source> <translation>Verificar mensajes comprobando que están firmados con direcciones Horuscoin concretas</translation> </message> <message> <location line="+48"/> <source>&amp;File</source> <translation>&amp;Archivo</translation> </message> <message> <location line="+14"/> <source>&amp;Settings</source> <translation>&amp;Configuración</translation> </message> <message> <location line="+9"/> <source>&amp;Help</source> <translation>A&amp;yuda</translation> </message> <message> <location line="+15"/> <source>Tabs toolbar</source> <translation>Barra de pestañas</translation> </message> <message> <location line="-284"/> <location line="+376"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="-401"/> <source>Horuscoin Core</source> <translation>Núcleo de Horuscoin</translation> </message> <message> <location line="+163"/> <source>Request payments (generates QR codes and horuscoin: URIs)</source> <translation>Solicitar pagos (genera codigo QR y URL&apos;s de Horuscoin)</translation> </message> <message> <location line="+29"/> <location line="+2"/> <source>&amp;About Horuscoin Core</source> <translation>&amp;Acerca del Núcleo de Horuscoin</translation> </message> <message> <location line="+35"/> <source>Show the list of used sending addresses and labels</source> <translation>Mostrar la lista de direcciones de envío y etiquetas</translation> </message> <message> <location line="+2"/> <source>Show the list of used receiving addresses and labels</source> <translation>Muestra la lista de direcciones de recepción y etiquetas</translation> </message> <message> <location line="+3"/> <source>Open a horuscoin: URI or payment request</source> <translation>Abrir un horuscoin: URI o petición de pago</translation> </message> <message> <location line="+2"/> <source>&amp;Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the Horuscoin Core help message to get a list with possible Horuscoin Core command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+159"/> <location line="+5"/> <source>Horuscoin client</source> <translation>Cliente Horuscoin</translation> </message> <message numerus="yes"> <location line="+142"/> <source>%n active connection(s) to Horuscoin network</source> <translation><numerusform>%n conexión activa hacia la red Horuscoin</numerusform><numerusform>%n conexiones activas hacia la red Horuscoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Ninguna fuente de bloques disponible ...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Se han procesado %1 de %2 bloques (estimados) del historial de transacciones.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Procesados %1 bloques del historial de transacciones.</translation> </message> <message numerus="yes"> <location line="+23"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n día</numerusform><numerusform>%n días</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 atrás</translation> </message> <message> <location line="+21"/> <source>Last received block was generated %1 ago.</source> <translation>El último bloque recibido fue generado hace %1.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Las transacciones posteriores aún no están visibles.</translation> </message> <message> <location line="+27"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Información</translation> </message> <message> <location line="-85"/> <source>Up to date</source> <translation>Actualizado</translation> </message> <message> <location line="+34"/> <source>Catching up...</source> <translation>Actualizando...</translation> </message> <message> <location line="+130"/> <source>Sent transaction</source> <translation>Transacción enviada</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transacción entrante</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Fecha: %1 Cantidad: %2 Tipo: %3 Dirección: %4 </translation> </message> <message> <location line="+69"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+438"/> <source>A fatal error occurred. Horuscoin Core can no longer continue safely and will quit.</source> <translation>Ha ocurrido un error crítico. Horuscoin ya no puede continuar con seguridad y se cerrará.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+119"/> <source>Network Alert</source> <translation>Alerta de red</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control Address Selection</source> <translation>Selección de la dirección de control de la moneda</translation> </message> <message> <location line="+34"/> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <location line="+29"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+45"/> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <location line="+29"/> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <location line="+45"/> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <location line="+32"/> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <location line="+48"/> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <location line="+32"/> <source>Change:</source> <translation>Cambio:</translation> </message> <message> <location line="+63"/> <source>(un)select all</source> <translation>(des)selecciona todos</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Modo arbol</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <location line="+52"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+10"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmaciones</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prioridad</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+42"/> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copiar cantidad</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <location line="+1"/> <source>Lock unspent</source> <translation>Bloquear lo no gastado</translation> </message> <message> <location line="+1"/> <source>Unlock unspent</source> <translation>Desbloquear lo no gastado</translation> </message> <message> <location line="+22"/> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar cambio</translation> </message> <message> <location line="+323"/> <source>highest</source> <translation>lo más alto</translation> </message> <message> <location line="+1"/> <source>higher</source> <translation>más alto</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>alto</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>medio-alto</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>medio</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>bajo-medio</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>bajo</translation> </message> <message> <location line="+1"/> <source>lower</source> <translation>más bajo</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>lo más bajo</translation> </message> <message> <location line="+11"/> <source>(%1 locked)</source> <translation>(%1 bloqueado)</translation> </message> <message> <location line="+31"/> <source>none</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Dust</source> <translation>Basura</translation> </message> <message> <location line="+0"/> <source>yes</source> <translation>si</translation> </message> <message> <location line="+0"/> <source>no</source> <translation>no</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> <translation>Esta etiqueta se torna roja si el tamaño de la transación es mayor a 1000 bytes.</translation> </message> <message> <location line="+1"/> <location line="+5"/> <source>This means a fee of at least %1 per kB is required.</source> <translation>Esto implica que se requiere una tarifa de al menos %1 por kB</translation> </message> <message> <location line="-4"/> <source>Can vary +/- 1 byte per input.</source> <translation>Puede variar +/- 1 byte por entrada.</translation> </message> <message> <location line="+2"/> <source>Transactions with higher priority are more likely to get included into a block.</source> <translation>Las transacciones con alta prioridad son más propensas a ser incluidas dentro de un bloque.</translation> </message> <message> <location line="+1"/> <source>This label turns red, if the priority is smaller than &quot;medium&quot;.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation>Esta etiqueta se torna roja si cualquier destinatario recibe una cantidad menor a %1.</translation> </message> <message> <location line="+1"/> <location line="+4"/> <source>This means a fee of at least %1 is required.</source> <translation>Esto significa que se necesita una tarifa de al menos %1.</translation> </message> <message> <location line="-3"/> <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> <translation>Cantidades por debajo de 0.546 veces la tasa serán mostradas como basura</translation> </message> <message> <location line="+2"/> <source>This label turns red, if the change is smaller than %1.</source> <translation>Esta etiqueta se vuelve roja si la cantidad de monedas es menor a %1</translation> </message> <message> <location line="+43"/> <location line="+66"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>Enviar desde %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(cambio)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Dirección</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Etiqueta</translation> </message> <message> <location line="+10"/> <source>The label associated with this address list entry</source> <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation> </message> <message> <location line="+17"/> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation>La dirección asociada con esta entrada de la lista de direcciones. Solo puede ser modificada para direcciones de envío.</translation> </message> <message> <location line="-10"/> <source>&amp;Address</source> <translation>&amp;Dirección</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+28"/> <source>New receiving address</source> <translation>Nueva dirección de recepción</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nueva dirección de envío</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar dirección de recepción</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar dirección de envío</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>La dirección introducida &quot;%1&quot; ya está presente en la libreta de direcciones.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Horuscoin address.</source> <translation>La dirección introducida &quot;%1&quot; no es una dirección Horuscoin válida.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>No se pudo desbloquear el monedero.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Ha fallado la generación de la nueva clave.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <location filename="../intro.cpp" line="+65"/> <source>A new data directory will be created.</source> <translation>Se creará un nuevo directorio de datos.</translation> </message> <message> <location line="+22"/> <source>name</source> <translation>nombre</translation> </message> <message> <location line="+2"/> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation>El directorio ya existe. Añada %1 si pretende crear aquí un directorio nuevo.</translation> </message> <message> <location line="+3"/> <source>Path already exists, and is not a directory.</source> <translation>La ruta ya existe y no es un directorio.</translation> </message> <message> <location line="+7"/> <source>Cannot create data directory here.</source> <translation>No se puede crear un directorio de datos aquí.</translation> </message> </context> <context> <name>HelpMessageDialog</name> <message> <location filename="../forms/helpmessagedialog.ui" line="+19"/> <source>Horuscoin Core - Command-line options</source> <translation type="unfinished"/> </message> <message> <location filename="../utilitydialog.cpp" line="+38"/> <source>Horuscoin Core</source> <translation>Núcleo de Horuscoin</translation> </message> <message> <location line="+0"/> <source>version</source> <translation>versión</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>opciones de la línea de órdenes</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Opciones GUI</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Establecer el idioma, por ejemplo, &quot;es_ES&quot; (predeterminado: configuración regional del sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Arrancar minimizado</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar pantalla de bienvenida en el inicio (predeterminado: 1)</translation> </message> <message> <location line="+1"/> <source>Choose data directory on startup (default: 0)</source> <translation>Elegir directorio de datos al iniciar (predeterminado: 0)</translation> </message> </context> <context> <name>Intro</name> <message> <location filename="../forms/intro.ui" line="+14"/> <source>Welcome</source> <translation>Bienvenido</translation> </message> <message> <location line="+9"/> <source>Welcome to Horuscoin Core.</source> <translation>Bienvenido al Núcleo de Horuscoin</translation> </message> <message> <location line="+26"/> <source>As this is the first time the program is launched, you can choose where Horuscoin Core will store its data.</source> <translation>Al ser la primera vez que se ejecuta el programa, puede elegir dónde almacenará sus datos Horuscoin-Qt.</translation> </message> <message> <location line="+10"/> <source>Horuscoin Core will download and store a copy of the Horuscoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation>Horuscoin-Qt va a descargar y guardar una copia de la cadena de bloques de Horuscoin. Se almacenará al menos %1GB de datos en este directorio, que irá creciendo con el tiempo. El monedero se guardará también en este directorio.</translation> </message> <message> <location line="+10"/> <source>Use the default data directory</source> <translation>Utilizar el directorio de datos predeterminado</translation> </message> <message> <location line="+7"/> <source>Use a custom data directory:</source> <translation>Utilice un directorio de datos personalizado:</translation> </message> <message> <location filename="../intro.cpp" line="+85"/> <source>Horuscoin</source> <translation>Horuscoin</translation> </message> <message> <location line="+1"/> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation>Error: No puede crearse el directorio de datos especificado &quot;%1&quot;.</translation> </message> <message> <location line="+19"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="+9"/> <source>GB of free space available</source> <translation>GB de espacio libre disponible</translation> </message> <message> <location line="+3"/> <source>(of %1GB needed)</source> <translation>(de los %1GB necesarios)</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <location filename="../forms/openuridialog.ui" line="+14"/> <source>Open URI</source> <translation>Abrir URI...</translation> </message> <message> <location line="+6"/> <source>Open payment request from URI or file</source> <translation>El pago requiere una URI o archivo</translation> </message> <message> <location line="+9"/> <source>URI:</source> <translation>URI:</translation> </message> <message> <location line="+11"/> <source>Select payment request file</source> <translation>Seleccione archivo de sulicitud de pago</translation> </message> <message> <location filename="../openuridialog.cpp" line="+47"/> <source>Select payment request file to open</source> <translation>Abrir archivo de solicitud de pago</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opciones</translation> </message> <message> <location line="+13"/> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Tarifa de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Comisión de &amp;transacciones</translation> </message> <message> <location line="+31"/> <source>Automatically start Horuscoin Core after logging in to the system.</source> <translation>Iniciar Horuscoin automáticamente al encender el sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Horuscoin Core on system login</source> <translation>&amp;Iniciar Horuscoin al iniciar el sistema</translation> </message> <message> <location line="+9"/> <source>Size of &amp;database cache</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Establecer el tamaño de caché de la base de datos en megabytes (predeterminado: 25)</translation> </message> <message> <location line="+13"/> <source>MB</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Number of script &amp;verification threads</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Configura el número de hilos para el script de verificación (hasta 16, 0 = auto, &lt;0 = leave that many cores free, por fecto: 0)</translation> </message> <message> <location line="+58"/> <source>Connect to the Horuscoin network through a SOCKS proxy.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy (default proxy):</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation type="unfinished"/> </message> <message> <location line="+224"/> <source>Active command-line options that override above options:</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Reset all client options to default.</source> <translation>Restablecer todas las opciones del cliente a las predeterminadas.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Restablecer opciones</translation> </message> <message> <location line="-323"/> <source>&amp;Network</source> <translation>&amp;Red</translation> </message> <message> <location line="+6"/> <source>Automatically open the Horuscoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir automáticamente el puerto del cliente Horuscoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear el puerto usando &amp;UPnP</translation> </message> <message> <location line="+19"/> <source>Proxy &amp;IP:</source> <translation>Dirección &amp;IP del proxy:</translation> </message> <message> <location line="+32"/> <source>&amp;Port:</source> <translation>&amp;Puerto:</translation> </message> <message> <location line="+25"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Puerto del servidor proxy (ej. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versión SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versión del proxy SOCKS (ej. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Ventana</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimizar en lugar de salir de la aplicación al cerrar la ventana. Cuando esta opción está activa, la aplicación solo se puede cerrar seleccionando Salir desde el menú.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar al cerrar</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Interfaz</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>I&amp;dioma de la interfaz de usuario</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Horuscoin Core.</source> <translation>El idioma de la interfaz de usuario puede establecerse aquí. Este ajuste se aplicará cuando se reinicie Horuscoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>Mostrar las cantidades en la &amp;unidad:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas.</translation> </message> <message> <location line="+9"/> <source>Whether to show Horuscoin addresses in the transaction list or not.</source> <translation>Mostrar o no las direcciones Horuscoin en la lista de transacciones.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Mostrar las direcciones en la lista de transacciones</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation>Mostrar o no características de control de moneda</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only)</source> <translation>Mostrar moneda y características de control (Avanzado)</translation> </message> <message> <location line="+136"/> <source>&amp;OK</source> <translation>&amp;Aceptar</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+67"/> <source>default</source> <translation>predeterminado</translation> </message> <message> <location line="+57"/> <source>none</source> <translation type="unfinished"/> </message> <message> <location line="+75"/> <source>Confirm options reset</source> <translation>Confirme el restablecimiento de las opciones</translation> </message> <message> <location line="+1"/> <location line="+29"/> <source>Client restart required to activate changes.</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Client will be shutdown, do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <source>This change would require a client restart.</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The supplied proxy address is invalid.</source> <translation>La dirección proxy indicada es inválida.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Desde</translation> </message> <message> <location line="+50"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Horuscoin network after a connection is established, but this process has not completed yet.</source> <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Horuscoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado.</translation> </message> <message> <location line="-155"/> <source>Unconfirmed:</source> <translation>No confirmado(s):</translation> </message> <message> <location line="-83"/> <source>Wallet</source> <translation>Monedero</translation> </message> <message> <location line="+51"/> <source>Confirmed:</source> <translation>Confirmado:</translation> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Su balance actual gastable</translation> </message> <message> <location line="+32"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>Total de transacciones que deben ser confirmadas, y que no cuentan con el balance gastable necesario</translation> </message> <message> <location line="+16"/> <source>Immature:</source> <translation>No disponible:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Saldo recién minado que aún no está disponible.</translation> </message> <message> <location line="+16"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Su balance actual total</translation> </message> <message> <location line="+71"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Movimientos recientes&lt;/b&gt;</translation> </message> <message> <location filename="../overviewpage.cpp" line="+120"/> <location line="+1"/> <source>out of sync</source> <translation>desincronizado</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+403"/> <location line="+13"/> <source>URI handling</source> <translation>Gestión de URI</translation> </message> <message> <location line="+1"/> <source>URI can not be parsed! This can be caused by an invalid Horuscoin address or malformed URI parameters.</source> <translation>¡No se puede interpretar la URI! Esto puede deberse a una dirección Horuscoin inválida o a parámetros de URI mal formados.</translation> </message> <message> <location line="+96"/> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation>La cantidad del pago solicitado (%1) es demasiado pequeña (considerada polvo).</translation> </message> <message> <location line="-221"/> <location line="+212"/> <location line="+13"/> <location line="+95"/> <location line="+18"/> <location line="+16"/> <source>Payment request error</source> <translation>Error en petición de pago</translation> </message> <message> <location line="-353"/> <source>Cannot start horuscoin: click-to-pay handler</source> <translation>No se pudo iniciar horuscoin: manejador de pago-al-clic</translation> </message> <message> <location line="+58"/> <source>Net manager warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Your active proxy doesn&apos;t support SOCKS5, which is required for payment requests via proxy.</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>Payment request fetch URL is invalid: %1</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Payment request file handling</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> <translation type="unfinished"/> </message> <message> <location line="+73"/> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation>No están soportadas las peticiones inseguras a scripts de pago personalizados</translation> </message> <message> <location line="+59"/> <source>Refund from %1</source> <translation>Devolución de %1</translation> </message> <message> <location line="+43"/> <source>Error communicating with %1: %2</source> <translation>Error en la comunicación con %1: %2</translation> </message> <message> <location line="+24"/> <source>Payment request can not be parsed or processed!</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Bad response from server %1</source> <translation>Respuesta errónea del servidor %1</translation> </message> <message> <location line="+33"/> <source>Payment acknowledged</source> <translation>Pago aceptado</translation> </message> <message> <location line="-11"/> <source>Network request error</source> <translation>Error en petición de red</translation> </message> </context> <context> <name>QObject</name> <message> <location filename="../bitcoin.cpp" line="+71"/> <location line="+11"/> <source>Horuscoin</source> <translation>Horuscoin</translation> </message> <message> <location line="+1"/> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation>Error: El directorio de datos especificado &quot;%1&quot; no existe.</translation> </message> <message> <location line="-12"/> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation>Error: Combinación no válida de -regtest y -testnet.</translation> </message> <message> <location filename="../guiutil.cpp" line="+82"/> <source>Enter a Horuscoin address (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation>Introduzca una dirección Horuscoin (ej. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</translation> </message> </context> <context> <name>QRImageWidget</name> <message> <location filename="../receiverequestdialog.cpp" line="+36"/> <source>&amp;Save Image...</source> <translation>Guardar Imagen...</translation> </message> <message> <location line="+3"/> <source>&amp;Copy Image</source> <translation>Copiar imagen</translation> </message> <message> <location line="+28"/> <source>Save QR Code</source> <translation>Guardar código QR</translation> </message> <message> <location line="+0"/> <source>PNG Image (*.png)</source> <translation>Imágenes PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nombre del cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+23"/> <location line="+36"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+359"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-223"/> <source>Client version</source> <translation>Versión del cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Información</translation> </message> <message> <location line="-10"/> <source>Debug window</source> <translation>Ventana de depuración</translation> </message> <message> <location line="+25"/> <source>General</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Using OpenSSL version</source> <translation>Utilizando la versión OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Hora de inicio</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Red</translation> </message> <message> <location line="+7"/> <source>Name</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Number of connections</source> <translation>Número de conexiones</translation> </message> <message> <location line="+29"/> <source>Block chain</source> <translation>Cadena de bloques</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Número actual de bloques</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Bloques totales estimados</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Hora del último bloque</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <location line="+72"/> <source>&amp;Network Traffic</source> <translation>&amp;Tráfico de Red</translation> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation>&amp;Limpiar</translation> </message> <message> <location line="+13"/> <source>Totals</source> <translation>Total:</translation> </message> <message> <location line="+64"/> <source>In:</source> <translation>Dentro:</translation> </message> <message> <location line="+80"/> <source>Out:</source> <translation>Fuera:</translation> </message> <message> <location line="-521"/> <source>Build date</source> <translation>Fecha de compilación</translation> </message> <message> <location line="+206"/> <source>Debug log file</source> <translation>Archivo de registro de depuración</translation> </message> <message> <location line="+7"/> <source>Open the Horuscoin Core debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir el archivo de registro de depuración en el directorio actual de datos. Esto puede llevar varios segundos para archivos de registro grandes.</translation> </message> <message> <location line="+76"/> <source>Clear console</source> <translation>Borrar consola</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Horuscoin Core RPC console.</source> <translation>Bienvenido a la consola RPC de Horuscoin</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use las flechas arriba y abajo para navegar por el historial y &lt;b&gt;Control+L&lt;/b&gt; para limpiar la pantalla.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Escriba &lt;b&gt;help&lt;/b&gt; para ver un resumen de los comandos disponibles.</translation> </message> <message> <location line="+122"/> <source>%1 B</source> <translation>%1 B</translation> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation>%1 KB</translation> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation>%1 MB</translation> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation>%1 GB</translation> </message> <message> <location line="+7"/> <source>%1 m</source> <translation>%1 m</translation> </message> <message> <location line="+5"/> <source>%1 h</source> <translation>%1 h</translation> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation>%1 h %2 m</translation> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <location filename="../forms/receivecoinsdialog.ui" line="+107"/> <source>&amp;Amount:</source> <translation>Cantidad</translation> </message> <message> <location line="-16"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="-37"/> <source>&amp;Message:</source> <translation>Mensaje:</translation> </message> <message> <location line="-20"/> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation>Reutilizar una de las direcciones previamente usadas para recibir. Reutilizar direcciones tiene problemas de seguridad y privacidad. No lo uses a menos que antes regeneres una solicitud de pago.</translation> </message> <message> <location line="+3"/> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation>R&amp;eutilizar una dirección existente para recibir (no recomendado)</translation> </message> <message> <location line="+14"/> <location line="+23"/> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Horuscoin network.</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <location line="+21"/> <source>An optional label to associate with the new receiving address.</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <location line="+22"/> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Clear all fields of the form.</source> <translation>Limpiar todos los campos del formulario.</translation> </message> <message> <location line="+3"/> <source>Clear</source> <translation>Limpiar</translation> </message> <message> <location line="+78"/> <source>Requested payments history</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>&amp;Request payment</source> <translation>&amp;Solicitar pago</translation> </message> <message> <location line="+120"/> <source>Show the selected request (does the same as double clicking an entry)</source> <translation>Muestra la petición seleccionada (También doble clic)</translation> </message> <message> <location line="+3"/> <source>Show</source> <translation>Mostrar</translation> </message> <message> <location line="+11"/> <source>Remove the selected entries from the list</source> <translation>Borrar de la lista las direcciónes actualmente seleccionadas</translation> </message> <message> <location line="+3"/> <source>Remove</source> <translation>Eliminar</translation> </message> <message> <location filename="../receivecoinsdialog.cpp" line="+38"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy message</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar cantidad</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <location filename="../forms/receiverequestdialog.ui" line="+29"/> <source>QR Code</source> <translation>Código QR</translation> </message> <message> <location line="+46"/> <source>Copy &amp;URI</source> <translation>Copiar &amp;URI</translation> </message> <message> <location line="+7"/> <source>Copy &amp;Address</source> <translation>Copiar &amp;Dirección</translation> </message> <message> <location line="+7"/> <source>&amp;Save Image...</source> <translation>Guardar Imagen...</translation> </message> <message> <location filename="../receiverequestdialog.cpp" line="+56"/> <source>Request payment to %1</source> <translation>Solicitar pago a %1</translation> </message> <message> <location line="+6"/> <source>Payment information</source> <translation>Información de pago</translation> </message> <message> <location line="+1"/> <source>URI</source> <translation>URI</translation> </message> <message> <location line="+2"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+2"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+2"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+2"/> <source>Message</source> <translation>Mensaje</translation> </message> <message> <location line="+10"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante demasiado larga. Intente reducir el texto de la etiqueta / mensaje.</translation> </message> <message> <location line="+5"/> <source>Error encoding URI into QR Code.</source> <translation>Error al codificar la URI en el código QR.</translation> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <location filename="../recentrequeststablemodel.cpp" line="+24"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+0"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+0"/> <source>Message</source> <translation>Mensaje</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+38"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <location line="+9"/> <source>(no message)</source> <translation>(Ningun mensaje)</translation> </message> <message> <location line="+8"/> <source>(no amount)</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+380"/> <location line="+80"/> <source>Send Coins</source> <translation>Enviar monedas</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Características de control de la moneda</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entradas...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>Seleccionado automaticamente</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Fondos insuficientes!</translation> </message> <message> <location line="+89"/> <source>Quantity:</source> <translation>Cantidad:</translation> </message> <message> <location line="+35"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Cuantía:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prioridad:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Tasa:</translation> </message> <message> <location line="+32"/> <source>Low Output:</source> <translation>Envío pequeño:</translation> </message> <message> <location line="+48"/> <source>After Fee:</source> <translation>Después de tasas:</translation> </message> <message> <location line="+32"/> <source>Change:</source> <translation>Cambio:</translation> </message> <message> <location line="+44"/> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation>Al activarse, si la dirección esta vacía o es inválida, las monedas serán enviadas a una nueva dirección generada.</translation> </message> <message> <location line="+3"/> <source>Custom change address</source> <translation>Dirección propia</translation> </message> <message> <location line="+164"/> <source>Send to multiple recipients at once</source> <translation>Enviar a múltiples destinatarios de una vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Añadir &amp;destinatario</translation> </message> <message> <location line="-23"/> <source>Clear all fields of the form.</source> <translation>Limpiar todos los campos del formulario</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Limpiar &amp;todo</translation> </message> <message> <location line="+52"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="-78"/> <source>Confirm the send action</source> <translation>Confirmar el envío</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-229"/> <source>Confirm send coins</source> <translation>Confirmar el envío de monedas</translation> </message> <message> <location line="-74"/> <location line="+5"/> <location line="+5"/> <location line="+4"/> <source>%1 to %2</source> <translation>%1 a %2</translation> </message> <message> <location line="-121"/> <source>Copy quantity</source> <translation>Copiar cantidad</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Copiar donación</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Copiar después de aplicar donación</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Copiar prioridad</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar envío pequeño</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar Cambio</translation> </message> <message> <location line="+170"/> <source>Total Amount %1 (= %2)</source> <translation>Cuantía Total %1 (=%2)</translation> </message> <message> <location line="+2"/> <source>or</source> <translation>o</translation> </message> <message> <location line="+203"/> <source>The recipient address is not valid, please recheck.</source> <translation>La dirección de recepción no es válida, compruébela de nuevo.</translation> </message> <message> <location line="+3"/> <source>The amount to pay must be larger than 0.</source> <translation>La cantidad por pagar tiene que ser mayor de 0.</translation> </message> <message> <location line="+3"/> <source>The amount exceeds your balance.</source> <translation>La cantidad sobrepasa su saldo.</translation> </message> <message> <location line="+3"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>El total sobrepasa su saldo cuando se incluye la tasa de envío de %1</translation> </message> <message> <location line="+3"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.</translation> </message> <message> <location line="+3"/> <source>Transaction creation failed!</source> <translation>¡Ha fallado la creación de la transacción!</translation> </message> <message> <location line="+4"/> <source>The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>La transacción fue rechazada. Esto puede haber ocurrido si alguna de las monedas ya estaba gastada o si ha usado una copia de wallet.dat y las monedas se gastaron en la copia pero no se han marcado como gastadas aqui.</translation> </message> <message> <location line="+113"/> <source>Warning: Invalid Horuscoin address</source> <translation>Alerta: Dirección de Horuscoin inválida</translation> </message> <message> <location line="+20"/> <source>(no label)</source> <translation>(sin etiqueta)</translation> </message> <message> <location line="-11"/> <source>Warning: Unknown change address</source> <translation>Alerta: Dirección de Horuscoin inválida</translation> </message> <message> <location line="-367"/> <source>Are you sure you want to send?</source> <translation>¿Está seguro que desea enviar?</translation> </message> <message> <location line="+9"/> <source>added as transaction fee</source> <translation>añadido como comisión de transacción</translation> </message> <message> <location line="+171"/> <source>Payment request expired</source> <translation>Petición de pago expirada</translation> </message> <message> <location line="+8"/> <source>Invalid payment address %1</source> <translation>Dirección de pago no válida %1</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+131"/> <location line="+521"/> <location line="+536"/> <source>A&amp;mount:</source> <translation>Ca&amp;ntidad:</translation> </message> <message> <location line="-1152"/> <source>Pay &amp;To:</source> <translation>&amp;Pagar a:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation>La dirección a la que enviar el pago (p. ej. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+30"/> <source>Enter a label for this address to add it to your address book</source> <translation>Etiquete esta dirección para añadirla a la libreta</translation> </message> <message> <location filename="../forms/sendcoinsentry.ui" line="+57"/> <source>&amp;Label:</source> <translation>&amp;Etiqueta:</translation> </message> <message> <location line="-50"/> <source>Choose previously used address</source> <translation>Escoger direcciones previamente usadas</translation> </message> <message> <location line="-40"/> <source>This is a normal payment.</source> <translation>Esto es un pago ordinario.</translation> </message> <message> <location line="+50"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <location line="+524"/> <location line="+536"/> <source>Remove this entry</source> <translation>Eliminar esta transacción</translation> </message> <message> <location line="-1008"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+968"/> <source>This is a verified payment request.</source> <translation>Esto es una petición de pago verificado.</translation> </message> <message> <location line="-991"/> <source>Enter a label for this address to add it to the list of used addresses</source> <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation> </message> <message> <location line="+33"/> <source>A message that was attached to the horuscoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Horuscoin network.</source> <translation type="unfinished"/> </message> <message> <location line="+426"/> <source>This is an unverified payment request.</source> <translation>Esto es una petición de pago no verificado.</translation> </message> <message> <location line="+18"/> <location line="+532"/> <source>Pay To:</source> <translation>Paga a:</translation> </message> <message> <location line="-498"/> <location line="+536"/> <source>Memo:</source> <translation>Memo:</translation> </message> </context> <context> <name>ShutdownWindow</name> <message> <location filename="../utilitydialog.cpp" line="+48"/> <source>Horuscoin Core is shutting down...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do not shut down the computer until this window disappears.</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Firmas - Firmar / verificar un mensaje</translation> </message> <message> <location line="+10"/> <source>&amp;Sign Message</source> <translation>&amp;Firmar mensaje</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation>La dirección con la que firmar el mensaje (ej. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</translation> </message> <message> <location line="+7"/> <location line="+210"/> <source>Choose previously used address</source> <translation>Escoger dirección previamente usada</translation> </message> <message> <location line="-200"/> <location line="+210"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-200"/> <source>Paste address from clipboard</source> <translation>Pegar dirección desde portapapeles</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Introduzca el mensaje que desea firmar aquí</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Firma</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar la firma actual al portapapeles del sistema</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Horuscoin address</source> <translation>Firmar el mensaje para demostrar que se posee esta dirección Horuscoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Firmar &amp;mensaje</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Limpiar todos los campos de la firma de mensaje</translation> </message> <message> <location line="+3"/> <location line="+143"/> <source>Clear &amp;All</source> <translation>Limpiar &amp;todo</translation> </message> <message> <location line="-84"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar mensaje</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation>La dirección con la que se firmó el mensaje (ej. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</translation> </message> <message> <location line="+37"/> <source>Verify the message to ensure it was signed with the specified Horuscoin address</source> <translation>Verificar el mensaje para comprobar que fue firmado con la dirección Horuscoin indicada</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verificar &amp;mensaje</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Limpiar todos los campos de la verificación de mensaje</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+30"/> <source>Enter a Horuscoin address (e.g. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</source> <translation>Introduzca una dirección Horuscoin (ej. DJ7zB7c5BsB9UJLy1rKQtY7c6CQfGiaRLM)</translation> </message> <message> <location line="-1"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Haga clic en &quot;Firmar mensaje&quot; para generar la firma</translation> </message> <message> <location line="+84"/> <location line="+80"/> <source>The entered address is invalid.</source> <translation>La dirección introducida es inválida.</translation> </message> <message> <location line="-80"/> <location line="+8"/> <location line="+72"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Verifique la dirección e inténtelo de nuevo.</translation> </message> <message> <location line="-80"/> <location line="+80"/> <source>The entered address does not refer to a key.</source> <translation>La dirección introducida no corresponde a una clave.</translation> </message> <message> <location line="-72"/> <source>Wallet unlock was cancelled.</source> <translation>Se ha cancelado el desbloqueo del monedero. </translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>No se dispone de la clave privada para la dirección introducida.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Ha fallado la firma del mensaje.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensaje firmado.</translation> </message> <message> <location line="+58"/> <source>The signature could not be decoded.</source> <translation>No se puede decodificar la firma.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Compruebe la firma e inténtelo de nuevo.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La firma no coincide con el resumen del mensaje.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>La verificación del mensaje ha fallado.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensaje verificado.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+28"/> <source>Horuscoin Core</source> <translation>Núcleo de Horuscoin</translation> </message> <message> <location line="+2"/> <source>The Horuscoin Core developers</source> <translation>Los desarrolladores del Núcleo de Horuscoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+79"/> <source>KB/s</source> <translation>KB/s</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+28"/> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/fuera de línea</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/no confirmado</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmaciones</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitir a través de %n nodo</numerusform><numerusform>, transmitir a través de %n nodos</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fuente</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generado</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>dirección propia</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>etiqueta</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+53"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-125"/> <source>matures in %n more block(s)</source> <translation><numerusform>disponible en %n bloque más</numerusform><numerusform>disponible en %n bloques más</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>no aceptada</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+53"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-62"/> <source>Transaction fee</source> <translation>Comisión de transacción</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Cantidad neta</translation> </message> <message> <location line="+6"/> <location line="+9"/> <source>Message</source> <translation>Mensaje</translation> </message> <message> <location line="-7"/> <source>Comment</source> <translation>Comentario</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>Identificador de transacción</translation> </message> <message> <location line="+18"/> <source>Merchant</source> <translation>Vendedor</translation> </message> <message> <location line="+7"/> <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Las monedas generadas deben madurar %1 bloques antes de que puedan ser gastadas. Una vez que generas este bloque, es propagado por la red para ser añadido a la cadena de bloques. Si falla el intento de meterse en la cadena, su estado cambiará a &quot;no aceptado&quot; y ya no se puede gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del tuyo.</translation> </message> <message> <location line="+8"/> <source>Debug information</source> <translation>Información de depuración</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transacción</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadero</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-232"/> <source>, has not been successfully broadcast yet</source> <translation>, todavía no se ha sido difundido satisfactoriamente</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>desconocido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalles de transacción</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Esta ventana muestra información detallada sobre la transacción</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+234"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+59"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+16"/> <source>Open for %n more block(s)</source> <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Abierto hasta %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Fuera de línea (%1 confirmaciones)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>No confirmado (%1 de %2 confirmaciones)</translation> </message> <message> <location line="-22"/> <location line="+25"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmado (%1 confirmaciones)</translation> </message> <message> <location line="-22"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generado pero no aceptado</translation> </message> <message> <location line="+62"/> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recibidos de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pago propio</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(nd)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Fecha y hora en que se recibió la transacción.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transacción.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Dirección de destino de la transacción.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Cantidad retirada o añadida al saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+57"/> <location line="+16"/> <source>All</source> <translation>Todo</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoy</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mes</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mes pasado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este año</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Rango...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recibido con</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviado a</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>A usted mismo</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Otra</translation> </message> <message> <location line="+6"/> <source>Enter address or label to search</source> <translation>Introduzca una dirección o etiqueta que buscar</translation> </message> <message> <location line="+6"/> <source>Min amount</source> <translation>Cantidad mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar dirección</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar etiqueta</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar cuantía</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar identificador de transacción</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar etiqueta</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalles de la transacción</translation> </message> <message> <location line="+142"/> <source>Export Transaction History</source> <translation>Exportar historial de transacciones</translation> </message> <message> <location line="+19"/> <source>Exporting Failed</source> <translation>Error exportando</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the transaction history to %1.</source> <translation>Ha habido un error al intentar guardar la transacción con %1.</translation> </message> <message> <location line="+4"/> <source>Exporting Successful</source> <translation>Exportación finalizada</translation> </message> <message> <location line="+0"/> <source>The transaction history was successfully saved to %1.</source> <translation>La transacción ha sido guardada en %1.</translation> </message> <message> <location line="-22"/> <source>Comma separated file (*.csv)</source> <translation>Archivos de columnas separadas por coma (*.csv)</translation> </message> <message> <location line="+9"/> <source>Confirmed</source> <translation>Confirmado</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Fecha</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Etiqueta</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Dirección</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Cantidad</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+107"/> <source>Range:</source> <translation>Rango:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>para</translation> </message> </context> <context> <name>WalletFrame</name> <message> <location filename="../walletframe.cpp" line="+26"/> <source>No wallet has been loaded.</source> <translation>No se ha cargado ningún monedero</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+245"/> <source>Send Coins</source> <translation>Enviar monedas</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+43"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exportar a un archivo los datos de esta pestaña</translation> </message> <message> <location line="+181"/> <source>Backup Wallet</source> <translation>Respaldo de monedero</translation> </message> <message> <location line="+1"/> <source>Wallet Data (*.dat)</source> <translation>Datos de monedero (*.dat)</translation> </message> <message> <location line="+6"/> <source>Backup Failed</source> <translation>Ha fallado el respaldo</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to %1.</source> <translation>Ha habido un error al intentar guardar los datos del monedero en %1.</translation> </message> <message> <location line="+4"/> <source>The wallet data was successfully saved to %1.</source> <translation>Los datos del monedero se han guardado con éxito en %1.</translation> </message> <message> <location line="+0"/> <source>Backup Successful</source> <translation>Se ha completado con éxito la copia de respaldo</translation> </message> </context> <context> <name>horuscoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+221"/> <source>Usage:</source> <translation>Uso:</translation> </message> <message> <location line="-54"/> <source>List commands</source> <translation>Muestra comandos </translation> </message> <message> <location line="-14"/> <source>Get help for a command</source> <translation>Recibir ayuda para un comando </translation> </message> <message> <location line="+26"/> <source>Options:</source> <translation>Opciones: </translation> </message> <message> <location line="+22"/> <source>Specify configuration file (default: horuscoin.conf)</source> <translation>Especificar archivo de configuración (predeterminado: horuscoin.conf) </translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: horuscoind.pid)</source> <translation>Especificar archivo pid (predeterminado: horuscoind.pid) </translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar directorio para los datos</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Establecer el tamaño de caché de la base de datos en megabytes (predeterminado: 25)</translation> </message> <message> <location line="-26"/> <source>Listen for connections on &lt;port&gt; (default: 22556 or testnet: 44556)</source> <translation>Escuchar conexiones en &lt;puerto&gt; (predeterminado: 22556 o testnet: 44556)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Mantener como máximo &lt;n&gt; conexiones a pares (predeterminado: 125)</translation> </message> <message> <location line="-51"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation> </message> <message> <location line="+84"/> <source>Specify your own public address</source> <translation>Especifique su propia dirección pública</translation> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100)</translation> </message> <message> <location line="-148"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400)</translation> </message> <message> <location line="-36"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s</translation> </message> <message> <location line="+34"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 22555 or testnet: 44555)</source> <translation>Escuchar conexiones JSON-RPC en &lt;puerto&gt; (predeterminado: 22555 o testnet:44555)</translation> </message> <message> <location line="+45"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceptar comandos consola y JSON-RPC </translation> </message> <message> <location line="+80"/> <source>Run in the background as a daemon and accept commands</source> <translation>Ejecutar en segundo plano como daemon y aceptar comandos </translation> </message> <message> <location line="+39"/> <source>Use the test network</source> <translation>Usar la red de pruebas </translation> </message> <message> <location line="-118"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation> </message> <message> <location line="-95"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=horuscoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Horuscoin Alert&quot; admin@foo.com </source> <translation>%s, debe establecer un valor rpcpassword en el archivo de configuración: %s Se recomienda utilizar la siguiente contraseña aleatoria: rpcuser=horuscoinrpc rpcpassword=%s (no es necesario recordar esta contraseña) El nombre de usuario y la contraseña DEBEN NO ser iguales. Si el archivo no existe, créelo con permisos de archivo de solo lectura. Se recomienda también establecer alertnotify para recibir notificaciones de problemas. Por ejemplo: alertnotify=echo %%s | mail -s &quot;Horuscoin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+12"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation>Cifradores aceptables (por defecto: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</translation> </message> <message> <location line="+5"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Horuscoin Core is probably already running.</source> <translation>No se puede bloquear el directorio de datos %s. Probablemente Horuscoin ya se está ejecutando.</translation> </message> <message> <location line="+3"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation>Iniciar modo de prueba de regresión, el cuál utiliza una cadena especial en la cual los bloques pueden ser resueltos instantáneamente. Se utiliza para herramientas de prueba de regresión y desarrollo de aplicaciones.</translation> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>¡Error: se ha rechazado la transacción! Esto puede ocurrir si ya se han gastado algunas de las monedas del monedero, como ocurriría si hubiera hecho una copia de wallet.dat y se hubieran gastado monedas a partir de la copia, con lo que no se habrían marcado aquí como gastadas.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>¡Error: Esta transacción requiere una comisión de al menos %s debido a su monto, complejidad, o al uso de fondos recién recibidos!</translation> </message> <message> <location line="+6"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation> </message> <message> <location line="+18"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería.</translation> </message> <message> <location line="+5"/> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> <translation>Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: -proxy)</translation> </message> <message> <location line="+3"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Horuscoin Core will not work properly.</source> <translation>Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, Horuscoin no funcionará correctamente.</translation> </message> <message> <location line="+3"/> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation>Atención: ¡Parece que la red no está totalmente de acuerdo! Algunos mineros están presentando inconvenientes.</translation> </message> <message> <location line="+3"/> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Atención: ¡Parece que no estamos completamente de acuerdo con nuestros pares! Podría necesitar una actualización, u otros nodos podrían necesitarla.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Aviso: ¡Error al leer wallet.dat! Todas las claves se han leído correctamente, pero podrían faltar o ser incorrectos los datos de transacciones o las entradas de la libreta de direcciones.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad.</translation> </message> <message> <location line="+9"/> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; puede ser:</translation> </message> <message> <location line="+6"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Intento de recuperar claves privadas de un wallet.dat corrupto</translation> </message> <message> <location line="+1"/> <source>Horuscoin Core Daemon</source> <translation>Proceso Horuscoin-QT</translation> </message> <message> <location line="+1"/> <source>Horuscoin Core RPC client version</source> <translation>Versión de cliente HoruscoinROC</translation> </message> <message> <location line="+1"/> <source>Block creation options:</source> <translation>Opciones de creación de bloques:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Conectar sólo a los nodos (o nodo) especificados</translation> </message> <message> <location line="+1"/> <source>Connect through SOCKS proxy</source> <translation>Conectar a través de un proxy SOCKS</translation> </message> <message> <location line="+1"/> <source>Connect to JSON-RPC on &lt;port&gt; (default: 22555 or testnet: 44555)</source> <translation>Conectar a JSON-RPC en &lt;puerto&gt; (predeterminado: 22555 o testnet: 44555)</translation> </message> <message> <location line="+2"/> <source>Corrupted block database detected</source> <translation>Corrupción de base de datos de bloques detectada.</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip)</translation> </message> <message> <location line="+1"/> <source>Do not load the wallet and disable wallet RPC calls</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Error al inicializar la base de datos de bloques</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Error al inicializar el entorno de la base de datos del monedero %s</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Error cargando base de datos de bloques</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Error al abrir base de datos de bloques.</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Error: ¡Espacio en disco bajo!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Error: ¡El monedero está bloqueado; no se puede crear la transacción!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Error: error de sistema: </translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>No se ha podido leer la información de bloque</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>No se ha podido leer el bloque</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>No se ha podido sincronizar el índice de bloques</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>No se ha podido escribir en el índice de bloques</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>No se ha podido escribir la información de bloques</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>No se ha podido escribir el bloque</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>No se ha podido escribir la información de archivo</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>No se ha podido escribir en la base de datos de monedas</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>No se ha podido escribir en el índice de transacciones</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>No se han podido escribir los datos de deshacer</translation> </message> <message> <location line="+1"/> <source>Fee per kB to add to transactions you send</source> <translation>Donación por KB añadida a las transacciones que envíe</translation> </message> <message> <location line="+1"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Generar monedas (por defecto: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Cuántos bloques comprobar al iniciar (predeterminado: 288, 0 = todos)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Como es de exhaustiva la verificación de bloques (0-4, por defecto 3)</translation> </message> <message> <location line="+1"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation>Si no se proporciona &lt;category&gt;, mostrar toda la depuración</translation> </message> <message> <location line="+2"/> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red?</translation> </message> <message> <location line="+3"/> <source>Invalid -onion address: &apos;%s&apos;</source> <translation>Dirección -onion inválida: &apos;%s&apos;</translation> </message> <message> <location line="+15"/> <source>Not enough file descriptors available.</source> <translation>No hay suficientes descriptores de archivo disponibles. </translation> </message> <message> <location line="+5"/> <source>Prepend debug output with timestamp (default: 1)</source> <translation>Anteponer marca temporal a la información de depuración (por defecto: 1)</translation> </message> <message> <location line="+1"/> <source>RPC client options:</source> <translation>Opciones para cliente RPC:</translation> </message> <message> <location line="+1"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales</translation> </message> <message> <location line="+5"/> <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> <translation>Seleccionar version de SOCKS para -proxy (4 o 5, por defecto: 5)</translation> </message> <message> <location line="+1"/> <source>Send command to Horuscoin Core server</source> <translation>Enviar comando a servidor Horuscoin</translation> </message> <message> <location line="+7"/> <source>Set maximum block size in bytes (default: %d)</source> <translation>Establecer tamaño máximo de bloque en bytes (por defecto: %d)</translation> </message> <message> <location line="+2"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Establecer el número de hilos para atender las llamadas RPC (predeterminado: 4)</translation> </message> <message> <location line="+7"/> <source>Specify wallet file (within data directory)</source> <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation> </message> <message> <location line="+2"/> <source>Start Horuscoin Core server</source> <translation>Iniciar servidor Horuscoin</translation> </message> <message> <location line="+3"/> <source>This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Usage (deprecated, use horuscoin-cli):</source> <translation>Uso (desaconsejado, usar horuscoin-cli)</translation> </message> <message> <location line="+7"/> <source>Verifying blocks...</source> <translation>Verificando bloques...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verificando monedero...</translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation>Espere a que se inicie el servidor RPC</translation> </message> <message> <location line="+1"/> <source>Wallet %s resides outside data directory %s</source> <translation>El monedero %s se encuentra fuera del directorio de datos %s</translation> </message> <message> <location line="+2"/> <source>Wallet options:</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation>Aviso: Argumento -debugnet anticuado, utilice -debug=net</translation> </message> <message> <location line="+2"/> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation>Usted necesita reconstruir la base de datos utilizando -reindex para cambiar -txindex</translation> </message> <message> <location line="-79"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importa los bloques desde un archivo blk000??.dat externo</translation> </message> <message> <location line="-105"/> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje)</translation> </message> <message> <location line="+14"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation>Mostrar depuración (por defecto: 0, proporcionar &lt;category&gt; es opcional)</translation> </message> <message> <location line="+2"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation>Establecer tamaño máximo de las transacciones de alta prioridad/comisión baja en bytes (por defecto: %d)</translation> </message> <message> <location line="+2"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Configura el número de hilos para el script de verificación (hasta 16, 0 = auto, &lt;0 = leave that many cores free, por fecto: 0)</translation> </message> <message> <location line="+89"/> <source>Information</source> <translation>Información</translation> </message> <message> <location line="+4"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Inválido por el monto -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Inválido por el monto -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Mantener índice de transacciones completo (predeterminado: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (predeterminado: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Búfer de recepción máximo por conexión, , &lt;n&gt;*1000 bytes (predeterminado: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Conectarse solo a nodos de la red &lt;net&gt; (IPv4, IPv6 o Tor)</translation> </message> <message> <location line="+9"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Opciones SSL: (ver la Bitcoin Wiki para instrucciones de configuración SSL)</translation> </message> <message> <location line="+4"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation> </message> <message> <location line="+6"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Establecer tamaño mínimo de bloque en bytes (predeterminado: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Transacción falló</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000)</translation> </message> <message> <location line="+6"/> <source>System error: </source> <translation>Error de sistema: </translation> </message> <message> <location line="+5"/> <source>Transaction amount too small</source> <translation>Monto de la transacción muy pequeño</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Montos de transacciones deben ser positivos</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transacción demasiado grande</translation> </message> <message> <location line="+8"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para asignar el puerto de escucha (predeterminado: 1 al escuchar)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nombre de usuario para las conexiones JSON-RPC </translation> </message> <message> <location line="+7"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Aviso: Esta versión es obsoleta, actualización necesaria!</translation> </message> <message> <location line="+2"/> <source>version</source> <translation>versión</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupto. Ha fallado la recuperación.</translation> </message> <message> <location line="-58"/> <source>Password for JSON-RPC connections</source> <translation>Contraseña para las conexiones JSON-RPC </translation> </message> <message> <location line="-70"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir conexiones JSON-RPC desde la dirección IP especificada </translation> </message> <message> <location line="+80"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comando al nodo situado en &lt;ip&gt; (predeterminado: 127.0.0.1) </translation> </message> <message> <location line="-132"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation> </message> <message> <location line="+161"/> <source>Upgrade wallet to latest format</source> <translation>Actualizar el monedero al último formato</translation> </message> <message> <location line="-24"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Ajustar el número de claves en reserva &lt;n&gt; (predeterminado: 100) </translation> </message> <message> <location line="-11"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas</translation> </message> <message> <location line="+38"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para las conexiones JSON-RPC </translation> </message> <message> <location line="-30"/> <source>Server certificate file (default: server.cert)</source> <translation>Certificado del servidor (predeterminado: server.cert) </translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clave privada del servidor (predeterminado: server.pem) </translation> </message> <message> <location line="+16"/> <source>This help message</source> <translation>Este mensaje de ayuda </translation> </message> <message> <location line="+7"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>No es posible conectar con %s en este sistema (bind ha dado el error %d, %s)</translation> </message> <message> <location line="-107"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation> </message> <message> <location line="+60"/> <source>Loading addresses...</source> <translation>Cargando direcciones...</translation> </message> <message> <location line="-37"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error al cargar wallet.dat: el monedero está dañado</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Horuscoin Core</source> <translation>Error al cargar wallet.dat: El monedero requiere una versión más reciente de Horuscoin</translation> </message> <message> <location line="+98"/> <source>Wallet needed to be rewritten: restart Horuscoin Core to complete</source> <translation>El monedero ha necesitado ser reescrito. Reinicie Horuscoin para completar el proceso</translation> </message> <message> <location line="-100"/> <source>Error loading wallet.dat</source> <translation>Error al cargar wallet.dat</translation> </message> <message> <location line="+31"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Dirección -proxy inválida: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>La red especificada en -onlynet &apos;%s&apos; es desconocida</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Solicitada versión de proxy -socks desconocida: %i</translation> </message> <message> <location line="-101"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>No se puede resolver la dirección de -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+48"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Cantidad inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Cuantía no válida</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fondos insuficientes</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Cargando el índice de bloques...</translation> </message> <message> <location line="-62"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Añadir un nodo al que conectarse y tratar de mantener la conexión abierta</translation> </message> <message> <location line="-32"/> <source>Unable to bind to %s on this computer. Horuscoin Core is probably already running.</source> <translation>No es posible conectar con %s en este sistema. Probablemente Horuscoin ya está ejecutándose.</translation> </message> <message> <location line="+95"/> <source>Loading wallet...</source> <translation>Cargando monedero...</translation> </message> <message> <location line="-56"/> <source>Cannot downgrade wallet</source> <translation>No se puede rebajar el monedero</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>No se puede escribir la dirección predeterminada</translation> </message> <message> <location line="+67"/> <source>Rescanning...</source> <translation>Reexplorando...</translation> </message> <message> <location line="-58"/> <source>Done loading</source> <translation>Generado pero no aceptado</translation> </message> <message> <location line="+85"/> <source>To use the %s option</source> <translation>Para utilizar la opción %s</translation> </message> <message> <location line="-77"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="-35"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Tiene que establecer rpcpassword=&lt;contraseña&gt; en el fichero de configuración: ⏎ %s ⏎ Si el archivo no existe, créelo con permiso de lectura solamente del propietario.</translation> </message> </context> </TS>
{ "content_hash": "7fbb30fbb83f6c0797d706bf3b97c34b", "timestamp": "", "source": "github", "line_count": 4073, "max_line_length": 419, "avg_line_length": 38.674195924380065, "alnum_prop": 0.6280408836973083, "repo_name": "horuscoin/horuscoin", "id": "08796f76c5c23b2c5ffeca73345fb578a40f0205", "size": "158031", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_es_DO.ts", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "169097" }, { "name": "C++", "bytes": "2913280" }, { "name": "CSS", "bytes": "1127" }, { "name": "Erlang", "bytes": "6749" }, { "name": "IDL", "bytes": "755" }, { "name": "JavaScript", "bytes": "12" }, { "name": "Nu", "bytes": "293" }, { "name": "Objective-C++", "bytes": "6262" }, { "name": "PHP", "bytes": "1158" }, { "name": "Perl", "bytes": "28019" }, { "name": "Python", "bytes": "95263" }, { "name": "Shell", "bytes": "115233" }, { "name": "TypeScript", "bytes": "10328540" } ], "symlink_target": "" }
.class public Lcom/android/internal/telephony/CellBroadcastFwkExt; .super Ljava/lang/Object; .source "CellBroadcastFwkExt.java" # interfaces .implements Lcom/android/internal/telephony/ICellBroadcastFwkExt; # static fields .field public static final CB_SET_TYPE_CLOSE_ETWS_CHANNEL:I = 0x2 .field public static final CB_SET_TYPE_NORMAL:I = 0x0 .field public static final CB_SET_TYPE_OPEN_ETWS_CHANNEL:I = 0x1 .field private static final CHANNEL_URI:Landroid/net/Uri; = null .field private static final CHANNEL_URI1:Landroid/net/Uri; = null .field private static final EVENT_CLOSE_ETWS_CHANNEL_DONE:I = 0x3 .field private static final EVENT_OPEN_ETWS_CHANNEL_DONE:I = 0x2 .field private static final EVENT_QUERY_CB_CONFIG:I = 0x1 .field private static final MAX_ETWS_NOTIFICATION:I = 0x4 .field private static final NEXT_ACTION_NO_ACTION:I = 0x64 .field private static final NEXT_ACTION_ONLY_ADD:I = 0x65 .field private static final NEXT_ACTION_ONLY_REMOVE:I = 0x65 .field private static final NEXT_ACTION_REMOVE_THEN_ADD:I = 0x66 .field private static final TAG:Ljava/lang/String; = "CellBroadcastFwkExt" # instance fields .field private mCM:Lcom/android/internal/telephony/CommandsInterface; .field private mConfigInfo:Lcom/android/internal/telephony/CellBroadcastConfigInfo; .field private mContext:Landroid/content/Context; .field private mEtwsNotificationList:Ljava/util/ArrayList; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/ArrayList", "<", "Lcom/android/internal/telephony/EtwsNotification;", ">;" } .end annotation .end field .field private mHandler:Landroid/os/Handler; .field private mLock:Ljava/lang/Object; .field private mPhone:Lcom/android/internal/telephony/PhoneBase; .field private mPhoneId:I .field private mSuccess:Z # direct methods .method static constructor <clinit>()V .locals 1 .prologue .line 49 sget-object v0, Landroid/provider/Telephony$CbSms$CbChannel;->CONTENT_URI:Landroid/net/Uri; sput-object v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->CHANNEL_URI:Landroid/net/Uri; .line 50 const-string v0, "content://cb/channel1" invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri; move-result-object v0 sput-object v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->CHANNEL_URI1:Landroid/net/Uri; return-void .end method .method constructor <init>(Lcom/android/internal/telephony/PhoneBase;)V .locals 2 .parameter "phone" .prologue const/4 v1, 0x0 const/4 v0, 0x0 .line 52 invoke-direct {p0}, Ljava/lang/Object;-><init>()V .line 36 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mPhone:Lcom/android/internal/telephony/PhoneBase; .line 37 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; .line 38 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mContext:Landroid/content/Context; .line 39 iput v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mPhoneId:I .line 41 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mLock:Ljava/lang/Object; .line 43 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mConfigInfo:Lcom/android/internal/telephony/CellBroadcastConfigInfo; .line 44 iput-boolean v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mSuccess:Z .line 47 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; .line 68 new-instance v0, Lcom/android/internal/telephony/CellBroadcastFwkExt$1; invoke-direct {v0, p0}, Lcom/android/internal/telephony/CellBroadcastFwkExt$1;-><init>(Lcom/android/internal/telephony/CellBroadcastFwkExt;)V iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; .line 53 if-nez p1, :cond_0 .line 54 const-string v0, "CellBroadcastFwkExt" const-string v1, "FAIL! phone is null" invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 66 :goto_0 return-void .line 58 :cond_0 iput-object p1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mPhone:Lcom/android/internal/telephony/PhoneBase; .line 59 iget-object v0, p1, Lcom/android/internal/telephony/PhoneBase;->mCM:Lcom/android/internal/telephony/CommandsInterface; iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; .line 60 invoke-virtual {p1}, Lcom/android/internal/telephony/PhoneBase;->getContext()Landroid/content/Context; move-result-object v0 iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mContext:Landroid/content/Context; .line 61 invoke-virtual {p1}, Lcom/android/internal/telephony/PhoneBase;->getMySimId()I move-result v0 iput v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mPhoneId:I .line 63 new-instance v0, Ljava/lang/Object; invoke-direct {v0}, Ljava/lang/Object;-><init>()V iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mLock:Ljava/lang/Object; .line 65 new-instance v0, Ljava/util/ArrayList; const/4 v1, 0x4 invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V iput-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; goto :goto_0 .end method .method static synthetic access$000(Lcom/android/internal/telephony/CellBroadcastFwkExt;I)Ljava/lang/String; .locals 1 .parameter "x0" .parameter "x1" .prologue .line 20 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->idToString(I)Ljava/lang/String; move-result-object v0 return-object v0 .end method .method static synthetic access$100(Lcom/android/internal/telephony/CellBroadcastFwkExt;Ljava/lang/String;ILcom/android/internal/telephony/EtwsNotification;)V .locals 0 .parameter "x0" .parameter "x1" .parameter "x2" .parameter "x3" .prologue .line 20 invoke-direct {p0, p1, p2, p3}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->handleQueriedConfig(Ljava/lang/String;ILcom/android/internal/telephony/EtwsNotification;)V return-void .end method .method static synthetic access$200(Lcom/android/internal/telephony/CellBroadcastFwkExt;Lcom/android/internal/telephony/EtwsNotification;)V .locals 0 .parameter "x0" .parameter "x1" .prologue .line 20 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->addEtwsNoti(Lcom/android/internal/telephony/EtwsNotification;)V return-void .end method .method static synthetic access$300(Lcom/android/internal/telephony/CellBroadcastFwkExt;Lcom/android/internal/telephony/EtwsNotification;)V .locals 0 .parameter "x0" .parameter "x1" .prologue .line 20 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->removeFirstEtwsNotiThenAdd(Lcom/android/internal/telephony/EtwsNotification;)V return-void .end method .method static synthetic access$400(Lcom/android/internal/telephony/CellBroadcastFwkExt;Z)V .locals 0 .parameter "x0" .parameter "x1" .prologue .line 20 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->updateDatabase(Z)V return-void .end method .method static synthetic access$500(Lcom/android/internal/telephony/CellBroadcastFwkExt;Lcom/android/internal/telephony/EtwsNotification;)V .locals 0 .parameter "x0" .parameter "x1" .prologue .line 20 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->removeEtwsNoti(Lcom/android/internal/telephony/EtwsNotification;)V return-void .end method .method private addEtwsNoti(Lcom/android/internal/telephony/EtwsNotification;)V .locals 2 .parameter "noti" .prologue .line 337 const-string v0, "CellBroadcastFwkExt" const-string v1, "call addEtwsNoti" invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 338 iget-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 339 return-void .end method .method private handleQueriedConfig(Ljava/lang/String;ILcom/android/internal/telephony/EtwsNotification;)V .locals 12 .parameter "config" .parameter "nextAction" .parameter "noti" .prologue .line 263 const-string v9, "CellBroadcastFwkExt" const-string v10, "handleQueriedConfig" invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 265 invoke-direct {p0, p1}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->parseConfigInfoToList(Ljava/lang/String;)Ljava/util/ArrayList; move-result-object v5 .line 266 .local v5, oldConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" new-instance v4, Ljava/util/ArrayList; invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V .line 268 .local v4, newConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" const/16 v9, 0x1100 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v9 invoke-virtual {v4, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 269 const/16 v9, 0x1101 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v9 invoke-virtual {v4, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 270 const/16 v9, 0x1102 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v9 invoke-virtual {v4, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 271 const/16 v9, 0x1103 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v9 invoke-virtual {v4, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 272 const/16 v9, 0x1104 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v9 invoke-virtual {v4, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 273 const/4 v8, 0x0 .line 274 .local v8, sortedConfig:Ljava/util/SortedSet;,"Ljava/util/SortedSet<Ljava/lang/Integer;>;" const/4 v2, 0x0 .line 275 .local v2, finalConfig:Ljava/lang/String; const/4 v6, 0x0 .line 277 .local v6, response:Landroid/os/Message; const/4 v9, 0x2 if-ne p2, v9, :cond_3 .line 278 const-string v9, "CellBroadcastFwkExt" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v11, "to open ETWS channel: " invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 iget v11, p3, Lcom/android/internal/telephony/EtwsNotification;->messageId:I invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 280 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v9}, Ljava/util/ArrayList;->size()I move-result v7 .line 281 .local v7, size:I const/4 v9, 0x4 if-ge v7, v9, :cond_0 .line 282 const-string v9, "CellBroadcastFwkExt" const-string/jumbo v10, "list is NOT full" invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 284 invoke-direct {p0, v5, v4}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mergeConfigList(Ljava/util/ArrayList;Ljava/util/ArrayList;)Ljava/util/SortedSet; move-result-object v8 .line 285 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; const/16 v10, 0x65 const/4 v11, 0x0 invoke-virtual {v9, p2, v10, v11, p3}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message; move-result-object v6 .line 304 :goto_0 invoke-direct {p0, v8}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->parseSortedSetToString(Ljava/util/SortedSet;)Ljava/lang/String; move-result-object v2 .line 305 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; const/4 v10, 0x1 invoke-interface {v9, v2, v10, v6}, Lcom/android/internal/telephony/CommandsInterface;->setCellBroadcastChannelConfigInfo(Ljava/lang/String;ILandroid/os/Message;)V .line 318 .end local v7 #size:I :goto_1 return-void .line 287 .restart local v7 #size:I :cond_0 const-string v9, "CellBroadcastFwkExt" const-string/jumbo v10, "list is full" invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 289 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; const/4 v10, 0x0 invoke-virtual {v9, v10}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Lcom/android/internal/telephony/EtwsNotification; .line 290 .local v1, earliestNoti:Lcom/android/internal/telephony/EtwsNotification; const/4 v3, 0x0 .local v3, i:I :goto_2 invoke-virtual {v5}, Ljava/util/ArrayList;->size()I move-result v9 if-ge v3, v9, :cond_1 .line 291 invoke-virtual {v5, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object v9 check-cast v9, Ljava/lang/Integer; invoke-virtual {v9}, Ljava/lang/Integer;->intValue()I move-result v0 .line 292 .local v0, ch:I iget v9, v1, Lcom/android/internal/telephony/EtwsNotification;->messageId:I if-ne v0, v9, :cond_2 .line 293 const-string v9, "CellBroadcastFwkExt" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v11, "remove channel from old config: " invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 iget v11, v1, Lcom/android/internal/telephony/EtwsNotification;->messageId:I invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 294 invoke-virtual {v5, v3}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object; .line 300 .end local v0 #ch:I :cond_1 invoke-direct {p0, v5, v4}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mergeConfigList(Ljava/util/ArrayList;Ljava/util/ArrayList;)Ljava/util/SortedSet; move-result-object v8 .line 301 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; const/16 v10, 0x66 const/4 v11, 0x0 invoke-virtual {v9, p2, v10, v11, p3}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message; move-result-object v6 goto :goto_0 .line 290 .restart local v0 #ch:I :cond_2 add-int/lit8 v3, v3, 0x1 goto :goto_2 .line 306 .end local v0 #ch:I .end local v1 #earliestNoti:Lcom/android/internal/telephony/EtwsNotification; .end local v3 #i:I .end local v7 #size:I :cond_3 const/4 v9, 0x3 if-ne p2, v9, :cond_4 .line 307 const-string v9, "CellBroadcastFwkExt" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v11, "to close ETWS channel: " invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 iget v11, p3, Lcom/android/internal/telephony/EtwsNotification;->messageId:I invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 308 invoke-direct {p0, v5, v4}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->minusConfigList(Ljava/util/ArrayList;Ljava/util/ArrayList;)Ljava/util/SortedSet; move-result-object v8 .line 309 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; const/16 v10, 0x65 const/4 v11, 0x0 invoke-virtual {v9, p2, v10, v11, p3}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message; move-result-object v6 .line 310 invoke-direct {p0, v8}, Lcom/android/internal/telephony/CellBroadcastFwkExt;->parseSortedSetToString(Ljava/util/SortedSet;)Ljava/lang/String; move-result-object v2 .line 311 iget-object v9, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; const/4 v10, 0x2 invoke-interface {v9, v2, v10, v6}, Lcom/android/internal/telephony/CommandsInterface;->setCellBroadcastChannelConfigInfo(Ljava/lang/String;ILandroid/os/Message;)V goto/16 :goto_1 .line 313 :cond_4 const-string v9, "CellBroadcastFwkExt" new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V const-string v11, "invalid action: " invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v10 invoke-static {v9, v10}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I goto/16 :goto_1 .end method .method private idToString(I)Ljava/lang/String; .locals 2 .parameter "id" .prologue .line 149 packed-switch p1, :pswitch_data_0 .line 153 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v1, "unknown message id: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 :goto_0 return-object v0 .line 150 :pswitch_0 const-string v0, "EVENT_QUERY_CB_CONFIG" goto :goto_0 .line 151 :pswitch_1 const-string v0, "EVENT_OPEN_ETWS_CHANNEL_DONE" goto :goto_0 .line 152 :pswitch_2 const-string v0, "EVENT_CLOSE_ETWS_CHANNEL_DONE" goto :goto_0 .line 149 nop :pswitch_data_0 .packed-switch 0x1 :pswitch_0 :pswitch_1 :pswitch_2 .end packed-switch .end method .method private mergeConfigList(Ljava/util/ArrayList;Ljava/util/ArrayList;)Ljava/util/SortedSet; .locals 5 .parameter .parameter .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/ArrayList", "<", "Ljava/lang/Integer;", ">;", "Ljava/util/ArrayList", "<", "Ljava/lang/Integer;", ">;)", "Ljava/util/SortedSet", "<", "Ljava/lang/Integer;", ">;" } .end annotation .prologue .line 158 .local p1, oldConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" .local p2, newConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" const-string v3, "CellBroadcastFwkExt" const-string v4, "call mergeConfigInfoList" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 159 new-instance v2, Ljava/util/TreeSet; invoke-direct {v2}, Ljava/util/TreeSet;-><init>()V .line 160 .local v2, sortedConfig:Ljava/util/SortedSet; if-eqz p1, :cond_0 invoke-virtual {p1}, Ljava/util/ArrayList;->size()I move-result v3 if-lez v3, :cond_0 .line 161 invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator; move-result-object v1 .local v1, i$:Ljava/util/Iterator; :goto_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_1 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 check-cast v3, Ljava/lang/Integer; invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I move-result v0 .line 162 .local v0, i:I invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v3 invoke-interface {v2, v3}, Ljava/util/SortedSet;->add(Ljava/lang/Object;)Z goto :goto_0 .line 165 .end local v0 #i:I .end local v1 #i$:Ljava/util/Iterator; :cond_0 const-string v3, "CellBroadcastFwkExt" const-string/jumbo v4, "oldConfigList is null" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 167 :cond_1 if-eqz p2, :cond_2 invoke-virtual {p2}, Ljava/util/ArrayList;->size()I move-result v3 if-lez v3, :cond_2 .line 168 invoke-virtual {p2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator; move-result-object v1 .restart local v1 #i$:Ljava/util/Iterator; :goto_1 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_3 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 check-cast v3, Ljava/lang/Integer; invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I move-result v0 .line 169 .restart local v0 #i:I invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v3 invoke-interface {v2, v3}, Ljava/util/SortedSet;->add(Ljava/lang/Object;)Z goto :goto_1 .line 172 .end local v0 #i:I .end local v1 #i$:Ljava/util/Iterator; :cond_2 const-string v3, "CellBroadcastFwkExt" const-string/jumbo v4, "newConfigList is null" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 175 :cond_3 return-object v2 .end method .method private minusConfigList(Ljava/util/ArrayList;Ljava/util/ArrayList;)Ljava/util/SortedSet; .locals 8 .parameter .parameter .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/ArrayList", "<", "Ljava/lang/Integer;", ">;", "Ljava/util/ArrayList", "<", "Ljava/lang/Integer;", ">;)", "Ljava/util/SortedSet", "<", "Ljava/lang/Integer;", ">;" } .end annotation .prologue .line 179 .local p1, oldConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" .local p2, newConfigList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" const-string v5, "CellBroadcastFwkExt" const-string v6, "call minusConfigList" invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 180 new-instance v4, Ljava/util/TreeSet; invoke-direct {v4}, Ljava/util/TreeSet;-><init>()V .line 181 .local v4, sortedConfig:Ljava/util/SortedSet; if-eqz p1, :cond_0 invoke-virtual {p1}, Ljava/util/ArrayList;->size()I move-result v5 if-nez v5, :cond_2 .line 182 :cond_0 const-string v5, "CellBroadcastFwkExt" const-string/jumbo v6, "oldConfigList, no need to minus" invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 202 :cond_1 return-object v4 .line 186 :cond_2 if-eqz p2, :cond_5 invoke-virtual {p2}, Ljava/util/ArrayList;->size()I move-result v5 if-lez v5, :cond_5 .line 187 invoke-virtual {p2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator; move-result-object v1 .local v1, i$:Ljava/util/Iterator; :cond_3 :goto_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v5 if-eqz v5, :cond_5 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v5 check-cast v5, Ljava/lang/Integer; invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I move-result v0 .line 188 .local v0, i:I const/4 v2, 0x0 .local v2, j:I invoke-virtual {p1}, Ljava/util/ArrayList;->size()I move-result v3 .local v3, n:I :goto_1 if-ge v2, v3, :cond_3 .line 189 invoke-virtual {p1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object v5 check-cast v5, Ljava/lang/Integer; invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I move-result v5 if-ne v0, v5, :cond_4 .line 190 const-string v5, "CellBroadcastFwkExt" new-instance v6, Ljava/lang/StringBuilder; invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V const-string v7, "delete config: " invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v6 invoke-virtual {v6, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v6 invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v6 invoke-static {v5, v6}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 191 invoke-virtual {p1, v2}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object; goto :goto_0 .line 188 :cond_4 add-int/lit8 v2, v2, 0x1 goto :goto_1 .line 198 .end local v0 #i:I .end local v1 #i$:Ljava/util/Iterator; .end local v2 #j:I .end local v3 #n:I :cond_5 invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator; move-result-object v1 .restart local v1 #i$:Ljava/util/Iterator; :goto_2 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v5 if-eqz v5, :cond_1 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v5 check-cast v5, Ljava/lang/Integer; invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I move-result v0 .line 199 .restart local v0 #i:I invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v5 invoke-interface {v4, v5}, Ljava/util/SortedSet;->add(Ljava/lang/Object;)Z goto :goto_2 .end method .method private parseConfigInfoToList(Ljava/lang/String;)Ljava/util/ArrayList; .locals 13 .parameter "config" .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/String;", ")", "Ljava/util/ArrayList", "<", "Ljava/lang/Integer;", ">;" } .end annotation .prologue const/16 v12, 0x2c .line 206 const-string v10, "CellBroadcastFwkExt" const-string v11, "call parseConfigInfoToList" invoke-static {v10, v11}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 207 const/4 v3, 0x0 .line 208 .local v3, left:I const/4 v7, 0x0 .line 209 .local v7, right:I const/4 v9, 0x0 .line 210 .local v9, value:I const/4 v4, 0x0 .line 211 .local v4, meetMinus:Z new-instance v6, Ljava/util/ArrayList; invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V .line 212 .local v6, ret:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/Integer;>;" if-eqz p1, :cond_0 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result v10 if-nez v10, :cond_1 .line 242 :cond_0 return-object v6 .line 214 :cond_1 invoke-virtual {p1}, Ljava/lang/String;->length()I move-result v10 const/4 v11, 0x1 if-ne v10, v11, :cond_2 const/4 v10, 0x0 invoke-virtual {p1, v10}, Ljava/lang/String;->charAt(I)C move-result v10 if-eq v10, v12, :cond_0 .line 218 :cond_2 new-instance v10, Ljava/lang/StringBuilder; invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v10, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 const-string v11, "," invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v10 invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v8 .line 219 .local v8, temp:Ljava/lang/String; const/4 v1, 0x0 .local v1, i:I invoke-virtual {v8}, Ljava/lang/String;->length()I move-result v5 .local v5, n:I :goto_0 if-ge v1, v5, :cond_0 .line 220 invoke-virtual {v8, v1}, Ljava/lang/String;->charAt(I)C move-result v0 .line 221 .local v0, ch:C const/16 v10, 0x30 if-lt v0, v10, :cond_4 const/16 v10, 0x39 if-gt v0, v10, :cond_4 .line 222 mul-int/lit8 v10, v9, 0xa add-int/lit8 v11, v0, -0x30 add-int v9, v10, v11 .line 219 :cond_3 :goto_1 add-int/lit8 v1, v1, 0x1 goto :goto_0 .line 223 :cond_4 const/16 v10, 0x2d if-ne v0, v10, :cond_5 .line 224 const/4 v4, 0x1 .line 225 move v3, v9 .line 226 const/4 v9, 0x0 goto :goto_1 .line 227 :cond_5 if-ne v0, v12, :cond_3 .line 229 if-eqz v4, :cond_7 .line 230 move v7, v9 .line 231 move v2, v3 .local v2, j:I :goto_2 if-gt v2, v7, :cond_6 .line 232 invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v10 invoke-virtual {v6, v10}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 231 add-int/lit8 v2, v2, 0x1 goto :goto_2 .line 234 :cond_6 const/4 v4, 0x0 .line 238 .end local v2 #j:I :goto_3 const/4 v9, 0x0 goto :goto_1 .line 236 :cond_7 invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v10 invoke-virtual {v6, v10}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z goto :goto_3 .end method .method private parseSortedSetToString(Ljava/util/SortedSet;)Ljava/lang/String; .locals 5 .parameter .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/SortedSet", "<", "Ljava/lang/Integer;", ">;)", "Ljava/lang/String;" } .end annotation .prologue .line 246 .local p1, sortedSet:Ljava/util/SortedSet;,"Ljava/util/SortedSet<Ljava/lang/Integer;>;" const-string v3, "CellBroadcastFwkExt" const-string v4, "call parseSortedSet" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 247 if-eqz p1, :cond_0 invoke-interface {p1}, Ljava/util/SortedSet;->size()I move-result v3 if-nez v3, :cond_1 .line 248 :cond_0 const-string v3, "CellBroadcastFwkExt" const-string/jumbo v4, "sortedSet is null" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 249 const/4 v3, 0x0 .line 259 :goto_0 return-object v3 .line 252 :cond_1 new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V .line 253 .local v2, ret:Ljava/lang/StringBuilder; invoke-interface {p1}, Ljava/util/SortedSet;->iterator()Ljava/util/Iterator; move-result-object v1 .local v1, i$:Ljava/util/Iterator; :goto_1 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_2 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 check-cast v3, Ljava/lang/Integer; invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I move-result v0 .line 254 .local v0, i:I invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; .line 255 const/16 v3, 0x2c invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; goto :goto_1 .line 257 .end local v0 #i:I :cond_2 invoke-virtual {v2}, Ljava/lang/StringBuilder;->length()I move-result v3 add-int/lit8 v3, v3, -0x1 invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->deleteCharAt(I)Ljava/lang/StringBuilder; .line 259 invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 goto :goto_0 .end method .method private removeEtwsNoti(Lcom/android/internal/telephony/EtwsNotification;)V .locals 7 .parameter "noti" .prologue .line 342 const-string v4, "CellBroadcastFwkExt" const-string v5, "call removeEtwsNoti" invoke-static {v4, v5}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 344 const/4 v0, 0x0 .line 345 .local v0, count:I const/4 v2, 0x0 .local v2, i:I iget-object v4, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v4}, Ljava/util/ArrayList;->size()I move-result v3 .local v3, n:I :goto_0 if-ge v2, v3, :cond_1 .line 346 iget-object v4, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v4, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Lcom/android/internal/telephony/EtwsNotification; .line 347 .local v1, element:Lcom/android/internal/telephony/EtwsNotification; iget v4, v1, Lcom/android/internal/telephony/EtwsNotification;->messageId:I iget v5, p1, Lcom/android/internal/telephony/EtwsNotification;->messageId:I if-ne v4, v5, :cond_0 .line 348 iget-object v4, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v4, v2}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object; .line 349 add-int/lit8 v3, v3, -0x1 .line 350 add-int/lit8 v0, v0, 0x1 goto :goto_0 .line 352 :cond_0 add-int/lit8 v2, v2, 0x1 goto :goto_0 .line 356 .end local v1 #element:Lcom/android/internal/telephony/EtwsNotification; :cond_1 const-string v4, "CellBroadcastFwkExt" new-instance v5, Ljava/lang/StringBuilder; invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v6, "remove noti " invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v5 invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v5 invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v5 invoke-static {v4, v5}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 357 return-void .end method .method private removeFirstEtwsNotiThenAdd(Lcom/android/internal/telephony/EtwsNotification;)V .locals 2 .parameter "noti" .prologue .line 360 const-string v0, "CellBroadcastFwkExt" const-string v1, "call removeFirstEtwsNotiThenAdd" invoke-static {v0, v1}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 361 iget-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v0}, Ljava/util/ArrayList;->size()I move-result v0 const/4 v1, 0x4 if-lt v0, v1, :cond_0 .line 362 iget-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; const/4 v1, 0x0 invoke-virtual {v0, v1}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object; .line 364 :cond_0 iget-object v0, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z .line 365 return-void .end method .method private updateDatabase(Z)V .locals 19 .parameter "open" .prologue .line 368 const-string v1, "CellBroadcastFwkExt" new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v4, "updateDatabase " invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 move/from16 v0, p1 invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-static {v1, v3}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 369 sget-object v2, Lcom/android/internal/telephony/CellBroadcastFwkExt;->CHANNEL_URI:Landroid/net/Uri; .line 370 .local v2, uri:Landroid/net/Uri; move-object/from16 v0, p0 iget v1, v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mPhoneId:I const/4 v3, 0x1 if-ne v1, v3, :cond_0 .line 371 sget-object v2, Lcom/android/internal/telephony/CellBroadcastFwkExt;->CHANNEL_URI1:Landroid/net/Uri; .line 373 :cond_0 const/4 v8, -0x1 .line 374 .local v8, channel:I const-string v16, "" .line 375 .local v16, name:Ljava/lang/String; const/4 v10, -0x1 .line 376 .local v10, enable:I const/4 v14, -0x1 .line 377 .local v14, key:I const/4 v1, 0x5 new-array v7, v1, [I fill-array-data v7, :array_0 .line 378 .local v7, Channels:[I const/4 v1, 0x5 new-array v12, v1, [Z fill-array-data v12, :array_1 .line 379 .local v12, handled:[Z move-object/from16 v0, p0 iget-object v1, v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mContext:Landroid/content/Context; invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver; move-result-object v1 const/4 v3, 0x0 const/4 v4, 0x0 const/4 v5, 0x0 const/4 v6, 0x0 invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor; move-result-object v9 .line 381 .local v9, cursor:Landroid/database/Cursor; if-eqz v9, :cond_7 .line 382 :cond_1 :goto_0 :try_start_0 invoke-interface {v9}, Landroid/database/Cursor;->moveToNext()Z move-result v1 if-eqz v1, :cond_7 .line 383 const-string/jumbo v1, "number" invoke-interface {v9, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I move-result v1 invoke-interface {v9, v1}, Landroid/database/Cursor;->getInt(I)I move-result v8 .line 384 const-string v1, "CellBroadcastFwkExt" new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V const-string/jumbo v4, "updateDatabase channel:" invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-static {v1, v3}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 385 const/4 v1, 0x0 aget v1, v7, v1 if-lt v8, v1, :cond_1 const/4 v1, 0x4 aget v1, v7, v1 if-gt v8, v1, :cond_1 .line 386 const-string v1, "enable" invoke-interface {v9, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I move-result v1 invoke-interface {v9, v1}, Landroid/database/Cursor;->getInt(I)I move-result v10 .line 387 const/4 v1, 0x0 aget v1, v7, v1 sub-int v1, v8, v1 const/4 v3, 0x1 aput-boolean v3, v12, v1 .line 388 const/4 v1, 0x1 if-ne v10, v1, :cond_2 if-nez p1, :cond_1 :cond_2 if-nez v10, :cond_3 if-eqz p1, :cond_1 .line 391 :cond_3 const-string v1, "_id" invoke-interface {v9, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I move-result v1 invoke-interface {v9, v1}, Landroid/database/Cursor;->getInt(I)I move-result v14 .line 392 new-instance v17, Landroid/content/ContentValues; const/4 v1, 0x1 move-object/from16 v0, v17 invoke-direct {v0, v1}, Landroid/content/ContentValues;-><init>(I)V .line 393 .local v17, value:Landroid/content/ContentValues; const-string v3, "enable" if-eqz p1, :cond_5 const/4 v1, 0x1 :goto_1 invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v1 move-object/from16 v0, v17 invoke-virtual {v0, v3, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V .line 394 move-object/from16 v0, p0 iget-object v1, v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mContext:Landroid/content/Context; invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver; move-result-object v1 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V const-string v4, "_id=" invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3, v14}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 const/4 v4, 0x0 move-object/from16 v0, v17 invoke-virtual {v1, v2, v0, v3, v4}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto/16 :goto_0 .line 398 .end local v17 #value:Landroid/content/ContentValues; :catch_0 move-exception v11 .line 399 .local v11, ex:Ljava/lang/Exception; :try_start_1 const-string v1, "CellBroadcastFwkExt" const-string v3, "get channels error:" invoke-static {v1, v3, v11}, Lcom/mediatek/xlog/Xlog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 402 if-eqz v9, :cond_4 .line 403 invoke-interface {v9}, Landroid/database/Cursor;->close()V .line 417 .end local v11 #ex:Ljava/lang/Exception; :cond_4 return-void .line 393 .restart local v17 #value:Landroid/content/ContentValues; :cond_5 const/4 v1, 0x0 goto :goto_1 .line 402 .end local v17 #value:Landroid/content/ContentValues; :catchall_0 move-exception v1 if-eqz v9, :cond_6 .line 403 invoke-interface {v9}, Landroid/database/Cursor;->close()V .line 402 :cond_6 throw v1 :cond_7 if-eqz v9, :cond_8 .line 403 invoke-interface {v9}, Landroid/database/Cursor;->close()V .line 406 :cond_8 array-length v15, v12 .line 407 .local v15, len:I const/4 v13, 0x0 .local v13, i:I :goto_2 const/4 v1, 0x5 if-ge v13, v1, :cond_4 .line 408 aget-boolean v1, v12, v13 if-nez v1, :cond_9 .line 409 const/4 v1, 0x0 aget v1, v7, v1 add-int v8, v13, v1 .line 410 new-instance v18, Landroid/content/ContentValues; invoke-direct/range {v18 .. v18}, Landroid/content/ContentValues;-><init>()V .line 411 .local v18, values:Landroid/content/ContentValues; const-string/jumbo v1, "name" new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V const-string v4, "" invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 move-object/from16 v0, v18 invoke-virtual {v0, v1, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V .line 412 const-string/jumbo v1, "number" invoke-static {v8}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v3 move-object/from16 v0, v18 invoke-virtual {v0, v1, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V .line 413 const-string v3, "enable" if-eqz p1, :cond_a const/4 v1, 0x1 :goto_3 invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v1 move-object/from16 v0, v18 invoke-virtual {v0, v3, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V .line 414 move-object/from16 v0, p0 iget-object v1, v0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mContext:Landroid/content/Context; invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver; move-result-object v1 move-object/from16 v0, v18 invoke-virtual {v1, v2, v0}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri; .line 407 .end local v18 #values:Landroid/content/ContentValues; :cond_9 add-int/lit8 v13, v13, 0x1 goto :goto_2 .line 413 .restart local v18 #values:Landroid/content/ContentValues; :cond_a const/4 v1, 0x0 goto :goto_3 .line 377 nop :array_0 .array-data 0x4 0x0t 0x11t 0x0t 0x0t 0x1t 0x11t 0x0t 0x0t 0x2t 0x11t 0x0t 0x0t 0x3t 0x11t 0x0t 0x0t 0x4t 0x11t 0x0t 0x0t .end array-data .line 378 :array_1 .array-data 0x1 0x0t 0x0t 0x0t 0x0t 0x0t .end array-data .end method # virtual methods .method public closeEtwsChannel(Lcom/android/internal/telephony/EtwsNotification;)V .locals 5 .parameter "newEtwsNoti" .prologue .line 142 const-string v1, "CellBroadcastFwkExt" const-string v2, "closeEtwsChannel" invoke-static {v1, v2}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 144 iget-object v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; const/4 v2, 0x1 const/4 v3, 0x3 const/4 v4, 0x0 invoke-virtual {v1, v2, v3, v4, p1}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message; move-result-object v0 .line 145 .local v0, response:Landroid/os/Message; iget-object v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; invoke-interface {v1, v0}, Lcom/android/internal/telephony/CommandsInterface;->queryCellBroadcastConfigInfo(Landroid/os/Message;)V .line 146 return-void .end method .method public containDuplicatedEtwsNotification(Lcom/android/internal/telephony/EtwsNotification;)Z .locals 5 .parameter "newEtwsNoti" .prologue const/4 v2, 0x0 .line 321 const-string v3, "CellBroadcastFwkExt" const-string v4, "call containDuplicatedEtwsNotification" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 322 if-nez p1, :cond_1 .line 323 const-string v3, "CellBroadcastFwkExt" const-string/jumbo v4, "null EtwsNotification" invoke-static {v3, v4}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 333 :cond_0 :goto_0 return v2 .line 327 :cond_1 iget-object v3, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mEtwsNotificationList:Ljava/util/ArrayList; invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator; move-result-object v1 .local v1, i$:Ljava/util/Iterator; :cond_2 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_0 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Lcom/android/internal/telephony/EtwsNotification; .line 328 .local v0, e:Lcom/android/internal/telephony/EtwsNotification; invoke-virtual {v0, p1}, Lcom/android/internal/telephony/EtwsNotification;->isDuplicatedEtws(Lcom/android/internal/telephony/EtwsNotification;)Z move-result v3 if-eqz v3, :cond_2 .line 329 const/4 v2, 0x1 goto :goto_0 .end method .method public openEtwsChannel(Lcom/android/internal/telephony/EtwsNotification;)V .locals 5 .parameter "newEtwsNoti" .prologue .line 135 const-string v1, "CellBroadcastFwkExt" const-string/jumbo v2, "openEtwsChannel" invoke-static {v1, v2}, Lcom/mediatek/xlog/Xlog;->d(Ljava/lang/String;Ljava/lang/String;)I .line 137 iget-object v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mHandler:Landroid/os/Handler; const/4 v2, 0x1 const/4 v3, 0x2 const/4 v4, 0x0 invoke-virtual {v1, v2, v3, v4, p1}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message; move-result-object v0 .line 138 .local v0, response:Landroid/os/Message; iget-object v1, p0, Lcom/android/internal/telephony/CellBroadcastFwkExt;->mCM:Lcom/android/internal/telephony/CommandsInterface; invoke-interface {v1, v0}, Lcom/android/internal/telephony/CommandsInterface;->queryCellBroadcastConfigInfo(Landroid/os/Message;)V .line 139 return-void .end method
{ "content_hash": "bcf18f5bdb330295c4d5ca0b778a6bd5", "timestamp": "", "source": "github", "line_count": 2092, "max_line_length": 195, "avg_line_length": 25.106118546845124, "alnum_prop": 0.6760595559955828, "repo_name": "baidurom/devices-g520", "id": "3fc3258ee557d1c23f70daf4dc868344d525edb5", "size": "52522", "binary": false, "copies": "2", "ref": "refs/heads/coron-4.1", "path": "framework.jar.out/smali/com/android/internal/telephony/CellBroadcastFwkExt.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "12575" }, { "name": "Python", "bytes": "1261" }, { "name": "Shell", "bytes": "2159" } ], "symlink_target": "" }
#include <gtest/gtest.h> int main(int argc, char *argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
{ "content_hash": "244108c69e9595f3a7b58e597b863351", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 43, "avg_line_length": 17, "alnum_prop": 0.6323529411764706, "repo_name": "OldFrostDragon/GcovParserLibrary", "id": "57a3c190d3270b111b2f646e4a597e74f55a99aa", "size": "1328", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/auto/main.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "14990" }, { "name": "C++", "bytes": "3386012" }, { "name": "CMake", "bytes": "32169" }, { "name": "M4", "bytes": "25387" }, { "name": "Objective-C", "bytes": "5467" }, { "name": "Python", "bytes": "451787" }, { "name": "Shell", "bytes": "26543" } ], "symlink_target": "" }
import glob import os import shutil def move(): filenames = glob.glob('*.grp') for i in filenames: prefix = '.'.join(i.split('.')[0:3]) shutil.copyfile(i, prefix + '.amiga.grp')
{ "content_hash": "50c2ae29affa9b9b40f1b57e3986e87d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 49, "avg_line_length": 21.2, "alnum_prop": 0.5613207547169812, "repo_name": "salomanders/NbodyPythonTools", "id": "aae215fcafe4b24db73ee92f2f4c4a45208882d3", "size": "212", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nbdpt/fof/mvfof2amiga.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "126801" } ], "symlink_target": "" }
class Checkbashisms < Formula desc "Checks for bashisms in shell scripts" homepage "https://launchpad.net/ubuntu/+source/devscripts/" url "https://deb.debian.org/debian/pool/main/d/devscripts/devscripts_2.18.9.tar.xz" sha256 "75027f6fbbbc9a9ab1b2bb7b8651622fbd9d3d691e8f4a21639865c9efe4b0e4" bottle :unneeded def install inreplace "scripts/checkbashisms.pl" do |s| s.gsub! "###VERSION###", version s.gsub! "#!/usr/bin/perl", "#!/usr/bin/perl -T" end bin.install "scripts/checkbashisms.pl" => "checkbashisms" man1.install "scripts/checkbashisms.1" end test do (testpath/"test.sh").write <<~EOS #!/bin/sh if [[ "home == brew" ]]; then echo "dog" fi EOS expected = <<~EOS (alternative test command ([[ foo ]] should be [ foo ])): EOS assert_match expected, shell_output("#{bin}/checkbashisms #{testpath}/test.sh 2>&1", 1) end end
{ "content_hash": "443094923538415f70e6eaecbeba7820", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 91, "avg_line_length": 29.0625, "alnum_prop": 0.6505376344086021, "repo_name": "git-lfs/homebrew-core", "id": "ba5758abd48740be2cf665270e52c0a07397c58d", "size": "930", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Formula/checkbashisms.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Perl", "bytes": "628" }, { "name": "Ruby", "bytes": "8159935" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Valkyrja\Client\Managers; use Valkyrja\Client\Client as Contract; use Valkyrja\Client\Config\Config; use Valkyrja\Client\Driver; use Valkyrja\Client\Factory; use Valkyrja\Http\Request; use Valkyrja\Http\Response; use Valkyrja\Support\Manager\Managers\Manager; /** * Class Client. * * @author Melech Mizrachi * * @property Factory $factory */ class Client extends Manager implements Contract { /** * Client constructor. * * @param Factory $factory The factory * @param Config|array $config The config */ public function __construct(Factory $factory, Config|array $config) { parent::__construct($factory, $config); $this->configurations = $config['clients']; } /** * @inheritDoc */ public function use(string $name = null): Driver { return parent::use($name); } /** * @inheritDoc */ public function request(Request $request): Response { return $this->use()->request($request); } /** * @inheritDoc */ public function get(Request $request): Response { return $this->use()->get($request); } /** * @inheritDoc */ public function post(Request $request): Response { return $this->use()->post($request); } /** * @inheritDoc */ public function head(Request $request): Response { return $this->use()->head($request); } /** * @inheritDoc */ public function put(Request $request): Response { return $this->use()->put($request); } /** * @inheritDoc */ public function patch(Request $request): Response { return $this->use()->patch($request); } /** * @inheritDoc */ public function delete(Request $request): Response { return $this->use()->delete($request); } }
{ "content_hash": "efdc87531cc60981cb8e470bce03c18b", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 71, "avg_line_length": 19.058823529411764, "alnum_prop": 0.5787037037037037, "repo_name": "valkyrjaio/valkyrja", "id": "dc033ae01dc148717d97c9b63b8e757e25c2f132", "size": "2189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Valkyrja/Client/Managers/Client.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "2170989" } ], "symlink_target": "" }
<?php require_once 'class.field.php'; require_once 'class.layout.php'; class SectionException extends Exception { } class SectionFilterIterator extends FilterIterator { public function __construct($path) { parent::__construct(new DirectoryIterator(realpath($path))); } public function accept() { if ($this->isDir() == false && preg_match('/^([^.]+)\.xml$/i', $this->getFilename())) { return true; } return false; } } class SectionIterator extends ArrayIterator { protected static $cache; protected static $handles; protected static $objects; protected static $sections; public static function buildCache() { $cache = self::$cache = new Cache(Cache::SOURCE_CORE, 'sections'); $handles = $cache->{'handles'}; $sections = $cache->{'sections'}; if (isset(self::$objects) === false) { self::$objects = array(); } if (empty($handles) || empty($sections)) { $handles = $sections = []; $extensions = new ExtensionQuery(); $extensions->setFilters(array( ExtensionQuery::STATUS => Extension::STATUS_ENABLED )); Profiler::begin('Discovering sections'); foreach (new SectionFilterIterator(SECTIONS) as $file) { Profiler::begin('Discovered section %section'); $path = $file->getPathName(); $handle = basename($path, '.xml'); $sections[$path] = true; $handles[$handle] = $path; Profiler::store('section', $handle, 'system/section'); Profiler::store('location', $path, 'system/resource action/discovered'); Profiler::notice('Section location cached for future use.'); Profiler::end(); } foreach ($extensions as $extension) { if (is_dir($extension->path . '/sections') === false) { continue; } // Extension will tell us about it's own sections: if ($extension instanceof ExtensionWithSectionsInterface) { foreach ($extension->includeSections() as $path) { Profiler::begin('Discovered section %section'); $path = realpath($path); $handle = basename($path, '.xml'); $sections[$path] = true; $handles[$handle] = $path; Profiler::store('section', $handle, 'system/section'); Profiler::store('location', $path, 'system/resource action/discovered'); Profiler::notice('Section location cached for future use.'); Profiler::end(); } } // Old style, do the work for the extension: else { foreach (new SectionFilterIterator($extension->path . '/sections') as $file) { Profiler::begin('Discovered section %section'); $path = $file->getPathName(); $handle = basename($path, '.xml'); $sections[$path] = true; $handles[$handle] = $path; Profiler::store('section', $handle, 'system/section'); Profiler::store('location', $path, 'system/resource action/discovered'); Profiler::notice('Section location cached for future use.'); Profiler::end(); } } } $cache->{'handles'} = $handles; $cache->{'sections'} = $sections; Profiler::end(); } self::$handles = $handles; self::$objects = $objects; self::$sections = $sections; } public static function clearCachedFiles() { $cache = new Cache(Cache::SOURCE_CORE, 'sections'); $cache->purge(); self::$handles = array(); self::$sections = array(); } public function __construct() { if (empty(self::$sections)) { self::buildCache(); } parent::__construct(self::$sections); } public function current() { $path = $index = parent::key(); if (isset(self::$handles[$index])) { $path = self::$handles[$index]; } if (isset(self::$objects[$path]) === false) { Profiler::begin('Loaded section %section'); $section = Section::loadFromFile($path); self::$objects[$path] = $section; Profiler::store('section', basename($path, '.xml'), 'system/section'); Profiler::store('location', $path, 'system/resource action/loaded'); Profiler::end(); } return self::$objects[$path]; } public function offsetExists($index) { if (isset(self::$handles[$index])) { $index = self::$handles[$index]; } return parent::offsetExists($index); } public function offsetGet($index) { $path = $index; if (isset(self::$handles[$index])) { $path = self::$handles[$index]; } if (isset(self::$objects[$path]) === false) { Profiler::begin('Loaded section %section'); $section = Section::loadFromFile($path); self::$objects[$path] = $section; Profiler::store('section', basename($path, '.xml'), 'system/section'); Profiler::store('location', $path, 'system/resource action/loaded'); Profiler::end(); } return self::$objects[$path]; } public function offsetSet($index, $value) { if (isset(self::$handles[$index])) { $index = self::$handles[$index]; } self::$objects[$index] = $value; return parent::offsetSet($index, true); } public function offsetUnset($index) { if (isset(self::$handles[$index])) { $index = self::$handles[$index]; unset(self::$handles[$index]); } if (isset(self::$objects[$index])) { unset(self::$objects[$index]); } return parent::offsetUnset($index); } } class Section { const ERROR_SECTION_NOT_FOUND = 0; const ERROR_FAILED_TO_LOAD = 1; const ERROR_DOES_NOT_ACCEPT_PARAMETERS = 2; const ERROR_TOO_MANY_PARAMETERS = 3; const ERROR_MISSING_OR_INVALID_FIELDS = 4; const ERROR_FAILED_TO_WRITE = 5; protected static $sections = array(); protected $parameters; public $fields; public $layout; public static function createGUID() { return uniqid(); } public function __construct() { $this->parameters = new StdClass; $this->name = null; $this->fields = []; $this->layout = []; $this->{'navigation-group'} = null; $this->{'publish-order-handle'} = null; $this->{'publish-order-direction'} = null; $this->{'hidden-from-publish-menu'} = null; } public function __isset($name) { return isset($this->parameters->$name); } public function __get($name) { if ($name == 'guid' and !isset($this->guid)) { $this->parameters->guid = Section::createGUID(); } return $this->parameters->$name; } public function __set($name, $value) { if ($name == 'name') { $this->parameters->handle = Lang::createHandle($value, '-', false, true, array('/^[^:_a-z]+/i' => null, '/[^:_a-z0-9\.-]/i' => null)); } $this->parameters->$name = $value; } public function appendField(Field $field) { $field->section = $this->handle; $this->fields[] = $field; } public function appendFieldByType($type, array $data = null) { $field = Field::loadFromType($type); if (!is_null($data)) { $field->setPropertiesFromPostData($data); } $this->appendField($field); return $field; } public function removeAllFields() { $this->fields = array(); } public function removeField($name) { foreach ($this->fields as $index => $f) { if ($f->{'publish-label'} == $name || $f->{'element-name'} == $name) { unset($this->fields[$index]); } } } /** * Given an field's element name, return an object of * that Field. * * @param $handle string * @return Field */ public function fetchFieldByHandle($handle) { foreach ($this->fields as $field) { if ($field->{'element-name'} == $handle) { return $field; } } return null; } /** * Given an field's element name, return an object of * that Field. * * @param $handle string * @return Field */ public function fetchFieldsByType($type) { $fields = array(); foreach ($this->fields as $field) { if ($field->{'type'} == $type) { $fields[] = $field; } } return $fields; } public static function fetchUsedNavigationGroups() { $groups = array(); foreach (new SectionIterator as $s) { $groups[] = $s->{'navigation-group'}; } return General::array_remove_duplicates($groups); } public static function load($path) { $sections = new SectionIterator(); // Try with given path: if (isset($sections[$path])) { $section = $sections[$path]; } // Try with realpath: else { $real = realpath($path); if ($real !== false && isset($sections[$real]) !== false) { $section = $sections[$real]; } } // Not found: if (isset($section) === false) { throw new ExtensionException('No sections found for ' . $path); } return $section; } public static function loadFromHandle($name) { $sections = new SectionIterator(); if (isset($sections[$name]) === false) { throw new ExtensionException('No sections found for ' . $name); } return $sections[$name]; } public static function loadFromFile($path) { $section = new Section(); $section->handle = preg_replace('/\.xml$/', null, basename($path)); $section->path = dirname($path); $doc = @simplexml_load_file($path); $section->document = $doc; if (($doc instanceof SimpleXMLElement) === false) { throw new SectionException( __('Failed to load section configuration file: %s', array($path)), Section::ERROR_FAILED_TO_LOAD ); } foreach ($doc as $name => $value) { if ($name == 'fields' && isset($value->field)) { foreach ($value->field as $field) { Profiler::begin('Loading %class field %field'); try { $field = Field::loadFromXMLDefinition($field); $section->appendField($field); } catch (Exception $e) { // Couldnt find the field. Ignore it for now // TODO: Might need to more than just ignore it } Profiler::store('field', $field->{'element-name'}, 'system/field'); Profiler::store('class', get_class($field), 'system/class'); Profiler::store('location', $field->file, 'system/resource action/loaded'); Profiler::end(); } } elseif ($name == 'layout' && isset($value->column)) { $data = array(); foreach ($value->column as $column) { if (isset($column->size) === false) { $size = Layout::LARGE; } else { $size = (string)$column->size; } $data_column = (object)array( 'size' => $size, 'fieldsets' => array() ); foreach ($column->fieldset as $fieldset) { if (isset($fieldset->name) or trim((string)$fieldset->name) == '') { $name = (string)$fieldset->name; } $data_fieldset = (object)array( 'name' => $name, 'collapsed' => ( isset($fieldset->collapsed) ? (string)$fieldset->collapsed : 'no' ), 'fields' => array() ); foreach ($fieldset->field as $field) { $data_fieldset->fields[] = (string)$field; } $data_column->fieldsets[] = $data_fieldset; } $data[] = $data_column; } $section->layout = $data; $section->sanitizeLayout(true); } elseif (isset($value->item)) { $stack = array(); foreach ($value->item as $item) { array_push($stack, (string)$item); } $section->$name = $stack; } else { $section->$name = (string)$value; } } if (isset($doc->attributes()->guid)) { $section->guid = (string)$doc->attributes()->guid; } return $section; } public static function save(Section $section, MessageStack $messages, $essentials = null, $simulate = false) { $pathname = sprintf('%s/%s.xml', $section->path, $section->handle); // Check to ensure all the required section fields are filled if (!isset($section->name) || strlen(trim($section->name)) == 0) { $messages->append('name', __('This is a required field.')); } // Check for duplicate section handle elseif (file_exists($pathname)) { $existing = self::load($pathname); if (isset($existing->guid) and $existing->guid != $section->guid) { $messages->append('name', __('A Section with the name <code>%s</code> already exists', array($section->name))); } unset($existing); } ## Check to ensure all the required section fields are filled if (!isset($section->{'navigation-group'}) || strlen(trim($section->{'navigation-group'})) == 0) { $messages->append('navigation-group', __('This is a required field.')); } if (is_array($section->fields) && !empty($section->fields)) { foreach ($section->fields as $index => $field) { $field_stack = new MessageStack; if ($field->validateSettings($field_stack, false, false) != Field::STATUS_OK) { $messages->append("field::{$index}", $field_stack); } } } if ($messages->length() > 0) { throw new SectionException(__('Section could not be saved. Validation failed.'), self::ERROR_MISSING_OR_INVALID_FIELDS); } if ($simulate) { return true; } $section->sanitizeLayout(); return file_put_contents($pathname, (string)$section); } public static function syncroniseStatistics(Section $section) { $new_doc = new DOMDocument('1.0', 'UTF-8'); $new_doc->formatOutput = true; $new_doc->loadXML((string)$section); $new_xpath = new DOMXPath($new_doc); $new_handle = $section->handle; $old = $new = array(); $result = (object)array( 'synced' => true, 'section' => (object)array( 'create' => false, 'rename' => false, 'old' => (object)array( 'handle' => $new_handle, 'name' => $section->name ), 'new' => (object)array( 'handle' => $new_handle, 'name' => $section->name ) ), 'remove' => array(), 'rename' => array(), 'create' => array(), 'update' => array() ); $res = Symphony::Database()->query( ' SELECT s.xml FROM `sections_sync` AS s WHERE s.section = "%s" ', array( $section->guid ) ); // Found sync data: if ($res->valid()) { $old_doc = new DOMDocument('1.0', 'UTF-8'); $old_doc->formatOutput = true; $old_doc->loadXML($res->current()->xml); $old_xpath = new DOMXPath($old_doc); $old_handle = $old_xpath->evaluate('string(/section/name/@handle)'); if ($old_handle != $new_handle) { $result->synced = false; $result->section->rename = true; $result->section->old->handle = $old_handle; $result->section->old->name = $old_xpath->evaluate('string(/section/name)'); } // Build array of old and new nodes for comparison: foreach ($old_xpath->query('/section/fields/field') as $node) { $type = $old_xpath->evaluate('string(type)', $node); $field = Field::loadFromType($type); $field->loadSettingsFromSimpleXMLObject( simplexml_import_dom($node) ); $old[$field->guid] = (object)array( 'label' => $field->{'publish-label'}, 'field' => $field ); } } // Creating the section: else { $result->synced = false; $result->section->create = true; } foreach ($new_xpath->query('/section/fields/field') as $node) { $type = $new_xpath->evaluate('string(type)', $node); $field = Field::loadFromType($type); $field->loadSettingsFromSimpleXMLObject( simplexml_import_dom($node) ); $new[$field->guid] = (object)array( 'label' => $field->{'publish-label'}, 'field' => $field ); } foreach ($new as $guid => $data) { // Field is being created: if (array_key_exists($guid, $old) === false) { $result->create[$guid] = $data; continue; } // Field is being renamed: if ($result->section->rename or $old[$guid]->field->{'element-name'} != $data->field->{'element-name'}) { if ($old[$guid]->field->type == $data->field->type) { $result->rename[$guid] = (object)array( 'label' => $data->{'label'}, 'old' => $old[$guid]->field, 'new' => $data->field ); } // Type has changed: else { $result->remove[$guid] = $old[$guid]; $result->create[$guid] = $data; continue; } } // Field definition has changed: if ($old[$guid]->field != $data->field) { if ($old[$guid]->field->type == $data->field->type) { $result->update[$guid] = (object)array( 'label' => $data->{'label'}, 'old' => $old[$guid]->field, 'new' => $data->field ); } // Type has changed: else { $result->remove[$guid] = $old[$guid]; $result->create[$guid] = $data; continue; } } } foreach ($old as $guid => $data) { if (array_key_exists($guid, $new)) { continue; } $result->remove[$guid] = $data; } $result->synced = ( $result->synced and empty($result->remove) and empty($result->rename) and empty($result->create) and empty($result->update) ); return $result; } public static function synchronise(Section $section) { $stats = self::syncroniseStatistics($section); $new_handle = $stats->section->new->handle; $old_handle = $stats->section->old->handle; // Remove fields: foreach ($stats->remove as $guid => $data) { $data->field->remove(); } // Rename fields: foreach ($stats->rename as $guid => $data) { $data->new->rename($data->old); } // Create fields: foreach ($stats->create as $guid => $data) { $data->field->create(); } // Update fields: foreach ($stats->update as $guid => $data) { $data->new->update($data->old); } // Remove old sync data: Symphony::Database()->delete( 'sections_sync', array($section->guid), '`section` = "%s"' ); // Create new sync data: Symphony::Database()->insert('sections_sync', array( 'section' => $section->guid, 'xml' => (string)$section )); } public static function rename(Section $section, $old_handle) { /* TODO: Upon renaming a section, data-sources/events attached to it must update. Views will also need to update to ensure they still have references to the same data-sources/sections */ return General::deleteFile($section->path . '/' . $old_handle . '.xml'); } public static function delete(Section $section) { /* TODO: Upon deletion it should update all data-sources/events attached to it. Either by deleting them, or making section $unknown. I think deletion is best because if the section is renamed, the rename() function will take care of moving the dependancies, so there should be no data-sources/events to delete anyway. However, if you delete page accidentally (hm, even though you clicked confirm), do you really want your data-sources/events to just be deleted? Verdict? */ // Remove fields: foreach ($section->fields as $field) { $field->remove(); } // Remove sync data: Symphony::Database()->delete( 'sections_sync', array($section->guid), '`section` = "%s"' ); // Remove entry metadata Symphony::Database()->delete( 'entries', array($section->handle), '`section` = "%s"' ); if (General::deleteFile($section->path . '/' . $section->handle . '.xml')) { // Cleanup Datasources foreach (new DataSourceIterator as $datasource) { $ds = DataSource::load($datasource); if ($ds->parameters()->section == $section->handle) { DataSource::delete($ds); } } // Cleanup Events foreach (new EventIterator as $event) { $ev = Event::load($event); if ($ev->parameters()->source == $section->handle) { Event::delete($ev); } } } } public function sanitizeLayout($loading = false) { $layout = $this->layout; $fields_used = array(); $fields_available = array(); // Find available fields: foreach ($this->fields as $field) { $fields_available[] = $field->{'element-name'}; } // Make sure we have at least one column: if (!is_array($layout) or empty($layout)) { $layout = array( (object)array( 'size' => Layout::LARGE, 'fieldsets' => array() ), (object)array( 'size' => Layout::SMALL, 'fieldsets' => array() ) ); } // Make sure each column has a fieldset: foreach ($layout as &$column) { if (!isset($column->fieldsets) or !is_array($column->fieldsets)) { $column->fieldsets = array(); } if (empty($column->fieldsets)) { $column->fieldsets = array( (object)array( 'name' => null, 'fields' => array() ) ); } foreach ($column->fieldsets as &$fieldset) { if (!isset($fieldset->fields) or !is_array($fieldset->fields)) { $fieldset->fields = array(); } if (empty($fieldset->fields)) { $fieldset->fields = array(); } foreach ($fieldset->fields as $index => $field) { if (in_array($field, $fields_available)) { $fields_used[] = $field; } else { unset($fieldset->fields[$index]); } $fields_used[] = $field; } } } $fields_unused = array_diff($fields_available, $fields_used); if (is_array($fields_unused)) { foreach ($fields_unused as $field) { $layout[0]->fieldsets[0]->fields[] = $field; } } $this->layout = $layout; } public function toDoc() { $doc = new DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $root = $doc->createElement('section'); $doc->appendChild($root); if (!isset($this->guid) || is_null($this->guid)) { $this->guid = uniqid(); } $root->setAttribute('guid', $this->guid); $name = $doc->createElement('name', General::sanitize($this->name)); $name->setAttribute('handle', $this->handle); $root->appendChild($name); $root->appendChild($doc->createElement('hidden-from-publish-menu', ( isset($this->{'hidden-from-publish-menu'}) && strtolower(trim($this->{'hidden-from-publish-menu'})) == 'yes' ? 'yes' : 'no' ))); $root->appendChild($doc->createElement('navigation-group', General::sanitize($this->{'navigation-group'}))); $root->appendChild($doc->createElement('publish-order-handle', General::sanitize($this->{'publish-order-handle'}))); $root->appendChild($doc->createElement('publish-order-direction', General::sanitize($this->{'publish-order-direction'}))); if (is_array($this->fields) && !empty($this->fields)) { $fields = $doc->createElement('fields'); foreach ($this->fields as $index => $field) { $fields->appendChild($doc->importNode( $field->toDoc()->documentElement, true )); } $root->appendChild($fields); } if (is_array($this->layout)) { $layout = $doc->createElement('layout'); foreach ($this->layout as $data) { $column = $doc->createElement('column'); if (!isset($data->size) or $data->size != Layout::LARGE) { $data->size = Layout::SMALL; } $size = $doc->createElement('size', $data->size); $column->appendChild($size); if (is_array($data->fieldsets)) { foreach ($data->fieldsets as $data) { $fieldset = $doc->createElement('fieldset'); if (!isset($data->name) or trim($data->name) == '') { $data->name = null; } $name = $doc->createElement('name', $data->name); $fieldset->appendChild($name); if (is_array($data->fields)) { foreach ($data->fields as $data) { if (!is_string($data) or trim($data) == '') { continue; } $fieldset->appendChild($doc->createElement('field', $data)); } } $column->appendChild($fieldset); } } $layout->appendChild($column); } $root->appendChild($layout); } return $doc; } public function __toString() { try { return $this->toDoc()->saveXML(); } catch (Exception $e) { var_dump($e); die(); } } }
{ "content_hash": "850778edb602a11efcd74041de6643ba", "timestamp": "", "source": "github", "line_count": 966, "max_line_length": 146, "avg_line_length": 31.15734989648033, "alnum_prop": 0.4594989700312313, "repo_name": "embarknow/journey-cms", "id": "21aaa12baadcaea463cc5a04c40d6c3e6e049a02", "size": "30098", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "symphony/lib/class.section.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "99576" }, { "name": "Erlang", "bytes": "2308" }, { "name": "HTML", "bytes": "506923" }, { "name": "JavaScript", "bytes": "121863" }, { "name": "PHP", "bytes": "2315760" }, { "name": "Perl", "bytes": "15271" }, { "name": "Shell", "bytes": "182" }, { "name": "XSLT", "bytes": "13152" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.jkiss.dbeaver</groupId> <artifactId>bundles</artifactId> <version>1.0.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> <artifactId>org.jkiss.wmi</artifactId> <version>2.0.183-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <build> <sourceDirectory>${project.basedir}/src/java</sourceDirectory> </build> </project>
{ "content_hash": "523885c8cbb3f8766891cd0bf16ce714", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 149, "avg_line_length": 36.26315789473684, "alnum_prop": 0.6894049346879536, "repo_name": "Sargul/dbeaver", "id": "7124a832ee2126b619bb2f01397ac4db10120c76", "size": "689", "binary": false, "copies": "1", "ref": "refs/heads/devel", "path": "bundles/org.jkiss.wmi/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2837" }, { "name": "C++", "bytes": "63113" }, { "name": "CSS", "bytes": "19694" }, { "name": "HTML", "bytes": "10379" }, { "name": "Java", "bytes": "24457701" }, { "name": "JavaScript", "bytes": "139972" }, { "name": "Shell", "bytes": "202" }, { "name": "XSLT", "bytes": "8047" } ], "symlink_target": "" }
The MIT License (MIT) ===================== Copyright © `Emilis Bliudzius` `2016` Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "content_hash": "5127ee0de29ba14b623af79166a641c4", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 65, "avg_line_length": 44.28, "alnum_prop": 0.7859078590785907, "repo_name": "wallnutkraken/unitusk_cs", "id": "a9f445940351e3c91d3278dd5c37e2933998d972", "size": "1118", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "License.md", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "7820" } ], "symlink_target": "" }
# State Machine A dead simple State Machine PHP package. ## Installation To install, just add this to your composer.json: ````json "require": { "esampaio/state-machine":"master" } ```` ## Usage ### PHP version 5.3 If you are running PHP 5.3 you need to inherit the StateMachine class: ````php <?php use Esampaio\StateMachine\StateMachine; class MyClass extends StateMachine { ```` ### PHP version 5.4 If you are running PHP version 5.4, just use the Trait: ````php use Esampaio\StateMachine\Traits\StateMachine; class MyClass { use StateMachine; ```` ### Annotations To add your possible states and transitions, use the following annotations: ````php use Esampaio\StateMachine\Traits\StateMachine; use Esampaio\StateMachine\States; use Esampaio\StateMachine\Transition; /** * @States(states = {"requested", "approved", "rejected"}) * @Transition(state = "requested", transitions = {"approved", "rejected"}) */ class MyClass { use StateMachine; ```` ### Magic! The following methods will be created for each state: ````php $foo->isRequested(); // Check if foo's current state equals "requested" $foo->canApproved(); // Check if foo's current state allows transition to "approved" $foo->transitionRejected(); // Transitions current foo's state to "rejected" ```` Two methods are triggered when a transition happens, you may implement them if you want: ````php $foo->beforeRejected(); // Triggered before foo's state is changed into "rejected" $foo->afterRejected(); // Triggered after foo's state is changed into "rejected" ```` Check the source code and/or tests to understand it better. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
{ "content_hash": "502277965eb0891331b54479e530421a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 88, "avg_line_length": 23, "alnum_prop": 0.7198067632850241, "repo_name": "esampaio/state-machine", "id": "eb1becefbbc48f4f98ed5f43442e8da03c3ba1ae", "size": "1863", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "20429" } ], "symlink_target": "" }
package ru.job4j.cinema.model; public class Site { private int id; private int row; private int place; private boolean isFree; private int cost; public Site(int id, int row, int place, boolean isFree, int cost) { this.id = id; this.row = row; this.place = place; this.isFree = isFree; this.cost = cost; } public int getId() { return id; } public int getRow() { return row; } public int getPlace() { return place; } public boolean getisFree() { return isFree; } public int getCost() { return cost; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Site site = (Site) o; if (id != site.id) return false; if (row != site.row) return false; if (place != site.place) return false; if (isFree != site.isFree) return false; return cost == site.cost; } @Override public int hashCode() { int result = id; result = 31 * result + row; result = 31 * result + place; result = 31 * result + (isFree ? 1 : 0); result = 31 * result + cost; return result; } @Override public String toString() { return "Site{" + "id=" + id + ", row=" + row + ", place=" + place + ", isFree=" + isFree + ", cost=" + cost + '}'; } }
{ "content_hash": "a8179cadefbb2cd193772cebdee07372", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 71, "avg_line_length": 22.11111111111111, "alnum_prop": 0.48743718592964824, "repo_name": "Mrsananabos/ashveytser", "id": "31efaa53278dc34e62fb76a7af541ee4761a3ab9", "size": "1592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_006/src/main/java/ru/job4j/cinema/model/Site.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2150" }, { "name": "HTML", "bytes": "62484" }, { "name": "Java", "bytes": "453586" }, { "name": "JavaScript", "bytes": "27530" }, { "name": "XSLT", "bytes": "349" } ], "symlink_target": "" }
/** * Source : https://leetcode.com/problems/reverse-linked-list/ * Author : Zhuang Ma * Email : chumpma(at)gmail.com * Date : 2015-11-30 * */ /** * Problem: * Reverse a singly linked list. */ class Solution { public: ListNode* reverseList(ListNode* head) { ListNode* pPre = NULL; ListNode* pThis = head; ListNode* pNext = NULL; while (pThis != NULL) { pNext = pThis->next; pThis->next = pPre; pPre = pThis; pThis = pNext; } return pPre; } ListNode* reverseList2(ListNode* head) { if (head == NULL || head->next == NULL) { return head; } ListNode* childHead = reverseList(head->next); head->next->next = head; head->next = NULL; return childHead; } };
{ "content_hash": "3004a06efdd8830c57e55556b8007815", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 62, "avg_line_length": 21.11904761904762, "alnum_prop": 0.49492671927846676, "repo_name": "mzlogin/LeetCode", "id": "317ec25aebaa311cd0b922a8df67980e69b37a07", "size": "887", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "algorithms/cpp/reverseLinkedList/solution.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1145" }, { "name": "C++", "bytes": "72788" } ], "symlink_target": "" }
class XmlParser { public: XmlParser(XmlContentHandler& handler); ~XmlParser(); void parse(wxString filename); void start_element(wxString name, std::map<std::string, wxString> attrs); void end_element(wxString name); void char_data(wxString data); XML_Parser get_parser(); void set_error_msg(const char* msg); private: XML_Parser parser_; XmlContentHandler& handler_; const char* error_msg_; }; #endif
{ "content_hash": "1066bc2e7de7a8e1392d557502dfbd42", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 24.833333333333332, "alnum_prop": 0.6845637583892618, "repo_name": "tatsuhiro-t/metalink-editor", "id": "b7ae5dae3a59f05153bb8290e2a527bbbbb65e3d", "size": "597", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "XmlParser.hpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "71361" } ], "symlink_target": "" }
"use strict"; var express = require('express'); var user = require('../facade/user'); var homePageApi = require('./homePageApi'); var weeklyMovieApi = require('./weeklyMovieApi'); var bookmarkApi = require('./bookmarkApi'); var movieUtilApi = require('./movieUtilApi'); var debug = require('debug')('watchitlater:server:appApi'); var router = express.Router(); router.get('/getLatestBoxOffice', homePageApi.getLatestBoxOffice); router.get('/getLatestTopMovie', homePageApi.getLatestTopMovie); router.get('/weeklymovie', weeklyMovieApi.weeklymovieGet); router.post('/weeklymovie', weeklyMovieApi.weeklymoviePost); router.get('/bookmarks', bookmarkApi.getAllBookmarked); router.post('/bookmarks', bookmarkApi.addToBookmarked); router.get('/bookmarks/movie', bookmarkApi.getBookmarkedMovie); router.delete('/bookmarks', bookmarkApi.removeFromBookmark); router.get('/watched', bookmarkApi.getAllWatched); router.post('/watched', bookmarkApi.addToWatched); router.get('/watched/movie', bookmarkApi.getWatchedMovie); router.get('/moviesWithoutThumbnail', movieUtilApi.findAllMovieWithoutImageFile); router.post('/signin', function (req, res, next) { debug('POST /signin'); var userData = req.body; function sendData(result) { var sess = req.session; sess['loggedUser'] = { userId: result._id, email: result.email }; res.send(result); } user.saveOrUpdate(userData).then(sendData).catch(next); }); module.exports = router;
{ "content_hash": "bff0d4f333770b1b5f4c09a3ed4a55c3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 81, "avg_line_length": 42.6, "alnum_prop": 0.7270288397048961, "repo_name": "tekdungtralala/watchitlater", "id": "169e5eb8a5b456d381118bb79e928e3a23b50475", "size": "1491", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "expressapp/server/routes/appApi.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "129105" }, { "name": "HTML", "bytes": "73369" }, { "name": "JavaScript", "bytes": "151899" }, { "name": "TypeScript", "bytes": "83152" } ], "symlink_target": "" }
$(document).ready(function() { $('#UserDetailsDialog').dialog({ autoOpen : false, position : 'center', modal : true, resizable : false, width : 800, buttons : { "Save" : function() { $('#userDetailsForm').submit(); }, "Cancel" : function() { $(this).dialog('close'); } }, close : function() { resetDialog($('#userDetailsForm')); $(this).dialog('close'); } }); }); function editUser(id) { console.log("comes here") $.get("admin/get/" + id, function(result) { console.log("comes out"); console.log(result); $("#UserDetailsDialog").html(result); $('#UserDetailsDialog').dialog("option", "title", 'Edit User Details'); $("#UserDetailsDialog").dialog('open'); initializeDatePicker(); }); } function initializeDatePicker() { $(".datepicker").datepicker({ dateFormat : "mm-dd-yyyy", changeMonth : true, changeYear : true, showButtonPanel : true }); } function resetDialog(form) { form.find("input").val(""); } initializeDatePicker();
{ "content_hash": "9dbaf7305aec61906c05d964898b4ee4", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 73, "avg_line_length": 17.721311475409838, "alnum_prop": 0.572617946345976, "repo_name": "rsubra13/ss", "id": "6903d4daecc41524c62212b1863902d181333ba0", "size": "1081", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ira_bank/WebContent/js/userDetails.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "160496" }, { "name": "Java", "bytes": "276129" }, { "name": "JavaScript", "bytes": "266666" } ], "symlink_target": "" }
module OpenTracing class << self # Text format for #inject and #extract FORMAT_TEXT_MAP = 1 # Binary format for #inject and #extract FORMAT_BINARY = 2 # Ruby Specific format to handle how Rack changes environment variables. FORMAT_RACK = 3 attr_accessor :global_tracer def method_missing(method_name, *args, &block) @global_tracer.send(method_name, *args, &block) end end end
{ "content_hash": "c5442273200c7e03da789ffb70c19fd8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 76, "avg_line_length": 23.666666666666668, "alnum_prop": 0.6737089201877934, "repo_name": "nguyenquangminh0711/ruby-sensor", "id": "1e7edf7d82d739019f80847a5ee0f3a2436e6d94", "size": "426", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/instana/opentracing/tracer.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1699" }, { "name": "Ruby", "bytes": "285566" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
package expansion import ( "context" "github.com/open-policy-agent/gatekeeper/pkg/metrics" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "k8s.io/apimachinery/pkg/types" ) const ( etMetricName = "expansion_templates" etDesc = "Number of observed expansion templates" ) var ( etM = stats.Int64(etMetricName, etDesc, stats.UnitDimensionless) views = []*view.View{ { Name: etMetricName, Measure: etM, Description: etDesc, Aggregation: view.LastValue(), }, } ) func init() { if err := register(); err != nil { panic(err) } } func register() error { return view.Register(views...) } func newRegistry() *etRegistry { return &etRegistry{cache: make(map[types.NamespacedName]bool)} } type etRegistry struct { cache map[types.NamespacedName]bool dirty bool } func (r *etRegistry) add(key types.NamespacedName) { r.cache[key] = true r.dirty = true } func (r *etRegistry) remove(key types.NamespacedName) { delete(r.cache, key) r.dirty = true } func (r *etRegistry) report(ctx context.Context) error { if !r.dirty { return nil } if err := metrics.Record(ctx, etM.M(int64(len(r.cache)))); err != nil { r.dirty = false return err } return nil }
{ "content_hash": "24ffecfc6795ac2ab968aa7752031040", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 72, "avg_line_length": 17.428571428571427, "alnum_prop": 0.6778688524590164, "repo_name": "open-policy-agent/gatekeeper", "id": "91bf1c4507683a93b896b76af703fb46f5275bb5", "size": "1220", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/controller/expansion/stats_reporter.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3322" }, { "name": "Dockerfile", "bytes": "4459" }, { "name": "Go", "bytes": "1416828" }, { "name": "HTML", "bytes": "369" }, { "name": "JavaScript", "bytes": "3415" }, { "name": "Makefile", "bytes": "18766" }, { "name": "Open Policy Agent", "bytes": "9016" }, { "name": "Python", "bytes": "3987" }, { "name": "Shell", "bytes": "39093" }, { "name": "Smarty", "bytes": "7738" } ], "symlink_target": "" }
<?php define("URL_PREFIX", "/m/"); define("NM_URL_PREFIX", "/v4/"); // Non-mobile URL prefix define("VIEW_PREFIX", "mobile/"); require(IXG_PATH_PREFIX . "libraries/prefixes.php");
{ "content_hash": "6ede11ed9500926d268d15131799136c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 26, "alnum_prop": 0.6483516483516484, "repo_name": "mattbasta/Tinytape", "id": "b4dc1b4becb20d6a72111ea0b5bb6ee28ba4c23c", "size": "182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libraries/mobile_prefixes.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35024" }, { "name": "HTML", "bytes": "433" }, { "name": "JavaScript", "bytes": "57372" }, { "name": "PHP", "bytes": "442125" } ], "symlink_target": "" }
var CK_INVOICE = (function () { var my = {}; // These are overriden on startup. my.max_time = 15 * 60; my.time_left = my.max_time; my.ck_refnum = 'none'; function set_expired() { $('#js-expired').height($('#js-most-stuff').height()); $('#js-most-stuff').hide() $('#js-expired').show() $('#js-time-percent').width(0); $('#js-time-left').text('expired'); my.time_left = 0; } my.set_ispaid = function() { $('#js-paid').height($('#js-most-stuff').height()); $('#js-most-stuff').hide() $('#js-paid').show() $('#js-time-percent').width(0); $('#js-time-left').hide(); my.time_left = 0; } function tick_handler() { // called once per second // NOTE: this is the wrong way to do this, but only a demo! if(my.time_left <= 0) return; my.time_left -= 1; if(my.time_left > 0) { $('#js-time-left').text(numeral(my.time_left).format('0:00:00') + ' left'); $('#js-time-percent').width(((100*my.time_left) / my.max_time) + '%'); } else { // done. set_expired(); } } my.startup = function(time_left, max_time, ck_refnum) { // We have an invoice to work with. Animate it. my.time_left = time_left; my.max_time = max_time; my.ck_refnum = ck_refnum; if(my.time_left <= 0) { set_expired(); } else { my.tick_id = window.setInterval(tick_handler, 1000); } } my.got_event = function(msg) { if(msg.request != my.ck_refnum) return; my.set_ispaid() } return my; }()); head.ready(document, function () { // All pages need these $(".js-tooltip").tooltip(); $(".js-popover").popover(); select_contents = function(evt) { var text = evt.target; var doc = document, range, selection; if(doc.body.createTextRange) { range = document.body.createTextRange(); range.moveToElementText(text); range.select(); } else if(window.getSelection) { range = document.createRange(); range.selectNodeContents(text); selection = window.getSelection(); if(selection != range) { selection.removeAllRanges(); selection.addRange(range); } } }; $(".js-selectable").on('click', select_contents) .attr('title', 'Click to select for copying').tooltip(); if(typeof(THIS_INVOICE) != 'undefined') { THIS_INVOICE(); } });
{ "content_hash": "1a5e91b4f85c72ee5cdde2aafa505d54", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 87, "avg_line_length": 25.46153846153846, "alnum_prop": 0.5064199395770392, "repo_name": "coinkite/coinkite-real-time-invoice", "id": "68a1f641f0d83e16240102952e3d5f6c6634a1e6", "size": "2650", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "static/js/invoice.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2650" }, { "name": "Makefile", "bytes": "317" }, { "name": "Python", "bytes": "338851" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "1924cf77af75264da7ab659f715b0950", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "71dec7cb9690b98053d26feb7c16eb7d980437d3", "size": "177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Tragacantha/Tragacantha ochrobia/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "country" ("id", "name") VALUES ('ab', 'abkaziu'); INSERT INTO "country" ("id", "name") VALUES ('af', 'afrikaner'); INSERT INTO "country" ("id", "name") VALUES ('ay', 'aimara'); INSERT INTO "country" ("id", "name") VALUES ('ak', 'akan'); INSERT INTO "country" ("id", "name") VALUES ('de', 'alemãu'); INSERT INTO "country" ("id", "name") VALUES ('de_AT', 'alimãu austriaku'); INSERT INTO "country" ("id", "name") VALUES ('de_CH', 'altu alimãu suisu'); INSERT INTO "country" ("id", "name") VALUES ('am', 'amariku'); INSERT INTO "country" ("id", "name") VALUES ('ar', 'arabi'); INSERT INTO "country" ("id", "name") VALUES ('as', 'asames'); INSERT INTO "country" ("id", "name") VALUES ('ha', 'auza'); INSERT INTO "country" ("id", "name") VALUES ('az', 'azerbaijanu'); INSERT INTO "country" ("id", "name") VALUES ('bn', 'bengali'); INSERT INTO "country" ("id", "name") VALUES ('be', 'bielorusu'); INSERT INTO "country" ("id", "name") VALUES ('my', 'birmanes'); INSERT INTO "country" ("id", "name") VALUES ('bs', 'bosniu'); INSERT INTO "country" ("id", "name") VALUES ('bg', 'bulgaru'); INSERT INTO "country" ("id", "name") VALUES ('da', 'dinamarkes'); INSERT INTO "country" ("id", "name") VALUES ('nl_BE', 'flamengu'); INSERT INTO "country" ("id", "name") VALUES ('fr', 'franses'); INSERT INTO "country" ("id", "name") VALUES ('fr_CA', 'franses kanadianu'); INSERT INTO "country" ("id", "name") VALUES ('fr_CH', 'franses suisu'); INSERT INTO "country" ("id", "name") VALUES ('cy', 'gales'); INSERT INTO "country" ("id", "name") VALUES ('el', 'gregu'); INSERT INTO "country" ("id", "name") VALUES ('ig', 'ibo'); INSERT INTO "country" ("id", "name") VALUES ('hi', 'indi'); INSERT INTO "country" ("id", "name") VALUES ('id', 'indoneziu'); INSERT INTO "country" ("id", "name") VALUES ('en', 'ingles'); INSERT INTO "country" ("id", "name") VALUES ('en_AU', 'ingles australianu'); INSERT INTO "country" ("id", "name") VALUES ('en_GB', 'ingles britanuku'); INSERT INTO "country" ("id", "name") VALUES ('en_CA', 'ingles kanadianu'); INSERT INTO "country" ("id", "name") VALUES ('en_US', 'ingles merkanu'); INSERT INTO "country" ("id", "name") VALUES ('yo', 'ioruba'); INSERT INTO "country" ("id", "name") VALUES ('it', 'italianu'); INSERT INTO "country" ("id", "name") VALUES ('ja', 'japones'); INSERT INTO "country" ("id", "name") VALUES ('jv', 'javanes'); INSERT INTO "country" ("id", "name") VALUES ('kea', 'kabuverdianu'); INSERT INTO "country" ("id", "name") VALUES ('ca', 'katalãu'); INSERT INTO "country" ("id", "name") VALUES ('rw', 'kiniaruanda'); INSERT INTO "country" ("id", "name") VALUES ('km', 'kmer'); INSERT INTO "country" ("id", "name") VALUES ('ko', 'kureanu'); INSERT INTO "country" ("id", "name") VALUES ('und', 'lingua diskonxedu'); INSERT INTO "country" ("id", "name") VALUES ('ms', 'malaiu'); INSERT INTO "country" ("id", "name") VALUES ('ne', 'nepales'); INSERT INTO "country" ("id", "name") VALUES ('nl', 'olandes'); INSERT INTO "country" ("id", "name") VALUES ('pa', 'pandjabi'); INSERT INTO "country" ("id", "name") VALUES ('fa', 'persa'); INSERT INTO "country" ("id", "name") VALUES ('pl', 'pulaku'); INSERT INTO "country" ("id", "name") VALUES ('pt', 'purtuges'); INSERT INTO "country" ("id", "name") VALUES ('pt_BR', 'purtuges brazileru'); INSERT INTO "country" ("id", "name") VALUES ('pt_PT', 'purtuges europeu'); INSERT INTO "country" ("id", "name") VALUES ('ro', 'rumenu'); INSERT INTO "country" ("id", "name") VALUES ('ru', 'rusu'); INSERT INTO "country" ("id", "name") VALUES ('so', 'somali'); INSERT INTO "country" ("id", "name") VALUES ('es', 'spanhol'); INSERT INTO "country" ("id", "name") VALUES ('es_ES', 'spanhol europeu'); INSERT INTO "country" ("id", "name") VALUES ('es_419', 'spanhol latinu-merkanu'); INSERT INTO "country" ("id", "name") VALUES ('sv', 'sueku'); INSERT INTO "country" ("id", "name") VALUES ('th', 'tailandes'); INSERT INTO "country" ("id", "name") VALUES ('ta', 'tamil'); INSERT INTO "country" ("id", "name") VALUES ('bo', 'tibetanu'); INSERT INTO "country" ("id", "name") VALUES ('tr', 'turku'); INSERT INTO "country" ("id", "name") VALUES ('cs', 'txeku'); INSERT INTO "country" ("id", "name") VALUES ('uk', 'ukranianu'); INSERT INTO "country" ("id", "name") VALUES ('hu', 'ungaru'); INSERT INTO "country" ("id", "name") VALUES ('ur', 'urdu'); INSERT INTO "country" ("id", "name") VALUES ('vi', 'vietnamita'); INSERT INTO "country" ("id", "name") VALUES ('zh', 'xines'); INSERT INTO "country" ("id", "name") VALUES ('zh_Hans', 'xines simplifikadu'); INSERT INTO "country" ("id", "name") VALUES ('zh_Hant', 'xines tradisional'); INSERT INTO "country" ("id", "name") VALUES ('zu', 'zulu');
{ "content_hash": "dc8aff34341c34a6e05bdde4a5ad3eb0", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 90, "avg_line_length": 64.97260273972603, "alnum_prop": 0.6137465738983765, "repo_name": "JumpLink/country-list", "id": "bdb02cd14c14bc3824c8483efbb64ebd56e41a98", "size": "4747", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "country/icu/kea/language.sqlite.sql", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3084" }, { "name": "PHP", "bytes": "9858933" } ], "symlink_target": "" }
package main import ( "flag" "log" "net/http" "os" "path/filepath" "github.com/austinkelmore/catarang/catarang" "github.com/austinkelmore/catarang/web" ) func main() { log.Println("Running Catarang!") // if len(os.Args) >= 2 && os.Args[1] != "" { // greeter.ClientPluginStart() // return // } log.SetFlags(log.LstdFlags | log.Lshortfile) clean := flag.Bool("clean", false, "Cleans everything so you start of fresh for testing") dev := flag.Bool("dev", false, "Sets up a dev environment to point to the web assets, but run in the bin dir assuming you have the normal build setup.") flag.Parse() if *dev { dir, err := filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { log.Fatal("Couldn't get the directory of executable") } if err := os.Chdir(dir); err != nil { log.Fatal("Couldn't set working directory to", dir) } log.Println("Set working directory to", dir) web.SetWebDir("../web") } if *clean { catarang.Clean() os.RemoveAll("jobs/") os.RemoveAll("results/") log.Println("Cleaned catarang to start from scratch") } catarang.ReadInConfig() r := web.CreateRoutes() http.Handle("/", r) // greeter.ServerStart(os.Args) log.Fatal(http.ListenAndServe(":8080", nil)) }
{ "content_hash": "5befc43a34f459f5718b6e7207a17c61", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 153, "avg_line_length": 22.089285714285715, "alnum_prop": 0.6628940986257074, "repo_name": "austinkelmore/catarang", "id": "dd1bc5f282b455527c59629c7054ff8b13ddd92b", "size": "1237", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/github.com/austinkelmore/catarang/main/main.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "35130" }, { "name": "HTML", "bytes": "2375" }, { "name": "JavaScript", "bytes": "4799" } ], "symlink_target": "" }
#pragma once #include <zk/config.hpp> #include <initializer_list> #include <iosfwd> #include <string> #include <variant> #include <vector> #include "acl.hpp" #include "buffer.hpp" #include "forwards.hpp" #include "results.hpp" #include "types.hpp" namespace zk { /// \addtogroup Client /// \{ /// Describes the type of an \ref op. enum class op_type : int { check, //!< \ref op::check create, //!< \ref op::create erase, //!< \ref op::erase set, //!< \ref op::set }; std::ostream& operator<<(std::ostream&, const op_type&); std::string to_string(const op_type&); /// Represents a single operation of a \ref multi_op. class op final { public: /// Data for a \ref op::check operation. struct check_data { std::string path; version check; explicit check_data(std::string path, version check); op_type type() const { return op_type::check; } }; /// Check that the given \a path exists with the provided version \a check (which can be \c version::any). static op check(std::string path, version check = version::any()); /// Data for a \ref op::create operation. struct create_data { std::string path; buffer data; acl rules; create_mode mode; explicit create_data(std::string path, buffer data, acl rules, create_mode mode); op_type type() const { return op_type::create; } }; /// \{ /// Create a new entry at the given \a path with the \a data. /// /// \see client::create static op create(std::string path, buffer data, acl rules, create_mode mode = create_mode::normal); static op create(std::string path, buffer data, create_mode mode = create_mode::normal); /// \} /// Data for a \ref op::erase operation. struct erase_data { std::string path; version check; explicit erase_data(std::string path, version check); op_type type() const { return op_type::erase; } }; /// Delete the entry at the given \a path if it matches the version \a check. /// /// \see client::erase static op erase(std::string path, version check = version::any()); /// Data for a \ref op::set operation. struct set_data { std::string path; buffer data; version check; explicit set_data(std::string path, buffer data, version check); op_type type() const { return op_type::set; } }; /// Set the \a data for the entry at \a path if it matches the version \a check. /// /// \see client::set static op set(std::string path, buffer data, version check = version::any()); public: op(const op&); op(op&&) noexcept; op& operator=(const op&) = delete; op& operator=(op&&) = delete; ~op() noexcept; /// Get the underlying type of this operation. op_type type() const; /// Get the check-specific data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::check. const check_data& as_check() const; /// Get the create-specific data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::create. const create_data& as_create() const; /// Get the erase-specific data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::erase. const erase_data& as_erase() const; /// Get the set-specific data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::set. const set_data& as_set() const; private: using any_data = std::variant<check_data, create_data, erase_data, set_data>; explicit op(any_data&&) noexcept; template <typename T> const T& as(ptr<const char> operation) const; friend std::ostream& operator<<(std::ostream&, const op&); private: any_data _storage; }; std::ostream& operator<<(std::ostream&, const op&); std::string to_string(const op&); /// A collection of operations that will be performed atomically. /// /// \see client::commit /// \see op class multi_op final { public: using iterator = std::vector<op>::iterator; using const_iterator = std::vector<op>::const_iterator; using size_type = std::vector<op>::size_type; public: /// Create an empty operation set. multi_op() noexcept { } /// Create an instance from the provided \a ops. multi_op(std::vector<op> ops) noexcept; /// Create an instance from the provided \a ops. multi_op(std::initializer_list<op> ops) : multi_op(std::vector<op>(ops)) { } ~multi_op() noexcept; /// The number of operations in this transaction bundle. size_type size() const { return _ops.size(); } /// \{ /// Get the operation at the given \a idx. const op& operator[](size_type idx) const { return _ops[idx]; } op& operator[](size_type idx) { return _ops[idx]; } /// \} /// \{ /// Get the operation at the given \a idx. /// /// \throws std::out_of_range if \a idx is larger than \ref size. const op& at(size_type idx) const { return _ops.at(idx); } op& at(size_type idx) { return _ops.at(idx); } /// \} /// \{ /// Get an iterator to the beginning of the operation list. iterator begin() { return _ops.begin(); } const_iterator begin() const { return _ops.begin(); } const_iterator cbegin() const { return _ops.begin(); } /// \} /// \{ /// Get an iterator to the end of the operation list. iterator end() { return _ops.end(); } const_iterator end() const { return _ops.end(); } const_iterator cend() const { return _ops.end(); } /// \} /// Increase the reserved memory block so it can store at least \a capacity operations without reallocating. void reserve(size_type capacity) { _ops.reserve(capacity); } /// Construct an operation emplace on the end of the list using \a args. /// /// \see push_back template <typename... TArgs> void emplace_back(TArgs&&... args) { _ops.emplace_back(std::forward<TArgs>(args)...); } /// \{ /// Add the operation \a x to the end of this list. void push_back(op&& x) { emplace_back(std::move(x)); } void push_back(const op& x) { emplace_back(x); } /// \} private: std::vector<op> _ops; }; std::ostream& operator<<(std::ostream&, const multi_op&); std::string to_string(const multi_op&); /// The result of a successful \ref client::commit operation. class multi_result final { public: /// A part of a result. The behavior depends on the type of \ref op provided to the original transaction. class part final { public: explicit part(op_type, std::nullptr_t) noexcept; explicit part(create_result) noexcept; explicit part(set_result) noexcept; part(const part&); part(part&&) noexcept; part& operator=(const part&) = delete; part& operator=(part&&) = delete; ~part() noexcept; /// The \ref op_type of the \ref op that caused this result. op_type type() const { return _type; } /// Get the create-specific result data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::set. const create_result& as_create() const; /// Get the set-specific result data. /// /// \throws std::logic_error if the \ref type is not \ref op_type::set. const set_result& as_set() const; private: using any_result = std::variant<std::monostate, create_result, set_result>; template <typename T> const T& as(ptr<const char> operation) const; private: op_type _type; any_result _storage; }; using iterator = std::vector<part>::iterator; using const_iterator = std::vector<part>::const_iterator; using size_type = std::vector<part>::size_type; public: multi_result() noexcept { } multi_result(std::vector<part> parts) noexcept; multi_result(multi_result&&) = default; multi_result & operator=(multi_result&&) = default; ~multi_result() noexcept; /// The number of results in this transaction bundle. size_type size() const { return _parts.size(); } /// \{ /// Get the result at the given \a idx. /// /// \throws std::out_of_range if \a idx is larger than \a size. part& operator[](size_type idx) { return _parts[idx]; } const part& operator[](size_type idx) const { return _parts[idx]; } /// \} /// \{ /// Get the result at the given \a idx. /// /// \throws std::out_of_range if \a idx is larger than \ref size. const part& at(size_type idx) const { return _parts.at(idx); } part& at(size_type idx) { return _parts.at(idx); } /// \} /// \{ /// Get an iterator to the beginning of the result list. iterator begin() { return _parts.begin(); } const_iterator begin() const { return _parts.begin(); } const_iterator cbegin() const { return _parts.begin(); } /// \} /// \{ /// Get an iterator to the end of the result list. iterator end() { return _parts.end(); } const_iterator end() const { return _parts.end(); } const_iterator cend() const { return _parts.end(); } /// \} /// Increase the reserved memory block so it can store at least \a capacity results without reallocating. void reserve(size_type capacity) { _parts.reserve(capacity); } /// Construct a result emplace on the end of the list using \a args. /// /// \see push_back template <typename... TArgs> void emplace_back(TArgs&&... args) { _parts.emplace_back(std::forward<TArgs>(args)...); } /// \{ /// Add the operation \a x to the end of this list. void push_back(part&& x) { emplace_back(std::move(x)); } void push_back(const part& x) { emplace_back(x); } /// \} private: std::vector<part> _parts; }; std::ostream& operator<<(std::ostream&, const multi_result::part&); std::ostream& operator<<(std::ostream&, const multi_result&); std::string to_string(const multi_result::part&); std::string to_string(const multi_result&); /** \} **/ }
{ "content_hash": "ae6ded775b38db91279c8207da119859", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 112, "avg_line_length": 28.446280991735538, "alnum_prop": 0.5940344760797985, "repo_name": "tgockel/zookeeper-cpp", "id": "595a1b74cbbe0063454dfc6748e6b9523c6b2d11", "size": "10326", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/zk/multi.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "279242" }, { "name": "CMake", "bytes": "30964" }, { "name": "Dockerfile", "bytes": "4048" }, { "name": "Shell", "bytes": "10184" } ], "symlink_target": "" }
using JetBrains.ReSharper.UnitTestFramework; namespace XunitContrib.Runner.ReSharper.UnitTestProvider { public static class UnitTestElementIdExtensions { public static string GetPersistentProjectId(this UnitTestElementId id) { return id.PersistentProjectId.Id; } } }
{ "content_hash": "397740a806e0e3fae8a30324da5ec2d5", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 78, "avg_line_length": 26.333333333333332, "alnum_prop": 0.7215189873417721, "repo_name": "derigel23/resharper-xunit", "id": "309dbd7c171b19795017031839e9736780534e21", "size": "318", "binary": false, "copies": "1", "ref": "refs/heads/xunit2", "path": "resharper/src/provider/UnitTestElements/UnitTestElementIdExtensions-pre9.2.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "20873" }, { "name": "C#", "bytes": "632917" }, { "name": "HTML", "bytes": "74054" }, { "name": "Visual Basic", "bytes": "21650" }, { "name": "XSLT", "bytes": "81460" } ], "symlink_target": "" }
Configuration File ------------------ After installation, you will need to create a configuration file. By default, ``jenkins-jobs`` looks in ``/etc/jenkins_jobs/jenkins_jobs.ini`` but you may specify an alternative location when running ``jenkins-jobs``. The file should have the following format: .. literalinclude:: ../../etc/jenkins_jobs.ini-sample :language: ini job_builder section ^^^^^^^^^^^^^^^^^^^ **ignore_cache** (Optional) If set to True, Jenkins Job Builder won't use any cache. **keep_descriptions** By default `jenkins-jobs` will overwrite the jobs descriptions even if no description has been defined explicitly. When this option is set to True, that behavior changes and it will only overwrite the description if you specified it in the yaml. False by default. **include_path** (Optional) Can be set to a ':' delimited list of paths, which jenkins job builder will search for any files specified by the custom application yaml tags 'include', 'include-raw' and 'include-raw-escaped'. **recursive** (Optional) If set to True, jenkins job builder will search for job definition files recursively. **exclude** (Optional) If set to a list of values separated by ':', these paths will be excluded from the list of paths to be processed when searching recursively. Values containing no ``/`` will be matched against directory names at all levels, those starting with ``/`` will be considered absolute, while others containing a ``/`` somewhere other than the start of the value will be considered relative to the starting path. **allow_duplicates** (Optional) By default `jenkins-jobs` will abort when a duplicate macro, template, job-group or job name is encountered as it cannot establish the correct one to use. When this option is set to True, only a warning is emitted. **allow_empty_variables** (Optional) When expanding strings, by default `jenkins-jobs` will raise an exception if there's a key in the string, that has not been declared in the input YAML files. Setting this option to True will replace it with the empty string, allowing you to use those strings without having to define all the keys it might be using. jenkins section ^^^^^^^^^^^^^^^ **user** This should be the name of a user previously defined in Jenkins. Appropriate user permissions must be set under the Jenkins security matrix: under the ``Global`` group of permissions, check ``Read``, then under the ``Job`` group of permissions, check ``Create``, ``Delete``, ``Configure`` and finally ``Read``. **password** The API token for the user specified. You can get this through the Jenkins management interface under ``People`` -> username -> ``Configure`` and then click the ``Show API Token`` button. **url** The base URL for your Jenkins installation. **timeout** (Optional) The connection timeout (in seconds) to the Jenkins server. By default this is set to the system configured socket timeout. **query_plugins_info** Whether to query the Jenkins instance for plugin info when a configuration file is provided. If a configuration file is not provided `jenkins-jobs` will ignore this setting and skip querying for plugin information. True by default. hipchat section ^^^^^^^^^^^^^^^ **send-as** This is the hipchat user name that will be used when sending notifications. **authtoken** The API token necessary to send messages to hipchat. This can be generated in the hipchat web interface by a user with administrative access for your organization. This authtoken is set for each job individually; the JJB Hipchat Plugin does not currently support setting different tokens for different projects, so the token you use will have to be scoped such that it can be used for any room your jobs might be configured to notify. For more information on this topic, please see the `Hipchat API Documentation`__ __ https://www.hipchat.com/docs/apiv2/auth stash section ^^^^^^^^^^^^^^^^^^^^^^^ **username** This is the stash user name that will be used to connect to stash when using the stash publisher plugin and not defining it in the yaml part. **password** This is the related password that will be used with the stash username when using the stash publisher plugin and not defining it in the yaml part. Running ------- After it's installed and configured, you can invoke Jenkins Job Builder by running ``jenkins-jobs``. You won't be able to do anything useful just yet without a configuration; that is discussed in the next section. Test Mode ^^^^^^^^^ Once you have a configuration defined, you can run the job builder in test mode. If you want to run a simple test with just a single YAML job definition file and see the XML output on stdout:: jenkins-jobs test /path/to/foo.yaml You can also pass JJB a directory containing multiple job definition files:: jenkins-jobs test /path/to/defs -o /path/to/output which will write XML files to the output directory for all of the jobs defined in the defs directory. .. _updating-jobs: Updating Jobs ^^^^^^^^^^^^^ When you're satisfied with the generated XML from the test, you can run:: jenkins-jobs update /path/to/defs which will upload the job definitions to Jenkins if needed. Jenkins Job Builder maintains, for each host, a cache [#f1]_ of previously configured jobs, so that you can run that command as often as you like, and it will only update the jobs configurations in Jenkins if the defined definitions has changed since the last time it was run. Note: if you modify a job directly in Jenkins, jenkins-jobs will not know about it and will not update it. To update a specific list of jobs, simply pass the job names as additional arguments after the job definition path. To update Foo1 and Foo2 run:: jenkins-jobs update /path/to/defs Foo1 Foo2 Passing Multiple Paths ^^^^^^^^^^^^^^^^^^^^^^ It is possible to pass multiple paths to JJB using colons as a path separator on \*nix systems and semi-colons on Windows systems. For example:: jenkins-jobs test /path/to/global:/path/to/instance:/path/to/instance/project This helps when structuring directory layouts as you may selectively include directories in different ways to suit different needs. If you maintain multiple Jenkins instances suited to various needs you may want to share configuration between those instances (global). Furthermore, there may be various ways you would like to structure jobs within a given instance. Recursive Searching of Paths ---------------------------- In addition to passing multiple paths to JJB it is also possible to enable recursive searching to process all yaml files in the tree beneath each path. For example:: For a tree: /path/ to/ defs/ ci_jobs/ release_jobs/ globals/ macros/ templates/ jenkins-jobs update -r /path/to/defs:/path/to/globals JJB will search defs/ci_jobs, defs/release_jobs, globals/macros and globals/templates in addition to the defs and globals trees. Excluding Paths --------------- To allow a complex tree of jobs where some jobs are managed differently without needing to explicitly provide each path, the recursive path processing supports excluding paths based on absolute paths, relative paths and patterns. For example:: For a tree: /path/ to/ defs/ ci_jobs/ manual/ release_jobs/ manual/ qa_jobs/ globals/ macros/ templates/ special/ jenkins-jobs update -r -x man*:./qa_jobs -x /path/to/defs/globals/special \ /path/to/defs:/path/to/globals JJB will search the given paths, ignoring the directories qa_jobs, ci_jobs/manual, release_jobs/manual, and globals/special when building the list of yaml files to be processed. Absolute paths are denoted by starting from the root, relative by containing the path separator, and patterns by having neither. Patterns use simple shell globing to match directories. Deleting Jobs ^^^^^^^^^^^^^ Jenkins Job Builder supports deleting jobs from Jenkins. To delete a specific job:: jenkins-jobs delete Foo1 To delete a list of jobs, simply pass them as additional arguments after the command:: jenkins-jobs delete Foo1 Foo2 The ``update`` command includes a ``delete-old`` option to remove obsolete jobs:: jenkins-jobs update --delete-old /path/to/defs Obsolete jobs are *all* jobs not managed by JJB, even jobs which were *never* managed by JJB. There is also a command to delete **all** jobs. **WARNING**: Use with caution:: jenkins-jobs delete-all Globbed Parameters ^^^^^^^^^^^^^^^^^^ Jenkins job builder supports globbed parameters to identify jobs from a set of definition files. This feature only supports JJB managed jobs. To update jobs that only have 'foo' in their name:: jenkins-jobs update ./myjobs \*foo\* To delete jobs that only have 'foo' in their name:: jenkins-jobs delete --path ./myjobs \*foo\* .. _command-reference: Command Reference ^^^^^^^^^^^^^^^^^ .. program-output:: jenkins-jobs --help .. program-output:: jenkins-jobs test --help .. program-output:: jenkins-jobs update --help .. program-output:: jenkins-jobs delete-all --help .. program-output:: jenkins-jobs delete --help .. rubric:: Footnotes .. [#f1] The cache default location is at ``~/.cache/jenkins_jobs``, which can be overridden by setting the ``XDG_CACHE_HOME`` environment variable.
{ "content_hash": "2cc9930a30a0cfe76e37c502914078c2", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 80, "avg_line_length": 33.56537102473498, "alnum_prop": 0.726286977576587, "repo_name": "GoodgameStudios/jenkins-job-builder", "id": "6ca7330f5705537513f44d63a44fa833c6777312", "size": "9499", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "doc/source/execution.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "51" }, { "name": "C++", "bytes": "719" }, { "name": "Python", "bytes": "816372" }, { "name": "Shell", "bytes": "916" }, { "name": "SourcePawn", "bytes": "16" } ], "symlink_target": "" }
package com.google.ddex.convertercli; import com.google.common.collect.ImmutableSet; import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; class ConverterOptions { private File outputDirectory = null; private File inputFile = null; private List<File> inputFileList = new ArrayList<>(); private boolean inputIsDirectory = false; private String inputType = null; private CommandLine commandLineInput; private static final ImmutableSet<String> VALID_INPUT_TYPES = ImmutableSet.of("message", "schema", "schema_set"); private static final Options DEFAULT_COMMAND_OPTIONS = new Options() .addOption( Option.builder("o") .longOpt("outputDirectory") .hasArg() .argName("path") .required(false) .desc("the output directory of the serialized protobuf message(s)") .build()) .addOption( Option.builder("d") .longOpt("directory") .desc("specify this option if the input argument is a directory of input_files") .build()) .addOption( Option.builder() .longOpt("inputType") .hasArg() .argName("type") .required(true) .desc("message | schema | schema_set") .build()); public static void showCommandUsage() { final String helpCmdSyntax = "ConverterCli [OPTIONS] input_file"; final String helpHeader = "Convert input DDEX XML formats to Protobuf"; HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(helpCmdSyntax, helpHeader, DEFAULT_COMMAND_OPTIONS, null); } public ConverterOptions(String[] args) throws InvalidOptionsException { setCommandLineInput(args); populateOptions(); validateOptions(); } File getOutputDirectory() { return outputDirectory; } File getInputFile() { return inputFile; } List<File> getInputFileList() { return inputFileList; } boolean isInputIsDirectory() { return inputIsDirectory; } String getInputType() { return inputType; } private void setCommandLineInput(String[] args) throws InvalidOptionsException { try { CommandLineParser commandParser = new DefaultParser(); commandLineInput = commandParser.parse(DEFAULT_COMMAND_OPTIONS, args); } catch (ParseException e) { throw new InvalidOptionsException("Error trying to parse command input.", e); } } private File getFile(String pathName) throws InvalidOptionsException { File ddexFile = new File(pathName); if (ddexFile.exists()) { return ddexFile; } else { throw new InvalidOptionsException("XML file input does not exist."); } } private void populateOptions() throws InvalidOptionsException { if (commandLineInput.hasOption("outputDirectory")) { outputDirectory = new File(commandLineInput.getOptionValue("outputDirectory")); } if (commandLineInput.hasOption("directory")) { inputIsDirectory = true; } if (commandLineInput.hasOption("inputType")) { inputType = commandLineInput.getOptionValue("inputType"); } String[] args = commandLineInput.getArgs(); if (args.length == 1) { File ddexFile = getFile(args[0]); inputFile = ddexFile; inputFileList.add(ddexFile); } else if (args.length > 1) { for (String arg : args) { File ddexFile = getFile(arg); inputFileList.add(ddexFile); } } else { throw new InvalidOptionsException("Missing arguments."); } } private void validateOptions() throws InvalidOptionsException { if (!VALID_INPUT_TYPES.contains(inputType)) { throw new InvalidOptionsException("Invalid inputType specified: " + inputType); } } }
{ "content_hash": "57f0d02078789d19c6c5aea1043cd554", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 98, "avg_line_length": 31.893939393939394, "alnum_prop": 0.6572446555819478, "repo_name": "googleinterns/ddex-mead-parser", "id": "3c18e3fc8252b2a0dff8d10c7911c72f0f52ae11", "size": "4210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/ddex-convertercli/src/main/java/com/google/ddex/convertercli/ConverterOptions.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "14861" }, { "name": "Java", "bytes": "81833" }, { "name": "Starlark", "bytes": "1705" } ], "symlink_target": "" }
from scp.ethyl_alcohol import EthylAlcohol from scp.ethylene_glycol import EthyleneGlycol from scp.methyl_alcohol import MethylAlcohol from scp.propylene_glycol import PropyleneGlycol from scp.water import Water class Fluid: """ An object for handling the fluid properties Parameters ---------- fluid_str: str The mixer for this application should be one of: - 'Water' - Complete water solution - 'MEG' - Ethylene glycol mixed with water - 'MPG' - Propylene glycol mixed with water - 'MEA' - Ethanol mixed with water - 'MMA' - Methanol mixed with water percent: float Mass fraction of the mixing fluid added to water (in %). Lower bound = 0. Upper bound is dependent on the mixture. T: float, optional The temperature of the fluid (in Celcius). Default is 20 degC. Examples -------- >>> import pygfunction as gt >>> T_f = 20. # Temp at 20 C >>> # complete water solution >>> fluid_str = 'Water' >>> percent = 0 >>> fluid = gt.media.Fluid(fluid_str, percent, T=T_f) >>> print(fluid) >>> # 20 % propylene glycol mixed with water >>> fluid_str = 'MPG' >>> percent = 20 >>> fluid = gt.media.Fluid(fluid_str, percent, T=T_f) >>> # 60% ethylene glycol mixed with water >>> fluid_str = 'MEG' >>> percent = 60 >>> fluid = gt.media.Fluid(fluid_str, percent, T=T_f) >>> print(fluid) >>> # 5% methanol mixed with water >>> fluid_str = 'MMA' >>> percent = 5 >>> fluid = gt.media.Fluid(fluid_str, percent, T=T_f) >>> print(fluid) >>> # ethanol / water >>> fluid_str = 'MEA' >>> percent = 10 >>> fluid = gt.media.Fluid(fluid_str, percent, T=T_f) >>> print(fluid) """ def __init__(self, fluid_str: str, percent: float, T: float = 20.): # concentration fraction x_frac = percent / 100 if fluid_str.upper() == 'WATER': self.fluid = Water() elif fluid_str.upper() in ['PROPYLENEGLYCOL', 'MPG']: self.fluid = PropyleneGlycol(x_frac) elif fluid_str.upper() in ['ETHYLENEGLYCOL', 'MEG']: self.fluid = EthyleneGlycol(x_frac) elif fluid_str.upper() in ['METHYLALCOHOL', 'MMA']: self.fluid = MethylAlcohol(x_frac) elif fluid_str.upper() in ['ETHYLALCOHOL', 'MEA']: self.fluid = EthylAlcohol(x_frac) else: raise ValueError(f'Unsupported fluid mixture: "{fluid_str}".') # Initialize all fluid properties # Temperature of the fluid (in Celsius) self.T_C = T # Density (in kg/m3) self.rho = self.density() # Dynamic viscosity (in Pa.s, or N.s/m2) self.mu = self.dynamic_viscosity() # Kinematic viscosity (in m2/s) self.nu = self.kinematic_viscosity() # Specific isobaric heat capacity (J/kg.K) self.cp = self.specific_heat_capacity() # Volumetric heat capacity (in J/m3.K) self.rhoCp = self.volumetric_heat_capacity() # Thermal conductivity (in W/m.K) self.k = self.thermal_conductivity() # Prandlt number self.Pr = self.Prandlt_number() def __repr__(self): return f'{self.__class__!s}\n' \ + '\n'.join( (f'{item!s} = {self.__dict__[item]}' for item in sorted(self.__dict__))) def append_to_dict(self, dnary): if len(list(dnary.keys())) == 0: for item in sorted(self.__dict__): dnary[item] = [] for item in sorted(self.__dict__): dnary[item].append(f'{self.__dict__[item]:.5E}') def density(self): """ Returns the density of the fluid (in kg/m3). Returns ------- rho : float Density (in kg/m3). """ return self.fluid.density(self.T_C) def dynamic_viscosity(self): """ Returns the dynamic viscosity of the fluid (in Pa.s, or N.s/m2). Returns ------- mu : float Dynamic viscosity (in Pa.s, or N.s/m2). """ return self.fluid.viscosity(self.T_C) def kinematic_viscosity(self): """ Returns the kinematic viscosity of the fluid (in m2/s). Returns ------- nu : float Kinematic viscosity (in m2/s). """ return self.mu / self.rho def specific_heat_capacity(self): """ Returns the specific isobaric heat capacity of the fluid (J/kg.K). Returns ------- cp : float Specific isobaric heat capacity (J/kg.K). """ return self.fluid.specific_heat(self.T_C) def volumetric_heat_capacity(self): """ Returns the volumetric heat capacity of the fluid (J/m3.K). Returns ------- rhoCp : float Volumetric heat capacity (in J/m3.K). """ return self.rho * self.cp def thermal_conductivity(self): """ Returns the thermal conductivity of the fluid (in W/m.K). Returns ------- k : float Thermal conductivity (in W/m.K). """ return self.fluid.conductivity(self.T_C) def Prandlt_number(self): """ Returns the Prandtl of the fluid. Returns ------- Pr : float Prandlt number. """ return self.fluid.prandtl(self.T_C)
{ "content_hash": "8774810cc511b6a65126d434abc50351", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 74, "avg_line_length": 29.755208333333332, "alnum_prop": 0.5251181515841065, "repo_name": "MassimoCimmino/pygfunction", "id": "52bce819e86e3211df3046a5f6c468cb7c535c32", "size": "5737", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pygfunction/media.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "647388" } ], "symlink_target": "" }
static void help() { printf("Usage: buildmon [options]\n" "\n" "-h Show help\n" "-v Show version\n"); exit(0); } struct Process_TypeGroup1 { int UniqueProcessKey; int ProcessId; int ParentId; int SessionId; int ExitStatus; int DirectoryTableBase; int UserSID[13]; char ImageFileName[1]; // string CommandLine; }; static FILE *file; static PEVENT_TRACE_PROPERTIES properties; static TRACEHANDLE trace; static void end(int status) { if (trace) ControlTrace(0, KERNEL_LOGGER_NAME, properties, EVENT_TRACE_CONTROL_STOP); if (file) fclose(file); ExitProcess(status); } static void err(char *s) { // Retrieve the system error message for the last-error code auto error = GetLastError(); char *msg; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *)&msg, 0, 0); // Display the error message and exit the process printf("%s failed with error %d: %s\n", s, error, msg); end(error); } template <class C> static void output(C *s) { fputc('"', file); for (; *s; s++) { if (*s == '"') fputc('"', file); fputc(*s, file); } fputc('"', file); } static void WINAPI EventRecordCallback(PEVENT_RECORD event) { if (event->EventHeader.EventDescriptor.Opcode != 1) return; auto p = (Process_TypeGroup1 *)event->UserData; auto n = strlen(p->ImageFileName) + 1; auto CommandLine = (wchar_t *)(p->ImageFileName + n); output(p->ImageFileName); fputc(',', file); output(CommandLine); fputc('\n', file); } static DWORD WINAPI processThread(void *) { ProcessTrace(&trace, 1, 0, 0); return 0; } int main(int argc, char **argv) { for (auto i = argv + 1; i != argv + argc; ++i) { auto s = *i; if (*s != '-') help(); while (*s == '-') ++s; switch (*s) { case '?': case 'h': help(); case 'V': case 'v': puts("buildmon version 1"); return 0; default: printf("%s: unknown option\n", *i); return 1; } } auto BufferSize = sizeof(EVENT_TRACE_PROPERTIES) + sizeof(KERNEL_LOGGER_NAME); properties = (PEVENT_TRACE_PROPERTIES)malloc(BufferSize); ZeroMemory(properties, BufferSize); properties->EnableFlags = EVENT_TRACE_FLAG_PROCESS; properties->LogFileMode = EVENT_TRACE_REAL_TIME_MODE; properties->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES); properties->Wnode.BufferSize = BufferSize; properties->Wnode.ClientContext = 3; properties->Wnode.Flags = WNODE_FLAG_TRACED_GUID; properties->Wnode.Guid = SystemTraceControlGuid; strcpy((char *)properties + properties->LoggerNameOffset, KERNEL_LOGGER_NAME); ControlTrace(0, KERNEL_LOGGER_NAME, properties, EVENT_TRACE_CONTROL_STOP); auto status = StartTrace(&trace, KERNEL_LOGGER_NAME, properties); if (status != ERROR_SUCCESS) err("StartTrace"); EVENT_TRACE_LOGFILE log = {0}; log.EventRecordCallback = EventRecordCallback; log.LoggerName = KERNEL_LOGGER_NAME; log.ProcessTraceMode = (PROCESS_TRACE_MODE_REAL_TIME | PROCESS_TRACE_MODE_EVENT_RECORD | PROCESS_TRACE_MODE_RAW_TIMESTAMP); trace = OpenTrace(&log); file = fopen("log.csv", "wb"); CreateThread(0, 0, processThread, 0, 0, 0); puts("Press any key to exit"); getch(); end(0); }
{ "content_hash": "5678a11e97dc49a3a69461e1204279bd", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 80, "avg_line_length": 26.609375, "alnum_prop": 0.6438637698179683, "repo_name": "russellw/buildmon", "id": "62257c2f6355b97404d5b89bb0a0ee1dbb37520c", "size": "3571", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "buildmon.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "563" }, { "name": "C++", "bytes": "3571" }, { "name": "Python", "bytes": "212" } ], "symlink_target": "" }
package fi.lbd.mobile.mapobjects.events; import android.support.annotation.Nullable; import java.util.List; import fi.lbd.mobile.authorization.AuthorizedEvent; import fi.lbd.mobile.events.AbstractEvent; import fi.lbd.mobile.mapobjects.MapObject; /** * Event for OTTO-bus. Returns a set of map objects as a result from a request. * * Created by tommi on 19.10.2014. */ public class ReturnNearObjectsEvent extends AbstractEvent { private final List<MapObject> mapObjects; public ReturnNearObjectsEvent(@Nullable List<MapObject> mapObjects) { this.mapObjects = mapObjects; } public List<MapObject> getMapObjects() { return this.mapObjects; } }
{ "content_hash": "75c7698ea7363bebee736d87c69bb699", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 26.423076923076923, "alnum_prop": 0.7467248908296943, "repo_name": "tttro/projektityokurssi", "id": "0695912d50b0f6cbff2481feaed842dc82905238", "size": "687", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mobile/LBDMobileClient/app/src/main/java/fi/lbd/mobile/mapobjects/events/ReturnNearObjectsEvent.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "41078" }, { "name": "Java", "bytes": "441369" }, { "name": "JavaScript", "bytes": "153125" }, { "name": "Makefile", "bytes": "5589" }, { "name": "Python", "bytes": "91897" }, { "name": "Shell", "bytes": "5113" } ], "symlink_target": "" }
package org.lockss.util.urlconn; import java.io.*; import java.util.*; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.auth.*; import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.params.*; import org.apache.commons.httpclient.protocol.*; import org.apache.commons.httpclient.util.*; import org.apache.commons.collections4.map.*; import org.lockss.config.*; import org.lockss.util.*; /** Encapsulates Jakarta HttpClient method as a LockssUrlConnection. * Mostly simple wrapper behavior, except cross-host redirects are handled * because HttpClient doesn't. */ public class HttpClientUrlConnection extends BaseLockssUrlConnection { private static Logger log = Logger.getLogger("HttpClientUrlConnection"); /* Accept header value. Can be overridden by plugin. */ static final String PARAM_ACCEPT_HEADER = PREFIX + "acceptHeader"; static final String DEFAULT_ACCEPT_HEADER = "text/html, image/gif, image/jpeg; q=.2, */*; q=.2"; /** Charset to be used to encode/decode HTTP result headers. */ static final String PARAM_HEADER_CHARSET = PREFIX + "httpHeaderCharset"; static final String DEFAULT_HEADER_CHARSET = "ISO-8859-1"; /** Repeated response headers normally get combined on receipe into a * single header with a comma-separated value. Headers in this list do * not get that treatment - the value in the last occurrence of the * header is used. */ static final String PARAM_SINGLE_VALUED_HEADERS = PREFIX + "singleValuedHeaders"; static final List DEFAULT_SINGLE_VALUED_HEADERS = Collections.emptyList(); /* If true, the InputStream returned from getResponseInputStream() will * be wrapped in an EofBugInputStream */ static final String PARAM_USE_WRAPPER_STREAM = PREFIX + "useWrapperStream"; static final boolean DEFAULT_USE_WRAPPER_STREAM = true; /* If true, any connection on which credentials are set will preemptively * send the credentials. If false they will be sent only after receiving * 401, which currently happens on every request. */ static final String PARAM_USE_PREEMPTIVE_AUTH = PREFIX + "usePreemptiveAuth"; static final boolean DEFAULT_USE_PREEMPTIVE_AUTH = true; /** Choices for trustworthiness required of server. */ public enum ServerTrustLevel {Trusted, SelfSigned, Untrusted}; /** Determines the required trustworthiness of HTTPS server certificates. * * <dl><lh>Set to one of:</lh> * * <dt>Trusted</dt><dd>Server certificate must be signed by a known CA.</dd> * * <dt>SeflSigned</dt><dd>Server certificate must be self-signed or signed by a known CA.</dd> * * <dt>Untrusted</dt><dd>Any server certificate will be accepted.</dd> * </dl> */ static final String PARAM_SERVER_TRUST_LEVEL = PREFIX + "serverTrustLevel"; public static final ServerTrustLevel DEFAULT_SERVER_TRUST_LEVEL = ServerTrustLevel.Untrusted; /** Key used in HttpParams to communicate so_keepalive value to * LockssDefaultProtocolSocketFactory */ public static String SO_KEEPALIVE = "lockss_so_keepalive"; // Set up a flexible SSL protocol factory. It doesn't work to set the // Protocol in the HostConfiguration - HttpClient.executeMethod() // overwrites it. So we must communicate the per-host policies to a // global factory. static DispatchingSSLProtocolSocketFactory DISP_FACT = new DispatchingSSLProtocolSocketFactory(); static { // Install our http factory Protocol http_proto = new Protocol("http", LockssDefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http_proto); // Install our https factory Protocol https_proto = new Protocol("https", DISP_FACT, 443); Protocol.registerProtocol("https", https_proto); DISP_FACT.setDefaultFactory(getDefaultSocketFactory(DEFAULT_SERVER_TRUST_LEVEL)); } private static ServerTrustLevel serverTrustLevel; private static String acceptHeader = DEFAULT_ACCEPT_HEADER; private static Set<String> singleValuedHdrs = new HashSet(DEFAULT_SINGLE_VALUED_HEADERS); private static SecureProtocolSocketFactory getDefaultSocketFactory(ServerTrustLevel stl) { switch (stl) { case Trusted: return new SSLProtocolSocketFactory(); case SelfSigned: return new EasySSLProtocolSocketFactory(); case Untrusted: default: return new PermissiveSSLProtocolSocketFactory(); } } /** Called by org.lockss.config.MiscConfig */ public static void setConfig(Configuration config, Configuration oldConfig, Configuration.Differences diffs) { if (diffs.contains(PREFIX)) { acceptHeader = config.get(PARAM_ACCEPT_HEADER, DEFAULT_ACCEPT_HEADER); Set<String> set = new HashSet(); for (String s : (List<String>)config.getList(PARAM_SINGLE_VALUED_HEADERS, DEFAULT_SINGLE_VALUED_HEADERS)) { set.add(s.toLowerCase()); } singleValuedHdrs = set; HttpParams params = DefaultHttpParams.getDefaultParams(); if (diffs.contains(PARAM_COOKIE_POLICY)) { String policy = config.get(PARAM_COOKIE_POLICY, DEFAULT_COOKIE_POLICY); params.setParameter(HttpMethodParams.COOKIE_POLICY, getCookiePolicy(policy)); } if (diffs.contains(PARAM_SINGLE_COOKIE_HEADER)) { boolean val = config.getBoolean(PARAM_SINGLE_COOKIE_HEADER, DEFAULT_SINGLE_COOKIE_HEADER); params.setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, val); } if (diffs.contains(PARAM_HEADER_CHARSET)) { String val = config.get(PARAM_HEADER_CHARSET, DEFAULT_HEADER_CHARSET); params.setParameter(HttpMethodParams.HTTP_ELEMENT_CHARSET, val); } ServerTrustLevel stl = (ServerTrustLevel)config.getEnum(ServerTrustLevel.class, PARAM_SERVER_TRUST_LEVEL, DEFAULT_SERVER_TRUST_LEVEL); DISP_FACT.setDefaultFactory(getDefaultSocketFactory(stl)); } } static String getCookiePolicy(String policy) { if (Constants.COOKIE_POLICY_RFC_2109.equalsIgnoreCase(policy)) { return CookiePolicy.RFC_2109; } else if (Constants.COOKIE_POLICY_NETSCAPE.equalsIgnoreCase(policy)) { return CookiePolicy.NETSCAPE; } else if (Constants.COOKIE_POLICY_IGNORE.equalsIgnoreCase(policy)) { return CookiePolicy.IGNORE_COOKIES; } else if (Constants.COOKIE_POLICY_COMPATIBILITY.equalsIgnoreCase(policy)) { return CookiePolicy.BROWSER_COMPATIBILITY; } else { log.warning("Unknown cookie policy: " + policy + ", using BROWSER_COMPATIBILITY"); return CookiePolicy.BROWSER_COMPATIBILITY; } } private HttpClient client; private HttpMethod method; private int methodCode; private LockssUrlConnectionPool connectionPool; private int responseCode; /** Create a connection object, defaulting to GET method */ public HttpClientUrlConnection(String urlString, HttpClient client) throws IOException { this(LockssUrlConnection.METHOD_GET, urlString, client, null); } /** Create a connection object, with specified method */ public HttpClientUrlConnection(int methodCode, String urlString, HttpClient client, LockssUrlConnectionPool connectionPool) throws IOException { super(urlString); this.client = client != null ? client : new HttpClient(); this.methodCode = methodCode; method = createMethod(methodCode, urlString); this.connectionPool = connectionPool; } private HttpMethod createMethod(int methodCode, String urlString) throws IOException { String u_str = urlString; try { if(log.isDebug2()) log.debug2("in:"+ urlString + " isAscii:"+ StringUtil.isAscii(urlString)); if(!StringUtil.isAscii(urlString)) { if(log.isDebug2()) log.debug2("in:" + u_str); u_str = UrlUtil.encodeUri(urlString, Constants.ENCODING_UTF_8); if(log.isDebug2()) log.debug2("out:" + u_str); } switch (methodCode) { case LockssUrlConnection.METHOD_GET: return newLockssGetMethodImpl(u_str); case LockssUrlConnection.METHOD_PROXY: return new LockssProxyGetMethodImpl(u_str); case LockssUrlConnection.METHOD_POST: return new LockssPostMethodImpl(u_str); } throw new RuntimeException("Unknown url method: " + methodCode); } catch (IllegalArgumentException e) { // HttpMethodBase throws IllegalArgumentException on illegal URLs // Canonicalize that to Java's MalformedURLException throw newMalformedURLException(u_str, e); } catch (IllegalStateException e) { // HttpMethodBase throws IllegalArgumentException on illegal protocols // Canonicalize that to Java's MalformedURLException throw newMalformedURLException(urlString, e); } } java.net.MalformedURLException newMalformedURLException(String msg, Throwable cause) { java.net.MalformedURLException e = new java.net.MalformedURLException(msg); e.initCause(cause); return e; } /** for testing */ protected HttpClientUrlConnection(String urlString, HttpClient client, LockssGetMethod method) throws IOException { super(urlString); this.client = client; this.method = method; } protected LockssGetMethod newLockssGetMethodImpl(String urlString) { return new LockssGetMethodImpl(urlString); } public boolean isHttp() { return true; } /** Execute the request. */ public void execute() throws IOException { assertNotExecuted(); if (methodCode != LockssUrlConnection.METHOD_PROXY) { mimicSunRequestHeaders(); } HostConfiguration hostConfig = client.getHostConfiguration(); if (proxyHost != null) { hostConfig.setProxy(proxyHost, proxyPort); } else { hostConfig.setProxyHost(null); } if (localAddress != null) { hostConfig.setLocalAddress(localAddress.getInetAddr()); } else { hostConfig.setLocalAddress(null); } if (sockFact != null) { SecureProtocolSocketFactory hcSockFact = sockFact.getHttpClientSecureProtocolSocketFactory(); String host = url.getHost(); int port = url.getPort(); if (port <= 0) { port = UrlUtil.getDefaultPort(url.getProtocol().toLowerCase()); } DISP_FACT.setFactory(host, port, hcSockFact); // XXX Would like to check after connection is made that cert check // was actually done, but there's no good way to get to the socket or // SSLContect, etc. isAuthenticatedServer = sockFact.requiresServerAuth(); } isExecuted = true; responseCode = executeOnce(method); } private int executeOnce(HttpMethod method) throws IOException { try { return client.executeMethod(method); } catch (ConnectTimeoutException /*| java.net.SocketTimeoutException*/ e) { // Thrown by HttpClient if the connect timeout elapses before // socket.connect() returns. // Turn this into a non HttpClient-specific exception throw new ConnectionTimeoutException("Host did not respond", e); // XXX If socket.connect() returns an error because the underlying // socket connect times out, the behavior is platform dependent. On // Linux, java.net.ConnectException is thrown (same as for connection // refused, and distunguishable only by the exception message). On // OpenBSD, java.net.SocketException is thrown with a message like // "errno: 22, error: Invalid argument for fd: 3". In lieu of a way // to reliably determine when to turn these into a // ConnectionTimeoutException, the solution for now is to use // java-level connect timeouts that are shorter than the underlying // socket connect timeout. } catch (NoHttpResponseException e) { // Thrown by HttpClient if the server closes the connection before // sending a response. // Turn this into a non HttpClient-specific exception java.net.SocketException se = new java.net.SocketException("Connection reset by peer"); se.initCause(e); throw se; } } public boolean canProxy() { return true; } public void setRequestProperty(String key, String value) { assertNotExecuted(); method.setRequestHeader(key, value); } public void addRequestProperty(String key, String value) { assertNotExecuted(); method.addRequestHeader(key, value); } public void setHeaderCharset(String charset) { assertNotExecuted(); HttpMethodParams params = method.getParams(); params.setHttpElementCharset(charset); } public void setFollowRedirects(boolean followRedirects) { assertNotExecuted(); method.setFollowRedirects(followRedirects); } public void setCookiePolicy(String policy) { assertNotExecuted(); HttpParams params = method.getParams(); params.setParameter(HttpMethodParams.COOKIE_POLICY, getCookiePolicy(policy)); } public void setKeepAlive(boolean val) { assertNotExecuted(); HttpParams params = method.getParams(); params.setBooleanParameter(SO_KEEPALIVE, val); // method params don't current work, set in connection pool also, // though that won't affect already-open sockets connectionPool.setKeepAlive(val); } public void addCookie(String domain, String path, String name, String value) { assertNotExecuted(); HttpState state = client.getState(); Cookie cook = new Cookie(domain, name, value, path, null, false); state.addCookie(cook); } public void setCredentials(String username, String password) { assertNotExecuted(); Credentials credentials = new UsernamePasswordCredentials(username, password); HttpState state = client.getState(); state.setCredentials(AuthScope.ANY, credentials); if (CurrentConfig.getBooleanParam(PARAM_USE_PREEMPTIVE_AUTH, DEFAULT_USE_PREEMPTIVE_AUTH)) { HttpClientParams params = client.getParams(); params.setAuthenticationPreemptive(true); } } /** method for passing through the post content */ public void setRequestEntity(RequestEntity entity) { assertNotExecuted(); if(method instanceof PostMethod) { ((PostMethod) method).setRequestEntity(entity); } } HttpClient getClient() { return client; } public String getResponseHeaderFieldVal(int n) { assertExecuted(); try { return method.getResponseHeaders()[n].getValue(); } catch (ArrayIndexOutOfBoundsException e) { return null; } } public String getResponseHeaderFieldKey(int n) { assertExecuted(); try { return method.getResponseHeaders()[n].getName(); } catch (ArrayIndexOutOfBoundsException e) { return null; } } public int getResponseCode() { assertExecuted(); return responseCode; } public String getResponseMessage() { assertExecuted(); return method.getStatusText(); } public long getResponseDate() { assertExecuted(); String datestr = getResponseHeaderValue("date"); if (datestr == null) { return -1; } try { return DateUtil.parseDate(datestr).getTime(); } catch (DateParseException e) { log.error("Error parsing response Date: header: " + datestr, e); return -1; } } public long getResponseLastModified() { String datestr = getResponseHeaderValue("last-modified"); if (datestr == null) { return -1; } try { return DateUtil.parseDate(datestr).getTime(); } catch (DateParseException e) { log.error("Error parsing response last-modified: header: " + datestr, e); return -1; } } public long getResponseContentLength() { assertExecuted(); if (method instanceof LockssGetMethod) { LockssGetMethod getmeth = (LockssGetMethod)method; return getmeth.getResponseContentLength(); } throw new UnsupportedOperationException(method.getClass().toString()); } public String getResponseContentType() { return getResponseHeaderValue("Content-Type"); } public String getResponseContentEncoding() { return getResponseHeaderValue("content-encoding"); } public String getResponseHeaderValue(String name) { assertExecuted(); Header header = method.getResponseHeader(name); return (header != null) ? header.getValue() : null; } public InputStream getResponseInputStream() throws IOException { assertExecuted(); InputStream in = method.getResponseBodyAsStream(); if (in == null) { // this is a normal occurrence (e.g., with 304 response) log.debug2("Returning null input stream"); return null; } if (CurrentConfig.getBooleanParam(PARAM_USE_WRAPPER_STREAM, DEFAULT_USE_WRAPPER_STREAM)) { return new EofBugInputStream(in); } return in; } public void storeResponseHeaderInto(Properties props, String prefix) { // store all header properties (this is the only way to iterate) // first collect all values for any repeated headers. MultiValueMap<String,String> map = new MultiValueMap<String,String>(); Header[] headers = method.getResponseHeaders(); for (int ix = 0; ix < headers.length; ix++) { Header hdr = headers[ix]; String key = hdr.getName(); String value = hdr.getValue(); if (value!=null) { // only store headers with values // qualify header names to avoid conflict with our properties if (key == null) { key = "header_" + ix; } String propKey = (prefix == null) ? key : prefix + key; if (!singleValuedHdrs.isEmpty() && singleValuedHdrs.contains(key.toLowerCase())) { map.remove(propKey); } map.put(propKey, value); } } // now combine multiple values into comma-separated string for (String key : map.keySet()) { Collection<String> val = map.getCollection(key); props.setProperty(key, ((val.size() > 1) ? StringUtil.separatedString(val, ",") : CollectionUtil.getAnElement(val))); } } public String getActualUrl() { try { String path = method.getPath(); String query = method.getQueryString(); if (!StringUtil.isNullString(query)) { path = path + "?" + query; } URI uri = new URI(new URI(urlString, false), path, true); return uri.toString(); } catch(URIException e) { log.warning("getActualUrl(): ", e); return urlString; } } /** Mimic Java 1.3 HttpURLConnection default request header behavior */ private void mimicSunRequestHeaders() { if (!isHeaderSet(method.getRequestHeader("Accept"))) { setRequestProperty("Accept", acceptHeader); } if (!isHeaderSet(method.getRequestHeader("Connection"))) { setRequestProperty("Connection", "keep-alive"); } } private boolean isHeaderSet(Header hdr) { return (hdr == null) ? false : !StringUtil.isNullString(hdr.getValue()); } /** * Release resources associated with this request. */ public void release() { assertExecuted(); method.releaseConnection(); } /** * Abort the request. */ public void abort() { method.abort(); } /** Common interface for our methods makes testing more convenient */ interface LockssGetMethod extends HttpMethod { long getResponseContentLength(); } /** Same as GET method */ static class LockssGetMethodImpl extends GetMethod implements LockssGetMethod { public LockssGetMethodImpl(String url) { super(url); // Establish our retry handler // setMethodRetryHandler(getRetryHandler()); } } /** * same as the POST method */ interface LockssPostMethod extends HttpMethod { long getResponseContentLength(); } static class LockssPostMethodImpl extends PostMethod implements LockssPostMethod { public LockssPostMethodImpl(String url) { super(url); } } /** Extends GET method to not add any default request headers */ static class LockssProxyGetMethodImpl extends LockssGetMethodImpl { public LockssProxyGetMethodImpl(String url) { super(url); } protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { // Suppress this - don't want any automatic header processing when // acting as a proxy. } } /** Extension of ConnectionTimeoutException used as a wrapper for the * HttpClient-specific HttpConnection.ConnectionTimeoutException. */ public class ConnectionTimeoutException extends LockssUrlConnection.ConnectionTimeoutException { public ConnectionTimeoutException(String msg) { super(msg); } public ConnectionTimeoutException(String msg, Throwable t) { super(msg, t); } public ConnectionTimeoutException(Throwable t) { super(t.getMessage(), t); } } }
{ "content_hash": "0d352d7d6068c5e05d2649b07f77c1de", "timestamp": "", "source": "github", "line_count": 620, "max_line_length": 96, "avg_line_length": 33.91451612903226, "alnum_prop": 0.6971988395871974, "repo_name": "edina/lockss-daemon", "id": "b0a29c66f2851ad1ab19d703fa0449fef117e886", "size": "22392", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/lockss/util/urlconn/HttpClientUrlConnection.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ANTLR", "bytes": "18526" }, { "name": "Awk", "bytes": "10730" }, { "name": "Batchfile", "bytes": "77" }, { "name": "C", "bytes": "4376" }, { "name": "CSS", "bytes": "8824" }, { "name": "HTML", "bytes": "62125" }, { "name": "Java", "bytes": "28845466" }, { "name": "JavaScript", "bytes": "45452" }, { "name": "Perl", "bytes": "148040" }, { "name": "Python", "bytes": "654894" }, { "name": "Shell", "bytes": "155796" } ], "symlink_target": "" }
package com.robertozagni.algoritmi.binaryheap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Test; public class BinaryMinHeapTest { public BinaryMinHeapTest() { } @Test public void shouldCreateANewBinaryMinHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertNotNull(bmh); } @Test public void shouldCalculateLeftOfRoot() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(1, bmh.getLeftIndex(0)); } @Test public void shouldCalculateRightOfRoot() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(2, bmh.getRightIndex(0)); } /** * Answering the parent of root is not an easy answer. Possible answers are: 1. there is no parent of root => throw * exception; 2. parent of root is root => return root itself; 3. there is no parent of root => return -1 (or any * impossible index); * * I adopted solution 1 that I like as uses language constructs to handle corner cases; also the 2nd solution has some * appeal, as it turns a special case into a standard one, but I am afraid this could easily cause infinite loops; * solution 3 to me is bad. */ @Test(expected = BinaryHeapException.class) public void shouldCalculateParentOfRoot() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.getParentIndex(0); } /** * Indexes run from 0 (included) upwards, so passing a negative index should throw an exception. */ @Test(expected = BinaryHeapException.class) public void shouldCalculateLeftOfNegativeIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(12345, bmh.getLeftIndex(-1)); } @Test(expected = BinaryHeapException.class) public void shouldCalculateRightOfNegativeIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(-12345, bmh.getRightIndex(-5)); } @Test(expected = BinaryHeapException.class) public void shouldCalculateParentOfNegativeIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(-12345, bmh.getParentIndex(-7)); } @Test public void shouldCalculateLeftOfSomeValidIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(3, bmh.getLeftIndex(1)); assertEquals(5, bmh.getLeftIndex(2)); assertEquals(7, bmh.getLeftIndex(3)); assertEquals(9, bmh.getLeftIndex(4)); assertEquals(13, bmh.getLeftIndex(6)); assertEquals(21, bmh.getLeftIndex(10)); assertEquals(247, bmh.getLeftIndex(123)); } @Test public void shouldCalculateRightOfSomeValidIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(4, bmh.getRightIndex(1)); assertEquals(6, bmh.getRightIndex(2)); assertEquals(8, bmh.getRightIndex(3)); assertEquals(10, bmh.getRightIndex(4)); assertEquals(12, bmh.getRightIndex(5)); assertEquals(14, bmh.getRightIndex(6)); assertEquals(248, bmh.getRightIndex(123)); } @Test public void shouldCalculateParentOfSomeValidIndexes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(0, bmh.getParentIndex(1)); assertEquals(0, bmh.getParentIndex(2)); assertEquals(1, bmh.getParentIndex(3)); assertEquals(3, bmh.getParentIndex(8)); assertEquals(5, bmh.getParentIndex(12)); assertEquals(10, bmh.getParentIndex(21)); assertEquals(123, bmh.getParentIndex(247)); assertEquals(123, bmh.getParentIndex(248)); } @Test public void isEmptyshouldBeTrueForANewlyCreatedBinaryMinHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertTrue(bmh.isEmpty()); } @Test public void addShouldMakeHeapNotEmpty() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); assertFalse(bmh.isEmpty()); } @Test public void addShouldIncreaseNodeCount() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(99); assertEquals(1, bmh.getNumberOfNodes()); bmh.add(-9); assertEquals(2, bmh.getNumberOfNodes()); } // getMinimum @Test(expected = BinaryHeapException.class) public void getMinimumShouldFailForANewlyCreatedBinaryMinHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertEquals(0, bmh.getHead().intValue()); } @Test public void firstAddShouldBeHeapMinimum() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); assertEquals(5, bmh.getHead().intValue()); } @Test public void getMinimumShouldReturnCorrectMinimumForABinaryMinHeapWithContent() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); bmh.add(3); assertEquals(3, bmh.getHead().intValue()); } /** * Answering the data for an index out of bounds is not an easy answer. Possible answers are: 1. you are out of bounds * => throw exception; 2. I have no value for that index => return null, like accessing an existing, but empty * position; * * I adopted solution 1 that I like as uses language constructs to handle corner cases; also the 2nd solution has some * appeal, but I prefer the solution from standard Java libs. */ @Test(expected = BinaryHeapOutOfBoundsException.class) public void getDataShouldThrowExceptionForNegativeIndices() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.getData(-1); } @Test(expected = BinaryHeapOutOfBoundsException.class) public void getDataShouldThrowExceptionForBigIndices() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.getData(BinaryMinHeap.NUMERO_NODI_INIZIALI * 2); } @Test(expected = BinaryHeapOutOfBoundsException.class) public void getDataShouldThrowExceptionForEmptyHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); assertNull(bmh.getData(0)); } @Test public void getDataShouldWorkForExistingPositionInHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); assertEquals(5, bmh.getData(0).intValue()); } @Test public void needSwitchShouldBeTrueForUnorderedAndFalseForEqualOrOrdered() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 5; bmh.data[1] = 3; bmh.data[2] = 5; assertTrue(bmh.needSwitchIn(1, 0)); assertFalse(bmh.needSwitchIn(0, 1)); assertFalse(bmh.needSwitchIn(0, 2)); } @Test public void siftInShouldReverseUnorderedNodes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 5; bmh.data[1] = 3; bmh.siftIn(1); assertEquals(3, bmh.data[0].intValue()); assertEquals(5, bmh.data[1].intValue()); } @Test public void siftInShouldNotReverseOrderedNodes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 3; bmh.data[1] = 5; bmh.siftIn(1); assertEquals(3, bmh.data[0].intValue()); assertEquals(5, bmh.data[1].intValue()); } @Test public void siftInShouldNotReverseSameValueNodes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 5; bmh.data[1] = 5; bmh.siftIn(1); assertEquals(5, bmh.data[0].intValue()); assertEquals(5, bmh.data[1].intValue()); } @Test(expected = BinaryHeapException.class) public void shouldNotAddNullValue() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(null); } @Test public void addShouldLeaveUpdatedHeadValue() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); int count = 0; for (int value = (BinaryMinHeap.NUMERO_NODI_INIZIALI + 1); value > -(BinaryMinHeap.NUMERO_NODI_INIZIALI + 1); value--) { bmh.add(value); assertEquals(value, bmh.getHead().intValue()); assertEquals(++count, bmh.getNumberOfNodes()); } } @Test public void siftOutShouldReverseUnorderedNodes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 8; bmh.data[1] = 3; bmh.data[2] = 6; bmh.data[3] = 5; bmh.data[4] = 9; bmh.numberOfNodes = 5; bmh.siftOut(0); assertEquals(3, bmh.data[0].intValue()); assertEquals(5, bmh.data[1].intValue()); assertEquals(6, bmh.data[2].intValue()); assertEquals(8, bmh.data[3].intValue()); assertEquals(9, bmh.data[4].intValue()); assertEquals(5, bmh.getNumberOfNodes()); } @Test public void getChildMinShouldReturnMinimumValueOfNodes() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.data[0] = 8; bmh.data[1] = 3; bmh.data[2] = 6; bmh.data[3] = 5; bmh.data[4] = 9; bmh.numberOfNodes = 5; assertEquals(1, bmh.getSwapCandidateChildIndex(0)); assertEquals(3, bmh.getSwapCandidateChildIndex(1)); assertEquals(2, bmh.getSwapCandidateChildIndex(2)); assertEquals(3, bmh.getSwapCandidateChildIndex(3)); assertEquals(4, bmh.getSwapCandidateChildIndex(4)); assertEquals(5, bmh.getSwapCandidateChildIndex(5)); } @Test(expected = BinaryHeapException.class) public void removeHeadOnEmptyHeapShouldThrowException() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.removeHead(); } @Test public void removeHeadShouldReturnHeadOfHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); bmh.add(2); assertEquals(bmh.getHead().intValue(), bmh.removeHead().intValue()); } @Test public void removeHeadOnLastItemShouldLeaveAnEmptyHeap() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(5); assertEquals(bmh.getHead().intValue(), bmh.removeHead().intValue()); assertTrue(bmh.isEmpty()); } @Test public void removeHeadShouldReduceSizeByOne() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(15); bmh.add(23); bmh.add(7); bmh.add(99); assertEquals(7, bmh.removeHead().intValue()); assertEquals(3, bmh.getNumberOfNodes()); } @Test public void removeHeadShouldLeaveHeapConsistent() { BinaryMinHeap<Integer> bmh = new BinaryMinHeap<Integer>(Integer.class); bmh.add(15); bmh.add(15); bmh.add(14); bmh.add(99); assertEquals(14, bmh.removeHead().intValue()); assertEquals(3, bmh.getNumberOfNodes()); assertFalse(bmh.isEmpty()); assertEquals(15, bmh.removeHead().intValue()); assertEquals(2, bmh.getNumberOfNodes()); assertFalse(bmh.isEmpty()); assertEquals(15, bmh.removeHead().intValue()); assertEquals(1, bmh.getNumberOfNodes()); assertFalse(bmh.isEmpty()); assertEquals(99, bmh.removeHead().intValue()); assertEquals(0, bmh.getNumberOfNodes()); assertTrue(bmh.isEmpty()); } }
{ "content_hash": "fce5c5020e026669da3dd1c6104acc78", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 120, "avg_line_length": 32.590529247910865, "alnum_prop": 0.6846153846153846, "repo_name": "RobMcZag/Algorithms", "id": "53fc26d05556748fa3cf11b674e27b0982a4d818", "size": "11948", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/robertozagni/algoritmi/binaryheap/BinaryMinHeapTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "167982" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.stats.moment_helpers.mnc2mvsk &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" href="../_static/material.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/language_data.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.stats.moment_helpers.mvsk2mc" href="statsmodels.stats.moment_helpers.mvsk2mc.html" /> <link rel="prev" title="statsmodels.stats.moment_helpers.mnc2mc" href="statsmodels.stats.moment_helpers.mnc2mc.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.stats.moment_helpers.mnc2mvsk" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.12.0</span> <span class="md-header-nav__topic"> statsmodels.stats.moment_helpers.mnc2mvsk </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="GET" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../_static/versions.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../stats.html" class="md-tabs__link">Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">stats</span></code></a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.12.0</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../stats.html" class="md-nav__link">Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">stats</span></code></a> </li> <li class="md-nav__item"> <a href="../contingency_tables.html" class="md-nav__link">Contingency tables</a> </li> <li class="md-nav__item"> <a href="../imputation.html" class="md-nav__link">Multiple Imputation with Chained Equations</a> </li> <li class="md-nav__item"> <a href="../emplike.html" class="md-nav__link">Empirical Likelihood <code class="xref py py-mod docutils literal notranslate"><span class="pre">emplike</span></code></a> </li> <li class="md-nav__item"> <a href="../distributions.html" class="md-nav__link">Distributions</a> </li> <li class="md-nav__item"> <a href="../graphics.html" class="md-nav__link">Graphics</a> </li> <li class="md-nav__item"> <a href="../iolib.html" class="md-nav__link">Input-Output <code class="xref py py-mod docutils literal notranslate"><span class="pre">iolib</span></code></a> </li> <li class="md-nav__item"> <a href="../tools.html" class="md-nav__link">Tools</a> </li> <li class="md-nav__item"> <a href="../large_data.html" class="md-nav__link">Working with Large Data Sets</a> </li> <li class="md-nav__item"> <a href="../optimization.html" class="md-nav__link">Optimization</a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.stats.moment_helpers.mnc2mvsk.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <h1 id="generated-statsmodels-stats-moment-helpers-mnc2mvsk--page-root">statsmodels.stats.moment_helpers.mnc2mvsk<a class="headerlink" href="#generated-statsmodels-stats-moment-helpers-mnc2mvsk--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py function"> <dt id="statsmodels.stats.moment_helpers.mnc2mvsk"> <code class="sig-prename descclassname">statsmodels.stats.moment_helpers.</code><code class="sig-name descname">mnc2mvsk</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">args</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/statsmodels/stats/moment_helpers.html#mnc2mvsk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#statsmodels.stats.moment_helpers.mnc2mvsk" title="Permalink to this definition">¶</a></dt> <dd><p>convert central moments to mean, variance, skew, kurtosis</p> </dd></dl> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.stats.moment_helpers.mnc2mc.html" title="statsmodels.stats.moment_helpers.mnc2mc" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.stats.moment_helpers.mnc2mc </span> </div> </a> <a href="statsmodels.stats.moment_helpers.mvsk2mc.html" title="statsmodels.stats.moment_helpers.mvsk2mc" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.stats.moment_helpers.mvsk2mc </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Aug 27, 2020. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 3.2.1. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
{ "content_hash": "964bd702a563616122100b46bac908ca", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 999, "avg_line_length": 37.30583501006036, "alnum_prop": 0.5918235262391457, "repo_name": "statsmodels/statsmodels.github.io", "id": "5fa730b021722357b1e7dbc36844f1c78066f2d0", "size": "18545", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v0.12.0/generated/statsmodels.stats.moment_helpers.mnc2mvsk.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
import pygst import gst import time import random class AudioEngine: """The class that controls playing the media from Ampache.""" def __init__(self, ampache_conn): """To construct an AudioEngine object you need to pass it an AmpacheSession object.""" ################################## # Variables ################################## self.ampache_conn = ampache_conn self.ampache_gui = None self.repeat_songs = False self.shuffle_songs = False self.songs_list = [] self.song_num = -1 # create a playbin (plays media form an uri) self.player = gst.element_factory_make("playbin2", "player") # source = gst.element_factory_make("souphttpsrc", "source") # source.set_property('user-agent', 'Viridian 1.0 (http://viridian.daveeddy.com)') # self.player.add(source) bus = self.player.get_bus() bus.add_signal_watch() bus.enable_sync_message_emission() bus.connect("message", self.on_message) self.player.connect("about-to-finish", self.on_about_to_finish) def set_ampache_gui_hook(self, ampache_gui): """Attach the GUI to this object, so the audio_engine can alert the GUI of song changes""" self.ampache_gui = ampache_gui def play_from_list_of_songs(self, songs_list, song_num=0): """Takes a list of song_ids and position in the list and plays it. This function will use the AmpacheSession to turn song_ids into song_urls.""" if not songs_list: print "Can't play empty list" return False self.songs_list = songs_list self.song_num = song_num try: # get the song_url and play it song_url = self.ampache_conn.get_song_url( self.songs_list[self.song_num] ) self.player.set_state(gst.STATE_NULL) self.player.set_property('uri', song_url) self.player.set_state(gst.STATE_PLAYING) if self.ampache_gui != None: self.ampache_gui.audioengine_song_changed(songs_list[song_num]) # hook into GUI except: # out of songs self.stop() if self.ampache_gui != None: self.ampache_gui.audioengine_song_changed(None) # hook into GUI print "No more songs" def on_message(self, bus, message): """This function runs when the player gets a message (event). This allows the GUI to determine when it reaches the end of a song.""" t = message.type if t == gst.MESSAGE_EOS: # end of song self.stop() print "Song is over -- trying next song" self.next_track(True) elif t == gst.MESSAGE_ERROR: # error! self.stop() err, debug = message.parse_error() result = "Gstreamer Error: %s %s" % (err, debug) print result if self.ampache_gui != None: self.ampache_gui.audioengine_error_callback(result) def on_about_to_finish(self, player): #self.next_track_gapless() return def query_position(self): """Returns position in nanoseconds""" try: position, _ = self.player.query_position(gst.FORMAT_TIME) except: position = -1 #try: # duration, format = self.player.query_duration(gst.FORMAT_TIME) #except: # duration = gst.CLOCK_TIME_NONE return position def get_state(self, *args): """Returns a string that tells the current state of the player.""" state = self.player.get_state() for current_state in state: current_state = str(current_state) try: if current_state == str(gst.STATE_PLAYING): return "playing" elif current_state == str(gst.STATE_PAUSED): return "paused" elif current_state == str(gst.STATE_NULL): return "stopped" except: pass return None def set_playlist(self, l): """Sets the current playlist to list.""" self.songs_list = l def get_playlist(self, *args): """Returns the current playlist in a list of song_ids.""" return self.songs_list def set_current_song(self, song_num, *args): """Sets the current song num (doesn't affect what is currently playing).""" self.song_num = song_num def get_current_song(self, *args): """Returns the current playing songs position in the list.""" return self.song_num def get_current_song_id(self, *args): """Returns the current playing song_id or None.""" if self.song_num == -1: return None return self.songs_list[self.song_num] def set_repeat_songs(self, value, *args): # must be True or False """Set songs to repeat. Takes True or False.""" self.repeat_songs = value def get_repeat_songs(self, *args): """True if songs are set to repeat.""" return self.repeat_songs def set_shuffle_songs(self, value, *args): """Set songs to shuffle. Takes True or False.""" self.shuffle_songs = value def get_shuffle_songs(self, value, *args): """True if songs are set to shuffle.""" return self.shuffle_songs def set_volume(self, percent, *args): """Sets the volume, must be 0-100.""" if percent <= 0: volume = 0 elif percent >= 100: volume = 1 else: volume = percent / 100.0 self.player.set_property('volume', float(volume)) return True def get_volume(self, *args): """Gets the volume.""" return self.player.get_property('volume')*100 def clear_playlist(self, *args): """Clear the current playlist and stop the song.""" self.stop() self.songs_list = [] self.song_num = -1 if self.ampache_gui != None: self.ampache_gui.audioengine_song_changed(None) def seek(self, seek_time_secs): """Seek function, doesn't work on some distros.""" return self.player.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_KEY_UNIT, int(seek_time_secs) * gst.SECOND) def stop(self, *args): """Tells the player to stop.""" try: self.player.set_state(gst.STATE_NULL) except: return False return True def pause(self, *args): """Tells the player to pause.""" try: self.player.set_state(gst.STATE_PAUSED) except: return False return True def play(self, *args): """Tells the player to play.""" try: self.player.set_state(gst.STATE_PLAYING) except: return False return True def restart(self, *args): """Tells tho player to restart the song if it is playing.""" if self.get_state() == "playing": self.play_from_list_of_songs(self.songs_list, self.song_num) return True return False def change_song(self, song_num, *args): """Change song to the given song number.""" self.play_from_list_of_songs(self.songs_list, song_num) return True def remove_from_playlist(self, song_id, *args): """Remove the song_id from the playlist.""" try: song_num = self.songs_list.index(song_id) if song_num <= self.song_num: self.song_num -= 1 self.songs_list.remove(song_id) except: return False return True def insert_into_playlist(self, song_id, song_num=None): """insert the song_id into the playlist, song_num is optional.""" if song_num == None: self.songs_list.append(song_id) else: self.songs_list.insert(song_num, song_id) def prev_track(self, *args): """Tells the player to go back a song in the playlist. This function takes care of repeating songs if enabled.""" self.song_num -= 1 if self.repeat_songs: # if the user wants the album to repeat self.song_num = (self.song_num + len(self.songs_list)) % len(self.songs_list) # this is for repeating tracks else: # the user doesn't want the album to repeat if self.song_num < 0: self.song_num = 0 return False self.play_from_list_of_songs(self.songs_list, self.song_num) return True def next_track(self, auto=False): """Tells the player to go forward a song in the playlist. This function takes care of repeating songs if enabled.""" if self.shuffle_songs: new_song_num = int( random.random() * len(self.songs_list) ) - 1 if new_song_num == self.song_num: self.song_num = None else: self.song_num = new_song_num if self.song_num == None: # the user clicked prev too many times self.song_num = 0 else: self.song_num += 1 if self.repeat_songs: # if the user wants the album to repeat self.song_num = self.song_num % len(self.songs_list) else: # don't repeat if self.song_num >= len(self.songs_list): # dont' let the current position go over the playlist length if auto: self.song_num = -1 self.stop() if self.ampache_gui != None: self.ampache_gui.audioengine_song_changed(None) return True else: self.song_num = len(self.songs_list) - 1 return False self.play_from_list_of_songs(self.songs_list, self.song_num) return True ''' def next_track_gapless(self): """Tell the player to play the next song right away.""" try: if self.song_num == None: # the user clicked prev too many times self.song_num = 0 else: self.song_num += 1 if self.repeat_songs: # if the user wants the album to repeat self.song_num = self.song_num % len(self.songs_list) else: # don't repeat if self.song_num >= len(self.songs_list): ## dont' let the current position go over the playlist length self.song_num = -1 self.stop() return print "New song_num", self.song_num self.player.set_property('uri', self.ampache_conn.get_song_url(self.songs_list[self.song_num])) self.ampache_gui.audioengine_song_changed(songs_list[song_num]) except: return False return True '''
{ "content_hash": "f4891c421919bb5dbc3984c0040ea5e5", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 135, "avg_line_length": 37.19387755102041, "alnum_prop": 0.5601280292638318, "repo_name": "bahamas10/Viridian", "id": "399340ca55b186104874b58d257c0245930499d3", "size": "12518", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AmpacheTools/AudioEngine.py", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "220511" } ], "symlink_target": "" }
{% extends current_module.base_template %} {% load i18n material_form material_frontend %} {% block content %} {% block left-panel %} <div class="left-panel"> <div class="card"> <div class="card-content"> <div class="card-title">不具合・工事追加</div> <form> <div class="row input-field"> <label for="id_contact_date" class="">発生日:</label> <input type="text" name="contact_date" class="vDateField" required="" id="id_contact_date"> </div> <div class="row input-field"> <label for="id_1" class="">問い合わせ元:</label> <input type="text" name="contact_date" required="" id="id_1"> </div> <div class="row input-field"> <label for="id_parking_lot" class="active">駐車場:</label> <select id="id_parking_lot"> <option>コスモフェスタ日暮里</option> <option>アデニウム田端</option> </select> </div> <div> <input type="checkbox" class="filled-in" id="id_pos1"/><label for="id_pos1" style="margin-right:15px;">22</label> <input type="checkbox" class="filled-in" id="id_pos2"/><label for="id_pos2" style="margin-right:15px;">23</label> <input type="checkbox" class="filled-in" id="id_pos3"/><label for="id_pos3" style="margin-right:15px;">24</label> <input type="checkbox" class="filled-in" id="id_pos4"/><label for="id_pos4" style="margin-right:15px;">25</label> <input type="checkbox" class="filled-in" id="id_pos5"/><label for="id_pos5" style="margin-right:15px;">26</label> <input type="checkbox" class="filled-in" id="id_pos6"/><label for="id_pos6" style="margin-right:15px;">27</label> <input type="checkbox" class="filled-in" id="id_pos7"/><label for="id_pos7" style="margin-right:15px;">全体</label> </div> <div class="row input-field"> <input type="checkbox" class="filled-in" id="id_pos8"/><label for="id_pos8" style="margin-right:15px;">現地掲示物有り</label> </div> <div class="row input-field"> <input type="checkbox" class="filled-in" id="id_pos9"/><label for="id_pos9" style="margin-right:15px;">車両の入出庫可能</label> </div> <div class="row input-field"> <input type="checkbox" class="filled-in" id="id_pos10"/><label for="id_pos10" style="margin-right:15px;">代替駐車場の用意有り</label> </div> <div class="row input-field" style="margin-top: 30px;"> <label for="id_user" class="active">受付者:</label> <select id="id_user"> <option>楊皖軍</option> <option>admin</option> </select> </div> <div class="row input-field"> <label for="id_staff" class="active">担当者:</label> <select id="id_staff"> <option>楊皖軍</option> <option>admin</option> </select> </div> <div class="row input-field"> <textarea id="textarea1" class="materialize-textarea"></textarea> <label for="textarea1">不具合内容</label> </div> </form> </div> <div class="card-action"> <div class="right-align"> <a class="waves-effect waves-light btn white-text popup">保存</a> </div> </div> </div> </div> {% endblock left-panel %} {% block right-panel %} <div class="right-panel"> {% include 'common/user_info.html' %} </div> {% endblock right-panel %} {% endblock %} {% block footer %} <script type="text/javascript"> $(document).one("turbolinks:load", function() { ebjs.$('.vDateField').datetimepicker({ timepicker:false, format:'Y-m-d' }); }); </script> {% endblock %}
{ "content_hash": "7029696993bfd0891e3d9530dd6bde38", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 143, "avg_line_length": 47.39772727272727, "alnum_prop": 0.5005993766482858, "repo_name": "YangWanjun/areaparking", "id": "76ce85b7a8a26018c3253e6bc38e02eab673dd62", "size": "4337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/whiteboard/construction_add.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "715" }, { "name": "CSS", "bytes": "16603" }, { "name": "HTML", "bytes": "696337" }, { "name": "JavaScript", "bytes": "1412226" }, { "name": "Python", "bytes": "2820285" }, { "name": "SQLPL", "bytes": "2281" }, { "name": "Shell", "bytes": "882" } ], "symlink_target": "" }
using UnityEngine; namespace GPUTools.Physics.Scripts.Joints { public struct GPPointJoint { public int BodyId; public int MatrixId; public Vector3 Point; public float Elasticity; public GPPointJoint(int bodyId, int matrixId, Vector3 point, float elasticity) { BodyId = bodyId; Point = point; MatrixId = matrixId; Elasticity = elasticity; } public static int Size() { return sizeof(int)*2 + sizeof(float)*3 + sizeof(float); } } }
{ "content_hash": "c51defe7f639426e100dcb2d128859b3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 87, "avg_line_length": 23.44, "alnum_prop": 0.5614334470989761, "repo_name": "devgl/cg", "id": "73336e3910636cf225de3dd1fe4f5001c18781a8", "size": "588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/GPUTools/Physics/Scripts/Joints/GPPointJoint.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "184946" }, { "name": "HLSL", "bytes": "25632" }, { "name": "MAXScript", "bytes": "1316" }, { "name": "ShaderLab", "bytes": "39953" } ], "symlink_target": "" }
@class NSString; @interface XCElementSnapshot (XCUIElementAttributes) <XCUIElementAttributes> // Remaining properties @property(readonly) unsigned long long elementType; @property(readonly, getter=isEnabled) _Bool enabled; @property(readonly) struct CGRect frame; @property(readonly) long long horizontalSizeClass; @property(readonly) NSString *identifier; @property(readonly, copy) NSString *label; @property(readonly) NSString *placeholderValue; @property(readonly, getter=isSelected) _Bool selected; @property(readonly, copy) NSString *title; @property(readonly) id value; @property(readonly) long long verticalSizeClass; @end
{ "content_hash": "ccf67a0bf793c037b08292b2a7409385", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 76, "avg_line_length": 35.166666666666664, "alnum_prop": 0.8088467614533965, "repo_name": "bayareabear/bluepill", "id": "0b536a2b96f3efb60a55813068d4bca328edc465", "size": "838", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Bluepill-cli/Bluepill-cli/PrivateHeaders/XCTest/XCElementSnapshot-XCUIElementAttributes.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "3119" }, { "name": "Objective-C", "bytes": "805344" }, { "name": "Python", "bytes": "4824" }, { "name": "Shell", "bytes": "3765" }, { "name": "Swift", "bytes": "666" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "c0a26312458c838d912c7ffa684c7ba2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "388d8a01cf7b413f539c7f63a8a97e46c809e156", "size": "203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Senecio spathulatus attenuatus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "a40515246d1e1f591e1956ddec2c3856", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "dca237377ee04202e87de700dc0e13fc051582c6", "size": "188", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Meliaceae/Dysoxylum/Dysoxylum hongkongense/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef HEADER_CURL_HUGEHELP_H #define HEADER_CURL_HUGEHELP_H #include "setup.h" void hugehelp(void); #endif /* HEADER_CURL_HUGEHELP_H */
{ "content_hash": "8eeced336b1fc8639837c823f99792ef", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 35, "avg_line_length": 17.625, "alnum_prop": 0.7304964539007093, "repo_name": "Maher4Ever/libcoderwall", "id": "842836dda06c1f2afcdd272ff19ad358eef75ff6", "size": "1165", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "vendor/curl-7.25.0/src/hugehelp.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "29946" } ], "symlink_target": "" }
{% load i18n cms_admin admin_urls %} {# INFO: columns are defined in base.html options #} {% spaceless %} <li class="cms-tree-node {{ css_class }} {% if page.pk in open_nodes %} jstree-open{% elif children %} jstree-closed{% endif %} {% if page.reverse_id == 'page_types' %} cms-tree-node-pagetype{% endif %} {% if page.level == 0 %} cms-tree-node-top{% endif %} {% if cl.is_filtered %} cms-tree-node-filtered{% endif %} {% if has_add_permission %} cms-tree-node-root-allow-children{% endif %} " {% if cl.is_popup %}onclick="opener.dismissRelatedLookupPopup(window, {{ page.id }}); return false;"{% endif %} data-id="{{ page.pk }}" data-slug="{{ page.get_slug }}" data-move-permission="{{ has_move_page_permission|yesno:"true,false" }}" data-add-permission="{{ has_add_page_permission|yesno:"true,false" }}" data-colview=' <div class="cms-tree-col"> <div class="cms-tree-item-wrapper"> {% if page.is_home %} <div class="cms-tree-item cms-tree-item-icons"> <div class="cms-tree-item-inner"> <div class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans 'Home' %}{% endfilter %}"> <span class="cms-icon cms-icon-home"></span> </div> </div> </div> {% endif %} {% if page.soft_root %} <div class="cms-tree-item cms-tree-item-icons"> <div class="cms-tree-item-inner"> <div class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans 'Softroot' %}{% endfilter %}"> <a href="{% url 'admin:cms_page_advanced' page.id %}"> <span class="cms-icon cms-icon-sitemap"></span> </a> </div> </div> </div> {% endif %} {% if page.application_urls %} <div class="cms-tree-item cms-tree-item-icons"> <div class="cms-tree-item-inner"> <div class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% blocktrans with page.application_urls as apphook%}Application: {{ apphook }}{% endblocktrans %}{% endfilter %}"> <a href="{% url 'admin:cms_page_advanced' page.id %}"> <span class="cms-icon cms-icon-puzzle"></span> </a> </div> </div> </div> {% endif %} </div> </div> ' data-colpreview=' <div class="cms-tree-col"> <div class="cms-tree-item cms-tree-item-preview {# INFO: highlight active icon when in sidebar mode #} {% if page.id|slugify == request.GET.page_id|slugify %} cms-tree-preview-active{% endif %}"> <div class="cms-tree-item-inner cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans "View on site" %}{% endfilter %}"> <a class="js-cms-pagetree-page-view" href="{% url 'admin:cms_page_preview_page' page.id lang %}"{% if lang in page.languages %} target="_top"{% endif %}"> <span class="sr-only">{% filter escapejs %}{% trans "View on site" %}{% endfilter %}</span> </a> </div> </div> </div> ' {% for lang in site_languages %} data-col{{ lang|lower|cut:'-' }}=' <div class="cms-tree-col"> <div class="cms-tree-item {% if not has_publish_permission %} cms-tree-item-disabled{% endif %} cms-tree-item-lang"> <div class="cms-tree-item-inner cms-pagetree-dropdown{% if has_publish_permission %} js-cms-pagetree-dropdown{% endif %}"> {% if has_publish_permission %} <a href="{% url 'admin:cms_page_preview_page' page.id lang %}" class="cms-pagetree-dropdown-trigger js-cms-pagetree-dropdown-trigger" {# INFO: delegate click event to parent window when in sideframe #} {% if lang in page.languages %} target="_top"{% endif %}> {# INFO: renders <span class="{cls}" title="{title}"></span> #} {% tree_publish_row page lang %} </a> <div class="cms-pagetree-dropdown-menu cms-pagetree-dropdown-menu-arrow-right-top js-cms-pagetree-dropdown-menu"> <ul class="cms-pagetree-dropdown-menu-inner"> <li> <a href="{% url 'admin:cms_page_preview_page' page.id lang %}" class="js-cms-pagetree-page-view" target="_top"> <span class="cms-icon cms-icon-eye" title="{% filter escapejs %}{% blocktrans with lang|upper as language %}Preview this page in {{ language }} {% endblocktrans %}{% endfilter %}"></span> <span>{% filter escapejs %}{% trans "Preview" %}{% endfilter %}</span> </a> </li> {# hide if page is empty #} {% if lang in page.languages %} {% if page|all_ancestors_are_published:lang %} {% if page|is_dirty:lang or not page|is_published:lang %} <li> <a href="{% url 'admin:cms_page_publish_page' page.id lang %}?redirect_language={{ preview_language }}{% if request.GET.page_id %}&amp;redirect_page_id={{ request.GET.page_id }}{% endif %}" class="js-cms-tree-lang-trigger"> <span class="cms-icon cms-icon-check-o"></span> <span>{% filter escapejs %}{% trans "Publish" %}{% endfilter %}</span> </a> </li> {% endif %} {% if page|is_published:lang %} <li> <a href="{% url 'admin:cms_page_unpublish' page.id lang %}?redirect_language={{ preview_language }}{% if request.GET.page_id %}&amp;redirect_page_id={{ request.GET.page_id }}{% endif %}" class="js-cms-tree-lang-trigger"> <span class="cms-icon cms-icon-forbidden"></span> <span>{% filter escapejs %}{% trans "Unpublish" %}{% endfilter %}</span> </a> </li> {% endif %} {% endif %} {% else %} <li> <a href="{% url 'admin:cms_page_change' page.id %}?language={{ lang }}"> <span class="cms-icon cms-icon-cogs"></span> <span>{% filter escapejs %}{% trans "Configure" %}{% endfilter %}</span> </a> </li> {% endif %} </ul> </div> {% else %} <span class="cms-tree-lang-container"> {% tree_publish_row page lang %} </span> {% endif %} </div> </div> </div> ' {% endfor %} data-colmenu=' <div class="cms-tree-col"> <div class="cms-tree-item cms-tree-item-menu{% if not has_change_permission %} cms-tree-item-disabled{% endif %} js-cms-tree-item-menu"> <div class="cms-tree-item-inner"> {% if has_change_permission %} <a href="{% url 'admin:cms_page_change_innavigation' page.id %}?language={{ preview_language }}&amp;{{ page.id }}={{ page.in_navigation|yesno:"1,0" }}"> {% endif %} {% if page.in_navigation %} <div class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans "in menu" %}{% endfilter %}"> <span class="cms-icon cms-icon-check-square"></span> </div> {% else %} <div class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans "not in menu" %}{% endfilter %}"> <span class="cms-icon cms-icon-minus-square"></span> </div> {% endif %} {% if has_change_permission %} </a> {% endif %} </div> </div> </div> ' data-coloptions=' <div class="cms-tree-col cms-tree-col-padding-sm"> <div class="cms-tree-item-wrapper"> <div class="cms-tree-item cms-tree-item-button"> <div{% if has_change_permission and has_change_advanced_settings_permission %} class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans "Page settings (SHIFT click for advanced settings)" %}{% endfilter %}"{% endif %}> {% if has_change_permission or has_change_advanced_settings_permission %} <a {% if has_change_permission %}href="{% url 'admin:cms_page_change' page.id %}?language={{ preview_language }}" {% endif %} class="cms-btn cms-btn-default js-cms-tree-advanced-settings cms-icon cms-icon-pencil" {% if has_change_advanced_settings_permission %} data-url="{% url 'admin:cms_page_advanced' page.id %}" {% endif %} > {% else %} <span class="cms-btn cms-btn-default cms-btn-disabled js-cms-tree-advanced-settings cms-icon cms-icon-pencil"> {% endif %} <span class="sr-only">{% filter escapejs %}{% trans "Page settings (SHIFT click for advanced settings)" %}{% endfilter %}</span> {% if has_change_permission or has_change_advanced_settings_permission %} </a> {% endif %} </div> </div> <div class="cms-tree-item cms-tree-item-button"> <div{% if has_add_page_permission %} class="cms-hover-tooltip cms-hover-tooltip-left cms-hover-tooltip-delay" data-cms-tooltip="{% filter escapejs %}{% trans 'New sub page' %}{% endfilter %}"{% endif %}> {% if has_add_page_permission %} <a href="{% url 'admin:cms_page_add' %}?target={{ page.id }}&amp;position=last-child" class="cms-btn cms-btn-default cms-icon cms-icon-plus"> {% else %} <span class="cms-btn cms-btn-default cms-btn-disabled cms-icon cms-icon-plus"> {% endif %} <span class="sr-only">{% filter escapejs %}{% trans 'New sub page' %}{% endfilter %}</span> {% if has_add_page_permission %} </a> {% else %} </span> {% endif %} </div> </div> <div class="js-cms-pagetree-actions-dropdown cms-tree-item cms-tree-item-button cms-pagetree-dropdown js-cms-pagetree-dropdown" data-lazy-url="{% url 'admin:cms_page_actions_menu' page.id %}"> <a data-id="{{ page.pk }}" href="#" class="js-cms-pagetree-dropdown-trigger js-cms-pagetree-options cms-pagetree-dropdown-trigger cms-btn cms-btn-default cms-btn-no-border cms-icon cms-icon-menu"> <span class="sr-only">{% filter escapejs %}{% trans "Options" %}{% endfilter %}</span> </a> <div class="js-cms-pagetree-dropdown-menu cms-pagetree-dropdown-menu cms-pagetree-dropdown-menu-arrow-right-top"> <div class="js-cms-pagetree-dropdown-loader cms-pagetree-dropdown-loader"> </div> {# dummy structure #} <ul class="cms-pagetree-dropdown-menu-inner"> <li> <a class="cms-pagetree-dropdown-item-disabled" href="#" title="{% filter escapejs %}{% trans 'Copy' %}{% endfilter %}"> <span class="cms-icon cms-icon-copy"></span> <span>{% filter escapejs %}{% trans 'Copy' %}{% endfilter %}<span> </a> </li> <li class=""> <a href="#" class="cms-pagetree-dropdown-item-disabled" title="{% filter escapejs %}{% trans 'Cut' %}{% endfilter %}"> <span class="cms-icon cms-icon-scissors"></span> <span>{% filter escapejs %}{% trans 'Cut' %}{% endfilter %}<span> </a> </li> <li> <a href="#" data-id="{{ page.pk }}" class="cms-pagetree-dropdown-item-disabled"> <span class="cms-icon cms-icon-alias"></span> <span>{% filter escapejs %}{% trans "Paste" %}{% endfilter %}</span> </a> </li> <li> <a class="cms-pagetree-dropdown-item-disabled" href="#" title="{% filter escapejs %}{% trans 'Delete' %}{% endfilter %}"> <span class="cms-icon cms-icon-bin"></span> <span>{% filter escapejs %}{% trans 'Delete' %}...{% endfilter %}</span> </a> </li> <li> <a class="cms-pagetree-dropdown-item-disabled" href="#" title="{% filter escapejs %}{% trans "Advanced settings" %}{% endfilter %}"> <span class="cms-icon cms-icon-cogs"></span> <span>{% filter escapejs %}{% trans "Advanced settings" %}{% endfilter %}</span> </a> </li> {% if CMS_PERMISSION %} <li> <a href="#" class="cms-pagetree-dropdown-item-disabled"> <span class="cms-icon cms-icon-lock"></span> <span>{% filter escapejs %}{% trans "Permissions" %}{% endfilter %}</span> </a> </li> {% endif %} </ul> </div> </div> </div> </div> ' > {% language LANGUAGE_CODE %} {{ page.get_admin_tree_title }} {% endlanguage %} {# INFO render children #} {% if page.pk in open_nodes and children %} <ul> {% show_admin_menu_for_pages children %} </ul> {% endif %} </li> {% endspaceless %}
{ "content_hash": "1f4b3763e22b370c400425fd133e4115", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 271, "avg_line_length": 64.0532319391635, "alnum_prop": 0.4290632791167043, "repo_name": "bittner/django-cms", "id": "62150cdf85f11bc281f67db7956d7be23fba1e03", "size": "16846", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "cms/templates/admin/cms/page/tree/menu.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "143487" }, { "name": "HTML", "bytes": "188292" }, { "name": "JavaScript", "bytes": "1283742" }, { "name": "Python", "bytes": "2205532" }, { "name": "Shell", "bytes": "447" } ], "symlink_target": "" }
<?php defined('BASEPATH') or exit('No direct script access allowed'); /* * 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. */ /** * Description of Rx_giat * * @author Selamet Subu - Dell 5459 */ class Rx_giat extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('Rx_giat_m'); $this->load->library('form_validation'); $this->is_logged_in(); if( empty( $this->auth_role ) ) { redirect("login"); } } public function index() { show_404(); } public function simpan_json() { // only allow ajax request if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ) show_404(); // check user login $id = $this->input->post('recid'); // set validation rules $config = array( array( 'field' => 'kdgiat', 'label' => 'Kode Giat', 'rules' => 'required', 'max_length' => '50' ), array( 'field' => 'nmgiat', 'label' => 'Nama Giat', 'rules' => 'required', 'max_length' => '50' ) ); $this->form_validation->set_rules($config); $this->form_validation->set_error_delimiters('<div class="text-danger">', '</div>'); // end validation rules if ($this->form_validation->run() !== false) { // Post data $sessionid = $this->input->post('sessionid'); $userinput = $this->auth_user_id; $kdgiat = $this->input->post('kdgiat'); $nmgiat = $this->input->post('nmgiat'); // set POST data in Array $data = array( 'kdgiat' => empty_to_null($kdgiat), 'nmgiat' => empty_to_null($nmgiat) ); $result = $this->Rx_giat_m->update_by_id_and_sessionid($data, $id, $sessionid); if ($result) { $r = array('status' => '1', 'message' => 'Data tersimpan'); } else { $r = array('status' => '0', 'message' => 'Data gagal tersimpan'); } } else { $r = array('status' => '0'); foreach ($_POST as $key => $value) { $r['message'][$key] = form_error($key); } } echo json_encode($r); } public function hapus_json() { // only allow ajax request if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ) show_404(); $id = $this->input->get('id'); $result = $this->Rx_giat_m->delete_by_id($id); if ($result) { $r = array('status' => '1', 'message' => 'Data terhapus'); } else { $r = array('status' => '0', 'message' => 'Data gagal terhapus'); } echo json_encode($r); } public function admin_ajax_list() { // only allow ajax request if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ) show_404(); $this->load->model('Rx_giat_m'); $sessionid = $this->__get_curent_sessionid(); $where = array('sessionid' => $sessionid); $column_order = array( 'recid', 'kdgiat', 'nmgiat', 'error_char', 'error_remarks', 'sessionid' ); $column_search = $column_order; $order = array('recid' => 'desc'); // default order $list = $this->Rx_giat_m->get_datatables($column_order, $order, $column_search, $where); $data = array(); $no = $_POST['start']; foreach ($list as $r) { $no++; $row = array(); for ($i = 0; $i < count($column_search); $i++) { $row[] = $r[$column_search[$i]]; } $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->Rx_giat_m->count_all($where), "recordsFiltered" => $this->Rx_giat_m->count_filtered($column_order, $order, $column_search, $where), "data" => $data, ); echo json_encode($output); } public function get_data_by_id_json() { // only allow ajax request if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest' ) show_404(); $id = $this->input->get("id"); $sessionid = $this->input->get("sessionid"); $data = $this->Rx_giat_m->get_data_by_id_and_sessionid($id, $sessionid); echo json_encode($data); } function hapus_redundan(){ $sessionid = $this->__get_curent_sessionid(); $result = $this->Rx_giat_m->call_pr_upl_rka_delete_double_giat($sessionid); if( $result ){ $r = array('status' => '1', 'message' => 'Berhasil'); } else { $r = array('status' => '0', 'message' => 'Gagal'); } echo json_encode($r); } }
{ "content_hash": "c1113fbed812c98c113e23810d11eaf1", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 113, "avg_line_length": 30.983870967741936, "alnum_prop": 0.4709352767655735, "repo_name": "selametsubu/newmpo", "id": "9134a48d130805ee8279ea9b81cf4037169f0dbb", "size": "5763", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/controllers/Rx_giat.php", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "290" }, { "name": "CSS", "bytes": "2608274" }, { "name": "CoffeeScript", "bytes": "83631" }, { "name": "Go", "bytes": "7075" }, { "name": "HTML", "bytes": "38091692" }, { "name": "Java", "bytes": "102172" }, { "name": "JavaScript", "bytes": "4788599" }, { "name": "Makefile", "bytes": "133" }, { "name": "PHP", "bytes": "5786649" }, { "name": "PLpgSQL", "bytes": "1272" }, { "name": "Python", "bytes": "5844" }, { "name": "Ruby", "bytes": "161" }, { "name": "Shell", "bytes": "1934" } ], "symlink_target": "" }
<html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <link rel="icon" href="images/favicon.ico"> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <script src="js/ie-emulation-modes-warning.js"></script> <!-- GA --> <script src="analytics.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <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]--> <!-- Custom styles for this template --> <link href="css/carousel.css" rel="stylesheet"> </head> <!-- NAVBAR ================================================== --> <body> <div class="navbar-wrapper"> <div class="container"> <nav class="navbar navbar-inverse navbar-static-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">PROVA!</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="index.html">Home</a></li> <li class="active"><a href="about.html">About</a></li> <li><a href="manual.html">Manual</a></li> <li><a href="publications.html">Publications</a></li> <li><a href="people.html">People</a></li> </ul> </div> </div> </nav> </div> </div> <hr> <div class="container"> <div class="jumbotron"> <h2 id="sec-faq" class="h1" data-heading-depth="1" style="display:block">FAQ</h2> <ol class="ol loose"> <li class="li ol-li loose-li"> <p><strong class="strong-star2">How is PROVA! different?</strong><br> PROVA! implements many features to enable writing and executing an experiment on an HPC machine directly from your browser. Read the <a href="manual.html" data-linkid="reference manual">reference manual</a> to learn more. </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Does the PROVA! server store any documents?</strong><br> No, the PROVA! server just processes your requests. All data is sent over an encrypted connection and immediately removed after processing.<br> Documents are only stored locally in your browser, and on your personal storage on the host machine. Nothing is retained on the PROVA! server. </p> </li> <!-- <li class="li ol-li loose-li"> <p><strong class="strong-star2">Do I need to save my files?</strong><br> No, PROVA! continuously saves the current document in browser local storage. You can at any time close the browser or shutdown the computer and your changes are saved. PROVA! also automatically synchronizes your changes to the machine you are accessing every 30 seconds or so. </p> </li> --> <!-- <li class="li ol-li loose-li"> <p><strong class="strong-star2">Can I work concurrently with other users on a project?</strong><br> Yes, PROVA! merges concurrent changes automatically. However, currently only Github supports full sharing of files in the cloud. </p> </li> --> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Is there version control?</strong><br> Not yet. PROVA! connects to your local workspace. If you make it a github repository, then you can exploit versioning. Such a feature will be automatically provided by PROVA! in the next releases. </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Can I write my code in PROVA! instead of using vi, or any other shell editor?</strong><br> Yes! and PROVA! makes it especially easy thanks to its web interface which makes use of &nbsp;<a href="http://nodejs.org" data-linkid="nodejs">nodejs</a>. <!--to work with others through Github. -->It is fairly safe to try out PROVA! to work to your next experiment since: </p> <ul class="ul list-star compact"> <li class="li ul-li list-star-li compact-li">Using it you can always fall back to old style development/experiment run in a pinch.</li> <li class="li ul-li list-star-li compact-li">PROVA! <!--synchronizes and backs up your document to the cloud making the document available anywhere on any device.-->saves your work onto the machine you are connected to. </li> </ul> </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">What browsers are supported?</strong><br> PROVA! has been tested with Chrome version 31+, and Firefox version 27+. </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Can I run PROVA! locally?</strong><br> Yes! PROVA! is free software and runs as a command line program on any system that can run <a href="http://nodejs.org" data-linkid="nodejs">nodejs</a> (Windows, MacOSX, Linux, etc). Follow the installation instructions in the <a href="manual.html">reference manual</a>. </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Does PROVA! work if I am not connected?</strong><br> Unfortunately not, PROVA! is a “web-app” and works with an internet connection. </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">What software does PROVA! use?</strong> <ul class="ul list-dash compact"> <li class="li ul-li list-dash-li compact-li"><a href="http://nodejs.org" data-linkid="nodejs">NodeJS</a></li> <li class="li ul-li list-dash-li compact-li"><a href="http://expressjs.com" data-linkid="express">Express</a></li> <li class="li ul-li list-dash-li compact-li">PROVA! is written in shell script and <a href="https://www.python.org/" data-linkid="python">Python</a> language.</li> <li class="li ul-li list-dash-li compact-li">PROVA! is free software and available on <a href="https://bitbucket.org/hpwc/nodejs_server" data-linkid="bitbucket">bitbucket</a> under the GPLv3 license </li> </ul> </p> </li> <li class="li ol-li loose-li"> <p><strong class="strong-star2">Any useful links?</strong> <ul class="ul list-dash compact"> <li class="li ul-li list-dash-li compact-li"><a href="manual.html" data-linkid="reference manual">The PROVA! reference manual</a></li> <li class="li ul-li list-dash-li compact-li"><a href="https://github.com/dominicbosch/hpwc-workflow/issues">Report an issue</a> </li> </ul> </p> </li> </ol> </div> <!-- FOOTER --> <footer> <p class="pull-right"><a href="#">Back to top</a></p> <p>&copy; 2016 PROVA. &middot; <a href="privacy.html">Privacy</a> &middot; <a href="terms.html">Terms</a></p> </footer> </div><!-- /.container --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script> <script src="js/bootstrap.min.js"></script> <!-- Just to make our placeholder images work. Don't actually copy the next line! --> <script src="js/holder.min.js"></script> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="js/ie10-viewport-bug-workaround.js"></script> </body> </html>
{ "content_hash": "da27af0b3b9e857208a2023c85d5c380", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 196, "avg_line_length": 50.90502793296089, "alnum_prop": 0.5888937664618086, "repo_name": "prova-unibas/prova-unibas.github.io", "id": "88b6b43c2b9be409ccff800a2233ad2ede819d0b", "size": "9116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "about.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "8249" }, { "name": "HTML", "bytes": "86042" }, { "name": "JavaScript", "bytes": "3186" }, { "name": "TeX", "bytes": "3539" } ], "symlink_target": "" }
import zmarkdown from zmarkdown.inlinepatterns import Pattern PING_RE = (r'(?<![^\s])' # Check that there isn't any space before the ping r'@(?:' r'([-_\d\w]+)' # For @ping r'|' r'\[' # For @[ping long] r'([^\[\]\n]+)' # Match everything excepted [, ] and \n r'\]' r')') class PingPattern(Pattern): def __init__(self, md, ping_url): self.ping_url = ping_url Pattern.__init__(self, PING_RE, md) def handleMatch(self, m): name = m.group(2) if m.group(2) is not None else m.group(3) if name is None: # pragma: no cover return None url = self.ping_url(name) if url is None: return None dnode = zmarkdown.util.etree.Element('a') dnode.set('class', 'ping') dnode.set('href', url) dnode.text = zmarkdown.util.AtomicString('@{}'.format(name)) self.zmarkdown.metadata["ping"].add(name) return dnode class PingExtension(zmarkdown.extensions.Extension): """Adds ping extension to Markdown class.""" def __init__(self, *args, **kwargs): self.config = { "ping_url": [lambda _: None, 'Function that should return an url if it is a valid pingeable name else None']} super(PingExtension, self).__init__(*args, **kwargs) def reset(self): self.md.metadata["ping"] = set() def extendZMarkdown(self, md, md_globals): """Modifies inline patterns.""" md.inlinePatterns.add('a', PingPattern(md, self.getConfig('ping_url')), '<not_strong') self.md = md self.reset() md.registerExtension(self)
{ "content_hash": "8deb7b1964a6ccd176e69bbdec6d3ca1", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 105, "avg_line_length": 32.24528301886792, "alnum_prop": 0.5488589818607372, "repo_name": "zestedesavoir/Python-ZMarkdown", "id": "88de1e054e3e712ce319b797c07279b0737b8ef8", "size": "1709", "binary": false, "copies": "1", "ref": "refs/heads/master-zds", "path": "zmarkdown/extensions/ping.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "608664" }, { "name": "Makefile", "bytes": "943" }, { "name": "Python", "bytes": "266528" }, { "name": "Shell", "bytes": "912" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sirius2d游戏引擎API</title> <meta name="description" content="Sirius2d是一款使用JavaScript编写的HTML5开源免费游戏框架,其核心定位是开放,高效,优雅。 基于它,你可以快速轻松地构建属于自己的HTML5移动游戏。" /> <meta name="keywords" content="Sirius2d,游戏引擎,HTML5,2d,物理引擎,网页游戏,开源框架,手机游戏,开发文档,开发手册" /> <meta name="keyword" content="Sirius2d,游戏引擎,HTML5,2d,物理引擎,网页游戏,开源框架,手机游戏,开发文档,开发手册" /> <meta property="og:title" content=""/> <meta property="og:type" content="website"/> <meta property="og:image" content=""/> <meta property="og:site_name" content=""/> <meta property="og:url" content=""/> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <script src="scripts/jquery.min.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="styles/jaguar.css"> <script> var config = {"monospaceLinks":true,"cleverLinks":true,"default":{"outputSourceFiles":true},"applicationName":"Sirius2d","disqus":"sirius2d","googleAnalytics":"","openGraph":{"title":"","type":"website","image":"","site_name":"","url":""},"meta":{"title":"Sirius2d游戏引擎API","description":"Sirius2d是一款使用JavaScript编写的HTML5开源免费游戏框架,其核心定位是开放,高效,优雅。 基于它,你可以快速轻松地构建属于自己的HTML5移动游戏。","keyword":"Sirius2d,游戏引擎,HTML5,2d,物理引擎,网页游戏,开源框架,手机游戏,开发文档,开发手册"}}; </script> </head> <body> <div id="wrap" class="clearfix"> <div class="navigation"> <h3 class="applicationName"><a href="index.html">Sirius2d</a></h3> <div class="search"> <input id="search" type="text" class="form-control input-sm" placeholder="搜索一下"> </div> <ul class="list"> <li class="item" data-name="ss2d"> <span class="title"> <a href="ss2d.html">ss2d</a> <span class="static">static</span> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.canvas"><a href="ss2d.html#canvas">canvas</a></li> <li data-name="ss2d.context"><a href="ss2d.html#context">context</a></li> <li data-name="ss2d.debug"><a href="ss2d.html#debug">debug</a></li> <li data-name="ss2d.global"><a href="ss2d.html#global">global</a></li> <li data-name="ss2d.LoadQueue"><a href="ss2d.html#LoadQueue">LoadQueue</a></li> <li data-name="ss2d.nocache"><a href="ss2d.html#nocache">nocache</a></li> <li data-name="ss2d.QuadData"><a href="ss2d.html#QuadData">QuadData</a></li> <li data-name="ss2d.QuadMatrixUtil"><a href="ss2d.html#QuadMatrixUtil">QuadMatrixUtil</a></li> <li data-name="ss2d.QuadResource"><a href="ss2d.html#QuadResource">QuadResource</a></li> <li data-name="ss2d.sound"><a href="ss2d.html#sound">sound</a></li> <li data-name="ss2d.Timer"><a href="ss2d.html#Timer">Timer</a></li> <li data-name="ss2d.useMouseMove"><a href="ss2d.html#useMouseMove">useMouseMove</a></li> <li data-name="ss2d.version"><a href="ss2d.html#version">version</a></li> <li data-name="ss2d.xmlUnderline"><a href="ss2d.html#xmlUnderline">xmlUnderline</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.$"><a href="ss2d.html#$">$</a></li> <li data-name="ss2d.$new"><a href="ss2d.html#$new">$new</a></li> <li data-name="ss2d.cancelFullScreen"><a href="ss2d.html#cancelFullScreen">cancelFullScreen</a></li> <li data-name="ss2d.copy"><a href="ss2d.html#copy">copy</a></li> <li data-name="ss2d.degreeToRadian"><a href="ss2d.html#degreeToRadian">degreeToRadian</a></li> <li data-name="ss2d.getElementOffset"><a href="ss2d.html#getElementOffset">getElementOffset</a></li> <li data-name="ss2d.getScope"><a href="ss2d.html#getScope">getScope</a></li> <li data-name="ss2d.hitPoint"><a href="ss2d.html#hitPoint">hitPoint</a></li> <li data-name="ss2d.hitTrianglePoint"><a href="ss2d.html#hitTrianglePoint">hitTrianglePoint</a></li> <li data-name="ss2d.isFullScreen"><a href="ss2d.html#isFullScreen">isFullScreen</a></li> <li data-name="ss2d.isPower_2"><a href="ss2d.html#isPower_2">isPower_2</a></li> <li data-name="ss2d.ksort"><a href="ss2d.html#ksort">ksort</a></li> <li data-name="ss2d.log"><a href="ss2d.html#log">log</a></li> <li data-name="ss2d.merge"><a href="ss2d.html#merge">merge</a></li> <li data-name="ss2d.orthographicViewportMatrix"><a href="ss2d.html#orthographicViewportMatrix">orthographicViewportMatrix</a></li> <li data-name="ss2d.proxy"><a href="ss2d.html#proxy">proxy</a></li> <li data-name="ss2d.radianToDegree"><a href="ss2d.html#radianToDegree">radianToDegree</a></li> <li data-name="ss2d.requestFullScreen"><a href="ss2d.html#requestFullScreen">requestFullScreen</a></li> <li data-name="ss2d.supportsFullScreen"><a href="ss2d.html#supportsFullScreen">supportsFullScreen</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Blend"> <span class="title"> <a href="ss2d.Blend.html">ss2d.Blend</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Broadcast"> <span class="title"> <a href="ss2d.Broadcast.html">ss2d.Broadcast</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ColorTransform"> <span class="title"> <a href="ss2d.ColorTransform.html">ss2d.ColorTransform</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ColorTransform#alphaMultiplier"><a href="ss2d.ColorTransform.html#alphaMultiplier">alphaMultiplier</a></li> <li data-name="ss2d.ColorTransform#alphaOffset"><a href="ss2d.ColorTransform.html#alphaOffset">alphaOffset</a></li> <li data-name="ss2d.ColorTransform#blueMultiplier"><a href="ss2d.ColorTransform.html#blueMultiplier">blueMultiplier</a></li> <li data-name="ss2d.ColorTransform#blueOffset"><a href="ss2d.ColorTransform.html#blueOffset">blueOffset</a></li> <li data-name="ss2d.ColorTransform#greenMultiplier"><a href="ss2d.ColorTransform.html#greenMultiplier">greenMultiplier</a></li> <li data-name="ss2d.ColorTransform#greenOffset"><a href="ss2d.ColorTransform.html#greenOffset">greenOffset</a></li> <li data-name="ss2d.ColorTransform#redMultiplier"><a href="ss2d.ColorTransform.html#redMultiplier">redMultiplier</a></li> <li data-name="ss2d.ColorTransform#redOffset"><a href="ss2d.ColorTransform.html#redOffset">redOffset</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.DisplayObject"> <span class="title"> <a href="ss2d.DisplayObject.html">ss2d.DisplayObject</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.DisplayObject#GPU"><a href="ss2d.DisplayObject.html#GPU">GPU</a></li> <li data-name="ss2d.DisplayObject#GPUX"><a href="ss2d.DisplayObject.html#GPUX">GPUX</a></li> <li data-name="ss2d.DisplayObject#GPUY"><a href="ss2d.DisplayObject.html#GPUY">GPUY</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.DisplayObject#getA"><a href="ss2d.DisplayObject.html#getA">getA</a></li> <li data-name="ss2d.DisplayObject#getAlpha"><a href="ss2d.DisplayObject.html#getAlpha">getAlpha</a></li> <li data-name="ss2d.DisplayObject#getB"><a href="ss2d.DisplayObject.html#getB">getB</a></li> <li data-name="ss2d.DisplayObject#getCenter"><a href="ss2d.DisplayObject.html#getCenter">getCenter</a></li> <li data-name="ss2d.DisplayObject#getColor"><a href="ss2d.DisplayObject.html#getColor">getColor</a></li> <li data-name="ss2d.DisplayObject#getForceCenter"><a href="ss2d.DisplayObject.html#getForceCenter">getForceCenter</a></li> <li data-name="ss2d.DisplayObject#getG"><a href="ss2d.DisplayObject.html#getG">getG</a></li> <li data-name="ss2d.DisplayObject#getHeight"><a href="ss2d.DisplayObject.html#getHeight">getHeight</a></li> <li data-name="ss2d.DisplayObject#getIsRedraw"><a href="ss2d.DisplayObject.html#getIsRedraw">getIsRedraw</a></li> <li data-name="ss2d.DisplayObject#getMouseEnabled"><a href="ss2d.DisplayObject.html#getMouseEnabled">getMouseEnabled</a></li> <li data-name="ss2d.DisplayObject#getParent"><a href="ss2d.DisplayObject.html#getParent">getParent</a></li> <li data-name="ss2d.DisplayObject#getPivotX"><a href="ss2d.DisplayObject.html#getPivotX">getPivotX</a></li> <li data-name="ss2d.DisplayObject#getPivotY"><a href="ss2d.DisplayObject.html#getPivotY">getPivotY</a></li> <li data-name="ss2d.DisplayObject#getR"><a href="ss2d.DisplayObject.html#getR">getR</a></li> <li data-name="ss2d.DisplayObject#getRotation"><a href="ss2d.DisplayObject.html#getRotation">getRotation</a></li> <li data-name="ss2d.DisplayObject#getScaleX"><a href="ss2d.DisplayObject.html#getScaleX">getScaleX</a></li> <li data-name="ss2d.DisplayObject#getScaleY"><a href="ss2d.DisplayObject.html#getScaleY">getScaleY</a></li> <li data-name="ss2d.DisplayObject#getSkewX"><a href="ss2d.DisplayObject.html#getSkewX">getSkewX</a></li> <li data-name="ss2d.DisplayObject#getSkewY"><a href="ss2d.DisplayObject.html#getSkewY">getSkewY</a></li> <li data-name="ss2d.DisplayObject#getUserData"><a href="ss2d.DisplayObject.html#getUserData">getUserData</a></li> <li data-name="ss2d.DisplayObject#getVisible"><a href="ss2d.DisplayObject.html#getVisible">getVisible</a></li> <li data-name="ss2d.DisplayObject#getWidth"><a href="ss2d.DisplayObject.html#getWidth">getWidth</a></li> <li data-name="ss2d.DisplayObject#getX"><a href="ss2d.DisplayObject.html#getX">getX</a></li> <li data-name="ss2d.DisplayObject#getY"><a href="ss2d.DisplayObject.html#getY">getY</a></li> <li data-name="ss2d.DisplayObject#hitTestObject"><a href="ss2d.DisplayObject.html#hitTestObject">hitTestObject</a></li> <li data-name="ss2d.DisplayObject#hitTestPoint"><a href="ss2d.DisplayObject.html#hitTestPoint">hitTestPoint</a></li> <li data-name="ss2d.DisplayObject#hitTestRoundness"><a href="ss2d.DisplayObject.html#hitTestRoundness">hitTestRoundness</a></li> <li data-name="ss2d.DisplayObject#setA"><a href="ss2d.DisplayObject.html#setA">setA</a></li> <li data-name="ss2d.DisplayObject#setAlpha"><a href="ss2d.DisplayObject.html#setAlpha">setAlpha</a></li> <li data-name="ss2d.DisplayObject#setB"><a href="ss2d.DisplayObject.html#setB">setB</a></li> <li data-name="ss2d.DisplayObject#setCenter"><a href="ss2d.DisplayObject.html#setCenter">setCenter</a></li> <li data-name="ss2d.DisplayObject#setColor"><a href="ss2d.DisplayObject.html#setColor">setColor</a></li> <li data-name="ss2d.DisplayObject#setForceCenter"><a href="ss2d.DisplayObject.html#setForceCenter">setForceCenter</a></li> <li data-name="ss2d.DisplayObject#setG"><a href="ss2d.DisplayObject.html#setG">setG</a></li> <li data-name="ss2d.DisplayObject#setHeight"><a href="ss2d.DisplayObject.html#setHeight">setHeight</a></li> <li data-name="ss2d.DisplayObject#setIsRedraw"><a href="ss2d.DisplayObject.html#setIsRedraw">setIsRedraw</a></li> <li data-name="ss2d.DisplayObject#setMouseEnabled"><a href="ss2d.DisplayObject.html#setMouseEnabled">setMouseEnabled</a></li> <li data-name="ss2d.DisplayObject#setParent"><a href="ss2d.DisplayObject.html#setParent">setParent</a></li> <li data-name="ss2d.DisplayObject#setPivotX"><a href="ss2d.DisplayObject.html#setPivotX">setPivotX</a></li> <li data-name="ss2d.DisplayObject#setPivotY"><a href="ss2d.DisplayObject.html#setPivotY">setPivotY</a></li> <li data-name="ss2d.DisplayObject#setR"><a href="ss2d.DisplayObject.html#setR">setR</a></li> <li data-name="ss2d.DisplayObject#setRotation"><a href="ss2d.DisplayObject.html#setRotation">setRotation</a></li> <li data-name="ss2d.DisplayObject#setScaleX"><a href="ss2d.DisplayObject.html#setScaleX">setScaleX</a></li> <li data-name="ss2d.DisplayObject#setScaleY"><a href="ss2d.DisplayObject.html#setScaleY">setScaleY</a></li> <li data-name="ss2d.DisplayObject#setSkewX"><a href="ss2d.DisplayObject.html#setSkewX">setSkewX</a></li> <li data-name="ss2d.DisplayObject#setSkewY"><a href="ss2d.DisplayObject.html#setSkewY">setSkewY</a></li> <li data-name="ss2d.DisplayObject#setUserData"><a href="ss2d.DisplayObject.html#setUserData">setUserData</a></li> <li data-name="ss2d.DisplayObject#setVisible"><a href="ss2d.DisplayObject.html#setVisible">setVisible</a></li> <li data-name="ss2d.DisplayObject#setWidth"><a href="ss2d.DisplayObject.html#setWidth">setWidth</a></li> <li data-name="ss2d.DisplayObject#setX"><a href="ss2d.DisplayObject.html#setX">setX</a></li> <li data-name="ss2d.DisplayObject#setY"><a href="ss2d.DisplayObject.html#setY">setY</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.EventDispatcher"> <span class="title"> <a href="ss2d.EventDispatcher.html">ss2d.EventDispatcher</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.EventDispatcher#addEventListener"><a href="ss2d.EventDispatcher.html#addEventListener">addEventListener</a></li> <li data-name="ss2d.EventDispatcher#dispatchEvent"><a href="ss2d.EventDispatcher.html#dispatchEvent">dispatchEvent</a></li> <li data-name="ss2d.EventDispatcher#hasEventListener"><a href="ss2d.EventDispatcher.html#hasEventListener">hasEventListener</a></li> <li data-name="ss2d.EventDispatcher#on"><a href="ss2d.EventDispatcher.html#on">on</a></li> <li data-name="ss2d.EventDispatcher#removeAllEventListeners"><a href="ss2d.EventDispatcher.html#removeAllEventListeners">removeAllEventListeners</a></li> <li data-name="ss2d.EventDispatcher#removeEventListener"><a href="ss2d.EventDispatcher.html#removeEventListener">removeEventListener</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.FrameBuffer"> <span class="title"> <a href="ss2d.FrameBuffer.html">ss2d.FrameBuffer</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.FrameBuffer#addChild"><a href="ss2d.FrameBuffer.html#addChild">addChild</a></li> <li data-name="ss2d.FrameBuffer#getFrameBuff"><a href="ss2d.FrameBuffer.html#getFrameBuff">getFrameBuff</a></li> <li data-name="ss2d.FrameBuffer#isClear"><a href="ss2d.FrameBuffer.html#isClear">isClear</a></li> <li data-name="ss2d.FrameBuffer#removeChild"><a href="ss2d.FrameBuffer.html#removeChild">removeChild</a></li> <li data-name="ss2d.FrameBuffer#setDisplay"><a href="ss2d.FrameBuffer.html#setDisplay">setDisplay</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.FrameFunction"> <span class="title"> <a href="ss2d.FrameFunction.html">ss2d.FrameFunction</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.FrameFunction#callback"><a href="ss2d.FrameFunction.html#callback">callback</a></li> <li data-name="ss2d.FrameFunction#frame"><a href="ss2d.FrameFunction.html#frame">frame</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Group"> <span class="title"> <a href="ss2d.Group.html">ss2d.Group</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Group#addChild"><a href="ss2d.Group.html#addChild">addChild</a></li> <li data-name="ss2d.Group#clearParentGroup"><a href="ss2d.Group.html#clearParentGroup">clearParentGroup</a></li> <li data-name="ss2d.Group#containsGroup"><a href="ss2d.Group.html#containsGroup">containsGroup</a></li> <li data-name="ss2d.Group#dispose"><a href="ss2d.Group.html#dispose">dispose</a></li> <li data-name="ss2d.Group#getRotation"><a href="ss2d.Group.html#getRotation">getRotation</a></li> <li data-name="ss2d.Group#getScaleX"><a href="ss2d.Group.html#getScaleX">getScaleX</a></li> <li data-name="ss2d.Group#getScaleY"><a href="ss2d.Group.html#getScaleY">getScaleY</a></li> <li data-name="ss2d.Group#getSkewX"><a href="ss2d.Group.html#getSkewX">getSkewX</a></li> <li data-name="ss2d.Group#getSkewY"><a href="ss2d.Group.html#getSkewY">getSkewY</a></li> <li data-name="ss2d.Group#getX"><a href="ss2d.Group.html#getX">getX</a></li> <li data-name="ss2d.Group#getY"><a href="ss2d.Group.html#getY">getY</a></li> <li data-name="ss2d.Group#removeChild"><a href="ss2d.Group.html#removeChild">removeChild</a></li> <li data-name="ss2d.Group#setParentGroup"><a href="ss2d.Group.html#setParentGroup">setParentGroup</a></li> <li data-name="ss2d.Group#setRotation"><a href="ss2d.Group.html#setRotation">setRotation</a></li> <li data-name="ss2d.Group#setScaleX"><a href="ss2d.Group.html#setScaleX">setScaleX</a></li> <li data-name="ss2d.Group#setScaleY"><a href="ss2d.Group.html#setScaleY">setScaleY</a></li> <li data-name="ss2d.Group#setSkewX"><a href="ss2d.Group.html#setSkewX">setSkewX</a></li> <li data-name="ss2d.Group#setSkewY"><a href="ss2d.Group.html#setSkewY">setSkewY</a></li> <li data-name="ss2d.Group#setX"><a href="ss2d.Group.html#setX">setX</a></li> <li data-name="ss2d.Group#setY"><a href="ss2d.Group.html#setY">setY</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Matrix2D"> <span class="title"> <a href="ss2d.Matrix2D.html">ss2d.Matrix2D</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Matrix2D#rawData"><a href="ss2d.Matrix2D.html#rawData">rawData</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Matrix2D#add1x3"><a href="ss2d.Matrix2D.html#add1x3">add1x3</a></li> <li data-name="ss2d.Matrix2D#add1x32"><a href="ss2d.Matrix2D.html#add1x32">add1x32</a></li> <li data-name="ss2d.Matrix2D#add3x3"><a href="ss2d.Matrix2D.html#add3x3">add3x3</a></li> <li data-name="ss2d.Matrix2D#add3x32"><a href="ss2d.Matrix2D.html#add3x32">add3x32</a></li> <li data-name="ss2d.Matrix2D#appendRotation"><a href="ss2d.Matrix2D.html#appendRotation">appendRotation</a></li> <li data-name="ss2d.Matrix2D#appendTranslation"><a href="ss2d.Matrix2D.html#appendTranslation">appendTranslation</a></li> <li data-name="ss2d.Matrix2D#identity"><a href="ss2d.Matrix2D.html#identity">identity</a></li> <li data-name="ss2d.Matrix2D#upDateMatrix"><a href="ss2d.Matrix2D.html#upDateMatrix">upDateMatrix</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Matrix3D"> <span class="title"> <a href="ss2d.Matrix3D.html">ss2d.Matrix3D</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Matrix3D#rawData"><a href="ss2d.Matrix3D.html#rawData">rawData</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Matrix3D#add1x4"><a href="ss2d.Matrix3D.html#add1x4">add1x4</a></li> <li data-name="ss2d.Matrix3D#add4x4"><a href="ss2d.Matrix3D.html#add4x4">add4x4</a></li> <li data-name="ss2d.Matrix3D#appendRotation"><a href="ss2d.Matrix3D.html#appendRotation">appendRotation</a></li> <li data-name="ss2d.Matrix3D#appendTranslation"><a href="ss2d.Matrix3D.html#appendTranslation">appendTranslation</a></li> <li data-name="ss2d.Matrix3D#identity"><a href="ss2d.Matrix3D.html#identity">identity</a></li> <li data-name="ss2d.Matrix3D#upDateMatrix"><a href="ss2d.Matrix3D.html#upDateMatrix">upDateMatrix</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Message"> <span class="title"> <a href="ss2d.Message.html">ss2d.Message</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Message#type"><a href="ss2d.Message.html#type">type</a></li> <li data-name="ss2d.Message#userData"><a href="ss2d.Message.html#userData">userData</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.MouseEvent"> <span class="title"> <a href="ss2d.MouseEvent.html">ss2d.MouseEvent</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.MouseEvent#stageX"><a href="ss2d.MouseEvent.html#stageX">stageX</a></li> <li data-name="ss2d.MouseEvent#stageY"><a href="ss2d.MouseEvent.html#stageY">stageY</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.MovieClip"> <span class="title"> <a href="ss2d.MovieClip.html">ss2d.MovieClip</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.MovieClip#absCentre"><a href="ss2d.MovieClip.html#absCentre">absCentre</a></li> <li data-name="ss2d.MovieClip#addFrameScript"><a href="ss2d.MovieClip.html#addFrameScript">addFrameScript</a></li> <li data-name="ss2d.MovieClip#dispose"><a href="ss2d.MovieClip.html#dispose">dispose</a></li> <li data-name="ss2d.MovieClip#frameDelay"><a href="ss2d.MovieClip.html#frameDelay">frameDelay</a></li> <li data-name="ss2d.MovieClip#getA"><a href="ss2d.MovieClip.html#getA">getA</a></li> <li data-name="ss2d.MovieClip#getAlpha"><a href="ss2d.MovieClip.html#getAlpha">getAlpha</a></li> <li data-name="ss2d.MovieClip#getB"><a href="ss2d.MovieClip.html#getB">getB</a></li> <li data-name="ss2d.MovieClip#getCenter"><a href="ss2d.MovieClip.html#getCenter">getCenter</a></li> <li data-name="ss2d.MovieClip#getColor"><a href="ss2d.MovieClip.html#getColor">getColor</a></li> <li data-name="ss2d.MovieClip#getCurrentFrame"><a href="ss2d.MovieClip.html#getCurrentFrame">getCurrentFrame</a></li> <li data-name="ss2d.MovieClip#getForceCenter"><a href="ss2d.MovieClip.html#getForceCenter">getForceCenter</a></li> <li data-name="ss2d.MovieClip#getG"><a href="ss2d.MovieClip.html#getG">getG</a></li> <li data-name="ss2d.MovieClip#getHeight"><a href="ss2d.MovieClip.html#getHeight">getHeight</a></li> <li data-name="ss2d.MovieClip#getIsRedraw"><a href="ss2d.MovieClip.html#getIsRedraw">getIsRedraw</a></li> <li data-name="ss2d.MovieClip#getMouseEnabled"><a href="ss2d.MovieClip.html#getMouseEnabled">getMouseEnabled</a></li> <li data-name="ss2d.MovieClip#getParent"><a href="ss2d.MovieClip.html#getParent">getParent</a></li> <li data-name="ss2d.MovieClip#getR"><a href="ss2d.MovieClip.html#getR">getR</a></li> <li data-name="ss2d.MovieClip#getRotation"><a href="ss2d.MovieClip.html#getRotation">getRotation</a></li> <li data-name="ss2d.MovieClip#getScaleX"><a href="ss2d.MovieClip.html#getScaleX">getScaleX</a></li> <li data-name="ss2d.MovieClip#getScaleY"><a href="ss2d.MovieClip.html#getScaleY">getScaleY</a></li> <li data-name="ss2d.MovieClip#getSkewX"><a href="ss2d.MovieClip.html#getSkewX">getSkewX</a></li> <li data-name="ss2d.MovieClip#getSkewY"><a href="ss2d.MovieClip.html#getSkewY">getSkewY</a></li> <li data-name="ss2d.MovieClip#getTextureID"><a href="ss2d.MovieClip.html#getTextureID">getTextureID</a></li> <li data-name="ss2d.MovieClip#getTileHeightOffset"><a href="ss2d.MovieClip.html#getTileHeightOffset">getTileHeightOffset</a></li> <li data-name="ss2d.MovieClip#getTileWidthOffset"><a href="ss2d.MovieClip.html#getTileWidthOffset">getTileWidthOffset</a></li> <li data-name="ss2d.MovieClip#getTileXOffset"><a href="ss2d.MovieClip.html#getTileXOffset">getTileXOffset</a></li> <li data-name="ss2d.MovieClip#getTileYOffset"><a href="ss2d.MovieClip.html#getTileYOffset">getTileYOffset</a></li> <li data-name="ss2d.MovieClip#getTotalFrame"><a href="ss2d.MovieClip.html#getTotalFrame">getTotalFrame</a></li> <li data-name="ss2d.MovieClip#getTransform"><a href="ss2d.MovieClip.html#getTransform">getTransform</a></li> <li data-name="ss2d.MovieClip#getUserData"><a href="ss2d.MovieClip.html#getUserData">getUserData</a></li> <li data-name="ss2d.MovieClip#getVisible"><a href="ss2d.MovieClip.html#getVisible">getVisible</a></li> <li data-name="ss2d.MovieClip#getWidth"><a href="ss2d.MovieClip.html#getWidth">getWidth</a></li> <li data-name="ss2d.MovieClip#getX"><a href="ss2d.MovieClip.html#getX">getX</a></li> <li data-name="ss2d.MovieClip#getY"><a href="ss2d.MovieClip.html#getY">getY</a></li> <li data-name="ss2d.MovieClip#gotoAndPlay"><a href="ss2d.MovieClip.html#gotoAndPlay">gotoAndPlay</a></li> <li data-name="ss2d.MovieClip#gotoAndStop"><a href="ss2d.MovieClip.html#gotoAndStop">gotoAndStop</a></li> <li data-name="ss2d.MovieClip#hitTestObject"><a href="ss2d.MovieClip.html#hitTestObject">hitTestObject</a></li> <li data-name="ss2d.MovieClip#hitTestPoint"><a href="ss2d.MovieClip.html#hitTestPoint">hitTestPoint</a></li> <li data-name="ss2d.MovieClip#hitTestRoundness"><a href="ss2d.MovieClip.html#hitTestRoundness">hitTestRoundness</a></li> <li data-name="ss2d.MovieClip#loop"><a href="ss2d.MovieClip.html#loop">loop</a></li> <li data-name="ss2d.MovieClip#paint"><a href="ss2d.MovieClip.html#paint">paint</a></li> <li data-name="ss2d.MovieClip#play"><a href="ss2d.MovieClip.html#play">play</a></li> <li data-name="ss2d.MovieClip#queryName"><a href="ss2d.MovieClip.html#queryName">queryName</a></li> <li data-name="ss2d.MovieClip#removeAllFrameScript"><a href="ss2d.MovieClip.html#removeAllFrameScript">removeAllFrameScript</a></li> <li data-name="ss2d.MovieClip#removeFrameScript"><a href="ss2d.MovieClip.html#removeFrameScript">removeFrameScript</a></li> <li data-name="ss2d.MovieClip#rollbackAnimation"><a href="ss2d.MovieClip.html#rollbackAnimation">rollbackAnimation</a></li> <li data-name="ss2d.MovieClip#setA"><a href="ss2d.MovieClip.html#setA">setA</a></li> <li data-name="ss2d.MovieClip#setAlpha"><a href="ss2d.MovieClip.html#setAlpha">setAlpha</a></li> <li data-name="ss2d.MovieClip#setAnimationSpeed"><a href="ss2d.MovieClip.html#setAnimationSpeed">setAnimationSpeed</a></li> <li data-name="ss2d.MovieClip#setB"><a href="ss2d.MovieClip.html#setB">setB</a></li> <li data-name="ss2d.MovieClip#setCenter"><a href="ss2d.MovieClip.html#setCenter">setCenter</a></li> <li data-name="ss2d.MovieClip#setColor"><a href="ss2d.MovieClip.html#setColor">setColor</a></li> <li data-name="ss2d.MovieClip#setForceCenter"><a href="ss2d.MovieClip.html#setForceCenter">setForceCenter</a></li> <li data-name="ss2d.MovieClip#setG"><a href="ss2d.MovieClip.html#setG">setG</a></li> <li data-name="ss2d.MovieClip#setHeight"><a href="ss2d.MovieClip.html#setHeight">setHeight</a></li> <li data-name="ss2d.MovieClip#setIsRedraw"><a href="ss2d.MovieClip.html#setIsRedraw">setIsRedraw</a></li> <li data-name="ss2d.MovieClip#setMouseEnabled"><a href="ss2d.MovieClip.html#setMouseEnabled">setMouseEnabled</a></li> <li data-name="ss2d.MovieClip#setParent"><a href="ss2d.MovieClip.html#setParent">setParent</a></li> <li data-name="ss2d.MovieClip#setR"><a href="ss2d.MovieClip.html#setR">setR</a></li> <li data-name="ss2d.MovieClip#setRotation"><a href="ss2d.MovieClip.html#setRotation">setRotation</a></li> <li data-name="ss2d.MovieClip#setScaleX"><a href="ss2d.MovieClip.html#setScaleX">setScaleX</a></li> <li data-name="ss2d.MovieClip#setScaleY"><a href="ss2d.MovieClip.html#setScaleY">setScaleY</a></li> <li data-name="ss2d.MovieClip#setSkewX"><a href="ss2d.MovieClip.html#setSkewX">setSkewX</a></li> <li data-name="ss2d.MovieClip#setSkewY"><a href="ss2d.MovieClip.html#setSkewY">setSkewY</a></li> <li data-name="ss2d.MovieClip#setTextureID"><a href="ss2d.MovieClip.html#setTextureID">setTextureID</a></li> <li data-name="ss2d.MovieClip#setTileHeightOffset"><a href="ss2d.MovieClip.html#setTileHeightOffset">setTileHeightOffset</a></li> <li data-name="ss2d.MovieClip#setTileId"><a href="ss2d.MovieClip.html#setTileId">setTileId</a></li> <li data-name="ss2d.MovieClip#setTileName"><a href="ss2d.MovieClip.html#setTileName">setTileName</a></li> <li data-name="ss2d.MovieClip#setTileWidthOffset"><a href="ss2d.MovieClip.html#setTileWidthOffset">setTileWidthOffset</a></li> <li data-name="ss2d.MovieClip#setTileXOffset"><a href="ss2d.MovieClip.html#setTileXOffset">setTileXOffset</a></li> <li data-name="ss2d.MovieClip#setTileYOffset"><a href="ss2d.MovieClip.html#setTileYOffset">setTileYOffset</a></li> <li data-name="ss2d.MovieClip#setTransform"><a href="ss2d.MovieClip.html#setTransform">setTransform</a></li> <li data-name="ss2d.MovieClip#setUserData"><a href="ss2d.MovieClip.html#setUserData">setUserData</a></li> <li data-name="ss2d.MovieClip#setVertexColour"><a href="ss2d.MovieClip.html#setVertexColour">setVertexColour</a></li> <li data-name="ss2d.MovieClip#setVisible"><a href="ss2d.MovieClip.html#setVisible">setVisible</a></li> <li data-name="ss2d.MovieClip#setWidth"><a href="ss2d.MovieClip.html#setWidth">setWidth</a></li> <li data-name="ss2d.MovieClip#setX"><a href="ss2d.MovieClip.html#setX">setX</a></li> <li data-name="ss2d.MovieClip#setY"><a href="ss2d.MovieClip.html#setY">setY</a></li> <li data-name="ss2d.MovieClip#stop"><a href="ss2d.MovieClip.html#stop">stop</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ParticleEmittersCPU"> <span class="title"> <a href="ss2d.ParticleEmittersCPU.html">ss2d.ParticleEmittersCPU</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ParticleEmittersCPU#sendParticle"><a href="ss2d.ParticleEmittersCPU.html#sendParticle">sendParticle</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ParticleStyle"> <span class="title"> <a href="ss2d.ParticleStyle.html">ss2d.ParticleStyle</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ParticleStyle#a"><a href="ss2d.ParticleStyle.html#a">a</a></li> <li data-name="ss2d.ParticleStyle#addA"><a href="ss2d.ParticleStyle.html#addA">addA</a></li> <li data-name="ss2d.ParticleStyle#addB"><a href="ss2d.ParticleStyle.html#addB">addB</a></li> <li data-name="ss2d.ParticleStyle#addG"><a href="ss2d.ParticleStyle.html#addG">addG</a></li> <li data-name="ss2d.ParticleStyle#addR"><a href="ss2d.ParticleStyle.html#addR">addR</a></li> <li data-name="ss2d.ParticleStyle#alphaValue"><a href="ss2d.ParticleStyle.html#alphaValue">alphaValue</a></li> <li data-name="ss2d.ParticleStyle#angleValue"><a href="ss2d.ParticleStyle.html#angleValue">angleValue</a></li> <li data-name="ss2d.ParticleStyle#b"><a href="ss2d.ParticleStyle.html#b">b</a></li> <li data-name="ss2d.ParticleStyle#g"><a href="ss2d.ParticleStyle.html#g">g</a></li> <li data-name="ss2d.ParticleStyle#gotoFrame"><a href="ss2d.ParticleStyle.html#gotoFrame">gotoFrame</a></li> <li data-name="ss2d.ParticleStyle#loop"><a href="ss2d.ParticleStyle.html#loop">loop</a></li> <li data-name="ss2d.ParticleStyle#r"><a href="ss2d.ParticleStyle.html#r">r</a></li> <li data-name="ss2d.ParticleStyle#rotationRandom"><a href="ss2d.ParticleStyle.html#rotationRandom">rotationRandom</a></li> <li data-name="ss2d.ParticleStyle#rotationValue"><a href="ss2d.ParticleStyle.html#rotationValue">rotationValue</a></li> <li data-name="ss2d.ParticleStyle#scaleX"><a href="ss2d.ParticleStyle.html#scaleX">scaleX</a></li> <li data-name="ss2d.ParticleStyle#scaleXValue"><a href="ss2d.ParticleStyle.html#scaleXValue">scaleXValue</a></li> <li data-name="ss2d.ParticleStyle#scaleY"><a href="ss2d.ParticleStyle.html#scaleY">scaleY</a></li> <li data-name="ss2d.ParticleStyle#scaleYValue"><a href="ss2d.ParticleStyle.html#scaleYValue">scaleYValue</a></li> <li data-name="ss2d.ParticleStyle#scopeY"><a href="ss2d.ParticleStyle.html#scopeY">scopeY</a></li> <li data-name="ss2d.ParticleStyle#speedValue"><a href="ss2d.ParticleStyle.html#speedValue">speedValue</a></li> <li data-name="ss2d.ParticleStyle#tileName"><a href="ss2d.ParticleStyle.html#tileName">tileName</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Point"> <span class="title"> <a href="ss2d.Point.html">ss2d.Point</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Point.distance"><a href="ss2d.Point.html#distance">distance</a></li> <li data-name="ss2d.Point.interpolate"><a href="ss2d.Point.html#interpolate">interpolate</a></li> <li data-name="ss2d.Point.polar"><a href="ss2d.Point.html#polar">polar</a></li> <li data-name="ss2d.Point#add"><a href="ss2d.Point.html#add">add</a></li> <li data-name="ss2d.Point#clone"><a href="ss2d.Point.html#clone">clone</a></li> <li data-name="ss2d.Point#equals"><a href="ss2d.Point.html#equals">equals</a></li> <li data-name="ss2d.Point#initialize"><a href="ss2d.Point.html#initialize">initialize</a></li> <li data-name="ss2d.Point#normalize"><a href="ss2d.Point.html#normalize">normalize</a></li> <li data-name="ss2d.Point#offset"><a href="ss2d.Point.html#offset">offset</a></li> <li data-name="ss2d.Point#subtract"><a href="ss2d.Point.html#subtract">subtract</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Quad"> <span class="title"> <a href="ss2d.Quad.html">ss2d.Quad</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Quad#isAnimationMatrix"><a href="ss2d.Quad.html#isAnimationMatrix">isAnimationMatrix</a></li> <li data-name="ss2d.Quad#isVertexColour"><a href="ss2d.Quad.html#isVertexColour">isVertexColour</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Quad#absCentre"><a href="ss2d.Quad.html#absCentre">absCentre</a></li> <li data-name="ss2d.Quad#addFrameScript"><a href="ss2d.Quad.html#addFrameScript">addFrameScript</a></li> <li data-name="ss2d.Quad#dispose"><a href="ss2d.Quad.html#dispose">dispose</a></li> <li data-name="ss2d.Quad#frameDelay"><a href="ss2d.Quad.html#frameDelay">frameDelay</a></li> <li data-name="ss2d.Quad#getCenter"><a href="ss2d.Quad.html#getCenter">getCenter</a></li> <li data-name="ss2d.Quad#getCurrentFrame"><a href="ss2d.Quad.html#getCurrentFrame">getCurrentFrame</a></li> <li data-name="ss2d.Quad#getHeight"><a href="ss2d.Quad.html#getHeight">getHeight</a></li> <li data-name="ss2d.Quad#getIndexVertex"><a href="ss2d.Quad.html#getIndexVertex">getIndexVertex</a></li> <li data-name="ss2d.Quad#getScene"><a href="ss2d.Quad.html#getScene">getScene</a></li> <li data-name="ss2d.Quad#getTextureID"><a href="ss2d.Quad.html#getTextureID">getTextureID</a></li> <li data-name="ss2d.Quad#getTileHeightOffset"><a href="ss2d.Quad.html#getTileHeightOffset">getTileHeightOffset</a></li> <li data-name="ss2d.Quad#getTileWidthOffset"><a href="ss2d.Quad.html#getTileWidthOffset">getTileWidthOffset</a></li> <li data-name="ss2d.Quad#getTileXOffset"><a href="ss2d.Quad.html#getTileXOffset">getTileXOffset</a></li> <li data-name="ss2d.Quad#getTileYOffset"><a href="ss2d.Quad.html#getTileYOffset">getTileYOffset</a></li> <li data-name="ss2d.Quad#getTotalFrame"><a href="ss2d.Quad.html#getTotalFrame">getTotalFrame</a></li> <li data-name="ss2d.Quad#getTransform"><a href="ss2d.Quad.html#getTransform">getTransform</a></li> <li data-name="ss2d.Quad#getVertex"><a href="ss2d.Quad.html#getVertex">getVertex</a></li> <li data-name="ss2d.Quad#getWidth"><a href="ss2d.Quad.html#getWidth">getWidth</a></li> <li data-name="ss2d.Quad#gotoAndPlay"><a href="ss2d.Quad.html#gotoAndPlay">gotoAndPlay</a></li> <li data-name="ss2d.Quad#gotoAndStop"><a href="ss2d.Quad.html#gotoAndStop">gotoAndStop</a></li> <li data-name="ss2d.Quad#loop"><a href="ss2d.Quad.html#loop">loop</a></li> <li data-name="ss2d.Quad#play"><a href="ss2d.Quad.html#play">play</a></li> <li data-name="ss2d.Quad#removeAllFrameScript"><a href="ss2d.Quad.html#removeAllFrameScript">removeAllFrameScript</a></li> <li data-name="ss2d.Quad#removeFrameScript"><a href="ss2d.Quad.html#removeFrameScript">removeFrameScript</a></li> <li data-name="ss2d.Quad#rollbackAnimation"><a href="ss2d.Quad.html#rollbackAnimation">rollbackAnimation</a></li> <li data-name="ss2d.Quad#setAnimationSpeed"><a href="ss2d.Quad.html#setAnimationSpeed">setAnimationSpeed</a></li> <li data-name="ss2d.Quad#setCenter"><a href="ss2d.Quad.html#setCenter">setCenter</a></li> <li data-name="ss2d.Quad#setHeight"><a href="ss2d.Quad.html#setHeight">setHeight</a></li> <li data-name="ss2d.Quad#setID"><a href="ss2d.Quad.html#setID">setID</a></li> <li data-name="ss2d.Quad#setIndexVertex"><a href="ss2d.Quad.html#setIndexVertex">setIndexVertex</a></li> <li data-name="ss2d.Quad#setScene"><a href="ss2d.Quad.html#setScene">setScene</a></li> <li data-name="ss2d.Quad#setTextureID"><a href="ss2d.Quad.html#setTextureID">setTextureID</a></li> <li data-name="ss2d.Quad#setTileHeightOffset"><a href="ss2d.Quad.html#setTileHeightOffset">setTileHeightOffset</a></li> <li data-name="ss2d.Quad#setTileId"><a href="ss2d.Quad.html#setTileId">setTileId</a></li> <li data-name="ss2d.Quad#setTileName"><a href="ss2d.Quad.html#setTileName">setTileName</a></li> <li data-name="ss2d.Quad#setTileWidthOffset"><a href="ss2d.Quad.html#setTileWidthOffset">setTileWidthOffset</a></li> <li data-name="ss2d.Quad#setTileXOffset"><a href="ss2d.Quad.html#setTileXOffset">setTileXOffset</a></li> <li data-name="ss2d.Quad#setTileYOffset"><a href="ss2d.Quad.html#setTileYOffset">setTileYOffset</a></li> <li data-name="ss2d.Quad#setTransform"><a href="ss2d.Quad.html#setTransform">setTransform</a></li> <li data-name="ss2d.Quad#setVertexColour"><a href="ss2d.Quad.html#setVertexColour">setVertexColour</a></li> <li data-name="ss2d.Quad#setWidth"><a href="ss2d.Quad.html#setWidth">setWidth</a></li> <li data-name="ss2d.Quad#stop"><a href="ss2d.Quad.html#stop">stop</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Rectangle"> <span class="title"> <a href="ss2d.Rectangle.html">ss2d.Rectangle</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Rectangle#height"><a href="ss2d.Rectangle.html#height">height</a></li> <li data-name="ss2d.Rectangle#width"><a href="ss2d.Rectangle.html#width">width</a></li> <li data-name="ss2d.Rectangle#x"><a href="ss2d.Rectangle.html#x">x</a></li> <li data-name="ss2d.Rectangle#y"><a href="ss2d.Rectangle.html#y">y</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Rectangle#clone"><a href="ss2d.Rectangle.html#clone">clone</a></li> <li data-name="ss2d.Rectangle#contains"><a href="ss2d.Rectangle.html#contains">contains</a></li> <li data-name="ss2d.Rectangle#containsPoint"><a href="ss2d.Rectangle.html#containsPoint">containsPoint</a></li> <li data-name="ss2d.Rectangle#containsRect"><a href="ss2d.Rectangle.html#containsRect">containsRect</a></li> <li data-name="ss2d.Rectangle#equals"><a href="ss2d.Rectangle.html#equals">equals</a></li> <li data-name="ss2d.Rectangle#inflate"><a href="ss2d.Rectangle.html#inflate">inflate</a></li> <li data-name="ss2d.Rectangle#inflatePoint"><a href="ss2d.Rectangle.html#inflatePoint">inflatePoint</a></li> <li data-name="ss2d.Rectangle#intersection"><a href="ss2d.Rectangle.html#intersection">intersection</a></li> <li data-name="ss2d.Rectangle#intersects"><a href="ss2d.Rectangle.html#intersects">intersects</a></li> <li data-name="ss2d.Rectangle#isEmpty"><a href="ss2d.Rectangle.html#isEmpty">isEmpty</a></li> <li data-name="ss2d.Rectangle#offset"><a href="ss2d.Rectangle.html#offset">offset</a></li> <li data-name="ss2d.Rectangle#offsetPoint"><a href="ss2d.Rectangle.html#offsetPoint">offsetPoint</a></li> <li data-name="ss2d.Rectangle#setEmpty"><a href="ss2d.Rectangle.html#setEmpty">setEmpty</a></li> <li data-name="ss2d.Rectangle#union"><a href="ss2d.Rectangle.html#union">union</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Scene"> <span class="title"> <a href="ss2d.Scene.html">ss2d.Scene</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Scene#glScissorHeight"><a href="ss2d.Scene.html#glScissorHeight">glScissorHeight</a></li> <li data-name="ss2d.Scene#glScissorWidth"><a href="ss2d.Scene.html#glScissorWidth">glScissorWidth</a></li> <li data-name="ss2d.Scene#glScissorX"><a href="ss2d.Scene.html#glScissorX">glScissorX</a></li> <li data-name="ss2d.Scene#glScissorY"><a href="ss2d.Scene.html#glScissorY">glScissorY</a></li> <li data-name="ss2d.Scene#stage"><a href="ss2d.Scene.html#stage">stage</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Scene#applyQuad"><a href="ss2d.Scene.html#applyQuad">applyQuad</a></li> <li data-name="ss2d.Scene#blend"><a href="ss2d.Scene.html#blend">blend</a></li> <li data-name="ss2d.Scene#dispose"><a href="ss2d.Scene.html#dispose">dispose</a></li> <li data-name="ss2d.Scene#getMouseEnabled"><a href="ss2d.Scene.html#getMouseEnabled">getMouseEnabled</a></li> <li data-name="ss2d.Scene#getShader"><a href="ss2d.Scene.html#getShader">getShader</a></li> <li data-name="ss2d.Scene#getTexture"><a href="ss2d.Scene.html#getTexture">getTexture</a></li> <li data-name="ss2d.Scene#hideQuad"><a href="ss2d.Scene.html#hideQuad">hideQuad</a></li> <li data-name="ss2d.Scene#hitTestPoint"><a href="ss2d.Scene.html#hitTestPoint">hitTestPoint</a></li> <li data-name="ss2d.Scene#paint"><a href="ss2d.Scene.html#paint">paint</a></li> <li data-name="ss2d.Scene#setMouseEnabled"><a href="ss2d.Scene.html#setMouseEnabled">setMouseEnabled</a></li> <li data-name="ss2d.Scene#setShader"><a href="ss2d.Scene.html#setShader">setShader</a></li> <li data-name="ss2d.Scene#setTexture"><a href="ss2d.Scene.html#setTexture">setTexture</a></li> <li data-name="ss2d.Scene#showQuad"><a href="ss2d.Scene.html#showQuad">showQuad</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderAbstract"> <span class="title"> <a href="ss2d.ShaderAbstract.html">ss2d.ShaderAbstract</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderAdvanced"> <span class="title"> <a href="ss2d.ShaderAdvanced.html">ss2d.ShaderAdvanced</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderBasis"> <span class="title"> <a href="ss2d.ShaderBasis.html">ss2d.ShaderBasis</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderBlur"> <span class="title"> <a href="ss2d.ShaderBlur.html">ss2d.ShaderBlur</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ShaderBlur#blurX"><a href="ss2d.ShaderBlur.html#blurX">blurX</a></li> <li data-name="ss2d.ShaderBlur#blurY"><a href="ss2d.ShaderBlur.html#blurY">blurY</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderFigure"> <span class="title"> <a href="ss2d.ShaderFigure.html">ss2d.ShaderFigure</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderFlame"> <span class="title"> <a href="ss2d.ShaderFlame.html">ss2d.ShaderFlame</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderFractal"> <span class="title"> <a href="ss2d.ShaderFractal.html">ss2d.ShaderFractal</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderGlass"> <span class="title"> <a href="ss2d.ShaderGlass.html">ss2d.ShaderGlass</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ShaderGlass#frequency"><a href="ss2d.ShaderGlass.html#frequency">frequency</a></li> <li data-name="ss2d.ShaderGlass#noisy"><a href="ss2d.ShaderGlass.html#noisy">noisy</a></li> <li data-name="ss2d.ShaderGlass#resolution"><a href="ss2d.ShaderGlass.html#resolution">resolution</a></li> <li data-name="ss2d.ShaderGlass#speed"><a href="ss2d.ShaderGlass.html#speed">speed</a></li> <li data-name="ss2d.ShaderGlass#timer"><a href="ss2d.ShaderGlass.html#timer">timer</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderGLSL"> <span class="title"> <a href="ss2d.ShaderGLSL.html">ss2d.ShaderGLSL</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderGray"> <span class="title"> <a href="ss2d.ShaderGray.html">ss2d.ShaderGray</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderHdr"> <span class="title"> <a href="ss2d.ShaderHdr.html">ss2d.ShaderHdr</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ShaderHdr#mLuminance"><a href="ss2d.ShaderHdr.html#mLuminance">mLuminance</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderHdr#initialize"><a href="ss2d.ShaderHdr.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderHeartbeat"> <span class="title"> <a href="ss2d.ShaderHeartbeat.html">ss2d.ShaderHeartbeat</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderHeartbeat#initialize"><a href="ss2d.ShaderHeartbeat.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderJoint"> <span class="title"> <a href="ss2d.ShaderJoint.html">ss2d.ShaderJoint</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderLaser"> <span class="title"> <a href="ss2d.ShaderLaser.html">ss2d.ShaderLaser</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderLaser#initialize"><a href="ss2d.ShaderLaser.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderLight"> <span class="title"> <a href="ss2d.ShaderLight.html">ss2d.ShaderLight</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ShaderLight#lightScale"><a href="ss2d.ShaderLight.html#lightScale">lightScale</a></li> <li data-name="ss2d.ShaderLight#lightX"><a href="ss2d.ShaderLight.html#lightX">lightX</a></li> <li data-name="ss2d.ShaderLight#lightY"><a href="ss2d.ShaderLight.html#lightY">lightY</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderLight#initialize"><a href="ss2d.ShaderLight.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderMosaic"> <span class="title"> <a href="ss2d.ShaderMosaic.html">ss2d.ShaderMosaic</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.ShaderMosaic#noisy"><a href="ss2d.ShaderMosaic.html#noisy">noisy</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderMosaic#initialize"><a href="ss2d.ShaderMosaic.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderNet"> <span class="title"> <a href="ss2d.ShaderNet.html">ss2d.ShaderNet</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderNet#initialize"><a href="ss2d.ShaderNet.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderQuick"> <span class="title"> <a href="ss2d.ShaderQuick.html">ss2d.ShaderQuick</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderQuick#initialize"><a href="ss2d.ShaderQuick.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.ShaderRelief"> <span class="title"> <a href="ss2d.ShaderRelief.html">ss2d.ShaderRelief</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.ShaderRelief#initialize"><a href="ss2d.ShaderRelief.html#initialize">initialize</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.SoundControl"> <span class="title"> <a href="ss2d.SoundControl.html">ss2d.SoundControl</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.SoundControl#isPlaying"><a href="ss2d.SoundControl.html#isPlaying">isPlaying</a></li> <li data-name="ss2d.SoundControl#originalVolume"><a href="ss2d.SoundControl.html#originalVolume">originalVolume</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.SoundControl#dispose"><a href="ss2d.SoundControl.html#dispose">dispose</a></li> <li data-name="ss2d.SoundControl#getVolume"><a href="ss2d.SoundControl.html#getVolume">getVolume</a></li> <li data-name="ss2d.SoundControl#mute"><a href="ss2d.SoundControl.html#mute">mute</a></li> <li data-name="ss2d.SoundControl#onCancel"><a href="ss2d.SoundControl.html#onCancel">onCancel</a></li> <li data-name="ss2d.SoundControl#onComplete"><a href="ss2d.SoundControl.html#onComplete">onComplete</a></li> <li data-name="ss2d.SoundControl#onError"><a href="ss2d.SoundControl.html#onError">onError</a></li> <li data-name="ss2d.SoundControl#onMute"><a href="ss2d.SoundControl.html#onMute">onMute</a></li> <li data-name="ss2d.SoundControl#onPause"><a href="ss2d.SoundControl.html#onPause">onPause</a></li> <li data-name="ss2d.SoundControl#onPlay"><a href="ss2d.SoundControl.html#onPlay">onPlay</a></li> <li data-name="ss2d.SoundControl#onStop"><a href="ss2d.SoundControl.html#onStop">onStop</a></li> <li data-name="ss2d.SoundControl#onUnMute"><a href="ss2d.SoundControl.html#onUnMute">onUnMute</a></li> <li data-name="ss2d.SoundControl#pause"><a href="ss2d.SoundControl.html#pause">pause</a></li> <li data-name="ss2d.SoundControl#play"><a href="ss2d.SoundControl.html#play">play</a></li> <li data-name="ss2d.SoundControl#setVolume"><a href="ss2d.SoundControl.html#setVolume">setVolume</a></li> <li data-name="ss2d.SoundControl#stop"><a href="ss2d.SoundControl.html#stop">stop</a></li> <li data-name="ss2d.SoundControl#toggleMute"><a href="ss2d.SoundControl.html#toggleMute">toggleMute</a></li> <li data-name="ss2d.SoundControl#togglePlay"><a href="ss2d.SoundControl.html#togglePlay">togglePlay</a></li> <li data-name="ss2d.SoundControl#unmute"><a href="ss2d.SoundControl.html#unmute">unmute</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.SoundItem"> <span class="title"> <a href="ss2d.SoundItem.html">ss2d.SoundItem</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.SoundItem#delay"><a href="ss2d.SoundItem.html#delay">delay</a></li> <li data-name="ss2d.SoundItem#lastPosition"><a href="ss2d.SoundItem.html#lastPosition">lastPosition</a></li> <li data-name="ss2d.SoundItem#loops"><a href="ss2d.SoundItem.html#loops">loops</a></li> <li data-name="ss2d.SoundItem#sound"><a href="ss2d.SoundItem.html#sound">sound</a></li> <li data-name="ss2d.SoundItem#url"><a href="ss2d.SoundItem.html#url">url</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.SoundItem#cancel"><a href="ss2d.SoundItem.html#cancel">cancel</a></li> <li data-name="ss2d.SoundItem#clone"><a href="ss2d.SoundItem.html#clone">clone</a></li> <li data-name="ss2d.SoundItem#dispose"><a href="ss2d.SoundItem.html#dispose">dispose</a></li> <li data-name="ss2d.SoundItem#getLength"><a href="ss2d.SoundItem.html#getLength">getLength</a></li> <li data-name="ss2d.SoundItem#getPosition"><a href="ss2d.SoundItem.html#getPosition">getPosition</a></li> <li data-name="ss2d.SoundItem#getPositionPercent"><a href="ss2d.SoundItem.html#getPositionPercent">getPositionPercent</a></li> <li data-name="ss2d.SoundItem#getVolume"><a href="ss2d.SoundItem.html#getVolume">getVolume</a></li> <li data-name="ss2d.SoundItem#load"><a href="ss2d.SoundItem.html#load">load</a></li> <li data-name="ss2d.SoundItem#onLoad"><a href="ss2d.SoundItem.html#onLoad">onLoad</a></li> <li data-name="ss2d.SoundItem#pause"><a href="ss2d.SoundItem.html#pause">pause</a></li> <li data-name="ss2d.SoundItem#play"><a href="ss2d.SoundItem.html#play">play</a></li> <li data-name="ss2d.SoundItem#setPosition"><a href="ss2d.SoundItem.html#setPosition">setPosition</a></li> <li data-name="ss2d.SoundItem#setPositionPercent"><a href="ss2d.SoundItem.html#setPositionPercent">setPositionPercent</a></li> <li data-name="ss2d.SoundItem#setVolume"><a href="ss2d.SoundItem.html#setVolume">setVolume</a></li> <li data-name="ss2d.SoundItem#stop"><a href="ss2d.SoundItem.html#stop">stop</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.SoundManager"> <span class="title"> <a href="ss2d.SoundManager.html">ss2d.SoundManager</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.SoundManager#add"><a href="ss2d.SoundManager.html#add">add</a></li> <li data-name="ss2d.SoundManager#dispose"><a href="ss2d.SoundManager.html#dispose">dispose</a></li> <li data-name="ss2d.SoundManager#group"><a href="ss2d.SoundManager.html#group">group</a></li> <li data-name="ss2d.SoundManager#item"><a href="ss2d.SoundManager.html#item">item</a></li> <li data-name="ss2d.SoundManager#length"><a href="ss2d.SoundManager.html#length">length</a></li> <li data-name="ss2d.SoundManager#match"><a href="ss2d.SoundManager.html#match">match</a></li> <li data-name="ss2d.SoundManager#pause"><a href="ss2d.SoundManager.html#pause">pause</a></li> <li data-name="ss2d.SoundManager#play"><a href="ss2d.SoundManager.html#play">play</a></li> <li data-name="ss2d.SoundManager#remove"><a href="ss2d.SoundManager.html#remove">remove</a></li> <li data-name="ss2d.SoundManager#stop"><a href="ss2d.SoundManager.html#stop">stop</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Sprite"> <span class="title"> <a href="ss2d.Sprite.html">ss2d.Sprite</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Sprite#addChild"><a href="ss2d.Sprite.html#addChild">addChild</a></li> <li data-name="ss2d.Sprite#dispose"><a href="ss2d.Sprite.html#dispose">dispose</a></li> <li data-name="ss2d.Sprite#getHeight"><a href="ss2d.Sprite.html#getHeight">getHeight</a></li> <li data-name="ss2d.Sprite#getMouseEnabled"><a href="ss2d.Sprite.html#getMouseEnabled">getMouseEnabled</a></li> <li data-name="ss2d.Sprite#getParent"><a href="ss2d.Sprite.html#getParent">getParent</a></li> <li data-name="ss2d.Sprite#getRotation"><a href="ss2d.Sprite.html#getRotation">getRotation</a></li> <li data-name="ss2d.Sprite#getScaleX"><a href="ss2d.Sprite.html#getScaleX">getScaleX</a></li> <li data-name="ss2d.Sprite#getScaleY"><a href="ss2d.Sprite.html#getScaleY">getScaleY</a></li> <li data-name="ss2d.Sprite#getSkewX"><a href="ss2d.Sprite.html#getSkewX">getSkewX</a></li> <li data-name="ss2d.Sprite#getSkewY"><a href="ss2d.Sprite.html#getSkewY">getSkewY</a></li> <li data-name="ss2d.Sprite#getUserData"><a href="ss2d.Sprite.html#getUserData">getUserData</a></li> <li data-name="ss2d.Sprite#getVisible"><a href="ss2d.Sprite.html#getVisible">getVisible</a></li> <li data-name="ss2d.Sprite#getWidth"><a href="ss2d.Sprite.html#getWidth">getWidth</a></li> <li data-name="ss2d.Sprite#getX"><a href="ss2d.Sprite.html#getX">getX</a></li> <li data-name="ss2d.Sprite#getY"><a href="ss2d.Sprite.html#getY">getY</a></li> <li data-name="ss2d.Sprite#paint"><a href="ss2d.Sprite.html#paint">paint</a></li> <li data-name="ss2d.Sprite#removeChild"><a href="ss2d.Sprite.html#removeChild">removeChild</a></li> <li data-name="ss2d.Sprite#setHeight"><a href="ss2d.Sprite.html#setHeight">setHeight</a></li> <li data-name="ss2d.Sprite#setMouseEnabled"><a href="ss2d.Sprite.html#setMouseEnabled">setMouseEnabled</a></li> <li data-name="ss2d.Sprite#setParent"><a href="ss2d.Sprite.html#setParent">setParent</a></li> <li data-name="ss2d.Sprite#setRotation"><a href="ss2d.Sprite.html#setRotation">setRotation</a></li> <li data-name="ss2d.Sprite#setScaleX"><a href="ss2d.Sprite.html#setScaleX">setScaleX</a></li> <li data-name="ss2d.Sprite#setScaleY"><a href="ss2d.Sprite.html#setScaleY">setScaleY</a></li> <li data-name="ss2d.Sprite#setSkewX"><a href="ss2d.Sprite.html#setSkewX">setSkewX</a></li> <li data-name="ss2d.Sprite#setSkewY"><a href="ss2d.Sprite.html#setSkewY">setSkewY</a></li> <li data-name="ss2d.Sprite#setUserData"><a href="ss2d.Sprite.html#setUserData">setUserData</a></li> <li data-name="ss2d.Sprite#setVisible"><a href="ss2d.Sprite.html#setVisible">setVisible</a></li> <li data-name="ss2d.Sprite#setWidth"><a href="ss2d.Sprite.html#setWidth">setWidth</a></li> <li data-name="ss2d.Sprite#setX"><a href="ss2d.Sprite.html#setX">setX</a></li> <li data-name="ss2d.Sprite#setY"><a href="ss2d.Sprite.html#setY">setY</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Stage2D"> <span class="title"> <a href="ss2d.Stage2D.html">ss2d.Stage2D</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Stage2D.a"><a href="ss2d.Stage2D.html#a">a</a></li> <li data-name="ss2d.Stage2D.b"><a href="ss2d.Stage2D.html#b">b</a></li> <li data-name="ss2d.Stage2D.canvas"><a href="ss2d.Stage2D.html#canvas">canvas</a></li> <li data-name="ss2d.Stage2D.context"><a href="ss2d.Stage2D.html#context">context</a></li> <li data-name="ss2d.Stage2D.fps"><a href="ss2d.Stage2D.html#fps">fps</a></li> <li data-name="ss2d.Stage2D.g"><a href="ss2d.Stage2D.html#g">g</a></li> <li data-name="ss2d.Stage2D.gl"><a href="ss2d.Stage2D.html#gl">gl</a></li> <li data-name="ss2d.Stage2D.mouseX"><a href="ss2d.Stage2D.html#mouseX">mouseX</a></li> <li data-name="ss2d.Stage2D.mouseY"><a href="ss2d.Stage2D.html#mouseY">mouseY</a></li> <li data-name="ss2d.Stage2D.ovMatrix"><a href="ss2d.Stage2D.html#ovMatrix">ovMatrix</a></li> <li data-name="ss2d.Stage2D.r"><a href="ss2d.Stage2D.html#r">r</a></li> <li data-name="ss2d.Stage2D.rttFramebuffer"><a href="ss2d.Stage2D.html#rttFramebuffer">rttFramebuffer</a></li> <li data-name="ss2d.Stage2D.rttTexture"><a href="ss2d.Stage2D.html#rttTexture">rttTexture</a></li> <li data-name="ss2d.Stage2D.shader"><a href="ss2d.Stage2D.html#shader">shader</a></li> <li data-name="ss2d.Stage2D.stageHeight"><a href="ss2d.Stage2D.html#stageHeight">stageHeight</a></li> <li data-name="ss2d.Stage2D.stageWidth"><a href="ss2d.Stage2D.html#stageWidth">stageWidth</a></li> <li data-name="ss2d.Stage2D#displayerlist"><a href="ss2d.Stage2D.html#displayerlist">displayerlist</a></li> <li data-name="ss2d.Stage2D#frameBufflist"><a href="ss2d.Stage2D.html#frameBufflist">frameBufflist</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Stage2D#addChild"><a href="ss2d.Stage2D.html#addChild">addChild</a></li> <li data-name="ss2d.Stage2D#addFrameBuffer"><a href="ss2d.Stage2D.html#addFrameBuffer">addFrameBuffer</a></li> <li data-name="ss2d.Stage2D#onDrawFrame"><a href="ss2d.Stage2D.html#onDrawFrame">onDrawFrame</a></li> <li data-name="ss2d.Stage2D#removeChild"><a href="ss2d.Stage2D.html#removeChild">removeChild</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.TextField"> <span class="title"> <a href="ss2d.TextField.html">ss2d.TextField</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.TextField#getAlpha"><a href="ss2d.TextField.html#getAlpha">getAlpha</a></li> <li data-name="ss2d.TextField#getFontSize"><a href="ss2d.TextField.html#getFontSize">getFontSize</a></li> <li data-name="ss2d.TextField#getText"><a href="ss2d.TextField.html#getText">getText</a></li> <li data-name="ss2d.TextField#getTypefac"><a href="ss2d.TextField.html#getTypefac">getTypefac</a></li> <li data-name="ss2d.TextField#setAlpha"><a href="ss2d.TextField.html#setAlpha">setAlpha</a></li> <li data-name="ss2d.TextField#setColor"><a href="ss2d.TextField.html#setColor">setColor</a></li> <li data-name="ss2d.TextField#setFontSize"><a href="ss2d.TextField.html#setFontSize">setFontSize</a></li> <li data-name="ss2d.TextField#setText"><a href="ss2d.TextField.html#setText">setText</a></li> <li data-name="ss2d.TextField#setTypefac"><a href="ss2d.TextField.html#setTypefac">setTypefac</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.Texture"> <span class="title"> <a href="ss2d.Texture.html">ss2d.Texture</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.Texture#height"><a href="ss2d.Texture.html#height">height</a></li> <li data-name="ss2d.Texture#quadResource"><a href="ss2d.Texture.html#quadResource">quadResource</a></li> <li data-name="ss2d.Texture#texture"><a href="ss2d.Texture.html#texture">texture</a></li> <li data-name="ss2d.Texture#width"><a href="ss2d.Texture.html#width">width</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="ss2d.Texture#dispose"><a href="ss2d.Texture.html#dispose">dispose</a></li> <li data-name="ss2d.Texture#loadXml"><a href="ss2d.Texture.html#loadXml">loadXml</a></li> <li data-name="ss2d.Texture#newBitmap"><a href="ss2d.Texture.html#newBitmap">newBitmap</a></li> <li data-name="ss2d.Texture#newCanvas"><a href="ss2d.Texture.html#newCanvas">newCanvas</a></li> <li data-name="ss2d.Texture#newSprite"><a href="ss2d.Texture.html#newSprite">newSprite</a></li> <li data-name="ss2d.Texture#newTexture"><a href="ss2d.Texture.html#newTexture">newTexture</a></li> <li data-name="ss2d.Texture#transformTextureBuffer"><a href="ss2d.Texture.html#transformTextureBuffer">transformTextureBuffer</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.TextureStyle"> <span class="title"> <a href="ss2d.TextureStyle.html">ss2d.TextureStyle</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.TextureStyle#xSampling"><a href="ss2d.TextureStyle.html#xSampling">xSampling</a></li> <li data-name="ss2d.TextureStyle#xTile"><a href="ss2d.TextureStyle.html#xTile">xTile</a></li> <li data-name="ss2d.TextureStyle#ySampling"><a href="ss2d.TextureStyle.html#ySampling">ySampling</a></li> <li data-name="ss2d.TextureStyle#yTile"><a href="ss2d.TextureStyle.html#yTile">yTile</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="ss2d.TimerEvent"> <span class="title"> <a href="ss2d.TimerEvent.html">ss2d.TimerEvent</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="ss2d.TimerEvent.TIMER"><a href="ss2d.TimerEvent.html#TIMER">TIMER</a></li> <li data-name="ss2d.TimerEvent.TIMER_COMPLETE"><a href="ss2d.TimerEvent.html#TIMER_COMPLETE">TIMER_COMPLETE</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> </ul> </div> <div class="main"> <h1 class="page-title" data-filename="ss2d.ParticleStyle.html">Class: ParticleStyle</h1> <section> <header> <h2> <span class="ancestors"><a href="ss2d.html">ss2d</a>.</span> ParticleStyle </h2> </header> <article> <div class="container-overview"> <dt> <div class="nameContainer"> <h4 class="name" id="ParticleStyle"> new ss2d.ParticleStyle<span class="signature">()</span> </h4> <div class="tag-source"> <a href="ParticleStyle.js.html">ParticleStyle.js</a>, <a href="ParticleStyle.js.html#line33">line 33</a> </div> </div> </dt> <dd> <div class="description"> <p>ParticleStyle 粒子样式表,用于处理粒子发射时的各项参数 <br /> 演示地址:<a href="http://sirius2d.com/demos/d_32/">http://sirius2d.com/demos/d_32/</a></p> </div> <dl class="details"> </dl> </dd> </div> <h3 class="subsection-title">Members</h3> <dl> <dt> <div class="nameContainer"> <h4 class="name" id="a">a</h4> </div> </dt> <dd> <div class="description"> <p>粒子透明度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="addA">addA</h4> </div> </dt> <dd> <div class="description"> <p>粒子递增透明度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="addB">addB</h4> </div> </dt> <dd> <div class="description"> <p>粒子递增蓝色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="addG">addG</h4> </div> </dt> <dd> <div class="description"> <p>粒子递增绿色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="addR">addR</h4> </div> </dt> <dd> <div class="description"> <p>粒子递增红色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="alphaValue">alphaValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子初始化透明度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="angleValue">angleValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子角度递增值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="b">b</h4> </div> </dt> <dd> <div class="description"> <p>粒子蓝色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="g">g</h4> </div> </dt> <dd> <div class="description"> <p>粒子绿色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="gotoFrame">gotoFrame</h4> </div> </dt> <dd> <div class="description"> <p>跳转到第几帧</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="loop">loop</h4> </div> </dt> <dd> <div class="description"> <p>是否播放动画</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="r">r</h4> </div> </dt> <dd> <div class="description"> <p>粒子红色通道值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="rotationRandom">rotationRandom</h4> </div> </dt> <dd> <div class="description"> <p>粒子随机角度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="rotationValue">rotationValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子初始化角度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="scaleX">scaleX</h4> </div> </dt> <dd> <div class="description"> <p>粒子的X轴比例</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="scaleXValue">scaleXValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子X比例缩放值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="scaleY">scaleY</h4> </div> </dt> <dd> <div class="description"> <p>粒子的Y轴比例</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="scaleYValue">scaleYValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子Y比例缩放值</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="scopeY">scopeY</h4> </div> </dt> <dd> <div class="description"> <p>粒子Y随机范围</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="speedValue">speedValue</h4> </div> </dt> <dd> <div class="description"> <p>粒子运动速度</p> </div> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="tileName">tileName</h4> </div> </dt> <dd> <div class="description"> <p>设置动画片段名称</p> </div> <dl class="details"> </dl> </dd> </dl> </article> </section> <!-- disqus code --> <div id="disqus_thread"></div> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">评论系统由<span class="logo-disqus">Disqus</span>强力驱动</a> <!-- // disqus code --> <footer> Copyright 2013-2014 <a target="_blank" href="http://sirius2d.com">SIRIUS2D.COM</a> <a target="_blank" href="http://html5gamedev.org">HTML5GAMEDEV.ORG</a> All Right Reserved. </footer> </div> </div> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> <script src="scripts/main.js"></script> </body> </html>
{ "content_hash": "27b2562e4450a3801369870b95ac586d", "timestamp": "", "source": "github", "line_count": 3122, "max_line_length": 446, "avg_line_length": 32.68577834721332, "alnum_prop": 0.5043069234161399, "repo_name": "kukuzhang/sirius2d", "id": "bd84a23191963d7a69d66e9ed3eeba22fb269b88", "size": "102819", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/ss2d.ParticleStyle.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
using System; using System.Data; using System.Data.SQLite; using System.Globalization; using System.IO; using System.Reflection; using SST.Enums; using SST.Model; using SST.Model.QlRanks; using SST.Util; namespace SST.Database { /// <summary> /// Database class responsible for QLRanks elo data for players. /// </summary> public class DbElo : CommonSqliteDb { private readonly Type _logClassType = MethodBase.GetCurrentMethod().DeclaringType; private readonly string _logPrefix = "[DB:ELO]"; private readonly string _sqlConString = "Data Source=" + Filepaths.EloDatabaseFilePath; private readonly string _sqlDbPath = Filepaths.EloDatabaseFilePath; /// <summary> /// Initializes a new instance of the <see cref="DbElo"/> class. /// </summary> public DbElo() { VerifyDb(); } /// <summary> /// Adds the user to the database. /// </summary> /// <param name="user">The user.</param> /// <param name="lastUpdatedDate">The date and time on which the elo data was last updated.</param> /// <param name="caElo">The CA elo.</param> /// <param name="ctfElo">The CTF elo.</param> /// <param name="duelElo">The Duel elo.</param> /// <param name="ffaElo">The FFA elo.</param> /// <param name="tdmElo">The TDM elo.</param> /// <returns> /// A <see cref="UserDbResult"/> value indicating the result of the attempted user addition. /// </returns> public UserDbResult AddUserToDb(string user, DateTime lastUpdatedDate, long caElo, long ctfElo, long duelElo, long ffaElo, long tdmElo) { var result = UserDbResult.Unspecified; if (VerifyDb()) { if (DoesUserExistInDb(user.ToLowerInvariant())) { return UserDbResult.UserAlreadyExists; } try { using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); using (var cmd = new SQLiteCommand(sqlcon)) { cmd.CommandText = "INSERT INTO elo(user, lastUpdated, caElo, ctfElo, duelElo, ffaElo, tdmElo) VALUES(@user," + " @lastUpdatedDate, @caElo, @ctfElo, @duelElo, @ffaElo, @tdmElo)"; cmd.Parameters.AddWithValue("@user", user.ToLowerInvariant()); cmd.Parameters.AddWithValue("@lastUpdatedDate", lastUpdatedDate); cmd.Parameters.AddWithValue("@caElo", caElo); cmd.Parameters.AddWithValue("@ctfElo", ctfElo); cmd.Parameters.AddWithValue("@duelElo", duelElo); cmd.Parameters.AddWithValue("@ffaElo", ffaElo); cmd.Parameters.AddWithValue("@tdmElo", tdmElo); cmd.ExecuteNonQuery(); Log.Write(string.Format( "{0} successfully added to Elo database. Elo last updated:" + " {1}. CA: {2} | CTF: {3} | DUEL: {4} | FFA: {5} | TDM: {6}", user, lastUpdatedDate.ToString("G", DateTimeFormatInfo.InvariantInfo), caElo, ctfElo, duelElo, ffaElo, tdmElo), _logClassType, _logPrefix); result = UserDbResult.Success; } } } catch (Exception ex) { Log.WriteCritical(string.Format("Problem adding player {0} to Elo database: {1}", user, ex.Message), _logClassType, _logPrefix); result = UserDbResult.InternalError; } } return result; } /// <summary> /// Gets the elo data for a given player. /// </summary> /// <param name="user">The user.</param> /// <returns>The player's elo data as an <see cref="EloData"/> object.</returns> public EloData GetEloData(string user) { var eloData = new EloData(); if (VerifyDb()) { if (!DoesUserExistInDb(user.ToLowerInvariant())) { return null; } try { using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); using (var cmd = new SQLiteCommand(sqlcon)) { cmd.CommandText = "SELECT * FROM elo WHERE user = @user"; cmd.Parameters.AddWithValue("@user", user.ToLowerInvariant()); using (SQLiteDataReader reader = cmd.ExecuteReader()) { if (!reader.HasRows) { return null; } while (reader.Read()) { eloData.LastUpdatedDate = (DateTime)reader["lastUpdated"]; eloData.CaElo = (long)reader["caElo"]; eloData.CtfElo = (long)reader["ctfElo"]; eloData.DuelElo = (long)reader["duelElo"]; eloData.FfaElo = (long)reader["ffaElo"]; eloData.TdmElo = (long)reader["tdmElo"]; } } } } } catch (Exception ex) { Log.WriteCritical(string.Format( "Problem getting Elo data for player {0} from Elo database: {1}", user, ex.Message), _logClassType, _logPrefix); } } return eloData; } /// <summary> /// Updates a player's elo data in the database. /// </summary> /// <param name="user">The user.</param> /// <param name="lastUpdatedDate">The date and time on which the elo data was last updated.</param> /// <param name="caElo">The CA elo.</param> /// <param name="ctfElo">The CTF elo.</param> /// <param name="duelElo">The Duel elo.</param> /// <param name="ffaElo">The FFA elo.</param> /// <param name="tdmElo">The TDM elo.</param> public void UpdateEloData(string user, DateTime lastUpdatedDate, long caElo, long ctfElo, long duelElo, long ffaElo, long tdmElo) { if (VerifyDb()) { if (!DoesUserExistInDb(user.ToLowerInvariant())) { return; } try { using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); using (var cmd = new SQLiteCommand(sqlcon)) { cmd.CommandText = "UPDATE elo SET lastUpdated = @lastUpdatedDate, caElo = @caElo, ctfElo = @ctfElo," + " duelElo = @duelElo, ffaElo = @ffaElo, tdmElo = @tdmElo WHERE user = @user"; cmd.Parameters.AddWithValue("@user", user.ToLowerInvariant()); cmd.Parameters.AddWithValue("@lastUpdatedDate", lastUpdatedDate); cmd.Parameters.AddWithValue("@caElo", caElo); cmd.Parameters.AddWithValue("@ctfElo", ctfElo); cmd.Parameters.AddWithValue("@duelElo", duelElo); cmd.Parameters.AddWithValue("@ffaElo", ffaElo); cmd.Parameters.AddWithValue("@tdmElo", tdmElo); int total = cmd.ExecuteNonQuery(); if (total > 0) { Log.Write(string.Format( "Successfully updated QLRanks Elo database data for user: {0}. Elo last updated: {1}." + " CA: {2} | CTF: {3} | DUEL: {4} | FFA: {5} | TDM: {6}", user, lastUpdatedDate.ToString("G", DateTimeFormatInfo.InvariantInfo), caElo, ctfElo, duelElo, ffaElo, tdmElo), _logClassType, _logPrefix); } } } } catch (Exception ex) { Log.WriteCritical(string.Format( "Problem updating QLRanks Elo data for player {0} in Elo database: {1}", user, ex.Message), _logClassType, _logPrefix); } } } /// <summary> /// Checks whether the user is already banned. /// </summary> /// <param name="user">The user.</param> /// <returns><c>true</c> if the user is already banned, otherwise <c>false</c>.</returns> public bool UserAlreadyExists(string user) { return DoesUserExistInDb(user); } /// <summary> /// Creates the database. /// </summary> protected override void CreateDb() { if (DbExists()) return; SQLiteConnection.CreateFile(_sqlDbPath); try { using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); string s = "CREATE TABLE elo (id INTEGER PRIMARY KEY AUTOINCREMENT, user TEXT NOT NULL," + " lastUpdated DATETIME, caElo INTEGER, ctfElo INTEGER, duelElo INTEGER," + " ffaElo INTEGER, tdmElo INTEGER)"; using (var cmd = new SQLiteCommand(s, sqlcon)) { cmd.ExecuteNonQuery(); Log.Write("Elo database created.", _logClassType, _logPrefix); } } } catch (Exception ex) { Log.WriteCritical("Problem creating Elo database: " + ex.Message, _logClassType, _logPrefix); DeleteDb(); } } /// <summary> /// Checks whether the ban database exists. /// </summary> /// <returns><c>true</c> if the user database exists, otherwise <c>false</c>.</returns> protected override bool DbExists() { return (File.Exists(_sqlDbPath)); } /// <summary> /// Deletes the ban database. /// </summary> protected override void DeleteDb() { if (!DbExists()) return; try { File.Delete(_sqlDbPath); } catch (Exception ex) { Log.WriteCritical("Unable to delete Elo database: " + ex.Message, _logClassType, _logPrefix); } } /// <summary> /// Checks whether the user already exists in the database. /// </summary> /// <param name="user">The user.</param> /// <returns><c>true</c> if the user exists, otherwise <c>false</c>.</returns> protected override bool DoesUserExistInDb(string user) { try { using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); using (var cmd = new SQLiteCommand(sqlcon)) { cmd.CommandText = "SELECT * FROM elo WHERE user = @user"; cmd.Parameters.AddWithValue("@user", user.ToLowerInvariant()); using (SQLiteDataReader reader = cmd.ExecuteReader()) { return reader.HasRows; } } } } catch (Exception ex) { Log.WriteCritical(string.Format("Problem checking if player {0} exists in Elo database: {1}", user, ex.Message), _logClassType, _logPrefix); } return false; } /// <summary> /// Verifies the registration database. /// </summary> protected override sealed bool VerifyDb() { if (!DbExists()) { CreateDb(); return true; } using (var sqlcon = new SQLiteConnection(_sqlConString)) { sqlcon.Open(); using (var cmd = new SQLiteCommand(sqlcon)) { cmd.CommandType = CommandType.Text; cmd.CommandText = "SELECT * FROM sqlite_master WHERE type = 'table' AND name = 'elo'"; using (SQLiteDataReader sdr = cmd.ExecuteReader()) { if (sdr.Read()) { return true; } Log.WriteCritical("elo table not found in Elo database... Creating Elo database...", _logClassType, _logPrefix); CreateDb(); return false; } } } } } }
{ "content_hash": "14c70345ee4e54bffb12fb6947dcd56d", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 124, "avg_line_length": 41.20234604105572, "alnum_prop": 0.4499644128113879, "repo_name": "syncore/SST", "id": "444e30be7e2a15668520ff91f1c41ba79576e3d7", "size": "14052", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SST/Database/DbElo.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "176" }, { "name": "C#", "bytes": "1804995" } ], "symlink_target": "" }
title: Grouping collections in Java date: 2012-08-15 comments: true categories: [java, functional_programming, tdd] keywords: "java, functional programming, guava, tdd, test driven development, grouping, enumerable" aliases: - /blog/2012/08/15/grouping-collections-in-java/ - /2012/08/15/grouping-collections-in-java/ --- Recently I came across some code that was iterating over collections in order to group them by certain fields. This code was repeated a few times as it was grouping more than once. To me this seemed very verbose and a little hard to understand. As Guava was the available library and one that does not include any grouping I decided to have a go myself. <!-- more --> ## The iterative approach ``` java Map<Character, List<String>> group = newHashMap(); List<String> strings = asList("one", "two", "three", "four"); for (String string : strings) { Character firstCharacter = string.charAt(0); if (group.containsKey(firstCharacter)) { group.get(firstCharacter).add(string); } else { group.put(firstCharacter, asList(string)); } } ``` ## The idea Some functional languages do allow you to group items based upon a field such as the group by in Scala. Here's a quick example. ``` java val strings = "one" :: "two" :: "three" :: Nil val groups = strings groupBy (_.charAt(0)) ``` ## The specification To design the grouping I drove this from how I wanted to use it. The simplest way to do this is from a test. This allows me to flesh out the design as well as prove it works (and also to know when I am done.) Simple JUnit tests will suffice. > I'm using enumerable-java to reduce noise in my Java code (see [Lambda Magic?](/2012/01/10/lambda-magic/)) along with this λ trick for Guava ``` java @NewLambda private static <F, T> Function<F, T> λ(F from, T to) { throw new LambdaWeavingNotEnabledException(); } ``` This defines a method named `λ` which can be used as a lambda function with guava as the default enumerable implementation returns a `Callable` for [Totally Lazy](https://github.com/bodar/totallylazy) ### The Test ``` java @Test public void groupAListOfStrings_byTheirFirstLetter() { List<String> strings = asList("apples", "apricots", "oranges"); Map<Character, Collection<String>> grouping = group(strings, λ(s, s.charAt(0)); assertThat(grouping.size(), is(2)); assertThat(grouping.keySet(), contains('a', 'o')); assertThat(grouping.get('a'), contains("apples", "apricots")); assertThat(grouping.get('o'), contains("oranges")); } ``` It's pretty obvious to see that we are grouping these strings by their first letter, `a` for apples and apricots, `o` for oranges. We have a number of assertions to make sure that the group is how we expected. ## The implementation Now we have our specification we can start to implement the function. Our test has already given us our signature. ``` java Map<Character, Collection<String>> group(Collection<String> strings, Function<Character, String> function); ``` Now we can simply iterate over the given list, applying the given function and placing them in the result (using Guava's [ListMultimap](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ListMultimap.html) for ease. ``` java ListMultimap<Character, String> groups = ArrayListMultimap.create(); for (String string : string) groups.put(function.apply(string), string); return groups.asMap(); ``` Great, we have a simple function that can group our list of strings by their first character. Unfortunately this isn't very generic and if we wanted a different type of grouping this would not work. Let's try another test to help us make this more usable. ``` java private static Person Rod = aPerson("Rod", 50); private static Person Jane = aPerson("Jane", 21); private static Person Freddy = aPerson("Freddy", 50); @Test public void groupPeople_byAge() { List<Person> people = asList(Rod, Jane, Freddy); Map<Integer, Collection<Person>> groups = group(people, λ(p, p.age())); assertThat(groups.size(), is(2)); assertThat(groups.keySet(), contains(21, 50)); assertThat(groups.get(21), contains(Jane)); assertThat(groups.get(50), contains(Rod, Freddy)); } class Person { public static Person aPerson(String name, Integer age) { return new Person(name, age); } private Person(String name, Integer age) { this.name = name, this.age = age; } public Integer age() { return age }; } ``` Now we need a generic signature for our group function. Here's what I came up with. ``` java <Group, Item> Map<Group, Collection<Item>> group(Collection<Item> items, Function<Item, Group> grouping); ``` It's a shame that trying to make this readable makes a huge long signature. I admit I could have just used `G` and `I` instead of `Group` and `Item` however I do feel this explains the usage more. Also, I was quite pleased at how close my Java implementation came out to the original Scala. It wasn't the intention, I just wanted to make it readable. * Group a list of strings by their first character in Java ``` java group(strings, λ(s, s.charAt(0)); ``` * Group a list of string by their first character in Scala ``` scala strings groupBy (_.charAt(0)) ``` ## Conclusion I found the group function very useful, especially when creating reports. I do realise that I wanted to remove iteration/duplication and the new `group()` function iterates, maybe this could be further improved with tail recursion.
{ "content_hash": "cdf337cfa67d05bf4842d308c35cacd8", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 356, "avg_line_length": 36.76158940397351, "alnum_prop": 0.7189695550351288, "repo_name": "tonyklawrence/tonyklawrence.github.io", "id": "c4d3e997418096989c07bbc994063ed337c02d5e", "size": "5561", "binary": false, "copies": "1", "ref": "refs/heads/hugo", "path": "content/post/java/grouping-collections.markdown", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "1606" } ], "symlink_target": "" }
@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source set I18NSPHINXOPTS=%SPHINXOPTS% source if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^<target^>` where ^<target^> is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Yoson.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Yoson.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end
{ "content_hash": "aa9baa24c7a62a5c9031272ef7f0f20c", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 79, "avg_line_length": 26.71900826446281, "alnum_prop": 0.7008969996906897, "repo_name": "ZrtLab/Yoson", "id": "d052d6cdc976aaf929824ba4a1e3b41fb8164431", "size": "6466", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/make.bat", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3243" }, { "name": "Python", "bytes": "10499" }, { "name": "Shell", "bytes": "6466" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using Xamarin.Forms; namespace TimesheetXF.WinPhone { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); Forms.Init(); Content = TimesheetXF.App.MainPage.ConvertPageToUIElement(this); } } }
{ "content_hash": "c58524252cb9c244e2914368421f9e4a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 21, "alnum_prop": 0.6959706959706959, "repo_name": "teamtam/xamarin-forms-timesheet", "id": "c722549d1832b5ae3823544c652a093d0fc83429", "size": "548", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TimesheetXF/TimesheetXF.WinPhone/MainPage.xaml.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "39113" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="Sergey Pozhilov (GetTemplate.com)"> <title>Sign in - Progressus Bootstrap template</title> <link rel="shortcut icon" href="assets/images/gt_favicon.png"> <link rel="stylesheet" media="screen" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700"> <link rel="stylesheet" href="assets/css/bootstrap.min.css"> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <!-- Custom styles for our template --> <link rel="stylesheet" href="assets/css/bootstrap-theme.css" media="screen" > <link rel="stylesheet" href="assets/css/main.css"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="assets/js/html5shiv.js"></script> <script src="assets/js/respond.min.js"></script> <![endif]--> </head> <body> <!-- Fixed navbar --> <div class="navbar navbar-inverse navbar-fixed-top headroom" > <div class="container"> <div class="navbar-header"> <!-- Button for smallest screens --> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html"><img src="assets/images/logo.png" alt="Progressus HTML5 template"></a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav pull-right"> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">More Pages <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="sidebar-left.html">Left Sidebar</a></li> <li><a href="sidebar-right.html">Right Sidebar</a></li> </ul> </li> <li><a href="contact.html">Contact</a></li> <li class="active"><a class="btn" href="signin.html">SIGN IN / SIGN UP</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> <!-- /.navbar --> <header id="head" class="secondary"></header> <!-- container --> <div class="container"> <ol class="breadcrumb"> <li><a href="index.html">Home</a></li> <li class="active">User access</li> </ol> <div class="row"> <!-- Article main content --> <article class="col-xs-12 maincontent"> <header class="page-header"> <h1 class="page-title">Sign in</h1> </header> <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2"> <div class="panel panel-default"> <div class="panel-body"> <h3 class="thin text-center">Sign in to your account</h3> <p class="text-center text-muted">Lorem ipsum dolor sit amet, <a href="signup.html">Register</a> adipisicing elit. Quo nulla quibusdam cum doloremque incidunt nemo sunt a tenetur omnis odio. </p> <hr> <form> <div class="top-margin"> <label>Username/Email <span class="text-danger">*</span></label> <input type="text" class="form-control"> </div> <div class="top-margin"> <label>Password <span class="text-danger">*</span></label> <input type="password" class="form-control"> </div> <hr> <div class="row"> <div class="col-lg-8"> <b><a href="">Forgot password?</a></b> </div> <div class="col-lg-4 text-right"> <button class="btn btn-action" type="submit">Sign in</button> </div> </div> </form> </div> </div> </div> </article> <!-- /Article --> </div> </div> <!-- /container --> <footer id="footer" class="top-space"> <div class="footer1"> <div class="container"> <div class="row"> <div class="col-md-3 widget"> <h3 class="widget-title">Contact</h3> <div class="widget-body"> <p>+234 23 9873237<br> <a href="mailto:#">some.email@somewhere.com</a><br> <br> 234 Hidden Pond Road, Ashland City, TN 37015 </p> </div> </div> <div class="col-md-3 widget"> <h3 class="widget-title">Follow me</h3> <div class="widget-body"> <p class="follow-me-icons clearfix"> <a href=""><i class="fa fa-twitter fa-2"></i></a> <a href=""><i class="fa fa-dribbble fa-2"></i></a> <a href=""><i class="fa fa-github fa-2"></i></a> <a href=""><i class="fa fa-facebook fa-2"></i></a> </p> </div> </div> <div class="col-md-6 widget"> <h3 class="widget-title">Text widget</h3> <div class="widget-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Excepturi, dolores, quibusdam architecto voluptatem amet fugiat nesciunt placeat provident cumque accusamus itaque voluptate modi quidem dolore optio velit hic iusto vero praesentium repellat commodi ad id expedita cupiditate repellendus possimus unde?</p> <p>Eius consequatur nihil quibusdam! Laborum, rerum, quis, inventore ipsa autem repellat provident assumenda labore soluta minima alias temporibus facere distinctio quas adipisci nam sunt explicabo officia tenetur at ea quos doloribus dolorum voluptate reprehenderit architecto sint libero illo et hic.</p> </div> </div> </div> <!-- /row of widgets --> </div> </div> <div class="footer2"> <div class="container"> <div class="row"> <div class="col-md-6 widget"> <div class="widget-body"> <p class="simplenav"> <a href="#">Home</a> | <a href="about.html">About</a> | <a href="sidebar-right.html">Sidebar</a> | <a href="contact.html">Contact</a> | <b><a href="signup.html">Sign up</a></b> </p> </div> </div> <div class="col-md-6 widget"> <div class="widget-body"> <p class="text-right"> Copyright &copy; 2014, Your name. Designed by <a href="http://gettemplate.com/" rel="designer">gettemplate</a> </p> </div> </div> </div> <!-- /row of widgets --> </div> </div> </footer> <!-- JavaScript libs are placed at the end of the document so the pages load faster --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="assets/js/headroom.min.js"></script> <script src="assets/js/jQuery.headroom.min.js"></script> <script src="assets/js/template.js"></script> </body> </html>
{ "content_hash": "d41d28c05793006aa21665f09f7d3559", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 324, "avg_line_length": 34.46153846153846, "alnum_prop": 0.6047619047619047, "repo_name": "FeR-S/judlit", "id": "2e73748dfcc8e556383a5f672c1df787aa35a414", "size": "6720", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "frontend/web/Progressus/signin.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1541" }, { "name": "CSS", "bytes": "18393" }, { "name": "HTML", "bytes": "60330" }, { "name": "JavaScript", "bytes": "5766" }, { "name": "PHP", "bytes": "325623" }, { "name": "Shell", "bytes": "3257" } ], "symlink_target": "" }
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { convertToParamMap, ParamMap } from '@angular/router'; import { Injectable } from '@angular/core'; @Injectable() export class ActivatedRouteStub { // ActivatedRoute.paramMap is Observable private subject = new BehaviorSubject(convertToParamMap(this.testParamMap)); paramMap = this.subject.asObservable(); // Test parameters private _testParamMap: ParamMap; get testParamMap() { return this._testParamMap; } set testParamMap(params: {}) { this._testParamMap = convertToParamMap(params); this.subject.next(this._testParamMap); } // ActivatedRoute.snapshot.paramMap get snapshot() { return { paramMap: this.testParamMap }; } }
{ "content_hash": "433ba9b11431d742b85247fff1bff30f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 30.25, "alnum_prop": 0.7327823691460055, "repo_name": "MehlboxKonsole/mk2-ng-app", "id": "182f52cc90ffcbb7305de81ef4af6e57ea972f20", "size": "726", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/shared/util/testing/ActivatedRouteStub.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18413" }, { "name": "Gherkin", "bytes": "236" }, { "name": "HTML", "bytes": "39337" }, { "name": "JavaScript", "bytes": "4341" }, { "name": "TypeScript", "bytes": "92924" } ], "symlink_target": "" }
import React from 'react'; class OfferOtherWords extends React.Component{ render(){ let word = this.props.dictionary[this.props.showKey]; return( <div> <h3>Zvol správnou variantu</h3> {word.meaningCZ} </div> ) } } export default OfferOtherWords;
{ "content_hash": "22d4aa47639c0d74e2968c4be96447c6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 18.333333333333332, "alnum_prop": 0.5636363636363636, "repo_name": "pufinek/learn-Spanish", "id": "82c77469bb2b617d816514a7702f3c131c0967ae", "size": "331", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/components/Tests/OfferOtherWords.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10689" }, { "name": "HTML", "bytes": "530" }, { "name": "JavaScript", "bytes": "44094" } ], "symlink_target": "" }
//-----------------------------------NOTICE----------------------------------// // Some of this file is automatically filled in by a Python script. Only // // add custom code in the designated areas or it will be overwritten during // // the next update. // //-----------------------------------NOTICE----------------------------------// //--BEGIN FILE HEAD CUSTOM CODE--// //--END CUSTOM CODE--// #include "../../include/FixLink.h" #include "../../include/ObjectRegistry.h" #include "../../include/NIF_IO.h" #include "../../include/obj/bhkOrientHingedBodyAction.h" using namespace Niflib; //Definition of TYPE constant const Type bhkOrientHingedBodyAction::TYPE("bhkOrientHingedBodyAction", &bhkSerializable::TYPE); bhkOrientHingedBodyAction::bhkOrientHingedBodyAction() { //--BEGIN CONSTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } bhkOrientHingedBodyAction::~bhkOrientHingedBodyAction() { //--BEGIN DESTRUCTOR CUSTOM CODE--// //--END CUSTOM CODE--// } const Type & bhkOrientHingedBodyAction::GetType() const { return TYPE; } NiObject * bhkOrientHingedBodyAction::Create() { return new bhkOrientHingedBodyAction; } void bhkOrientHingedBodyAction::Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info) { //--BEGIN PRE-READ CUSTOM CODE--// //--END CUSTOM CODE--// bhkSerializable::Read(in, link_stack, info); for(unsigned int i1 = 0; i1 < 17; i1++) { NifStream(unknownInts1[i1], in, info); }; //--BEGIN POST-READ CUSTOM CODE--// //--END CUSTOM CODE--// } void bhkOrientHingedBodyAction::Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const { //--BEGIN PRE-WRITE CUSTOM CODE--// //--END CUSTOM CODE--// bhkSerializable::Write(out, link_map, missing_link_stack, info); for(unsigned int i1 = 0; i1 < 17; i1++) { NifStream(unknownInts1[i1], out, info); }; //--BEGIN POST-WRITE CUSTOM CODE--// //--END CUSTOM CODE--// } std::string bhkOrientHingedBodyAction::asString(bool verbose) const { //--BEGIN PRE-STRING CUSTOM CODE--// //--END CUSTOM CODE--// stringstream out; unsigned int array_output_count = 0; out << bhkSerializable::asString(verbose); array_output_count = 0; for(unsigned int i1 = 0; i1 < 17; i1++) { if(!verbose && (array_output_count > MAXARRAYDUMP)) { out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl; break; }; if(!verbose && (array_output_count > MAXARRAYDUMP)) { break; }; out << " Unknown Ints 1[" << i1 << "]: " << unknownInts1[i1] << endl; array_output_count++; }; return out.str(); //--BEGIN POST-STRING CUSTOM CODE--// //--END CUSTOM CODE--// } void bhkOrientHingedBodyAction::FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info) { //--BEGIN PRE-FIXLINKS CUSTOM CODE--// //--END CUSTOM CODE--// bhkSerializable::FixLinks(objects, link_stack, missing_link_stack, info); //--BEGIN POST-FIXLINKS CUSTOM CODE--// //--END CUSTOM CODE--// } std::list<NiObjectRef> bhkOrientHingedBodyAction::GetRefs() const { list<Ref<NiObject> > refs; refs = bhkSerializable::GetRefs(); return refs; } std::list<NiObject *> bhkOrientHingedBodyAction::GetPtrs() const { list<NiObject *> ptrs; ptrs = bhkSerializable::GetPtrs(); return ptrs; } //--This object has no eligable attributes. No example implementation generated--// //--BEGIN MISC CUSTOM CODE--// //--END CUSTOM CODE--//
{ "content_hash": "0a09a0e001823c2a26b3c529bb746c17", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 183, "avg_line_length": 25.274647887323944, "alnum_prop": 0.6441905823349122, "repo_name": "BlazesRus/niflib", "id": "bf664005511e262ea928400e9bbfa4076244a2a8", "size": "3703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/obj/bhkOrientHingedBodyAction.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "5722136" }, { "name": "CMake", "bytes": "13336" }, { "name": "HTML", "bytes": "485" }, { "name": "Objective-C", "bytes": "10426" } ], "symlink_target": "" }
using System; using System.IO; using System.Reflection; using Xwt.Drawing; using System.Collections.Generic; namespace Xwt.Backends { public abstract class ImageBackendHandler: DisposableResourceBackendHandler { public virtual object CreateBackend () { throw new NotSupportedException (); } public virtual object LoadFromResource (Assembly asm, string name) { using (var s = asm.GetManifestResourceStream (name)) { if (s == null) throw new InvalidOperationException ("Resource not found: " + name); return LoadFromStream (s); } } public virtual object LoadFromFile (string file) { using (var s = File.OpenRead (file)) return LoadFromStream (s); } /// <summary> /// Creates an image that is custom drawn /// </summary> /// <returns>The custom drawn.</returns> /// <param name="drawCallback">The callback to be used to draw the image. The arguments are: the context backend, the bounds where to draw</param> public virtual object CreateCustomDrawn (ImageDrawCallback drawCallback) { throw new NotSupportedException (); } /// <summary> /// Creates an image with multiple representations in different sizes /// </summary> /// <returns>The image backend</returns> /// <param name="images">Backends of the different image representations</param> /// <remarks>The first image of the list if the reference image, the one with scale factor = 1</remarks> public virtual object CreateMultiResolutionImage (IEnumerable<object> images) { throw new NotSupportedException (); } public virtual object CreateMultiSizeIcon (IEnumerable<object> images) { throw new NotSupportedException (); } public abstract object LoadFromStream (Stream stream); public abstract void SaveToStream (object backend, System.IO.Stream stream, ImageFileType fileType); public abstract Image GetStockIcon (string id); /// <summary> /// Determines whether this instance is a bitmap /// </summary> /// <param name="handle">Image handle</param> public abstract bool IsBitmap (object handle); /// <summary> /// Converts an image to a bitmap of the specified size /// </summary> /// <returns>The bitmap.</returns> /// <param name="handle">Image handle.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public abstract object ConvertToBitmap (ImageDescription idesc, double scaleFactor, ImageFormat format); /// <summary> /// Returns True if the image has multiple representations of different sizes. /// </summary> /// <param name="handle">Image handle.</param> /// <remarks>For example, it would return True for a .ico file which as several representations of the image in different sizes</remarks> public abstract bool HasMultipleSizes (object handle); /// <summary> /// Gets the size of an image /// </summary> /// <returns>The size of the image, or a size of (0,0) if there is no known size for the image</returns> /// <param name="handle">Image handle</param> /// <remarks> /// This method should return a size of (0,0) if the image doesn't have an intrinsic size. /// For example: if the image is a vecor image, or if is an icon composed of images of different sizes. /// </remarks> public abstract Size GetSize (object handle); /// <summary> /// Gets the size of an image without loading the entire file. /// </summary> /// <param name="file">The path to the image</param> /// <returns>The size of the image</returns> public abstract Size GetSize (string file); public abstract object CopyBitmap (object handle); public abstract void CopyBitmapArea (object srcHandle, int srcX, int srcY, int width, int height, object destHandle, int destX, int destY); public abstract object CropBitmap (object handle, int srcX, int srcY, int width, int height); public abstract void SetBitmapPixel (object handle, int x, int y, Color color); public abstract Color GetBitmapPixel (object handle, int x, int y); } public enum ImagePixelFormat { BGR888, RGB565, BGRA8888 } public delegate void ImageDrawCallback (object contextBackend, Rectangle bounds, ImageDescription idesc, Toolkit toolkit); public struct ImageDescription { public static ImageDescription Null = new ImageDescription (); public bool IsNull { get { return Backend == null; } } public object Backend { get; set; } public Size Size { get; set; } public double Alpha { get; set; } public StyleSet Styles { get; set; } } }
{ "content_hash": "29b3991a50932eb06ad6b265f93b2e2c", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 148, "avg_line_length": 32.77536231884058, "alnum_prop": 0.7083793942073845, "repo_name": "antmicro/xwt", "id": "48ccf2b7e91f74a5d46713b15dddb088cead5984", "size": "5729", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Xwt/Xwt.Backends/ImageBackendHandler.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "3816738" }, { "name": "Makefile", "bytes": "245" } ], "symlink_target": "" }
tinyMCE.addI18n('fi.style_dlg',{ title:"Muokkaa CSS tyyli\u00E4", apply:"K\u00E4yt\u00E4", text_tab:"Teksti", background_tab:"Tausta", block_tab:"Palkki", box_tab:"Laatikko", border_tab:"Kehys", list_tab:"Lista", positioning_tab:"Sijainti", text_props:"Text", text_font:"Font", text_size:"Size", text_weight:"Weight", text_style:"Style", text_variant:"Variant", text_lineheight:"Line height", text_case:"Case", text_color:"Color", text_decoration:"Decoration", text_overline:"overline", text_underline:"underline", text_striketrough:"strikethrough", text_blink:"blink", text_none:"none", background_color:"Background color", background_image:"Background image", background_repeat:"Repeat", background_attachment:"Attachment", background_hpos:"Horizontal position", background_vpos:"Vertical position", block_wordspacing:"Word spacing", block_letterspacing:"Letter spacing", block_vertical_alignment:"Vertical alignment", block_text_align:"Text align", block_text_indent:"Text indent", block_whitespace:"Whitespace", block_display:"Display", box_width:"Width", box_height:"Height", box_float:"Float", box_clear:"Clear", padding:"Padding", same:"Sama kaikille", top:"Top", right:"Right", bottom:"Bottom", left:"Left", margin:"Margin", style:"Style", width:"Width", height:"Height", color:"Color", list_type:"Type", bullet_image:"Bullet image", position:"Position", positioning_type:"Type", visibility:"Visibility", zindex:"Z-index", overflow:"Overflow", placement:"Placement", clip:"Clip" });
{ "content_hash": "1f50d1d40c04a4bc67de7d29c1b5468d", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 46, "avg_line_length": 23.650793650793652, "alnum_prop": 0.7456375838926175, "repo_name": "SunboX/fotocommunity", "id": "dbcb0e8f53f0fd05ca38e7f891e5a0b7e83c078d", "size": "1490", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "jsparty/tiny_mce2/plugins/style/langs/fi_dlg.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "2171787" }, { "name": "PHP", "bytes": "5313005" }, { "name": "Python", "bytes": "2128" }, { "name": "Scheme", "bytes": "97379" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About MP3Coin</source> <translation>À propos de MP3Coin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;MP3Coin&lt;/b&gt; version</source> <translation>&lt;b&gt;MP3Coin&lt;/b&gt; version</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Ce logiciel est en phase expérimentale. Distribué sous licence MIT/X11, voir le fichier COPYING ou http://www.opensource.org/licenses/mit-license.php. Ce produit comprend des fonctionnalités développées par le projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL (http://www.openssl.org/), un logiciel cryptographique écrit par Eric Young (eay@cryptsoft.com), et des fonctionnalités développées pour le logiciel UPnP écrit par Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Droit d&apos;auteur</translation> </message> <message> <location line="+0"/> <source>The MP3Coin developers</source> <translation>Les développeurs MP3Coin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Carnet d&apos;adresses</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Double cliquez afin de modifier l&apos;adresse ou l&apos;étiquette</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Créer une nouvelle adresse</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copier l&apos;adresse sélectionnée dans le presse-papiers</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nouvelle adresse</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your MP3Coin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Voici vos adresses MP3Coin qui vous permettent de recevoir des paiements. Vous pouvez donner une adresse différente à chaque expéditeur afin de savoir qui vous paye.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copier l&apos;adresse</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Afficher le &amp;QR Code</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a MP3Coin address</source> <translation>Signer un message pour prouver que vous détenez une adresse MP3Coin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signer un &amp;message</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Effacer l&apos;adresse actuellement sélectionnée de la liste</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exporter les données de l&apos;onglet courant vers un fichier</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exporter</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified MP3Coin address</source> <translation>Vérifier un message pour vous assurer qu&apos;il a bien été signé avec l&apos;adresse MP3Coin spécifiée</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Supprimer</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your MP3Coin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Ce sont vos adresses MP3Coin pour émettre des paiements. Vérifiez toujours le montant et l&apos;adresse du destinataire avant d&apos;envoyer des pièces.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copier l&apos;é&amp;tiquette</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Éditer</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Envoyer des &amp;MP3Coins</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exporter les données du carnet d&apos;adresses</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erreur lors de l&apos;exportation</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(aucune étiquette)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogue de phrase de passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Entrez la phrase de passe</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nouvelle phrase de passe</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Répétez la phrase de passe</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Entrez une nouvelle phrase de passe pour le porte-monnaie.&lt;br/&gt;Veuillez utiliser une phrase composée de &lt;b&gt;10 caractères aléatoires ou plus&lt;/b&gt;, ou bien de &lt;b&gt;huit mots ou plus&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Chiffrer le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour déverrouiller le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Déverrouiller le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Cette opération nécessite votre phrase de passe pour décrypter le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Déchiffrer le porte-monnaie</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Changer la phrase de passe</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Entrez l’ancienne phrase de passe pour le porte-monnaie ainsi que la nouvelle.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmer le chiffrement du porte-monnaie</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>Attention : Si vous chiffrez votre porte-monnaie et perdez votre phrase de passe, vous &lt;b&gt;PERDREZ ACCÈS À TOUS VOS LITECOINS&lt;/b&gt; !</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Êtes-vous sûr de vouloir chiffrer votre porte-monnaie ?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANT : Les sauvegardes précédentes de votre fichier de porte-monnaie devraient être remplacées par le nouveau fichier crypté de porte-monnaie. Pour des raisons de sécurité, les précédentes sauvegardes de votre fichier de porte-monnaie non chiffré deviendront inutilisables dès que vous commencerez à utiliser le nouveau porte-monnaie chiffré.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Attention : la touche Verr. Maj. est activée !</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Porte-monnaie chiffré</translation> </message> <message> <location line="-56"/> <source>MP3Coin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your mp3coins from being stolen by malware infecting your computer.</source> <translation>MP3Coin va à présent se fermer pour terminer la procédure de cryptage. N&apos;oubliez pas que le chiffrement de votre porte-monnaie ne peut pas fournir une protection totale contre le vol par des logiciels malveillants qui infecteraient votre ordinateur.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Le chiffrement du porte-monnaie a échoué</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Le chiffrement du porte-monnaie a échoué en raison d&apos;une erreur interne. Votre porte-monnaie n&apos;a pas été chiffré.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Les phrases de passe entrées ne correspondent pas.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Le déverrouillage du porte-monnaie a échoué</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>La phrase de passe entrée pour décrypter le porte-monnaie était incorrecte.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Le déchiffrage du porte-monnaie a échoué</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>La phrase de passe du porte-monnaie a été modifiée avec succès.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Signer un &amp;message...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synchronisation avec le réseau…</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Vue d&apos;ensemble</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Afficher une vue d’ensemble du porte-monnaie</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transactions</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Parcourir l&apos;historique des transactions</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Éditer la liste des adresses et des étiquettes stockées</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Afficher la liste des adresses pour recevoir des paiements</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>Q&amp;uitter</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Quitter l’application</translation> </message> <message> <location line="+4"/> <source>Show information about MP3Coin</source> <translation>Afficher des informations à propos de MP3Coin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>À propos de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Afficher des informations sur Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Options…</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Chiffrer le porte-monnaie...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Sauvegarder le porte-monnaie...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Modifier la phrase de passe...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importation des blocs depuis le disque...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Réindexation des blocs sur le disque...</translation> </message> <message> <location line="-347"/> <source>Send coins to a MP3Coin address</source> <translation>Envoyer des pièces à une adresse MP3Coin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for MP3Coin</source> <translation>Modifier les options de configuration de MP3Coin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Sauvegarder le porte-monnaie à un autre emplacement</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Modifier la phrase de passe utilisée pour le chiffrement du porte-monnaie</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Fenêtre de &amp;débogage</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Ouvrir une console de débogage et de diagnostic</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Vérifier un message...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>MP3Coin</source> <translation>MP3Coin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Porte-monnaie</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Envoyer</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Recevoir</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Adresses</translation> </message> <message> <location line="+22"/> <source>&amp;About MP3Coin</source> <translation>À &amp;propos de MP3Coin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Afficher / Cacher</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Afficher ou masquer la fenêtre principale</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Crypter les clefs privées de votre porte-monnaie</translation> </message> <message> <location line="+7"/> <source>Sign messages with your MP3Coin addresses to prove you own them</source> <translation>Signer les messages avec vos adresses MP3Coin pour prouver que vous les détenez</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified MP3Coin addresses</source> <translation>Vérifier les messages pour vous assurer qu&apos;ils ont bien été signés avec les adresses MP3Coin spécifiées</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fichier</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Réglages</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Aide</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barre d&apos;outils des onglets</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>MP3Coin client</source> <translation>Client MP3Coin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to MP3Coin network</source> <translation><numerusform>%n connexion active avec le réseau MP3Coin</numerusform><numerusform>%n connexions actives avec le réseau MP3Coin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Aucune source de bloc disponible...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>%1 blocs sur %2 (estimés) de l&apos;historique des transactions traités.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>%1 blocs de l&apos;historique des transactions traités.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n heure</numerusform><numerusform>%n heures</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n jour</numerusform><numerusform>%n jours</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semaine</numerusform><numerusform>%n semaines</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 en arrière</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Le dernier bloc reçu avait été généré il y a %1.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Les transactions après cela ne seront pas encore visibles.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Erreur</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Information</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Cette transaction dépasse la limite de taille. Vous pouvez quand même l&apos;envoyer en vous acquittant de frais d&apos;un montant de %1 qui iront aux nœuds qui traiteront la transaction et aideront à soutenir le réseau. Voulez-vous payer les frais ?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>À jour</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Rattrapage…</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirmer les frais de transaction</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transaction envoyée</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transaction entrante</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Date : %1 Montant : %2 Type : %3 Adresse : %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Gestion des URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid MP3Coin address or malformed URI parameters.</source> <translation>L&apos;URI ne peut être analysé ! Cela peut être causé par une adresse MP3Coin invalide ou par des paramètres d&apos;URI malformés.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;déverrouillé&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;verrouillé&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. MP3Coin can no longer continue safely and will quit.</source> <translation>Une erreur fatale est survenue. MP3Coin ne peut plus continuer à fonctionner de façon sûre et va s&apos;arrêter.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Alerte réseau</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Éditer l&apos;adresse</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Étiquette</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>L’étiquette associée à cette entrée du carnet d&apos;adresses</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresse</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>L’adresse associée avec cette entrée du carnet d&apos;adresses. Ne peut être modifiées que les adresses d’envoi.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nouvelle adresse de réception</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nouvelle adresse d’envoi</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Éditer l’adresse de réception</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Éditer l’adresse d&apos;envoi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>L’adresse fournie « %1 » est déjà présente dans le carnet d&apos;adresses.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid MP3Coin address.</source> <translation>L&apos;adresse fournie « %1 » n&apos;est pas une adresse MP3Coin valide.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossible de déverrouiller le porte-monnaie.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Échec de la génération de la nouvelle clef.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>MP3Coin-Qt</source> <translation>MP3Coin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>version</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilisation :</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>options de ligne de commande</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Options Interface Utilisateur</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Définir la langue, par exemple « de_DE » (par défaut : la langue du système)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Démarrer sous forme minimisée</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Afficher l&apos;écran d&apos;accueil au démarrage (par défaut : 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Options</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>Réglages &amp;principaux</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Frais de transaction optionnel par ko qui aident à garantir un traitement rapide des transactions. La plupart des transactions utilisent 1 ko.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Payer des &amp;frais de transaction</translation> </message> <message> <location line="+31"/> <source>Automatically start MP3Coin after logging in to the system.</source> <translation>Démarrer MP3Coin automatiquement lors de l&apos;ouverture une session sur l&apos;ordinateur.</translation> </message> <message> <location line="+3"/> <source>&amp;Start MP3Coin on system login</source> <translation>&amp;Démarrer MP3Coin lors de l&apos;ouverture d&apos;une session</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Remettre toutes les options du client aux valeurs par défaut.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Remise à zéro des options</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Réseau</translation> </message> <message> <location line="+6"/> <source>Automatically open the MP3Coin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Ouvrir le port du client MP3Coin automatiquement sur le routeur. Cela ne fonctionne que si votre routeur supporte l&apos;UPnP et si la fonctionnalité est activée.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Ouvrir le port avec l&apos;&amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the MP3Coin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Connexion au réseau MP3Coin à travers un proxy SOCKS (par ex. lors d&apos;une connexion via Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Connexion à travers un proxy SOCKS :</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP du proxy :</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Adresse IP du proxy (par ex. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port :</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port du proxy (par ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Version SOCKS :</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Version SOCKS du serveur mandataire (par ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Fenêtre</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Afficher uniquement une icône système après minimisation.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiser dans la barre système au lieu de la barre des tâches</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimiser au lieu quitter l&apos;application lorsque la fenêtre est fermée. Lorsque cette option est activée, l&apos;application ne pourra être fermée qu&apos;en sélectionnant Quitter dans le menu déroulant.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimiser lors de la fermeture</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Affichage</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Langue de l&apos;interface utilisateur :</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting MP3Coin.</source> <translation>La langue de l&apos;interface utilisateur peut être définie ici. Ce réglage sera pris en compte après redémarrage de MP3Coin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unité d&apos;affichage des montants :</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Choisissez la sous-unité par défaut pour l&apos;affichage dans l&apos;interface et lors de l&apos;envoi de pièces.</translation> </message> <message> <location line="+9"/> <source>Whether to show MP3Coin addresses in the transaction list or not.</source> <translation>Détermine si les adresses MP3Coin seront affichées sur la liste des transactions.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Afficher les adresses sur la liste des transactions</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;Valider</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>A&amp;nnuler</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Appliquer</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>par défaut</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirmer la remise à zéro des options</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>La prise en compte de certains réglages peut nécessiter un redémarrage du client.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Voulez-vous continuer ?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting MP3Coin.</source> <translation>Ce réglage sera pris en compte après un redémarrage de MP3Coin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>L&apos;adresse de proxy fournie est invalide.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the MP3Coin network after a connection is established, but this process has not completed yet.</source> <translation>Les informations affichées peuvent être obsolètes. Votre porte-monnaie est automatiquement synchronisé avec le réseau MP3Coin lorsque la connexion s&apos;établit, or ce processus n&apos;est pas encore terminé.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Solde :</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Non confirmé :</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Porte-monnaie</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Immature :</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Le solde généré n&apos;est pas encore mûr</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transactions récentes&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Votre solde actuel</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Total des transactions qui doivent encore être confirmées et qui ne sont pas prises en compte dans le solde actuel</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>désynchronisé</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start mp3coin: click-to-pay handler</source> <translation>Impossible de démarrer mp3coin : gestionnaire de cliquer-pour-payer</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Dialogue de QR Code</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Demande de paiement</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Montant :</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Étiquette :</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Message :</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Enregistrer sous...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erreur de l&apos;encodage de l&apos;URI dans le QR Code.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Le montant entré est invalide, veuillez le vérifier.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>L&apos;URI résultant est trop long, essayez avec un texte d&apos;étiquette ou de message plus court.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Sauvegarder le QR Code</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Images PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nom du client</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>Indisponible</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Version du client</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informations</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Version d&apos;OpenSSL utilisée</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Date de démarrage</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Réseau</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Nombre de connexions</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Sur testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Chaîne de blocs</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Nombre actuel de blocs</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Nombre total estimé de blocs</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Horodatage du dernier bloc</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Ouvrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Options de ligne de commande</translation> </message> <message> <location line="+7"/> <source>Show the MP3Coin-Qt help message to get a list with possible MP3Coin command-line options.</source> <translation>Afficher le message d&apos;aide de MP3Coin-Qt pour obtenir la liste des options de ligne de commande disponibles pour MP3Coin.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Afficher</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Console</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Date de compilation</translation> </message> <message> <location line="-104"/> <source>MP3Coin - Debug window</source> <translation>MP3Coin - Fenêtre de débogage</translation> </message> <message> <location line="+25"/> <source>MP3Coin Core</source> <translation>Noyau MP3Coin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Journal de débogage</translation> </message> <message> <location line="+7"/> <source>Open the MP3Coin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Ouvrir le journal de débogage de MP3Coin depuis le répertoire de données actuel. Cela peut prendre quelques secondes pour les journaux de grande taille.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Nettoyer la console</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the MP3Coin RPC console.</source> <translation>Bienvenue sur la console RPC de MP3Coin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Utilisez les touches de curseur pour naviguer dans l&apos;historique et &lt;b&gt;Ctrl-L&lt;/b&gt; pour effacer l&apos;écran.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Tapez &lt;b&gt;help&lt;/b&gt; pour afficher une vue générale des commandes disponibles.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Envoyer des pièces</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Envoyer des pièces à plusieurs destinataires à la fois</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Ajouter un &amp;destinataire</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Enlever tous les champs de transaction</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Solde :</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirmer l’action d&apos;envoi</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>E&amp;nvoyer</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; à %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirmer l’envoi des pièces</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Êtes-vous sûr de vouloir envoyer %1 ?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> et </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Cette adresse de destinataire n’est pas valide, veuillez la vérifier.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Le montant à payer doit être supérieur à 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Le montant dépasse votre solde.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Le montant dépasse votre solde lorsque les frais de transaction de %1 sont inclus.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Adresse dupliquée trouvée, il n&apos;est possible d&apos;envoyer qu&apos;une fois à chaque adresse par opération d&apos;envoi.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Erreur : Échec de la création de la transaction !</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erreur : la transaction a été rejetée. Cela peut arriver si certaines pièces de votre porte-monnaie ont déjà été dépensées, par exemple si vous avez utilisé une copie de wallet.dat avec laquelle les pièces ont été dépensées mais pas marquées comme telles ici.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulaire</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Montant :</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Payer &amp;à :</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse à laquelle le paiement sera envoyé (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Entrez une étiquette pour cette adresse afin de l’ajouter à votre carnet d’adresses</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Étiquette :</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Choisir une adresse dans le carnet d&apos;adresses</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Coller une adresse depuis le presse-papiers</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Enlever ce destinataire</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a MP3Coin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Entrez une adresse MP3Coin (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signatures - Signer / Vérifier un message</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Signer un message</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Vous pouvez signer des messages avec vos adresses pour prouver que les détenez. Faites attention à ne pas signer quoi que ce soit de vague car des attaques d&apos;hameçonnage peuvent essayer d&apos;usurper votre identité par votre signature. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous serez d&apos;accord.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse avec laquelle le message sera signé (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Choisir une adresse depuis le carnet d&apos;adresses</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Coller une adresse depuis le presse-papiers</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Entrez ici le message que vous désirez signer</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Signature</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copier la signature actuelle dans le presse-papiers</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this MP3Coin address</source> <translation>Signer le message pour prouver que vous détenez cette adresse MP3Coin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signer le &amp;message</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Remettre à zéro tous les champs de signature de message</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>&amp;Tout nettoyer</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Vérifier un message</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Entrez ci-dessous l&apos;adresse ayant servi à signer, le message (assurez-vous d&apos;avoir copié exactement les retours à la ligne, les espacements, tabulations etc.) et la signature pour vérifier le message. Faites attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé lui-même pour éviter d&apos;être trompé par une attaque d&apos;homme du milieu.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>L&apos;adresse avec laquelle le message a été signé (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified MP3Coin address</source> <translation>Vérifier le message pour vous assurer qu&apos;il a bien été signé par l&apos;adresse MP3Coin spécifiée</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Vérifier un &amp;message</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Remettre à zéro tous les champs de vérification de message</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a MP3Coin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Entrez une adresse MP3Coin (par ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Cliquez sur « Signer le message » pour générer la signature</translation> </message> <message> <location line="+3"/> <source>Enter MP3Coin signature</source> <translation>Entrer une signature MP3Coin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>L&apos;adresse entrée est invalide.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Veuillez vérifier l&apos;adresse et réessayez.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>L&apos;adresse entrée ne fait pas référence à une clef.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Le déverrouillage du porte-monnaie a été annulé.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>La clef privée pour l&apos;adresse indiquée n&apos;est pas disponible.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>La signature du message a échoué.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Le message a été signé.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>La signature n&apos;a pu être décodée.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Veuillez vérifier la signature et réessayez.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>La signature ne correspond pas au hachage du message.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Échec de la vérification du message.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Message vérifié.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The MP3Coin developers</source> <translation>Les développeurs MP3Coin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/hors ligne</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confirmée</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmations</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>État</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, diffusée à travers %n nœud</numerusform><numerusform>, diffusée à travers %n nœuds</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Source</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Génération</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>À</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>votre propre adresse</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>étiquette</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>arrive à maturité dans %n bloc</numerusform><numerusform>arrive à maturité dans %n blocs de plus</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>non accepté</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Frais de transaction</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Montant net</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Message</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Commentaire</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID de la transaction</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Les pièces générées doivent mûrir pendant 120 blocs avant de pouvoir être dépensées. Lorsque vous avez généré ce bloc, il a été diffusé sur le réseau pour être ajouté à la chaîne de blocs. S’il échoue a intégrer la chaîne, son état sera modifié en « non accepté » et il ne sera pas possible de le dépenser. Cela peut arriver occasionnellement si un autre nœud génère un bloc quelques secondes avant ou après vous.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informations de débogage</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transaction</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Entrées</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>vrai</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>faux</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, n’a pas encore été diffusée avec succès</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ouvert pour %n bloc de plus</numerusform><numerusform>Ouvert pour %n blocs de plus</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>inconnu</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Détails de la transaction</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Ce panneau affiche une description détaillée de la transaction</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Montant</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ouvert pour %n bloc de plus</numerusform><numerusform>Ouvert pour %n blocs de plus</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Ouvert jusqu&apos;à %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Hors ligne (%1 confirmations)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Non confirmée (%1 confirmations sur un total de %2)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmée (%1 confirmations)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Le solde généré (mined) sera disponible quand il aura mûri dans %n bloc</numerusform><numerusform>Le solde généré (mined) sera disponible quand il aura mûri dans %n blocs</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Ce bloc n’a été reçu par aucun autre nœud et ne sera probablement pas accepté !</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Généré mais pas accepté</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Reçue avec</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Reçue de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Envoyée à</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Paiement à vous-même</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Extraction</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(indisponible)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>État de la transaction. Laissez le pointeur de la souris sur ce champ pour voir le nombre de confirmations.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Date et heure de réception de la transaction.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Type de transaction.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>L’adresse de destination de la transaction.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Montant ajouté au, ou enlevé du, solde.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Toutes</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Aujourd’hui</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Cette semaine</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Ce mois-ci</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mois dernier</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Cette année</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervalle…</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Reçues avec</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Envoyées à</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>À vous-même</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Extraction</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Autres</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Entrez une adresse ou une étiquette à rechercher</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Montant min</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copier l’adresse</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copier l’étiquette</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copier le montant</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copier l&apos;ID de la transaction</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Éditer l’étiquette</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Afficher les détails de la transaction</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exporter les données des transactions</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Valeurs séparées par des virgules (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmée</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Date</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Type</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Étiquette</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresse</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Montant</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erreur lors de l’exportation</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossible d&apos;écrire dans le fichier %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervalle :</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>à</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Envoyer des pièces</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exporter</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exporter les données de l&apos;onglet courant vers un fichier</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Sauvegarder le porte-monnaie</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Données de porte-monnaie (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Échec de la sauvegarde</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Une erreur est survenue lors de l&apos;enregistrement des données de porte-monnaie à un nouvel endroit</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Sauvegarde réussie</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Les données de porte-monnaie ont été enregistrées avec succès sur le nouvel emplacement.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>MP3Coin version</source> <translation>Version de MP3Coin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Utilisation :</translation> </message> <message> <location line="-29"/> <source>Send command to -server or mp3coind</source> <translation>Envoyer une commande à -server ou à mp3coind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Lister les commandes</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Obtenir de l’aide pour une commande</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Options :</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: mp3coin.conf)</source> <translation>Spécifier le fichier de configuration (par défaut : mp3coin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: mp3coind.pid)</source> <translation>Spécifier le fichier PID (par défaut : mp3coind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Spécifier le répertoire de données</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Définir la taille du tampon en mégaoctets (par défaut : 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Écouter les connexions sur le &lt;port&gt; (par défaut : 9333 ou testnet : 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Garder au plus &lt;n&gt; connexions avec les pairs (par défaut : 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Se connecter à un nœud pour obtenir des adresses de pairs puis se déconnecter</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Spécifier votre propre adresse publique</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Seuil de déconnexion des pairs de mauvaise qualité (par défaut : 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Délai en secondes de refus de reconnexion aux pairs de mauvaise qualité (par défaut : 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Une erreur est survenue lors de la mise en place du port RPC %u pour écouter sur IPv4 : %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Écouter les connexions JSON-RPC sur le &lt;port&gt; (par défaut : 9332 ou tesnet : 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accepter les commandes de JSON-RPC et de la ligne de commande</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Fonctionner en arrière-plan en tant que démon et accepter les commandes</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utiliser le réseau de test</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accepter les connexions entrantes (par défaut : 1 si -proxy ou -connect ne sont pas présents)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=mp3coinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;MP3Coin Alert&quot; admin@foo.com </source> <translation>%s, vous devez définir un mot de passe rpc dans le fichier de configuration : %s Il vous est conseillé d&apos;utiliser le mot de passe aléatoire suivant : rpcuser=mp3coinrpc rpcpassword=%s (vous n&apos;avez pas besoin de retenir ce mot de passe) Le nom d&apos;utilisateur et le mot de passe NE DOIVENT PAS être identiques. Si le fichier n&apos;existe pas, créez-le avec les droits de lecture accordés au propriétaire. Il est aussi conseillé de régler alertnotify pour être prévenu des problèmes ; par exemple : alertnotify=echo %%s | mail -s &quot;MP3Coin Alert&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Une erreur est survenue lors de la mise en place du port RPC %u pour écouter sur IPv6, retour à IPv4 : %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Se lier à l&apos;adresse donnée et toujours l&apos;écouter. Utilisez la notation [host]:port pour l&apos;IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. MP3Coin is probably already running.</source> <translation>Impossible d’obtenir un verrou sur le répertoire de données %s. MP3Coin fonctionne probablement déjà.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erreur : la transaction a été rejetée ! Cela peut arriver si certaines pièces de votre porte-monnaie étaient déjà dépensées, par exemple si vous avez utilisé une copie de wallet.dat et les pièces ont été dépensées avec cette copie sans être marquées comme telles ici.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Erreur : cette transaction nécessite des frais de transaction d&apos;au moins %s en raison de son montant, de sa complexité ou parce que des fonds reçus récemment sont utilisés !</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Exécuter une commande lorsqu&apos;une alerte correspondante est reçue (%s dans la commande sera remplacé par le message)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Exécuter la commande lorsqu&apos;une transaction de porte-monnaie change (%s dans la commande est remplacée par TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Définir la taille maximale en octets des transactions prioritaires/à frais modiques (par défaut : 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Ceci est une pré-version de test - utilisez à vos risques et périls - ne l&apos;utilisez pas pour miner ou pour des applications marchandes</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Attention : -paytxfee est réglée sur un montant très élevé ! Il s&apos;agit des frais de transaction que vous payerez si vous émettez une transaction.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Avertissement : les transactions affichées pourraient être incorrectes ! Vous ou d&apos;autres nœuds du réseau pourriez avoir besoin d&apos;effectuer une mise à jour.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong MP3Coin will not work properly.</source> <translation>Attention : veuillez vérifier que l&apos;heure et la date de votre ordinateur sont correctes ! Si votre horloge n&apos;est pas à l&apos;heure, MP3Coin ne fonctionnera pas correctement.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Avertissement : une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement mais les données de transaction ou les entrées du carnet d&apos;adresses pourraient être incorrectes ou manquantes.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Avertissement : wallet.dat corrompu, données récupérées ! Le fichier wallet.dat original a été enregistré en tant que wallet.{horodatage}.bak dans %s ; si votre solde ou transactions sont incorrects vous devriez effectuer une restauration depuis une sauvegarde.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tenter de récupérer les clefs privées d&apos;un wallet.dat corrompu</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Options de création des blocs :</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Ne se connecter qu&apos;au(x) nœud(s) spécifié(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Base de données des blocs corrompue détectée</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Découvrir sa propre adresse IP (par défaut : 1 lors de l&apos;écoute et si -externalip n&apos;est pas présent)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Voulez-vous reconstruire la base de données des blocs maintenant ?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Erreur lors de l&apos;initialisation de la base de données des blocs</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Erreur lors de l&apos;initialisation de l&apos;environnement de la base de données du porte-monnaie %s !</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Erreur du chargement de la base de données des blocs</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Erreur lors de l&apos;ouverture de la base de données</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Erreur : l&apos;espace disque est faible !</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erreur : Porte-monnaie verrouillé, impossible de créer la transaction !</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Erreur : erreur système :</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Échec de l&apos;écoute sur un port quelconque. Utilisez -listen=0 si vous voulez cela.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>La lecture des informations de bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>La lecture du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>La synchronisation de l&apos;index des blocs a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>L&apos;&apos;écriture de l&apos;index des blocs a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>L&apos;écriture des informations du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>L&apos;écriture du bloc a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>L&apos;écriture des informations de fichier a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>L&apos;écriture dans la base de données des pièces a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>L&apos;écriture de l&apos;index des transactions a échoué</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>L&apos;écriture des données d&apos;annulation a échoué</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Trouver des pairs en utilisant la recherche DNS (par défaut : 1 sauf si -connect est utilisé)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Générer des pièces (défaut: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Nombre de blocs à vérifier au démarrage (par défaut : 288, 0 = tout)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Niveau d&apos;approfondissement de la vérification des blocs (0-4, par défaut : 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Pas assez de descripteurs de fichiers disponibles.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruire l&apos;index de la chaîne des blocs à partir des fichiers blk000??.dat actuels</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Définir le nombre d&apos;exétrons pour desservir les appels RPC (par défaut : 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Vérification des blocs...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Vérification du porte-monnaie...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importe des blocs depuis un fichier blk000??.dat externe</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Définir le nombre de fils d’exécution pour la vérification des scripts (maximum 16, 0 = auto, &lt; 0 = laisser ce nombre de cœurs libres, par défaut : 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informations</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Adresse -tor invalide : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -minrelayfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -mintxfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Maintenir un index complet des transactions (par défaut : 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Tampon maximal de réception par -connection, &lt;n&gt;*1000 octets (par défaut : 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Tampon maximal d&apos;envoi par connexion, &lt;n&gt;*1000 octets (par défaut : 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>N&apos;accepter que la chaîne de blocs correspondant aux points de vérification internes (par défaut : 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Se connecter uniquement aux nœuds du réseau &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Afficher des information de débogage supplémentaires. Cela signifie toutes les autres options -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Afficher des informations de débogage réseau supplémentaires</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Faire précéder les données de débogage par un horodatage</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the MP3Coin Wiki for SSL setup instructions)</source> <translation>Options SSL : (cf. le wiki de MP3Coin pour les instructions de configuration du SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Sélectionner la version du proxy socks à utiliser (4-5, 5 étant la valeur par défaut)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Envoyer les informations de débogage/trace au débogueur</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Définir la taille maximale des blocs en octets (par défaut : 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Définir la taille minimale des blocs en octets (par défaut : 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 lorsque -debug n&apos;est pas présent)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>La signature de la transaction a échoué</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Spécifier le délai d&apos;expiration de la connexion en millisecondes (par défaut : 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Erreur système :</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Montant de la transaction trop bas</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Les montants de la transaction doivent être positifs</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transaction trop volumineuse</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut : 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Utiliser l&apos;UPnP pour rediriger le port d&apos;écoute (par défaut : 1 lors de l&apos;écoute)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utiliser un proxy pour atteindre les services cachés de Tor (par défaut : même valeur que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nom d&apos;utilisateur pour les connexions JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Avertissement</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Avertissement : cette version est obsolète, une mise à jour est nécessaire !</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Vous devez reconstruire les bases de données avec -reindex pour modifier -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrompu, la récupération a échoué</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Mot de passe pour les connexions JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Autoriser les connexions JSON-RPC depuis l&apos;adresse IP spécifiée</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Envoyer des commandes au nœud fonctionnant à &lt;ip&gt; (par défaut : 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Exécuter la commande lorsque le meilleur bloc change (%s est remplacé par le hachage du bloc dans cmd)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Mettre à jour le format du porte-monnaie</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Régler la taille de la plage de clefs sur &lt;n&gt; (par défaut : 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Réanalyser la chaîne de blocs pour les transactions de porte-monnaie manquantes</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utiliser OpenSSL (https) pour les connexions JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Fichier de certificat serveur (par défaut : server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clef privée du serveur (par défaut : server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Clefs de chiffrement acceptables (par défaut : TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Ce message d&apos;aide</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Impossible de se lier à %s sur cet ordinateur (bind a retourné l&apos;erreur %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Connexion via un proxy socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Autoriser les recherches DNS pour -addnode, -seednode et -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Chargement des adresses…</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erreur lors du chargement de wallet.dat : porte-monnaie corrompu</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of MP3Coin</source> <translation>Erreur lors du chargement de wallet.dat : le porte-monnaie nécessite une version plus récente de MP3Coin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart MP3Coin to complete</source> <translation>Le porte-monnaie nécessitait une réécriture : veuillez redémarrer MP3Coin pour terminer l&apos;opération</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Erreur lors du chargement de wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Adresse -proxy invalide : « %s »</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Réseau inconnu spécifié sur -onlynet : « %s »</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Version inconnue de proxy -socks demandée : %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -bind : « %s »</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Impossible de résoudre l&apos;adresse -externalip : « %s »</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Montant invalide pour -paytxfee=&lt;montant&gt; : « %s »</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Montant invalide</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fonds insuffisants</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Chargement de l’index des blocs…</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Ajouter un nœud auquel se connecter et tenter de garder la connexion ouverte</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. MP3Coin is probably already running.</source> <translation>Impossible de se lier à %s sur cet ordinateur. MP3Coin fonctionne probablement déjà.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Frais par Ko à ajouter aux transactions que vous enverrez</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Chargement du porte-monnaie…</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Impossible de revenir à une version antérieure du porte-monnaie</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Impossible d&apos;écrire l&apos;adresse par défaut</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Nouvelle analyse…</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Chargement terminé</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Pour utiliser l&apos;option %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Erreur</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Vous devez ajouter la ligne rpcpassword=&lt;mot-de-passe&gt; au fichier de configuration : %s Si le fichier n&apos;existe pas, créez-le avec les droits de lecture seule accordés au propriétaire.</translation> </message> </context> </TS>
{ "content_hash": "ed968d1084abe26bb043cc474fad033d", "timestamp": "", "source": "github", "line_count": 2938, "max_line_length": 448, "avg_line_length": 41.389380530973455, "alnum_prop": 0.6379582572655055, "repo_name": "mp3-coin/master", "id": "4ed3a9647e2a61260fda3a13bfb2ecd32454a1b3", "size": "122584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_fr.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "92422" }, { "name": "C++", "bytes": "2553007" }, { "name": "CSS", "bytes": "1127" }, { "name": "Objective-C++", "bytes": "5864" }, { "name": "Python", "bytes": "69709" }, { "name": "Shell", "bytes": "13173" }, { "name": "TypeScript", "bytes": "5232184" } ], "symlink_target": "" }
typedef enum { KSVeneerViewAnimationFade, KSVeneerViewAnimationSwap, KSVeneerViewAnimationNone } KSVeneerViewAnimation; typedef enum { KSVeneerViewAxisY, KSVeneerViewAxisX, KSVeneerViewAxisNone } KSVeneerViewAxis; @interface KSVeneerView : UIView <UIScrollViewDelegate> @property (nonatomic, weak) id <KSVeneerViewDelegate> delegate; @property (nonatomic, weak) id <KSVeneerViewDataSource> source; @property (nonatomic, assign) BOOL editing; @property (nonatomic, assign) KSVeneerViewAxis axis; - (UIView *)dequeueReusableCellWithIdentifier:(NSString *)identifier; - (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier; - (void)registerClass:(Class)klass forCellReuseIdentifier:(NSString *)identifier; - (void)insertViewAtIndexPath:(NSIndexPath *)path withAnimation:(KSVeneerViewAnimation)animation; - (void)deleteViewAtIndexPath:(NSIndexPath *)path withAnimation:(KSVeneerViewAnimation)animation; - (void)insertViewsAtIndexPaths:(NSArray *)paths withAnimation:(KSVeneerViewAnimation)animation; - (void)deleteViewsAtIndexPaths:(NSArray *)paths withAnimation:(KSVeneerViewAnimation)animation; - (void)insertSections:(NSIndexSet *)sections withAnimation:(KSVeneerViewAnimation)animation; - (void)deleteSections:(NSIndexSet *)sections withAnimation:(KSVeneerViewAnimation)animation; - (void)insertSection:(NSInteger)section withAnimation:(KSVeneerViewAnimation)animation; - (void)deleteSection:(NSInteger)section withAnimation:(KSVeneerViewAnimation)animation; - (NSInteger)numberOfCellsInSection:(NSInteger)section; - (NSInteger)numberOfSections; - (void)reload; @end
{ "content_hash": "81c6d74c1cede8c9a94cc16349ba1856", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 38.73809523809524, "alnum_prop": 0.8149969268592502, "repo_name": "ksylvest/veneer", "id": "a1d51688225bece9b92138ef3b2d64e7a093d9d8", "size": "1854", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Veneer/Veneer/KSVeneerView.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "24484" }, { "name": "Ruby", "bytes": "370" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "a7d4a97fcb93a1fecd189703202dceb6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "18010500803e45c58ddab98bc9393c3fb132c68c", "size": "181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Bacillariophyta/Bacillariophyceae/Bacillariales/Bacillariaceae/Tryblionella/Tryblionella ardua/ Syn. Nitzschia ardua/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef __MEMCHECK_H #define __MEMCHECK_H /* This file is for inclusion into client (your!) code. You can use these macros to manipulate and query memory permissions inside your own programs. See comment near the top of valgrind.h on how to use them. */ #include "valgrind.h" /* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! This enum comprises an ABI exported by Valgrind to programs which use client requests. DO NOT CHANGE THE ORDER OF THESE ENTRIES, NOR DELETE ANY -- add new ones at the end. */ typedef enum { VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE('M', 'C'), VG_USERREQ__MAKE_MEM_UNDEFINED, VG_USERREQ__MAKE_MEM_DEFINED, VG_USERREQ__DISCARD, VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE, VG_USERREQ__CHECK_MEM_IS_DEFINED, VG_USERREQ__DO_LEAK_CHECK, VG_USERREQ__COUNT_LEAKS, VG_USERREQ__GET_VBITS, VG_USERREQ__SET_VBITS, VG_USERREQ__CREATE_BLOCK, VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, /* This is just for memcheck's internal use - don't use it */ _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR = VG_USERREQ_TOOL_BASE('M', 'C') + 256 } Vg_MemCheckClientRequest; /* Client-code macros to manipulate the state of memory. */ /* Mark memory at _qzz_addr as unaddressable for _qzz_len bytes. */ #define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__MAKE_MEM_NOACCESS, \ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Similarly, mark memory at _qzz_addr as addressable but undefined for _qzz_len bytes. */ #define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__MAKE_MEM_UNDEFINED, \ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Similarly, mark memory at _qzz_addr as addressable and defined for _qzz_len bytes. */ #define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__MAKE_MEM_DEFINED, \ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Similar to VALGRIND_MAKE_MEM_DEFINED except that addressability is not altered: bytes which are addressable are marked as defined, but those which are not addressable are left unchanged. */ #define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, \ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Create a block-description handle. The description is an ascii string which is included in any messages pertaining to addresses within the specified memory range. Has no other effect on the properties of the memory range. */ #define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__CREATE_BLOCK, \ _qzz_addr, _qzz_len, _qzz_desc, \ 0, 0); \ _qzz_res; \ })) /* Discard a block-description-handle. Returns 1 for an invalid handle, 0 for a valid handle. */ #define VALGRIND_DISCARD(_qzz_blkindex) \ (__extension__ ({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \ VG_USERREQ__DISCARD, \ 0, _qzz_blkindex, 0, 0, 0); \ _qzz_res; \ })) /* Client-code macros to check the state of memory. */ /* Check that memory at _qzz_addr is addressable for _qzz_len bytes. If suitable addressibility is not established, Valgrind prints an error message and returns the address of the first offending byte. Otherwise it returns zero. */ #define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,\ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Check that memory at _qzz_addr is addressable and defined for _qzz_len bytes. If suitable addressibility and definedness are not established, Valgrind prints an error message and returns the address of the first offending byte. Otherwise it returns zero. */ #define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) \ (__extension__({unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__CHECK_MEM_IS_DEFINED, \ _qzz_addr, _qzz_len, 0, 0, 0); \ _qzz_res; \ })) /* Use this macro to force the definedness and addressibility of an lvalue to be checked. If suitable addressibility and definedness are not established, Valgrind prints an error message and returns the address of the first offending byte. Otherwise it returns zero. */ #define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue) \ VALGRIND_CHECK_MEM_IS_DEFINED( \ (volatile unsigned char *)&(__lvalue), \ (unsigned long)(sizeof (__lvalue))) /* Do a memory leak check mid-execution. */ #define VALGRIND_DO_LEAK_CHECK \ {unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__DO_LEAK_CHECK, \ 0, 0, 0, 0, 0); \ } /* Just display summaries of leaked memory, rather than all the details */ #define VALGRIND_DO_QUICK_LEAK_CHECK \ {unsigned long _qzz_res; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__DO_LEAK_CHECK, \ 1, 0, 0, 0, 0); \ } /* Return number of leaked, dubious, reachable and suppressed bytes found by all previous leak checks. They must be lvalues. */ #define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed) \ /* For safety on 64-bit platforms we assign the results to private unsigned long variables, then assign these to the lvalues the user specified, which works no matter what type 'leaked', 'dubious', etc are. We also initialise '_qzz_leaked', etc because VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as initialised. */ \ {unsigned long _qzz_res; \ unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \ unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__COUNT_LEAKS, \ &_qzz_leaked, &_qzz_dubious, \ &_qzz_reachable, &_qzz_suppressed, 0); \ leaked = _qzz_leaked; \ dubious = _qzz_dubious; \ reachable = _qzz_reachable; \ suppressed = _qzz_suppressed; \ } /* Get the validity data for addresses [zza..zza+zznbytes-1] and copy it into the provided zzvbits array. Return values: 0 if not running on valgrind 1 success 2 [previously indicated unaligned arrays; these are now allowed] 3 if any parts of zzsrc/zzvbits are not addressable. The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call. */ #define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \ (__extension__({unsigned long _qzz_res; \ char* czza = (char*)zza; \ char* czzvbits = (char*)zzvbits; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__GET_VBITS, \ czza, czzvbits, zznbytes, 0, 0 ); \ _qzz_res; \ })) /* Set the validity data for addresses [zza..zza+zznbytes-1], copying it from the provided zzvbits array. Return values: 0 if not running on valgrind 1 success 2 [previously indicated unaligned arrays; these are now allowed] 3 if any parts of zza/zzvbits are not addressable. The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call. */ #define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \ (__extension__({unsigned int _qzz_res; \ char* czza = (char*)zza; \ char* czzvbits = (char*)zzvbits; \ VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ VG_USERREQ__SET_VBITS, \ czza, czzvbits, zznbytes, 0, 0 ); \ _qzz_res; \ })) #endif
{ "content_hash": "2221dea2c45c236c791fbba9fcb2c0b7", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 83, "avg_line_length": 46.60087719298246, "alnum_prop": 0.5093647058823529, "repo_name": "brabander/olsr", "id": "5282fa575c3c7ac2d08ba45b0a8c5b43b8bba635", "size": "13205", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/valgrind/memcheck.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "2081628" }, { "name": "C++", "bytes": "119927" }, { "name": "Perl", "bytes": "7477" }, { "name": "Prolog", "bytes": "257" }, { "name": "Shell", "bytes": "13585" } ], "symlink_target": "" }
package com.mxgraph.view; import com.mxgraph.canvas.mxGraphics2DCanvas; import com.mxgraph.canvas.mxICanvas; import com.mxgraph.canvas.mxImageCanvas; import com.mxgraph.model.*; import com.mxgraph.model.mxGraphModel.*; import com.mxgraph.util.*; import com.mxgraph.util.mxUndoableEdit.mxUndoableChange; import consulo.util.pointers.Named; import org.w3c.dom.Element; import java.awt.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.*; import java.util.List; /** * Implements a graph object that allows to create diagrams from a graph model * and stylesheet. * <p/> * <h3>Images</h3> * To create an image from a graph, use the following code for a given * XML document (doc) and File (file): * <p/> * <code> * Image img = mxCellRenderer.createBufferedImage( * graph, null, 1, Color.WHITE, false, null); * ImageIO.write(img, "png", file); * </code> * <p/> * If the XML is given as a string rather than a document, the document can * be obtained using mxUtils.parse. * <p/> * This class fires the following events: * <p/> * mxEvent.ROOT fires if the root in the model has changed. This event has no * properties. * <p/> * mxEvent.ALIGN_CELLS fires between begin- and endUpdate in alignCells. The * <code>cells</code> and <code>align</code> properties contain the respective * arguments that were passed to alignCells. * <p/> * mxEvent.FLIP_EDGE fires between begin- and endUpdate in flipEdge. The * <code>edge</code> property contains the edge passed to flipEdge. * <p/> * mxEvent.ORDER_CELLS fires between begin- and endUpdate in orderCells. The * <code>cells</code> and <code>back</code> properties contain the respective * arguments that were passed to orderCells. * <p/> * mxEvent.CELLS_ORDERED fires between begin- and endUpdate in cellsOrdered. * The <code>cells</code> and <code>back</code> arguments contain the * respective arguments that were passed to cellsOrdered. * <p/> * mxEvent.GROUP_CELLS fires between begin- and endUpdate in groupCells. The * <code>group</code>, <code>cells</code> and <code>border</code> arguments * contain the respective arguments that were passed to groupCells. * <p/> * mxEvent.UNGROUP_CELLS fires between begin- and endUpdate in ungroupCells. * The <code>cells</code> property contains the array of cells that was passed * to ungroupCells. * <p/> * mxEvent.REMOVE_CELLS_FROM_PARENT fires between begin- and endUpdate in * removeCellsFromParent. The <code>cells</code> property contains the array of * cells that was passed to removeCellsFromParent. * <p/> * mxEvent.ADD_CELLS fires between begin- and endUpdate in addCells. The * <code>cells</code>, <code>parent</code>, <code>index</code>, * <code>source</code> and <code>target</code> properties contain the * respective arguments that were passed to addCells. * <p/> * mxEvent.CELLS_ADDED fires between begin- and endUpdate in cellsAdded. The * <code>cells</code>, <code>parent</code>, <code>index</code>, * <code>source</code>, <code>target</code> and <code>absolute</code> * properties contain the respective arguments that were passed to cellsAdded. * <p/> * mxEvent.REMOVE_CELLS fires between begin- and endUpdate in removeCells. The * <code>cells</code> and <code>includeEdges</code> arguments contain the * respective arguments that were passed to removeCells. * <p/> * mxEvent.CELLS_REMOVED fires between begin- and endUpdate in cellsRemoved. * The <code>cells</code> argument contains the array of cells that was * removed. * <p/> * mxEvent.SPLIT_EDGE fires between begin- and endUpdate in splitEdge. The * <code>edge</code> property contains the edge to be splitted, the * <code>cells</code>, <code>newEdge</code>, <code>dx</code> and * <code>dy</code> properties contain the respective arguments that were passed * to splitEdge. * <p/> * mxEvent.TOGGLE_CELLS fires between begin- and endUpdate in toggleCells. The * <code>show</code>, <code>cells</code> and <code>includeEdges</code> * properties contain the respective arguments that were passed to toggleCells. * <p/> * mxEvent.FOLD_CELLS fires between begin- and endUpdate in foldCells. The * <code>collapse</code>, <code>cells</code> and <code>recurse</code> * properties contain the respective arguments that were passed to foldCells. * <p/> * mxEvent.CELLS_FOLDED fires between begin- and endUpdate in cellsFolded. The * <code>collapse</code>, <code>cells</code> and <code>recurse</code> * properties contain the respective arguments that were passed to cellsFolded. * <p/> * mxEvent.UPDATE_CELL_SIZE fires between begin- and endUpdate in * updateCellSize. The <code>cell</code> and <code>ignoreChildren</code> * properties contain the respective arguments that were passed to * updateCellSize. * <p/> * mxEvent.RESIZE_CELLS fires between begin- and endUpdate in resizeCells. The * <code>cells</code> and <code>bounds</code> properties contain the respective * arguments that were passed to resizeCells. * <p/> * mxEvent.CELLS_RESIZED fires between begin- and endUpdate in cellsResized. * The <code>cells</code> and <code>bounds</code> properties contain the * respective arguments that were passed to cellsResized. * <p/> * mxEvent.MOVE_CELLS fires between begin- and endUpdate in moveCells. The * <code>cells</code>, <code>dx</code>, <code>dy</code>, <code>clone</code>, * <code>target</code> and <code>location</code> properties contain the * respective arguments that were passed to moveCells. * <p/> * mxEvent.CELLS_MOVED fires between begin- and endUpdate in cellsMoved. The * <code>cells</code>, <code>dx</code>, <code>dy</code> and * <code>disconnect</code> properties contain the respective arguments that * were passed to cellsMoved. * <p/> * mxEvent.CONNECT_CELL fires between begin- and endUpdate in connectCell. The * <code>edge</code>, <code>terminal</code> and <code>source</code> properties * contain the respective arguments that were passed to connectCell. * <p/> * mxEvent.CELL_CONNECTED fires between begin- and endUpdate in cellConnected. * The <code>edge</code>, <code>terminal</code> and <code>source</code> * properties contain the respective arguments that were passed to * cellConnected. * <p/> * mxEvent.REPAINT fires if a repaint was requested by calling repaint. The * <code>region</code> property contains the optional mxRectangle that was * passed to repaint to define the dirty region. */ public class mxGraph extends mxEventSource { /** * Adds required resources. */ static { try { mxResources.add("com.mxgraph.resources.graph"); } catch (Exception e) { // ignore } } /** * Holds the version number of this release. Current version * is 2.2.0.1. */ public static final String VERSION = "2.2.0.1"; /** * */ public interface mxICellVisitor { /** * @param vertex * @param edge */ boolean visit(Object vertex, Object edge); } /** * Property change event handling. */ protected PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); /** * Holds the model that contains the cells to be displayed. */ protected mxIGraphModel model; /** * Holds the view that caches the cell states. */ protected mxGraphView view; /** * Holds the stylesheet that defines the appearance of the cells. */ protected mxStylesheet stylesheet; /** * Holds the <mxGraphSelection> that models the current selection. */ protected mxGraphSelectionModel selectionModel; /** * Specifies the grid size. Default is 10. */ protected int gridSize = 10; /** * Specifies if the grid is enabled. Default is true. */ protected boolean gridEnabled = true; /** * Value returned by getOverlap if isAllowOverlapParent returns * true for the given cell. getOverlap is used in keepInside if * isKeepInsideParentOnMove returns true. The value specifies the * portion of the child which is allowed to overlap the parent. */ protected double defaultOverlap = 0.5; /** * Specifies the default parent to be used to insert new cells. * This is used in getDefaultParent. Default is null. */ protected Object defaultParent; /** * Specifies the alternate edge style to be used if the main control point * on an edge is being doubleclicked. Default is null. */ protected String alternateEdgeStyle; /** * Specifies the return value for isEnabled. Default is true. */ protected boolean enabled = true; /** * Specifies the return value for isCell(s)Locked. Default is false. */ protected boolean cellsLocked = false; /** * Specifies the return value for isCell(s)Editable. Default is true. */ protected boolean cellsEditable = true; /** * Specifies the return value for isCell(s)Sizable. Default is true. */ protected boolean cellsResizable = true; /** * Specifies the return value for isCell(s)Movable. Default is true. */ protected boolean cellsMovable = true; /** * Specifies the return value for isCell(s)Bendable. Default is true. */ protected boolean cellsBendable = true; /** * Specifies the return value for isCell(s)Selectable. Default is true. */ protected boolean cellsSelectable = true; /** * Specifies the return value for isCell(s)Deletable. Default is true. */ protected boolean cellsDeletable = true; /** * Specifies the return value for isCell(s)Cloneable. Default is true. */ protected boolean cellsCloneable = true; /** * Specifies the return value for isCellDisconntableFromTerminal. Default * is true. */ protected boolean cellsDisconnectable = true; /** * Specifies the return value for isLabel(s)Clipped. Default is false. */ protected boolean labelsClipped = false; /** * Specifies the return value for edges in isLabelMovable. Default is true. */ protected boolean edgeLabelsMovable = true; /** * Specifies the return value for vertices in isLabelMovable. Default is false. */ protected boolean vertexLabelsMovable = false; /** * Specifies the return value for isDropEnabled. Default is true. */ protected boolean dropEnabled = true; /** * Specifies if dropping onto edges should be enabled. Default is true. */ protected boolean splitEnabled = true; /** * Specifies if the graph should automatically update the cell size * after an edit. This is used in isAutoSizeCell. Default is false. */ protected boolean autoSizeCells = false; /** * <mxRectangle> that specifies the area in which all cells in the * diagram should be placed. Uses in getMaximumGraphBounds. Use a width * or height of 0 if you only want to give a upper, left corner. */ protected mxRectangle maximumGraphBounds = null; /** * mxRectangle that specifies the minimum size of the graph canvas inside * the scrollpane. */ protected mxRectangle minimumGraphSize = null; /** * Border to be added to the bottom and right side when the container is * being resized after the graph has been changed. Default is 0. */ protected int border = 0; /** * Specifies if edges should appear in the foreground regardless of their * order in the model. This has precendence over keepEdgeInBackground * Default is false. */ protected boolean keepEdgesInForeground = false; /** * Specifies if edges should appear in the background regardless of their * order in the model. Default is false. */ protected boolean keepEdgesInBackground = false; /** * Specifies if the cell size should be changed to the preferred size when * a cell is first collapsed. Default is true. */ protected boolean collapseToPreferredSize = true; /** * Specifies if negative coordinates for vertices are allowed. Default is true. */ protected boolean allowNegativeCoordinates = true; /** * Specifies the return value for isConstrainChildren. Default is true. */ protected boolean constrainChildren = true; /** * Specifies if a parent should contain the child bounds after a resize of * the child. Default is true. */ protected boolean extendParents = true; /** * Specifies if parents should be extended according to the <extendParents> * switch if cells are added. Default is true. */ protected boolean extendParentsOnAdd = true; /** * Specifies if the scale and translate should be reset if * the root changes in the model. Default is true. */ protected boolean resetViewOnRootChange = true; /** * Specifies if loops (aka self-references) are allowed. * Default is false. */ protected boolean resetEdgesOnResize = false; /** * Specifies if edge control points should be reset after * the move of a connected cell. Default is false. */ protected boolean resetEdgesOnMove = false; /** * Specifies if edge control points should be reset after * the the edge has been reconnected. Default is true. */ protected boolean resetEdgesOnConnect = true; /** * Specifies if loops (aka self-references) are allowed. * Default is false. */ protected boolean allowLoops = false; /** * Specifies the multiplicities to be used for validation of the graph. */ protected mxMultiplicity[] multiplicities; /** * Specifies the default style for loops. */ protected mxEdgeStyle.mxEdgeStyleFunction defaultLoopStyle = mxEdgeStyle.Loop; /** * Specifies if multiple edges in the same direction between * the same pair of vertices are allowed. Default is true. */ protected boolean multigraph = true; /** * Specifies if edges are connectable. Default is false. * This overrides the connectable field in edges. */ protected boolean connectableEdges = false; /** * Specifies if edges with disconnected terminals are * allowed in the graph. Default is false. */ protected boolean allowDanglingEdges = true; /** * Specifies if edges that are cloned should be validated and only inserted * if they are valid. Default is true. */ protected boolean cloneInvalidEdges = false; /** * Specifies if edges should be disconnected from their terminals when they * are moved. Default is true. */ protected boolean disconnectOnMove = true; /** * Specifies if labels should be visible. This is used in * getLabel. Default is true. */ protected boolean labelsVisible = true; /** * Specifies if nesting of swimlanes is allowed. Default is true. */ protected boolean swimlaneNesting = true; /** * Specifies the maximum number of changes that should be processed to find * the dirty region. If the number of changes is larger, then the complete * grah is repainted. A value of zero will always compute the dirty region * for any number of changes. Default is 1000. */ protected int changesRepaintThreshold = 1000; /** * Specifies if the origin should be automatically updated. */ protected boolean autoOrigin = false; /** * Holds the current automatic origin. */ protected mxPoint origin = new mxPoint(); /** * Holds the list of bundles. */ protected static List<mxImageBundle> imageBundles = new LinkedList<mxImageBundle>(); /** * Fires repaint events for full repaints. */ protected mxIEventListener fullRepaintHandler = new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { repaint(); } }; /** * Fires repaint events for full repaints. */ protected mxIEventListener updateOriginHandler = new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { if (isAutoOrigin()) { updateOrigin(); } } }; /** * Fires repaint events for model changes. */ protected mxIEventListener graphModelChangeHandler = new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { mxRectangle dirty = graphModelChanged((mxIGraphModel)sender, (List<mxUndoableChange>)((mxUndoableEdit)evt.getProperty("edit")).getChanges()); repaint(dirty); } }; /** * Constructs a new graph with an empty * {@link com.mxgraph.model.mxGraphModel}. */ public mxGraph() { this(null, null); } /** * Constructs a new graph for the specified model. If no model is * specified, then a new, empty {@link com.mxgraph.model.mxGraphModel} is * used. * * @param model Model that contains the graph data */ public mxGraph(mxIGraphModel model) { this(model, null); } /** * Constructs a new graph for the specified model. If no model is * specified, then a new, empty {@link com.mxgraph.model.mxGraphModel} is * used. * * @param stylesheet The stylesheet to use for the graph. */ public mxGraph(mxStylesheet stylesheet) { this(null, stylesheet); } /** * Constructs a new graph for the specified model. If no model is * specified, then a new, empty {@link com.mxgraph.model.mxGraphModel} is * used. * * @param model Model that contains the graph data */ public mxGraph(mxIGraphModel model, mxStylesheet stylesheet) { selectionModel = createSelectionModel(); setModel((model != null) ? model : new mxGraphModel()); setStylesheet((stylesheet != null) ? stylesheet : createStylesheet()); setView(createGraphView()); } /** * Constructs a new selection model to be used in this graph. */ protected mxGraphSelectionModel createSelectionModel() { return new mxGraphSelectionModel(this); } /** * Constructs a new stylesheet to be used in this graph. */ protected mxStylesheet createStylesheet() { return new mxStylesheet(); } /** * Constructs a new view to be used in this graph. */ protected mxGraphView createGraphView() { return new mxGraphView(this); } /** * Returns the graph model that contains the graph data. * * @return Returns the model that contains the graph data */ public mxIGraphModel getModel() { return model; } /** * Sets the graph model that contains the data, and fires an * mxEvent.CHANGE followed by an mxEvent.REPAINT event. * * @param value Model that contains the graph data */ public void setModel(mxIGraphModel value) { if (model != null) { model.removeListener(graphModelChangeHandler); } Object oldModel = model; model = value; if (view != null) { view.revalidate(); } model.addListener(mxEvent.CHANGE, graphModelChangeHandler); changeSupport.firePropertyChange("model", oldModel, model); repaint(); } /** * Returns the view that contains the cell states. * * @return Returns the view that contains the cell states */ public mxGraphView getView() { return view; } /** * Sets the view that contains the cell states. * * @param value View that contains the cell states */ public void setView(mxGraphView value) { if (view != null) { view.removeListener(fullRepaintHandler); view.removeListener(updateOriginHandler); } Object oldView = view; view = value; if (view != null) { view.revalidate(); } // Listens to changes in the view view.addListener(mxEvent.SCALE, fullRepaintHandler); view.addListener(mxEvent.SCALE, updateOriginHandler); view.addListener(mxEvent.TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, updateOriginHandler); view.addListener(mxEvent.UP, fullRepaintHandler); view.addListener(mxEvent.DOWN, fullRepaintHandler); changeSupport.firePropertyChange("view", oldView, view); } /** * Returns the stylesheet that provides the style. * * @return Returns the stylesheet that provides the style. */ public mxStylesheet getStylesheet() { return stylesheet; } /** * Sets the stylesheet that provides the style. * * @param value Stylesheet that provides the style. */ public void setStylesheet(mxStylesheet value) { mxStylesheet oldValue = stylesheet; stylesheet = value; changeSupport.firePropertyChange("stylesheet", oldValue, stylesheet); } /** * Returns the cells to be selected for the given list of changes. */ public Object[] getSelectionCellsForChanges(List<mxUndoableChange> changes) { List<Object> cells = new ArrayList<Object>(); Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { Object change = it.next(); if (change instanceof mxChildChange) { cells.add(((mxChildChange)change).getChild()); } else if (change instanceof mxTerminalChange) { cells.add(((mxTerminalChange)change).getCell()); } else if (change instanceof mxValueChange) { cells.add(((mxValueChange)change).getCell()); } else if (change instanceof mxStyleChange) { cells.add(((mxStyleChange)change).getCell()); } else if (change instanceof mxGeometryChange) { cells.add(((mxGeometryChange)change).getCell()); } else if (change instanceof mxCollapseChange) { cells.add(((mxCollapseChange)change).getCell()); } else if (change instanceof mxVisibleChange) { mxVisibleChange vc = (mxVisibleChange)change; if (vc.isVisible()) { cells.add(((mxVisibleChange)change).getCell()); } } } return mxGraphModel.getTopmostCells(model, cells.toArray()); } /** * Called when the graph model changes. Invokes processChange on each * item of the given array to update the view accordingly. */ public mxRectangle graphModelChanged(mxIGraphModel sender, List<mxUndoableChange> changes) { int thresh = getChangesRepaintThreshold(); boolean ignoreDirty = thresh > 0 && changes.size() > thresh; // Ignores dirty rectangle if there was a root change if (!ignoreDirty) { Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { if (it.next() instanceof mxRootChange) { ignoreDirty = true; break; } } } mxRectangle dirty = processChanges(changes, true, ignoreDirty); view.validate(); if (isAutoOrigin()) { updateOrigin(); } if (!ignoreDirty) { mxRectangle tmp = processChanges(changes, false, ignoreDirty); if (tmp != null) { if (dirty == null) { dirty = tmp; } else { dirty.add(tmp); } } } removeSelectionCells(getRemovedCellsForChanges(changes)); return dirty; } /** * Extends the canvas by doing another validation with a shifted * global translation if the bounds of the graph are below (0,0). * <p/> * The first validation is required to compute the bounds of the graph * while the second validation is required to apply the new translate. */ protected void updateOrigin() { mxRectangle bounds = getGraphBounds(); if (bounds != null) { double scale = getView().getScale(); double x = bounds.getX() / scale - getBorder(); double y = bounds.getY() / scale - getBorder(); if (x < 0 || y < 0) { double x0 = Math.min(0, x); double y0 = Math.min(0, y); origin.setX(origin.getX() + x0); origin.setY(origin.getY() + y0); mxPoint t = getView().getTranslate(); getView().setTranslate(new mxPoint(t.getX() - x0, t.getY() - y0)); } else if ((x > 0 || y > 0) && (origin.getX() < 0 || origin.getY() < 0)) { double dx = Math.min(-origin.getX(), x); double dy = Math.min(-origin.getY(), y); origin.setX(origin.getX() + dx); origin.setY(origin.getY() + dy); mxPoint t = getView().getTranslate(); getView().setTranslate(new mxPoint(t.getX() - dx, t.getY() - dy)); } } } /** * Returns the cells that have been removed from the model. */ public Object[] getRemovedCellsForChanges(List<mxUndoableChange> changes) { List<Object> result = new ArrayList<Object>(); Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { Object change = it.next(); if (change instanceof mxRootChange) { break; } else if (change instanceof mxChildChange) { mxChildChange cc = (mxChildChange)change; if (cc.getParent() == null) { result.addAll(mxGraphModel.getDescendants(model, cc.getChild())); } } else if (change instanceof mxVisibleChange) { Object cell = ((mxVisibleChange)change).getCell(); result.addAll(mxGraphModel.getDescendants(model, cell)); } } return result.toArray(); } /** * Processes the changes and returns the minimal rectangle to be * repainted in the buffer. A return value of null means no repaint * is required. */ public mxRectangle processChanges(List<mxUndoableChange> changes, boolean invalidate, boolean ignoreDirty) { mxRectangle bounds = null; Iterator<mxUndoableChange> it = changes.iterator(); while (it.hasNext()) { mxRectangle rect = processChange(it.next(), invalidate, ignoreDirty); if (bounds == null) { bounds = rect; } else { bounds.add(rect); } } return bounds; } /** * Processes the given change and invalidates the respective cached data * in <view>. This fires a <root> event if the root has changed in the * model. */ public mxRectangle processChange(mxUndoableChange change, boolean invalidate, boolean ignoreDirty) { mxRectangle result = null; if (change instanceof mxRootChange) { result = (ignoreDirty) ? null : getGraphBounds(); if (invalidate) { clearSelection(); removeStateForCell(((mxRootChange)change).getPrevious()); if (isResetViewOnRootChange()) { view.setEventsEnabled(false); try { view.scaleAndTranslate(1, 0, 0); } finally { view.setEventsEnabled(true); } } } fireEvent(new mxEventObject(mxEvent.ROOT)); } else if (change instanceof mxChildChange) { mxChildChange cc = (mxChildChange)change; // Repaints the parent area if it is a rendered cell (vertex or // edge) otherwise only the child area is repainted, same holds // if the parent and previous are the same object, in which case // only the child area needs to be repainted (change of order) if (!ignoreDirty) { if (cc.getParent() != cc.getPrevious()) { if (model.isVertex(cc.getParent()) || model.isEdge(cc.getParent())) { result = getBoundingBox(cc.getParent(), true, true); } if (model.isVertex(cc.getPrevious()) || model.isEdge(cc.getPrevious())) { if (result != null) { result.add(getBoundingBox(cc.getPrevious(), true, true)); } else { result = getBoundingBox(cc.getPrevious(), true, true); } } } if (result == null) { result = getBoundingBox(cc.getChild(), true, true); } } if (invalidate) { if (cc.getParent() != null) { view.clear(cc.getChild(), false, true); } else { removeStateForCell(cc.getChild()); } } } else if (change instanceof mxTerminalChange) { Object cell = ((mxTerminalChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(cell, true); } if (invalidate) { view.invalidate(cell); } } else if (change instanceof mxValueChange) { Object cell = ((mxValueChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(cell); } if (invalidate) { view.clear(cell, false, false); } } else if (change instanceof mxStyleChange) { Object cell = ((mxStyleChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(cell, true); } if (invalidate) { // TODO: Add includeEdges argument to clear method for // not having to call invalidate in this case (where it // is possible that the perimeter has changed, which // means the connected edges need to be invalidated) view.clear(cell, false, false); view.invalidate(cell); } } else if (change instanceof mxGeometryChange) { Object cell = ((mxGeometryChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(cell, true, true); } if (invalidate) { view.invalidate(cell); } } else if (change instanceof mxCollapseChange) { Object cell = ((mxCollapseChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(((mxCollapseChange)change).getCell(), true, true); } if (invalidate) { removeStateForCell(cell); } } else if (change instanceof mxVisibleChange) { Object cell = ((mxVisibleChange)change).getCell(); if (!ignoreDirty) { result = getBoundingBox(((mxVisibleChange)change).getCell(), true, true); } if (invalidate) { removeStateForCell(cell); } } return result; } /** * Removes all cached information for the given cell and its descendants. * This is called when a cell was removed from the model. * * @param cell Cell that was removed from the model. */ protected void removeStateForCell(Object cell) { int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { removeStateForCell(model.getChildAt(cell, i)); } view.removeState(cell); } // // Cell styles // /** * Returns an array of key, value pairs representing the cell style for the * given cell. If no string is defined in the model that specifies the * style, then the default style for the cell is returned or <EMPTY_ARRAY>, * if not style can be found. * * @param cell Cell whose style should be returned. * @return Returns the style of the cell. */ public Map<String, Object> getCellStyle(Object cell) { Map<String, Object> style = (model.isEdge(cell)) ? stylesheet.getDefaultEdgeStyle() : stylesheet.getDefaultVertexStyle(); String name = model.getStyle(cell); if (name != null) { style = postProcessCellStyle(stylesheet.getCellStyle(name, style)); } if (style == null) { style = mxStylesheet.EMPTY_STYLE; } return style; } /** * Tries to resolve the value for the image style in the image bundles and * turns short data URIs as defined in mxImageBundle to data URIs as * defined in RFC 2397 of the IETF. */ protected Map<String, Object> postProcessCellStyle(Map<String, Object> style) { if (style != null) { String key = mxUtils.getString(style, mxConstants.STYLE_IMAGE); String image = getImageFromBundles(key); if (image != null) { style.put(mxConstants.STYLE_IMAGE, image); } else { image = key; } // Converts short data uris to normal data uris if (image != null && image.startsWith("data:image/")) { int comma = image.indexOf(','); if (comma > 0) { image = image.substring(0, comma) + ";base64," + image.substring(comma + 1); } style.put(mxConstants.STYLE_IMAGE, image); } } return style; } /** * Sets the style of the selection cells to the given value. * * @param style String representing the new style of the cells. */ public Object[] setCellStyle(String style) { return setCellStyle(style, null); } /** * Sets the style of the specified cells. If no cells are given, then the * selection cells are changed. * * @param style String representing the new style of the cells. * @param cells Optional array of <mxCells> to set the style for. Default is the * selection cells. */ public Object[] setCellStyle(String style, Object[] cells) { if (cells == null) { cells = getSelectionCells(); } if (cells != null) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { model.setStyle(cells[i], style); } } finally { model.endUpdate(); } } return cells; } /** * Toggles the boolean value for the given key in the style of the * given cell. If no cell is specified then the selection cell is * used. * * @param key Key for the boolean value to be toggled. * @param defaultValue Default boolean value if no value is defined. * @param cell Cell whose style should be modified. */ public Object toggleCellStyle(String key, boolean defaultValue, Object cell) { return toggleCellStyles(key, defaultValue, new Object[]{cell})[0]; } /** * Toggles the boolean value for the given key in the style of the * selection cells. * * @param key Key for the boolean value to be toggled. * @param defaultValue Default boolean value if no value is defined. */ public Object[] toggleCellStyles(String key, boolean defaultValue) { return toggleCellStyles(key, defaultValue, null); } /** * Toggles the boolean value for the given key in the style of the given * cells. If no cells are specified, then the selection cells are used. For * example, this can be used to toggle mxConstants.STYLE_ROUNDED or any * other style with a boolean value. * * @param key String representing the key of the boolean style to be toggled. * @param defaultValue Default boolean value if no value is defined. * @param cells Cells whose styles should be modified. */ public Object[] toggleCellStyles(String key, boolean defaultValue, Object[] cells) { if (cells == null) { cells = getSelectionCells(); } if (cells != null && cells.length > 0) { mxCellState state = view.getState(cells[0]); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cells[0]); if (style != null) { String value = (mxUtils.isTrue(style, key, defaultValue)) ? "0" : "1"; setCellStyles(key, value, cells); } } return cells; } /** * Sets the key to value in the styles of the selection cells. * * @param key String representing the key to be assigned. * @param value String representing the new value for the key. */ public Object[] setCellStyles(String key, String value) { return setCellStyles(key, value, null); } /** * Sets the key to value in the styles of the given cells. This will modify * the existing cell styles in-place and override any existing assignment * for the given key. If no cells are specified, then the selection cells * are changed. If no value is specified, then the respective key is * removed from the styles. * * @param key String representing the key to be assigned. * @param value String representing the new value for the key. * @param cells Array of cells to change the style for. */ public Object[] setCellStyles(String key, String value, Object[] cells) { if (cells == null) { cells = getSelectionCells(); } mxStyleUtils.setCellStyles(model, cells, key, value); return cells; } /** * Toggles the given bit for the given key in the styles of the selection * cells. * * @param key String representing the key to toggle the flag in. * @param flag Integer that represents the bit to be toggled. */ public Object[] toggleCellStyleFlags(String key, int flag) { return toggleCellStyleFlags(key, flag, null); } /** * Toggles the given bit for the given key in the styles of the specified * cells. * * @param key String representing the key to toggle the flag in. * @param flag Integer that represents the bit to be toggled. * @param cells Optional array of <mxCells> to change the style for. Default is * the selection cells. */ public Object[] toggleCellStyleFlags(String key, int flag, Object[] cells) { return setCellStyleFlags(key, flag, null, cells); } /** * Sets or toggles the given bit for the given key in the styles of the * selection cells. * * @param key String representing the key to toggle the flag in. * @param flag Integer that represents the bit to be toggled. * @param value Boolean value to be used or null if the value should be * toggled. */ public Object[] setCellStyleFlags(String key, int flag, boolean value) { return setCellStyleFlags(key, flag, value, null); } /** * Sets or toggles the given bit for the given key in the styles of the * specified cells. * * @param key String representing the key to toggle the flag in. * @param flag Integer that represents the bit to be toggled. * @param value Boolean value to be used or null if the value should be * toggled. * @param cells Optional array of cells to change the style for. If no * cells are specified then the selection cells are used. */ public Object[] setCellStyleFlags(String key, int flag, Boolean value, Object[] cells) { if (cells == null) { cells = getSelectionCells(); } if (cells != null && cells.length > 0) { if (value == null) { mxCellState state = view.getState(cells[0]); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cells[0]); if (style != null) { int current = mxUtils.getInt(style, key); value = !((current & flag) == flag); } } mxStyleUtils.setCellStyleFlags(model, cells, key, flag, value); } return cells; } /** * Adds the specified bundle. */ public void addImageBundle(mxImageBundle bundle) { imageBundles.add(bundle); } /** * Removes the specified bundle. */ public void removeImageBundle(mxImageBundle bundle) { imageBundles.remove(bundle); } /** * Searches all bundles for the specified key and returns the value for the * first match or null if the key is not found. */ public String getImageFromBundles(String key) { if (key != null) { Iterator<mxImageBundle> it = imageBundles.iterator(); while (it.hasNext()) { String value = it.next().getImage(key); if (value != null) { return value; } } } return null; } /** * Returns the image bundles */ public List<mxImageBundle> getImageBundles() { return imageBundles; } /** * Returns the image bundles */ public void getImageBundles(List<mxImageBundle> value) { imageBundles = value; } // // Cell alignment and orientation // /** * Aligns the selection cells vertically or horizontally according to the * given alignment. * * @param align Specifies the alignment. Possible values are all constants * in mxConstants with an ALIGN prefix. */ public Object[] alignCells(String align) { return alignCells(align, null); } /** * Aligns the given cells vertically or horizontally according to the given * alignment. * * @param align Specifies the alignment. Possible values are all constants * in mxConstants with an ALIGN prefix. * @param cells Array of cells to be aligned. */ public Object[] alignCells(String align, Object[] cells) { return alignCells(align, cells, null); } /** * Aligns the given cells vertically or horizontally according to the given * alignment using the optional parameter as the coordinate. * * @param align Specifies the alignment. Possible values are all constants * in mxConstants with an ALIGN prefix. * @param cells Array of cells to be aligned. * @param param Optional coordinate for the alignment. */ public Object[] alignCells(String align, Object[] cells, Object param) { if (cells == null) { cells = getSelectionCells(); } if (cells != null && cells.length > 1) { // Finds the required coordinate for the alignment if (param == null) { for (int i = 0; i < cells.length; i++) { mxGeometry geo = getCellGeometry(cells[i]); if (geo != null && !model.isEdge(cells[i])) { if (param == null) { if (align == null || align.equals(mxConstants.ALIGN_LEFT)) { param = geo.getX(); } else if (align.equals(mxConstants.ALIGN_CENTER)) { param = geo.getX() + geo.getWidth() / 2; break; } else if (align.equals(mxConstants.ALIGN_RIGHT)) { param = geo.getX() + geo.getWidth(); } else if (align.equals(mxConstants.ALIGN_TOP)) { param = geo.getY(); } else if (align.equals(mxConstants.ALIGN_MIDDLE)) { param = geo.getY() + geo.getHeight() / 2; break; } else if (align.equals(mxConstants.ALIGN_BOTTOM)) { param = geo.getY() + geo.getHeight(); } } else { double tmp = Double.parseDouble(String.valueOf(param)); if (align == null || align.equals(mxConstants.ALIGN_LEFT)) { param = Math.min(tmp, geo.getX()); } else if (align.equals(mxConstants.ALIGN_RIGHT)) { param = Math.max(tmp, geo.getX() + geo.getWidth()); } else if (align.equals(mxConstants.ALIGN_TOP)) { param = Math.min(tmp, geo.getY()); } else if (align.equals(mxConstants.ALIGN_BOTTOM)) { param = Math.max(tmp, geo.getY() + geo.getHeight()); } } } } } // Aligns the cells to the coordinate model.beginUpdate(); try { double tmp = Double.parseDouble(String.valueOf(param)); for (int i = 0; i < cells.length; i++) { mxGeometry geo = getCellGeometry(cells[i]); if (geo != null && !model.isEdge(cells[i])) { geo = (mxGeometry)geo.clone(); if (align == null || align.equals(mxConstants.ALIGN_LEFT)) { geo.setX(tmp); } else if (align.equals(mxConstants.ALIGN_CENTER)) { geo.setX(tmp - geo.getWidth() / 2); } else if (align.equals(mxConstants.ALIGN_RIGHT)) { geo.setX(tmp - geo.getWidth()); } else if (align.equals(mxConstants.ALIGN_TOP)) { geo.setY(tmp); } else if (align.equals(mxConstants.ALIGN_MIDDLE)) { geo.setY(tmp - geo.getHeight() / 2); } else if (align.equals(mxConstants.ALIGN_BOTTOM)) { geo.setY(tmp - geo.getHeight()); } model.setGeometry(cells[i], geo); if (isResetEdgesOnMove()) { resetEdges(new Object[]{cells[i]}); } } } fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS, "cells", cells, "align", align)); } finally { model.endUpdate(); } } return cells; } /** * Called when the main control point of the edge is double-clicked. This * implementation switches between null (default) and alternateEdgeStyle * and resets the edges control points. Finally, a flip event is fired * before endUpdate is called on the model. * * @param edge Cell that represents the edge to be flipped. * @return Returns the edge that has been flipped. */ public Object flipEdge(Object edge) { if (edge != null && alternateEdgeStyle != null) { model.beginUpdate(); try { String style = model.getStyle(edge); if (style == null || style.length() == 0) { model.setStyle(edge, alternateEdgeStyle); } else { model.setStyle(edge, null); } // Removes all existing control points resetEdge(edge); fireEvent(new mxEventObject(mxEvent.FLIP_EDGE, "edge", edge)); } finally { model.endUpdate(); } } return edge; } // // Order // /** * Moves the selection cells to the front or back. This is a shortcut method. * * @param back Specifies if the cells should be moved to back. */ public Object[] orderCells(boolean back) { return orderCells(back, null); } /** * Moves the given cells to the front or back. The change is carried out * using cellsOrdered. This method fires mxEvent.ORDER_CELLS while the * transaction is in progress. * * @param back Specifies if the cells should be moved to back. * @param cells Array of cells whose order should be changed. If null is * specified then the selection cells are used. */ public Object[] orderCells(boolean back, Object[] cells) { if (cells == null) { cells = mxUtils.sortCells(getSelectionCells(), true); } model.beginUpdate(); try { cellsOrdered(cells, back); fireEvent(new mxEventObject(mxEvent.ORDER_CELLS, "cells", cells, "back", back)); } finally { model.endUpdate(); } return cells; } /** * Moves the given cells to the front or back. This method fires * mxEvent.CELLS_ORDERED while the transaction is in progress. * * @param cells Array of cells whose order should be changed. * @param back Specifies if the cells should be moved to back. */ public void cellsOrdered(Object[] cells, boolean back) { if (cells != null) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { Object parent = model.getParent(cells[i]); if (back) { model.add(parent, cells[i], i); } else { model.add(parent, cells[i], model.getChildCount(parent) - 1); } } fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED, "cells", cells, "back", back)); } finally { model.endUpdate(); } } } // // Grouping // /** * Groups the selection cells. This is a shortcut method. * * @return Returns the new group. */ public Object groupCells() { return groupCells(null); } /** * Groups the selection cells and adds them to the given group. This is a * shortcut method. * * @return Returns the new group. */ public Object groupCells(Object group) { return groupCells(group, 0); } /** * Groups the selection cells and adds them to the given group. This is a * shortcut method. * * @return Returns the new group. */ public Object groupCells(Object group, double border) { return groupCells(group, border, null); } /** * Adds the cells into the given group. The change is carried out using * cellsAdded, cellsMoved and cellsResized. This method fires * mxEvent.GROUP_CELLS while the transaction is in progress. Returns the * new group. A group is only created if there is at least one entry in the * given array of cells. * * @param group Cell that represents the target group. If null is specified * then a new group is created using createGroupCell. * @param border Integer that specifies the border between the child area * and the group bounds. * @param cells Optional array of cells to be grouped. If null is specified * then the selection cells are used. */ public Object groupCells(Object group, double border, Object[] cells) { if (cells == null) { cells = mxUtils.sortCells(getSelectionCells(), true); } cells = getCellsForGroup(cells); if (group == null) { group = createGroupCell(cells); } mxRectangle bounds = getBoundsForGroup(group, cells, border); if (cells.length > 0 && bounds != null) { // Uses parent of group or previous parent of first child Object parent = model.getParent(group); if (parent == null) { parent = model.getParent(cells[0]); } model.beginUpdate(); try { // Checks if the group has a geometry and // creates one if one does not exist if (getCellGeometry(group) == null) { model.setGeometry(group, new mxGeometry()); } // Adds the children into the group and moves int index = model.getChildCount(group); cellsAdded(cells, group, index, null, null, false); cellsMoved(cells, -bounds.getX(), -bounds.getY(), false, true); // Adds the group into the parent and resizes index = model.getChildCount(parent); cellsAdded(new Object[]{group}, parent, index, null, null, false, false); cellsResized(new Object[]{group}, new mxRectangle[]{bounds}); fireEvent(new mxEventObject(mxEvent.GROUP_CELLS, "group", group, "cells", cells, "border", border)); } finally { model.endUpdate(); } } return group; } /** * Returns the cells with the same parent as the first cell * in the given array. */ public Object[] getCellsForGroup(Object[] cells) { List<Object> result = new ArrayList<Object>(cells.length); if (cells.length > 0) { Object parent = model.getParent(cells[0]); result.add(cells[0]); // Filters selection cells with the same parent for (int i = 1; i < cells.length; i++) { if (model.getParent(cells[i]) == parent) { result.add(cells[i]); } } } return result.toArray(); } /** * Returns the bounds to be used for the given group and children. This * implementation computes the bounding box of the geometries of all * vertices in the given children array. Edges are ignored. If the group * cell is a swimlane the title region is added to the bounds. */ public mxRectangle getBoundsForGroup(Object group, Object[] children, double border) { mxRectangle result = getBoundingBoxFromGeometry(children); if (result != null) { if (isSwimlane(group)) { mxRectangle size = getStartSize(group); result.setX(result.getX() - size.getWidth()); result.setY(result.getY() - size.getHeight()); result.setWidth(result.getWidth() + size.getWidth()); result.setHeight(result.getHeight() + size.getHeight()); } // Adds the border result.setX(result.getX() - border); result.setY(result.getY() - border); result.setWidth(result.getWidth() + 2 * border); result.setHeight(result.getHeight() + 2 * border); } return result; } /** * Hook for creating the group cell to hold the given array of <mxCells> if * no group cell was given to the <group> function. The children are just * for informational purpose, they will be added to the returned group * later. Note that the returned group should have a geometry. The * coordinates of which are later overridden. * * @param cells * @return Returns a new group cell. */ public Object createGroupCell(Object[] cells) { mxCell group = new mxCell("", new mxGeometry(), null); group.setVertex(true); group.setConnectable(false); return group; } /** * Ungroups the selection cells. This is a shortcut method. */ public Object[] ungroupCells() { return ungroupCells(null); } /** * Ungroups the given cells by moving the children the children to their * parents parent and removing the empty groups. * * @param cells Array of cells to be ungrouped. If null is specified then * the selection cells are used. * @return Returns the children that have been removed from the groups. */ public Object[] ungroupCells(Object[] cells) { List<Object> result = new ArrayList<Object>(); if (cells == null) { cells = getSelectionCells(); // Finds the cells with children List<Object> tmp = new ArrayList<Object>(cells.length); for (int i = 0; i < cells.length; i++) { if (model.getChildCount(cells[i]) > 0) { tmp.add(cells[i]); } } cells = tmp.toArray(); } if (cells != null && cells.length > 0) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { Object[] children = mxGraphModel.getChildren(model, cells[i]); if (children != null && children.length > 0) { Object parent = model.getParent(cells[i]); int index = model.getChildCount(parent); cellsAdded(children, parent, index, null, null, true); result.addAll(Arrays.asList(children)); } } cellsRemoved(addAllEdges(cells)); fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS, "cells", cells)); } finally { model.endUpdate(); } } return result.toArray(); } /** * Removes the selection cells from their parents and adds them to the * default parent returned by getDefaultParent. */ public Object[] removeCellsFromParent() { return removeCellsFromParent(null); } /** * Removes the specified cells from their parents and adds them to the * default parent. * * @param cells Array of cells to be removed from their parents. * @return Returns the cells that were removed from their parents. */ public Object[] removeCellsFromParent(Object[] cells) { if (cells == null) { cells = getSelectionCells(); } model.beginUpdate(); try { Object parent = getDefaultParent(); int index = model.getChildCount(parent); cellsAdded(cells, parent, index, null, null, true); fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT, "cells", cells)); } finally { model.endUpdate(); } return cells; } /** * Updates the bounds of the given array of groups so that it includes * all child vertices. */ public Object[] updateGroupBounds() { return updateGroupBounds(null); } /** * Updates the bounds of the given array of groups so that it includes * all child vertices. * * @param cells The groups whose bounds should be updated. */ public Object[] updateGroupBounds(Object[] cells) { return updateGroupBounds(cells, 0); } /** * Updates the bounds of the given array of groups so that it includes * all child vertices. * * @param cells The groups whose bounds should be updated. * @param border The border to be added in the group. */ public Object[] updateGroupBounds(Object[] cells, int border) { return updateGroupBounds(cells, border, false); } /** * Updates the bounds of the given array of groups so that it includes * all child vertices. * * @param cells The groups whose bounds should be updated. * @param border The border to be added in the group. * @param moveParent Specifies if the group should be moved. */ public Object[] updateGroupBounds(Object[] cells, int border, boolean moveParent) { if (cells == null) { cells = getSelectionCells(); } model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { mxGeometry geo = getCellGeometry(cells[i]); if (geo != null) { Object[] children = getChildCells(cells[i]); if (children != null && children.length > 0) { mxRectangle childBounds = getBoundingBoxFromGeometry(children); if (childBounds.getWidth() > 0 && childBounds.getHeight() > 0) { mxRectangle size = (isSwimlane(cells[i])) ? getStartSize(cells[i]) : new mxRectangle(); geo = (mxGeometry)geo.clone(); if (moveParent) { geo.setX(geo.getX() + childBounds.getX() - size.getWidth() - border); geo.setY(geo.getY() + childBounds.getY() - size.getHeight() - border); } geo.setWidth(childBounds.getWidth() + size.getWidth() + 2 * border); geo.setHeight(childBounds.getHeight() + size.getHeight() + 2 * border); model.setGeometry(cells[i], geo); moveCells(children, -childBounds.getX() + size.getWidth() + border, -childBounds.getY() + size.getHeight() + border); } } } } } finally { model.endUpdate(); } return cells; } // // Cell cloning, insertion and removal // /** * Clones all cells in the given array. To clone all children in a cell and * add them to another graph: * <p/> * <code> * graph2.addCells(graph.cloneCells(new Object[] { parent })); * </code> * <p/> * To clone all children in a graph layer if graph g1 and put them into the * default parent (typically default layer) of another graph g2, the * following code is used: * <p/> * <code> * g2.addCells(g1.cloneCells(g1.cloneCells(g1.getChildCells(g1.getDefaultParent())); * </code> */ public Object[] cloneCells(Object[] cells) { return cloneCells(cells, true); } /** * Returns the clones for the given cells. If the terminal of an edge is * not in the given array, then the respective end is assigned a terminal * point and the terminal is removed. If a cloned edge is invalid and * allowInvalidEdges is false, then a null pointer will be at this position * in the returned array. Use getCloneableCells on the input array to only * clone the cells where isCellCloneable returns true. * * @param cells Array of mxCells to be cloned. * @return Returns the clones of the given cells. */ public Object[] cloneCells(Object[] cells, boolean allowInvalidEdges) { Object[] clones = null; if (cells != null) { Collection<Object> tmp = new LinkedHashSet<Object>(cells.length); tmp.addAll(Arrays.asList(cells)); if (!tmp.isEmpty()) { double scale = view.getScale(); mxPoint trans = view.getTranslate(); clones = model.cloneCells(cells, true); for (int i = 0; i < cells.length; i++) { if (!allowInvalidEdges && model.isEdge(clones[i]) && getEdgeValidationError(clones[i], model.getTerminal(clones[i], true), model.getTerminal(clones[i], false)) != null) { clones[i] = null; } else { mxGeometry g = model.getGeometry(clones[i]); if (g != null) { mxCellState state = view.getState(cells[i]); mxCellState pstate = view.getState(model.getParent(cells[i])); if (state != null && pstate != null) { double dx = pstate.getOrigin().getX(); double dy = pstate.getOrigin().getY(); if (model.isEdge(clones[i])) { // Checks if the source is cloned or sets the terminal point Object src = model.getTerminal(cells[i], true); while (src != null && !tmp.contains(src)) { src = model.getParent(src); } if (src == null) { mxPoint pt = state.getAbsolutePoint(0); g.setTerminalPoint(new mxPoint(pt.getX() / scale - trans.getX(), pt.getY() / scale - trans.getY()), true); } // Checks if the target is cloned or sets the terminal point Object trg = model.getTerminal(cells[i], false); while (trg != null && !tmp.contains(trg)) { trg = model.getParent(trg); } if (trg == null) { mxPoint pt = state.getAbsolutePoint(state.getAbsolutePointCount() - 1); g.setTerminalPoint(new mxPoint(pt.getX() / scale - trans.getX(), pt.getY() / scale - trans.getY()), false); } // Translates the control points List<mxPoint> points = g.getPoints(); if (points != null) { Iterator<mxPoint> it = points.iterator(); while (it.hasNext()) { mxPoint pt = it.next(); pt.setX(pt.getX() + dx); pt.setY(pt.getY() + dy); } } } else { g.setX(g.getX() + dx); g.setY(g.getY() + dy); } } } } } } else { clones = new Object[]{}; } } return clones; } /** * Creates and adds a new vertex with an empty style. */ public mxCell insertVertex(Object parent, String id, Object value, double x, double y, double width, double height) { return insertVertex(parent, id, value, x, y, width, height, null); } /** * Adds a new vertex into the given parent using value as the user object * and the given coordinates as the geometry of the new vertex. The id and * style are used for the respective properties of the new cell, which is * returned. * * @param parent Cell that specifies the parent of the new vertex. * @param id Optional string that defines the Id of the new vertex. * @param value Object to be used as the user object. * @param x Integer that defines the x coordinate of the vertex. * @param y Integer that defines the y coordinate of the vertex. * @param width Integer that defines the width of the vertex. * @param height Integer that defines the height of the vertex. * @param style Optional string that defines the cell style. * @return Returns the new vertex that has been inserted. */ public mxCell insertVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style) { return insertVertex(parent, id, value, x, y, width, height, style, false); } /** * Adds a new vertex into the given parent using value as the user object * and the given coordinates as the geometry of the new vertex. The id and * style are used for the respective properties of the new cell, which is * returned. * * @param parent Cell that specifies the parent of the new vertex. * @param id Optional string that defines the Id of the new vertex. * @param value Object to be used as the user object. * @param x Integer that defines the x coordinate of the vertex. * @param y Integer that defines the y coordinate of the vertex. * @param width Integer that defines the width of the vertex. * @param height Integer that defines the height of the vertex. * @param style Optional string that defines the cell style. * @param relative Specifies if the geometry should be relative. * @return Returns the new vertex that has been inserted. */ public mxCell insertVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style, boolean relative) { mxCell vertex = createVertex(parent, id, value, x, y, width, height, style, relative); return (mxCell) addCell(vertex, parent); } /** * Hook method that creates the new vertex for insertVertex. * * @param parent Cell that specifies the parent of the new vertex. * @param id Optional string that defines the Id of the new vertex. * @param value Object to be used as the user object. * @param x Integer that defines the x coordinate of the vertex. * @param y Integer that defines the y coordinate of the vertex. * @param width Integer that defines the width of the vertex. * @param height Integer that defines the height of the vertex. * @param style Optional string that defines the cell style. * @return Returns the new vertex to be inserted. */ public Object createVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style) { return createVertex(parent, id, value, x, y, width, height, style, false); } /** * Hook method that creates the new vertex for insertVertex. * * @param parent Cell that specifies the parent of the new vertex. * @param id Optional string that defines the Id of the new vertex. * @param value Object to be used as the user object. * @param x Integer that defines the x coordinate of the vertex. * @param y Integer that defines the y coordinate of the vertex. * @param width Integer that defines the width of the vertex. * @param height Integer that defines the height of the vertex. * @param style Optional string that defines the cell style. * @param relative Specifies if the geometry should be relative. * @return Returns the new vertex to be inserted. */ public mxCell createVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style, boolean relative) { mxGeometry geometry = new mxGeometry(x, y, width, height); geometry.setRelative(relative); mxCell vertex = new mxCell(value, geometry, style); vertex.setId(id); vertex.setVertex(true); vertex.setConnectable(true); return vertex; } /** * Creates and adds a new edge with an empty style. */ public mxCell insertEdge(Object parent, String id, Object value, Object source, Object target) { return insertEdge(parent, id, value, source, target, null); } /** * Adds a new edge into the given parent using value as the user object and * the given source and target as the terminals of the new edge. The Id and * style are used for the respective properties of the new cell, which is * returned. * * @param parent Cell that specifies the parent of the new edge. * @param id Optional string that defines the Id of the new edge. * @param value Object to be used as the user object. * @param source Cell that defines the source of the edge. * @param target Cell that defines the target of the edge. * @param style Optional string that defines the cell style. * @return Returns the new edge that has been inserted. */ public mxCell insertEdge(Object parent, String id, Object value, Object source, Object target, String style) { mxCell edge = createEdge(parent, id, value, source, target, style); return (mxCell) addEdge(edge, parent, source, target, null); } /** * Hook method that creates the new edge for insertEdge. This * implementation does not set the source and target of the edge, these * are set when the edge is added to the model. * * @param parent Cell that specifies the parent of the new edge. * @param id Optional string that defines the Id of the new edge. * @param value Object to be used as the user object. * @param source Cell that defines the source of the edge. * @param target Cell that defines the target of the edge. * @param style Optional string that defines the cell style. * @return Returns the new edge to be inserted. */ public mxCell createEdge(Object parent, String id, Object value, Object source, Object target, String style) { mxCell edge = new mxCell(value, new mxGeometry(), style); edge.setId(id); edge.setEdge(true); edge.getGeometry().setRelative(true); return edge; } /** * Adds the edge to the parent and connects it to the given source and * target terminals. This is a shortcut method. * * @param edge Edge to be inserted into the given parent. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @param source Optional cell that represents the source terminal. * @param target Optional cell that represents the target terminal. * @param index Optional index to insert the cells at. Default is to append. * @return Returns the edge that was added. */ public Object addEdge(mxCell edge, Object parent, Object source, Object target, Integer index) { return addCell(edge, parent, index, source, target); } /** * Adds the cell to the default parent. This is a shortcut method. * * @param cell Cell to be inserted. * @return Returns the cell that was added. */ public Object addCell(Object cell) { return addCell(cell, null); } /** * Adds the cell to the parent. This is a shortcut method. * * @param cell Cell tobe inserted. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @return Returns the cell that was added. */ public Object addCell(Object cell, Object parent) { return addCell(cell, parent, null, null, null); } /** * Adds the cell to the parent and connects it to the given source and * target terminals. This is a shortcut method. * * @param cell Cell to be inserted into the given parent. * @param parent Object that represents the new parent. If no parent is * given then the default parent is used. * @param index Optional index to insert the cells at. Default is to append. * @param source Optional cell that represents the source terminal. * @param target Optional cell that represents the target terminal. * @return Returns the cell that was added. */ public Object addCell(Object cell, Object parent, Integer index, Object source, Object target) { return addCells(new Object[]{cell}, parent, index, source, target)[0]; } /** * Adds the cells to the default parent. This is a shortcut method. * * @param cells Array of cells to be inserted. * @return Returns the cells that were added. */ public Object[] addCells(Object[] cells) { return addCells(cells, null); } /** * Adds the cells to the parent. This is a shortcut method. * * @param cells Array of cells to be inserted. * @param parent Optional cell that represents the new parent. If no parent * is specified then the default parent is used. * @return Returns the cells that were added. */ public Object[] addCells(Object[] cells, Object parent) { return addCells(cells, parent, null); } /** * Adds the cells to the parent at the given index. This is a shortcut method. * * @param cells Array of cells to be inserted. * @param parent Optional cell that represents the new parent. If no parent * is specified then the default parent is used. * @param index Optional index to insert the cells at. Default is to append. * @return Returns the cells that were added. */ public Object[] addCells(Object[] cells, Object parent, Integer index) { return addCells(cells, parent, index, null, null); } /** * Adds the cells to the parent at the given index, connecting each cell to * the optional source and target terminal. The change is carried out using * cellsAdded. This method fires mxEvent.ADD_CELLS while the transaction * is in progress. * * @param cells Array of cells to be added. * @param parent Optional cell that represents the new parent. If no parent * is specified then the default parent is used. * @param index Optional index to insert the cells at. Default is to append. * @param source Optional source terminal for all inserted cells. * @param target Optional target terminal for all inserted cells. * @return Returns the cells that were added. */ public Object[] addCells(Object[] cells, Object parent, Integer index, Object source, Object target) { if (parent == null) { parent = getDefaultParent(); } if (index == null) { index = model.getChildCount(parent); } model.beginUpdate(); try { cellsAdded(cells, parent, index, source, target, false, true); fireEvent(new mxEventObject(mxEvent.ADD_CELLS, "cells", cells, "parent", parent, "index", index, "source", source, "target", target)); } finally { model.endUpdate(); } return cells; } /** * Adds the specified cells to the given parent. This method fires * mxEvent.CELLS_ADDED while the transaction is in progress. */ public void cellsAdded(Object[] cells, Object parent, Integer index, Object source, Object target, boolean absolute) { cellsAdded(cells, parent, index, source, target, absolute, true); } /** * Adds the specified cells to the given parent. This method fires * mxEvent.CELLS_ADDED while the transaction is in progress. */ public void cellsAdded(Object[] cells, Object parent, Integer index, Object source, Object target, boolean absolute, boolean constrain) { if (cells != null && parent != null && index != null) { model.beginUpdate(); try { mxCellState parentState = (absolute) ? view.getState(parent) : null; mxPoint o1 = (parentState != null) ? parentState.getOrigin() : null; mxPoint zero = new mxPoint(0, 0); for (int i = 0; i < cells.length; i++) { if (cells[i] == null) { index--; } else { Object previous = model.getParent(cells[i]); // Keeps the cell at its absolute location if (o1 != null && cells[i] != parent && parent != previous) { mxCellState oldState = view.getState(previous); mxPoint o2 = (oldState != null) ? oldState.getOrigin() : zero; mxGeometry geo = model.getGeometry(cells[i]); if (geo != null) { double dx = o2.getX() - o1.getX(); double dy = o2.getY() - o1.getY(); geo = (mxGeometry)geo.clone(); geo.translate(dx, dy); if (!geo.isRelative() && model.isVertex(cells[i]) && !isAllowNegativeCoordinates()) { geo.setX(Math.max(0, geo.getX())); geo.setY(Math.max(0, geo.getY())); } model.setGeometry(cells[i], geo); } } // Decrements all following indices // if cell is already in parent if (parent == previous) { index--; } model.add(parent, cells[i], index + i); // Extends the parent if (isExtendParentsOnAdd() && isExtendParent(cells[i])) { extendParent(cells[i]); } // Constrains the child if (constrain) { constrainChild(cells[i]); } // Sets the source terminal if (source != null) { cellConnected(cells[i], source, true, null); } // Sets the target terminal if (target != null) { cellConnected(cells[i], target, false, null); } } } fireEvent( new mxEventObject(mxEvent.CELLS_ADDED, "cells", cells, "parent", parent, "index", index, "source", source, "target", target, "absolute", absolute)); } finally { model.endUpdate(); } } } /** * Removes the selection cells from the graph. * * @return Returns the cells that have been removed. */ public Object[] removeCells() { return removeCells(null); } /** * Removes the given cells from the graph. * * @param cells Array of cells to remove. * @return Returns the cells that have been removed. */ public Object[] removeCells(Object[] cells) { return removeCells(cells, true); } /** * Removes the given cells from the graph including all connected edges if * includeEdges is true. The change is carried out using cellsRemoved. This * method fires mxEvent.REMOVE_CELLS while the transaction is in progress. * * @param cells Array of cells to remove. If null is specified then the * selection cells which are deletable are used. * @param includeEdges Specifies if all connected edges should be removed as * well. */ public Object[] removeCells(Object[] cells, boolean includeEdges) { if (cells == null) { cells = getDeletableCells(getSelectionCells()); } // Adds all edges to the cells if (includeEdges) { cells = getDeletableCells(addAllEdges(cells)); } model.beginUpdate(); try { cellsRemoved(cells); fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS, "cells", cells, "includeEdges", includeEdges)); } finally { model.endUpdate(); } return cells; } /** * Removes the given cells from the model. This method fires * mxEvent.CELLS_REMOVED while the transaction is in progress. * * @param cells Array of cells to remove. */ public void cellsRemoved(Object[] cells) { if (cells != null && cells.length > 0) { double scale = view.getScale(); mxPoint tr = view.getTranslate(); model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { // Disconnects edges which are not in cells Collection<Object> cellSet = new HashSet<Object>(); cellSet.addAll(Arrays.asList(cells)); Object[] edges = getConnections(cells[i]); for (int j = 0; j < edges.length; j++) { if (!cellSet.contains(edges[j])) { mxGeometry geo = model.getGeometry(edges[j]); if (geo != null) { mxCellState state = view.getState(edges[j]); if (state != null) { geo = (mxGeometry)geo.clone(); boolean source = state.getVisibleTerminal(true) == cells[i]; int n = (source) ? 0 : state.getAbsolutePointCount() - 1; mxPoint pt = state.getAbsolutePoint(n); geo.setTerminalPoint(new mxPoint(pt.getX() / scale - tr.getX(), pt.getY() / scale - tr.getY()), source); model.setTerminal(edges[j], null, source); model.setGeometry(edges[j], geo); } } } } model.remove(cells[i]); } fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED, "cells", cells)); } finally { model.endUpdate(); } } } /** * */ public Object splitEdge(Object edge, Object[] cells) { return splitEdge(edge, cells, null, 0, 0); } /** * */ public Object splitEdge(Object edge, Object[] cells, double dx, double dy) { return splitEdge(edge, cells, null, dx, dy); } /** * Splits the given edge by adding a newEdge between the previous source * and the given cell and reconnecting the source of the given edge to the * given cell. Fires mxEvent.SPLIT_EDGE while the transaction is in * progress. * * @param edge Object that represents the edge to be splitted. * @param cells Array that contains the cells to insert into the edge. * @param newEdge Object that represents the edge to be inserted. * @return Returns the new edge that has been inserted. */ public Object splitEdge(Object edge, Object[] cells, Object newEdge, double dx, double dy) { if (newEdge == null) { newEdge = cloneCells(new Object[]{edge})[0]; } Object parent = model.getParent(edge); Object source = model.getTerminal(edge, true); model.beginUpdate(); try { cellsMoved(cells, dx, dy, false, false); cellsAdded(cells, parent, model.getChildCount(parent), null, null, true); cellsAdded(new Object[]{newEdge}, parent, model.getChildCount(parent), source, cells[0], false); cellConnected(edge, cells[0], true, null); fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE, "edge", edge, "cells", cells, "newEdge", newEdge, "dx", dx, "dy", dy)); } finally { model.endUpdate(); } return newEdge; } // // Cell visibility // /** * Sets the visible state of the selection cells. This is a shortcut * method. * * @param show Boolean that specifies the visible state to be assigned. * @return Returns the cells whose visible state was changed. */ public Object[] toggleCells(boolean show) { return toggleCells(show, null); } /** * Sets the visible state of the specified cells. This is a shortcut * method. * * @param show Boolean that specifies the visible state to be assigned. * @param cells Array of cells whose visible state should be changed. * @return Returns the cells whose visible state was changed. */ public Object[] toggleCells(boolean show, Object[] cells) { return toggleCells(show, cells, true); } /** * Sets the visible state of the specified cells and all connected edges * if includeEdges is true. The change is carried out using cellsToggled. * This method fires mxEvent.TOGGLE_CELLS while the transaction is in * progress. * * @param show Boolean that specifies the visible state to be assigned. * @param cells Array of cells whose visible state should be changed. If * null is specified then the selection cells are used. * @return Returns the cells whose visible state was changed. */ public Object[] toggleCells(boolean show, Object[] cells, boolean includeEdges) { if (cells == null) { cells = getSelectionCells(); } // Adds all connected edges recursively if (includeEdges) { cells = addAllEdges(cells); } model.beginUpdate(); try { cellsToggled(cells, show); fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS, "show", show, "cells", cells, "includeEdges", includeEdges)); } finally { model.endUpdate(); } return cells; } /** * Sets the visible state of the specified cells. * * @param cells Array of cells whose visible state should be changed. * @param show Boolean that specifies the visible state to be assigned. */ public void cellsToggled(Object[] cells, boolean show) { if (cells != null && cells.length > 0) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { model.setVisible(cells[i], show); } } finally { model.endUpdate(); } } } // // Folding // /** * Sets the collapsed state of the selection cells without recursion. * This is a shortcut method. * * @param collapse Boolean that specifies the collapsed state to be * assigned. * @return Returns the cells whose collapsed state was changed. */ public Object[] foldCells(boolean collapse) { return foldCells(collapse, false); } /** * Sets the collapsed state of the selection cells. This is a shortcut * method. * * @param collapse Boolean that specifies the collapsed state to be * assigned. * @param recurse Boolean that specifies if the collapsed state should * be assigned to all descendants. * @return Returns the cells whose collapsed state was changed. */ public Object[] foldCells(boolean collapse, boolean recurse) { return foldCells(collapse, recurse, null); } /** * Invokes foldCells with checkFoldable set to false. */ public Object[] foldCells(boolean collapse, boolean recurse, Object[] cells) { return foldCells(collapse, recurse, cells, false); } /** * Sets the collapsed state of the specified cells and all descendants * if recurse is true. The change is carried out using cellsFolded. * This method fires mxEvent.FOLD_CELLS while the transaction is in * progress. Returns the cells whose collapsed state was changed. * * @param collapse Boolean indicating the collapsed state to be assigned. * @param recurse Boolean indicating if the collapsed state of all * descendants should be set. * @param cells Array of cells whose collapsed state should be set. If * null is specified then the foldable selection cells are used. * @param checkFoldable Boolean indicating of isCellFoldable should be * checked. Default is false. */ public Object[] foldCells(boolean collapse, boolean recurse, Object[] cells, boolean checkFoldable) { if (cells == null) { cells = getFoldableCells(getSelectionCells(), collapse); } model.beginUpdate(); try { cellsFolded(cells, collapse, recurse, checkFoldable); fireEvent(new mxEventObject(mxEvent.FOLD_CELLS, "cells", cells, "collapse", collapse, "recurse", recurse)); } finally { model.endUpdate(); } return cells; } /** * Invokes cellsFoldable with checkFoldable set to false. */ public void cellsFolded(Object[] cells, boolean collapse, boolean recurse) { cellsFolded(cells, collapse, recurse, false); } /** * Sets the collapsed state of the specified cells. This method fires * mxEvent.CELLS_FOLDED while the transaction is in progress. Returns the * cells whose collapsed state was changed. * * @param cells Array of cells whose collapsed state should be set. * @param collapse Boolean indicating the collapsed state to be assigned. * @param recurse Boolean indicating if the collapsed state of all * descendants should be set. * @param checkFoldable Boolean indicating of isCellFoldable should be * checked. Default is false. */ public void cellsFolded(Object[] cells, boolean collapse, boolean recurse, boolean checkFoldable) { if (cells != null && cells.length > 0) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { if ((!checkFoldable || isCellFoldable(cells[i], collapse)) && collapse != isCellCollapsed(cells[i])) { model.setCollapsed(cells[i], collapse); swapBounds(cells[i], collapse); if (isExtendParent(cells[i])) { extendParent(cells[i]); } if (recurse) { Object[] children = mxGraphModel.getChildren(model, cells[i]); cellsFolded(children, collapse, recurse); } } } fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED, "cells", cells, "collapse", collapse, "recurse", recurse)); } finally { model.endUpdate(); } } } /** * Swaps the alternate and the actual bounds in the geometry of the given * cell invoking updateAlternateBounds before carrying out the swap. * * @param cell Cell for which the bounds should be swapped. * @param willCollapse Boolean indicating if the cell is going to be collapsed. */ public void swapBounds(Object cell, boolean willCollapse) { if (cell != null) { mxGeometry geo = model.getGeometry(cell); if (geo != null) { geo = (mxGeometry)geo.clone(); updateAlternateBounds(cell, geo, willCollapse); geo.swap(); model.setGeometry(cell, geo); } } } /** * Updates or sets the alternate bounds in the given geometry for the given * cell depending on whether the cell is going to be collapsed. If no * alternate bounds are defined in the geometry and * collapseToPreferredSize is true, then the preferred size is used for * the alternate bounds. The top, left corner is always kept at the same * location. * * @param cell Cell for which the geometry is being udpated. * @param geo Geometry for which the alternate bounds should be updated. * @param willCollapse Boolean indicating if the cell is going to be collapsed. */ public void updateAlternateBounds(Object cell, mxGeometry geo, boolean willCollapse) { if (cell != null && geo != null) { if (geo.getAlternateBounds() == null) { mxRectangle bounds = null; if (isCollapseToPreferredSize()) { bounds = getPreferredSizeForCell(cell); if (isSwimlane(cell)) { mxRectangle size = getStartSize(cell); bounds.setHeight(Math.max(bounds.getHeight(), size.getHeight())); bounds.setWidth(Math.max(bounds.getWidth(), size.getWidth())); } } if (bounds == null) { bounds = geo; } geo.setAlternateBounds(new mxRectangle(geo.getX(), geo.getY(), bounds.getWidth(), bounds.getHeight())); } else { geo.getAlternateBounds().setX(geo.getX()); geo.getAlternateBounds().setY(geo.getY()); } } } /** * Returns an array with the given cells and all edges that are connected * to a cell or one of its descendants. */ public Object[] addAllEdges(Object[] cells) { List<Object> allCells = new ArrayList<Object>(cells.length); allCells.addAll(Arrays.asList(cells)); allCells.addAll(Arrays.asList(getAllEdges(cells))); return allCells.toArray(); } /** * Returns all edges connected to the given cells or their descendants. */ public Object[] getAllEdges(Object[] cells) { List<Object> edges = new ArrayList<Object>(); if (cells != null) { for (int i = 0; i < cells.length; i++) { int edgeCount = model.getEdgeCount(cells[i]); for (int j = 0; j < edgeCount; j++) { edges.add(model.getEdgeAt(cells[i], j)); } // Recurses Object[] children = mxGraphModel.getChildren(model, cells[i]); edges.addAll(Arrays.asList(getAllEdges(children))); } } return edges.toArray(); } // // Cell sizing // /** * Updates the size of the given cell in the model using * getPreferredSizeForCell to get the new size. This function * fires beforeUpdateSize and afterUpdateSize events. * * @param cell <mxCell> for which the size should be changed. */ public Object updateCellSize(Object cell) { return updateCellSize(cell, false); } /** * Updates the size of the given cell in the model using * getPreferredSizeForCell to get the new size. This function * fires mxEvent.UPDATE_CELL_SIZE. * * @param cell Cell for which the size should be changed. */ public Object updateCellSize(Object cell, boolean ignoreChildren) { model.beginUpdate(); try { cellSizeUpdated(cell, ignoreChildren); fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE, "cell", cell, "ignoreChildren", ignoreChildren)); } finally { model.endUpdate(); } return cell; } /** * Updates the size of the given cell in the model using * getPreferredSizeForCell to get the new size. * * @param cell Cell for which the size should be changed. */ public void cellSizeUpdated(Object cell, boolean ignoreChildren) { if (cell != null) { model.beginUpdate(); try { mxRectangle size = getPreferredSizeForCell(cell); mxGeometry geo = model.getGeometry(cell); if (size != null && geo != null) { boolean collapsed = isCellCollapsed(cell); geo = (mxGeometry)geo.clone(); if (isSwimlane(cell)) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); String cellStyle = model.getStyle(cell); if (cellStyle == null) { cellStyle = ""; } if (mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true)) { cellStyle = mxStyleUtils.setStyle(cellStyle, mxConstants.STYLE_STARTSIZE, String.valueOf(size.getHeight() + 8)); if (collapsed) { geo.setHeight(size.getHeight() + 8); } geo.setWidth(size.getWidth()); } else { cellStyle = mxStyleUtils.setStyle(cellStyle, mxConstants.STYLE_STARTSIZE, String.valueOf(size.getWidth() + 8)); if (collapsed) { geo.setWidth(size.getWidth() + 8); } geo.setHeight(size.getHeight()); } model.setStyle(cell, cellStyle); } else { geo.setWidth(size.getWidth()); geo.setHeight(size.getHeight()); } if (!ignoreChildren && !collapsed) { mxRectangle bounds = view.getBounds(mxGraphModel.getChildren(model, cell)); if (bounds != null) { mxPoint tr = view.getTranslate(); double scale = view.getScale(); double width = (bounds.getX() + bounds.getWidth()) / scale - geo.getX() - tr.getX(); double height = (bounds.getY() + bounds.getHeight()) / scale - geo.getY() - tr.getY(); geo.setWidth(Math.max(geo.getWidth(), width)); geo.setHeight(Math.max(geo.getHeight(), height)); } } cellsResized(new Object[]{cell}, new mxRectangle[]{geo}); } } finally { model.endUpdate(); } } } /** * Returns the preferred width and height of the given <mxCell> as an * <mxRectangle>. * * @param cell <mxCell> for which the preferred size should be returned. */ public mxRectangle getPreferredSizeForCell(Object cell) { mxRectangle result = null; if (cell != null) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.style : getCellStyle(cell); if (style != null && !model.isEdge(cell)) { double dx = 0; double dy = 0; // Adds dimension of image if shape is a label if (getImage(state) != null || mxUtils.getString(style, mxConstants.STYLE_IMAGE) != null) { if (mxUtils.getString(style, mxConstants.STYLE_SHAPE, "").equals(mxConstants.SHAPE_LABEL)) { if (mxUtils.getString(style, mxConstants.STYLE_VERTICAL_ALIGN, "").equals(mxConstants.ALIGN_MIDDLE)) { dx += mxUtils.getDouble(style, mxConstants.STYLE_IMAGE_WIDTH, mxConstants.DEFAULT_IMAGESIZE); } if (mxUtils.getString(style, mxConstants.STYLE_ALIGN, "").equals(mxConstants.ALIGN_CENTER)) { dy += mxUtils.getDouble(style, mxConstants.STYLE_IMAGE_HEIGHT, mxConstants.DEFAULT_IMAGESIZE); } } } // Adds spacings double spacing = mxUtils.getDouble(style, mxConstants.STYLE_SPACING); dx += 2 * spacing; dx += mxUtils.getDouble(style, mxConstants.STYLE_SPACING_LEFT); dx += mxUtils.getDouble(style, mxConstants.STYLE_SPACING_RIGHT); dy += 2 * spacing; dy += mxUtils.getDouble(style, mxConstants.STYLE_SPACING_TOP); dy += mxUtils.getDouble(style, mxConstants.STYLE_SPACING_BOTTOM); // LATER: Add space for collapse/expand icon if applicable // Adds space for label String value = getLabel(cell); if (value != null && value.length() > 0) { mxRectangle size = mxUtils.getLabelSize(value, style, 1); double width = size.getWidth() + dx; double height = size.getHeight() + dy; if (!mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true)) { double tmp = height; height = width; width = tmp; } if (gridEnabled) { width = snap(width + gridSize / 2); height = snap(height + gridSize / 2); } result = new mxRectangle(0, 0, width, height); } else { double gs2 = 4 * gridSize; result = new mxRectangle(0, 0, gs2, gs2); } } } return result; } /** * Sets the bounds of the given cell using resizeCells. Returns the * cell which was passed to the function. * * @param cell <mxCell> whose bounds should be changed. * @param bounds <mxRectangle> that represents the new bounds. */ public Object resizeCell(Object cell, mxRectangle bounds) { return resizeCells(new Object[]{cell}, new mxRectangle[]{bounds})[0]; } /** * Sets the bounds of the given cells and fires a mxEvent.RESIZE_CELLS * event. while the transaction is in progress. Returns the cells which * have been passed to the function. * * @param cells Array of cells whose bounds should be changed. * @param bounds Array of rectangles that represents the new bounds. */ public Object[] resizeCells(Object[] cells, mxRectangle[] bounds) { model.beginUpdate(); try { cellsResized(cells, bounds); fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS, "cells", cells, "bounds", bounds)); } finally { model.endUpdate(); } return cells; } /** * Sets the bounds of the given cells and fires a <mxEvent.CELLS_RESIZED> * event. If extendParents is true, then the parent is extended if a child * size is changed so that it overlaps with the parent. * * @param cells Array of <mxCells> whose bounds should be changed. * @param bounds Array of <mxRectangles> that represents the new bounds. */ public void cellsResized(Object[] cells, mxRectangle[] bounds) { if (cells != null && bounds != null && cells.length == bounds.length) { model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { mxRectangle tmp = bounds[i]; mxGeometry geo = model.getGeometry(cells[i]); if (geo != null && (geo.getX() != tmp.getX() || geo.getY() != tmp.getY() || geo.getWidth() != tmp.getWidth() || geo.getHeight() != tmp.getHeight())) { geo = (mxGeometry)geo.clone(); if (geo.isRelative()) { mxPoint offset = geo.getOffset(); if (offset != null) { offset.setX(offset.getX() + tmp.getX()); offset.setY(offset.getY() + tmp.getY()); } } else { geo.setX(tmp.getX()); geo.setY(tmp.getY()); } geo.setWidth(tmp.getWidth()); geo.setHeight(tmp.getHeight()); if (!geo.isRelative() && model.isVertex(cells[i]) && !isAllowNegativeCoordinates()) { geo.setX(Math.max(0, geo.getX())); geo.setY(Math.max(0, geo.getY())); } model.setGeometry(cells[i], geo); if (isExtendParent(cells[i])) { extendParent(cells[i]); } } } if (isResetEdgesOnResize()) { resetEdges(cells); } // RENAME BOUNDSARRAY TO BOUNDS fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED, "cells", cells, "bounds", bounds)); } finally { model.endUpdate(); } } } /** * Resizes the parents recursively so that they contain the complete area * of the resized child cell. * * @param cell <mxCell> that has been resized. */ public void extendParent(Object cell) { if (cell != null) { Object parent = model.getParent(cell); mxGeometry p = model.getGeometry(parent); if (parent != null && p != null && !isCellCollapsed(parent)) { mxGeometry geo = model.getGeometry(cell); if (geo != null && (p.getWidth() < geo.getX() + geo.getWidth() || p.getHeight() < geo.getY() + geo.getHeight())) { p = (mxGeometry)p.clone(); p.setWidth(Math.max(p.getWidth(), geo.getX() + geo.getWidth())); p.setHeight(Math.max(p.getHeight(), geo.getY() + geo.getHeight())); cellsResized(new Object[]{parent}, new mxRectangle[]{p}); } } } } // // Cell moving // /** * Moves the cells by the given amount. This is a shortcut method. */ public Object[] moveCells(Object[] cells, double dx, double dy) { return moveCells(cells, dx, dy, false); } /** * Moves or clones the cells and moves the cells or clones by the given * amount. This is a shortcut method. */ public Object[] moveCells(Object[] cells, double dx, double dy, boolean clone) { return moveCells(cells, dx, dy, clone, null, null); } /** * Moves or clones the specified cells and moves the cells or clones by the * given amount, adding them to the optional target cell. The location is * the position of the mouse pointer as the mouse was released. The change * is carried out using cellsMoved. This method fires mxEvent.MOVE_CELLS * while the transaction is in progress. * * @param cells Array of cells to be moved, cloned or added to the target. * @param dx Integer that specifies the x-coordinate of the vector. * @param dy Integer that specifies the y-coordinate of the vector. * @param clone Boolean indicating if the cells should be cloned. * @param target Cell that represents the new parent of the cells. * @param location Location where the mouse was released. * @return Returns the cells that were moved. */ public Object[] moveCells(Object[] cells, double dx, double dy, boolean clone, Object target, Point location) { if (cells != null && (dx != 0 || dy != 0 || clone || target != null)) { model.beginUpdate(); try { if (clone) { cells = cloneCells(cells, isCloneInvalidEdges()); if (target == null) { target = getDefaultParent(); } } // Need to disable allowNegativeCoordinates if target not null to // allow for temporary negative numbers until cellsAdded is called. boolean previous = isAllowNegativeCoordinates(); if (target != null) { setAllowNegativeCoordinates(true); } cellsMoved(cells, dx, dy, !clone && isDisconnectOnMove() && isAllowDanglingEdges(), target == null); setAllowNegativeCoordinates(previous); if (target != null) { Integer index = model.getChildCount(target); cellsAdded(cells, target, index, null, null, true); } fireEvent(new mxEventObject(mxEvent.MOVE_CELLS, "cells", cells, "dx", dx, "dy", dy, "clone", clone, "target", target, "location", location)); } finally { model.endUpdate(); } } return cells; } /** * Moves the specified cells by the given vector, disconnecting the cells * using disconnectGraph if disconnect is true. This method fires * mxEvent.CELLS_MOVED while the transaction is in progress. */ public void cellsMoved(Object[] cells, double dx, double dy, boolean disconnect, boolean constrain) { if (cells != null && (dx != 0 || dy != 0)) { model.beginUpdate(); try { if (disconnect) { disconnectGraph(cells); } for (int i = 0; i < cells.length; i++) { translateCell(cells[i], dx, dy); if (constrain) { constrainChild(cells[i]); } } if (isResetEdgesOnMove()) { resetEdges(cells); } fireEvent(new mxEventObject(mxEvent.CELLS_MOVED, "cells", cells, "dx", dx, "dy", dy, "disconnect", disconnect)); } finally { model.endUpdate(); } } } /** * Translates the geometry of the given cell and stores the new, * translated geometry in the model as an atomic change. */ public void translateCell(Object cell, double dx, double dy) { mxGeometry geo = model.getGeometry(cell); if (geo != null) { geo = (mxGeometry)geo.clone(); geo.translate(dx, dy); if (!geo.isRelative() && model.isVertex(cell) && !isAllowNegativeCoordinates()) { geo.setX(Math.max(0, geo.getX())); geo.setY(Math.max(0, geo.getY())); } if (geo.isRelative() && !model.isEdge(cell)) { if (geo.getOffset() == null) { geo.setOffset(new mxPoint(dx, dy)); } else { mxPoint offset = geo.getOffset(); offset.setX(offset.getX() + dx); offset.setY(offset.getY() + dy); } } model.setGeometry(cell, geo); } } /** * Returns the mxRectangle inside which a cell is to be kept. */ public mxRectangle getCellContainmentArea(Object cell) { if (cell != null && !model.isEdge(cell)) { Object parent = model.getParent(cell); if (parent == getDefaultParent() || parent == getCurrentRoot()) { return getMaximumGraphBounds(); } else if (parent != null && parent != getDefaultParent()) { mxGeometry g = model.getGeometry(parent); if (g != null) { double x = 0; double y = 0; double w = g.getWidth(); double h = g.getHeight(); if (isSwimlane(parent)) { mxRectangle size = getStartSize(parent); x = size.getWidth(); w -= size.getWidth(); y = size.getHeight(); h -= size.getHeight(); } return new mxRectangle(x, y, w, h); } } } return null; } /** * @return the maximumGraphBounds */ public mxRectangle getMaximumGraphBounds() { return maximumGraphBounds; } /** * @param value the maximumGraphBounds to set */ public void setMaximumGraphBounds(mxRectangle value) { mxRectangle oldValue = maximumGraphBounds; maximumGraphBounds = value; changeSupport.firePropertyChange("maximumGraphBounds", oldValue, maximumGraphBounds); } /** * Keeps the given cell inside the bounds returned by * getCellContainmentArea for its parent, according to the rules defined by * getOverlap and isConstrainChild. This modifies the cell's geometry * in-place and does not clone it. * * @param cell Cell which should be constrained. */ public void constrainChild(Object cell) { if (cell != null) { mxGeometry geo = model.getGeometry(cell); mxRectangle area = (isConstrainChild(cell)) ? getCellContainmentArea(cell) : getMaximumGraphBounds(); if (geo != null && area != null) { // Keeps child within the content area of the parent if (!geo.isRelative() && (geo.getX() < area.getX() || geo.getY() < area.getY() || area.getWidth() < geo.getX() + geo.getWidth() || area.getHeight() < geo.getY() + geo.getHeight())) { double overlap = getOverlap(cell); if (area.getWidth() > 0) { geo.setX(Math.min(geo.getX(), area.getX() + area.getWidth() - (1 - overlap) * geo.getWidth())); } if (area.getHeight() > 0) { geo.setY(Math.min(geo.getY(), area.getY() + area.getHeight() - (1 - overlap) * geo.getHeight())); } geo.setX(Math.max(geo.getX(), area.getX() - geo.getWidth() * overlap)); geo.setY(Math.max(geo.getY(), area.getY() - geo.getHeight() * overlap)); } } } } /** * Resets the control points of the edges that are connected to the given * cells if not both ends of the edge are in the given cells array. * * @param cells Array of mxCells for which the connected edges should be * reset. */ public void resetEdges(Object[] cells) { if (cells != null) { // Prepares a hashtable for faster cell lookups HashSet<Object> set = new HashSet<Object>(Arrays.asList(cells)); model.beginUpdate(); try { for (int i = 0; i < cells.length; i++) { Object[] edges = mxGraphModel.getEdges(model, cells[i]); if (edges != null) { for (int j = 0; j < edges.length; j++) { mxCellState state = view.getState(edges[j]); Object source = (state != null) ? state.getVisibleTerminal(true) : view.getVisibleTerminal(edges[j], true); Object target = (state != null) ? state.getVisibleTerminal(false) : view.getVisibleTerminal(edges[j], false); // Checks if one of the terminals is not in the given array if (!set.contains(source) || !set.contains(target)) { resetEdge(edges[j]); } } } resetEdges(mxGraphModel.getChildren(model, cells[i])); } } finally { model.endUpdate(); } } } /** * Resets the control points of the given edge. */ public Object resetEdge(Object edge) { mxGeometry geo = model.getGeometry(edge); if (geo != null) { // Resets the control points List<mxPoint> points = geo.getPoints(); if (points != null && !points.isEmpty()) { geo = (mxGeometry)geo.clone(); geo.setPoints(null); model.setGeometry(edge, geo); } } return edge; } // // Cell connecting and connection constraints // /** * Returns an array of all constraints for the given terminal. * * @param terminal Cell state that represents the terminal. * @param source Specifies if the terminal is the source or target. */ public mxConnectionConstraint[] getAllConnectionConstraints(mxCellState terminal, boolean source) { return null; } /** * Returns an connection constraint that describes the given connection * point. This result can then be passed to getConnectionPoint. * * @param edge Cell state that represents the edge. * @param terminal Cell state that represents the terminal. * @param source Boolean indicating if the terminal is the source or target. */ public mxConnectionConstraint getConnectionConstraint(mxCellState edge, mxCellState terminal, boolean source) { mxPoint point = null; Object x = edge.getStyle().get((source) ? mxConstants.STYLE_EXIT_X : mxConstants.STYLE_ENTRY_X); if (x != null) { Object y = edge.getStyle().get((source) ? mxConstants.STYLE_EXIT_Y : mxConstants.STYLE_ENTRY_Y); if (y != null) { point = new mxPoint(Double.parseDouble(x.toString()), Double.parseDouble(y.toString())); } } boolean perimeter = false; if (point != null) { perimeter = mxUtils.isTrue(edge.style, (source) ? mxConstants.STYLE_EXIT_PERIMETER : mxConstants.STYLE_ENTRY_PERIMETER, true); } return new mxConnectionConstraint(point, perimeter); } /** * Sets the connection constraint that describes the given connection point. * If no constraint is given then nothing is changed. To remove an existing * constraint from the given edge, use an empty constraint instead. * * @param edge Cell that represents the edge. * @param terminal Cell that represents the terminal. * @param source Boolean indicating if the terminal is the source or target. * @param constraint Optional connection constraint to be used for this connection. */ public void setConnectionConstraint(Object edge, Object terminal, boolean source, mxConnectionConstraint constraint) { if (constraint != null) { model.beginUpdate(); try { Object[] cells = new Object[]{edge}; // FIXME, constraint can't be null, we've checked that above if (constraint == null || constraint.point == null) { setCellStyles((source) ? mxConstants.STYLE_EXIT_X : mxConstants.STYLE_ENTRY_X, null, cells); setCellStyles((source) ? mxConstants.STYLE_EXIT_Y : mxConstants.STYLE_ENTRY_Y, null, cells); setCellStyles((source) ? mxConstants.STYLE_EXIT_PERIMETER : mxConstants.STYLE_ENTRY_PERIMETER, null, cells); } else if (constraint.point != null) { setCellStyles((source) ? mxConstants.STYLE_EXIT_X : mxConstants.STYLE_ENTRY_X, String.valueOf(constraint.point.getX()), cells); setCellStyles((source) ? mxConstants.STYLE_EXIT_Y : mxConstants.STYLE_ENTRY_Y, String.valueOf(constraint.point.getY()), cells); // Only writes 0 since 1 is default if (!constraint.perimeter) { setCellStyles((source) ? mxConstants.STYLE_EXIT_PERIMETER : mxConstants.STYLE_ENTRY_PERIMETER, "0", cells); } else { setCellStyles((source) ? mxConstants.STYLE_EXIT_PERIMETER : mxConstants.STYLE_ENTRY_PERIMETER, null, cells); } } } finally { model.endUpdate(); } } } /** * Sets the connection constraint that describes the given connection point. * If no constraint is given then nothing is changed. To remove an existing * constraint from the given edge, use an empty constraint instead. * * @param vertex Cell state that represents the vertex. * @param constraint Connection constraint that represents the connection point * constraint as returned by getConnectionConstraint. */ public mxPoint getConnectionPoint(mxCellState vertex, mxConnectionConstraint constraint) { mxPoint point = null; if (vertex != null && constraint.point != null) { point = new mxPoint(vertex.getX() + constraint.getPoint().getX() * vertex.getWidth(), vertex.getY() + constraint.getPoint().getY() * vertex.getHeight()); } if (point != null && constraint.perimeter) { point = view.getPerimeterPoint(vertex, point, false); } return point; } /** * Connects the specified end of the given edge to the given terminal * using cellConnected and fires mxEvent.CONNECT_CELL while the transaction * is in progress. */ public Object connectCell(Object edge, Object terminal, boolean source) { return connectCell(edge, terminal, source, null); } /** * Connects the specified end of the given edge to the given terminal * using cellConnected and fires mxEvent.CONNECT_CELL while the transaction * is in progress. * * @param edge Edge whose terminal should be updated. * @param terminal New terminal to be used. * @param source Specifies if the new terminal is the source or target. * @param constraint Optional constraint to be used for this connection. * @return Returns the update edge. */ public Object connectCell(Object edge, Object terminal, boolean source, mxConnectionConstraint constraint) { model.beginUpdate(); try { Object previous = model.getTerminal(edge, source); cellConnected(edge, terminal, source, constraint); fireEvent(new mxEventObject(mxEvent.CONNECT_CELL, "edge", edge, "terminal", terminal, "source", source, "previous", previous)); } finally { model.endUpdate(); } return edge; } /** * Sets the new terminal for the given edge and resets the edge points if * isResetEdgesOnConnect returns true. This method fires * <mxEvent.CELL_CONNECTED> while the transaction is in progress. * * @param edge Edge whose terminal should be updated. * @param terminal New terminal to be used. * @param source Specifies if the new terminal is the source or target. * @param constraint Constraint to be used for this connection. */ public void cellConnected(Object edge, Object terminal, boolean source, mxConnectionConstraint constraint) { if (edge != null) { model.beginUpdate(); try { Object previous = model.getTerminal(edge, source); // Updates the constraint setConnectionConstraint(edge, terminal, source, constraint); // Checks if the new terminal is a port String id = null; if (isPort(terminal) && terminal instanceof mxICell) { id = ((mxICell)terminal).getId(); terminal = getTerminalForPort(terminal, source); } // Sets or resets all previous information for connecting to a child port String key = (source) ? mxConstants.STYLE_SOURCE_PORT : mxConstants.STYLE_TARGET_PORT; setCellStyles(key, id, new Object[]{edge}); model.setTerminal(edge, terminal, source); if (isResetEdgesOnConnect()) { resetEdge(edge); } fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED, "edge", edge, "terminal", terminal, "source", source, "previous", previous)); } finally { model.endUpdate(); } } } /** * Disconnects the given edges from the terminals which are not in the * given array. * * @param cells Array of <mxCells> to be disconnected. */ public void disconnectGraph(Object[] cells) { if (cells != null) { model.beginUpdate(); try { double scale = view.getScale(); mxPoint tr = view.getTranslate(); // Prepares a hashtable for faster cell lookups Set<Object> hash = new HashSet<Object>(); for (int i = 0; i < cells.length; i++) { hash.add(cells[i]); } for (int i = 0; i < cells.length; i++) { if (model.isEdge(cells[i])) { mxGeometry geo = model.getGeometry(cells[i]); if (geo != null) { mxCellState state = view.getState(cells[i]); mxCellState pstate = view.getState(model.getParent(cells[i])); if (state != null && pstate != null) { geo = (mxGeometry)geo.clone(); double dx = -pstate.getOrigin().getX(); double dy = -pstate.getOrigin().getY(); Object src = model.getTerminal(cells[i], true); if (src != null && isCellDisconnectable(cells[i], src, true)) { while (src != null && !hash.contains(src)) { src = model.getParent(src); } if (src == null) { mxPoint pt = state.getAbsolutePoint(0); geo.setTerminalPoint(new mxPoint(pt.getX() / scale - tr.getX() + dx, pt.getY() / scale - tr.getY() + dy), true); model.setTerminal(cells[i], null, true); } } Object trg = model.getTerminal(cells[i], false); if (trg != null && isCellDisconnectable(cells[i], trg, false)) { while (trg != null && !hash.contains(trg)) { trg = model.getParent(trg); } if (trg == null) { int n = state.getAbsolutePointCount() - 1; mxPoint pt = state.getAbsolutePoint(n); geo.setTerminalPoint(new mxPoint(pt.getX() / scale - tr.getX() + dx, pt.getY() / scale - tr.getY() + dy), false); model.setTerminal(cells[i], null, false); } } } model.setGeometry(cells[i], geo); } } } } finally { model.endUpdate(); } } } // // Drilldown // /** * Returns the current root of the displayed cell hierarchy. This is a * shortcut to <mxGraphView.currentRoot> in <view>. * * @return Returns the current root in the view. */ public Object getCurrentRoot() { return view.getCurrentRoot(); } /** * Returns the translation to be used if the given cell is the root cell as * an <mxPoint>. This implementation returns null. * * @param cell Cell that represents the root of the view. * @return Returns the translation of the graph for the given root cell. */ public mxPoint getTranslateForRoot(Object cell) { return null; } /** * Returns true if the given cell is a "port", that is, when connecting to * it, the cell returned by getTerminalForPort should be used as the * terminal and the port should be referenced by the ID in either the * mxConstants.STYLE_SOURCE_PORT or the or the * mxConstants.STYLE_TARGET_PORT. Note that a port should not be movable. * This implementation always returns false. * <p/> * A typical implementation of this method looks as follows: * <p/> * <code> * public boolean isPort(Object cell) * { * mxGeometry geo = getCellGeometry(cell); * <p/> * return (geo != null) ? geo.isRelative() : false; * } * </code> * * @param cell Cell that represents the port. * @return Returns true if the cell is a port. */ public boolean isPort(Object cell) { return false; } /** * Returns the terminal to be used for a given port. This implementation * always returns the parent cell. * * @param cell Cell that represents the port. * @param source If the cell is the source or target port. * @return Returns the terminal to be used for the given port. */ public Object getTerminalForPort(Object cell, boolean source) { return getModel().getParent(cell); } /** * Returns the offset to be used for the cells inside the given cell. The * root and layer cells may be identified using mxGraphModel.isRoot and * mxGraphModel.isLayer. This implementation returns null. * * @param cell Cell whose offset should be returned. * @return Returns the child offset for the given cell. */ public mxPoint getChildOffsetForCell(Object cell) { return null; } /** * */ public void enterGroup() { enterGroup(null); } /** * Uses the given cell as the root of the displayed cell hierarchy. If no * cell is specified then the selection cell is used. The cell is only used * if <isValidRoot> returns true. * * @param cell */ public void enterGroup(Object cell) { if (cell == null) { cell = getSelectionCell(); } if (cell != null && isValidRoot(cell)) { view.setCurrentRoot(cell); clearSelection(); } } /** * Changes the current root to the next valid root in the displayed cell * hierarchy. */ public void exitGroup() { Object root = model.getRoot(); Object current = getCurrentRoot(); if (current != null) { Object next = model.getParent(current); // Finds the next valid root in the hierarchy while (next != root && !isValidRoot(next) && model.getParent(next) != root) { next = model.getParent(next); } // Clears the current root if the new root is // the model's root or one of the layers. if (next == root || model.getParent(next) == root) { view.setCurrentRoot(null); } else { view.setCurrentRoot(next); } mxCellState state = view.getState(current); // Selects the previous root in the graph if (state != null) { setSelectionCell(current); } } } /** * Uses the root of the model as the root of the displayed cell hierarchy * and selects the previous root. */ public void home() { Object current = getCurrentRoot(); if (current != null) { view.setCurrentRoot(null); mxCellState state = view.getState(current); if (state != null) { setSelectionCell(current); } } } /** * Returns true if the given cell is a valid root for the cell display * hierarchy. This implementation returns true for all non-null values. * * @param cell <mxCell> which should be checked as a possible root. * @return Returns true if the given cell is a valid root. */ public boolean isValidRoot(Object cell) { return (cell != null); } // // Graph display // /** * Returns the bounds of the visible graph. */ public mxRectangle getGraphBounds() { return view.getGraphBounds(); } /** * Returns the bounds of the given cell. */ public mxRectangle getCellBounds(Object cell) { return getCellBounds(cell, false); } /** * Returns the bounds of the given cell including all connected edges * if includeEdge is true. */ public mxRectangle getCellBounds(Object cell, boolean includeEdges) { return getCellBounds(cell, includeEdges, false); } /** * Returns the bounds of the given cell including all connected edges * if includeEdge is true. */ public mxRectangle getCellBounds(Object cell, boolean includeEdges, boolean includeDescendants) { return getCellBounds(cell, includeEdges, includeDescendants, false); } /** * Returns the bounding box for the geometries of the vertices in the * given array of cells. */ public mxRectangle getBoundingBoxFromGeometry(Object[] cells) { mxRectangle result = null; if (cells != null) { for (int i = 0; i < cells.length; i++) { if (getModel().isVertex(cells[i])) { mxGeometry geo = getCellGeometry(cells[i]); if (result == null) { result = new mxRectangle(geo); } else { result.add(geo); } } } } return result; } /** * Returns the bounds of the given cell. */ public mxRectangle getBoundingBox(Object cell) { return getBoundingBox(cell, false); } /** * Returns the bounding box of the given cell including all connected edges * if includeEdge is true. */ public mxRectangle getBoundingBox(Object cell, boolean includeEdges) { return getBoundingBox(cell, includeEdges, false); } /** * Returns the bounding box of the given cell including all connected edges * if includeEdge is true. */ public mxRectangle getBoundingBox(Object cell, boolean includeEdges, boolean includeDescendants) { return getCellBounds(cell, includeEdges, includeDescendants, true); } /** * Returns the bounding box of the given cells and their descendants. */ public mxRectangle getPaintBounds(Object[] cells) { return getBoundsForCells(cells, false, true, true); } /** * Returns the bounds for the given cells. */ public mxRectangle getBoundsForCells(Object[] cells, boolean includeEdges, boolean includeDescendants, boolean boundingBox) { mxRectangle result = null; if (cells != null && cells.length > 0) { for (int i = 0; i < cells.length; i++) { mxRectangle tmp = getCellBounds(cells[i], includeEdges, includeDescendants, boundingBox); if (tmp != null) { if (result == null) { result = new mxRectangle(tmp); } else { result.add(tmp); } } } } return result; } /** * Returns the bounds of the given cell including all connected edges * if includeEdge is true. */ public mxRectangle getCellBounds(Object cell, boolean includeEdges, boolean includeDescendants, boolean boundingBox) { mxRectangle result = null; Object[] cells; // Recursively includes connected edges if (includeEdges) { Set<Object> allCells = new HashSet<Object>(); allCells.add(cell); Set<Object> edges = new HashSet<Object>(Arrays.asList(getEdges(cell))); while (!edges.isEmpty() && !allCells.containsAll(edges)) { allCells.addAll(edges); Set<Object> tmp = new HashSet<Object>(); Iterator<Object> it = edges.iterator(); while (it.hasNext()) { Object edge = it.next(); tmp.addAll(Arrays.asList(getEdges(edge))); } edges = tmp; } cells = allCells.toArray(); } else { cells = new Object[]{cell}; } if (boundingBox) { result = view.getBoundingBox(cells); } else { result = view.getBounds(cells); } // Recursively includes the bounds of the children if (includeDescendants) { int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { mxRectangle tmp = getCellBounds(model.getChildAt(cell, i), includeEdges, true, boundingBox); if (result != null) { result.add(tmp); } else { result = tmp; } } } return result; } /** * Clears all cell states or the states for the hierarchy starting at the * given cell and validates the graph. */ public void refresh() { view.reload(); repaint(); } /** * Fires a repaint event. */ public void repaint() { repaint(null); } /** * Fires a repaint event. The optional region is the rectangle that needs * to be repainted. */ public void repaint(mxRectangle region) { fireEvent(new mxEventObject(mxEvent.REPAINT, "region", region)); } /** * Snaps the given numeric value to the grid if <gridEnabled> is true. * * @param value Numeric value to be snapped to the grid. * @return Returns the value aligned to the grid. */ public double snap(double value) { if (gridEnabled) { value = Math.round(value / gridSize) * gridSize; } return value; } /** * Returns the geometry for the given cell. * * @param cell Cell whose geometry should be returned. * @return Returns the geometry of the cell. */ public mxGeometry getCellGeometry(Object cell) { return model.getGeometry(cell); } /** * Returns true if the given cell is visible in this graph. This * implementation uses <mxGraphModel.isVisible>. Subclassers can override * this to implement specific visibility for cells in only one graph, that * is, without affecting the visible state of the cell. * <p/> * When using dynamic filter expressions for cell visibility, then the * graph should be revalidated after the filter expression has changed. * * @param cell Cell whose visible state should be returned. * @return Returns the visible state of the cell. */ public boolean isCellVisible(Object cell) { return model.isVisible(cell); } /** * Returns true if the given cell is collapsed in this graph. This * implementation uses <mxGraphModel.isCollapsed>. Subclassers can override * this to implement specific collapsed states for cells in only one graph, * that is, without affecting the collapsed state of the cell. * <p/> * When using dynamic filter expressions for the collapsed state, then the * graph should be revalidated after the filter expression has changed. * * @param cell Cell whose collapsed state should be returned. * @return Returns the collapsed state of the cell. */ public boolean isCellCollapsed(Object cell) { return model.isCollapsed(cell); } /** * Returns true if the given cell is connectable in this graph. This * implementation uses <mxGraphModel.isConnectable>. Subclassers can override * this to implement specific connectable states for cells in only one graph, * that is, without affecting the connectable state of the cell in the model. * * @param cell Cell whose connectable state should be returned. * @return Returns the connectable state of the cell. */ public boolean isCellConnectable(Object cell) { return model.isConnectable(cell); } /** * Returns true if perimeter points should be computed such that the * resulting edge has only horizontal or vertical segments. * * @param edge Cell state that represents the edge. */ public boolean isOrthogonal(mxCellState edge) { if (edge.getStyle().containsKey(mxConstants.STYLE_ORTHOGONAL)) { return mxUtils.isTrue(edge.getStyle(), mxConstants.STYLE_ORTHOGONAL); } mxEdgeStyle.mxEdgeStyleFunction tmp = view.getEdgeStyle(edge, null, null, null); return tmp == mxEdgeStyle.SegmentConnector || tmp == mxEdgeStyle.ElbowConnector || tmp == mxEdgeStyle.SideToSide || tmp == mxEdgeStyle.TopToBottom || tmp == mxEdgeStyle.EntityRelation || tmp == mxEdgeStyle.OrthConnector; } /** * Returns true if the given cell state is a loop. * * @param state <mxCellState> that represents a potential loop. * @return Returns true if the given cell is a loop. */ public boolean isLoop(mxCellState state) { Object src = state.getVisibleTerminalState(true); Object trg = state.getVisibleTerminalState(false); return (src != null && src == trg); } // // Cell validation // /** * */ public void setMultiplicities(mxMultiplicity[] value) { mxMultiplicity[] oldValue = multiplicities; multiplicities = value; changeSupport.firePropertyChange("multiplicities", oldValue, multiplicities); } /** * */ public mxMultiplicity[] getMultiplicities() { return multiplicities; } /** * Checks if the return value of getEdgeValidationError for the given * arguments is null. * * @param edge Cell that represents the edge to validate. * @param source Cell that represents the source terminal. * @param target Cell that represents the target terminal. */ public boolean isEdgeValid(Object edge, Object source, Object target) { return getEdgeValidationError(edge, source, target) == null; } /** * Returns the validation error message to be displayed when inserting or * changing an edges' connectivity. A return value of null means the edge * is valid, a return value of '' means it's not valid, but do not display * an error message. Any other (non-empty) string returned from this method * is displayed as an error message when trying to connect an edge to a * source and target. This implementation uses the multiplicities, as * well as multigraph and allowDanglingEdges to generate validation * errors. * * @param edge Cell that represents the edge to validate. * @param source Cell that represents the source terminal. * @param target Cell that represents the target terminal. */ public String getEdgeValidationError(Object edge, Object source, Object target) { if (edge != null && !isAllowDanglingEdges() && (source == null || target == null)) { return ""; } if (edge != null && model.getTerminal(edge, true) == null && model.getTerminal(edge, false) == null) { return null; } // Checks if we're dealing with a loop if (!isAllowLoops() && source == target && source != null) { return ""; } // Checks if the connection is generally allowed if (!isValidConnection(source, target)) { return ""; } if (source != null && target != null) { StringBuffer error = new StringBuffer(); // Checks if the cells are already connected // and adds an error message if required if (!multigraph) { Object[] tmp = mxGraphModel.getEdgesBetween(model, source, target, true); // Checks if the source and target are not connected by another edge if (tmp.length > 1 || (tmp.length == 1 && tmp[0] != edge)) { error.append(mxResources.get("alreadyConnected", "Already Connected") + "\n"); } } // Gets the number of outgoing edges from the source // and the number of incoming edges from the target // without counting the edge being currently changed. int sourceOut = mxGraphModel.getDirectedEdgeCount(model, source, true, edge); int targetIn = mxGraphModel.getDirectedEdgeCount(model, target, false, edge); // Checks the change against each multiplicity rule if (multiplicities != null) { for (int i = 0; i < multiplicities.length; i++) { String err = multiplicities[i].check(this, edge, source, target, sourceOut, targetIn); if (err != null) { error.append(err); } } } // Validates the source and target terminals independently String err = validateEdge(edge, source, target); if (err != null) { error.append(err); } return (error.length() > 0) ? error.toString() : null; } return (allowDanglingEdges) ? null : ""; } /** * Hook method for subclassers to return an error message for the given * edge and terminals. This implementation returns null. * * @param edge Cell that represents the edge to validate. * @param source Cell that represents the source terminal. * @param target Cell that represents the target terminal. */ public String validateEdge(Object edge, Object source, Object target) { return null; } /** * Checks all multiplicities that cannot be enforced while the graph is * being modified, namely, all multiplicities that require a minimum of * 1 edge. * * @param cell Cell for which the multiplicities should be checked. */ public String getCellValidationError(Object cell) { int outCount = mxGraphModel.getDirectedEdgeCount(model, cell, true); int inCount = mxGraphModel.getDirectedEdgeCount(model, cell, false); StringBuffer error = new StringBuffer(); Object value = model.getValue(cell); if (multiplicities != null) { for (int i = 0; i < multiplicities.length; i++) { mxMultiplicity rule = multiplicities[i]; int max = rule.getMaxValue(); if (rule.source && mxUtils.isNode(value, rule.type, rule.attr, rule.value) && ((max == 0 && outCount > 0) || (rule.min == 1 && outCount == 0) || (max == 1 && outCount > 1))) { error.append(rule.countError + '\n'); } else if (!rule.source && mxUtils.isNode(value, rule.type, rule.attr, rule.value) && ((max == 0 && inCount > 0) || (rule.min == 1 && inCount == 0) || (max == 1 && inCount > 1))) { error.append(rule.countError + '\n'); } } } return (error.length() > 0) ? error.toString() : null; } /** * Hook method for subclassers to return an error message for the given * cell and validation context. This implementation returns null. * * @param cell Cell that represents the cell to validate. * @param context Hashtable that represents the global validation state. */ public String validateCell(Object cell, Hashtable<Object, Object> context) { return null; } // // Graph appearance // /** * @return the labelsVisible */ public boolean isLabelsVisible() { return labelsVisible; } /** * @param value the labelsVisible to set */ public void setLabelsVisible(boolean value) { boolean oldValue = labelsVisible; labelsVisible = value; changeSupport.firePropertyChange("labelsVisible", oldValue, labelsVisible); } /** * Returns the textual representation for the given cell. * * @param cell Cell to be converted to a string. * @return Returns the textual representation of the cell. */ public String convertValueToString(Object cell) { Object result = model.getValue(cell); if(result instanceof Named) { return ((Named)result).getName(); } return (result != null) ? result.toString() : ""; } /** * Returns a string or DOM node that represents the label for the given * cell. This implementation uses <convertValueToString> if <labelsVisible> * is true. Otherwise it returns an empty string. * * @param cell <mxCell> whose label should be returned. * @return Returns the label for the given cell. */ public String getLabel(Object cell) { String result = ""; if (cell != null) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); if (labelsVisible && !mxUtils.isTrue(style, mxConstants.STYLE_NOLABEL, false)) { result = convertValueToString(cell); } } return result; } /** * Sets the new label for a cell. If autoSize is true then * <cellSizeUpdated> will be called. * * @param cell Cell whose label should be changed. * @param value New label to be assigned. * @param autoSize Specifies if cellSizeUpdated should be called. */ public void cellLabelChanged(Object cell, Object value, boolean autoSize) { model.beginUpdate(); try { getModel().setValue(cell, value); if (autoSize) { cellSizeUpdated(cell, false); } } finally { model.endUpdate(); } } /** * Returns the tooltip to be used for the given cell. */ public String getToolTipForCell(Object cell) { return convertValueToString(cell); } /** * Returns the start size of the given swimlane, that is, the width or * height of the part that contains the title, depending on the * horizontal style. The return value is an <mxRectangle> with either * width or height set as appropriate. * * @param swimlane <mxCell> whose start size should be returned. * @return Returns the startsize for the given swimlane. */ public mxRectangle getStartSize(Object swimlane) { mxRectangle result = new mxRectangle(); mxCellState state = view.getState(swimlane); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(swimlane); if (style != null) { double size = mxUtils.getDouble(style, mxConstants.STYLE_STARTSIZE, mxConstants.DEFAULT_STARTSIZE); if (mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true)) { result.setHeight(size); } else { result.setWidth(size); } } return result; } /** * Returns the image URL for the given cell state. This implementation * returns the value stored under <mxConstants.STYLE_IMAGE> in the cell * style. * * @param state * @return Returns the image associated with the given cell state. */ public String getImage(mxCellState state) { return (state != null && state.getStyle() != null) ? mxUtils.getString(state.getStyle(), mxConstants.STYLE_IMAGE) : null; } /** * Returns the value of <border>. * * @return Returns the border. */ public int getBorder() { return border; } /** * Sets the value of <border>. * * @param value Positive integer that represents the border to be used. */ public void setBorder(int value) { border = value; } /** * Returns the default edge style used for loops. * * @return Returns the default loop style. */ public mxEdgeStyle.mxEdgeStyleFunction getDefaultLoopStyle() { return defaultLoopStyle; } /** * Sets the default style used for loops. * * @param value Default style to be used for loops. */ public void setDefaultLoopStyle(mxEdgeStyle.mxEdgeStyleFunction value) { mxEdgeStyle.mxEdgeStyleFunction oldValue = defaultLoopStyle; defaultLoopStyle = value; changeSupport.firePropertyChange("defaultLoopStyle", oldValue, defaultLoopStyle); } /** * Returns true if the given cell is a swimlane. This implementation always * returns false. * * @param cell Cell that should be checked. * @return Returns true if the cell is a swimlane. */ public boolean isSwimlane(Object cell) { if (cell != null) { if (model.getParent(cell) != model.getRoot()) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); if (style != null && !model.isEdge(cell)) { return mxUtils.getString(style, mxConstants.STYLE_SHAPE, "").equals(mxConstants.SHAPE_SWIMLANE); } } } return false; } // // Cells and labels control options // /** * Returns true if the given cell may not be moved, sized, bended, * disconnected, edited or selected. This implementation returns true for * all vertices with a relative geometry if cellsLocked is false. * * @param cell Cell whose locked state should be returned. * @return Returns true if the given cell is locked. */ public boolean isCellLocked(Object cell) { mxGeometry geometry = model.getGeometry(cell); return isCellsLocked() || (geometry != null && model.isVertex(cell) && geometry.isRelative()); } /** * Returns cellsLocked, the default return value for isCellLocked. */ public boolean isCellsLocked() { return cellsLocked; } /** * Sets cellsLocked, the default return value for isCellLocked and fires a * property change event for cellsLocked. */ public void setCellsLocked(boolean value) { boolean oldValue = cellsLocked; cellsLocked = value; changeSupport.firePropertyChange("cellsLocked", oldValue, cellsLocked); } /** * Returns true if the given cell is movable. This implementation returns editable. * * @param cell Cell whose editable state should be returned. * @return Returns true if the cell is editable. */ public boolean isCellEditable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsEditable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_EDITABLE, true); } /** * Returns true if editing is allowed in this graph. * * @return Returns true if the graph is editable. */ public boolean isCellsEditable() { return cellsEditable; } /** * Sets if the graph is editable. */ public void setCellsEditable(boolean value) { boolean oldValue = cellsEditable; cellsEditable = value; changeSupport.firePropertyChange("cellsEditable", oldValue, cellsEditable); } /** * Returns true if the given cell is resizable. This implementation returns * cellsSizable for all cells. * * @param cell Cell whose resizable state should be returned. * @return Returns true if the cell is sizable. */ public boolean isCellResizable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsResizable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_RESIZABLE, true); } /** * Returns true if the given cell is resizable. This implementation return sizable. */ public boolean isCellsResizable() { return cellsResizable; } /** * Sets if the graph is resizable. */ public void setCellsResizable(boolean value) { boolean oldValue = cellsResizable; cellsResizable = value; changeSupport.firePropertyChange("cellsResizable", oldValue, cellsResizable); } /** * Returns the cells which are movable in the given array of cells. */ public Object[] getMovableCells(Object[] cells) { return mxGraphModel.filterCells(cells, new Filter() { public boolean filter(Object cell) { return isCellMovable(cell); } }); } /** * Returns true if the given cell is movable. This implementation * returns movable. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellMovable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsMovable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_MOVABLE, true); } /** * Returns cellsMovable. */ public boolean isCellsMovable() { return cellsMovable; } /** * Sets cellsMovable. */ public void setCellsMovable(boolean value) { boolean oldValue = cellsMovable; cellsMovable = value; changeSupport.firePropertyChange("cellsMovable", oldValue, cellsMovable); } /** * Function: isTerminalPointMovable * <p/> * Returns true if the given terminal point is movable. This is independent * from isCellConnectable and isCellDisconnectable and controls if terminal * points can be moved in the graph if the edge is not connected. Note that * it is required for this to return true to connect unconnected edges. * This implementation returns true. * * @param cell Cell whose terminal point should be moved. * @param source Boolean indicating if the source or target terminal should be moved. */ public boolean isTerminalPointMovable(Object cell, boolean source) { return true; } /** * Returns true if the given cell is bendable. This implementation returns * bendable. This is used in mxElbowEdgeHandler to determine if the middle * handle should be shown. * * @param cell Cell whose bendable state should be returned. * @return Returns true if the cell is bendable. */ public boolean isCellBendable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsBendable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_BENDABLE, true); } /** * Returns cellsBendable. */ public boolean isCellsBendable() { return cellsBendable; } /** * Sets cellsBendable. */ public void setCellsBendable(boolean value) { boolean oldValue = cellsBendable; cellsBendable = value; changeSupport.firePropertyChange("cellsBendable", oldValue, cellsBendable); } /** * Returns true if the given cell is selectable. This implementation returns * <selectable>. * * @param cell <mxCell> whose selectable state should be returned. * @return Returns true if the given cell is selectable. */ public boolean isCellSelectable(Object cell) { return isCellsSelectable(); } /** * Returns cellsSelectable. */ public boolean isCellsSelectable() { return cellsSelectable; } /** * Sets cellsSelectable. */ public void setCellsSelectable(boolean value) { boolean oldValue = cellsSelectable; cellsSelectable = value; changeSupport.firePropertyChange("cellsSelectable", oldValue, cellsSelectable); } /** * Returns the cells which are movable in the given array of cells. */ public Object[] getDeletableCells(Object[] cells) { return mxGraphModel.filterCells(cells, new Filter() { public boolean filter(Object cell) { return isCellDeletable(cell); } }); } /** * Returns true if the given cell is movable. This implementation always * returns true. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellDeletable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsDeletable() && mxUtils.isTrue(style, mxConstants.STYLE_DELETABLE, true); } /** * Returns cellsDeletable. */ public boolean isCellsDeletable() { return cellsDeletable; } /** * Sets cellsDeletable. */ public void setCellsDeletable(boolean value) { boolean oldValue = cellsDeletable; cellsDeletable = value; changeSupport.firePropertyChange("cellsDeletable", oldValue, cellsDeletable); } /** * Returns the cells which are movable in the given array of cells. */ public Object[] getCloneableCells(Object[] cells) { return mxGraphModel.filterCells(cells, new Filter() { public boolean filter(Object cell) { return isCellCloneable(cell); } }); } /** * Returns the constant true. This does not use the cloneable field to * return a value for a given cell, it is simply a hook for subclassers * to disallow cloning of individual cells. */ public boolean isCellCloneable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsCloneable() && mxUtils.isTrue(style, mxConstants.STYLE_CLONEABLE, true); } /** * Returns cellsCloneable. */ public boolean isCellsCloneable() { return cellsCloneable; } /** * Specifies if the graph should allow cloning of cells by holding down the * control key while cells are being moved. This implementation updates * cellsCloneable. * * @param value Boolean indicating if the graph should be cloneable. */ public void setCellsCloneable(boolean value) { boolean oldValue = cellsCloneable; cellsCloneable = value; changeSupport.firePropertyChange("cellsCloneable", oldValue, cellsCloneable); } /** * Returns true if the given cell is disconnectable from the source or * target terminal. This returns <disconnectable> for all given cells if * <isLocked> does not return true for the given cell. * * @param cell <mxCell> whose disconnectable state should be returned. * @param terminal <mxCell> that represents the source or target terminal. * @param source Boolean indicating if the source or target terminal is to be * disconnected. * @return Returns true if the given edge can be disconnected from the given * terminal. */ public boolean isCellDisconnectable(Object cell, Object terminal, boolean source) { return isCellsDisconnectable() && !isCellLocked(cell); } /** * Returns cellsDisconnectable. */ public boolean isCellsDisconnectable() { return cellsDisconnectable; } /** * Sets cellsDisconnectable. * * @param value Boolean indicating if the graph should allow disconnecting of * edges. */ public void setCellsDisconnectable(boolean value) { boolean oldValue = cellsDisconnectable; cellsDisconnectable = value; changeSupport.firePropertyChange("cellsDisconnectable", oldValue, cellsDisconnectable); } /** * Returns true if the overflow portion of labels should be hidden. If this * returns true then vertex labels will be clipped to the size of the vertices. * This implementation returns true if <mxConstants.STYLE_OVERFLOW> in the * style of the given cell is "hidden". * * @param cell Cell whose label should be clipped. * @return Returns true if the cell label should be clipped. */ public boolean isLabelClipped(Object cell) { if (!isLabelsClipped()) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return (style != null) ? mxUtils.getString(style, mxConstants.STYLE_OVERFLOW, "").equals("hidden") : false; } return isLabelsClipped(); } /** * Returns labelsClipped. */ public boolean isLabelsClipped() { return labelsClipped; } /** * Sets labelsClipped. */ public void setLabelsClipped(boolean value) { boolean oldValue = labelsClipped; labelsClipped = value; changeSupport.firePropertyChange("labelsClipped", oldValue, labelsClipped); } /** * Returns true if the given edges's label is moveable. This returns * <movable> for all given cells if <isLocked> does not return true * for the given cell. * * @param cell <mxCell> whose label should be moved. * @return Returns true if the label of the given cell is movable. */ public boolean isLabelMovable(Object cell) { return !isCellLocked(cell) && ((model.isEdge(cell) && isEdgeLabelsMovable()) || (model.isVertex(cell) && isVertexLabelsMovable())); } /** * Returns vertexLabelsMovable. */ public boolean isVertexLabelsMovable() { return vertexLabelsMovable; } /** * Sets vertexLabelsMovable. */ public void setVertexLabelsMovable(boolean value) { boolean oldValue = vertexLabelsMovable; vertexLabelsMovable = value; changeSupport.firePropertyChange("vertexLabelsMovable", oldValue, vertexLabelsMovable); } /** * Returns edgeLabelsMovable. */ public boolean isEdgeLabelsMovable() { return edgeLabelsMovable; } /** * Returns edgeLabelsMovable. */ public void setEdgeLabelsMovable(boolean value) { boolean oldValue = edgeLabelsMovable; edgeLabelsMovable = value; changeSupport.firePropertyChange("edgeLabelsMovable", oldValue, edgeLabelsMovable); } // // Graph control options // /** * Returns true if the graph is <enabled>. * * @return Returns true if the graph is enabled. */ public boolean isEnabled() { return enabled; } /** * Specifies if the graph should allow any interactions. This * implementation updates <enabled>. * * @param value Boolean indicating if the graph should be enabled. */ public void setEnabled(boolean value) { boolean oldValue = enabled; enabled = value; changeSupport.firePropertyChange("enabled", oldValue, enabled); } /** * Returns true if the graph allows drop into other cells. */ public boolean isDropEnabled() { return dropEnabled; } /** * Sets dropEnabled. */ public void setDropEnabled(boolean value) { boolean oldValue = dropEnabled; dropEnabled = value; changeSupport.firePropertyChange("dropEnabled", oldValue, dropEnabled); } /** * Affects the return values of isValidDropTarget to allow for edges as * drop targets. The splitEdge method is called in mxGraphHandler if * mxGraphComponent.isSplitEvent returns true for a given configuration. */ public boolean isSplitEnabled() { return splitEnabled; } /** * Sets splitEnabled. */ public void setSplitEnabled(boolean value) { splitEnabled = value; } /** * Returns multigraph. */ public boolean isMultigraph() { return multigraph; } /** * Sets multigraph. */ public void setMultigraph(boolean value) { boolean oldValue = multigraph; multigraph = value; changeSupport.firePropertyChange("multigraph", oldValue, multigraph); } /** * Returns swimlaneNesting. */ public boolean isSwimlaneNesting() { return swimlaneNesting; } /** * Sets swimlaneNesting. */ public void setSwimlaneNesting(boolean value) { boolean oldValue = swimlaneNesting; swimlaneNesting = value; changeSupport.firePropertyChange("swimlaneNesting", oldValue, swimlaneNesting); } /** * Returns allowDanglingEdges */ public boolean isAllowDanglingEdges() { return allowDanglingEdges; } /** * Sets allowDanglingEdges. */ public void setAllowDanglingEdges(boolean value) { boolean oldValue = allowDanglingEdges; allowDanglingEdges = value; changeSupport.firePropertyChange("allowDanglingEdges", oldValue, allowDanglingEdges); } /** * Returns cloneInvalidEdges. */ public boolean isCloneInvalidEdges() { return cloneInvalidEdges; } /** * Sets cloneInvalidEdge. */ public void setCloneInvalidEdges(boolean value) { boolean oldValue = cloneInvalidEdges; cloneInvalidEdges = value; changeSupport.firePropertyChange("cloneInvalidEdges", oldValue, cloneInvalidEdges); } /** * Returns disconnectOnMove */ public boolean isDisconnectOnMove() { return disconnectOnMove; } /** * Sets disconnectOnMove. */ public void setDisconnectOnMove(boolean value) { boolean oldValue = disconnectOnMove; disconnectOnMove = value; changeSupport.firePropertyChange("disconnectOnMove", oldValue, disconnectOnMove); } /** * Returns allowLoops. */ public boolean isAllowLoops() { return allowLoops; } /** * Sets allowLoops. */ public void setAllowLoops(boolean value) { boolean oldValue = allowLoops; allowLoops = value; changeSupport.firePropertyChange("allowLoops", oldValue, allowLoops); } /** * Returns connectableEdges. */ public boolean isConnectableEdges() { return connectableEdges; } /** * Sets connetableEdges. */ public void setConnectableEdges(boolean value) { boolean oldValue = connectableEdges; connectableEdges = value; changeSupport.firePropertyChange("connectableEdges", oldValue, connectableEdges); } /** * Returns resetEdgesOnMove. */ public boolean isResetEdgesOnMove() { return resetEdgesOnMove; } /** * Sets resetEdgesOnMove. */ public void setResetEdgesOnMove(boolean value) { boolean oldValue = resetEdgesOnMove; resetEdgesOnMove = value; changeSupport.firePropertyChange("resetEdgesOnMove", oldValue, resetEdgesOnMove); } /** * Returns resetViewOnRootChange. */ public boolean isResetViewOnRootChange() { return resetViewOnRootChange; } /** * Sets resetEdgesOnResize. */ public void setResetViewOnRootChange(boolean value) { boolean oldValue = resetViewOnRootChange; resetViewOnRootChange = value; changeSupport.firePropertyChange("resetViewOnRootChange", oldValue, resetViewOnRootChange); } /** * Returns resetEdgesOnResize. */ public boolean isResetEdgesOnResize() { return resetEdgesOnResize; } /** * Sets resetEdgesOnResize. */ public void setResetEdgesOnResize(boolean value) { boolean oldValue = resetEdgesOnResize; resetEdgesOnResize = value; changeSupport.firePropertyChange("resetEdgesOnResize", oldValue, resetEdgesOnResize); } /** * Returns resetEdgesOnConnect. */ public boolean isResetEdgesOnConnect() { return resetEdgesOnConnect; } /** * Sets resetEdgesOnConnect. */ public void setResetEdgesOnConnect(boolean value) { boolean oldValue = resetEdgesOnConnect; resetEdgesOnConnect = value; changeSupport.firePropertyChange("resetEdgesOnConnect", oldValue, resetEdgesOnResize); } /** * Returns true if the size of the given cell should automatically be * updated after a change of the label. This implementation returns * autoSize for all given cells or checks if the cell style does specify * mxConstants.STYLE_AUTOSIZE to be 1. * * @param cell Cell that should be resized. * @return Returns true if the size of the given cell should be updated. */ public boolean isAutoSizeCell(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isAutoSizeCells() || mxUtils.isTrue(style, mxConstants.STYLE_AUTOSIZE, false); } /** * Returns true if the size of the given cell should automatically be * updated after a change of the label. This implementation returns * autoSize for all given cells. */ public boolean isAutoSizeCells() { return autoSizeCells; } /** * Specifies if cell sizes should be automatically updated after a label * change. This implementation sets autoSize to the given parameter. * * @param value Boolean indicating if cells should be resized * automatically. */ public void setAutoSizeCells(boolean value) { boolean oldValue = autoSizeCells; autoSizeCells = value; changeSupport.firePropertyChange("autoSizeCells", oldValue, autoSizeCells); } /** * Returns true if the parent of the given cell should be extended if the * child has been resized so that it overlaps the parent. This * implementation returns ExtendParents if cell is not an edge. * * @param cell Cell that has been resized. */ public boolean isExtendParent(Object cell) { return !getModel().isEdge(cell) && isExtendParents(); } /** * Returns extendParents. */ public boolean isExtendParents() { return extendParents; } /** * Sets extendParents. */ public void setExtendParents(boolean value) { boolean oldValue = extendParents; extendParents = value; changeSupport.firePropertyChange("extendParents", oldValue, extendParents); } /** * Returns extendParentsOnAdd. */ public boolean isExtendParentsOnAdd() { return extendParentsOnAdd; } /** * Sets extendParentsOnAdd. */ public void setExtendParentsOnAdd(boolean value) { boolean oldValue = extendParentsOnAdd; extendParentsOnAdd = value; changeSupport.firePropertyChange("extendParentsOnAdd", oldValue, extendParentsOnAdd); } /** * Returns true if the given cell should be kept inside the bounds of its * parent according to the rules defined by getOverlap and * isAllowOverlapParent. This implementation returns false for all children * of edges and isConstrainChildren() otherwise. */ public boolean isConstrainChild(Object cell) { return isConstrainChildren() && !getModel().isEdge(getModel().getParent(cell)); } /** * Returns constrainChildren. * * @return the keepInsideParentOnMove */ public boolean isConstrainChildren() { return constrainChildren; } /** * @param value the constrainChildren to set */ public void setConstrainChildren(boolean value) { boolean oldValue = constrainChildren; constrainChildren = value; changeSupport.firePropertyChange("constrainChildren", oldValue, constrainChildren); } /** * Returns autoOrigin. */ public boolean isAutoOrigin() { return autoOrigin; } /** * @param value the autoOrigin to set */ public void setAutoOrigin(boolean value) { boolean oldValue = autoOrigin; autoOrigin = value; changeSupport.firePropertyChange("autoOrigin", oldValue, autoOrigin); } /** * Returns origin. */ public mxPoint getOrigin() { return origin; } /** * @param value the origin to set */ public void setOrigin(mxPoint value) { mxPoint oldValue = origin; origin = value; changeSupport.firePropertyChange("origin", oldValue, origin); } /** * @return Returns changesRepaintThreshold. */ public int getChangesRepaintThreshold() { return changesRepaintThreshold; } /** * @param value the changesRepaintThreshold to set */ public void setChangesRepaintThreshold(int value) { int oldValue = changesRepaintThreshold; changesRepaintThreshold = value; changeSupport.firePropertyChange("changesRepaintThreshold", oldValue, changesRepaintThreshold); } /** * Returns isAllowNegativeCoordinates. * * @return the allowNegativeCoordinates */ public boolean isAllowNegativeCoordinates() { return allowNegativeCoordinates; } /** * @param value the allowNegativeCoordinates to set */ public void setAllowNegativeCoordinates(boolean value) { boolean oldValue = allowNegativeCoordinates; allowNegativeCoordinates = value; changeSupport.firePropertyChange("allowNegativeCoordinates", oldValue, allowNegativeCoordinates); } /** * Returns collapseToPreferredSize. * * @return the collapseToPreferredSize */ public boolean isCollapseToPreferredSize() { return collapseToPreferredSize; } /** * @param value the collapseToPreferredSize to set */ public void setCollapseToPreferredSize(boolean value) { boolean oldValue = collapseToPreferredSize; collapseToPreferredSize = value; changeSupport.firePropertyChange("collapseToPreferredSize", oldValue, collapseToPreferredSize); } /** * @return Returns true if edges are rendered in the foreground. */ public boolean isKeepEdgesInForeground() { return keepEdgesInForeground; } /** * @param value the keepEdgesInForeground to set */ public void setKeepEdgesInForeground(boolean value) { boolean oldValue = keepEdgesInForeground; keepEdgesInForeground = value; changeSupport.firePropertyChange("keepEdgesInForeground", oldValue, keepEdgesInForeground); } /** * @return Returns true if edges are rendered in the background. */ public boolean isKeepEdgesInBackground() { return keepEdgesInBackground; } /** * @param value the keepEdgesInBackground to set */ public void setKeepEdgesInBackground(boolean value) { boolean oldValue = keepEdgesInBackground; keepEdgesInBackground = value; changeSupport.firePropertyChange("keepEdgesInBackground", oldValue, keepEdgesInBackground); } /** * Returns true if the given cell is a valid source for new connections. * This implementation returns true for all non-null values and is * called by is called by <isValidConnection>. * * @param cell Object that represents a possible source or null. * @return Returns true if the given cell is a valid source terminal. */ public boolean isValidSource(Object cell) { return (cell == null && allowDanglingEdges) || (cell != null && (!model.isEdge(cell) || isConnectableEdges()) && isCellConnectable(cell)); } /** * Returns isValidSource for the given cell. This is called by * isValidConnection. * * @param cell Object that represents a possible target or null. * @return Returns true if the given cell is a valid target. */ public boolean isValidTarget(Object cell) { return isValidSource(cell); } /** * Returns true if the given target cell is a valid target for source. * This is a boolean implementation for not allowing connections between * certain pairs of vertices and is called by <getEdgeValidationError>. * This implementation returns true if <isValidSource> returns true for * the source and <isValidTarget> returns true for the target. * * @param source Object that represents the source cell. * @param target Object that represents the target cell. * @return Returns true if the the connection between the given terminals * is valid. */ public boolean isValidConnection(Object source, Object target) { return isValidSource(source) && isValidTarget(target) && (isAllowLoops() || source != target); } /** * Returns the minimum size of the diagram. * * @return Returns the minimum container size. */ public mxRectangle getMinimumGraphSize() { return minimumGraphSize; } /** * @param value the minimumGraphSize to set */ public void setMinimumGraphSize(mxRectangle value) { mxRectangle oldValue = minimumGraphSize; minimumGraphSize = value; changeSupport.firePropertyChange("minimumGraphSize", oldValue, value); } /** * Returns a decimal number representing the amount of the width and height * of the given cell that is allowed to overlap its parent. A value of 0 * means all children must stay inside the parent, 1 means the child is * allowed to be placed outside of the parent such that it touches one of * the parents sides. If <isAllowOverlapParent> returns false for the given * cell, then this method returns 0. * * @param cell * @return Returns the overlapping value for the given cell inside its * parent. */ public double getOverlap(Object cell) { return (isAllowOverlapParent(cell)) ? getDefaultOverlap() : 0; } /** * Gets defaultOverlap. */ public double getDefaultOverlap() { return defaultOverlap; } /** * Sets defaultOverlap. */ public void setDefaultOverlap(double value) { double oldValue = defaultOverlap; defaultOverlap = value; changeSupport.firePropertyChange("defaultOverlap", oldValue, value); } /** * Returns true if the given cell is allowed to be placed outside of the * parents area. * * @param cell * @return Returns true if the given cell may overlap its parent. */ public boolean isAllowOverlapParent(Object cell) { return false; } /** * Returns the cells which are movable in the given array of cells. */ public Object[] getFoldableCells(Object[] cells, final boolean collapse) { return mxGraphModel.filterCells(cells, new Filter() { public boolean filter(Object cell) { return isCellFoldable(cell, collapse); } }); } /** * Returns true if the given cell is expandable. This implementation * returns true if the cell has at least one child and its style * does not specify mxConstants.STYLE_FOLDABLE to be 0. * * @param cell <mxCell> whose expandable state should be returned. * @return Returns true if the given cell is expandable. */ public boolean isCellFoldable(Object cell, boolean collapse) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return model.getChildCount(cell) > 0 && mxUtils.isTrue(style, mxConstants.STYLE_FOLDABLE, true); } /** * Returns true if the grid is enabled. * * @return Returns the enabled state of the grid. */ public boolean isGridEnabled() { return gridEnabled; } /** * Sets if the grid is enabled. * * @param value Specifies if the grid should be enabled. */ public void setGridEnabled(boolean value) { boolean oldValue = gridEnabled; gridEnabled = value; changeSupport.firePropertyChange("gridEnabled", oldValue, gridSize); } /** * Returns the grid size. * * @return Returns the grid size */ public int getGridSize() { return gridSize; } /** * Sets the grid size and fires a property change event for gridSize. * * @param value New grid size to be used. */ public void setGridSize(int value) { int oldValue = gridSize; gridSize = value; changeSupport.firePropertyChange("gridSize", oldValue, gridSize); } /** * Returns alternateEdgeStyle. */ public String getAlternateEdgeStyle() { return alternateEdgeStyle; } /** * Sets alternateEdgeStyle. */ public void setAlternateEdgeStyle(String value) { String oldValue = alternateEdgeStyle; alternateEdgeStyle = value; changeSupport.firePropertyChange("alternateEdgeStyle", oldValue, alternateEdgeStyle); } /** * Returns true if the given cell is a valid drop target for the specified * cells. This returns true if the cell is a swimlane, has children and is * not collapsed, or if splitEnabled is true and isSplitTarget returns * true for the given arguments * * @param cell Object that represents the possible drop target. * @param cells Objects that are going to be dropped. * @return Returns true if the cell is a valid drop target for the given * cells. */ public boolean isValidDropTarget(Object cell, Object[] cells) { return cell != null && ((isSplitEnabled() && isSplitTarget(cell, cells)) || (!model.isEdge(cell) && (isSwimlane(cell) || (model.getChildCount(cell) > 0 && !isCellCollapsed(cell))))); } /** * Returns true if split is enabled and the given edge may be splitted into * two edges with the given cell as a new terminal between the two. * * @param target Object that represents the edge to be splitted. * @param cells Array of cells to add into the given edge. * @return Returns true if the given edge may be splitted by the given * cell. */ public boolean isSplitTarget(Object target, Object[] cells) { if (target != null && cells != null && cells.length == 1) { Object src = model.getTerminal(target, true); Object trg = model.getTerminal(target, false); return (model.isEdge(target) && isCellConnectable(cells[0]) && getEdgeValidationError(target, model.getTerminal(target, true), cells[0]) == null && !model.isAncestor(cells[0], src) && !model.isAncestor(cells[0], trg)); } return false; } /** * Returns the given cell if it is a drop target for the given cells or the * nearest ancestor that may be used as a drop target for the given cells. * If the given array contains a swimlane and swimlaneNesting is false * then this always returns null. If no cell is given, then the bottommost * swimlane at the location of the given event is returned. * <p/> * This function should only be used if isDropEnabled returns true. */ public Object getDropTarget(Object[] cells, Point pt, Object cell) { if (!isSwimlaneNesting()) { for (int i = 0; i < cells.length; i++) { if (isSwimlane(cells[i])) { return null; } } } // FIXME the else below does nothing if swimlane is null Object swimlane = null; //getSwimlaneAt(pt.x, pt.y); if (cell == null) { cell = swimlane; } /*else if (swimlane != null) { // Checks if the cell is an ancestor of the swimlane // under the mouse and uses the swimlane in that case Object tmp = model.getParent(swimlane); while (tmp != null && isSwimlane(tmp) && tmp != cell) { tmp = model.getParent(tmp); } if (tmp == cell) { cell = swimlane; } }*/ while (cell != null && !isValidDropTarget(cell, cells) && model.getParent(cell) != model.getRoot()) { cell = model.getParent(cell); } return (model.getParent(cell) != model.getRoot() && !mxUtils.contains(cells, cell)) ? cell : null; } ; // // Cell retrieval // /** * Returns the first child of the root in the model, that is, the first or * default layer of the diagram. * * @return Returns the default parent for new cells. */ public Object getDefaultParent() { Object parent = defaultParent; if (parent == null) { parent = view.getCurrentRoot(); if (parent == null) { Object root = model.getRoot(); parent = model.getChildAt(root, 0); } } return parent; } /** * Sets the default parent to be returned by getDefaultParent. * Set this to null to return the first child of the root in * getDefaultParent. */ public void setDefaultParent(Object value) { defaultParent = value; } /** * Returns the visible child vertices of the given parent. * * @param parent Cell whose children should be returned. */ public Object[] getChildVertices(Object parent) { return getChildCells(parent, true, false); } /** * Returns the visible child edges of the given parent. * * @param parent Cell whose children should be returned. */ public Object[] getChildEdges(Object parent) { return getChildCells(parent, false, true); } /** * Returns the visible children of the given parent. * * @param parent Cell whose children should be returned. */ public Object[] getChildCells(Object parent) { return getChildCells(parent, false, false); } /** * Returns the visible child vertices or edges in the given parent. If * vertices and edges is false, then all children are returned. * * @param parent Cell whose children should be returned. * @param vertices Specifies if child vertices should be returned. * @param edges Specifies if child edges should be returned. * @return Returns the child vertices and edges. */ public Object[] getChildCells(Object parent, boolean vertices, boolean edges) { Object[] cells = mxGraphModel.getChildCells(model, parent, vertices, edges); List<Object> result = new ArrayList<Object>(cells.length); // Filters out the non-visible child cells for (int i = 0; i < cells.length; i++) { if (isCellVisible(cells[i])) { result.add(cells[i]); } } return result.toArray(); } /** * Returns all visible edges connected to the given cell without loops. * * @param cell Cell whose connections should be returned. * @return Returns the connected edges for the given cell. */ public Object[] getConnections(Object cell) { return getConnections(cell, null); } /** * Returns all visible edges connected to the given cell without loops. * If the optional parent argument is specified, then only child * edges of the given parent are returned. * * @param cell Cell whose connections should be returned. * @param parent Optional parent of the opposite end for a connection * to be returned. * @return Returns the connected edges for the given cell. */ public Object[] getConnections(Object cell, Object parent) { return getConnections(cell, parent, false); } /** * Returns all visible edges connected to the given cell without loops. * If the optional parent argument is specified, then only child * edges of the given parent are returned. * * @param cell Cell whose connections should be returned. * @param parent Optional parent of the opposite end for a connection * to be returned. * @return Returns the connected edges for the given cell. */ public Object[] getConnections(Object cell, Object parent, boolean recurse) { return getEdges(cell, parent, true, true, false, recurse); } /** * Returns all incoming visible edges connected to the given cell without * loops. * * @param cell Cell whose incoming edges should be returned. * @return Returns the incoming edges of the given cell. */ public Object[] getIncomingEdges(Object cell) { return getIncomingEdges(cell, null); } /** * Returns the visible incoming edges for the given cell. If the optional * parent argument is specified, then only child edges of the given parent * are returned. * * @param cell Cell whose incoming edges should be returned. * @param parent Optional parent of the opposite end for an edge * to be returned. * @return Returns the incoming edges of the given cell. */ public Object[] getIncomingEdges(Object cell, Object parent) { return getEdges(cell, parent, true, false, false); } /** * Returns all outgoing visible edges connected to the given cell without * loops. * * @param cell Cell whose outgoing edges should be returned. * @return Returns the outgoing edges of the given cell. */ public Object[] getOutgoingEdges(Object cell) { return getOutgoingEdges(cell, null); } /** * Returns the visible outgoing edges for the given cell. If the optional * parent argument is specified, then only child edges of the given parent * are returned. * * @param cell Cell whose outgoing edges should be returned. * @param parent Optional parent of the opposite end for an edge * to be returned. * @return Returns the outgoing edges of the given cell. */ public Object[] getOutgoingEdges(Object cell, Object parent) { return getEdges(cell, parent, false, true, false); } /** * Returns all visible edges connected to the given cell including loops. * * @param cell Cell whose edges should be returned. * @return Returns the edges of the given cell. */ public Object[] getEdges(Object cell) { return getEdges(cell, null); } /** * Returns all visible edges connected to the given cell including loops. * * @param cell Cell whose edges should be returned. * @param parent Optional parent of the opposite end for an edge * to be returned. * @return Returns the edges of the given cell. */ public Object[] getEdges(Object cell, Object parent) { return getEdges(cell, parent, true, true, true); } /** * Returns the incoming and/or outgoing edges for the given cell. * If the optional parent argument is specified, then only edges are returned * where the opposite is in the given parent cell. * * @param cell Cell whose edges should be returned. * @param parent Optional parent. If specified the opposite end of any edge * must be a direct child of that parent in order for the edge to be returned. * @param incoming Specifies if incoming edges should be included in the * result. * @param outgoing Specifies if outgoing edges should be included in the * result. * @param includeLoops Specifies if loops should be included in the result. * @return Returns the edges connected to the given cell. */ public Object[] getEdges(Object cell, Object parent, boolean incoming, boolean outgoing, boolean includeLoops) { return getEdges(cell, parent, incoming, outgoing, includeLoops, false); } /** * Returns the incoming and/or outgoing edges for the given cell. * If the optional parent argument is specified, then only edges are returned * where the opposite is in the given parent cell. * * @param cell Cell whose edges should be returned. * @param parent Optional parent. If specified the opposite end of any edge * must be a child of that parent in order for the edge to be returned. The * recurse parameter specifies whether or not it must be the direct child * or the parent just be an ancestral parent. * @param incoming Specifies if incoming edges should be included in the * result. * @param outgoing Specifies if outgoing edges should be included in the * result. * @param includeLoops Specifies if loops should be included in the result. * @param recurse Specifies if the parent specified only need be an ancestral * parent, <code>true</code>, or the direct parent, <code>false</code> * @return Returns the edges connected to the given cell. */ public Object[] getEdges(Object cell, Object parent, boolean incoming, boolean outgoing, boolean includeLoops, boolean recurse) { boolean isCollapsed = isCellCollapsed(cell); List<Object> edges = new ArrayList<Object>(); int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(cell, i); if (isCollapsed || !isCellVisible(child)) { edges.addAll(Arrays.asList(mxGraphModel.getEdges(model, child, incoming, outgoing, includeLoops))); } } edges.addAll(Arrays.asList(mxGraphModel.getEdges(model, cell, incoming, outgoing, includeLoops))); List<Object> result = new ArrayList<Object>(edges.size()); Iterator<Object> it = edges.iterator(); while (it.hasNext()) { Object edge = it.next(); mxCellState state = view.getState(edge); Object source = (state != null) ? state.getVisibleTerminal(true) : view.getVisibleTerminal(edge, true); Object target = (state != null) ? state.getVisibleTerminal(false) : view.getVisibleTerminal(edge, false); if ((includeLoops && source == target) || ((source != target) && ((incoming && target == cell && (parent == null || isValidAncestor(source, parent, recurse))) || (outgoing && source == cell && (parent == null || isValidAncestor(target, parent, recurse)))))) { result.add(edge); } } return result.toArray(); } /** * Returns whether or not the specified parent is a valid * ancestor of the specified cell, either direct or indirectly * based on whether ancestor recursion is enabled. * * @param cell the possible child cell * @param parent the possible parent cell * @param recurse whether or not to recurse the child ancestors * @return whether or not the specified parent is a valid * ancestor of the specified cell, either direct or indirectly * based on whether ancestor recursion is enabled. */ public boolean isValidAncestor(Object cell, Object parent, boolean recurse) { return (recurse ? model.isAncestor(parent, cell) : model.getParent(cell) == parent); } /** * Returns all distinct visible opposite cells of the terminal on the given * edges. * * @param edges * @param terminal * @return Returns the terminals at the opposite ends of the given edges. */ public Object[] getOpposites(Object[] edges, Object terminal) { return getOpposites(edges, terminal, true, true); } /** * Returns all distincts visible opposite cells for the specified terminal * on the given edges. * * @param edges Edges whose opposite terminals should be returned. * @param terminal Terminal that specifies the end whose opposite should be * returned. * @param sources Specifies if source terminals should be included in the * result. * @param targets Specifies if target terminals should be included in the * result. * @return Returns the cells at the opposite ends of the given edges. */ public Object[] getOpposites(Object[] edges, Object terminal, boolean sources, boolean targets) { Collection<Object> terminals = new LinkedHashSet<Object>(); if (edges != null) { for (int i = 0; i < edges.length; i++) { mxCellState state = view.getState(edges[i]); Object source = (state != null) ? state.getVisibleTerminal(true) : view.getVisibleTerminal(edges[i], true); Object target = (state != null) ? state.getVisibleTerminal(false) : view.getVisibleTerminal(edges[i], false); // Checks if the terminal is the source of // the edge and if the target should be // stored in the result if (targets && source == terminal && target != null && target != terminal) { terminals.add(target); } // Checks if the terminal is the taget of // the edge and if the source should be // stored in the result else if (sources && target == terminal && source != null && source != terminal) { terminals.add(source); } } } return terminals.toArray(); } /** * Returns the edges between the given source and target. This takes into * account collapsed and invisible cells and returns the connected edges * as displayed on the screen. * * @param source * @param target * @return Returns all edges between the given terminals. */ public Object[] getEdgesBetween(Object source, Object target) { return getEdgesBetween(source, target, false); } /** * Returns the edges between the given source and target. This takes into * account collapsed and invisible cells and returns the connected edges * as displayed on the screen. * * @param source * @param target * @param directed * @return Returns all edges between the given terminals. */ public Object[] getEdgesBetween(Object source, Object target, boolean directed) { Object[] edges = getEdges(source); List<Object> result = new ArrayList<Object>(edges.length); // Checks if the edge is connected to the correct // cell and adds any match to the result for (int i = 0; i < edges.length; i++) { mxCellState state = view.getState(edges[i]); Object src = (state != null) ? state.getVisibleTerminal(true) : view.getVisibleTerminal(edges[i], true); Object trg = (state != null) ? state.getVisibleTerminal(false) : view.getVisibleTerminal(edges[i], false); if ((src == source && trg == target) || (!directed && src == target && trg == source)) { result.add(edges[i]); } } return result.toArray(); } /** * Returns the children of the given parent that are contained in the * halfpane from the given point (x0, y0) rightwards and downwards * depending on rightHalfpane and bottomHalfpane. * * @param x0 X-coordinate of the origin. * @param y0 Y-coordinate of the origin. * @param parent <mxCell> whose children should be checked. * @param rightHalfpane Boolean indicating if the cells in the right halfpane * from the origin should be returned. * @param bottomHalfpane Boolean indicating if the cells in the bottom halfpane * from the origin should be returned. * @return Returns the cells beyond the given halfpane. */ public Object[] getCellsBeyond(double x0, double y0, Object parent, boolean rightHalfpane, boolean bottomHalfpane) { if (parent == null) { parent = getDefaultParent(); } int childCount = model.getChildCount(parent); List<Object> result = new ArrayList<Object>(childCount); if (rightHalfpane || bottomHalfpane) { if (parent != null) { for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(parent, i); mxCellState state = view.getState(child); if (isCellVisible(child) && state != null) { if ((!rightHalfpane || state.getX() >= x0) && (!bottomHalfpane || state.getY() >= y0)) { result.add(child); } } } } } return result.toArray(); } /** * Returns all visible children in the given parent which do not have * incoming edges. If the result is empty then the with the greatest * difference between incoming and outgoing edges is returned. This * takes into account edges that are being promoted to the given * root due to invisible children or collapsed cells. * * @param parent Cell whose children should be checked. * @return List of tree roots in parent. */ public List<Object> findTreeRoots(Object parent) { return findTreeRoots(parent, false); } /** * Returns all visible children in the given parent which do not have * incoming edges. If the result is empty then the children with the * maximum difference between incoming and outgoing edges are returned. * This takes into account edges that are being promoted to the given * root due to invisible children or collapsed cells. * * @param parent Cell whose children should be checked. * @param isolate Specifies if edges should be ignored if the opposite * end is not a child of the given parent cell. * @return List of tree roots in parent. */ public List<Object> findTreeRoots(Object parent, boolean isolate) { return findTreeRoots(parent, isolate, false); } /** * Returns all visible children in the given parent which do not have * incoming edges. If the result is empty then the children with the * maximum difference between incoming and outgoing edges are returned. * This takes into account edges that are being promoted to the given * root due to invisible children or collapsed cells. * * @param parent Cell whose children should be checked. * @param isolate Specifies if edges should be ignored if the opposite * end is not a child of the given parent cell. * @param invert Specifies if outgoing or incoming edges should be counted * for a tree root. If false then outgoing edges will be counted. * @return List of tree roots in parent. */ public List<Object> findTreeRoots(Object parent, boolean isolate, boolean invert) { List<Object> roots = new ArrayList<Object>(); if (parent != null) { int childCount = model.getChildCount(parent); Object best = null; int maxDiff = 0; for (int i = 0; i < childCount; i++) { Object cell = model.getChildAt(parent, i); if (model.isVertex(cell) && isCellVisible(cell)) { Object[] conns = getConnections(cell, (isolate) ? parent : null); int fanOut = 0; int fanIn = 0; for (int j = 0; j < conns.length; j++) { Object src = view.getVisibleTerminal(conns[j], true); if (src == cell) { fanOut++; } else { fanIn++; } } if ((invert && fanOut == 0 && fanIn > 0) || (!invert && fanIn == 0 && fanOut > 0)) { roots.add(cell); } int diff = (invert) ? fanIn - fanOut : fanOut - fanIn; if (diff > maxDiff) { maxDiff = diff; best = cell; } } } if (roots.isEmpty() && best != null) { roots.add(best); } } return roots; } /** * Traverses the tree starting at the given vertex. Here is how to use this * method for a given vertex (root) which is typically the root of a tree: * <code> * graph.traverse(root, true, new mxICellVisitor() * { * public boolean visit(Object vertex, Object edge) * { * System.out.println("edge="+graph.convertValueToString(edge)+ * " vertex="+graph.convertValueToString(vertex)); * <p/> * return true; * } * }); * </code> * * @param vertex * @param directed * @param visitor */ public void traverse(Object vertex, boolean directed, mxICellVisitor visitor) { traverse(vertex, directed, visitor, null, null); } /** * Traverses the (directed) graph invoking the given function for each * visited vertex and edge. The function is invoked with the current vertex * and the incoming edge as a parameter. This implementation makes sure * each vertex is only visited once. The function may return false if the * traversal should stop at the given vertex. * * @param vertex <mxCell> that represents the vertex where the traversal starts. * @param directed Optional boolean indicating if edges should only be traversed * from source to target. Default is true. * @param visitor Visitor that takes the current vertex and the incoming edge. * The traversal stops if the function returns false. * @param edge Optional <mxCell> that represents the incoming edge. This is * null for the first step of the traversal. * @param visited Optional array of cell paths for the visited cells. */ public void traverse(Object vertex, boolean directed, mxICellVisitor visitor, Object edge, Set<Object> visited) { if (vertex != null && visitor != null) { if (visited == null) { visited = new HashSet<Object>(); } if (!visited.contains(vertex)) { visited.add(vertex); if (visitor.visit(vertex, edge)) { int edgeCount = model.getEdgeCount(vertex); if (edgeCount > 0) { for (int i = 0; i < edgeCount; i++) { Object e = model.getEdgeAt(vertex, i); boolean isSource = model.getTerminal(e, true) == vertex; if (!directed || isSource) { Object next = model.getTerminal(e, !isSource); traverse(next, directed, visitor, e, visited); } } } } } } } // // Selection // /** * */ public mxGraphSelectionModel getSelectionModel() { return selectionModel; } /** * */ public int getSelectionCount() { return selectionModel.size(); } /** * @param cell * @return Returns true if the given cell is selected. */ public boolean isCellSelected(Object cell) { return selectionModel.isSelected(cell); } /** * @return Returns true if the selection is empty. */ public boolean isSelectionEmpty() { return selectionModel.isEmpty(); } /** * */ public void clearSelection() { selectionModel.clear(); } /** * @return Returns the selection cell. */ public Object getSelectionCell() { return selectionModel.getCell(); } /** * @param cell */ public void setSelectionCell(Object cell) { selectionModel.setCell(cell); } /** * @return Returns the selection cells. */ public Object[] getSelectionCells() { return selectionModel.getCells(); } /** * */ public void setSelectionCells(Object[] cells) { selectionModel.setCells(cells); } /** * @param cells */ public void setSelectionCells(Collection<Object> cells) { if (cells != null) { setSelectionCells(cells.toArray()); } } /** * */ public void addSelectionCell(Object cell) { selectionModel.addCell(cell); } /** * */ public void addSelectionCells(Object[] cells) { selectionModel.addCells(cells); } /** * */ public void removeSelectionCell(Object cell) { selectionModel.removeCell(cell); } /** * */ public void removeSelectionCells(Object[] cells) { selectionModel.removeCells(cells); } /** * Selects the next cell. */ public void selectNextCell() { selectCell(true, false, false); } /** * Selects the previous cell. */ public void selectPreviousCell() { selectCell(false, false, false); } /** * Selects the parent cell. */ public void selectParentCell() { selectCell(false, true, false); } /** * Selects the first child cell. */ public void selectChildCell() { selectCell(false, false, true); } /** * Selects the next, parent, first child or previous cell, if all arguments * are false. * * @param isNext * @param isParent * @param isChild */ public void selectCell(boolean isNext, boolean isParent, boolean isChild) { Object cell = getSelectionCell(); if (getSelectionCount() > 1) { clearSelection(); } Object parent = (cell != null) ? model.getParent(cell) : getDefaultParent(); int childCount = model.getChildCount(parent); if (cell == null && childCount > 0) { Object child = model.getChildAt(parent, 0); setSelectionCell(child); } else if ((cell == null || isParent) && view.getState(parent) != null && model.getGeometry(parent) != null) { if (getCurrentRoot() != parent) { setSelectionCell(parent); } } else if (cell != null && isChild) { int tmp = model.getChildCount(cell); if (tmp > 0) { Object child = model.getChildAt(cell, 0); setSelectionCell(child); } } else if (childCount > 0) { int i = ((mxICell)parent).getIndex((mxICell)cell); if (isNext) { i++; setSelectionCell(model.getChildAt(parent, i % childCount)); } else { i--; int index = (i < 0) ? childCount - 1 : i; setSelectionCell(model.getChildAt(parent, index)); } } } /** * Selects all vertices inside the default parent. */ public void selectVertices() { selectVertices(null); } /** * Selects all vertices inside the given parent or the default parent * if no parent is given. */ public void selectVertices(Object parent) { selectCells(true, false, parent); } /** * Selects all vertices inside the default parent. */ public void selectEdges() { selectEdges(null); } /** * Selects all vertices inside the given parent or the default parent * if no parent is given. */ public void selectEdges(Object parent) { selectCells(false, true, parent); } /** * Selects all vertices and/or edges depending on the given boolean * arguments recursively, starting at the default parent. Use * <code>selectAll</code> to select all cells. * * @param vertices Boolean indicating if vertices should be selected. * @param edges Boolean indicating if edges should be selected. */ public void selectCells(boolean vertices, boolean edges) { selectCells(vertices, edges, null); } /** * Selects all vertices and/or edges depending on the given boolean * arguments recursively, starting at the given parent or the default * parent if no parent is specified. Use <code>selectAll</code> to select * all cells. * * @param vertices Boolean indicating if vertices should be selected. * @param edges Boolean indicating if edges should be selected. * @param parent Optional cell that acts as the root of the recursion. * Default is <code>defaultParent</code>. */ public void selectCells(final boolean vertices, final boolean edges, Object parent) { if (parent == null) { parent = getDefaultParent(); } Collection<Object> cells = mxGraphModel.filterDescendants(getModel(), new mxGraphModel.Filter() { /** * */ public boolean filter(Object cell) { return view.getState(cell) != null && model.getChildCount(cell) == 0 && ((model.isVertex(cell) && vertices) || (model.isEdge(cell) && edges)); } }); setSelectionCells(cells); } /** * */ public void selectAll() { selectAll(null); } /** * Selects all children of the given parent cell or the children of the * default parent if no parent is specified. To select leaf vertices and/or * edges use <selectCells>. * * @param parent Optional <mxCell> whose children should be selected. * Default is <defaultParent>. */ public void selectAll(Object parent) { if (parent == null) { parent = getDefaultParent(); } Object[] children = mxGraphModel.getChildren(model, parent); if (children != null) { setSelectionCells(children); } } // // Images and drawing // /** * Draws the graph onto the given canvas. * * @param canvas Canvas onto which the graph should be drawn. */ public void drawGraph(mxICanvas canvas) { drawCell(canvas, getModel().getRoot()); } /** * Draws the given cell and its descendants onto the specified canvas. * * @param canvas Canvas onto which the cell should be drawn. * @param cell Cell that should be drawn onto the canvas. */ public void drawCell(mxICanvas canvas, Object cell) { drawState(canvas, getView().getState(cell), true); // Draws the children on top of their parent int childCount = model.getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = model.getChildAt(cell, i); drawCell(canvas, child); } } /** * Draws the cell state with the given label onto the canvas. No * children or descendants are painted here. This method invokes * cellDrawn after the cell, but not its descendants have been * painted. * * @param canvas Canvas onto which the cell should be drawn. * @param state State of the cell to be drawn. * @param drawLabel Indicates if the label should be drawn. */ public void drawState(mxICanvas canvas, mxCellState state, boolean drawLabel) { Object cell = (state != null) ? state.getCell() : null; if (cell != null && cell != view.getCurrentRoot() && cell != model.getRoot() && (model.isVertex(cell) || model.isEdge(cell))) { Object obj = canvas.drawCell(state); Object lab = null; // Holds the current clipping region in case the label will // be clipped Shape clip = null; Rectangle newClip = state.getRectangle(); // Indirection for image canvas that contains a graphics canvas mxICanvas clippedCanvas = (isLabelClipped(state.getCell())) ? canvas : null; if (clippedCanvas instanceof mxImageCanvas) { clippedCanvas = ((mxImageCanvas)clippedCanvas).getGraphicsCanvas(); // TODO: Shift newClip to match the image offset //Point pt = ((mxImageCanvas) canvas).getTranslate(); //newClip.translate(-pt.x, -pt.y); } if (clippedCanvas instanceof mxGraphics2DCanvas) { Graphics g = ((mxGraphics2DCanvas)clippedCanvas).getGraphics(); clip = g.getClip(); // Ensure that our new clip resides within our old clip if (clip instanceof Rectangle) { g.setClip(newClip.intersection((Rectangle)clip)); } // Otherwise, default to original implementation else { g.setClip(newClip); } } if (drawLabel) { String label = state.getLabel(); if (label != null && state.getLabelBounds() != null) { lab = canvas.drawLabel(label, state, false); } } // Restores the previous clipping region if (clippedCanvas instanceof mxGraphics2DCanvas) { ((mxGraphics2DCanvas)clippedCanvas).getGraphics().setClip(clip); } // Invokes the cellDrawn callback with the object which was created // by the canvas to represent the cell graphically if (obj != null) { cellDrawn(canvas, state, obj, lab); } } } /** * Called when a cell has been painted as the specified object, typically a * DOM node that represents the given cell graphically in a document. */ protected void cellDrawn(mxICanvas canvas, mxCellState state, Object element, Object labelElement) { if (element instanceof Element) { String link = getLinkForCell(state.getCell()); if (link != null) { String title = getToolTipForCell(state.getCell()); Element elem = (Element)element; if (elem.getNodeName().startsWith("v:")) { elem.setAttribute("href", link.toString()); if (title != null) { elem.setAttribute("title", title); } } else if (elem.getOwnerDocument().getElementsByTagName("svg").getLength() > 0) { Element xlink = elem.getOwnerDocument().createElement("a"); xlink.setAttribute("xlink:href", link.toString()); elem.getParentNode().replaceChild(xlink, elem); xlink.appendChild(elem); if (title != null) { xlink.setAttribute("xlink:title", title); } elem = xlink; } else { Element a = elem.getOwnerDocument().createElement("a"); a.setAttribute("href", link.toString()); a.setAttribute("style", "text-decoration:none;"); elem.getParentNode().replaceChild(a, elem); a.appendChild(elem); if (title != null) { a.setAttribute("title", title); } elem = a; } String target = getTargetForCell(state.getCell()); if (target != null) { elem.setAttribute("target", target); } } } } /** * Returns the hyperlink to be used for the given cell. */ protected String getLinkForCell(Object cell) { return null; } /** * Returns the hyperlink to be used for the given cell. */ protected String getTargetForCell(Object cell) { return null; } // // Redirected to change support // /** * @param listener * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener) */ public void addPropertyChangeListener(PropertyChangeListener listener) { changeSupport.addPropertyChangeListener(listener); } /** * @param propertyName * @param listener * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) */ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { changeSupport.addPropertyChangeListener(propertyName, listener); } /** * @param listener * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener) */ public void removePropertyChangeListener(PropertyChangeListener listener) { changeSupport.removePropertyChangeListener(listener); } /** * @param propertyName * @param listener * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) */ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { changeSupport.removePropertyChangeListener(propertyName, listener); } /** * Prints the version number on the console. */ public static void main(String[] args) { System.out.println("mxGraph version \"" + VERSION + "\""); } }
{ "content_hash": "f6a51a8b3680f508bce8881bca1933be", "timestamp": "", "source": "github", "line_count": 6746, "max_line_length": 140, "avg_line_length": 31.362288763711827, "alnum_prop": 0.6387436782152479, "repo_name": "consulo/consulo", "id": "54904fcb6decd460c0bf0f65307bec417291e7c8", "size": "211675", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/desktop-awt/desktop-ui-impl/src/main/java/com/mxgraph/view/mxGraph.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "299" }, { "name": "C", "bytes": "52718" }, { "name": "C++", "bytes": "72795" }, { "name": "CMake", "bytes": "854" }, { "name": "CSS", "bytes": "64655" }, { "name": "Groovy", "bytes": "36006" }, { "name": "HTML", "bytes": "173780" }, { "name": "Java", "bytes": "64026758" }, { "name": "Lex", "bytes": "5909" }, { "name": "Objective-C", "bytes": "23787" }, { "name": "Python", "bytes": "3276" }, { "name": "SCSS", "bytes": "9782" }, { "name": "Shell", "bytes": "5689" }, { "name": "Thrift", "bytes": "1216" }, { "name": "XSLT", "bytes": "49230" } ], "symlink_target": "" }
package com.sohu.cache.util; /** * Integer 工具类 * * @author 银时:yinshi.nc / yinshi.nc@taobao.com * @Date Jan 13, 2012 */ public class IntegerUtil { /** * 如果为0,则返回默认值 * * @param originalInt * @param defaultInt * 默认Integer * @return */ public static Integer defaultIfZero( Integer originalInt, Integer defaultInt ) { if ( 0 == originalInt ) { return defaultInt; } return originalInt; } /** * 如果为0,则返回默认值 * * @param originalInt * @param defaultInt * 默认Integer * @return */ public static Integer defaultIfError( String originalStr, Integer defaultInt ) { try { return Integer.parseInt( StringUtil.trimToEmpty( originalStr ) ); } catch ( Exception e ) { return defaultInt; } } /** * 如果是一个不合法的整型,那么返回一个默认值 * * @param originalInt * @param defaultInt * 默认Integer * @return */ public static Integer defaultIfError( Integer originalStr, Integer defaultInt ) { try { return originalStr; } catch ( Exception e ) { return defaultInt; } } /** * 如果非正,则返回默认值<br> * @param originalInt * @param defaultInt * 默认Integer * @return originalInt if originalInt>0, return defaultInt if originalInt<=0 */ public static Integer defaultIfSmallerThan0( Integer originalInt, Integer defaultInt ) { if ( 0 >= originalInt ) { return defaultInt; } return originalInt; } /** 将String 转化成 Integer,如果小于等于0,将抛异常 */ public static Integer exceptionIfSmallerThan0( String originalStr )throws Exception{ try { int num = Integer.parseInt( StringUtil.trimToEmpty( originalStr ) ); if( num > 0 ) return num; else throw new Exception(); } catch ( Exception e ) { throw new Exception( originalStr + " is smaller than 0, or it is a invalid parameter " ); } } /** * 判断是否大余0 * @return false if num <=0 , true if num >0 */ public static boolean isBiggerThan0( int num ){ if( 0>= num ) return false; return true; } /** * Return maxInt if too big, else return original. * * @param originalInt * @param maxInt * max int * @return */ public static Integer maxIfTooBig( Integer originalInt, Integer maxInt ) { if ( originalInt >= maxInt ) { originalInt = maxInt; } return originalInt; } }
{ "content_hash": "32339f3b8e7888ee6d41da5d0b6ad1c1", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 93, "avg_line_length": 21.13157894736842, "alnum_prop": 0.6081361560813615, "repo_name": "sohutv/cachecloud", "id": "a6ca663efd9d69529b7ad452fb86995683616804", "size": "2579", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "cachecloud-web/src/main/java/com/sohu/cache/util/IntegerUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "383298" }, { "name": "FreeMarker", "bytes": "74311" }, { "name": "HTML", "bytes": "1764" }, { "name": "Java", "bytes": "1497812" }, { "name": "JavaScript", "bytes": "1481557" }, { "name": "PLpgSQL", "bytes": "202324" }, { "name": "Shell", "bytes": "8160" } ], "symlink_target": "" }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace DotNetty.Transport.Bootstrapping { using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Net; using System.Text; using System.Threading.Tasks; using DotNetty.Common.Utilities; using DotNetty.Transport.Channels; /// <summary> /// {@link AbstractBootstrap} is a helper class that makes it easy to bootstrap a {@link Channel}. It support /// method-chaining to provide an easy way to configure the {@link AbstractBootstrap}. /// /// <p>When not used in a {@link ServerBootstrap} context, the {@link #bind()} methods are useful for connectionless /// transports such as datagram (UDP).</p> /// </summary> public abstract class AbstractBootstrap<TBootstrap, TChannel> : ICloneable where TBootstrap : AbstractBootstrap<TBootstrap, TChannel> where TChannel : IChannel { volatile IEventLoopGroup group; volatile Func<TChannel> channelFactory; volatile EndPoint localAddress; readonly ConcurrentDictionary<ChannelOption, object> options; // todo: attr //readonly Dictionary<AttributeKey, object> attrs = new Dictionary<AttributeKey, object>(); volatile IChannelHandler handler; protected internal AbstractBootstrap() { this.options = new ConcurrentDictionary<ChannelOption, object>(); // Disallow extending from a different package. } protected internal AbstractBootstrap(AbstractBootstrap<TBootstrap, TChannel> bootstrap) { this.group = bootstrap.group; this.channelFactory = bootstrap.channelFactory; this.handler = bootstrap.handler; this.localAddress = bootstrap.localAddress; this.options = new ConcurrentDictionary<ChannelOption, object>(bootstrap.options); // todo: attr //lock (bootstrap.attrs) //{ // this.attrs.putAll(bootstrap.attrs); //} } /// <summary> /// The {@link EventLoopGroup} which is used to handle all the events for the to-be-created /// {@link Channel} /// </summary> public virtual TBootstrap Group(IEventLoopGroup group) { Contract.Requires(group != null); if (this.group != null) { throw new InvalidOperationException("group has already been set."); } this.group = group; return (TBootstrap)this; } /// <summary> /// The {@link Class} which is used to create {@link Channel} instances from. /// You either use this or {@link #channelFactory(io.netty.channel.ChannelFactory)} if your /// {@link Channel} implementation has no no-args constructor. /// </summary> public TBootstrap Channel<T>() where T : TChannel, new() { return this.ChannelFactory(() => new T()); } public TBootstrap ChannelFactory(Func<TChannel> channelFactory) { Contract.Requires(channelFactory != null); this.channelFactory = channelFactory; return (TBootstrap)this; } /// <summary> /// The {@link SocketAddress} which is used to bind the local "end" to. /// </summary> public TBootstrap LocalAddress(EndPoint localAddress) { this.localAddress = localAddress; return (TBootstrap)this; } /// <summary> /// @see {@link #localAddress(SocketAddress)} /// </summary> public TBootstrap LocalAddress(int inetPort) { return this.LocalAddress(new IPEndPoint(IPAddress.Any, inetPort)); } /// <summary> /// @see {@link #localAddress(SocketAddress)} /// </summary> public TBootstrap LocalAddress(string inetHost, int inetPort) { return this.LocalAddress(new DnsEndPoint(inetHost, inetPort)); } /// <summary> /// @see {@link #localAddress(SocketAddress)} /// </summary> public TBootstrap LocalAddress(IPAddress inetHost, int inetPort) { return this.LocalAddress(new IPEndPoint(inetHost, inetPort)); } /// <summary> /// Allow to specify a {@link ChannelOption} which is used for the {@link Channel} instances once they got /// created. Use a value of {@code null} to remove a previous set {@link ChannelOption}. /// </summary> public TBootstrap Option<T>(ChannelOption<T> option, T value) { Contract.Requires(option != null); if (value == null) { object removed; this.options.TryRemove(option, out removed); } else { this.options[option] = value; } return (TBootstrap)this; } /// <summary> /// Allow to specify an initial attribute of the newly created {@link Channel}. If the {@code value} is /// {@code null}, the attribute of the specified {@code key} is removed. /// </summary> // todo: attr //public B attr<T>(AttributeKey<T> key, T value) //{ // if (key == null) // { // throw new NullPointerException("key"); // } // if (value == null) // { // synchronized(this.attrs) // { // this.attrs.remove(key); // } // } // else // { // synchronized(this.attrs) // { // this.attrs.put(key, value); // } // } // return (B)this; //} /// <summary> /// Validate all the parameters. Sub-classes may override this, but should /// call the super method in that case. /// </summary> public virtual TBootstrap Validate() { if (this.group == null) { throw new InvalidOperationException("group not set"); } if (this.channelFactory == null) { throw new InvalidOperationException("channel or channelFactory not set"); } return (TBootstrap)this; } /// <summary> /// Returns a deep clone of this bootstrap which has the identical configuration. This method is useful when making /// multiple {@link Channel}s with similar settings. Please note that this method does not clone the /// {@link EventLoopGroup} deeply but shallowly, making the group a shared resource. /// </summary> public abstract object Clone(); /// <summary> /// Create a new {@link Channel} and register it with an {@link EventLoop}. /// </summary> public Task Register() { this.Validate(); return this.InitAndRegisterAsync(); } /// <summary> /// Create a new {@link Channel} and bind it. /// </summary> public Task<IChannel> BindAsync() { this.Validate(); EndPoint address = this.localAddress; if (address == null) { throw new InvalidOperationException("localAddress must be set beforehand."); } return this.DoBind(address); } /// <summary> /// Create a new {@link Channel} and bind it. /// </summary> public Task<IChannel> BindAsync(int inetPort) { return this.BindAsync(new IPEndPoint(IPAddress.Any, inetPort)); } /// <summary> /// Create a new {@link Channel} and bind it. /// </summary> public Task<IChannel> BindAsync(string inetHost, int inetPort) { return this.BindAsync(new DnsEndPoint(inetHost, inetPort)); } /// <summary> /// Create a new {@link Channel} and bind it. /// </summary> public Task<IChannel> BindAsync(IPAddress inetHost, int inetPort) { return this.BindAsync(new IPEndPoint(inetHost, inetPort)); } /// <summary> /// Create a new {@link Channel} and bind it. /// </summary> public Task<IChannel> BindAsync(EndPoint localAddress) { this.Validate(); Contract.Requires(localAddress != null); return this.DoBind(localAddress); } async Task<IChannel> DoBind(EndPoint localAddress) { IChannel channel = await this.InitAndRegisterAsync(); await DoBind0(channel, localAddress); return channel; } protected async Task<IChannel> InitAndRegisterAsync() { IChannel channel = this.channelFactory(); try { this.Init(channel); } catch (Exception ex) { channel.Unsafe.CloseForcibly(); // as the Channel is not registered yet we need to force the usage of the GlobalEventExecutor throw; } try { await this.Group().GetNext().RegisterAsync(channel); } catch (Exception) { if (channel.Registered) { channel.CloseAsync(); } else { channel.Unsafe.CloseForcibly(); } throw; } // If we are here and the promise is not failed, it's one of the following cases: // 1) If we attempted registration from the event loop, the registration has been completed at this point. // i.e. It's safe to attempt bind() or connect() now because the channel has been registered. // 2) If we attempted registration from the other thread, the registration request has been successfully // added to the event loop's task queue for later execution. // i.e. It's safe to attempt bind() or connect() now: // because bind() or connect() will be executed *after* the scheduled registration task is executed // because register(), bind(), and connect() are all bound to the same thread. return channel; } static Task DoBind0(IChannel channel, EndPoint localAddress) { // This method is invoked before channelRegistered() is triggered. Give user handlers a chance to set up // the pipeline in its channelRegistered() implementation. return channel.EventLoop.SubmitAsync(async () => { try { await channel.BindAsync(localAddress); } catch (Exception) { channel.CloseAsync(); throw; } }); } protected abstract void Init(IChannel channel); /// <summary> /// the {@link ChannelHandler} to use for serving the requests. /// </summary> public TBootstrap Handler(IChannelHandler handler) { Contract.Requires(handler != null); this.handler = handler; return (TBootstrap)this; } protected EndPoint LocalAddress() { return this.localAddress; } protected IChannelHandler Handler() { return this.handler; } /// <summary> /// Return the configured {@link EventLoopGroup} or {@code null} if non is configured yet. /// </summary> public IEventLoopGroup Group() { return this.group; } protected IDictionary<ChannelOption, object> Options() { return this.options; } // todo: attr //Dictionary<AttributeKey, object> attrs() //{ // return this.attrs; //} public override string ToString() { StringBuilder buf = new StringBuilder() .Append(this.GetType().Name) .Append('('); if (this.group != null) { buf.Append("group: ") .Append(this.group.GetType().Name) .Append(", "); } if (this.channelFactory != null) { buf.Append("channelFactory: ") .Append(this.channelFactory) .Append(", "); } if (this.localAddress != null) { buf.Append("localAddress: ") .Append(this.localAddress) .Append(", "); } buf.Append("options: ") .Append(this.options.ToDebugString()) .Append(", "); // todo: attr //lock (this.attrs) //{ // if (!this.attrs.isEmpty()) // { // buf.Append("attrs: ") // .Append(this.attrs) // .Append(", "); // } //} if (this.handler != null) { buf.Append("handler: ") .Append(this.handler) .Append(", "); } if (buf[buf.Length - 1] == '(') { buf.Append(')'); } else { buf[buf.Length - 2] = ')'; buf.Length = buf.Length - 1; } return buf.ToString(); } //static class PendingRegistrationPromise : DefaultChannelPromise //{ // // Is set to the correct EventExecutor once the registration was successful. Otherwise it will // // stay null and so the GlobalEventExecutor.INSTANCE will be used for notifications. // volatile EventExecutor executor; // PendingRegistrationPromise(Channel channel) // { // super(channel); // } // protected EventExecutor executor() // { // EventExecutor executor = this.executor; // if (executor != null) // { // // If the registration was a success executor is set. // // // // See https://github.com/netty/netty/issues/2586 // return executor; // } // // The registration failed so we can only use the GlobalEventExecutor as last resort to notify. // return GlobalEventExecutor.INSTANCE; // } //} } }
{ "content_hash": "c8190bf2f04d55275604d2311503f054", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 124, "avg_line_length": 34.40950226244344, "alnum_prop": 0.5189690314945098, "repo_name": "iwate/DotNetty", "id": "2368badc1d3a25154fc7fb79c9815dd8138cc435", "size": "15211", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/DotNetty.Transport/Bootstrapping/AbstractBootstrap.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "706917" } ], "symlink_target": "" }
using System.Collections.Generic; using Mobile.Core.Interfaces.Entities; using Mobile.Core.Models; namespace Mobile.Core.Interfaces.Services.Database { public interface IUserService { void Delete(string id, bool isSoft = true); void DeleteAll(bool isSoft = true); List<User> GetAll(bool includeDeleted = false); User GetByEmail(string email); void Save(User user); } }
{ "content_hash": "941f057fa0b33981bc264873837ce9ef", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 60, "avg_line_length": 30.2, "alnum_prop": 0.6445916114790287, "repo_name": "andCulture/xamarin-architecture", "id": "02171ababe958fe95abe3c84b00a00e12ad1de67", "size": "455", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "01-Core/Mobile.Core/Interfaces/Services/Database/IUserService.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "131052" } ], "symlink_target": "" }
<?php namespace JGM\AgpBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * JGM\AgpBundle\Entity\ProductoEntregaReference * * @ORM\Table() * @ORM\Entity(repositoryClass="JGM\AgpBundle\Entity\ProductoEntregaReferenceRepository") */ class ProductoEntregaReference { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\ManyToOne(targetEntity="JGM\AgpBundle\Entity\Producto", inversedBy="productos") */ protected $producto; /** * @ORM\ManyToOne(targetEntity="JGM\AgpBundle\Entity\Entrega", inversedBy="entrega") */ protected $entrega; /** * @var string * * @ORM\Column(name="cantidad", type="integer") * @Assert\NotBlank(message="La cantidado no puede estar en blanco") */ private $cantidad; function getId() { return $this->id; } function getProducto() { return $this->producto; } function getEntrega() { return $this->entrega; } function getCantidad() { return $this->cantidad; } function setProducto($producto) { $this->producto = $producto; } function setEntrega($entrega) { $this->entrega = $entrega; } function setCantidad($cantidad) { $this->cantidad = $cantidad; } }
{ "content_hash": "f9fde9df7b985c5ef09a1158a3a8749d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 90, "avg_line_length": 18.74025974025974, "alnum_prop": 0.613998613998614, "repo_name": "alegperea/apparrecifes", "id": "3386863ef6d94cb3b6f142dcf4573d49cc9c80a5", "size": "1443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/JGM/AgpBundle/Entity/ProductoEntregaReference.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "16386" }, { "name": "ApacheConf", "bytes": "2907" }, { "name": "CSS", "bytes": "592393" }, { "name": "HTML", "bytes": "145025" }, { "name": "JavaScript", "bytes": "879365" }, { "name": "PHP", "bytes": "236419" }, { "name": "Shell", "bytes": "1628" } ], "symlink_target": "" }
package org.sep4j.support; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Test; public class SepStringHelperTest { @Test public void camelCaseToCapitalizedWordsTest() { assertNull(SepStringHelper.camelCaseToCapitalizedWords(null)); assertEquals("", SepStringHelper.camelCaseToCapitalizedWords("")); assertEquals(" ", SepStringHelper.camelCaseToCapitalizedWords(" ")); assertEquals("First Name", SepStringHelper.camelCaseToCapitalizedWords("firstName")); assertEquals("First Name", SepStringHelper.camelCaseToCapitalizedWords("FirstName")); assertEquals("Abc", SepStringHelper.camelCaseToCapitalizedWords("abc")); assertEquals("DEF", SepStringHelper.camelCaseToCapitalizedWords("DEF")); assertEquals("Abc DEF", SepStringHelper.camelCaseToCapitalizedWords("abcDEF")); assertEquals("Abc DE Fghi", SepStringHelper.camelCaseToCapitalizedWords("abcDEFghi")); assertEquals("Abc 200 Ghi", SepStringHelper.camelCaseToCapitalizedWords("abc200Ghi")); assertEquals("Abc 200 Ghi", SepStringHelper.camelCaseToCapitalizedWords("abc200ghi")); assertEquals("First _ Name", SepStringHelper.camelCaseToCapitalizedWords("first_name")); } @Test public void wordsToUncapitalizedCamelCaseTest() { assertNull(SepStringHelper.wordsToUncapitalizedCamelCase(null)); assertEquals("", SepStringHelper.wordsToUncapitalizedCamelCase("")); assertEquals(" ", SepStringHelper.wordsToUncapitalizedCamelCase(" ")); assertEquals("firstName", SepStringHelper.wordsToUncapitalizedCamelCase("First Name")); assertEquals("abc", SepStringHelper.wordsToUncapitalizedCamelCase("Abc")); assertEquals("dEF", SepStringHelper.wordsToUncapitalizedCamelCase("DEF")); assertEquals("abcDEF", SepStringHelper.wordsToUncapitalizedCamelCase("Abc DEF")); assertEquals("abcDEFGhi", SepStringHelper.wordsToUncapitalizedCamelCase("Abc DEF ghi")); assertEquals("abc200Ghi", SepStringHelper.wordsToUncapitalizedCamelCase("Abc 200 Ghi")); assertEquals("first_Name", SepStringHelper.wordsToUncapitalizedCamelCase("First _ Name")); } }
{ "content_hash": "efeadac40e3f293aa06eefc4de24fa40", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 92, "avg_line_length": 44.61702127659574, "alnum_prop": 0.7992370052455889, "repo_name": "chenjianjx/sep4j", "id": "cfa6a65d9ff274ddbd8ea82db4729957d589bca5", "size": "2097", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/org/sep4j/support/SepStringHelperTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "139423" } ], "symlink_target": "" }
StaffPlan::Application.configure do # Settings specified here will take precedence over those in config/application.rb # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true # Disable Rails's static asset server (Apache or nginx will already do this) config.serve_static_assets = false # Compress JavaScripts and CSS config.assets.compress = false # Set the mailer options needed to send emails config.action_mailer.default_url_options = {host: "www.staffplan.com"} # Fallback to assets pipeline if a precompiled asset is missed config.assets.compile = true # Generate digests for assets URLs config.assets.digest = true # Defaults to Rails.root.join("public/assets") # config.assets.manifest = YOUR_PATH # Specifies the header that your server uses for sending files # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true # See everything in the log (default is :info) # config.log_level = :debug # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Use a different cache store in production # config.cache_store = :mem_cache_store # Enable serving of images, stylesheets, and JavaScripts from an asset server config.action_controller.asset_host = "https://d330tx4v0wmwlf.cloudfront.net" # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # config.assets.precompile += %w( search.js ) # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false # Enable threaded mode # config.threadsafe! # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true # Send deprecation notices to registered listeners config.active_support.deprecation = :notify config.assets.compile = false # Disables security vulnerability end
{ "content_hash": "1182edc356ac3993bd3f7479781596d0", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 104, "avg_line_length": 36.13846153846154, "alnum_prop": 0.7505321413367391, "repo_name": "rescuedcode/StaffPlan", "id": "844f0674306064562866be2bc5c37172b480c659", "size": "2349", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/environments/production.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "28655" }, { "name": "CoffeeScript", "bytes": "108245" }, { "name": "JavaScript", "bytes": "2123" }, { "name": "Ruby", "bytes": "164553" } ], "symlink_target": "" }
package org.usfirst.frc.team2928.commands; import edu.wpi.first.wpilibj.command.Command; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import org.usfirst.frc.team2928.Robot; public class VisionDebug extends Command{ public VisionDebug(){ super(); requires(Robot.visiontracking); } protected void execute(){ SmartDashboard.putBoolean("Right Camera Locked", Robot.visiontracking.getLockedRight()); SmartDashboard.putBoolean("Left Camera Locked", Robot.visiontracking.getLockedLeft()); } @Override protected boolean isFinished() { return false; } }
{ "content_hash": "24ec2479598dbe4a2bf5a075cfc4bae6", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 96, "avg_line_length": 27.52173913043478, "alnum_prop": 0.717219589257504, "repo_name": "FRC-2928/VikingRobot", "id": "d7246516cdd773f4050f78fee927c2b4812b52c4", "size": "633", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/usfirst/frc/team2928/commands/VisionDebug.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "37728" } ], "symlink_target": "" }
<?php $installer = $this; /* @var $installer Mage_Core_Model_Resource_Setup */ $installer->startSetup(); $installer->run(" CREATE TABLE {$this->getTable('core_flag')} ( `flag_id` smallint(5) unsigned NOT NULL auto_increment, `flag_code` varchar(255) NOT NULL, `state` smallint(5) unsigned NOT NULL default '0', `flag_data` text, `last_update` datetime NOT NULL, PRIMARY KEY (`flag_id`), KEY (`last_update`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; "); $installer->endSetup();
{ "content_hash": "b7f8e3fa5d94dcf0715e83b6ad5ab5d5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 57, "avg_line_length": 23.476190476190474, "alnum_prop": 0.6774847870182555, "repo_name": "mikrotikAhmet/mbe-cpdev", "id": "7148b9374c60c8b384b8384488c903706accf054", "size": "1429", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.9-0.8.10.php", "mode": "33261", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "19946" }, { "name": "ApacheConf", "bytes": "1148" }, { "name": "Batchfile", "bytes": "1036" }, { "name": "C", "bytes": "653" }, { "name": "CSS", "bytes": "2469504" }, { "name": "HTML", "bytes": "6706314" }, { "name": "JavaScript", "bytes": "1271689" }, { "name": "PHP", "bytes": "50903014" }, { "name": "Perl", "bytes": "30260" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "288" }, { "name": "Shell", "bytes": "11651" }, { "name": "XSLT", "bytes": "2135" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace IOER.Pages.Developers { public partial class Rubrics { } }
{ "content_hash": "98b4cc289500cb47665089cced787f9a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 25.470588235294116, "alnum_prop": 0.4226327944572748, "repo_name": "siuccwd/IOER", "id": "8d14958886d6104f1ff368d92f7876867cb898c1", "size": "435", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Presentation/IOER.web/Pages/Developers/Rubrics.ascx.designer.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "2463833" }, { "name": "C#", "bytes": "8413370" }, { "name": "CSS", "bytes": "327426" }, { "name": "HTML", "bytes": "67125" }, { "name": "JavaScript", "bytes": "649265" }, { "name": "PowerShell", "bytes": "559490" } ], "symlink_target": "" }
package org.elasticsearch.index.mapper.geo; import org.apache.lucene.spatial.prefix.PrefixTreeStrategy; import org.apache.lucene.spatial.prefix.RecursivePrefixTreeStrategy; import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MergeResult; import org.elasticsearch.test.ElasticsearchSingleNodeTest; import org.junit.Test; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.isIn; public class GeoShapeFieldMapperTests extends ElasticsearchSingleNodeTest { @Test public void testDefaultConfiguration() throws IOException { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(GeoShapeFieldMapper.Defaults.DISTANCE_ERROR_PCT)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoShapeFieldMapper.Defaults.GEOHASH_LEVELS)); assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(GeoShapeFieldMapper.Defaults.ORIENTATION)); } /** * Test that orientation parameter correctly parses * @throws IOException */ public void testOrientationParsing() throws IOException { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("orientation", "left") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); ShapeBuilder.Orientation orientation = ((GeoShapeFieldMapper)fieldMapper).fieldType().orientation(); assertThat(orientation, equalTo(ShapeBuilder.Orientation.CLOCKWISE)); assertThat(orientation, equalTo(ShapeBuilder.Orientation.LEFT)); assertThat(orientation, equalTo(ShapeBuilder.Orientation.CW)); // explicit right orientation test mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("orientation", "right") .endObject().endObject() .endObject().endObject().string(); defaultMapper = createIndex("test2").mapperService().documentMapperParser().parse(mapping); fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); orientation = ((GeoShapeFieldMapper)fieldMapper).fieldType().orientation(); assertThat(orientation, equalTo(ShapeBuilder.Orientation.COUNTER_CLOCKWISE)); assertThat(orientation, equalTo(ShapeBuilder.Orientation.RIGHT)); assertThat(orientation, equalTo(ShapeBuilder.Orientation.CCW)); } @Test public void testGeohashConfiguration() throws IOException { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "geohash") .field("tree_levels", "4") .field("distance_error_pct", "0.1") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.1)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(4)); } @Test public void testQuadtreeConfiguration() throws IOException { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "quadtree") .field("tree_levels", "6") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(QuadPrefixTree.class)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(6)); } @Test public void testLevelPrecisionConfiguration() throws IOException { DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "quadtree") .field("tree_levels", "6") .field("precision", "70m") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(QuadPrefixTree.class)); // 70m is more precise so it wins assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.quadTreeLevelsForPrecision(70d))); } { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "quadtree") .field("tree_levels", "26") .field("precision", "70m") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); // distance_error_pct was not specified so we expect the mapper to take the highest precision between "precision" and // "tree_levels" setting distErrPct to 0 to guarantee desired precision assertThat(strategy.getDistErrPct(), equalTo(0.0)); assertThat(strategy.getGrid(), instanceOf(QuadPrefixTree.class)); // 70m is less precise so it loses assertThat(strategy.getGrid().getMaxLevels(), equalTo(26)); } { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "geohash") .field("tree_levels", "6") .field("precision", "70m") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); // 70m is more precise so it wins assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.geoHashLevelsForPrecision(70d))); } { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "geohash") .field("tree_levels", GeoUtils.geoHashLevelsForPrecision(70d)+1) .field("precision", "70m") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.geoHashLevelsForPrecision(70d)+1)); } { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "quadtree") .field("tree_levels", GeoUtils.quadTreeLevelsForPrecision(70d)+1) .field("precision", "70m") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(QuadPrefixTree.class)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.quadTreeLevelsForPrecision(70d)+1)); } } @Test public void testLevelDefaults() throws IOException { DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "quadtree") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(QuadPrefixTree.class)); /* 50m is default */ assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.quadTreeLevelsForPrecision(50d))); } { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type1") .startObject("properties").startObject("location") .field("type", "geo_shape") .field("tree", "geohash") .field("distance_error_pct", "0.5") .endObject().endObject() .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); FieldMapper fieldMapper = defaultMapper.mappers().getMapper("location"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy.getDistErrPct(), equalTo(0.5)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); /* 50m is default */ assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.geoHashLevelsForPrecision(50d))); } } @Test public void testGeoShapeMapperMerge() throws Exception { String stage1Mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties") .startObject("shape").field("type", "geo_shape").field("tree", "geohash").field("strategy", "recursive") .field("precision", "1m").field("tree_levels", 8).field("distance_error_pct", 0.01).field("orientation", "ccw") .endObject().endObject().endObject().endObject().string(); DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); DocumentMapper stage1 = parser.parse(stage1Mapping); String stage2Mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").startObject("shape").field("type", "geo_shape").field("tree", "quadtree") .field("strategy", "term").field("precision", "1km").field("tree_levels", 26).field("distance_error_pct", 26) .field("orientation", "cw").endObject().endObject().endObject().endObject().string(); DocumentMapper stage2 = parser.parse(stage2Mapping); MergeResult mergeResult = stage1.merge(stage2.mapping(), false); // check correct conflicts assertThat(mergeResult.hasConflicts(), equalTo(true)); assertThat(mergeResult.buildConflicts().length, equalTo(3)); ArrayList conflicts = new ArrayList<>(Arrays.asList(mergeResult.buildConflicts())); assertThat("mapper [shape] has different strategy", isIn(conflicts)); assertThat("mapper [shape] has different tree", isIn(conflicts)); assertThat("mapper [shape] has different tree_levels or precision", isIn(conflicts)); // verify nothing changed FieldMapper fieldMapper = stage1.mappers().getMapper("shape"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; PrefixTreeStrategy strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy, instanceOf(RecursivePrefixTreeStrategy.class)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); assertThat(strategy.getDistErrPct(), equalTo(0.01)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.geoHashLevelsForPrecision(1d))); assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(ShapeBuilder.Orientation.CCW)); // correct mapping stage2Mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").startObject("shape").field("type", "geo_shape").field("precision", "1m") .field("distance_error_pct", 0.001).field("orientation", "cw").endObject().endObject().endObject().endObject().string(); stage2 = parser.parse(stage2Mapping); mergeResult = stage1.merge(stage2.mapping(), false); // verify mapping changes, and ensure no failures assertThat(mergeResult.hasConflicts(), equalTo(false)); fieldMapper = stage1.mappers().getMapper("shape"); assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class)); geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper; strategy = geoShapeFieldMapper.fieldType().defaultStrategy(); assertThat(strategy, instanceOf(RecursivePrefixTreeStrategy.class)); assertThat(strategy.getGrid(), instanceOf(GeohashPrefixTree.class)); assertThat(strategy.getDistErrPct(), equalTo(0.001)); assertThat(strategy.getGrid().getMaxLevels(), equalTo(GeoUtils.geoHashLevelsForPrecision(1d))); assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(ShapeBuilder.Orientation.CW)); } }
{ "content_hash": "30c6884a3c807303eccc1decc3099e6a", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 136, "avg_line_length": 53.50681198910082, "alnum_prop": 0.6485715740693588, "repo_name": "jw0201/elastic", "id": "d31e2a1b01bc1cbee63ad73fd29a04fb1f3bee2d", "size": "20425", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "10152" }, { "name": "Groovy", "bytes": "451" }, { "name": "HTML", "bytes": "1212" }, { "name": "Java", "bytes": "28308414" }, { "name": "Perl", "bytes": "7087" }, { "name": "Python", "bytes": "62679" }, { "name": "Ruby", "bytes": "17776" }, { "name": "Shell", "bytes": "88726" } ], "symlink_target": "" }
{% extends "modal.html" %} {% load i18n %} {% block header %} {% blocktrans with id=order.code %}Reserve all products in order {{ id }}?{% endblocktrans %} {% endblock header %} {% block footer %} <form action="{{ action }}" method="post" accept-charset="utf-8"> {% csrf_token %} <button class="btn btn-primary" type="submit">{% trans "Reserve" %}</button> </form> {% endblock footer %}
{ "content_hash": "10ed6553bb7585164afd367bf43868c4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 97, "avg_line_length": 30.846153846153847, "alnum_prop": 0.6159600997506235, "repo_name": "filipp/Servo", "id": "318a28d12895c6da0fcb714792d77d0e2d1c2e59", "size": "401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "servo/templates/orders/reserve_products.html", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "114750" }, { "name": "HTML", "bytes": "493143" }, { "name": "JavaScript", "bytes": "430810" }, { "name": "Makefile", "bytes": "297" }, { "name": "Python", "bytes": "998166" }, { "name": "Shell", "bytes": "680" } ], "symlink_target": "" }
// Based on Eclipse Paho. /******************************************************************************* * Copyright (c) 2014 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Ian Craggs - initial API and implementation and/or initial documentation * Sergio R. Caprile - non-blocking packet read functions for stream transport *******************************************************************************/ /** * @file aws_iot_mqtt_client_common_internal.c * @brief MQTT client internal API definitions */ #ifdef __cplusplus extern "C" { #endif #include <aws_iot_mqtt_client.h> #include "aws_iot_mqtt_client_common_internal.h" /* Max length of packet header */ #define MAX_NO_OF_REMAINING_LENGTH_BYTES 4 /** * Encodes the message length according to the MQTT algorithm * @param buf the buffer into which the encoded data is written * @param length the length to be encoded * @return the number of bytes written to buffer */ size_t aws_iot_mqtt_internal_write_len_to_buffer(unsigned char *buf, uint32_t length) { size_t outLen = 0; unsigned char encodedByte; FUNC_ENTRY; do { encodedByte = (unsigned char) (length % 128); length /= 128; /* if there are more digits to encode, set the top bit of this digit */ if(length > 0) { encodedByte |= 0x80; } buf[outLen++] = encodedByte; } while(length > 0); FUNC_EXIT_RC(outLen); } /** * Decodes the message length according to the MQTT algorithm * @param the buffer containing the message * @param value the decoded length returned * @return the number of bytes read from the socket */ IoT_Error_t aws_iot_mqtt_internal_decode_remaining_length_from_buffer(unsigned char *buf, uint32_t *decodedLen, uint32_t *readBytesLen) { unsigned char encodedByte; uint32_t multiplier, len; FUNC_ENTRY; multiplier = 1; len = 0; *decodedLen = 0; do { if(++len > MAX_NO_OF_REMAINING_LENGTH_BYTES) { /* bad data */ FUNC_EXIT_RC(MQTT_DECODE_REMAINING_LENGTH_ERROR); } encodedByte = *buf; buf++; *decodedLen += (encodedByte & 127) * multiplier; multiplier *= 128; } while((encodedByte & 128) != 0); *readBytesLen = len; FUNC_EXIT_RC(SUCCESS); } uint32_t aws_iot_mqtt_internal_get_final_packet_length_from_remaining_length(uint32_t rem_len) { rem_len += 1; /* header byte */ /* now remaining_length field (MQTT 3.1.1 - 2.2.3)*/ if(rem_len < 128) { rem_len += 1; } else if(rem_len < 16384) { rem_len += 2; } else if(rem_len < 2097152) { rem_len += 3; } else { rem_len += 4; } return rem_len; } /** * Calculates uint16 packet id from two bytes read from the input buffer * Checks Endianness at runtime * * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned * @return the value calculated */ uint16_t aws_iot_mqtt_internal_read_uint16_t(unsigned char **pptr) { unsigned char *ptr = *pptr; uint16_t len = 0; uint8_t firstByte = (uint8_t) (*ptr); uint8_t secondByte = (uint8_t) (*(ptr + 1)); len = (uint16_t) (secondByte + (256 * firstByte)); *pptr += 2; return len; } /** * Writes an integer as 2 bytes to an output buffer. * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned * @param anInt the integer to write */ void aws_iot_mqtt_internal_write_uint_16(unsigned char **pptr, uint16_t anInt) { **pptr = (unsigned char) (anInt / 256); (*pptr)++; **pptr = (unsigned char) (anInt % 256); (*pptr)++; } /** * Reads one character from the input buffer. * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned * @return the character read */ unsigned char aws_iot_mqtt_internal_read_char(unsigned char **pptr) { unsigned char c = **pptr; (*pptr)++; return c; } /** * Writes one character to an output buffer. * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned * @param c the character to write */ void aws_iot_mqtt_internal_write_char(unsigned char **pptr, unsigned char c) { **pptr = c; (*pptr)++; } void aws_iot_mqtt_internal_write_utf8_string(unsigned char **pptr, const char *string, uint16_t stringLen) { /* Nothing that calls this function will have a stringLen with a size larger than 2 bytes (MQTT 3.1.1 - 1.5.3) */ aws_iot_mqtt_internal_write_uint_16(pptr, stringLen); if(stringLen > 0) { memcpy(*pptr, string, stringLen); *pptr += stringLen; } } /** * Initialize the MQTTHeader structure. Used to ensure that Header bits are * always initialized using the proper mappings. No Endianness issues here since * the individual fields are all less than a byte. Also generates no warnings since * all fields are initialized using hex constants */ IoT_Error_t aws_iot_mqtt_internal_init_header(MQTTHeader *pHeader, MessageTypes message_type, QoS qos, uint8_t dup, uint8_t retained) { FUNC_ENTRY; if(NULL == pHeader) { FUNC_EXIT_RC(NULL_VALUE_ERROR); } /* Set all bits to zero */ pHeader->byte = 0; uint8_t type = 0; switch(message_type) { case UNKNOWN: /* Should never happen */ return FAILURE; case CONNECT: type = 0x01; break; case CONNACK: type = 0x02; break; case PUBLISH: type = 0x03; break; case PUBACK: type = 0x04; break; case PUBREC: type = 0x05; break; case PUBREL: type = 0x06; break; case PUBCOMP: type = 0x07; break; case SUBSCRIBE: type = 0x08; break; case SUBACK: type = 0x09; break; case UNSUBSCRIBE: type = 0x0A; break; case UNSUBACK: type = 0x0B; break; case PINGREQ: type = 0x0C; break; case PINGRESP: type = 0x0D; break; case DISCONNECT: type = 0x0E; break; default: /* Should never happen */ FUNC_EXIT_RC(FAILURE); } pHeader->byte = type << 4; pHeader->byte |= dup << 3; switch(qos) { case QOS0: break; case QOS1: pHeader->byte |= 1 << 1; break; default: /* Using QOS0 as default */ break; } pHeader->byte |= (1 == retained) ? 0x01 : 0x00; FUNC_EXIT_RC(SUCCESS); } IoT_Error_t aws_iot_mqtt_internal_send_packet(AWS_IoT_Client *pClient, size_t length, Timer *pTimer) { size_t sentLen, sent; IoT_Error_t rc; FUNC_ENTRY; if(NULL == pClient || NULL == pTimer) { FUNC_EXIT_RC(NULL_VALUE_ERROR); } if(length >= pClient->clientData.writeBufSize) { FUNC_EXIT_RC(MQTT_TX_BUFFER_TOO_SHORT_ERROR); } #ifdef _ENABLE_THREAD_SUPPORT_ rc = aws_iot_mqtt_client_lock_mutex(pClient, &(pClient->clientData.tls_write_mutex)); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } #endif sentLen = 0; sent = 0; while(sent < length && !has_timer_expired(pTimer)) { rc = pClient->networkStack.write(&(pClient->networkStack), &pClient->clientData.writeBuf[sent], (length - sent), pTimer, &sentLen); if(SUCCESS != rc) { /* there was an error writing the data */ break; } sent += sentLen; } #ifdef _ENABLE_THREAD_SUPPORT_ rc = aws_iot_mqtt_client_unlock_mutex(pClient, &(pClient->clientData.tls_write_mutex)); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } #endif if(sent == length) { /* record the fact that we have successfully sent the packet */ //countdown_sec(&c->pingTimer, c->clientData.keepAliveInterval); FUNC_EXIT_RC(SUCCESS); } FUNC_EXIT_RC(rc); } static IoT_Error_t _aws_iot_mqtt_internal_readWrapper( AWS_IoT_Client *pClient, size_t offset, size_t size, Timer *pTimer, size_t * read_len ) { IoT_Error_t rc; int byteToRead; size_t byteRead = 0; byteToRead = ( offset + size ) - pClient->clientData.readBufIndex; if ( byteToRead > 0 ) { rc = pClient->networkStack.read( &( pClient->networkStack ), pClient->clientData.readBuf + pClient->clientData.readBufIndex, (size_t)byteToRead, pTimer, &byteRead ); pClient->clientData.readBufIndex += byteRead; /* refresh byte to read */ byteToRead = ( offset + size ) - ((int)pClient->clientData.readBufIndex); *read_len = size - (size_t)byteToRead; } else { *read_len = size; rc = SUCCESS; } return rc; } static IoT_Error_t _aws_iot_mqtt_internal_decode_packet_remaining_len(AWS_IoT_Client *pClient, size_t * offset, size_t *rem_len, Timer *pTimer) { size_t multiplier, len; IoT_Error_t rc; size_t read_len; FUNC_ENTRY; multiplier = 1; len = 0; *rem_len = 0; do { if(++len > MAX_NO_OF_REMAINING_LENGTH_BYTES) { /* bad data */ FUNC_EXIT_RC(MQTT_DECODE_REMAINING_LENGTH_ERROR); } rc = _aws_iot_mqtt_internal_readWrapper( pClient, len, 1, pTimer, &read_len ); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } *rem_len += (( pClient->clientData.readBuf[len] & 127) * multiplier); multiplier *= 128; } while(( pClient->clientData.readBuf[len] & 128) != 0); *offset = len + 1; FUNC_EXIT_RC(rc); } static IoT_Error_t _aws_iot_mqtt_internal_read_packet(AWS_IoT_Client *pClient, Timer *pTimer, uint8_t *pPacketType) { size_t rem_len, total_bytes_read, bytes_to_be_read, read_len; IoT_Error_t rc; size_t offset = 0; MQTTHeader header = {0}; Timer packetTimer; init_timer(&packetTimer); countdown_ms(&packetTimer, pClient->clientData.packetTimeoutMs); rem_len = 0; total_bytes_read = 0; bytes_to_be_read = 0; read_len = 0; rc = _aws_iot_mqtt_internal_readWrapper( pClient, offset, 1, pTimer, &read_len ); /* 1. read the header byte. This has the packet type in it */ if(NETWORK_SSL_NOTHING_TO_READ == rc) { return MQTT_NOTHING_TO_READ; } else if(SUCCESS != rc) { return rc; } /* 2. read the remaining length. This is variable in itself */ rc = _aws_iot_mqtt_internal_decode_packet_remaining_len(pClient, &offset, &rem_len, pTimer); if(SUCCESS != rc) { return rc; } /* if the buffer is too short then the message will be dropped silently */ if((rem_len + offset) >= pClient->clientData.readBufSize) { bytes_to_be_read = pClient->clientData.readBufSize; do { rc = pClient->networkStack.read(&(pClient->networkStack), pClient->clientData.readBuf, bytes_to_be_read, pTimer, &read_len); if(SUCCESS == rc) { total_bytes_read += read_len; if((rem_len - total_bytes_read) >= pClient->clientData.readBufSize) { bytes_to_be_read = pClient->clientData.readBufSize; } else { bytes_to_be_read = rem_len - total_bytes_read; } } } while(total_bytes_read < rem_len && SUCCESS == rc); /* Check buffer was correctly emptied, otherwise, return error message. */ if ( total_bytes_read == rem_len ) { aws_iot_mqtt_internal_flushBuffers( pClient ); return MQTT_RX_BUFFER_TOO_SHORT_ERROR; } else { return rc; } } /* 3. read the rest of the buffer using a callback to supply the rest of the data */ if(rem_len > 0) { rc = _aws_iot_mqtt_internal_readWrapper( pClient, offset, rem_len, pTimer, &read_len ); if(SUCCESS != rc || read_len != rem_len) { return FAILURE; } } /* Pack has been received, we can flush the buffers for next call. */ aws_iot_mqtt_internal_flushBuffers( pClient ); header.byte = pClient->clientData.readBuf[0]; *pPacketType = MQTT_HEADER_FIELD_TYPE(header.byte); FUNC_EXIT_RC(rc); } // assume topic filter and name is in correct format // # can only be at end // + and # can only be next to separator static bool _aws_iot_mqtt_internal_is_topic_matched(char *pTopicFilter, char *pTopicName, uint16_t topicNameLen) { char *curf, *curn, *curn_end; if(NULL == pTopicFilter || NULL == pTopicName) { return false; } curf = pTopicFilter; curn = pTopicName; curn_end = curn + topicNameLen; while(*curf && (curn < curn_end)) { if(*curn == '/' && *curf != '/') { break; } if(*curf != '+' && *curf != '#' && *curf != *curn) { break; } if(*curf == '+') { /* skip until we meet the next separator, or end of string */ char *nextpos = curn + 1; while(nextpos < curn_end && *nextpos != '/') nextpos = ++curn + 1; } else if(*curf == '#') { /* skip until end of string */ curn = curn_end - 1; } curf++; curn++; }; return (curn == curn_end) && (*curf == '\0'); } static IoT_Error_t _aws_iot_mqtt_internal_deliver_message(AWS_IoT_Client *pClient, char *pTopicName, uint16_t topicNameLen, IoT_Publish_Message_Params *pMessageParams) { uint32_t itr; IoT_Error_t rc; ClientState clientState; FUNC_ENTRY; if(NULL == pTopicName) { FUNC_EXIT_RC(NULL_VALUE_ERROR); } /* This function can be called from all MQTT APIs * But while callback return is in progress, Yield should not be called. * The state for CB_RETURN accomplishes that, as yield cannot be called while in that state */ clientState = aws_iot_mqtt_get_client_state(pClient); aws_iot_mqtt_set_client_state(pClient, clientState, CLIENT_STATE_CONNECTED_WAIT_FOR_CB_RETURN); /* Find the right message handler - indexed by topic */ for(itr = 0; itr < AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS; ++itr) { if(NULL != pClient->clientData.messageHandlers[itr].topicName) { if(((topicNameLen == pClient->clientData.messageHandlers[itr].topicNameLen) && (strncmp(pTopicName, (char *) pClient->clientData.messageHandlers[itr].topicName, topicNameLen) == 0)) || _aws_iot_mqtt_internal_is_topic_matched((char *) pClient->clientData.messageHandlers[itr].topicName, pTopicName, topicNameLen)) { if(NULL != pClient->clientData.messageHandlers[itr].pApplicationHandler) { pClient->clientData.messageHandlers[itr].pApplicationHandler(pClient, pTopicName, topicNameLen, pMessageParams, pClient->clientData.messageHandlers[itr].pApplicationHandlerData); } } } } rc = aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTED_WAIT_FOR_CB_RETURN, clientState); FUNC_EXIT_RC(rc); } static IoT_Error_t _aws_iot_mqtt_internal_handle_publish(AWS_IoT_Client *pClient, Timer *pTimer) { char *topicName; uint16_t topicNameLen; uint32_t len; IoT_Error_t rc; IoT_Publish_Message_Params msg; FUNC_ENTRY; topicName = NULL; topicNameLen = 0; len = 0; rc = aws_iot_mqtt_internal_deserialize_publish(&msg.isDup, &msg.qos, &msg.isRetained, &msg.id, &topicName, &topicNameLen, (unsigned char **) &msg.payload, &msg.payloadLen, pClient->clientData.readBuf, pClient->clientData.readBufSize); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } rc = _aws_iot_mqtt_internal_deliver_message(pClient, topicName, topicNameLen, &msg); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } if(QOS0 == msg.qos) { /* No further processing required for QoS0 */ FUNC_EXIT_RC(SUCCESS); } /* Message assumed to be QoS1 since we do not support QoS2 at this time */ rc = aws_iot_mqtt_internal_serialize_ack(pClient->clientData.writeBuf, pClient->clientData.writeBufSize, PUBACK, 0, msg.id, &len); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } rc = aws_iot_mqtt_internal_send_packet(pClient, len, pTimer); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } FUNC_EXIT_RC(SUCCESS); } IoT_Error_t aws_iot_mqtt_internal_cycle_read(AWS_IoT_Client *pClient, Timer *pTimer, uint8_t *pPacketType) { IoT_Error_t rc; #ifdef _ENABLE_THREAD_SUPPORT_ IoT_Error_t threadRc; #endif if(NULL == pClient || NULL == pTimer) { return NULL_VALUE_ERROR; } #ifdef _ENABLE_THREAD_SUPPORT_ threadRc = aws_iot_mqtt_client_lock_mutex(pClient, &(pClient->clientData.tls_read_mutex)); if(SUCCESS != threadRc) { FUNC_EXIT_RC(threadRc); } #endif /* read the socket, see what work is due */ rc = _aws_iot_mqtt_internal_read_packet(pClient, pTimer, pPacketType); #ifdef _ENABLE_THREAD_SUPPORT_ threadRc = aws_iot_mqtt_client_unlock_mutex(pClient, &(pClient->clientData.tls_read_mutex)); if(SUCCESS != threadRc && (MQTT_NOTHING_TO_READ == rc || SUCCESS == rc)) { return threadRc; } #endif if(MQTT_NOTHING_TO_READ == rc) { /* Nothing to read, not a cycle failure */ return SUCCESS; } else if(SUCCESS != rc) { return rc; } switch(*pPacketType) { case CONNACK: case PUBACK: case SUBACK: case UNSUBACK: /* SDK is blocking, these responses will be forwarded to calling function to process */ break; case PUBLISH: { rc = _aws_iot_mqtt_internal_handle_publish(pClient, pTimer); break; } case PUBREC: case PUBCOMP: /* QoS2 not supported at this time */ break; case PINGRESP: { pClient->clientStatus.isPingOutstanding = 0; countdown_sec(&pClient->pingTimer, pClient->clientData.keepAliveInterval); break; } default: { /* Either unknown packet type or Failure occurred * Should not happen */ rc = MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR; break; } } return rc; } IoT_Error_t aws_iot_mqtt_internal_flushBuffers( AWS_IoT_Client *pClient ) { pClient->clientData.readBufIndex = 0; return SUCCESS; } /* only used in single-threaded mode where one command at a time is in process */ IoT_Error_t aws_iot_mqtt_internal_wait_for_read(AWS_IoT_Client *pClient, uint8_t packetType, Timer *pTimer) { IoT_Error_t rc; uint8_t read_packet_type; FUNC_ENTRY; if(NULL == pClient || NULL == pTimer) { FUNC_EXIT_RC(NULL_VALUE_ERROR); } read_packet_type = 0; do { if(has_timer_expired(pTimer)) { /* we timed out */ rc = MQTT_REQUEST_TIMEOUT_ERROR; break; } rc = aws_iot_mqtt_internal_cycle_read(pClient, pTimer, &read_packet_type); } while(((SUCCESS == rc) || (MQTT_NOTHING_TO_READ == rc)) && (read_packet_type != packetType)); /* If rc is SUCCESS, we have received the expected * MQTT packet. Otherwise rc tells the error. */ FUNC_EXIT_RC(rc); } /** * Serializes a 0-length packet into the supplied buffer, ready for writing to a socket * @param buf the buffer into which the packet will be serialized * @param buflen the length in bytes of the supplied buffer, to avoid overruns * @param packettype the message type * @param serialized length * @return IoT_Error_t indicating function execution status */ IoT_Error_t aws_iot_mqtt_internal_serialize_zero(unsigned char *pTxBuf, size_t txBufLen, MessageTypes packetType, size_t *pSerializedLength) { unsigned char *ptr; IoT_Error_t rc; MQTTHeader header = {0}; FUNC_ENTRY; if(NULL == pTxBuf || NULL == pSerializedLength) { FUNC_EXIT_RC(NULL_VALUE_ERROR); } /* Buffer should have at least 2 bytes for the header */ if(4 > txBufLen) { FUNC_EXIT_RC(MQTT_TX_BUFFER_TOO_SHORT_ERROR); } ptr = pTxBuf; rc = aws_iot_mqtt_internal_init_header(&header, packetType, QOS0, 0, 0); if(SUCCESS != rc) { FUNC_EXIT_RC(rc); } /* write header */ aws_iot_mqtt_internal_write_char(&ptr, header.byte); /* write remaining length */ ptr += aws_iot_mqtt_internal_write_len_to_buffer(ptr, 0); *pSerializedLength = (uint32_t) (ptr - pTxBuf); FUNC_EXIT_RC(SUCCESS); } #ifdef __cplusplus } #endif
{ "content_hash": "28f79ff7b36a8928fdfe68902c3b34fa", "timestamp": "", "source": "github", "line_count": 707, "max_line_length": 144, "avg_line_length": 27.342291371994342, "alnum_prop": 0.654027210180539, "repo_name": "bouffalolab/bl_iot_sdk_matter", "id": "6251dcfcd27bb819b26ca3bf448bf47d74017d94", "size": "19901", "binary": false, "copies": "1", "ref": "refs/heads/release_spiwifi_bl602", "path": "components/3rdparty/aws-iot/aws-iot-device-sdk-embedded-C/src/aws_iot_mqtt_client_common_internal.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "46671" }, { "name": "Batchfile", "bytes": "1603" }, { "name": "C", "bytes": "24837905" }, { "name": "C++", "bytes": "14471862" }, { "name": "CMake", "bytes": "124252" }, { "name": "HTML", "bytes": "24826" }, { "name": "Makefile", "bytes": "114632" }, { "name": "Perl", "bytes": "2589" }, { "name": "Python", "bytes": "273291" }, { "name": "Roff", "bytes": "3255873" }, { "name": "Shell", "bytes": "27722" }, { "name": "XC", "bytes": "18410" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Thu Aug 20 14:30:52 BST 2015 --> <TITLE> Uses of Class org.openntf.osgiworlds.model.GenericDatabaseUtils </TITLE> <META NAME="date" CONTENT="2015-08-20"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../OpenNTFDominostylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.openntf.osgiworlds.model.GenericDatabaseUtils"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/openntf/osgiworlds/model/GenericDatabaseUtils.html" title="class in org.openntf.osgiworlds.model"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/openntf/osgiworlds/model/\class-useGenericDatabaseUtils.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="GenericDatabaseUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.openntf.osgiworlds.model.GenericDatabaseUtils</B></H2> </CENTER> No usage of org.openntf.osgiworlds.model.GenericDatabaseUtils <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/openntf/osgiworlds/model/GenericDatabaseUtils.html" title="class in org.openntf.osgiworlds.model"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/openntf/osgiworlds/model/\class-useGenericDatabaseUtils.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="GenericDatabaseUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "content_hash": "c673ab78d98dbdc9d0b299830a63f599", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 234, "avg_line_length": 42.99305555555556, "alnum_prop": 0.6083023744144727, "repo_name": "paulswithers/Key-Dates", "id": "e7b682506095e72d7b0cd311edb5a3e20e7b3a4b", "size": "6191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "documentation/osgiworlds/org/openntf/osgiworlds/model/class-use/GenericDatabaseUtils.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "18390" }, { "name": "Java", "bytes": "433352" }, { "name": "XPages", "bytes": "5162" } ], "symlink_target": "" }
<resources> <string name="app_name">ModernArtUI</string> <string name="hello_world">Hello world!</string> <string name="action_settings">Settings</string> <string name="menu_item_text">More Information</string> <string name="button_text_not_now">Not Now</string> <string name="button_text_view_moma">View MOMA</string> <string name="dialog_text">Inspired by the works of artists such as Piet Mondrian and Ben Nicholson.\n\nClick Below to learn more!</string> </resources>
{ "content_hash": "10be305e2841e2f4089e990103712ee0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 93, "avg_line_length": 39.30769230769231, "alnum_prop": 0.700587084148728, "repo_name": "jamescfli/GitRepository", "id": "105e4d977ae61dcea4ebfc1fac82949df4b8c966", "size": "511", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "coursera-android-labs-master/ModernArtUI2/app/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "1184" }, { "name": "HTML", "bytes": "65" }, { "name": "Java", "bytes": "3840365" } ], "symlink_target": "" }
package au.id.aj.efbp.schedule; import java.util.TimerTask; import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import au.id.aj.efbp.node.Node; /** * Exposes the ability to periodically schedule Nodes for execution. Scheduling * of nodes is primarily useful for {@see Producer} instances which may need to * pull data from an external source periodically. */ public interface Scheduler { /** * Schedules a Node for periodic scheduling on the execution queue. * * @param node * The node to schedule for execution. * * @param delay * The amount of time to pass before the first scheduling. * * @param period * The amount of time between schedulings of node's execution. * * @return The generated timer task, allowing the caller to cancel if * necessary. */ TimerTask schedule(final Node node, final long delay, final long period, final TimeUnit unit); /** * Immediately schedule node for execution. This is useful for callbacks * where data is made available from external services such as ActiveMQ, * allowing the node to be scheduled in a consistent manner rather than * forcing the calling thread to do processing work. * * @param node * The Node instance to schedule for execution. */ void schedule(final Node node); /** * Starts a thread dedicated to performing the provided task. */ void scheduleIo(final Runnable runnable); /** * Starts a thread dedicated to performing the provided task. The provided * task is scheduled for execution with no relation to other IO jobs. */ <T> Future<T> scheduleIo(final Callable<T> callable); LinearIoContext newLinearIoContext(final Object io); TreeIoContext newTreeIoContext(final Object io); void shutdown(); void awaitTermination() throws InterruptedException; }
{ "content_hash": "04c7c154140cd38e753bab98a39fb20e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 79, "avg_line_length": 31.765625, "alnum_prop": 0.675356615838662, "repo_name": "amboar/efbp", "id": "28b78d1187fe77d50c49308086c626e836d1c18a", "size": "2627", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/au/id/aj/efbp/schedule/Scheduler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "219706" } ], "symlink_target": "" }
Just some ideas for game
{ "content_hash": "fe5a9688b307e0e77b72d10f24a39109", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.8, "repo_name": "hasharahha/Cityscapegame", "id": "4436af67717f81272025e9d7e3148d45b6ea42fa", "size": "41", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /** * Created by PhpStorm. * User: Vishva * Date: 11/18/2016 * Time: 2:40 PM */?> <div class="jumbotron suggestbox" style="background-image: url('<?php echo base_url("media/home/suggestions1.jpg"); ?>')"> <div class="container"> <h2>Give us your Suggestions.</h2> <p>Let's add and build our own playlists.</p> <a href="#">Learn More</a> </div> </div>
{ "content_hash": "8e1c5e0de235cd0579b7165f8ed50413", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 122, "avg_line_length": 20, "alnum_prop": 0.585, "repo_name": "v1shva/MPlay", "id": "e813d2d5642bb78a8667ffeb62635e266bb9ba04", "size": "400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/pages/suggestions.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "194464" }, { "name": "ApacheConf", "bytes": "240" }, { "name": "Batchfile", "bytes": "1014" }, { "name": "CSS", "bytes": "1471856" }, { "name": "CoffeeScript", "bytes": "20838" }, { "name": "HTML", "bytes": "11103706" }, { "name": "JavaScript", "bytes": "6697602" }, { "name": "PHP", "bytes": "3326650" } ], "symlink_target": "" }
describe 'Conversation' do it 'sends a message' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:post, 'send', { from: 'MBTest', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) .and_return('{}') client.send_conversation_message('MBTest', 31_612_345_678, type: 'text', content: { text: 'Hi there!' }) end it 'starts a conversation' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:post, 'conversations/start', { channel_id: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) .and_return('{}') client.start_conversation(31_612_345_678, 'c0dae31e440145e094c4708b7d000000', type: 'text', content: { text: 'Hi there!' }) end it 'lists' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'conversations?limit=2&offset=0', {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_list(2, 0) expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'list without args' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'conversations?', {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_list expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'list messages' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) conversation_id = '5f3437fdb8444583aea093a047ac014b' expect(conversation_client) .to receive(:request) .with(:get, "conversations/#{conversation_id}/messages?limit=2&offset=0", {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_messages_list(conversation_id, 2, 0) expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'list messages without args' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) conversation_id = '5f3437fdb8444583aea093a047ac014b' expect(conversation_client) .to receive(:request) .with(:get, "conversations/#{conversation_id}/messages?", {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_messages_list(conversation_id) expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'reads an existing' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'conversations/conversation-id', {}) .and_return('{"id": "conversation-id","href": "https://conversations.messagebird.com/v1/conversations/conversation-id"}') conversation = client.conversation('conversation-id') expect(conversation.id).to eq 'conversation-id' end it 'updates a conversation' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:patch, 'conversations/conversation-id', { status: MessageBird::Conversation::CONVERSATION_STATUS_ARCHIVED }) .and_return('{"id":"conversation-id", "contactId": "contact-id"}') conversation = client.conversation_update('conversation-id', MessageBird::Conversation::CONVERSATION_STATUS_ARCHIVED) expect(conversation.id).to eq 'conversation-id' expect(conversation.contact_id).to eq 'contact-id' end it 'replies to a conversation' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:post, 'conversations/conversation-id/messages', { type: 'text', content: { text: 'Hi there' } }) .and_return({ id: 'message-id', channel_id: 'channel-id', conversationId: 'conversation-id' }.to_json) msg = client.conversation_reply('conversation-id', type: 'text', content: { text: 'Hi there' }) expect(msg.id).to eq 'message-id' expect(msg.channel_id).to eq 'channel-id' expect(msg.conversation_id).to eq 'conversation-id' end it 'reads messages in a conversation' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'conversations/conversation-id/messages?limit=2&offset=0', {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_messages_list('conversation-id', 2, 0) expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'reads a message' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'messages/message-id', {}) .and_return('{"id":"00000000000000000000000000000000"}') msg = client.conversation_message('message-id') expect(msg.id).to eq '00000000000000000000000000000000' end it 'creates a webhook' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:post, 'webhooks', { channel_id: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' }) .and_return('{"id":"00000000000000000000000000000000", "events": ["message.created", "message.updated"]}') webhook = client.conversation_webhook_create('channel-id', 'url', [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED]) expect(webhook.id).to eq '00000000000000000000000000000000' expect(webhook.events.count).to eq 2 end it 'reads a list of webhooks' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'webhooks?limit=10&offset=0', {}) .and_return('{"offset":0,"limit":10,"count":2,"totalCount":2,"items":[{"id":"00000000000000000000000000000000"},{"id":"11111111111111111111111111111111"}]}') list = client.conversation_webhooks_list(10, 0) expect(list.count).to eq 2 expect(list[0].id).to eq '00000000000000000000000000000000' end it 'reads a webhook' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:get, 'webhooks/webhook-id', {}) .and_return('{"id":"00000000000000000000000000000000"}') webhook = client.conversation_webhook('webhook-id') expect(webhook.id).to eq '00000000000000000000000000000000' end it 'updates a webhook' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:patch, 'webhooks/webhook-id', { events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED], url: 'url' }) .and_return('{"id":"00000000000000000000000000000000", "events": ["message.created"]}') webhook = client.conversation_webhook_update('webhook-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED], url: 'url') expect(webhook.id).to eq '00000000000000000000000000000000' expect(webhook.events.count).to eq 1 end it 'deletes a webhook' do conversation_client = double(MessageBird::ConversationClient) client = MessageBird::Client.new('', nil, conversation_client) expect(conversation_client) .to receive(:request) .with(:delete, 'webhooks/webhook-id', {}) .and_return('') client.conversation_webhook_delete('webhook-id') end end
{ "content_hash": "b3348638c70b98772682d1dc12c9db6f", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 198, "avg_line_length": 40.81115879828326, "alnum_prop": 0.6981806709433168, "repo_name": "messagebird/ruby-rest-api", "id": "463c069e677aa9902104e9d80f9fa233a6f820cc", "size": "9540", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/conversation_spec.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ruby", "bytes": "112599" } ], "symlink_target": "" }
class CreateNewsletters < ActiveRecord::Migration def change create_table :newsletters do |t| t.datetime :date, null: false t.attachment :file, null: false t.timestamps end end end
{ "content_hash": "a07376504f5d077d4cd3b13ba7e3df30", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 49, "avg_line_length": 23.666666666666668, "alnum_prop": 0.6713615023474179, "repo_name": "AbbyJonesDev/PreschoolOnRails", "id": "5ee690f5da745c12fa837976a60234f38fd24ead", "size": "213", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20141008205143_create_newsletters.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "52755" }, { "name": "HTML", "bytes": "83086" }, { "name": "JavaScript", "bytes": "3876" }, { "name": "Ruby", "bytes": "133143" }, { "name": "Shell", "bytes": "3039" } ], "symlink_target": "" }
use std::{ collections::hash_map::Entry, sync::{ atomic::{AtomicUsize, Ordering}, Arc, }, }; use collections::HashMap; use crossbeam::atomic::AtomicCell; use futures::{ future::{self, TryFutureExt}, sink::SinkExt, stream::TryStreamExt, }; use grpcio::{DuplexSink, Error as GrpcError, RequestStream, RpcContext, RpcStatus, RpcStatusCode}; use kvproto::{ cdcpb::{ ChangeData, ChangeDataEvent, ChangeDataRequest, ChangeDataRequestKvApi, Compatibility, }, kvrpcpb::ApiVersion, }; use tikv_util::{error, info, warn, worker::*}; use crate::{ channel::{channel, MemoryQuota, Sink, CDC_CHANNLE_CAPACITY}, delegate::{Downstream, DownstreamID, DownstreamState}, endpoint::{Deregister, Task}, }; static CONNECTION_ID_ALLOC: AtomicUsize = AtomicUsize::new(0); /// A unique identifier of a Connection. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub struct ConnID(usize); impl ConnID { pub fn new() -> ConnID { ConnID(CONNECTION_ID_ALLOC.fetch_add(1, Ordering::SeqCst)) } } impl Default for ConnID { fn default() -> Self { Self::new() } } bitflags::bitflags! { pub struct FeatureGate: u8 { const BATCH_RESOLVED_TS = 0b00000001; // Uncomment when its ready. // const LargeTxn = 0b00000010; } } impl FeatureGate { // Returns the first version (v4.0.8) that supports batch resolved ts. pub fn batch_resolved_ts() -> semver::Version { semver::Version::new(4, 0, 8) } // Returns the first version (v5.3.0) that supports validate cluster id. pub(crate) fn validate_cluster_id() -> semver::Version { semver::Version::new(5, 3, 0) } pub(crate) fn validate_kv_api(kv_api: ChangeDataRequestKvApi, api_version: ApiVersion) -> bool { kv_api == ChangeDataRequestKvApi::TiDb || (kv_api == ChangeDataRequestKvApi::RawKv && api_version == ApiVersion::V2) } } pub struct Conn { id: ConnID, sink: Sink, // region id -> DownstreamID downstreams: HashMap<u64, (DownstreamID, Arc<AtomicCell<DownstreamState>>)>, peer: String, version: Option<(semver::Version, FeatureGate)>, } impl Conn { pub fn new(sink: Sink, peer: String) -> Conn { Conn { id: ConnID::new(), sink, downstreams: HashMap::default(), version: None, peer, } } // TODO refactor into Error::Version. pub fn check_version_and_set_feature(&mut self, ver: semver::Version) -> Option<Compatibility> { match &self.version { Some((version, _)) => { if version == &ver { None } else { error!("cdc different version on the same connection"; "previous version" => ?version, "version" => ?ver, "downstream" => ?self.peer, "conn_id" => ?self.id); Some(Compatibility { required_version: version.to_string(), ..Default::default() }) } } None => { let mut features = FeatureGate::empty(); if FeatureGate::batch_resolved_ts() <= ver { features.toggle(FeatureGate::BATCH_RESOLVED_TS); } info!("cdc connection version"; "version" => ver.to_string(), "features" => ?features, "downstream" => ?self.peer); self.version = Some((ver, features)); None } } // Return Err(Compatibility) when TiKV reaches the next major release, // so that we can remove feature gates. } pub fn get_feature(&self) -> Option<&FeatureGate> { self.version.as_ref().map(|(_, f)| f) } pub fn get_peer(&self) -> &str { &self.peer } pub fn get_id(&self) -> ConnID { self.id } pub fn get_downstreams( &self, ) -> &HashMap<u64, (DownstreamID, Arc<AtomicCell<DownstreamState>>)> { &self.downstreams } pub fn take_downstreams( self, ) -> HashMap<u64, (DownstreamID, Arc<AtomicCell<DownstreamState>>)> { self.downstreams } pub fn get_sink(&self) -> &Sink { &self.sink } pub fn subscribe( &mut self, region_id: u64, downstream_id: DownstreamID, downstream_state: Arc<AtomicCell<DownstreamState>>, ) -> bool { match self.downstreams.entry(region_id) { Entry::Occupied(_) => false, Entry::Vacant(v) => { v.insert((downstream_id, downstream_state)); true } } } pub fn unsubscribe(&mut self, region_id: u64) { self.downstreams.remove(&region_id); } pub fn downstream_id(&self, region_id: u64) -> Option<DownstreamID> { self.downstreams.get(&region_id).map(|x| x.0) } } /// Service implements the `ChangeData` service. /// /// It's a front-end of the CDC service, schedules requests to the `Endpoint`. #[derive(Clone)] pub struct Service { scheduler: Scheduler<Task>, memory_quota: MemoryQuota, } impl Service { /// Create a ChangeData service. /// /// It requires a scheduler of an `Endpoint` in order to schedule tasks. pub fn new(scheduler: Scheduler<Task>, memory_quota: MemoryQuota) -> Service { Service { scheduler, memory_quota, } } } impl ChangeData for Service { fn event_feed( &mut self, ctx: RpcContext<'_>, stream: RequestStream<ChangeDataRequest>, mut sink: DuplexSink<ChangeDataEvent>, ) { let (event_sink, mut event_drain) = channel(CDC_CHANNLE_CAPACITY, self.memory_quota.clone()); let peer = ctx.peer(); let conn = Conn::new(event_sink, peer); let conn_id = conn.get_id(); if let Err(status) = self .scheduler .schedule(Task::OpenConn { conn }) .map_err(|e| { RpcStatus::with_message(RpcStatusCode::INVALID_ARGUMENT, format!("{:?}", e)) }) { error!("cdc connection initiate failed"; "error" => ?status); ctx.spawn( sink.fail(status) .unwrap_or_else(|e| error!("cdc failed to send error"; "error" => ?e)), ); return; } let peer = ctx.peer(); let scheduler = self.scheduler.clone(); let recv_req = stream.try_for_each(move |request| { let region_epoch = request.get_region_epoch().clone(); let req_id = request.get_request_id(); let req_kvapi = request.get_kv_api(); let version = match semver::Version::parse(request.get_header().get_ticdc_version()) { Ok(v) => v, Err(e) => { warn!("empty or invalid TiCDC version, please upgrading TiCDC"; "version" => request.get_header().get_ticdc_version(), "error" => ?e); semver::Version::new(0, 0, 0) } }; let downstream = Downstream::new(peer.clone(), region_epoch, req_id, conn_id, req_kvapi); let ret = scheduler .schedule(Task::Register { request, downstream, conn_id, version, }) .map_err(|e| { GrpcError::RpcFailure(RpcStatus::with_message( RpcStatusCode::INVALID_ARGUMENT, format!("{:?}", e), )) }); future::ready(ret) }); let peer = ctx.peer(); let scheduler = self.scheduler.clone(); ctx.spawn(async move { let res = recv_req.await; // Unregister this downstream only. let deregister = Deregister::Conn(conn_id); if let Err(e) = scheduler.schedule(Task::Deregister(deregister)) { error!("cdc deregister failed"; "error" => ?e, "conn_id" => ?conn_id); } match res { Ok(()) => { info!("cdc receive closed"; "downstream" => peer, "conn_id" => ?conn_id); } Err(e) => { warn!("cdc receive failed"; "error" => ?e, "downstream" => peer, "conn_id" => ?conn_id); } } }); let peer = ctx.peer(); let scheduler = self.scheduler.clone(); ctx.spawn(async move { #[cfg(feature = "failpoints")] sleep_before_drain_change_event().await; let res = event_drain.forward(&mut sink).await; // Unregister this downstream only. let deregister = Deregister::Conn(conn_id); if let Err(e) = scheduler.schedule(Task::Deregister(deregister)) { error!("cdc deregister failed"; "error" => ?e); } match res { Ok(_s) => { info!("cdc send closed"; "downstream" => peer, "conn_id" => ?conn_id); let _ = sink.close().await; } Err(e) => { warn!("cdc send failed"; "error" => ?e, "downstream" => peer, "conn_id" => ?conn_id); } } }); } } #[cfg(feature = "failpoints")] async fn sleep_before_drain_change_event() { use std::time::{Duration, Instant}; use tikv_util::timer::GLOBAL_TIMER_HANDLE; let should_sleep = || { fail::fail_point!("cdc_sleep_before_drain_change_event", |_| true); false }; if should_sleep() { let dur = Duration::from_secs(5); let timer = GLOBAL_TIMER_HANDLE.delay(Instant::now() + dur); let _ = futures::compat::Compat01As03::new(timer).await; } } #[cfg(test)] mod tests { use std::{sync::Arc, time::Duration}; use futures::executor::block_on; use grpcio::{self, ChannelBuilder, EnvBuilder, Server, ServerBuilder, WriteFlags}; use kvproto::cdcpb::{create_change_data, ChangeDataClient, ResolvedTs}; use super::*; use crate::channel::{poll_timeout, recv_timeout, CdcEvent}; fn new_rpc_suite(capacity: usize) -> (Server, ChangeDataClient, ReceiverWrapper<Task>) { let memory_quota = MemoryQuota::new(capacity); let (scheduler, rx) = dummy_scheduler(); let cdc_service = Service::new(scheduler, memory_quota); let env = Arc::new(EnvBuilder::new().build()); let builder = ServerBuilder::new(env.clone()).register_service(create_change_data(cdc_service)); let mut server = builder.bind("127.0.0.1", 0).build().unwrap(); server.start(); let (_, port) = server.bind_addrs().next().unwrap(); let addr = format!("127.0.0.1:{}", port); let channel = ChannelBuilder::new(env).connect(&addr); let client = ChangeDataClient::new(channel); (server, client, rx) } #[test] fn test_flow_control() { // Disable CDC sink memory quota. let capacity = usize::MAX; let (_server, client, mut task_rx) = new_rpc_suite(capacity); // Create a event feed stream. let (mut tx, mut rx) = client.event_feed().unwrap(); let mut req = ChangeDataRequest { region_id: 1, ..Default::default() }; req.mut_header().set_ticdc_version("4.0.7".into()); block_on(tx.send((req, WriteFlags::default()))).unwrap(); let task = task_rx.recv_timeout(Duration::from_millis(100)).unwrap(); let conn = if let Some(Task::OpenConn { conn }) = task { conn } else { panic!("expect to be Task::OpenConn"); }; let sink = conn.get_sink().clone(); // Approximate 1 KB. let mut rts = ResolvedTs::default(); rts.set_regions(vec![u64::MAX; 128]); let send = || { let rts_ = rts.clone(); let mut sink_ = sink.clone(); Box::pin(async move { sink_.send_all(vec![CdcEvent::ResolvedTs(rts_)]).await }) }; let must_fill_window = || { let mut window_size = 0; loop { if matches!( poll_timeout(&mut send(), Duration::from_millis(100)), Err(_) | Ok(Err(_)) ) { // Window is filled and flow control in sink is triggered. break; } window_size += 1; // gRPC window size should not be larger than 1GB. assert!(window_size <= 1024 * 1024, "window_size: {}", window_size); } window_size }; // Fill gRPC window. let window_size = must_fill_window(); assert_ne!(window_size, 0); // After receiving a message, sink should be able to send again. recv_timeout(&mut rx, Duration::from_millis(100)) .unwrap() .unwrap() .unwrap(); poll_timeout(&mut send(), Duration::from_millis(100)) .unwrap() .unwrap(); // gRPC client may update window size after receiving a message, // though server should not be able to send messages infinitely. let window_size = must_fill_window(); assert_ne!(window_size, 0); } }
{ "content_hash": "fa67c4f3ee32981eee95fe070da62811", "timestamp": "", "source": "github", "line_count": 409, "max_line_length": 108, "avg_line_length": 33.32029339853301, "alnum_prop": 0.5257557968887584, "repo_name": "BusyJay/tikv", "id": "80d0f8c47a47ceddd5f9b929d37bbda40a7a8e70", "size": "13696", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/cdc/src/service.rs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "6514" }, { "name": "Dockerfile", "bytes": "3726" }, { "name": "Makefile", "bytes": "15459" }, { "name": "Python", "bytes": "8323" }, { "name": "Rust", "bytes": "13838421" }, { "name": "Shell", "bytes": "10621" } ], "symlink_target": "" }
namespace WpfControlsLib.Controls.Scene.EventArguments { using System; /// <summary> /// Arguments for removed element event. /// </summary> public class ElementRemovedEventArgs : EventArgs { public Repo.IElement Element { get; set; } } }
{ "content_hash": "f2a5c8ef6e3de9ff8d9da81e88bb8acf", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 23, "alnum_prop": 0.6521739130434783, "repo_name": "yurii-litvinov/REAL.NET", "id": "4c950fdd6964f749d47bd6bb65c45c3b6563612d", "size": "278", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/WpfControlsLib/Controls/Scene/EventArguments/ElementRemovedEventArgs.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "517" }, { "name": "C#", "bytes": "215565" }, { "name": "F#", "bytes": "177942" }, { "name": "Shell", "bytes": "567" } ], "symlink_target": "" }
package com.bdc.ociney.fragment; import android.app.ActivityOptions; import android.content.Intent; import android.graphics.Rect; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.bdc.ociney.R; import com.bdc.ociney.activity.AppFragmentActivity; import com.bdc.ociney.activity.MovieActivity; import com.bdc.ociney.adapter.ObjectAdapter; import com.bdc.ociney.fragment.core.BetterFragment; import com.bdc.ociney.modele.Movie.Movie; import com.bdc.ociney.task.LoadMoviesFavorisTask; import com.bdc.ociney.task.LoadMoviesTask; import com.bdc.ociney.task.SearchMoviesTask; import com.bdc.ociney.view.CellMovie; import com.bdc.ociney.view.ViewCell; import java.text.Normalizer; import java.util.ArrayList; import java.util.List; public class ListMoviesFragment extends BetterFragment implements AbsListView.OnScrollListener, LoadMoviesFavorisTask.LoadMoviesFavorisTaskCallBack, AdapterView.OnItemClickListener, ObjectAdapter.ObjectAdapterLoadMore, SearchMoviesTask.SearchMoviesTaskCallBack, LoadMoviesTask.LoadMoviesTaskCallBack { public static final String MOVIES = "movies"; public static final String FAVORIS = "favoris"; public static final String NOW_SHOWING = "nowshowing"; public static final String FAVORIS_STRINGS = "favoris_string"; static int MOVIE_CELL_IMAGE_FOND_HEIGHT; static int MOVIE_PARALLAX_SPEED = 100; public int page = 1; List<Movie> movies; ObjectAdapter<Movie> adapter; AbsListView list; AsyncTask task = null; View top = null; boolean recherche = false; boolean favoris = false; String texteRecherche = ""; boolean nowshowing = false; boolean vide = false; public ListMoviesFragment() { } public static ListMoviesFragment newInstance(List<Movie> movies, boolean nowShowing) { ListMoviesFragment fragment = new ListMoviesFragment(); Bundle args = new Bundle(); Gson gSon = new Gson(); args.putString(MOVIES, gSon.toJson(movies)); args.putBoolean(NOW_SHOWING, nowShowing); fragment.setArguments(args); return fragment; } public static ListMoviesFragment newInstance(List<String> films) { //dans le cas des favoris ListMoviesFragment fragment = new ListMoviesFragment(); Bundle args = new Bundle(); Gson gSon = new Gson(); args.putBoolean(FAVORIS, true); args.putString(FAVORIS_STRINGS, gSon.toJson(films)); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_list, container, false); setFragmentView(view); Bundle bundle = getArguments(); if (bundle != null) { if (bundle.containsKey(FAVORIS)) { favoris = true; movies = new ArrayList<Movie>(); Gson gSon = new Gson(); List<String> films = gSon.fromJson(bundle.getString(FAVORIS_STRINGS), new TypeToken<List<String>>() { }.getType()); if (films.size() > 0) { super.tournerRoulette(true); new LoadMoviesFavorisTask(this).execute(films); } else afficherVide(true); } else if (bundle.containsKey(MOVIES)) { Gson gSon = new Gson(); nowshowing = bundle.getBoolean(NOW_SHOWING); movies = gSon.fromJson(bundle.getString(MOVIES), new TypeToken<List<Movie>>() { }.getType()); } } MOVIE_CELL_IMAGE_FOND_HEIGHT = (int) getActivity().getResources().getDimension(R.dimen.cell_movie_image_fond_height); charger(); remplir(); ajouterListeners(); refreshAdapter(movies); return view; } @Override public void onResume() { super.onResume(); } @Override public void onPause() { super.onPause(); } @Override protected void charger() { View v = View.inflate(getActivity(), R.layout.list, null); list = (AbsListView) v.findViewById(R.id.list); ((ViewGroup) fragmentView).addView(v); } @Override protected void remplir() { adapter = new ObjectAdapter<Movie>(getActivity(), movies, R.layout.cell_movie, CellMovie.class); if (!favoris) adapter.listener = this; list.setAdapter(adapter); adapter.notifyDataSetChanged(); } @Override protected void ajouterListeners() { list.setOnItemClickListener(this); list.setOnScrollListener(this); } public void onClick(View v) { } @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Movie movie = (Movie) adapter.getItem(i); Intent intent = new Intent(getActivity(), MovieActivity.class); intent.putExtra(MovieFragment.ACTIONBAR_TITLE, AppFragmentActivity.actionBarSubTitle); intent.putExtra(MovieFragment.MOVIE, (new Gson()).toJson(movie)); Bundle b = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { b = ActivityOptions.makeScaleUpAnimation(view, 0, 0, view.getWidth(), view.getHeight()).toBundle(); getActivity().startActivity(intent, b); } else { getActivity().startActivity(intent); getActivity().overridePendingTransition(0, 0); } } public void refreshAdapter(List<Movie> movies) { ViewGroup p = (ViewGroup) this.list.getParent(); p.removeView(list); this.movies = movies; page = 1; charger(); remplir(); ajouterListeners(); } @Override public void onScrollStateChanged(AbsListView absListView, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (view.getChildCount() == 0) return; int first = 0; if (top == null) top = view.getChildAt(first); //GFloat yOffset = ((self.parallaxCollectionView.contentOffset.y int last = first + visibleItemCount; float centerY = view.getMeasuredHeight() / 2 + view.getTop(); for (int i = first; i < last; ++i) { View viewCell = view.getChildAt(i); if(viewCell != null && viewCell.getTag()!=null) { ViewCell cell = (ViewCell) viewCell.getTag(); Rect rect = new Rect(); viewCell.getGlobalVisibleRect(rect); float diffCenter = (centerY - rect.top); float yOffset = diffCenter / MOVIE_CELL_IMAGE_FOND_HEIGHT; if (yOffset > 1) yOffset = 1; if (yOffset < -1) yOffset = -1; cell.onScroll((-1f + yOffset) * MOVIE_PARALLAX_SPEED); } } } @Override public void search(String text) { texteRecherche = Normalizer.normalize(text, Normalizer.Form.NFD) .replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); if (task == null && text != null && !text.isEmpty()) { task = new SearchMoviesTask(this).execute(texteRecherche); refreshAdapter(new ArrayList<Movie>()); recherche = true; } } @Override public void onSearchMoviesTaskTaskCallBack(final List<Movie> ms) { if (ms.isEmpty() && movies.isEmpty()) { afficherVide(true); vide = true; adapter.listener = null; } else afficherVide(false); if (ms.isEmpty()) { vide = true; adapter.listener = null; } if (ms.size() == 0) //si plus de resultats, on enleve le loadmore adapter.listener = null; else { list.post( new Runnable() { @Override public void run() { movies.addAll(ms); adapter.notifyDataSetChanged(); } } ); } task = null; } @Override public void loadMore() { page++; if (recherche && !vide) task = new SearchMoviesTask(this).execute(texteRecherche, page); else new LoadMoviesTask(this).execute(page); } @Override public void onLoadMoviesTaskCallBack(final ArrayList<List<Movie>> ms) { try { list.post( new Runnable() { @Override public void run() { AppFragmentActivity.moviesNowShowing.addAll(ms.get(0)); AppFragmentActivity.moviesCommingSoon.addAll(ms.get(1)); if (nowshowing) movies.addAll(ms.get(0)); else movies.addAll(ms.get(1)); adapter.notifyDataSetChanged(); } } ); } catch (Exception e) { e.printStackTrace(); adapter.listener = null; } } @Override public void onLoadMoviesFavorisTaskCallBack(List<Movie> ms) { if (ms.isEmpty() && movies.isEmpty()) afficherVide(true); else afficherVide(false); movies.addAll(ms); adapter.notifyDataSetChanged(); tournerRoulette(false); } }
{ "content_hash": "0b7b2d1467a9cd48ac9a4f9a2d9d1bf0", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 301, "avg_line_length": 30.30421686746988, "alnum_prop": 0.5869197892853593, "repo_name": "tamzi/sophia", "id": "5d38494638dc40b9bd7533f256a044f03f6eb34e", "size": "10061", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "OCiney/OCiney-master/app/src/main/java/com/bdc/ociney/fragment/ListMoviesFragment.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2926" }, { "name": "C++", "bytes": "518" }, { "name": "CSS", "bytes": "14892" }, { "name": "HTML", "bytes": "2553854" }, { "name": "Java", "bytes": "4452678" }, { "name": "Makefile", "bytes": "13152" }, { "name": "PHP", "bytes": "1287" }, { "name": "RenderScript", "bytes": "143470" } ], "symlink_target": "" }
/* * 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.gbif.api.ws.mixin; import org.gbif.api.jackson.EmptyToNullUriDeserializer; import java.net.URI; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; public interface DatasetMixin extends LicenseMixin, EntityWithLogoMixin { @JsonDeserialize(using = EmptyToNullUriDeserializer.class) URI getHomepage(); }
{ "content_hash": "d6324ad1b7d700cb825080a0c6b25adf", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 34.57692307692308, "alnum_prop": 0.7708565072302559, "repo_name": "gbif/gbif-api", "id": "af03f2925ae832b7d292a92495783151c91a347d", "size": "899", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/main/java/org/gbif/api/ws/mixin/DatasetMixin.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1875853" } ], "symlink_target": "" }
package it.cnr.isti.vir.similarity; import java.util.Arrays; import it.cnr.isti.vir.features.AbstractFeaturesCollector; import it.cnr.isti.vir.features.FeatureClassCollector; import it.cnr.isti.vir.features.Permutation; import it.cnr.isti.vir.similarity.metric.IMetric; /** * @author Fabrizio Falchi * * Implemented following * "A similarity measure for indefinte rankings" * William Webber, Alistair Moffat, Justin Zobel (Univ. of Melbourne, Australia) * ACM TOIS, Vol. 28, No. 4, Article 20, November 2010 * * RBD = 1 - RBO * * in the following depth starts from 0 while d in the paper starts from 1 * */ public class RankBiasedDistance implements ISimilarity<Permutation>, IMetric<Permutation> { private int maxLength = 0; private long dCount = 0; private double p;// = 0.999; private double[] w;// = {1.0}; private double maxRBO; //public RankBiasedDistance() {}; public RankBiasedDistance(double p, int maxDepth) { this.p = p; setWeights( maxDepth ); }; private final synchronized void setWeights( int maxDepth ) { w = new double[maxDepth]; w[maxDepth-1] = Math.pow(p, maxDepth) / ( maxDepth+1); for ( int di=maxDepth-2; di>=0; di--) { w[di] = w[di+1] + Math.pow(p, di) / (di+1); } for ( int i=0; i<w.length; i++ ) { maxRBO += w[i]; } } // public RankBiasedDistance(int maxLength) { // if ( maxLength >= 0) // this.maxLength =maxLength; // } // public void setParameters(double p, int maxDepth ) { // if ( this.p != p || maxDepth != w.length ) { // this.p = p; // setWeights( maxDepth ); // } // } public void setMaxLength(int maxLength) { this.maxLength = maxLength; if ( this.maxLength < 0) this.maxLength = 0; } @Override public double distance(Permutation f1, Permutation f2) { dCount++; if ( maxLength == 0 ) return d(f1.getROPositions(), f2.getROPositions()); return d_l(f1.getROPositions(), f2.getROPositions(), maxLength); } @Override public double distance(Permutation f1, Permutation f2, double max) { dCount++; if ( maxLength == 0 ) return d(f1.getROPositions(), f2.getROPositions(), (long) Math.ceil( max )); return d_l(f1.getROPositions(), f2.getROPositions(), (long) Math.ceil( max ), maxLength); } @Override public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2 ) { return distance((Permutation) f1.getFeature(Permutation.class), (Permutation) f2.getFeature(Permutation.class)); } @Override public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2, double max ) { return distance((Permutation) f1.getFeature(Permutation.class), (Permutation) f2.getFeature(Permutation.class), max); } public int getMaxDist() { return 1; } @Override public long getDistCount() { return dCount; } @Override public FeatureClassCollector getRequestedFeaturesClasses() { return new FeatureClassCollector( Permutation.class ); } /** * @param p * @param intersectionIncr * @return */ // public static double rbo(double p, byte[] intersectionIncr) { // // double acc =0; // int intersection = 0; // // if ( p<1 ) { // // the weight of depth=1 will be 1.0 // double w = (1/p); // for ( int d=0; d<intersectionIncr.length; d++ ) { // intersection += intersectionIncr[d]; // w *= p; // acc += w * ( intersection / (double) (d+1) ); // } // return (1-p)*acc; // } else { // for ( int d=0; d<intersectionIncr.length; d++ ) { // intersection += intersectionIncr[d]; // acc += ( intersection / (double) (d+1) ); // } // return acc/intersectionIncr.length; // } // // } /** * @param pos1 * @param pos2 * @return */ public double rbo(int[] pos1, int[] pos2) { assert pos1.length == pos2.length; int idMax = pos1.length; double rbo = 0.0; for ( int i=0; i<idMax; i++ ) { // first position is reported as 0 // the same for depth int depth = Math.max(pos1[i], pos2[i]); rbo+= w[depth]; } return rbo / maxRBO; } public double rbo_l(int[] pos1, int[] pos2, int permLength) { assert pos1.length == pos2.length; int idMax = pos1.length; double rbo = 0.0; for ( int i=0; i<idMax; i++ ) { // first position is reported as 0 // the same for depth int depth = Math.max(pos1[i], pos2[i]); if ( depth < permLength ) { rbo+= w[depth]; } } return rbo / maxRBO; } /** * @param pos1 * @param pos2 * @return */ public double d(int[] pos1, int[] pos2) { // assert pos1.length == pos2.length; // // int idMax = pos1.length; // // // store the increment of intersection at various depth // // at each depth the increment can be 0,1 or 2 // byte[] intersectionIncr = new byte[idMax]; // // for ( int i=0; i<idMax; i++ ) { // // first position is reported as 0 // // the same for depth // int depth = Math.max(pos1[i], pos2[i]); // intersectionIncr[depth]++; // } // return 1.0 - rbo(pos1, pos2); } /** * @param obj1 * @param obj2 * @param permLength max permutation length * @return */ public double d_l(int[] pos1, int[] pos2, int permLength) { // assert pos1.length == pos2.length; // // if ( pos1.length == permLength ) return d(pos1, pos2); // // int idMax = pos1.length; // // // store the increment of intersection at various depth // // at each depth the increment can be 0,1 or 2 // byte[] intersectionIncr = new byte[permLength]; // // for ( int i=0; i<idMax; i++ ) { // // first position is reported as 0 // // the same for depth // if ( pos1[i] < permLength && pos2[i] < permLength ) { // int depth = Math.max(pos1[i], pos2[i]); // intersectionIncr[depth]++; // } // } // return 1.0 - rbo_l(pos1, pos2, permLength); } /** * @param obj1 * @param obj2 * @param max * @param permLength max permutation length * @return */ public double d_l(int[] pos1, int[] pos2, long max, int permLength) { // TO DO !!! return d_l(pos1, pos2, permLength ); } public double d(int[] pos1, int[] pos2, long max) { // TO DO !!! return d(pos1, pos2); } public String getStatsString() { return ""; }; }
{ "content_hash": "065a1a9dbfeef960eb529383113dd27e", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 119, "avg_line_length": 25.141732283464567, "alnum_prop": 0.6035076730347635, "repo_name": "ffalchi/it.cnr.isti.vir", "id": "82d67f1c27f17e8bbd54bb0fa070e4cc5ea2e84c", "size": "7909", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/it/cnr/isti/vir/similarity/RankBiasedDistance.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Java", "bytes": "2065090" } ], "symlink_target": "" }
'use strict' /* Index Index contains the state of a datastore, ie. what data we currently have. Index receives a call from a Store when the operations log for the Store was updated, ie. new operations were added. In updateIndex, the Index implements its CRDT logic: add, remove or update items in the data structure. Each new operation received from the operations log is applied in order onto the current state, ie. each new operation changes the data and the state changes. Implementing each CRDT as an Index, we can implement both operation-based and state-based CRDTs with the same higher level abstractions. To read the current state of the database, Index provides a single public function: `get()`. It is up to the Store to decide what kind of query capabilities it provides to the consumer. Usage: ```javascript const Index = new Index(userId) ``` */ class Index { /* @param id - unique identifier of this index, eg. a user id or a hash */ constructor (id) { this.id = id this._index = [] } /* Returns the state of the datastore, ie. most up-to-date data @return - current state */ get () { return this._index } /* Applies operations to the Index and updates the state @param oplog - the source operations log that called updateIndex @param entries - operations that were added to the log */ async updateIndex (oplog, entries) { this._index = oplog.values } } module.exports = Index
{ "content_hash": "f655c6db3a6d86a096c9b1b20cda4117", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 27.254545454545454, "alnum_prop": 0.7031354236157439, "repo_name": "orbitdb/orbit-db-store", "id": "8a27e10798c66038008d687c24f9eafcb70a08cc", "size": "1499", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "src/Index.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "446" }, { "name": "JavaScript", "bytes": "39071" }, { "name": "Makefile", "bytes": "344" } ], "symlink_target": "" }
struct java::nio::channels::WritableByteChannel : public virtual Channel { virtual int32_t write(::java::nio::ByteBuffer* src) = 0; // Generated static ::java::lang::Class *class_(); };
{ "content_hash": "1a06b4b10d32c7a5a1a64aabc124961a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6470588235294118, "repo_name": "pebble2015/cpoi", "id": "4f30efc89ca95327851e721d04152d5bc716c292", "size": "455", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ext/src/java/nio/channels/WritableByteChannel.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "15964112" }, { "name": "Makefile", "bytes": "138107" } ], "symlink_target": "" }
permalink: "/github/" --- <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>baarbe.ca/github</title> <meta http-equiv="refresh" content="0; URL=https://github.com/baarbeh?tab=repositories" /> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-92975012-1', 'auto'); ga('send', 'pageview'); </script> </head> </html>
{ "content_hash": "2847ca07cebaad5d6cbf4543ad672c93", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 94, "avg_line_length": 34.65217391304348, "alnum_prop": 0.6398996235884568, "repo_name": "baarbeh/baarbeh.github.io", "id": "508b46006180d2b2a4b39a563aaf12b67e772d62", "size": "801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_pages/github.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "80408" }, { "name": "HTML", "bytes": "89576" }, { "name": "JavaScript", "bytes": "4736" }, { "name": "Ruby", "bytes": "2999" } ], "symlink_target": "" }
"""Functional test for learning rate decay.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import test_util from tensorflow.python.ops import state_ops from tensorflow.python.ops import variables from tensorflow.python.platform import googletest from tensorflow.python.training import learning_rate_decay class LRDecayTest(test_util.TensorFlowTestCase): def testContinuous(self): with self.test_session(): step = 5 decayed_lr = learning_rate_decay.exponential_decay(0.05, step, 10, 0.96) expected = .05 * 0.96 ** (5.0 / 10.0) self.assertAllClose(decayed_lr.eval(), expected, 1e-6) def testStaircase(self): with self.test_session(): step = state_ops.variable_op([], dtypes.int32) assign_100 = state_ops.assign(step, 100) assign_1 = state_ops.assign(step, 1) assign_2 = state_ops.assign(step, 2) decayed_lr = learning_rate_decay.exponential_decay(.1, step, 3, 0.96, staircase=True) # No change to learning rate assign_1.op.run() self.assertAllClose(decayed_lr.eval(), .1, 1e-6) assign_2.op.run() self.assertAllClose(decayed_lr.eval(), .1, 1e-6) # Decayed learning rate assign_100.op.run() expected = .1 * 0.96**(100 // 3) self.assertAllClose(decayed_lr.eval(), expected, 1e-6) def testVariables(self): with self.test_session(): step = variables.Variable(1) assign_1 = step.assign(1) assign_2 = step.assign(2) assign_100 = step.assign(100) decayed_lr = learning_rate_decay.exponential_decay(.1, step, 3, 0.96, staircase=True) variables.initialize_all_variables().run() # No change to learning rate assign_1.op.run() self.assertAllClose(decayed_lr.eval(), .1, 1e-6) assign_2.op.run() self.assertAllClose(decayed_lr.eval(), .1, 1e-6) # Decayed learning rate assign_100.op.run() expected = .1 * 0.96**(100 // 3) self.assertAllClose(decayed_lr.eval(), expected, 1e-6) def testPiecewiseConstant(self): with self.test_session(): x = variables.Variable(-999) assign_100 = x.assign(100) assign_105 = x.assign(105) assign_110 = x.assign(110) assign_120 = x.assign(120) assign_999 = x.assign(999) pc = learning_rate_decay.piecewise_constant(x, [100, 110, 120], [1.0, 0.1, 0.01, 0.001]) variables.initialize_all_variables().run() self.assertAllClose(pc.eval(), 1.0, 1e-6) assign_100.op.run() self.assertAllClose(pc.eval(), 1.0, 1e-6) assign_105.op.run() self.assertAllClose(pc.eval(), 0.1, 1e-6) assign_110.op.run() self.assertAllClose(pc.eval(), 0.1, 1e-6) assign_120.op.run() self.assertAllClose(pc.eval(), 0.01, 1e-6) assign_999.op.run() self.assertAllClose(pc.eval(), 0.001, 1e-6) def testPiecewiseConstantEdgeCases(self): with self.test_session(): with self.assertRaises(ValueError): x_int = variables.Variable(0, dtype=variables.dtypes.int32) boundaries, values = [-1.0, 1.0], [1, 2, 3] pc = learning_rate_decay.piecewise_constant(x_int, boundaries, values) with self.assertRaises(ValueError): x = variables.Variable(0.0) boundaries, values = [-1.0, 1.0], [1.0, 2, 3] pc = learning_rate_decay.piecewise_constant(x, boundaries, values) if __name__ == "__main__": googletest.main()
{ "content_hash": "7522bd9b47328d4c1534e946efb4752a", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 78, "avg_line_length": 38.18556701030928, "alnum_prop": 0.6169006479481641, "repo_name": "ivano666/tensorflow", "id": "6fabd58fe31b9484e613daa917319bf7c65ce5ee", "size": "4382", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "tensorflow/python/training/learning_rate_decay_test.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "155915" }, { "name": "C++", "bytes": "9051139" }, { "name": "CMake", "bytes": "29372" }, { "name": "CSS", "bytes": "1297" }, { "name": "HTML", "bytes": "763492" }, { "name": "Java", "bytes": "38854" }, { "name": "JavaScript", "bytes": "10779" }, { "name": "Jupyter Notebook", "bytes": "1772913" }, { "name": "Protocol Buffer", "bytes": "110179" }, { "name": "Python", "bytes": "6027764" }, { "name": "Shell", "bytes": "165125" }, { "name": "TypeScript", "bytes": "403037" } ], "symlink_target": "" }
from django.db import models from sorl.thumbnail import get_thumbnail class Image(models.Model): name = models.CharField(null=True,blank=True,max_length=500) src = models.ImageField(upload_to='uploads/photos/%Y-%m', null=True,max_length=200) upload_dt = models.DateTimeField(auto_now_add=True) rejected = models.BooleanField(default=False) def __unicode__ (self): return self.name @property def as_json(self): return { 'name': self.name, 'url': self.src.url, 'url_medium': get_thumbnail(self.src,"300x300").url, 'url_small': get_thumbnail(self.src,"128x128", crop='center').url, } #instagramphoto = models.ForeignKey(InstagramPhoto,null=True,blank=True) class Meta: ordering = ('name',)
{ "content_hash": "dbc5f7abd8ff9f17ee5e7ee05f9b3949", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 31.458333333333332, "alnum_prop": 0.6834437086092715, "repo_name": "pizzapanther/Localvore", "id": "228abfdd52d9a43cef03ef2fc52d2ccec077a773", "size": "755", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "django-app/media/models.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "607136" }, { "name": "CoffeeScript", "bytes": "3263" }, { "name": "JavaScript", "bytes": "74606" }, { "name": "Python", "bytes": "38363" }, { "name": "Shell", "bytes": "4789" } ], "symlink_target": "" }
AimpPlaylistQueue::AimpPlaylistQueue(IAIMPPlaylistQueue* queue, IAIMPPlaylistQueue2* queue2) : AimpObject(queue) { _listner = new AimpPlaylistQueueListener(this); queue2->ListenerAdd(_listner); } bool AimpPlaylistQueue::IsSuspended::get() { IAIMPPropertyList* properties = nullptr; try { InternalAimpObject->QueryInterface(IID_IAIMPPropertyList, reinterpret_cast<void**>(&properties)); return PropertyListExtension::GetBool(properties, AIMP_PLAYLISTQUEUE_PROPID_SUSPENDED); } finally { if (properties != nullptr) { properties->Release(); } } } void AimpPlaylistQueue::IsSuspended::set(bool value) { IAIMPPropertyList* properties = nullptr; InternalAimpObject->QueryInterface(IID_IAIMPPropertyList, reinterpret_cast<void**>(&properties)); PropertyListExtension::SetBool(properties, AIMP_PLAYLISTQUEUE_PROPID_SUSPENDED, value); properties->Release(); } ActionResult AimpPlaylistQueue::Add(IAimpPlaylistItem^ item, bool insertAtBeginning) { const auto internalObj = static_cast<AimpPlaylistItem^>(item)->InternalAimpObject; if (internalObj == nullptr) { NULL_REFERENCE() } return ACTION_RESULT(CheckResult(InternalAimpObject->Add(internalObj, insertAtBeginning))); } ActionResult AimpPlaylistQueue::AddList(Generic::IList<IAimpPlaylistItem^>^ items, bool insertAtBeginning) { ActionResultType result = ActionResultType::Fail; if (items->Count > 0) { IAIMPObjectList* list = nullptr; result = CheckResult( ManagedAimpCore::GetAimpCore()->CreateObject(IID_IAIMPObjectList, reinterpret_cast<void**>(&list))); if (result == ActionResultType::OK && list != nullptr) { for (int i = 0; i < items->Count; i++) { result = CheckResult(list->Add(static_cast<AimpPlaylistItem^>(items[i])->InternalAimpObject)); if (result != ActionResultType::OK) { return ACTION_RESULT(result); } } result = CheckResult(InternalAimpObject->AddList(list, insertAtBeginning)); } } return ACTION_RESULT(result); } int AimpPlaylistQueue::GetItemCount() { return InternalAimpObject->GetItemCount(); } ActionResult AimpPlaylistQueue::Delete(IAimpPlaylist^ playList) { return ACTION_RESULT( CheckResult(InternalAimpObject->Delete2(static_cast<AimpPlayList^>(playList)->InternalAimpObject))); } ActionResult AimpPlaylistQueue::Delete(IAimpPlaylistItem^ item) { return ACTION_RESULT( CheckResult(InternalAimpObject->Delete(static_cast<AimpPlaylistItem^>(item)->InternalAimpObject))); } ActionResult AimpPlaylistQueue::Move(IAimpPlaylistItem^ item, int index) { return ACTION_RESULT( CheckResult(InternalAimpObject->Move(static_cast<AimpPlaylistItem^>(item)->InternalAimpObject, index))); } ActionResult AimpPlaylistQueue::Move(int index, int targetIndex) { return ACTION_RESULT(CheckResult(InternalAimpObject->Move2(index, targetIndex))); } AimpActionResult<IAimpPlaylistItem^>^ AimpPlaylistQueue::GetItem(int index) { IAIMPPlaylistItem* aimpItem = nullptr; IAimpPlaylistItem^ item = nullptr; const auto res = CheckResult(InternalAimpObject->GetItem( index, IID_IAIMPPlaylistItem, reinterpret_cast<void**>(&aimpItem)) ); if (res == ActionResultType::OK && aimpItem != nullptr) { item = gcnew AimpPlaylistItem(aimpItem); } return gcnew AimpActionResult<IAimpPlaylistItem^>(res, item); } void AimpPlaylistQueue::ContentChanged::add(AimpPlaylistQueueListenerHandler^ onEvent) { if (_contentChanged == nullptr) { _contentChanged = static_cast<AimpPlaylistQueueListenerHandler^>(Delegate::Combine(_contentChanged, onEvent)); } } void AimpPlaylistQueue::ContentChanged::remove(AimpPlaylistQueueListenerHandler^ onEvent) { if (_contentChanged != nullptr) { _contentChanged = static_cast<AimpPlaylistQueueListenerHandler^>(Delegate::Remove(_contentChanged, onEvent)); } } void AimpPlaylistQueue::ContentChanged::raise(IAimpPlaylistQueue^ sender) { if (_contentChanged != nullptr) { _contentChanged(sender); } } void AimpPlaylistQueue::StateChanged::add(AimpPlaylistQueueListenerHandler^ onEvent) { if (_stateChanged == nullptr) { _stateChanged = static_cast<AimpPlaylistQueueListenerHandler^>(Delegate::Combine(_stateChanged, onEvent)); } } void AimpPlaylistQueue::StateChanged::remove(AimpPlaylistQueueListenerHandler^ onEvent) { if (_stateChanged != nullptr) { _stateChanged = static_cast<AimpPlaylistQueueListenerHandler^>(Delegate::Remove(_stateChanged, onEvent)); } } void AimpPlaylistQueue::StateChanged::raise(IAimpPlaylistQueue^ sender) { if (_stateChanged != nullptr) { _stateChanged(sender); } }
{ "content_hash": "8904299786005b6ed7a1ef98d5d3a860", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 118, "avg_line_length": 36.62406015037594, "alnum_prop": 0.7092999384110039, "repo_name": "martin211/aimp_dotnet", "id": "19faf80ef0d40fa8010de4050434ad7b9c87f8ec", "size": "5192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SDK/aimp_dotnet/SDK/PlayList/AimpPlayListQueue.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "214" }, { "name": "C", "bytes": "21484" }, { "name": "C#", "bytes": "904968" }, { "name": "C++", "bytes": "1245187" }, { "name": "CSS", "bytes": "18676" }, { "name": "JavaScript", "bytes": "42990" }, { "name": "Liquid", "bytes": "2760" }, { "name": "PowerShell", "bytes": "5649" }, { "name": "Shell", "bytes": "2342" }, { "name": "XSLT", "bytes": "2166" } ], "symlink_target": "" }
#include <seqan/basic.h> #include <seqan/sequence.h> #include <seqan/arg_parse.h> #include <string> #include <sstream> #include <iostream> #include <fstream> #include <map> #include "output.h" #include "read_stats.h" /* * Text constants for output */ // output filenames static const char * SEQC_READLENGTH_FILE = "readlength.tsv"; static const char * SEQC_POS_QUAL_FILE = "per_pos_qual.tsv"; static const char * SEQC_POS_GC_CONTENT_FILE = "pos_gc_content.tsv"; static const char * SEQC_POS_N_CONTENT_FILE = "pos_n_content.tsv"; static const char * SEQC_POS_NUC_DIST_FILE = "pos_nuc_dist.tsv"; static const char * SEQC_SEQ_GC_CONTENT_FILE = "seq_gc_content.tsv"; static const char * SEQC_SEQ_QUAL_DIST_FILE = "seq_qual.tsv"; static const char * SEQC_SUMMARY_FILE = "summary.tsv"; // textual conventions static const char * SEQC_END_MODULE_LN = ">>END_MODULE"; /** * wrapper: actually writes statistics info to files. */ int TSVWriter::writeAll(ReadStats & stats, std::string const outdir){ if (mkdir("testout",0744) != 0) { std::cerr << "Error creating output directory: " << strerror( errno ) << std::endl; exit(-1); } std::ofstream ofStream; {// ReadLength Distribution ofStream.open((outdir + "/" + SEQC_READLENGTH_FILE).c_str()); std::stringstream ss; writeReadLength(stats, ss); ofStream << ss.str(); ofStream.close(); } {// Per Position-in-Read Quality Statistics ofStream.open((outdir + "/" + SEQC_POS_QUAL_FILE).c_str()); std::stringstream ss; writePerPosQual(stats, ss); ofStream << ss.str(); ofStream.close(); } {// Per Position-in-Read Nucleotide content Statistics std::stringstream gc_content; std::stringstream n_content; std::stringstream nuc_dist; writeNucContent(stats, gc_content, n_content, nuc_dist); ofStream.open((outdir + "/" + SEQC_POS_GC_CONTENT_FILE).c_str()); ofStream << gc_content.str(); ofStream.close(); std::ofstream ofStream2; ofStream2.open((outdir + "/" + SEQC_POS_N_CONTENT_FILE).c_str()); ofStream2 << n_content.str(); ofStream2.close(); std::ofstream ofStream3; ofStream3.open((outdir + "/" + SEQC_POS_NUC_DIST_FILE).c_str()); ofStream3 << nuc_dist.str(); ofStream3.close(); } {// GC Content distribution file ofStream.open((outdir + "/" + SEQC_SEQ_GC_CONTENT_FILE).c_str()); std::stringstream ss; writePerReadGcContent(stats, ss); ofStream << ss.str(); ofStream.close(); } {// Overall quality score distribution file ofStream.open((outdir + "/" + SEQC_SEQ_QUAL_DIST_FILE).c_str()); std::stringstream ss; writePerReadQualContent(stats, ss); ofStream << ss.str(); ofStream.close(); } {// Write job summary ofStream.open((outdir + "/" + SEQC_SUMMARY_FILE).c_str()); std::stringstream ss; writeJobSummary(stats, ss); ofStream << ss.str(); ofStream.close(); } } /** * create the content that goes into the sequence length distribution statistics */ void TSVWriter::writeReadLength(ReadStats & stats, std::stringstream & ss) { // write out stats ss << ">>Sequence Length Distribution\tpass" << std::endl; ss << "#Length\tCount" << std::endl; std::map<int,int>::iterator iter; for(iter=stats.readLenCount.begin();iter != stats.readLenCount.end(); iter++){ ss << iter->first << "\t" << iter->second << std::endl; } ss << SEQC_END_MODULE_LN << std::endl; }; void TSVWriter::writePerReadQualContent(ReadStats & stats, std::stringstream & ss){ ss << ">>Per sequence quality scores\tpass"; ss << "#Quality\tCount"; }; void TSVWriter::writePerReadGcContent(ReadStats & stats, std::stringstream & ss){ ss << ">>Per Sequence GC Content\tpass" << std::endl; ss << "#GC\tCount" << std::endl; for(int i=0; i<seqan::length(stats.gcPerReadCount); ++i){ ss << i << "\t" << stats.gcPerReadCount[i] << std::endl; } }; unsigned sum(seqan::String<unsigned > counts ){ unsigned sum = 0; for(unsigned c = 0; c < length(counts);++c){ sum += counts[c]; } return sum; }; void TSVWriter::writeNucContent(ReadStats & stats, std::stringstream & gc_content, std::stringstream & n_content, std::stringstream & nuc_dist ) { gc_content << ">>Per base GC content\tpass" << std::endl; gc_content << "#Base\t%GC" << std::endl; n_content << ">>Per base N content\tpass" << std::endl; n_content << "#Base\t%GC" << std::endl; nuc_dist << ">>Per base sequence content\tpass" << std::endl; nuc_dist << "#Base\tG\tA\tT\tC\tN" << std::endl; // sums for per pos summations unsigned sum_a = 0; unsigned sum_t = 0; unsigned sum_c = 0; unsigned sum_g = 0; unsigned sum_n = 0; unsigned sum_all = 0; //per position in read: for(unsigned pos = 0; pos < length(stats.nucCount); ++pos) { sum_a = 0; sum_t = 0; sum_c = 0; sum_g = 0; sum_n = 0; sum_c += sum(stats.nucCount[pos][(seqan::Dna5)'C']); sum_g += sum(stats.nucCount[pos][(seqan::Dna5)'G']); sum_a += sum(stats.nucCount[pos][(seqan::Dna5)'A']); sum_t += sum(stats.nucCount[pos][(seqan::Dna5)'T']); sum_n += sum(stats.nucCount[pos][(seqan::Dna5)'N']); sum_all = sum_c + sum_g + sum_a + sum_t + sum_n; if(sum_all > 0) { gc_content << (pos+1) << "\t"; gc_content << 100*(float)(sum_g+sum_c)/sum_all << std::endl; n_content << (pos+1) << "\t"; n_content << 100*(float)sum_n/sum_all << std::endl; nuc_dist << (pos+1) << "\t"; nuc_dist << 100*(float)sum_g/sum_all << "\t" << 100*(float)sum_a/sum_all << "\t" << 100*(float)sum_t/sum_all << "\t" << 100*(float)sum_c/sum_all << "\t" << 100*(float)sum_n/sum_all << std::endl; } } }; void TSVWriter::writePerPosQual(ReadStats & stats, std::stringstream & ss) { ss << ">>Per base sequence quality\tfail" << std::endl; ss << "Base Mean Median Lower Quartile Upper Quartile 10th Percentile 90th Percentile" << std::endl; //per position in read: for(unsigned pos = 0; pos < length(stats.scoreCount); ++pos){ // we have to know how many there are counted in total // so we can pick specific quantiles later unsigned total_scores = 0; //we'll cumulate counts here so we have easier access later seqan::String<unsigned> intervals; //we need to add all scores to calc mean unsigned score_sum = 0; //we'll collect 20 quantiles here seqan::String<char> quantiles; for(unsigned score = 0; score < length(stats.scoreCount[0]); ++score){ total_scores += stats.scoreCount[pos][score]; seqan::append(intervals,total_scores); score_sum += stats.scoreCount[pos][score]*score; } if(total_scores > 0){ stats.collectQuantiles(intervals, quantiles, 20); //current base pos and mean ss << (pos+1) << "\t" << ((double)score_sum/total_scores)-stats.scoreOffset ; ss << "\t" << quantiles[9] - stats.scoreOffset; // median ss << "\t" << quantiles[4] - stats.scoreOffset; // lower quartile ss << "\t" << quantiles[14] - stats.scoreOffset; // upper quartile ss << "\t" << quantiles[1] - stats.scoreOffset; // 10th percentile ss << "\t" << quantiles[17] - stats.scoreOffset; // 90th percentile ss << std::endl; } } }; void TSVWriter::writeJobSummary(ReadStats & stats, std::stringstream & ss){ ss << ">>Basic Statistics pass" << std::endl; ss << "Measure\tValue" << std::endl; /* ss << "Filename " << stats < File type Conventional base calls < Encoding Sanger / Illumina 1.9 < Total Sequences 4183 < Filtered Sequences 0 < Sequence length 100 < %GC 50 */ }; /** * use existing quality scores to guess the scoring offset */ void TSVWriter::guessQualScoreOffset(ReadStats & stats){ /* * We can guess the scoring system, * but we have to make sure to warn about conflicts * * Illumina: offset=64 [ 0 - 40] -> [64-104] * Sanger: offset=33 [ 0 - 93] -> [33-126] * Solexa: offset=64 [-5 - 62] -> [59-99] * */ // if there are any scores lower than 59, we guess Sanger/Illumina 1.9 bool hasSangerScore = false; for(char score = 58; score >= 0 && !hasSangerScore; --score){ std::cout << " score: " << (unsigned)score << std::endl; for(unsigned pos = seqan::length(stats.scoreCount[stats.getSize()-1])-1; pos > 0 && !hasSangerScore; --pos){ std::cout << "pos: " << pos << " score: " << (unsigned)score << std::endl; if(stats.scoreCount[pos][score]>0){ hasSangerScore = true; } } } // if there are any scores in range 59-63, we guess Solexa, // if all scores are above 64, we guess Illumina, // even though it could be a good Sanger run };
{ "content_hash": "96c1f9bf27c39ea72e25bc3fdb08ce18", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 113, "avg_line_length": 32.30194805194805, "alnum_prop": 0.5419640164840688, "repo_name": "bkahlert/seqan-research", "id": "a0df2ceaacc98daabb0d63fb2a950bb3ec187853", "size": "9949", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "raw/pmsb13/pmsb13-data-20130530/sources/jo3m1hxqqtlpeaer/2013-05-10T22-15-36.815+0200/sandbox/group2/apps/seqc/output.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "39014" }, { "name": "Awk", "bytes": "44044" }, { "name": "Batchfile", "bytes": "37736" }, { "name": "C", "bytes": "1261223" }, { "name": "C++", "bytes": "277576131" }, { "name": "CMake", "bytes": "5546616" }, { "name": "CSS", "bytes": "271972" }, { "name": "GLSL", "bytes": "2280" }, { "name": "Groff", "bytes": "2694006" }, { "name": "HTML", "bytes": "15207297" }, { "name": "JavaScript", "bytes": "362928" }, { "name": "LSL", "bytes": "22561" }, { "name": "Makefile", "bytes": "6418610" }, { "name": "Objective-C", "bytes": "3730085" }, { "name": "PHP", "bytes": "3302" }, { "name": "Perl", "bytes": "10468" }, { "name": "PostScript", "bytes": "22762" }, { "name": "Python", "bytes": "9267035" }, { "name": "R", "bytes": "230698" }, { "name": "Rebol", "bytes": "283" }, { "name": "Shell", "bytes": "437340" }, { "name": "Tcl", "bytes": "15439" }, { "name": "TeX", "bytes": "738415" }, { "name": "VimL", "bytes": "12685" } ], "symlink_target": "" }
var PendingStepResult = function() { var self = { isSuccessful: function isSuccessful() { return false; }, isPending: function isPending() { return true; }, isFailed: function isFailed() { return false; } }; return self; }; module.exports = PendingStepResult;
{ "content_hash": "801d6bc0856385f84031220e5f080e07", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 32.44444444444444, "alnum_prop": 0.6472602739726028, "repo_name": "rhok-pta/drm", "id": "2537478adfaee059a4d1b238ebe20974db54b854", "size": "292", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/cucumber/runtime/pending_step_result.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "109427" } ], "symlink_target": "" }
MongoDB\Driver\ReadPreference::getModeString() --FILE-- <?php $tests = [ MongoDB\Driver\ReadPreference::RP_PRIMARY, MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED, MongoDB\Driver\ReadPreference::RP_SECONDARY, MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED, MongoDB\Driver\ReadPreference::RP_NEAREST, ]; foreach ($tests as $test) { $rp = new MongoDB\Driver\ReadPreference($test); var_dump($rp->getModeString()); } ?> ===DONE=== <?php exit(0); ?> --EXPECT-- string(7) "primary" string(16) "primaryPreferred" string(9) "secondary" string(18) "secondaryPreferred" string(7) "nearest" ===DONE===
{ "content_hash": "8114a801f07aafd9330c9143bb02672a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 58, "avg_line_length": 23.48148148148148, "alnum_prop": 0.7034700315457413, "repo_name": "jmikola/mongo-php-driver-prototype", "id": "b9e23d094e79ee2021141cdc42073e77106bfc7d", "size": "643", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "tests/readPreference/readpreference-getModeString-001.phpt", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "455" }, { "name": "C", "bytes": "457987" }, { "name": "Groff", "bytes": "19778" }, { "name": "JavaScript", "bytes": "9504" }, { "name": "PHP", "bytes": "464562" }, { "name": "Python", "bytes": "2024" }, { "name": "Shell", "bytes": "6335" } ], "symlink_target": "" }
using System.Collections.Generic; using System.Linq; using Typewriter.CodeModel.Collections; using Typewriter.Metadata.Interfaces; using static Typewriter.CodeModel.Helpers; namespace Typewriter.CodeModel.Implementation { public sealed class MethodImpl : Method { private readonly IMethodMetadata _metadata; private MethodImpl(IMethodMetadata metadata, Item parent) { _metadata = metadata; Parent = parent; } public override Item Parent { get; } public override string name => CamelCase(_metadata.Name.TrimStart('@')); public override string Name => _metadata.Name.TrimStart('@'); public override string FullName => _metadata.FullName; public override bool IsAbstract => _metadata.IsAbstract; public override bool IsGeneric => _metadata.IsGeneric; private AttributeCollection _attributes; public override AttributeCollection Attributes => _attributes ?? (_attributes = AttributeImpl.FromMetadata(_metadata.Attributes, this)); private DocComment _docComment; public override DocComment DocComment => _docComment ?? (_docComment = DocCommentImpl.FromXml(_metadata.DocComment, this)); private TypeParameterCollection _typeParameters; public override TypeParameterCollection TypeParameters => _typeParameters ?? (_typeParameters = TypeParameterImpl.FromMetadata(_metadata.TypeParameters, this)); private ParameterCollection _parameters; public override ParameterCollection Parameters => _parameters ?? (_parameters = ParameterImpl.FromMetadata(_metadata.Parameters, this)); private Type _type; public override Type Type => _type ?? (_type = TypeImpl.FromMetadata(_metadata.Type, this)); public override string ToString() { return Name; } public static MethodCollection FromMetadata(IEnumerable<IMethodMetadata> metadata, Item parent) { return new MethodCollectionImpl(metadata.Select(m => new MethodImpl(m, parent))); } } }
{ "content_hash": "a75cb2f5ff541a1af280f80706e96129", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 168, "avg_line_length": 40.34615384615385, "alnum_prop": 0.6963775023832222, "repo_name": "frhagn/Typewriter", "id": "52f1e54d13b9b2c4225c68563c8f0ad525cbf06e", "size": "2098", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Typewriter/CodeModel/Implementation/MethodImpl.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "631158" }, { "name": "PowerShell", "bytes": "2861" }, { "name": "Scilab", "bytes": "5202" } ], "symlink_target": "" }
package de.jangruenewald.samples.android.daggertwoeleven.cases.provideinterface; /** * Created by Jan-2 on 27.10.2017. */ public interface FunProvider { String provideTheFun(); }
{ "content_hash": "40d7102588e5e154248ee63f1d8b7760", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 80, "avg_line_length": 17.181818181818183, "alnum_prop": 0.7407407407407407, "repo_name": "bl1b/daggertwoeleven", "id": "148dc9b1c2e77b7b9086c026df39c41295fc32a0", "size": "800", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/de/jangruenewald/samples/android/daggertwoeleven/cases/provideinterface/FunProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "32399" } ], "symlink_target": "" }
<?php /* @var $installer Mage_Sales_Model_Entity_Setup */ $installer = $this; $installer->getConnection()->addKey($installer->getTable('sales_flat_order'), 'IDX_UPDATED_AT', 'updated_at'); $installer->getConnection()->addKey($installer->getTable('sales_flat_shipment'), 'IDX_CREATED_AT', 'created_at'); $installer->getConnection()->addKey($installer->getTable('sales_flat_shipment'), 'IDX_UPDATED_AT', 'updated_at');
{ "content_hash": "f5f7fc52633f5e9f6cf6962550446f55", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 113, "avg_line_length": 42.1, "alnum_prop": 0.7102137767220903, "repo_name": "roemerdlr/kyojin", "id": "dd20ba475c057e55f9c2fae690ac1da124821b0b", "size": "1358", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.1-1.4.0.2.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "20018" }, { "name": "ApacheConf", "bytes": "12321" }, { "name": "Batchfile", "bytes": "1036" }, { "name": "CSS", "bytes": "1864960" }, { "name": "HTML", "bytes": "5256105" }, { "name": "JavaScript", "bytes": "1135184" }, { "name": "PHP", "bytes": "48689882" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "288" }, { "name": "Shell", "bytes": "3849" }, { "name": "XSLT", "bytes": "2135" } ], "symlink_target": "" }