code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
4
991
language
stringclasses
9 values
license
stringclasses
15 values
size
int32
3
1.05M
/*********************************************************************** VruiCalibrator - Simple program to check the calibration of a VR environment. Copyright (c) 2005 Oliver Kreylos This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #include <Math/Math.h> #include <Geometry/OrthogonalTransformation.h> #include <GL/gl.h> #include <GL/GLColor.h> #include <GL/GLColorTemplates.h> #include <GL/GLVertexTemplates.h> #include <GL/GLGeometryWrappers.h> #include <GL/GLTransformationWrappers.h> #include <GLMotif/Button.h> #include <GLMotif/Menu.h> #include <GLMotif/PopupMenu.h> #include <Vrui/InputDevice.h> #include <Vrui/Vrui.h> #include <Vrui/Application.h> class VruiDemo:public Vrui::Application { /* Elements: */ private: /* Vrui parameters: */ GLColor<GLfloat,4> modelColor; // Color to draw the model GLMotif::PopupMenu* mainMenu; // The program's main menu /* Private methods: */ GLMotif::PopupMenu* createMainMenu(void); // Creates the program's main menu /* Constructors and destructors: */ public: VruiDemo(int& argc,char**& argv,char**& appDefaults); // Initializes the Vrui toolkit and the application virtual ~VruiDemo(void); // Shuts down the Vrui toolkit /* Methods: */ virtual void display(GLContextData& contextData) const; // Called for every eye and every window on every frame void resetNavigationCallback(Misc::CallbackData* cbData); // Method to reset the Vrui navigation transformation to its default }; /************************* Methods of class VruiDemo: *************************/ GLMotif::PopupMenu* VruiDemo::createMainMenu(void) { /* Create a popup shell to hold the main menu: */ GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager()); mainMenuPopup->setTitle("Vrui Demonstration"); /* Create the main menu itself: */ GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false); /* Create a button: */ GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation"); /* Add a callback to the button: */ resetNavigationButton->getSelectCallbacks().add(this,&VruiDemo::resetNavigationCallback); /* Finish building the main menu: */ mainMenu->manageChild(); return mainMenuPopup; } VruiDemo::VruiDemo(int& argc,char**& argv,char**& appDefaults) :Vrui::Application(argc,argv,appDefaults), mainMenu(0) { /* Calculate the model color: */ for(int i=0;i<3;++i) modelColor[i]=1.0f-Vrui::getBackgroundColor()[i]; modelColor[3]=1.0f; /* Create the user interface: */ mainMenu=createMainMenu(); /* Install the main menu: */ Vrui::setMainMenu(mainMenu); /* Set the navigation transformation: */ resetNavigationCallback(0); } VruiDemo::~VruiDemo(void) { delete mainMenu; } void VruiDemo::display(GLContextData& contextData) const { Vrui::Point displayCenter=Vrui::getDisplayCenter(); Vrui::Scalar inchScale=Vrui::getInchFactor(); /* Set up OpenGL state: */ GLboolean lightingEnabled=glIsEnabled(GL_LIGHTING); if(lightingEnabled) glDisable(GL_LIGHTING); GLfloat lineWidth; glGetFloatv(GL_LINE_WIDTH,&lineWidth); glLineWidth(1.0f); /* Draw a 10" wireframe cube in the middle of the environment: */ glPushMatrix(); glTranslate(displayCenter-Vrui::Point::origin); glScale(inchScale,inchScale,inchScale); glColor(modelColor); glBegin(GL_LINES); glVertex(-5.0f,-5.0f,-5.0f); glVertex( 5.0f,-5.0f,-5.0f); glVertex(-5.0f, 5.0f,-5.0f); glVertex( 5.0f, 5.0f,-5.0f); glVertex(-5.0f, 5.0f, 5.0f); glVertex( 5.0f, 5.0f, 5.0f); glVertex(-5.0f,-5.0f, 5.0f); glVertex( 5.0f,-5.0f, 5.0f); glVertex(-5.0f,-5.0f,-5.0f); glVertex(-5.0f, 5.0f,-5.0f); glVertex( 5.0f,-5.0f,-5.0f); glVertex( 5.0f, 5.0f,-5.0f); glVertex( 5.0f,-5.0f, 5.0f); glVertex( 5.0f, 5.0f, 5.0f); glVertex(-5.0f,-5.0f, 5.0f); glVertex(-5.0f, 5.0f, 5.0f); glVertex(-5.0f,-5.0f,-5.0f); glVertex(-5.0f,-5.0f, 5.0f); glVertex( 5.0f,-5.0f,-5.0f); glVertex( 5.0f,-5.0f, 5.0f); glVertex( 5.0f, 5.0f,-5.0f); glVertex( 5.0f, 5.0f, 5.0f); glVertex(-5.0f, 5.0f,-5.0f); glVertex(-5.0f, 5.0f, 5.0f); glEnd(); glPopMatrix(); /* Draw coordinate axes for each input device: */ int numDevices=Vrui::getNumInputDevices(); for(int i=0;i<numDevices;++i) { Vrui::InputDevice* id=Vrui::getInputDevice(i); if(id->is6DOFDevice()) { glPushMatrix(); glMultMatrix(id->getTransformation()); glScale(inchScale,inchScale,inchScale); glBegin(GL_LINES); glColor3f(1.0f,0.0f,0.0f); glVertex3f(-5.0f,0.0f,0.0f); glVertex3f( 5.0f,0.0f,0.0f); glColor3f(0.0f,1.0f,0.0f); glVertex3f(0.0f,-5.0f,0.0f); glVertex3f(0.0f, 5.0f,0.0f); glColor3f(0.0f,0.0f,1.0f); glVertex3f(0.0f,0.0f,-5.0f); glVertex3f(0.0f,0.0f, 5.0f); glEnd(); glPopMatrix(); } } /* This only works in the CAVE - draw a grid on the "front wall" to calibrate external cameras: */ glBegin(GL_LINES); glColor3f(1.0f,1.0f,0.0f); for(int y=0;y<=8;++y) { glVertex(-60.0f,-36.0f,float(y)*12.0f); glVertex(60.0f,-36.0f,float(y)*12.0f); } for(int x=0;x<=10;++x) { glVertex(float(x)*12.0f-60.0f,-36.0f,0.0f); glVertex(float(x)*12.0f-60.0f,-36.0f,96.0f); } glEnd(); /* Restore OpenGL state: */ glLineWidth(lineWidth); if(lightingEnabled) glEnable(GL_LIGHTING); } void VruiDemo::resetNavigationCallback(Misc::CallbackData* cbData) { /* Reset the Vrui navigation transformation: */ Vrui::NavTransform t=Vrui::NavTransform::identity; t*=Vrui::NavTransform::translateFromOriginTo(Vrui::getDisplayCenter()); t*=Vrui::NavTransform::scale(Vrui::getInchFactor()); t*=Vrui::NavTransform::translateToOriginFrom(Vrui::getDisplayCenter()); Vrui::setNavigationTransformation(t); } int main(int argc,char* argv[]) { /* Create an application object: */ char** appDefaults=0; // This is an additional parameter no one ever uses VruiDemo app(argc,argv,appDefaults); /* Run the Vrui main loop: */ app.run(); /* Exit to OS: */ return 0; }
VisualIdeation/Vrui-2.2-003
ExamplePrograms/VruiCalibrator.cpp
C++
gpl-2.0
6,656
let mix = require('laravel-mix'); /* |-------------------------------------------------------------------------- | Mix Asset Management |-------------------------------------------------------------------------- | | Mix provides a clean, fluent API for defining some Webpack build steps | for your Laravel application. By default, we are compiling the Sass | file for the application as well as bundling up all the JS files. | */ mix.js('resources/assets/js/app.js', 'public/js') .js('resources/assets/js/salary_calc.js', 'public/js') .less('resources/assets/less/app.less', 'public/css') .less('resources/assets/less/salarycalc.less', 'public/css') .less('resources/assets/less/wordcounter.less', 'public/css') .copy('resources/assets/img', 'public/img');
eddcoons/portfolio
webpack.mix.js
JavaScript
gpl-2.0
787
package eu.ttbox.velib.ui.map.dialog; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.text.Editable; import android.widget.EditText; import eu.ttbox.velib.R; public class AliasInputDialog extends AlertDialog implements OnClickListener { private final OnAliasInputListener mCallBack; private EditText aliaseditText; /** * The callback used to indicate the user is done selecting the favorite Icon. */ public interface OnAliasInputListener { void onAliasInput(String alias); } public AliasInputDialog(Context context, OnAliasInputListener callBack) { this(context, 0, callBack); } public AliasInputDialog(Context context, int theme, OnAliasInputListener callBack) { super(context, theme); this.mCallBack = callBack; // Init Context themeContext = getContext(); setTitle(R.string.dialog_custum_alias); setCancelable(true); setIcon(0); setCanceledOnTouchOutside(true); setButton(BUTTON_POSITIVE, themeContext.getText(R.string.valid), this); setButton(BUTTON_NEGATIVE, themeContext.getText(R.string.cancel), (OnClickListener) null); // Create View aliaseditText = new EditText(getContext()); aliaseditText.setHint(R.string.dialog_custum_alias_hint); setView(aliaseditText); } public void setAliasInput(String alias) { aliaseditText.setText(alias); } @Override public void onClick(DialogInterface dialog, int which) { if (mCallBack != null) { Editable aliasEditable = aliaseditText.getText(); String value = aliasEditable != null ? aliaseditText.getText().toString().trim() : null; if (value != null && value.length() < 1) { value = null; } mCallBack.onAliasInput(value); } } }
gabuzomeu/cityLibProject
cityLib/src/main/java/eu/ttbox/velib/ui/map/dialog/AliasInputDialog.java
Java
gpl-2.0
1,790
<?php /** * Grundeinstellungen für WordPress * * Zu diesen Einstellungen gehören: * * * MySQL-Zugangsdaten, * * Tabellenpräfix, * * Sicherheitsschlüssel * * und ABSPATH. * * Mehr Informationen zur wp-config.php gibt es auf der * {@link https://codex.wordpress.org/Editing_wp-config.php wp-config.php editieren} * Seite im Codex. Die Zugangsdaten für die MySQL-Datenbank * bekommst du von deinem Webhoster. * * Diese Datei wird zur Erstellung der wp-config.php verwendet. * Du musst aber dafür nicht das Installationsskript verwenden. * Stattdessen kannst du auch diese Datei als wp-config.php mit * deinen Zugangsdaten für die Datenbank abspeichern. * * @package WordPress */ // ** MySQL-Einstellungen ** // /** Diese Zugangsdaten bekommst du von deinem Webhoster. **/ /** * Ersetze datenbankname_hier_einfuegen mit dem Namen * mit dem Namen der Datenbank, die du verwenden möchtest. */ define('DB_NAME', 'newsletter-spraachen'); /** * Ersetze benutzername_hier_einfuegen * mit deinem MySQL-Datenbank-Benutzernamen. */ define('DB_USER', 'root'); /** * Ersetze passwort_hier_einfuegen mit deinem MySQL-Passwort. */ define('DB_PASSWORD', 'root'); /** * Ersetze localhost mit der MySQL-Serveradresse. */ define('DB_HOST', 'localhost'); /** * Der Datenbankzeichensatz, der beim Erstellen der * Datenbanktabellen verwendet werden soll */ define('DB_CHARSET', 'utf8mb4'); /** * Der Collate-Type sollte nicht geändert werden. */ define('DB_COLLATE', ''); /**#@+ * Sicherheitsschlüssel * * Ändere jeden untenstehenden Platzhaltertext in eine beliebige, * möglichst einmalig genutzte Zeichenkette. * Auf der Seite {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * kannst du dir alle Schlüssel generieren lassen. * Du kannst die Schlüssel jederzeit wieder ändern, alle angemeldeten * Benutzer müssen sich danach erneut anmelden. * * @since 2.6.0 */ define('AUTH_KEY', 'n;Lm;=%|JI)Hbvc{9|i<0tTljZVYbl+$5qCbdcRz0sBvB75E,oI!CS]uT8(Ez ]V'); define('SECURE_AUTH_KEY', 'QlfN+hGe=dXYO-s-|:$>:T2#`Bev)1J6-49+ilC%:YC_Pns:-p|v|R{[UtSA23<2'); define('LOGGED_IN_KEY', '18sA4OI!P&7It;uxN4[mD$Fc-S+*$uM/w:OTV3_*^G+L`dt5Y47y7R`eB+OWA*xO'); define('NONCE_KEY', ')D]kBhLfR&^cI3kW?(A}UK+zp*Ew=Xti2u~sM{2H;-mL3z>+=]+=dp#J]wB0ej9~'); define('AUTH_SALT', 'Kz-h[AVI+N?n^oqw-!(Lg$,^b)XLb0gK16r1:pU|-uS&!BG^lw/TJsK%G;3*EF{v'); define('SECURE_AUTH_SALT', 'Q%||w^8Mc{RxH^* +SLLWg*4-=jpZ|sY`Z@SyS@c^FCr}`f<cRsFjSR9q[z/j*+V'); define('LOGGED_IN_SALT', '-ba{S>O?+:XT,3|AJ/IFY4P)6&+gaCuD<iI8DH%7lzhFS|8^U#uC%ypxn`!qte&_'); define('NONCE_SALT', '`_NL.z_ CKw&YC4iO=Ic`O- VkXX-GdPA%9)#;Sd`IMhGBU0XpQ]!]Jst}3v!K1 '); /**#@-*/ /** * WordPress Datenbanktabellen-Präfix * * Wenn du verschiedene Präfixe benutzt, kannst du innerhalb einer Datenbank * verschiedene WordPress-Installationen betreiben. * Bitte verwende nur Zahlen, Buchstaben und Unterstriche! */ $table_prefix = 'nl_'; /** * Für Entwickler: Der WordPress-Debug-Modus. * * Setze den Wert auf „true“, um bei der Entwicklung Warnungen und Fehler-Meldungen angezeigt zu bekommen. * Plugin- und Theme-Entwicklern wird nachdrücklich empfohlen, WP_DEBUG * in ihrer Entwicklungsumgebung zu verwenden. * * Besuche den Codex, um mehr Informationen über andere Konstanten zu finden, * die zum Debuggen genutzt werden können. * * @link https://codex.wordpress.org/Debugging_in_WordPress */ define('WP_DEBUG', false); /* Das war’s, Schluss mit dem Bearbeiten! Viel Spaß beim Bloggen. */ /* That's all, stop editing! Happy blogging. */ /** Der absolute Pfad zum WordPress-Verzeichnis. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Definiert WordPress-Variablen und fügt Dateien ein. */ require_once(ABSPATH . 'wp-settings.php');
chillinhen/sak-newsletter
wp-config.php
PHP
gpl-2.0
3,865
/** * Definition of SegmentTreeNode: * public class SegmentTreeNode { * public int start, end, count; * public SegmentTreeNode left, right; * public SegmentTreeNode(int start, int end, int count) { * this.start = start; * this.end = end; * this.count = count; * this.left = this.right = null; * } * } */ public class SegmentTreeQueryII { /** *@param root, start, end: The root of segment tree and * an segment / interval *@return: The count number in the interval [start, end] */ public int query(SegmentTreeNode root, int start, int end) { if (root == null || start > end || end < root.start || start > root.end) { return 0; } if (end > root.end) { end = root.end; } if (start < root.start) { start = root.start; } if (root.start == start && root.end == end) { return root.count; } int mid = root.start + (root.end - root.start) / 2; if (end <= mid) { return query(root.left, start, end); } if (start >= mid + 1) { return query(root.right, start, end); } return query(root.left, start, mid) + query(root.right, mid + 1, end); } }
tianlinliu/lintcode
SegmentTreeQueryII.java
Java
gpl-2.0
1,332
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ir.nikagram.messenger.volley.toolbox; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; /** * ByteArrayPool is a source and repository of <code>byte[]</code> objects. Its purpose is to * supply those buffers to consumers who need to use them for a short period of time and then * dispose of them. Simply creating and disposing such buffers in the conventional manner can * considerable heap churn and garbage collection delays on Android, which lacks good management of * short-lived heap objects. It may be advantageous to trade off some memory in the form of a * permanently allocated pool of buffers in order to gain heap performance improvements; that is * what this class does. * <p> * A good candidate user for this class is something like an I/O system that uses large temporary * <code>byte[]</code> buffers to copy data around. In these use cases, often the consumer wants * the buffer to be a certain minimum size to ensure good performance (e.g. when copying data chunks * off of a stream), but doesn't mind if the buffer is larger than the minimum. Taking this into * account and also to maximize the odds of being able to reuse a recycled buffer, this class is * free to return buffers larger than the requested size. The caller needs to be able to gracefully * deal with getting buffers any size over the minimum. * <p> * If there is not a suitably-sized buffer in its recycling pool when a buffer is requested, this * class will allocate a new buffer and return it. * <p> * This class has no special ownership of buffers it creates; the caller is free to take a buffer * it receives from this pool, use it permanently, and never return it to the pool; additionally, * it is not harmful to return to this pool a buffer that was allocated elsewhere, provided there * are no other lingering references to it. * <p> * This class ensures that the total size of the buffers in its recycling pool never exceeds a * certain byte limit. When a buffer is returned that would cause the pool to exceed the limit, * least-recently-used buffers are disposed. */ public class ByteArrayPool { /** The buffer pool, arranged both by last use and by buffer size */ private List<byte[]> mBuffersByLastUse = new LinkedList<byte[]>(); private List<byte[]> mBuffersBySize = new ArrayList<byte[]>(64); /** The total size of the buffers in the pool */ private int mCurrentSize = 0; /** * The maximum aggregate size of the buffers in the pool. Old buffers are discarded to stay * under this limit. */ private final int mSizeLimit; /** Compares buffers by size */ protected static final Comparator<byte[]> BUF_COMPARATOR = new Comparator<byte[]>() { @Override public int compare(byte[] lhs, byte[] rhs) { return lhs.length - rhs.length; } }; /** * @param sizeLimit the maximum size of the pool, in bytes */ public ByteArrayPool(int sizeLimit) { mSizeLimit = sizeLimit; } /** * Returns a buffer from the pool if one is available in the requested size, or allocates a new * one if a pooled one is not available. * * @param len the minimum size, in bytes, of the requested buffer. The returned buffer may be * larger. * @return a byte[] buffer is always returned. */ public synchronized byte[] getBuf(int len) { for (int i = 0; i < mBuffersBySize.size(); i++) { byte[] buf = mBuffersBySize.get(i); if (buf.length >= len) { mCurrentSize -= buf.length; mBuffersBySize.remove(i); mBuffersByLastUse.remove(buf); return buf; } } return new byte[len]; } /** * Returns a buffer to the pool, throwing away old buffers if the pool would exceed its allotted * size. * * @param buf the buffer to return to the pool. */ public synchronized void returnBuf(byte[] buf) { if (buf == null || buf.length > mSizeLimit) { return; } mBuffersByLastUse.add(buf); int pos = Collections.binarySearch(mBuffersBySize, buf, BUF_COMPARATOR); if (pos < 0) { pos = -pos - 1; } mBuffersBySize.add(pos, buf); mCurrentSize += buf.length; trim(); } /** * Removes buffers from the pool until it is under its size limit. */ private synchronized void trim() { while (mCurrentSize > mSizeLimit) { byte[] buf = mBuffersByLastUse.remove(0); mBuffersBySize.remove(buf); mCurrentSize -= buf.length; } } }
amirlotfi/Nikagram
app/src/main/java/ir/nikagram/messenger/volley/toolbox/ByteArrayPool.java
Java
gpl-2.0
5,410
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Slot_Machine.Forms { public partial class HelpWindow : Form { public HelpWindow() { InitializeComponent(); } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } } }
chrispdevelopment/Slot-Machine
Slot Machine/Forms/Help Window.cs
C#
gpl-2.0
470
using System; using Windows.UI; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Media; namespace Rester.Converter { internal class BooleanToGreenOrRedConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { bool result = value is bool && (bool)value; return new SolidColorBrush(result ? Colors.Green : Colors.Red); } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } }
johanclasson/Rester
Rester/Converter/BooleanToGreenOrRedConverter.cs
C#
gpl-2.0
639
/** * Define the IS CurrentSearch Widget. */ (function ($, history) { AjaxSolr.asu_dirSortWidget = AjaxSolr.AbstractWidget.extend({ start: 0, active_sort: null, direction: 'asc', /** * @param {Object} [attributes] * @param {Number} [attributes.start] This widget will by default set the * offset parameter to 0 on each request. */ constructor: function (attributes) { AjaxSolr.asu_dirTreeWidget.__super__.constructor.apply(this, arguments); AjaxSolr.extend(this, { sortItems: [], fieldConfigs: null, defaultSort: null, titleSortField: null, fieldId: null }, attributes); }, init: function () { var self = this; var sort_items = self.sortItems; var fieldConfigs = self.fieldConfigs; var default_sort = self.defaultSort; var titlesort_field = self.titleSortField; //var tsort_placeholder = self.tsort_placeholder; var fieldId = self.fieldId; // set the default sort self.active_sort = default_sort; self.direction = 'asc'; self.manager.store.remove('sort'); if (self.active_sort != titlesort_field) { fieldConfigs.show_managers = false; self.manager.store.addByValue('sort', self.active_sort + ' ' + self.direction); } else { fieldConfigs.show_managers = true; self.manager.store.addByValue('sort', 'lastNameSort asc'); } for (var i = 0; i < sort_items.length; i++) { var name = sort_items[i].field_name; if (fieldConfigs.show_managers || self.active_sort == titlesort_field) { fieldConfigs.show_managers = true; if (name == titlesort_field) { $(sort_items[i].fieldId).addClass('dir-active-sort'); } } else if (name == self.active_sort) { $(sort_items[i].fieldId).append('<i class="dir-sort-icon fa fa-sort-' + self.direction + '"></i>'); $(sort_items[i].fieldId).addClass('dir-active-sort'); } $(sort_items[i].fieldId).click(function (field_name) { // return a click handler, with the name copied to field_name, because we are // in a loop return function () { //save prev sort before assigning new var prev_sort = self.active_sort; // if prevsort and new sort are title rank, return without doing anything. // this is because we don't want to have reverse titlerank sort. if (prev_sort == field_name && field_name == titlesort_field) { return false; } self.active_sort = field_name; //go back to first page if changing sort self.manager.store.remove('start'); //if there was a previous sort, then do some logic to add active classes, etc. //note: there should always be a prev_sort, since we have a default //SPECIAL CASE FOR THE TITLESORT FIELD if (field_name == titlesort_field) { ASUPeople[fieldId].fieldConfigs.show_managers = true; // special case. if we haven't changed placeholder yet, // then return false after doing request, but don't change manager store sort $(self.target).find('.dir-active-sort').removeClass('dir-active-sort'); $(this).addClass('dir-active-sort'); self.manager.store.remove('sort'); self.manager.store.addByValue('sort', 'lastNameSort asc'); self.manager.doRequest(); return false; } else { ASUPeople[fieldId].fieldConfigs.show_managers = false; } //special logic for ranksort, otherwise switch asc/desc /*if (field_name == titleSortField) { var target = $(self.target).find('.dir-active-sort'); target.removeClass('dir-active-sort'); $(this).addClass('dir-active-sort'); self.direction = 'asc'; } else*/ if (field_name == prev_sort) { if (self.direction == 'asc') { self.direction = 'desc'; } else { self.direction = 'asc'; } } else { var t2 = $(self.target).find('.dir-active-sort');//.removeClass('dir-active-sort'); t2.removeClass('dir-active-sort'); $(this).addClass('dir-active-sort'); self.direction = 'asc'; } var new_sort = self.active_sort + ' ' + self.direction; if (self.active_sort == titlesort_field) { new_sort += ',lastNameSort asc'; } self.manager.store.remove('sort'); self.manager.store.addByValue('sort', new_sort); self.manager.doRequest(); $(this).find('.fa').remove(); if (field_name != titlesort_field) { $(this).append('<i class="dir-sort-icon fa fa-sort-' + self.direction + '"></i>'); } } }(name)); } } }); })(jQuery, window.History);
jrounsav/webspark-drops-drupal7
profiles/openasu/modules/custom/asu_dirs/asu_dir/js/widgets/asu_dirSortWidget.js
JavaScript
gpl-2.0
6,259
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: Stormwind_City SD%Complete: 100 SDComment: Quest support: 1640, 1447, 4185, 11223 (DB support required for spell 42711). Receive emote General Marcus SDCategory: Stormwind City EndScriptData */ /* ContentData npc_archmage_malin npc_bartleby npc_dashel_stonefist npc_general_marcus_jonathan npc_lady_katrana_prestor EndContentData */ #include "precompiled.h" #include "WorldPacket.h" /*###### ## npc_archmage_malin ######*/ #define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." bool GossipHello_npc_archmage_malin(Player *player, Creature *_Creature) { if(_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); if(player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(11223)) player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); return true; } bool GossipSelect_npc_archmage_malin(Player *player, Creature *_Creature, uint32 sender, uint32 action) { if(action = GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); _Creature->CastSpell(player, 42711, true); } return true; } /*###### ## npc_bartleby ######*/ struct MANGOS_DLL_DECL npc_bartlebyAI : public ScriptedAI { npc_bartlebyAI(Creature *c) : ScriptedAI(c) {Reset();} uint64 PlayerGUID; void Reset() { m_creature->setFaction(11); m_creature->setEmoteState(7); PlayerGUID = 0; } void JustDied(Unit *who) { m_creature->setFaction(11); } void DamageTaken(Unit *done_by, uint32 & damage) { if(damage > m_creature->GetHealth() || ((m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)) { //Take 0 damage damage = 0; if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID) { ((Player*)done_by)->AttackStop(); ((Player*)done_by)->AreaExploredOrEventHappens(1640); } m_creature->CombatStop(); EnterEvadeMode(); } } void Aggro(Unit *who) {} }; bool QuestAccept_npc_bartleby(Player *player, Creature *_Creature, Quest const *_Quest) { if(_Quest->GetQuestId() == 1640) { _Creature->setFaction(168); ((npc_bartlebyAI*)_Creature->AI())->PlayerGUID = player->GetGUID(); ((npc_bartlebyAI*)_Creature->AI())->AttackStart(player); } return true; } CreatureAI* GetAI_npc_bartleby(Creature *_creature) { return new npc_bartlebyAI(_creature); } /*###### ## npc_dashel_stonefist ######*/ struct MANGOS_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI { npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {Reset();} void Reset() { m_creature->setFaction(11); m_creature->setEmoteState(7); } void DamageTaken(Unit *done_by, uint32 & damage) { if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15) { //Take 0 damage damage = 0; if (done_by->GetTypeId() == TYPEID_PLAYER) { ((Player*)done_by)->AttackStop(); ((Player*)done_by)->AreaExploredOrEventHappens(1447); } //m_creature->CombatStop(); EnterEvadeMode(); } AttackedBy(done_by); } void Aggro(Unit *who) {} }; bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest) { if(_Quest->GetQuestId() == 1447) { _Creature->setFaction(168); ((npc_dashel_stonefistAI*)_Creature->AI())->AttackStart(player); } return true; } CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature) { return new npc_dashel_stonefistAI(_creature); } /*###### ## npc_general_marcus_jonathan ######*/ #define SAY_GREETING -1000208 bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote) { if(player->GetTeam() == ALLIANCE) { if (emote == TEXTEMOTE_SALUTE) { _Creature->SetOrientation(_Creature->GetAngle(player)); _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); } if (emote == TEXTEMOTE_WAVE) { DoScriptText(SAY_GREETING, _Creature, player); } } return true; } /*###### ## npc_lady_katrana_prestor ######*/ #define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." #define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." #define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." #define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." bool GossipHello_npc_lady_katrana_prestor(Player *player, Creature *_Creature) { if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(2693, _Creature->GetGUID()); return true; } bool GossipSelect_npc_lady_katrana_prestor(Player *player, Creature *_Creature, uint32 sender, uint32 action) { switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(2694, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); player->SEND_GOSSIP_MENU(2695, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+2: player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); player->SEND_GOSSIP_MENU(2696, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+3: player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(4185); break; } return true; } /*###### ## npc_harbor_taxi ######*/ #define GOSSIP_STORMWIND "I'd like to take a flight around Stormwind Harbor." bool GossipHello_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature) { player->SetTaxiCheater(true); player->ADD_GOSSIP_ITEM(0, GOSSIP_STORMWIND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); player->SEND_GOSSIP_MENU(13454,_Creature->GetGUID()); return true; } bool GossipSelect_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { if (action == GOSSIP_ACTION_INFO_DEF + 10) { player->GetSession()->SendDoFlight(1149, 1041); } return true; } void AddSC_stormwind_city() { Script *newscript; newscript = new Script; newscript->Name = "npc_archmage_malin"; newscript->pGossipHello = &GossipHello_npc_archmage_malin; newscript->pGossipSelect = &GossipSelect_npc_archmage_malin; newscript->RegisterSelf(); newscript = new Script; newscript->Name = "npc_bartleby"; newscript->GetAI = &GetAI_npc_bartleby; newscript->pQuestAccept = &QuestAccept_npc_bartleby; newscript->RegisterSelf(); newscript = new Script; newscript->Name = "npc_dashel_stonefist"; newscript->GetAI = &GetAI_npc_dashel_stonefist; newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist; newscript->RegisterSelf(); newscript = new Script; newscript->Name = "npc_general_marcus_jonathan"; newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan; newscript->RegisterSelf(); newscript = new Script; newscript->Name = "npc_lady_katrana_prestor"; newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor; newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor; newscript->RegisterSelf(); newscript = new Script; newscript->Name="npc_stormwind_harbor_taxi"; newscript->pGossipHello = &GossipHello_npc_stormwind_harbor_taxi; newscript->pGossipSelect = &GossipSelect_npc_stormwind_harbor_taxi; newscript->RegisterSelf(); }
fanatix/fanatix-core
src/bindings/ScriptDev2/scripts/zone/stormwind/stormwind_city.cpp
C++
gpl-2.0
9,286
/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <functional> #include "ItemEnchantmentMgr.h" #include "DatabaseEnv.h" #include "Log.h" #include "ObjectMgr.h" #include <list> #include <vector> #include "Util.h" struct EnchStoreItem { uint32 ench; float chance; EnchStoreItem() : ench(0), chance(0) {} EnchStoreItem(uint32 _ench, float _chance) : ench(_ench), chance(_chance) {} }; typedef std::vector<EnchStoreItem> EnchStoreList; typedef std::unordered_map<uint32, EnchStoreList> EnchantmentStore; static EnchantmentStore RandomItemEnch; void LoadRandomEnchantmentsTable() { uint32 oldMSTime = getMSTime(); RandomItemEnch.clear(); // for reload case // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template"); if (result) { uint32 count = 0; do { Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); uint32 ench = fields[1].GetUInt32(); float chance = fields[2].GetFloat(); if (chance > 0.000001f && chance <= 100.0f) RandomItemEnch[entry].push_back(EnchStoreItem(ench, chance)); ++count; } while (result->NextRow()); sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } else { sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); sLog->outString(); } } uint32 GetItemEnchantMod(int32 entry) { if (!entry) return 0; if (entry == -1) return 0; EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry); if (tab == RandomItemEnch.end()) { sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry); return 0; } double dRoll = rand_chance(); float fCount = 0; for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter) { fCount += ench_iter->chance; if (fCount > dRoll) return ench_iter->ench; } //we could get here only if sum of all enchantment chances is lower than 100% dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; fCount = 0; for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter) { fCount += ench_iter->chance; if (fCount > dRoll) return ench_iter->ench; } return 0; } uint32 GenerateEnchSuffixFactor(uint32 item_id) { ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id); if (!itemProto) return 0; if (!itemProto->RandomSuffix) return 0; RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel); if (!randomProperty) return 0; uint32 suffixFactor; switch (itemProto->InventoryType) { // Items of that type don`t have points case INVTYPE_NON_EQUIP: case INVTYPE_BAG: case INVTYPE_TABARD: case INVTYPE_AMMO: case INVTYPE_QUIVER: case INVTYPE_RELIC: return 0; // Select point coefficient case INVTYPE_HEAD: case INVTYPE_BODY: case INVTYPE_CHEST: case INVTYPE_LEGS: case INVTYPE_2HWEAPON: case INVTYPE_ROBE: suffixFactor = 0; break; case INVTYPE_SHOULDERS: case INVTYPE_WAIST: case INVTYPE_FEET: case INVTYPE_HANDS: case INVTYPE_TRINKET: suffixFactor = 1; break; case INVTYPE_NECK: case INVTYPE_WRISTS: case INVTYPE_FINGER: case INVTYPE_SHIELD: case INVTYPE_CLOAK: case INVTYPE_HOLDABLE: suffixFactor = 2; break; case INVTYPE_WEAPON: case INVTYPE_WEAPONMAINHAND: case INVTYPE_WEAPONOFFHAND: suffixFactor = 3; break; case INVTYPE_RANGED: case INVTYPE_THROWN: case INVTYPE_RANGEDRIGHT: suffixFactor = 4; break; default: return 0; } // Select rare/epic modifier switch (itemProto->Quality) { case ITEM_QUALITY_UNCOMMON: return randomProperty->UncommonPropertiesPoints[suffixFactor]; case ITEM_QUALITY_RARE: return randomProperty->RarePropertiesPoints[suffixFactor]; case ITEM_QUALITY_EPIC: return randomProperty->EpicPropertiesPoints[suffixFactor]; case ITEM_QUALITY_LEGENDARY: case ITEM_QUALITY_ARTIFACT: return 0; // not have random properties default: break; } return 0; }
GiR-Zippo/Strawberry335
src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
C++
gpl-2.0
5,882
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Ch14Ex02")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Ch14Ex02")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f5934281-9422-4cb0-80dc-90415a1dd5a0")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
ktjones/BVCS2012
_Source/Chapter14Code/Ch14Ex02/Properties/AssemblyInfo.cs
C#
gpl-2.0
1,392
package main import ( "flag" "log" "syscall" ) var maxConnections = flag.Int("max_connections", getRlimitMax(syscall.RLIMIT_NOFILE), "The maximum number of incoming connections allowed.") func getRlimitMax(resource int) int { var rlimit syscall.Rlimit if err := syscall.Getrlimit(resource, &rlimit); err != nil { return 0 } return int(rlimit.Max) } func setRlimit(resource, value int) { rlimit := &syscall.Rlimit{Cur: uint64(value), Max: uint64(value)} err := syscall.Setrlimit(resource, rlimit) if err != nil { log.Fatalln("Error Setting Rlimit ", err) } } func setRlimitFromFlags() { setRlimit(syscall.RLIMIT_NOFILE, *maxConnections) }
die-net/http-tarpit
rlimit.go
GO
gpl-2.0
662
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3- // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2011.04.29 at 01:38:32 PM MESZ // @javax.xml.bind.annotation.XmlSchema(namespace = "http://ch/mitoco/store/generated", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package ch.mitoco.store.generated;
steffe/MT4J_KTSI
ktsi/ch/mitoco/store/generated/package-info.java
Java
gpl-2.0
556
/* This file is part of KOrganizer. Copyright (c) 1998 Preston Brown <pbrown@kde.org> Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include "searchdialog.h" #include "ui_searchdialog_base.h" #include "calendarview.h" #include "koglobals.h" #include <calendarsupport/kcalprefs.h> #include <calendarsupport/utils.h> #include <calendarviews/list/listview.h> #include <KMessageBox> using namespace KOrg; SearchDialog::SearchDialog( CalendarView *calendarview ) : KDialog( calendarview ), m_ui( new Ui::SearchDialog ), m_calendarview( calendarview ) { setCaption( i18n( "Search Calendar" ) ); setModal( false ); QWidget *mainWidget = new QWidget( this ); m_ui->setupUi( mainWidget ); setMainWidget( mainWidget ); // Set nice initial start and end dates for the search const QDate currDate = QDate::currentDate(); m_ui->startDate->setDate( currDate ); m_ui->endDate->setDate( currDate.addYears( 1 ) ); connect( m_ui->searchEdit, SIGNAL(textChanged(QString)), this, SLOT(searchTextChanged(QString)) ); // Results list view QVBoxLayout *layout = new QVBoxLayout; layout->setMargin( 0 ); listView = new EventViews::ListView( m_calendarview->calendar(), this ); layout->addWidget( listView ); m_ui->listViewFrame->setLayout( layout ); connect( this, SIGNAL(user1Clicked()), SLOT(doSearch()) ); // Propagate edit and delete event signals from event list view connect( listView, SIGNAL(showIncidenceSignal(Akonadi::Item)), SIGNAL(showIncidenceSignal(Akonadi::Item)) ); connect( listView, SIGNAL(editIncidenceSignal(Akonadi::Item)), SIGNAL(editIncidenceSignal(Akonadi::Item)) ); connect( listView, SIGNAL(deleteIncidenceSignal(Akonadi::Item)), SIGNAL(deleteIncidenceSignal(Akonadi::Item)) ); readConfig(); setButtons( User1 | Cancel ); setDefaultButton( User1 ); setButtonGuiItem( User1, KGuiItem( i18nc( "search in calendar", "&Search" ), QLatin1String( "edit-find" ) ) ); setButtonToolTip( User1, i18n( "Start searching" ) ); showButtonSeparator( false ); } SearchDialog::~SearchDialog() { writeConfig(); } void SearchDialog::showEvent( QShowEvent *event ) { Q_UNUSED( event ); m_ui->searchEdit->setFocus(); } void SearchDialog::searchTextChanged( const QString &_text ) { enableButton( KDialog::User1, !_text.isEmpty() ); } void SearchDialog::doSearch() { QRegExp re; re.setPatternSyntax( QRegExp::Wildcard ); // most people understand these better. re.setCaseSensitivity( Qt::CaseInsensitive ); re.setPattern( m_ui->searchEdit->text() ); if ( !re.isValid() ) { KMessageBox::sorry( this, i18n( "Invalid search expression, cannot perform the search. " "Please enter a search expression using the wildcard characters " "'*' and '?' where needed." ) ); return; } search( re ); listView->showIncidences( mMatchedEvents, QDate() ); if ( mMatchedEvents.isEmpty() ) { m_ui->numItems->setText ( QString() ); KMessageBox::information( this, i18n( "No items were found that match your search pattern." ), i18n( "Search Results" ), QLatin1String( "NoSearchResults" ) ); } else { m_ui->numItems->setText( i18np( "%1 item","%1 items", mMatchedEvents.count() ) ); } } void SearchDialog::updateView() { QRegExp re; re.setPatternSyntax( QRegExp::Wildcard ); // most people understand these better. re.setCaseSensitivity( Qt::CaseInsensitive ); re.setPattern( m_ui->searchEdit->text() ); if ( re.isValid() ) { search( re ); } else { mMatchedEvents.clear(); } listView->showIncidences( mMatchedEvents, QDate() ); } void SearchDialog::search( const QRegExp &re ) { const QDate startDt = m_ui->startDate->date(); const QDate endDt = m_ui->endDate->date(); KCalCore::Event::List events; KDateTime::Spec timeSpec = CalendarSupport::KCalPrefs::instance()->timeSpec(); if ( m_ui->eventsCheck->isChecked() ) { events = m_calendarview->calendar()->events( startDt, endDt, timeSpec, m_ui->inclusiveCheck->isChecked() ); } KCalCore::Todo::List todos; if ( m_ui->todosCheck->isChecked() ) { if ( m_ui->includeUndatedTodos->isChecked() ) { KDateTime::Spec spec = CalendarSupport::KCalPrefs::instance()->timeSpec(); KCalCore::Todo::List alltodos = m_calendarview->calendar()->todos(); Q_FOREACH ( const KCalCore::Todo::Ptr &todo, alltodos ) { Q_ASSERT( todo ); if ( ( !todo->hasStartDate() && !todo->hasDueDate() ) || // undated ( todo->hasStartDate() && ( todo->dtStart().toTimeSpec( spec ).date() >= startDt ) && ( todo->dtStart().toTimeSpec( spec ).date() <= endDt ) ) || //start dt in range ( todo->hasDueDate() && ( todo->dtDue().toTimeSpec( spec ).date() >= startDt ) && ( todo->dtDue().toTimeSpec( spec ).date() <= endDt ) ) || //due dt in range ( todo->hasCompletedDate() && ( todo->completed().toTimeSpec( spec ).date() >= startDt ) && ( todo->completed().toTimeSpec( spec ).date() <= endDt ) ) ) {//completed dt in range todos.append( todo ); } } } else { QDate dt = startDt; while ( dt <= endDt ) { todos += m_calendarview->calendar()->todos( dt ); dt = dt.addDays( 1 ); } } } KCalCore::Journal::List journals; if ( m_ui->journalsCheck->isChecked() ) { QDate dt = startDt; while ( dt <= endDt ) { journals += m_calendarview->calendar()->journals( dt ); dt = dt.addDays( 1 ); } } mMatchedEvents.clear(); KCalCore::Incidence::List incidences = Akonadi::ETMCalendar::mergeIncidenceList( events, todos, journals ); Q_FOREACH ( const KCalCore::Incidence::Ptr &ev, incidences ) { Q_ASSERT( ev ); Akonadi::Item item = m_calendarview->calendar()->item( ev->uid() ); if ( m_ui->summaryCheck->isChecked() ) { if ( re.indexIn( ev->summary() ) != -1 ) { mMatchedEvents.append( item ); continue; } } if ( m_ui->descriptionCheck->isChecked() ) { if ( re.indexIn( ev->description() ) != -1 ) { mMatchedEvents.append( item ); continue; } } if ( m_ui->categoryCheck->isChecked() ) { if ( re.indexIn( ev->categoriesStr() ) != -1 ) { mMatchedEvents.append( item ); continue; } } if ( m_ui->locationCheck->isChecked() ) { if ( re.indexIn( ev->location() ) != -1 ) { mMatchedEvents.append( item ); continue; } } if ( m_ui->attendeeCheck->isChecked() ) { Q_FOREACH ( const KCalCore::Attendee::Ptr &attendee, ev->attendees() ) { if ( re.indexIn( attendee->fullName() ) != -1 ) { mMatchedEvents.append( item ); break; } } } } } void SearchDialog::readConfig() { KConfigGroup group( KOGlobals::self()->config(), QLatin1String( "SearchDialog" ) ); const QSize size = group.readEntry( "Size", QSize( 775, 600 ) ); if ( size.isValid() ) { resize( size ); } } void SearchDialog::writeConfig() { KConfigGroup group( KOGlobals::self()->config(), QLatin1String( "SearchDialog" ) ); group.writeEntry( "Size", size() ); group.sync(); }
kolab-groupware/kdepim
korganizer/searchdialog.cpp
C++
gpl-2.0
8,329
/* * PNEDSkyboxPanel.cpp * * Description : * PNEDSkyboxPanel definition * * Copyright (C) 2005 PAVILLON-NOIR TEAM, http://pavillon-noir.org * This software has been written in EPITECH <http://www.epitech.net> * EPITECH is computer science school in Paris - FRANCE - * under the direction of flav <http://www.epita.fr/~flav>. * and Jerome Landrieu. * * This file is part of Pavillon Noir. * * Pavillon Noir is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * Pavillon Noir is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along with * Pavillon Noir; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include <fxkeys.h> #ifdef WIN32 # include <direct.h> #else # include <unistd.h> #endif #include <iostream> #include <libxml/xmlreader.h> ///////////////////////////////////// #include "pndefs.h" #include "pnresources.h" #include "pnxml.h" ///////////////////////////////////// #include "pneditorcommon.hpp" ///////////////////////////////////// #include "PNEditor.hpp" #include "PNEDSkyboxPanel.hpp" namespace PN { namespace EDITOR { ////////////////////////////////////////////////////////////////////////// // Map /*FXDEFMAP(PNEDSkyboxPanel) PNEDSkyboxPanelMap[]={ FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_LISTBOX_SEL,PNEDSkyboxPanel::onCmdListBox), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADD,PNEDSkyboxPanel::onCmdAdd), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_DELETE,PNEDSkyboxPanel::onCmdDelete), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_SAVE,PNEDSkyboxPanel::onCmdSave), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_RESET,PNEDSkyboxPanel::onCmdReset), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADDWP,PNEDSkyboxPanel::onAccept), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_CANCEL,PNEDSkyboxPanel::onCancel), FXMAPFUNC(SEL_COMMAND,PNEDSkyboxPanel::ID_ADDOBJECT,PNEDSkyboxPanel::onAddObject) };*/ ////////////////////////////////////////////////////////////////////////// //FXIMPLEMENT(PNEDSkyboxPanel, FXVerticalFrame, PNEDSkyboxPanelMap, ARRAYNUMBER(PNEDSkyboxPanelMap)) FXIMPLEMENT(PNEDSkyboxPanel, FXVerticalFrame, NULL, 0) PNEDSkyboxPanel::PNEDSkyboxPanel(FXComposite* p, EDITOR::PNEditor* ed) : FXVerticalFrame(p, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_Y | LAYOUT_CENTER_X | LAYOUT_TOP | LAYOUT_LEFT, 0, 0, 0, 0, 10, 10, 10, 10) { _ed = ed; _grid = new PNPropertiesGrid(this); } PNEDSkyboxPanel::~PNEDSkyboxPanel() { } // fox /////////////////////////////////////////////////////////////////// void PNEDSkyboxPanel::create() { FXComposite::create(); _grid->create(); } // object manipulation //////////////////////////////////////////////////////////////////////// void PNEDSkyboxPanel::setObject(PNConfigurableObject* object) { _grid->setObject(object); } PNConfigurableObject* PNEDSkyboxPanel::getObject() { return _grid->getObject(); } // update //////////////////////////////////////////////////////////////// void PNEDSkyboxPanel::update() { updateGrid(); updateView(); } ////////////////////////////////////////////////////////////////////////// void PNEDSkyboxPanel::updateGrid() { _grid->update(); } void PNEDSkyboxPanel::updateView() { _ed->redraw(); } ////////////////////////////////////////////////////////////////////////// };};
pngames/pavillon-noir
pavillonnoir/__src/pneditor/PNEDSkyboxPanel.cpp
C++
gpl-2.0
3,760
<?php // namespace com\won\web; class com_won_weather_Yahoo { private $data; private $yweather = 'http://xml.weather.yahoo.com/ns/rss/1.0'; private $geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'; public function __construct($woeid){ $url = 'http://weather.yahooapis.com/forecastrss?w=' . $woeid; $rss = simplexml_load_file($url); $this->data = $rss; } public function getData(){ return (string)$this->data->channel->item->description; } public function getTemp($unit='f'){ $s = $this->data->channel->item->children($this->yweather); $t = $s->condition->attributes()->temp; return $unit=='f'? $t : $this->ftoc($t); } public function getText(){ $s = $this->data->channel->item->children($this->yweather); return $s->condition->attributes()->text; } private function ctof($c){ return round($c * (9/5) + 32); } private function ftoc($f){ return round(($f - 32) * (5/9)); } } ?>
wonsong82/wonframework
system/com.won/weather/Yahoo.php
PHP
gpl-2.0
941
#include <iostream> using namespace std; int BinarySearch(int *a, int length, int key) { int left = 0, right = length - 1, mid = (right - left) / 2 + left; while (left <= right) { if (a[mid] < key) left = mid + 1; else if (a[mid] > key) right = mid - 1; else return mid; mid = (right - left) / 2 + left; } return -1; } int main() { int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 10}; cout << "Result is :" << BinarySearch(a, sizeof(a) / sizeof(int), 1) << endl; return 0; }
thinkermao/Demo
ACM/CodeLibrary/BinarySearch.cpp
C++
gpl-2.0
515
namespace Server.Mobiles { [CorpseName( "a sewer rat corpse" )] public class Sewerrat : BaseCreature { [Constructable] public Sewerrat() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 ) { Name = "a sewer rat"; Body = 238; BaseSoundID = 0xCC; SetStr( 9 ); SetDex( 25 ); SetInt( 6, 10 ); SetHits( 6 ); SetMana( 0 ); SetDamage( 1, 2 ); SetDamageType( ResistanceType.Physical, 100 ); SetResistance( ResistanceType.Physical, 5, 10 ); SetResistance( ResistanceType.Poison, 15, 25 ); SetResistance( ResistanceType.Energy, 5, 10 ); SetSkill( SkillName.MagicResist, 5.0 ); SetSkill( SkillName.Tactics, 5.0 ); SetSkill( SkillName.Wrestling, 5.0 ); Fame = 300; Karma = -300; VirtualArmor = 6; Tamable = true; ControlSlots = 1; MinTameSkill = -0.9; } public override void GenerateLoot() { AddLoot( LootPack.Poor ); } public override int Meat{ get{ return 1; } } public override FoodType FavoriteFood{ get{ return FoodType.Meat | FoodType.Eggs | FoodType.FruitsAndVegies; } } public Sewerrat(Serial serial) : base(serial) { } public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write((int) 0); } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); } } }
felladrin/last-wish
Scripts/Mobiles/Animals/Rodents/SewerRat.cs
C#
gpl-2.0
1,457
from django.apps import AppConfig from threading import Timer import sys class TelegramBotConfig(AppConfig): name = 'telegrambot' verbose_name = "Telegram Bot" def ready(self): from django.conf import settings if 'runserver' in sys.argv: from telegrambot.wrapper import Bot b = Bot(settings.TELEGRAM_BOT_TOKEN) if not settings.TELEGRAM_USE_WEBHOOK: b.post('setWebhook',{'url':''}) print("Telegram WebHook Disabled") Timer(10,b.getUpdates).start() if settings.TELEGRAM_USE_WEBHOOK: from telegrambot.wrapper import Bot b = Bot(settings.TELEGRAM_BOT_TOKEN) b.setWebhook() import telegrambot.signals import telegrambot.connectors
meska/telegrambot
apps.py
Python
gpl-2.0
853
<?php /** * @package hubzero-cms * @copyright Copyright (c) 2005-2020 The Regents of the University of California. * @license http://opensource.org/licenses/MIT MIT */ // No direct access defined('_HZEXEC_') or die(); /** * GeoIPs plugin for geocode * * The GeoIPsProvider named geo_ips is able to geocode * IPv4 addresses only. A valid api key is required. */ class plgGeocodeGeoips extends \Hubzero\Plugin\Plugin { /** * Return a geocode provider * * @param string $context * @param object $adapter * @param boolean $ip * @return object */ public function onGeocodeProvider($context, $adapter, $ip=false) { if ($context != 'geocode.locate') { return; } if (!$this->params->get('apiKey') || !$ip) { return; } return new \Geocoder\Provider\GeoIPsProvider( $adapter, $this->params->get('apiKey') ); } }
hubzero/hubzero-cms
core/plugins/geocode/geoips/geoips.php
PHP
gpl-2.0
873
package evochecker.genetic.jmetal.metaheuristics.single; import java.util.HashMap; import evochecker.auxiliary.Utility; import evochecker.evaluator.MultiProcessModelEvaluator; import evochecker.genetic.jmetal.operators.CrossoverFactory; import evochecker.genetic.jmetal.operators.MutationFactory; import evochecker.genetic.problem.GeneticProblemSingle; import jmetal.core.Algorithm; import jmetal.core.Problem; import jmetal.experiments.Settings; //import jmetal.metaheuristics.singleObjective.geneticAlgorithm.pgGA; import jmetal.operators.crossover.Crossover; import jmetal.operators.mutation.Mutation; import jmetal.operators.selection.Selection; import jmetal.operators.selection.SelectionFactory; import jmetal.util.JMException; public class SingleGA_Settings extends Settings{ public int populationSize_; public int maxEvaluations_; public double realCrossoverProbability_; public double intCrossoverProbability_; public double realMutationProbability_; public double intMutationProbability_; public double distributionIndex_; /** * Constructor */ public SingleGA_Settings (String problemName, Problem problem){ super(problemName); problem_ = problem; // Default experiments.settings populationSize_ = Integer.parseInt(Utility.getProperty("POPULATION_SIZE", "100")); maxEvaluations_ = Integer.parseInt(Utility.getProperty("MAX_EVALUATIONS", "100")); realCrossoverProbability_ = 0.9; intCrossoverProbability_ = 0.9;//0.5; realMutationProbability_ = 1.0 / ((GeneticProblemSingle)problem_).getNumOfRealVariables();// 0.4; intMutationProbability_ = 1.0 / ((GeneticProblemSingle)problem_).getNumOfIntVariables();//0.4; distributionIndex_ = 20; } // SingleGA_Settings /** * Configure Single_GA with default parameter experiments.settings * * @return A Single_GA algorithm object * @throws jmetal.util.JMException */ @Override public Algorithm configure() throws JMException { Algorithm algorithm; Selection selection; Crossover crossover; Mutation mutation; HashMap<String, Double> parameters; // Operator parameters //Create algorithm and parallel objects MultiProcessModelEvaluator evaluator = new MultiProcessModelEvaluator(); algorithm = new pgGA(problem_, evaluator); //pNSGAII(problem_, evaluator); // Algorithm parameters algorithm.setInputParameter("populationSize", populationSize_); algorithm.setInputParameter("maxEvaluations", maxEvaluations_); // Mutation and Crossover for Real codification parameters = new HashMap<String, Double>(); parameters.put("realCrossoverProbability", this.realCrossoverProbability_); parameters.put("intCrossoverProbability", this.intCrossoverProbability_); parameters.put("distributionIndex", this.distributionIndex_); crossover = CrossoverFactory.getCrossoverOperator("SBXSinglePointCrossover", parameters); parameters = new HashMap<String, Double>(); parameters.put("realMutationProbability", this.realMutationProbability_); parameters.put("intMutationProbability", this.intMutationProbability_); parameters.put("distributionIndex", this.distributionIndex_); mutation = MutationFactory.getMutationOperator("PolynomialUniformMutation", parameters); // Add the operators to the algorithm algorithm.addOperator("crossover", crossover); algorithm.addOperator("mutation", mutation); // Selection Operator parameters = null; selection = SelectionFactory.getSelectionOperator("BinaryTournament",parameters); algorithm.addOperator("selection", selection); return algorithm; } // configure }
gerasimou/EvoChecker
src/main/java/evochecker/genetic/jmetal/metaheuristics/single/SingleGA_Settings.java
Java
gpl-2.0
3,573
<?php /** Spanish (español) * * See MessagesQqq.php for message documentation incl. usage of parameters * To improve a translation please visit http://translatewiki.net * * @ingroup Language * @file * * @author -jem- * @author Aleator * @author Alhen * @author Alpertron * @author Alvaro qc * @author Amire80 * @author Armando-Martin * @author Ascánder * @author Baiji * @author Bea.miau * @author Benfutbol10 * @author Bengoa * @author Bernardom * @author Better * @author BicScope * @author Boivie * @author Candalua * @author Capmo * @author Carlitosag * @author Cerealito * @author Ciencia Al Poder * @author Clerc * @author Crazymadlover * @author Cvmontuy * @author Dalton2 * @author Danke7 * @author David0811 * @author Dferg * @author Diego Grez * @author Dmcdevit * @author Drini * @author Dvortygirl * @author Fibonacci * @author Fitoschido * @author Fluence * @author Fortega * @author Geitost * @author Gustronico * @author Gwickwire * @author Hahc21 * @author Hazard-SJ * @author Hercule * @author Icvav * @author Ihojose * @author Imre * @author Invadinado * @author Jatrobat * @author Jens Liebenau * @author Jewbask * @author Jurock * @author Kaganer * @author Larjona * @author Lin linao * @author Linterweb * @author Locos epraix * @author Luckas * @author Luis Felipe Schenone * @author Mahadeva * @author Manuelt15 * @author Maor X * @author MarcoAurelio * @author McDutchie * @author Miguel2706 * @author Muro de Aguas * @author Omnipaedista * @author Orgullomoore * @author Ovruni * @author Paucabot * @author Penarc * @author PerroVerd * @author Pertile * @author Peter Bowman * @author Pginer * @author Piolinfax * @author Platonides * @author PoLuX124 * @author QuimGil * @author Ralgis * @author Remember the dot * @author Remux * @author Richard Wolf VI * @author Salvador alc * @author Sanbec * @author Savh * @author Sethladan * @author Shirayuki * @author Spacebirdy * @author Stephensuleeman * @author Technorum * @author The Evil IP address * @author TheBITLINK * @author Titoxd * @author Toniher * @author Translationista * @author Urhixidur * @author VegaDark * @author Vivaelcelta * @author Waldir * @author Wilfredor * @author XalD * @author XanaG * @author לערי ריינהארט */ $namespaceNames = array( NS_MEDIA => 'Medio', NS_SPECIAL => 'Especial', NS_TALK => 'Discusión', NS_USER => 'Usuario', NS_USER_TALK => 'Usuario_discusión', NS_PROJECT_TALK => '$1_discusión', NS_FILE => 'Archivo', NS_FILE_TALK => 'Archivo_discusión', NS_MEDIAWIKI => 'MediaWiki', NS_MEDIAWIKI_TALK => 'MediaWiki_discusión', NS_TEMPLATE => 'Plantilla', NS_TEMPLATE_TALK => 'Plantilla_discusión', NS_HELP => 'Ayuda', NS_HELP_TALK => 'Ayuda_discusión', NS_CATEGORY => 'Categoría', NS_CATEGORY_TALK => 'Categoría_discusión', ); $namespaceAliases = array( 'Imagen' => NS_FILE, 'Imagen_Discusión' => NS_FILE_TALK, ); $namespaceGenderAliases = array( NS_USER => array( 'male' => 'Usuario', 'female' => 'Usuaria' ), NS_USER_TALK => array( 'male' => 'Usuario_Discusión', 'female' => 'Usuaria_Discusión' ), ); $specialPageAliases = array( 'Activeusers' => array( 'UsuariosActivos' ), 'Allmessages' => array( 'TodosLosMensajes' ), 'AllMyUploads' => array( 'TodasMisSubidas', 'TodosMisArchivos' ), 'Allpages' => array( 'Todas', 'Todas_las_páginas' ), 'Ancientpages' => array( 'PáginasAntiguas', 'Páginas_antiguas' ), 'Badtitle' => array( 'Título_incorrecto' ), 'Blankpage' => array( 'PáginaEnBlanco', 'BlanquearPágina', 'Blanquear_página', 'Página_en_blanco' ), 'Block' => array( 'Bloquear' ), 'Booksources' => array( 'FuentesDeLibros', 'Fuentes_de_libros' ), 'BrokenRedirects' => array( 'RedireccionesRotas', 'Redirecciones_rotas' ), 'Categories' => array( 'Categorías' ), 'ChangeEmail' => array( 'Cambiar_correo_electrónico', 'CambiarEmail', 'CambiarCorreo' ), 'ChangePassword' => array( 'Cambiar_contraseña', 'CambiarContraseña', 'ResetearContraseña', 'Resetear_contraseña' ), 'ComparePages' => array( 'Comparar_páginas', 'CompararPáginas' ), 'Confirmemail' => array( 'Confirmar_correo_electrónico', 'ConfirmarEmail' ), 'Contributions' => array( 'Contribuciones' ), 'CreateAccount' => array( 'Crear_una_cuenta', 'CrearCuenta' ), 'Deadendpages' => array( 'PáginasSinSalida', 'Páginas_sin_salida' ), 'DeletedContributions' => array( 'ContribucionesBorradas', 'Contribuciones_Borradas' ), 'DoubleRedirects' => array( 'RedireccionesDobles', 'Redirecciones_dobles' ), 'EditWatchlist' => array( 'EditarSeguimiento' ), 'Emailuser' => array( 'Enviar_correo_electrónico', 'MandarEmailUsuario' ), 'ExpandTemplates' => array( 'Sustituir_plantillas', 'Sustituidor_de_plantillas', 'Expandir_plantillas' ), 'Export' => array( 'Exportar' ), 'Fewestrevisions' => array( 'MenosEdiciones', 'Menos_ediciones' ), 'FileDuplicateSearch' => array( 'BuscarArchivosDuplicados', 'Buscar_archivos_duplicados' ), 'Filepath' => array( 'RutaDeArchivo', 'Ruta_de_archivo' ), 'Import' => array( 'Importar' ), 'Invalidateemail' => array( 'InvalidarEmail', 'Invalidar_correo_electrónico' ), 'BlockList' => array( 'UsuariosBloqueados', 'Lista_de_usuarios_bloqueados' ), 'LinkSearch' => array( 'BúsquedaDeEnlaces', 'Búsqueda_de_enlaces' ), 'Listadmins' => array( 'ListaDeAdministradores', 'Lista_de_administradores' ), 'Listbots' => array( 'ListaDeBots', 'Lista_de_bots' ), 'Listfiles' => array( 'ListaImágenes', 'Lista_de_imágenes' ), 'Listgrouprights' => array( 'ListaDerechosGrupos', 'Derechos_de_grupos_de_usuarios' ), 'Listredirects' => array( 'TodasLasRedirecciones', 'Todas_las_redirecciones' ), 'Listusers' => array( 'ListaUsuarios', 'Lista_de_usuarios' ), 'Lockdb' => array( 'BloquearBasedeDatos', 'Bloquear_base_de_datos' ), 'Log' => array( 'Registro' ), 'Lonelypages' => array( 'PáginasHuérfanas', 'Páginas_huérfanas' ), 'Longpages' => array( 'PáginasLargas', 'Páginas_largas' ), 'MergeHistory' => array( 'FusionarHistorial', 'Fusionar_historial' ), 'MIMEsearch' => array( 'BuscarPorMIME', 'Buscar_por_MIME' ), 'Mostcategories' => array( 'MásCategorizadas', 'Más_categorizadas' ), 'Mostimages' => array( 'MásImágenes', 'Con_más_imágenes' ), 'Mostlinked' => array( 'MásEnlazados', 'Más_enlazados', 'MásEnlazadas' ), 'Mostlinkedcategories' => array( 'CategoríasMásUsadas', 'Categorías_más_usadas' ), 'Mostlinkedtemplates' => array( 'PlantillasMásUsadas', 'Plantillas_más_usadas' ), 'Mostrevisions' => array( 'MásEdiciones', 'Más_ediciones' ), 'Movepage' => array( 'MoverPágina', 'Mover_página' ), 'Mycontributions' => array( 'MisContribuciones', 'Mis_contribuciones' ), 'Mypage' => array( 'MiPágina', 'Mi_página' ), 'Mytalk' => array( 'MiDiscusión', 'Mi_discusión' ), 'Myuploads' => array( 'MisArchivosSubidos' ), 'Newimages' => array( 'NuevasImágenes', 'Nuevas_imágenes' ), 'Newpages' => array( 'PáginasNuevas', 'Páginas_nuevas' ), 'PasswordReset' => array( 'RestablecerContraseña' ), 'PermanentLink' => array( 'EnlacePermanente' ), 'Popularpages' => array( 'PáginasMásVisitadas', 'PáginasPopulares', 'Páginas_más_visitadas' ), 'Preferences' => array( 'Preferencias' ), 'Prefixindex' => array( 'PáginasPorPrefijo', 'Páginas_por_prefijo' ), 'Protectedpages' => array( 'PáginasProtegidas', 'Páginas_protegidas' ), 'Protectedtitles' => array( 'TítulosProtegidos', 'Títulos_protegidos' ), 'Randompage' => array( 'Aleatoria', 'Aleatorio', 'Página_aleatoria' ), 'RandomInCategory' => array( 'Aleatorio_en_categoría' ), 'Randomredirect' => array( 'RedirecciónAleatoria', 'Redirección_aleatoria' ), 'Recentchanges' => array( 'CambiosRecientes', 'Cambios_recientes' ), 'Recentchangeslinked' => array( 'CambiosEnEnlazadas', 'Cambios_en_enlazadas' ), 'Redirect' => array( 'Redirigir' ), 'ResetTokens' => array( 'ReestablecerClaves' ), 'Revisiondelete' => array( 'BorrarRevisión', 'Borrar_revisión' ), 'Search' => array( 'Buscar' ), 'Shortpages' => array( 'PáginasCortas', 'Páginas_cortas' ), 'Specialpages' => array( 'PáginasEspeciales', 'Páginas_especiales' ), 'Statistics' => array( 'Estadísticas' ), 'Tags' => array( 'Etiquetas' ), 'Unblock' => array( 'Desbloquear' ), 'Uncategorizedcategories' => array( 'CategoríasSinCategorizar', 'Categorías_sin_categorizar' ), 'Uncategorizedimages' => array( 'ImágenesSinCategorizar', 'Imágenes_sin_categorizar' ), 'Uncategorizedpages' => array( 'PáginasSinCategorizar', 'Páginas_sin_categorizar' ), 'Uncategorizedtemplates' => array( 'PlantillasSinCategorizar', 'Plantillas_sin_categorizar' ), 'Undelete' => array( 'Restaurar' ), 'Unlockdb' => array( 'DesbloquearBasedeDatos', 'Desbloquear_base_de_datos' ), 'Unusedcategories' => array( 'CategoríasSinUso', 'Categorías_sin_uso' ), 'Unusedimages' => array( 'ImágenesSinUso', 'Imágenes_sin_uso' ), 'Unusedtemplates' => array( 'PlantillasSinUso', 'Plantillas_sin_uso' ), 'Unwatchedpages' => array( 'PáginasSinVigilar', 'Páginas_sin_vigilar' ), 'Upload' => array( 'SubirArchivo', 'Subir_archivo' ), 'UploadStash' => array( 'ArchivosEscondidos', 'FicherosEscondidos' ), 'Userlogin' => array( 'Entrar', 'Entrada_del_usuario' ), 'Userlogout' => array( 'Salida_del_usuario', 'Salir' ), 'Userrights' => array( 'PermisosUsuarios', 'Permisos_de_usuarios' ), 'Version' => array( 'Versión' ), 'Wantedcategories' => array( 'CategoríasRequeridas', 'Categorías_requeridas' ), 'Wantedfiles' => array( 'ArchivosRequeridos', 'Archivos_requeridos' ), 'Wantedpages' => array( 'PáginasRequeridas', 'Páginas_requeridas' ), 'Wantedtemplates' => array( 'PlantillasRequeridas', 'Plantillas_requeridas' ), 'Watchlist' => array( 'Seguimiento', 'Lista_de_seguimiento' ), 'Whatlinkshere' => array( 'LoQueEnlazaAquí', 'Lo_que_enlaza_aquí' ), 'Withoutinterwiki' => array( 'SinInterwikis', 'Sin_interwikis' ), ); $magicWords = array( 'redirect' => array( '0', '#REDIRECCIÓN', '#REDIRECCION', '#REDIRECT' ), 'notoc' => array( '0', '__SIN_TDC__', '__NOTDC__', '__NOTOC__' ), 'nogallery' => array( '0', '__SIN_GALERÍA__', '__NOGALERÍA__', '__NOGALERIA__', '__NOGALLERY__' ), 'forcetoc' => array( '0', '__FORZAR_TDC__', '__FORZARTDC__', '__FORZARTOC__', '__FORCETOC__' ), 'toc' => array( '0', '__TDC__', '__TOC__' ), 'noeditsection' => array( '0', '__NO_EDITAR_SECCIÓN__', '__NOEDITARSECCIÓN__', '__NOEDITARSECCION__', '__NOEDITSECTION__' ), 'currentmonth' => array( '1', 'MESACTUAL', 'MESACTUAL2', 'CURRENTMONTH', 'CURRENTMONTH2' ), 'currentmonth1' => array( '1', 'MESACTUAL1', 'CURRENTMONTH1' ), 'currentmonthname' => array( '1', 'MESACTUALCOMPLETO', 'NOMBREMESACTUAL', 'CURRENTMONTHNAME' ), 'currentmonthnamegen' => array( '1', 'MESACTUALGENITIVO', 'CURRENTMONTHNAMEGEN' ), 'currentmonthabbrev' => array( '1', 'MESACTUALABREVIADO', 'CURRENTMONTHABBREV' ), 'currentday' => array( '1', 'DÍAACTUAL', 'DIAACTUAL', 'DÍA_ACTUAL', 'DIA_ACTUAL', 'CURRENTDAY' ), 'currentday2' => array( '1', 'DÍAACTUAL2', 'DIAACTUAL2', 'DÍA_ACTUAL2', 'DIA_ACTUAL2', 'CURRENTDAY2' ), 'currentdayname' => array( '1', 'NOMBREDÍAACTUAL', 'NOMBREDIAACTUAL', 'CURRENTDAYNAME' ), 'currentyear' => array( '1', 'AÑOACTUAL', 'AÑO_ACTUAL', 'CURRENTYEAR' ), 'currenttime' => array( '1', 'HORA_MINUTOS_ACTUAL', 'HORAMINUTOSACTUAL', 'TIEMPOACTUAL', 'CURRENTTIME' ), 'currenthour' => array( '1', 'HORAACTUAL', 'HORA_ACTUAL', 'CURRENTHOUR' ), 'localmonth' => array( '1', 'MESLOCAL', 'MESLOCAL2', 'LOCALMONTH', 'LOCALMONTH2' ), 'localmonth1' => array( '1', 'MESLOCAL1', 'LOCALMONTH1' ), 'localmonthname' => array( '1', 'MESLOCALCOMPLETO', 'NOMBREMESLOCAL', 'LOCALMONTHNAME' ), 'localmonthnamegen' => array( '1', 'MESLOCALGENITIVO', 'LOCALMONTHNAMEGEN' ), 'localmonthabbrev' => array( '1', 'MESLOCALABREVIADO', 'LOCALMONTHABBREV' ), 'localday' => array( '1', 'DÍALOCAL', 'DIALOCAL', 'LOCALDAY' ), 'localday2' => array( '1', 'DIALOCAL2', 'DÍALOCAL2', 'LOCALDAY2' ), 'localdayname' => array( '1', 'NOMBREDIALOCAL', 'NOMBREDÍALOCAL', 'LOCALDAYNAME' ), 'localyear' => array( '1', 'AÑOLOCAL', 'LOCALYEAR' ), 'localtime' => array( '1', 'HORAMINUTOSLOCAL', 'TIEMPOLOCAL', 'LOCALTIME' ), 'localhour' => array( '1', 'HORALOCAL', 'LOCALHOUR' ), 'numberofpages' => array( '1', 'NÚMERODEPÁGINAS', 'NUMERODEPAGINAS', 'NUMBEROFPAGES' ), 'numberofarticles' => array( '1', 'NÚMERODEARTÍCULOS', 'NUMERODEARTICULOS', 'NUMBEROFARTICLES' ), 'numberoffiles' => array( '1', 'NÚMERODEARCHIVOS', 'NUMERODEARCHIVOS', 'NUMBEROFFILES' ), 'numberofusers' => array( '1', 'NÚMERODEUSUARIOS', 'NUMERODEUSUARIOS', 'NUMBEROFUSERS' ), 'numberofactiveusers' => array( '1', 'NÚMERODEUSUARIOSACTIVOS', 'NUMERODEUSUARIOSACTIVOS', 'NUMBEROFACTIVEUSERS' ), 'numberofedits' => array( '1', 'NÚMERODEEDICIONES', 'NUMERODEEDICIONES', 'NUMBEROFEDITS' ), 'numberofviews' => array( '1', 'NÚMERODEVISTAS', 'NUMERODEVISTAS', 'NUMBEROFVIEWS' ), 'pagename' => array( '1', 'NOMBREDEPAGINA', 'NOMBREDEPÁGINA', 'PAGENAME' ), 'pagenamee' => array( '1', 'NOMBREDEPAGINAC', 'NOMBREDEPÁGINAC', 'PAGENAMEE' ), 'namespace' => array( '1', 'ESPACIODENOMBRE', 'NAMESPACE' ), 'namespacee' => array( '1', 'ESPACIODENOMBREC', 'NAMESPACEE' ), 'namespacenumber' => array( '1', 'NÚMERODELESPACIO', 'NAMESPACENUMBER' ), 'talkspace' => array( '1', 'ESPACIODEDISCUSION', 'ESPACIODEDISCUSIÓN', 'TALKSPACE' ), 'talkspacee' => array( '1', 'ESPACIODEDISCUSIONC', 'TALKSPACEE' ), 'subjectspace' => array( '1', 'ESPACIODEASUNTO', 'ESPACIODETEMA', 'ESPACIODEARTÍCULO', 'ESPACIODEARTICULO', 'SUBJECTSPACE', 'ARTICLESPACE' ), 'subjectspacee' => array( '1', 'ESPACIODETEMAC', 'ESPACIODEASUNTOC', 'ESPACIODEARTICULOC', 'ESPACIODEARTÍCULOC', 'SUBJECTSPACEE', 'ARTICLESPACEE' ), 'fullpagename' => array( '1', 'NOMBRECOMPLETODEPÁGINA', 'NOMBRECOMPLETODEPAGINA', 'FULLPAGENAME' ), 'fullpagenamee' => array( '1', 'NOMBRECOMPLETODEPAGINAC', 'NOMBRECOMPLETODEPÁGINAC', 'FULLPAGENAMEE' ), 'subpagename' => array( '1', 'NOMBREDESUBPAGINA', 'NOMBREDESUBPÁGINA', 'SUBPAGENAME' ), 'subpagenamee' => array( '1', 'NOMBREDESUBPAGINAC', 'NOMBREDESUBPÁGINAC', 'SUBPAGENAMEE' ), 'rootpagename' => array( '1', 'NOMBREDEPAGINARAIZ', 'NOMBREDEPÁGINARAÍZ', 'ROOTPAGENAME' ), 'rootpagenamee' => array( '1', 'NOMBREDEPAGINARAIZC', 'NOMBREDEPÁGINARAÍZC', 'ROOTPAGENAMEE' ), 'basepagename' => array( '1', 'NOMBREDEPAGINABASE', 'NOMBREDEPÁGINABASE', 'BASEPAGENAME' ), 'basepagenamee' => array( '1', 'NOMBREDEPAGINABASEC', 'NOMBREDEPÁGINABASEC', 'BASEPAGENAMEE' ), 'talkpagename' => array( '1', 'NOMBREDEPÁGINADEDISCUSIÓN', 'NOMBREDEPAGINADEDISCUSION', 'NOMBREDEPAGINADISCUSION', 'NOMBREDEPÁGINADISCUSIÓN', 'TALKPAGENAME' ), 'talkpagenamee' => array( '1', 'NOMBREDEPÁGINADEDISCUSIÓNC', 'NOMBREDEPAGINADEDISCUSIONC', 'NOMBREDEPAGINADISCUSIONC', 'NOMBREDEPÁGINADISCUSIÓNC', 'TALKPAGENAMEE' ), 'subjectpagename' => array( '1', 'NOMBREDEPAGINADETEMA', 'NOMBREDEPÁGINADETEMA', 'NOMBREDEPÁGINADEASUNTO', 'NOMBREDEPAGINADEASUNTO', 'NOMBREDEPAGINADEARTICULO', 'NOMBREDEPÁGINADEARTÍCULO', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME' ), 'subjectpagenamee' => array( '1', 'NOMBREDEPAGINADETEMAC', 'NOMBREDEPÁGINADETEMAC', 'NOMBREDEPÁGINADEASUNTOC', 'NOMBREDEPAGINADEASUNTOC', 'NOMBREDEPAGINADEARTICULOC', 'NOMBREDEPÁGINADEARTÍCULOC', 'SUBJECTPAGENAMEE', 'ARTICLEPAGENAMEE' ), 'msg' => array( '0', 'MSJ:', 'MSG:' ), 'subst' => array( '0', 'SUST:', 'FIJAR:', 'SUBST:' ), 'img_thumbnail' => array( '1', 'miniaturadeimagen', 'miniatura', 'mini', 'thumbnail', 'thumb' ), 'img_manualthumb' => array( '1', 'miniaturadeimagen=$1', 'miniatura=$1', 'thumbnail=$1', 'thumb=$1' ), 'img_right' => array( '1', 'derecha', 'dcha', 'der', 'right' ), 'img_left' => array( '1', 'izquierda', 'izda', 'izq', 'left' ), 'img_none' => array( '1', 'ninguna', 'nada', 'no', 'ninguno', 'none' ), 'img_center' => array( '1', 'centro', 'centrado', 'centrada', 'centrar', 'center', 'centre' ), 'img_framed' => array( '1', 'marco', 'enmarcado', 'enmarcada', 'framed', 'enframed', 'frame' ), 'img_frameless' => array( '1', 'sinmarco', 'sin_enmarcar', 'sinenmarcar', 'frameless' ), 'img_page' => array( '1', 'pagina=$1', 'página=$1', 'pagina_$1', 'página_$1', 'page=$1', 'page $1' ), 'img_border' => array( '1', 'borde', 'border' ), 'img_link' => array( '1', 'vínculo=$1', 'vinculo=$1', 'enlace=$1', 'link=$1' ), 'sitename' => array( '1', 'NOMBREDELSITIO', 'SITENAME' ), 'ns' => array( '0', 'EN:', 'NS:' ), 'localurl' => array( '0', 'URLLOCAL', 'LOCALURL:' ), 'localurle' => array( '0', 'URLLOCALC:', 'LOCALURLE:' ), 'server' => array( '0', 'SERVIDOR', 'SERVER' ), 'servername' => array( '0', 'NOMBRESERVIDOR', 'SERVERNAME' ), 'scriptpath' => array( '0', 'RUTASCRIPT', 'RUTADESCRIPT', 'SCRIPTPATH' ), 'stylepath' => array( '0', 'RUTAESTILO', 'RUTADEESTILO', 'STYLEPATH' ), 'grammar' => array( '0', 'GRAMATICA:', 'GRAMÁTICA:', 'GRAMMAR:' ), 'gender' => array( '0', 'GÉNERO:', 'GENERO:', 'GENDER:' ), 'notitleconvert' => array( '0', '__NOCONVERTIRTITULO__', '__NOCONVERTIRTÍTULO__', '__NOCT___', '__NOTITLECONVERT__', '__NOTC__' ), 'nocontentconvert' => array( '0', '__NOCONVERTIRCONTENIDO__', '__NOCC___', '__NOCONTENTCONVERT__', '__NOCC__' ), 'currentweek' => array( '1', 'SEMANAACTUAL', 'CURRENTWEEK' ), 'currentdow' => array( '1', 'DDSACTUAL', 'DIADESEMANAACTUAL', 'DÍADESEMANAACTUAL', 'CURRENTDOW' ), 'localweek' => array( '1', 'SEMANALOCAL', 'LOCALWEEK' ), 'localdow' => array( '1', 'DDSLOCAL', 'DIADESEMANALOCAL', 'DÍADESEMANALOCAL', 'LOCALDOW' ), 'revisionid' => array( '1', 'IDDEREVISION', 'IDREVISION', 'IDDEREVISIÓN', 'IDREVISIÓN', 'REVISIONID' ), 'revisionday' => array( '1', 'DIADEREVISION', 'DIAREVISION', 'DÍADEREVISIÓN', 'DÍAREVISIÓN', 'REVISIONDAY' ), 'revisionday2' => array( '1', 'DIADEREVISION2', 'DIAREVISION2', 'DÍADEREVISIÓN2', 'DÍAREVISIÓN2', 'REVISIONDAY2' ), 'revisionmonth' => array( '1', 'MESDEREVISION', 'MESDEREVISIÓN', 'MESREVISION', 'MESREVISIÓN', 'REVISIONMONTH' ), 'revisionyear' => array( '1', 'AÑODEREVISION', 'AÑODEREVISIÓN', 'AÑOREVISION', 'AÑOREVISIÓN', 'REVISIONYEAR' ), 'revisiontimestamp' => array( '1', 'MARCADEHORADEREVISION', 'MARCADEHORADEREVISIÓN', 'REVISIONTIMESTAMP' ), 'revisionuser' => array( '1', 'USUARIODEREVISION', 'USUARIODEREVISIÓN', 'REVISIONUSER' ), 'fullurl' => array( '0', 'URLCOMPLETA:', 'FULLURL:' ), 'fullurle' => array( '0', 'URLCOMPLETAC:', 'FULLURLE:' ), 'canonicalurl' => array( '0', 'URLCANONICA:', 'CANONICALURL:' ), 'canonicalurle' => array( '0', 'URLCANONICAC:', 'CANONICALURLE:' ), 'lcfirst' => array( '0', 'PRIMEROMINUS;', 'PRIMEROMINÚS:', 'LCFIRST:' ), 'ucfirst' => array( '0', 'PRIMEROMAYUS;', 'PRIMEROMAYÚS:', 'UCFIRST:' ), 'lc' => array( '0', 'MINUS:', 'MINÚS:', 'LC:' ), 'uc' => array( '0', 'MAYUS:', 'MAYÚS:', 'UC:' ), 'raw' => array( '0', 'SINFORMATO', 'SINPUNTOS', 'RAW:' ), 'displaytitle' => array( '1', 'MOSTRARTÍTULO', 'MOSTRARTITULO', 'DISPLAYTITLE' ), 'rawsuffix' => array( '1', 'SF', 'R' ), 'newsectionlink' => array( '1', '__VINCULARANUEVASECCION__', '__ENLACECREARSECCIÓN__', '__NEWSECTIONLINK__' ), 'nonewsectionlink' => array( '1', '__NOVINCULARANUEVASECCION__', '__SINENLACECREARSECCIÓN__', '__NONEWSECTIONLINK__' ), 'currentversion' => array( '1', 'VERSIONACTUAL', 'VERSIÓNACTUAL', 'CURRENTVERSION' ), 'urlencode' => array( '0', 'CODIFICARURL:', 'URLENCODE:' ), 'currenttimestamp' => array( '1', 'MARCADEHORAACTUAL', 'CURRENTTIMESTAMP' ), 'localtimestamp' => array( '1', 'MARCADEHORALOCAL', 'LOCALTIMESTAMP' ), 'language' => array( '0', '#IDIOMA:', '#LANGUAGE:' ), 'contentlanguage' => array( '1', 'IDIOMADELCONTENIDO', 'IDIOMADELCONT', 'CONTENTLANGUAGE', 'CONTENTLANG' ), 'pagesinnamespace' => array( '1', 'PÁGINASENESPACIO', 'PAGESINNAMESPACE:', 'PAGESINNS:' ), 'numberofadmins' => array( '1', 'NÚMEROADMINIISTRADORES', 'NÚMEROADMINS', 'NUMEROADMINS', 'NUMEROADMINISTRADORES', 'NUMERODEADMINISTRADORES', 'NUMERODEADMINS', 'NÚMERODEADMINISTRADORES', 'NÚMERODEADMINS', 'NUMBEROFADMINS' ), 'formatnum' => array( '0', 'FORMATONÚMERO', 'FORMATONUMERO', 'FORMATNUM' ), 'special' => array( '0', 'especial', 'special' ), 'defaultsort' => array( '1', 'ORDENAR:', 'CLAVEDEORDENPREDETERMINADO:', 'ORDENDECATEGORIAPREDETERMINADO:', 'ORDENDECATEGORÍAPREDETERMINADO:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ), 'filepath' => array( '0', 'RUTAARCHIVO:', 'RUTARCHIVO:', 'RUTADEARCHIVO:', 'FILEPATH:' ), 'tag' => array( '0', 'etiqueta', 'tag' ), 'hiddencat' => array( '1', '__CATEGORÍAOCULTA__', '__HIDDENCAT__' ), 'pagesincategory' => array( '1', 'PÁGINASENCATEGORÍA', 'PÁGINASENCAT', 'PAGSENCAT', 'PAGINASENCATEGORIA', 'PAGINASENCAT', 'PAGESINCATEGORY', 'PAGESINCAT' ), 'pagesize' => array( '1', 'TAMAÑOPÁGINA', 'TAMAÑODEPÁGINA', 'TAMAÑOPAGINA', 'TAMAÑODEPAGINA', 'PAGESIZE' ), 'index' => array( '1', '__INDEXAR__', '__INDEX__' ), 'noindex' => array( '1', '__NOINDEXAR__', '__NOINDEX__' ), 'numberingroup' => array( '1', 'NÚMEROENGRUPO', 'NUMEROENGRUPO', 'NUMENGRUPO', 'NÚMENGRUPO', 'NUMBERINGROUP', 'NUMINGROUP' ), 'staticredirect' => array( '1', '__REDIRECCIONESTATICA__', '__REDIRECCIÓNESTÁTICA__', '__STATICREDIRECT__' ), 'protectionlevel' => array( '1', 'NIVELDEPROTECCIÓN', 'PROTECTIONLEVEL' ), 'formatdate' => array( '0', 'formatodefecha', 'formatearfecha', 'formatdate', 'dateformat' ), ); $datePreferences = false; $defaultDateFormat = 'dmy'; $dateFormats = array( 'dmy time' => 'H:i', 'dmy date' => 'j M Y', 'dmy both' => 'H:i j M Y', ); $separatorTransformTable = array( ',' => "\xc2\xa0", '.' => ',' ); $linkTrail = '/^([a-záéíóúñ]+)(.*)$/sDu'; $messages = array( # User preference toggles 'tog-underline' => 'Subrayar los enlaces:', 'tog-hideminor' => 'Ocultar las ediciones menores en los cambios recientes', 'tog-hidepatrolled' => 'Ocultar las ediciones patrulladas en los cambios recientes', 'tog-newpageshidepatrolled' => 'Ocultar las páginas patrulladas de la lista de páginas nuevas', 'tog-extendwatchlist' => 'Expandir la lista de seguimiento a todos los cambios, no sólo a los más recientes', 'tog-usenewrc' => 'Agrupar los cambios por página en los cambios recientes y en la lista de seguimiento (requiere JavaScript)', 'tog-numberheadings' => 'Numerar automáticamente los encabezados', 'tog-showtoolbar' => 'Mostrar la barra de edición', 'tog-editondblclick' => 'Editar las páginas al pulsar dos veces en ellos con el ratón', 'tog-editsectiononrightclick' => 'Activar la edición de secciones pulsando el botón derecho en los títulos de secciones', 'tog-rememberpassword' => 'Recordar mi nombre de usuario y contraseña entre sesiones en este navegador (por un máximo de $1 {{PLURAL:$1|día|días}})', 'tog-watchcreations' => 'Añadir las páginas que cree y los archivos que suba a mi lista de seguimento', 'tog-watchdefault' => 'Añadir las páginas y archivos que edite a mi lista de seguimiento', 'tog-watchmoves' => 'Añadir las páginas y archivos que mueva a mi lista de seguimiento', 'tog-watchdeletion' => 'Añadir las páginas y archivos que borre a mi lista de seguimiento', 'tog-minordefault' => 'Marcar todas las ediciones como menores de manera predeterminada', 'tog-previewontop' => 'Mostrar previsualización antes del cuadro de edición', 'tog-previewonfirst' => 'Mostrar previsualización en la primera edición', 'tog-enotifwatchlistpages' => 'Enviarme un correo electrónico cuando se modifique una página o un archivo de mi lista de seguimiento', 'tog-enotifusertalkpages' => 'Enviarme un correo electrónico cuando se modifique mi página de discusión', 'tog-enotifminoredits' => 'Notificarme también por correo electrónico los cambios menores de las páginas y archivos', 'tog-enotifrevealaddr' => 'Revelar mi dirección de correo electrónico en los correos de notificación', 'tog-shownumberswatching' => 'Mostrar el número de usuarios que la vigilan', 'tog-oldsig' => 'Firma actual:', 'tog-fancysig' => 'Tratar la firma como wikitexto (sin un enlace automático)', 'tog-uselivepreview' => 'Usar previsualización dinámica (experimental)', 'tog-forceeditsummary' => 'Avisarme cuando grabe la página sin introducir un resumen de edición', 'tog-watchlisthideown' => 'Ocultar mis ediciones en la lista de seguimiento', 'tog-watchlisthidebots' => 'Ocultar las ediciones de bots en la lista de seguimiento', 'tog-watchlisthideminor' => 'Ocultar las ediciones menores en la lista de seguimiento', 'tog-watchlisthideliu' => 'Ocultar las ediciones de los usuarios registrados en la lista de seguimiento', 'tog-watchlisthideanons' => 'Ocultar las ediciones de los usuarios anónimos en la lista de seguimiento', 'tog-watchlisthidepatrolled' => 'Ocultar las ediciones patrulladas en la lista de seguimiento', 'tog-ccmeonemails' => 'Recibir copias de los correos que envío a otros usuarios', 'tog-diffonly' => "No mostrar bajo las ''diferencias'' el contenido de la página", 'tog-showhiddencats' => 'Mostrar las categorías escondidas', 'tog-noconvertlink' => 'Desactivar la conversión de título de enlace', 'tog-norollbackdiff' => 'Omitir la diferencia después de revertir', 'tog-useeditwarning' => 'Advertirme cuando abandone una página editada con cambios sin grabar', 'tog-prefershttps' => 'Utiliza una conexión segura siempre que haya iniciado una sesión', 'underline-always' => 'Siempre', 'underline-never' => 'Nunca', 'underline-default' => 'Aspecto (skin) o valor predeterminado del navegador', # Font style option in Special:Preferences 'editfont-style' => 'Estilo de tipografía del área de edición:', 'editfont-default' => 'Predeterminado del navegador', 'editfont-monospace' => 'Tipo de letra monoespaciado', 'editfont-sansserif' => 'Tipo de letra de palo seco', 'editfont-serif' => 'Tipo de letra con serifas', # Dates 'sunday' => 'domingo', 'monday' => 'lunes', 'tuesday' => 'martes', 'wednesday' => 'miércoles', 'thursday' => 'jueves', 'friday' => 'viernes', 'saturday' => 'sábado', 'sun' => 'dom', 'mon' => 'lun', 'tue' => 'mar', 'wed' => 'mié', 'thu' => 'jue', 'fri' => 'vie', 'sat' => 'sáb', 'january' => 'enero', 'february' => 'febrero', 'march' => 'marzo', 'april' => 'abril', 'may_long' => 'mayo', 'june' => 'junio', 'july' => 'julio', 'august' => 'agosto', 'september' => 'septiembre', 'october' => 'octubre', 'november' => 'noviembre', 'december' => 'diciembre', 'january-gen' => 'enero', 'february-gen' => 'febrero', 'march-gen' => 'marzo', 'april-gen' => 'abril', 'may-gen' => 'mayo', 'june-gen' => 'junio', 'july-gen' => 'julio', 'august-gen' => 'agosto', 'september-gen' => 'septiembre', 'october-gen' => 'octubre', 'november-gen' => 'noviembre', 'december-gen' => 'diciembre', 'jan' => 'ene', 'feb' => 'feb', 'mar' => 'mar', 'apr' => 'abr', 'may' => 'may', 'jun' => 'jun', 'jul' => 'jul', 'aug' => 'ago', 'sep' => 'sep', 'oct' => 'oct', 'nov' => 'nov', 'dec' => 'dic', 'january-date' => '$1 de enero', 'february-date' => '$1 de febrero', 'march-date' => '$1 de marzo', 'april-date' => '$1 de abril', 'may-date' => '$1 de mayo', 'june-date' => '$1 de junio', 'july-date' => '$1 de julio', 'august-date' => '$1 de agosto', 'september-date' => '$1 de septiembre', 'october-date' => '$1 de octubre', 'november-date' => '$1 de noviembre', 'december-date' => '$1 de diciembre', # Categories related messages 'pagecategories' => '{{PLURAL:$1|Categoría|Categorías}}', 'category_header' => 'Páginas en la categoría «$1»', 'subcategories' => 'Subcategorías', 'category-media-header' => 'Archivos multimedia en la categoría «$1»', 'category-empty' => "''La categoría no contiene ninguna página o archivo.''", 'hidden-categories' => '{{PLURAL:$1|Categoría escondida|Categorías escondidas}}', 'hidden-category-category' => 'Categorías ocultas', 'category-subcat-count' => '{{PLURAL:$2|Esta categoría solo contiene la siguiente subcategoría.|Esta categoría contiene {{PLURAL:$1|la siguiente subcategoría|las siguientes $1 subcategorías}}, de un total de $2.}}', 'category-subcat-count-limited' => 'Esta categoría contiene {{PLURAL:$1|la siguiente subcategoría|las siguientes $1 subcategorías}}.', 'category-article-count' => '{{PLURAL:$2|Esta categoría incluye solamente la siguiente página.|{{PLURAL:$1|La siguiente página página pertenece|Las siguientes $1 páginas pertenecen}} a esta categoría, de un total de $2.}}', 'category-article-count-limited' => '{{PLURAL:$1|La siguiente página pertenece|Las siguientes $1 páginas pertenecen}} a esta categoría.', 'category-file-count' => '{{PLURAL:$2|Esta categoría contiene solamente el siguiente archivo.|{{PLURAL:$1|El siguiente archivo pertenece|Los siguientes $1 archivos pertenecen}} a esta categoría, de un total de $2.}}', 'category-file-count-limited' => '{{PLURAL:$1|El siguiente fichero pertenece|Los siguientes $1 ficheros pertenecen}} a esta categoría.', 'listingcontinuesabbrev' => 'cont.', 'index-category' => 'Páginas indizadas', 'noindex-category' => 'Páginas no indizadas', 'broken-file-category' => 'Páginas con enlaces rotos a archivos', 'about' => 'Acerca de', 'article' => 'Artículo', 'newwindow' => '(se abre en una ventana nueva)', 'cancel' => 'Cancelar', 'moredotdotdot' => 'Más...', 'morenotlisted' => 'Esta lista no está completa.', 'mypage' => 'Página', 'mytalk' => 'Discusión', 'anontalk' => 'Discusión para esta IP', 'navigation' => 'Navegación', 'and' => '&#32;y', # Cologne Blue skin 'qbfind' => 'Buscar', 'qbbrowse' => 'Navegar', 'qbedit' => 'Editar', 'qbpageoptions' => 'Opciones de página', 'qbmyoptions' => 'Mis páginas', 'faq' => 'Preguntas más frecuentes', 'faqpage' => 'Project:P+F', # Vector skin 'vector-action-addsection' => 'Nueva sección', 'vector-action-delete' => 'Borrar', 'vector-action-move' => 'Trasladar', 'vector-action-protect' => 'Proteger', 'vector-action-undelete' => 'Restaurar', 'vector-action-unprotect' => 'Cambiar protección', 'vector-view-create' => 'Crear', 'vector-view-edit' => 'Editar', 'vector-view-history' => 'Ver historial', 'vector-view-view' => 'Leer', 'vector-view-viewsource' => 'Ver código', 'actions' => 'Acciones', 'namespaces' => 'Espacios de nombres', 'variants' => 'Variantes', 'navigation-heading' => 'Menú de navegación', 'errorpagetitle' => 'Error', 'returnto' => 'Volver a $1.', 'tagline' => 'De {{SITENAME}}', 'help' => 'Ayuda', 'search' => 'Buscar', 'searchbutton' => 'Buscar', 'go' => 'Ir', 'searcharticle' => 'Ir', 'history' => 'Historial', 'history_short' => 'Historial', 'updatedmarker' => 'actualizado desde mi última visita', 'printableversion' => 'Versión para imprimir', 'permalink' => 'Enlace permanente', 'print' => 'Imprimir', 'view' => 'Ver', 'edit' => 'Editar', 'create' => 'Crear', 'editthispage' => 'Editar esta página', 'create-this-page' => 'Crear esta página', 'delete' => 'Borrar', 'deletethispage' => 'Borrar esta página', 'undeletethispage' => 'Restaurar esta página', 'undelete_short' => 'Restaurar {{PLURAL:$1|una edición|$1 ediciones}}', 'viewdeleted_short' => 'Ver {{PLURAL:$1|una edición borrada|$1 ediciones borradas}}', 'protect' => 'Proteger', 'protect_change' => 'cambiar', 'protectthispage' => 'Proteger esta página', 'unprotect' => 'Cambiar protección', 'unprotectthispage' => 'Cambiar la protección de esta página', 'newpage' => 'Página nueva', 'talkpage' => 'Discutir esta página', 'talkpagelinktext' => 'Discusión', 'specialpage' => 'Página especial', 'personaltools' => 'Herramientas personales', 'postcomment' => 'Sección nueva', 'articlepage' => 'Ver artículo', 'talk' => 'Discusión', 'views' => 'Vistas', 'toolbox' => 'Herramientas', 'userpage' => 'Ver página de usuario', 'projectpage' => 'Ver página de proyecto', 'imagepage' => 'Ver página del archivo', 'mediawikipage' => 'Ver página de mensaje', 'templatepage' => 'Ver página de plantilla', 'viewhelppage' => 'Ver página de ayuda', 'categorypage' => 'Ver página de categoría', 'viewtalkpage' => 'Ver discusión', 'otherlanguages' => 'Otros idiomas', 'redirectedfrom' => '(Redirigido desde «$1»)', 'redirectpagesub' => 'Página de redirección', 'lastmodifiedat' => 'Esta página fue modificada por última vez el $1, a las $2.', 'viewcount' => 'Esta página se ha visitado {{PLURAL:$1|una vez|$1 veces}}.', 'protectedpage' => 'Página protegida', 'jumpto' => 'Saltar a:', 'jumptonavigation' => 'navegación', 'jumptosearch' => 'buscar', 'view-pool-error' => 'Lo sentimos, los servidores están sobrecargados en este momento. Hay demasiados usuarios que están tratando de ver esta página. Espera un momento antes de tratar de acceder nuevamente a esta página. $1', 'pool-timeout' => 'Tiempo limite agotado para el bloqueo', 'pool-queuefull' => 'La cola de trabajo está llena', 'pool-errorunknown' => 'Error desconocido', # All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage). 'aboutsite' => 'Acerca de {{SITENAME}}', 'aboutpage' => 'Project:Acerca de', 'copyright' => 'El contenido está disponible bajo $1 a menos que se indique lo contrario.', 'copyrightpage' => '{{ns:project}}:Derechos de autor', 'currentevents' => 'Actualidad', 'currentevents-url' => 'Project:Actualidad', 'disclaimers' => 'Aviso legal', 'disclaimerpage' => 'Project:Limitación general de responsabilidad', 'edithelp' => 'Ayuda de edición', 'helppage' => 'Help:Contenido', 'mainpage' => 'Página principal', 'mainpage-description' => 'Página principal', 'policy-url' => 'Project:Políticas', 'portal' => 'Portal de la comunidad', 'portal-url' => 'Project:Portal de la comunidad', 'privacy' => 'Política de protección de datos', 'privacypage' => 'Project:Política de protección de datos', 'badaccess' => 'Error de permisos', 'badaccess-group0' => 'No estás autorizado a ejecutar la acción solicitada.', 'badaccess-groups' => 'La acción que has solicitado está restringida a los usuarios {{PLURAL:$2|del grupo|de uno de estos $2 grupos}}: $1.', 'versionrequired' => 'Se requiere la versión $1 de MediaWiki.', 'versionrequiredtext' => 'Se necesita la versión $1 de MediaWiki para utilizar esta página. Para más información, consultar [[Special:Version|la página de versión]]', 'ok' => 'Aceptar', 'retrievedfrom' => 'Obtenido de «$1»', 'youhavenewmessages' => 'Tienes $1 ($2).', 'youhavenewmessagesfromusers' => 'Tienes $1 de {{PLURAL:$3|otro usuario|$3 usuarios}} ($2).', 'youhavenewmessagesmanyusers' => 'Tienes $1 de muchos usuarios ($2).', 'newmessageslinkplural' => '{{PLURAL:$1|un mensaje nuevo|999=mensajes nuevos}}', 'newmessagesdifflinkplural' => '{{PLURAL:$1|último cambio|999=últimos cambios}}', 'youhavenewmessagesmulti' => 'Tienes mensajes nuevos en $1', 'editsection' => 'editar', 'editold' => 'editar', 'viewsourceold' => 'ver código', 'editlink' => 'modificar', 'viewsourcelink' => 'ver código', 'editsectionhint' => 'Editar sección: $1', 'toc' => 'Contenido', 'showtoc' => 'mostrar', 'hidetoc' => 'ocultar', 'collapsible-collapse' => 'Contraer', 'collapsible-expand' => 'Expandir', 'thisisdeleted' => '¿Ver o restaurar $1?', 'viewdeleted' => '¿Quieres ver $1?', 'restorelink' => '{{PLURAL:$1|una edición borrada|$1 ediciones borradas}}', 'feedlinks' => 'Canal:', 'feed-invalid' => 'El tipo de canal de suscripción no es válido.', 'feed-unavailable' => 'Los canales de sindicación no están disponibles', 'site-rss-feed' => 'Canal RSS de $1', 'site-atom-feed' => 'Canal Atom de $1', 'page-rss-feed' => 'Canal RSS «$1»', 'page-atom-feed' => 'Canal Atom «$1»', 'red-link-title' => '$1 (la página no existe)', 'sort-descending' => 'Orden descendente', 'sort-ascending' => 'Orden ascendente', # Short words for each namespace, by default used in the namespace tab in monobook 'nstab-main' => 'Página', 'nstab-user' => 'Página {{GENDER:{{ROOTPAGENAME}}|del usuario|de la usuaria}}', 'nstab-media' => 'Multimedia', 'nstab-special' => 'Página especial', 'nstab-project' => 'Página del proyecto', 'nstab-image' => 'Archivo', 'nstab-mediawiki' => 'Mensaje', 'nstab-template' => 'Plantilla', 'nstab-help' => 'Ayuda', 'nstab-category' => 'Categoría', # Main script and global functions 'nosuchaction' => 'No existe esa acción', 'nosuchactiontext' => 'La acción especificada en la dirección no es válida. Es posible que hayas escrito mal la URL o que hayas seguido un enlace incorrecto. Esto también podría indicar un error en el software utilizado en {{SITENAME}}.', 'nosuchspecialpage' => 'No existe esa página especial', 'nospecialpagetext' => '<strong>Ha solicitado una página especial inexistente.</strong> Puedes ver una lista de las páginas especiales en [[Special:SpecialPages|{{int:specialpages}}]].', # General errors 'error' => 'Error', 'databaseerror' => 'Error de la base de datos', 'databaseerror-text' => 'Se ha producido un error en la base de datos. Esto puede indicar un bug en el software.', 'databaseerror-textcl' => 'Se ha producido un error en la base de datos.', 'databaseerror-query' => 'Consulta: $1', 'databaseerror-function' => 'Función: $1', 'databaseerror-error' => 'Error: $1', 'laggedslavemode' => "'''Aviso:''' puede que falten las actualizaciones más recientes en esta página.", 'readonly' => 'Base de datos bloqueada', 'enterlockreason' => 'Explique el motivo del bloqueo, incluyendo una estimación de cuándo se producirá el desbloqueo', 'readonlytext' => 'La base de datos no permite nuevas entradas u otras modificaciones de forma temporal, probablemente por mantenimiento rutinario, tras lo cual volverá a la normalidad. La explicación dada por el administrador que la bloqueó fue: $1', 'missing-article' => "La base de datos no encuentra el texto de una página que debería hallarse, llamada «$1» $2. La causa de esto suele deberse a un ''diff'' anacrónico o un enlace al historial de una página que ha sido borrada. Si no fuera el caso, puedes haber encontrado un fallo en el software. Por favor, avisa a un [[Special:ListUsers/sysop|administrador]], tomando nota de la URL.", 'missingarticle-rev' => '(n.º de revisión: $1)', 'missingarticle-diff' => '(Dif.: $1, $2)', 'readonly_lag' => 'La base de datos se ha bloqueado temporalmente mientras los servidores se sincronizan.', 'internalerror' => 'Error interno', 'internalerror_info' => 'Error interno: $1', 'fileappenderrorread' => 'No se ha podido leer «$1» durante la anexión.', 'fileappenderror' => 'No se ha podido añadir «$1» a «$2».', 'filecopyerror' => 'No se pudo copiar el archivo «$1» a «$2».', 'filerenameerror' => 'No se pudo renombrar el archivo «$1» a «$2».', 'filedeleteerror' => 'No se pudo borrar el archivo «$1».', 'directorycreateerror' => 'No se pudo crear el directorio «$1».', 'filenotfound' => 'No se pudo encontrar el archivo «$1».', 'fileexistserror' => 'No se pudo escribir en el archivo «$1»: el archivo existe.', 'unexpected' => 'Valor inesperado: «$1»=«$2».', 'formerror' => 'Error: no se pudo enviar el formulario', 'badarticleerror' => 'Esta acción no se puede llevar a cabo en esta página.', 'cannotdelete' => 'La página o archivo «$1» no se pudo borrar. Puede que ya haya sido borrado por alguien más.', 'cannotdelete-title' => 'No se puede borrar la página «$1»', 'delete-hook-aborted' => 'La modificación que intentaste hacer fue cancelada por un gancho de extensión. No hay explicación disponible.', 'no-null-revision' => 'No se pudo crear la revisión nula para la página «$1»', 'badtitle' => 'Título incorrecto', 'badtitletext' => 'El título de la página solicitada está vacío, no es válido, o es un enlace interidioma o interwiki incorrecto. Puede que contenga uno o más caracteres que no se pueden usar en los títulos.', 'perfcached' => 'Los siguientes datos provienen de la caché y pueden no estar actualizados. La caché puede contener {{PLURAL:$1|un resultado|$1 resultados}} como máximo.', 'perfcachedts' => 'Los siguientes datos provienen de la caché y su última fecha y hora de actualización es: $1. La caché puede contener {{PLURAL:$4|un resultado|$4 resultados}} como máximo.', 'querypage-no-updates' => 'Actualmente las actualizaciones de esta página están desactivadas. Estos datos no serán actualizados a corto plazo.', 'viewsource' => 'Ver código', 'viewsource-title' => 'Ver el código de «$1»', 'actionthrottled' => 'Acción limitada', 'actionthrottledtext' => "Como medida contra el ''spam'', la acción que estás realizando está limitada a un número determinado de veces en un periodo corto de tiempo, y has excedido ese límite. Por favor inténtalo de nuevo en unos minutos.", 'protectedpagetext' => 'Esta página ha sido protegida para evitar su edición u otras acciones.', 'viewsourcetext' => 'Puedes ver y copiar el código fuente de esta página:', 'viewyourtext' => "Puedes ver y copiar el código de '''tus ediciones''' a esta página:", 'protectedinterface' => 'Esta página proporciona el texto de la interfaz del software en este wiki, y está protegida para prevenir el abuso. Para agregar o cambiar las traducciones para todos los wikis, por favor, usa [//translatewiki.net/ translatewiki.net], el proyecto de localización de MediaWiki.', 'editinginterface' => "'''Aviso:''' Estás editando una página usada para proporcionar el texto de la interfaz para el software. Los cambios en esta página afectarán a la apariencia de la interfaz para los demás usuarios de este wiki. Para añadir o cambiar las traducciones, por favor considera usar [//translatewiki.net/ translatewiki.net], el proyecto de localización de MediaWiki.", 'cascadeprotected' => 'Esta página ha sido protegida para su edición, porque está incluida en {{PLURAL:$1|la siguiente página|las siguientes páginas}}, que están protegidas con la opción de «cascada»: $2', 'namespaceprotected' => "No tienes permiso para editar las páginas del espacio de nombres '''$1'''.", 'customcssprotected' => 'No tienes permiso para editar esta página CSS, porque contiene configuraciones personales de otro usuario.', 'customjsprotected' => 'No tienes permiso para editar esta página JavaScript, porque contiene configuraciones personales de otro usuario.', 'mycustomcssprotected' => 'No tienes permiso para editar esta página CSS.', 'mycustomjsprotected' => 'No tienes permiso para editar esta página JavaScript.', 'myprivateinfoprotected' => 'No tienes permiso para editar tu información privada.', 'mypreferencesprotected' => 'No tienes permiso para editar tus preferencias.', 'ns-specialprotected' => 'Las páginas especiales no se pueden editar', 'titleprotected' => 'Esta página ha sido protegida contra creación por [[User:$1|$1]]. El motivo dado fue: "\'\'$2\'\'".', 'filereadonlyerror' => 'No se puede modificar el archivo "$1" porque el repositorio de archivos "$2" está en modo de sólo lectura. El administrador que lo ha bloqueado ofrece esta explicación: "$3".', 'invalidtitle-knownnamespace' => 'Título no válido con el espacio de nombres "$2" y el texto "$3"', 'invalidtitle-unknownnamespace' => 'Título no válido con número de espacio de nombres desconocido $1 y el texto "$2"', 'exception-nologin' => 'No has iniciado sesión', 'exception-nologin-text' => '[[Special:Userlogin|Inicia sesión]] para acceder a esta página o acción.', 'exception-nologin-text-manual' => 'Necesitas $1 para acceder a esta página o acción.', # Virus scanner 'virus-badscanner' => "Error de configuración: Antivirus desconocido: ''$1''", 'virus-scanfailed' => 'falló el análisis (código $1)', 'virus-unknownscanner' => 'antivirus desconocido:', # Login and logout pages 'logouttext' => '"\'Usted está ahora desconectado."\' Tenga en cuenta que algunas páginas pueden continuar mostrándose como si todavía estuviera conectado, hasta que borres la caché de tu navegador.', 'welcomeuser' => '¡Te damos la bienvenida, $1!', 'welcomecreation-msg' => 'Se ha creado tu cuenta. No olvides personalizar tus [[Special:Preferences|preferencias de {{SITENAME}}]].', 'yourname' => 'Nombre de usuario:', 'userlogin-yourname' => 'Usuario', 'userlogin-yourname-ph' => 'Escribe tu nombre de usuario', 'createacct-another-username-ph' => 'Escribe el nombre de usuario', 'yourpassword' => 'Contraseña:', 'userlogin-yourpassword' => 'Contraseña', 'userlogin-yourpassword-ph' => 'Escribe tu contraseña', 'createacct-yourpassword-ph' => 'Escribe una contraseña', 'yourpasswordagain' => 'Confirma la contraseña:', 'createacct-yourpasswordagain' => 'Confirma la contraseña', 'createacct-yourpasswordagain-ph' => 'Repite la contraseña', 'remembermypassword' => 'Mantenerme conectado en este navegador (hasta $1 {{PLURAL:$1|día|días}})', 'userlogin-remembermypassword' => 'Mantener mi sesión iniciada', 'userlogin-signwithsecure' => 'Usar conexión segura', 'yourdomainname' => 'Dominio', 'password-change-forbidden' => 'No puedes cambiar las contraseñas de este wiki.', 'externaldberror' => 'Hubo un error de autenticación externa de la base de datos o bien no tienes autorización para actualizar tu cuenta externa.', 'login' => 'Iniciar sesión', 'nav-login-createaccount' => 'Iniciar sesión / crear cuenta', 'loginprompt' => "Necesita activar las ''cookies'' en el navegador para iniciar sesión en {{SITENAME}}.", 'userlogin' => 'Iniciar sesión / crear cuenta', 'userloginnocreate' => 'Iniciar sesión', 'logout' => 'Cerrar sesión', 'userlogout' => 'Cerrar sesión', 'notloggedin' => 'No has iniciado sesión', 'userlogin-noaccount' => '¿No tienes una cuenta?', 'userlogin-joinproject' => 'Únete a {{SITENAME}}', 'nologin' => '¿No tienes una cuenta? $1.', 'nologinlink' => 'Crear una cuenta', 'createaccount' => 'Crear una cuenta', 'gotaccount' => '¿Ya tienes una cuenta? $1.', 'gotaccountlink' => 'Iniciar sesión', 'userlogin-resetlink' => '¿Olvidaste tus datos de acceso?', 'userlogin-resetpassword-link' => '¿Has olvidado tu contraseña?', 'helplogin-url' => 'Help:Inicio de sesión', 'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Ayuda]]', 'userlogin-loggedin' => 'Ya estás conectado como {{GENDER:$1|$1}}. Usa el formulario de abajo para iniciar sesión como otro usuario.', 'userlogin-createanother' => 'Crear otra cuenta', 'createacct-join' => 'Introduce tus datos debajo.', 'createacct-another-join' => 'Escribe la información de la cuenta nueva a continuación.', 'createacct-emailrequired' => 'Dirección de correo electrónico', 'createacct-emailoptional' => 'Dirección de correo electrónico (opcional)', 'createacct-email-ph' => 'Escribe tu dirección de correo electrónico', 'createacct-another-email-ph' => 'Introduzca la dirección de correo electrónico', 'createaccountmail' => 'Utilizar una contraseña aleatoria temporal y enviarla a la dirección de correo electrónico especificada', 'createacct-realname' => 'Nombre real (opcional)', 'createaccountreason' => 'Motivo:', 'createacct-reason' => 'Motivo', 'createacct-reason-ph' => 'Por qué estás creando otra cuenta', 'createacct-captcha' => 'Comprobación de seguridad', 'createacct-imgcaptcha-ph' => 'Escribe el texto de arriba', 'createacct-submit' => 'Crea tu cuenta', 'createacct-another-submit' => 'Crear otra cuenta', 'createacct-benefit-heading' => '{{SITENAME}} es hecha por gente como tú.', 'createacct-benefit-body1' => '{{PLURAL:$1|edición|ediciones}}', 'createacct-benefit-body2' => '{{PLURAL:$1|página|páginas}}', 'createacct-benefit-body3' => '{{PLURAL:$1|colaborador reciente|colaboradores recientes}}', 'badretype' => 'Las contraseñas no coinciden.', 'userexists' => 'El nombre de usuario indicado ya está en uso. Elige un nombre diferente.', 'loginerror' => 'Error de inicio de sesión', 'createacct-error' => 'Error al crear la cuenta', 'createaccounterror' => 'No se pudo crear la cuenta: $1', 'nocookiesnew' => 'La cuenta de usuario ha sido creada, pero no has iniciado sesión. {{SITENAME}} usa <em>cookies</em> para identificar a los usuarios registrados. Tu navegador tiene desactivadas las cookies. Por favor, actívalas e inicia sesión con tu nuevo nombre de usuario y contraseña.', 'nocookieslogin' => '{{SITENAME}} utiliza <em>cookies</em> para la autenticación de usuarios. Las <em>cookies</em> están desactivadas en tu navegador. Por favor, actívalas e inténtalo de nuevo.', 'nocookiesfornew' => 'No se pudo crear la cuenta de usuario, porque no pudimos confirmar su origen. Asegúrate de que tienes las cookies activadas, luego recarga esta página e inténtalo de nuevo.', 'noname' => 'No se ha especificado un nombre de usuario válido.', 'loginsuccesstitle' => 'Inicio de sesión exitoso', 'loginsuccess' => "'''Has iniciado sesión en {{SITENAME}} como «$1».'''", 'nosuchuser' => 'No existe ningún usuario llamado «$1». Los nombres de usuario son sensibles a las mayúsculas. Revisa la ortografía, o [[Special:UserLogin/signup|crea una cuenta nueva]].', 'nosuchusershort' => 'No hay un usuario con el nombre «$1». Comprueba que lo has escrito correctamente.', 'nouserspecified' => 'Debes especificar un nombre de usuario.', 'login-userblocked' => 'Este usuario está bloqueado. Inicio de sesión no permitido.', 'wrongpassword' => 'La contraseña indicada es incorrecta. Inténtalo de nuevo.', 'wrongpasswordempty' => 'No has escrito una contraseña. Inténtalo de nuevo.', 'passwordtooshort' => 'Las contraseñas deben tener al menos {{PLURAL:$1|1 caracter|$1 caracteres}}.', 'password-name-match' => 'Tu contraseña debe ser diferente de tu nombre de usuario.', 'password-login-forbidden' => 'El uso de este nombre de usuario y contraseña han sido prohibidos.', 'mailmypassword' => 'Restablecer la contraseña', 'passwordremindertitle' => 'Recordatorio de contraseña de {{SITENAME}}', 'passwordremindertext' => 'Alguien (probablemente tú, desde la dirección IP $1) solicitó que te enviáramos una nueva contraseña para tu cuenta en {{SITENAME}} ($4). Se ha creado la siguiente contraseña temporal para el usuario «$2»: «$3» Ahora deberías iniciar sesión y cambiar tu contraseña. Tu contraseña temporal expirará en {{PLURAL:$5|un día|$5 días}}. Si fue otro quien solicitó este mensaje o has recordado tu contraseña y ya no deseas cambiarla, puedes ignorar este mensaje y seguir usando tu contraseña original.', 'noemail' => 'No hay una dirección de correo electrónico registrada para «$1».', 'noemailcreate' => 'Necesitas proveer una dirección de correo electrónico válida', 'passwordsent' => 'Se ha enviado una nueva contraseña al correo electrónico de «$1». Por favor, identifícate de nuevo tras recibirla.', 'blocked-mailpassword' => 'Tu dirección IP está bloqueada, y no se te permite el uso de la función de recuperación de contraseñas para prevenir abusos.', 'eauthentsent' => 'Se ha enviado un correo electrónico de confirmación a la dirección especificada. Antes de que se envíe cualquier otro correo a la cuenta tienes que seguir las instrucciones enviadas en el mensaje para así confirmar que la dirección te pertenece.', 'throttled-mailpassword' => 'Ya se ha enviado un recordatorio de contraseña en {{PLURAL:$1|la última hora|las últimas $1 horas}}. Para evitar los abusos, solo se enviará un recordatorio de contraseña cada {{PLURAL:$1|hora|$1 horas}}.', 'mailerror' => 'Error al enviar correo: $1', 'acct_creation_throttle_hit' => 'Los visitantes a este wiki usando tu dirección IP han creado {{PLURAL:$1|una cuenta|$1 cuentas}} en el último día, lo cual es lo máximo permitido en este periodo de tiempo. Como resultado, los visitantes usando esta dirección IP no pueden crear más cuentas en este momento.', 'emailauthenticated' => 'Tu dirección de correo electrónico fue confirmada el $2 a las $3.', 'emailnotauthenticated' => 'Aún no has confirmado tu dirección de correo electrónico. Hasta que lo hagas, las siguientes funciones no estarán disponibles.', 'noemailprefs' => 'Especifica una dirección electrónica para habilitar estas características.', 'emailconfirmlink' => 'Confirmar dirección de correo electrónico', 'invalidemailaddress' => 'La dirección electrónica no puede ser aceptada, pues parece que tiene un formato no válido. Por favor, escribe una dirección en el formato adecuado o deja el campo en blanco.', 'cannotchangeemail' => 'Las direcciones de la correo electrónico de las cuentas de usuario no puedes cambiarse en esta wiki.', 'emaildisabled' => 'Este sitio no puede enviar mensajes de correo electrónico.', 'accountcreated' => 'Se ha creado la cuenta', 'accountcreatedtext' => 'La cuenta de usuario de [[{{ns:User}}:$1|$1]] ([[{{ns:User talk}}:$1|talk]]) ha sido creada.', 'createaccount-title' => 'Creación de cuenta para {{SITENAME}}', 'createaccount-text' => 'Alguien creó en {{SITENAME}} ($4) una cuenta asociada a este correo electrónico con el nombre «$2». La contraseña asignada automáticamente es «$3». Por favor entra ahora y cambia tu contraseña. Puedes ignorar este mensaje si esta cuenta fue creada por error.', 'usernamehasherror' => 'El nombre de usuario no puede contener símbolos de almohadilla/numeral', 'login-throttled' => 'Has intentado demasiadas veces iniciar sesión. Por favor espera $1 antes de intentarlo nuevamente.', 'login-abort-generic' => 'Tu inicio de sesión no fue exitoso - Cancelado', 'loginlanguagelabel' => 'Idioma: $1', 'suspicious-userlogout' => 'Tu solicitud de desconexión ha sido denegada, pues parece haber sido enviada desde un navegador defectuoso o un proxy caché.', 'createacct-another-realname-tip' => 'El nombre real es opcional. Si se proporciona, se usará para dar al usuario la atribución de su trabajo.', # Email sending 'php-mail-error-unknown' => 'Error desconocido en la función mail() de PHP.', 'user-mail-no-addy' => 'Se ha intentado enviar correo electrónico sin una dirección de correo electrónico.', 'user-mail-no-body' => 'Trató de enviar un correo electrónico con un cuerpo vacío o excesivamente corto.', # Change password dialog 'changepassword' => 'Cambiar contraseña', 'resetpass_announce' => 'Has iniciado sesión con una contraseña temporal que fue enviada por correo electrónico. Establece una contraseña nueva aquí:', 'resetpass_text' => '<!-- Añada texto aquí -->', 'resetpass_header' => 'Cambiar la contraseña de la cuenta', 'oldpassword' => 'Contraseña antigua:', 'newpassword' => 'Contraseña nueva:', 'retypenew' => 'Confirmar la contraseña nueva:', 'resetpass_submit' => 'Establecer contraseña e iniciar sesión', 'changepassword-success' => 'La contraseña ha sido cambiada con éxito.', 'changepassword-throttled' => 'Has intentado acceder demasiadas veces. Espera $1 antes de intentarlo de nuevo.', 'resetpass_forbidden' => 'No se pueden cambiar las contraseñas', 'resetpass-no-info' => 'Debes iniciar sesión para acceder directamente a esta página.', 'resetpass-submit-loggedin' => 'Cambiar contraseña', 'resetpass-submit-cancel' => 'Cancelar', 'resetpass-wrong-oldpass' => 'La contraseña antigua no es correcta. Puede que ya hayas cambiado la contraseña o que hayas pedido una temporal.', 'resetpass-temp-password' => 'Contraseña temporal:', 'resetpass-abort-generic' => 'Una extensión ha cancelado el cambio de la contraseña.', # Special:PasswordReset 'passwordreset' => 'Restablecimiento de contraseña', 'passwordreset-text-one' => 'Completa este formulario para restablecer tu contraseña.', 'passwordreset-text-many' => '{{PLURAL:$1|Rellena uno de los campos para restablecer la contraseña.}}', 'passwordreset-legend' => 'Restablecer contraseña', 'passwordreset-disabled' => 'Se ha desactivado el restablecimiento de contraseñas en este wiki.', 'passwordreset-emaildisabled' => 'Las funciones de correo electrónico han sido desactivadas en esta wiki.', 'passwordreset-username' => 'Nombre de usuario:', 'passwordreset-domain' => 'Dominio:', 'passwordreset-capture' => '¿Ver el mensaje resultante?', 'passwordreset-capture-help' => 'Si marcas esta casilla, se te mostrará el correo electrónico (con la contraseña temporal) además de enviarse al usuario.', 'passwordreset-email' => 'Dirección de correo electrónico:', 'passwordreset-emailtitle' => 'Detalles de la cuenta en {{SITENAME}}', 'passwordreset-emailtext-ip' => 'Alguien (probablemente tú, desde la dirección IP $1) ha solicitado la renovación de tu clave para {{SITENAME}} ($4). {{PLURAL:$3|La siguiente cuenta está asociada|Las siguientes cuentas están asociadas}} con esta dirección de correo electrónico: $2 {{PLURAL:$3|Esta contraseña temporal|Estas contraseñas temporales}} caducarán en {{PLURAL:$5|un día|$5 días}}. Deberías iniciar sesión y establecer una contraseña nueva ahora. Si otra persona ha realizado este solicitud o si recuerdas tu contraseña original y no deseas cambiarla, puedes ignorar este mensaje y continuar usando tu contraseña anterior.', 'passwordreset-emailtext-user' => 'El usuario $1 en {{SITENAME}} pidió un recordatorio de tus datos de cuenta para {{SITENAME}} ($4). {{PLURAL:$3|La siguiente cuenta está asociada|Las siguientes cuentas están asociadas}} con esta dirección de correo electrónico: $2 {{PLURAL:$3|Esta contraseña temporal|Estas contraseñas temporales}} expirarán en {{PLURAL:$5|un día|$5 días}}. Deberías iniciar sesión y establecer una contraseña nueva ahora. Si alguien más hizo este pedido, o recuerdas tu contraseña original, y no deseas cambiarla, puedes ignorar este mensaje y continuar usando tu contraseña anterior.', 'passwordreset-emailelement' => 'Nombre de usuario: $1 Contraseña temporal: $2', 'passwordreset-emailsent' => 'Se ha enviado un correo electrónico para el restablecimiento de tu contraseña.', 'passwordreset-emailsent-capture' => 'Se ha enviado un correo para el restablecimiento de la contraseña, el cual se muestra a continuación.', 'passwordreset-emailerror-capture' => 'Se generó un correo electrónico de restablecimiento de contraseña, que se muestra a continuación, pero el envío {{GENDER:$2|al usuario|a la usuaria}} falló. $1', # Special:ChangeEmail 'changeemail' => 'Cambiar la dirección de correo electrónico', 'changeemail-header' => 'Cambiar la dirección de correo de la cuenta', 'changeemail-text' => 'Rellena este formulario para cambiar tu dirección de correo electrónico. Debes introducir la contraseña para confirmar este cambio.', 'changeemail-no-info' => 'Debes iniciar sesión para acceder directamente a esta página.', 'changeemail-oldemail' => 'Dirección electrónica actual:', 'changeemail-newemail' => 'Dirección electrónica nueva:', 'changeemail-none' => '(ninguna)', 'changeemail-password' => 'Tu contraseña en {{SITENAME}}:', 'changeemail-submit' => 'Cambiar correo electrónico', 'changeemail-cancel' => 'Cancelar', 'changeemail-throttled' => 'Has intentado acceder demasiadas veces. Espera $1 antes de intentarlo de nuevo.', # Special:ResetTokens 'resettokens' => 'Restablecer claves', 'resettokens-text' => 'Puede restablecer las claves que permiten el acceso a ciertos datos privados asociados a tu cuenta aquí. Deberías hacerlo si accidentalmente la has compartido con alguien o si su cuenta ha sido comprometida.', 'resettokens-no-tokens' => 'No hay claves para restablecer.', 'resettokens-legend' => 'Restablecer claves', 'resettokens-tokens' => 'Claves:', 'resettokens-token-label' => '$1 (valor actual: $2)', 'resettokens-watchlist-token' => 'Clave para la lista de seguimiento (RSS/Atom) de los [[Special:Watchlist|cambios a las páginas en tu lista de seguimiento]]', 'resettokens-done' => 'Restablecimiento de claves.', 'resettokens-resetbutton' => 'Restablecer las claves', # Edit page toolbar 'bold_sample' => 'Texto en negrita', 'bold_tip' => 'Texto en negrita', 'italic_sample' => 'Texto en cursiva', 'italic_tip' => 'Texto en cursiva', 'link_sample' => 'Título del enlace', 'link_tip' => 'Enlace interno', 'extlink_sample' => 'http://www.ejemplo.com Título del enlace', 'extlink_tip' => 'Enlace externo (recuerda añadir el prefijo http://)', 'headline_sample' => 'Texto de encabezado', 'headline_tip' => 'Encabezado de nivel 2', 'nowiki_sample' => 'Insertar aquí texto sin formato', 'nowiki_tip' => 'Ignorar el formato wiki', 'image_sample' => 'Ejemplo.jpg', 'image_tip' => 'Archivo incrustado', 'media_sample' => 'Ejemplo.ogg', 'media_tip' => 'Enlace a archivo', 'sig_tip' => 'Tu firma con fecha y hora', 'hr_tip' => 'Línea horizontal (utilizar con moderación)', # Edit pages 'summary' => 'Resumen:', 'subject' => 'Asunto/encabezado:', 'minoredit' => 'Esta es una edición menor', 'watchthis' => 'Vigilar esta página', 'savearticle' => 'Guardar la página', 'preview' => 'Previsualizar', 'showpreview' => 'Mostrar previsualización', 'showlivepreview' => 'Previsualización dinámica', 'showdiff' => 'Mostrar los cambios', 'anoneditwarning' => "'''Aviso:''' No has iniciado sesión con una cuenta de usuario. Tu dirección IP se almacenará en el historial de ediciones de la página.", 'anonpreviewwarning' => "''No has iniciado sesión con una cuenta de usuario. Al guardar los cambios se almacenará tu dirección IP en el historial de edición de la página.''", 'missingsummary' => "'''Atención:''' No has escrito un resumen de edición. Si haces clic nuevamente en «{{int:savearticle}}» tu edición se grabará sin él.", 'missingcommenttext' => 'Escribe un comentario a continuación.', 'missingcommentheader' => "'''Recordatorio:''' No has escrito un título para este comentario. Si haces clic nuevamente en \"{{int:savearticle}}\" tu edición se grabará sin él.", 'summary-preview' => 'Previsualización del resumen:', 'subject-preview' => 'Previsualización del tema/título:', 'blockedtitle' => 'El usuario está bloqueado', 'blockedtext' => "'''Tu nombre de usuario o dirección IP ha sido bloqueada.''' El bloqueo fue hecho por $1. La razón dada es ''$2''. * Inicio del bloqueo: $8 * Caducidad del bloqueo: $6 * Bloqueo destinado a: $7 Puedes contactar con $1 u otro [[{{MediaWiki:Grouppage-sysop}}|administrador]] para discutir el bloqueo. No puedes utilizar la función «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y que el bloqueo no haya inhabilitado esta función. Tu dirección IP actual es $3, y el identificador del bloqueo es #$5. Por favor incluye todos los datos aquí mostrados en cualquier consulta que hagas.", 'autoblockedtext' => "Tu dirección IP ha sido bloqueada automáticamente porque fue utilizada por otro usuario que fue bloqueado por $1. La razón dada es esta: :''$2'' * Inicio del bloqueo: $8 * Caducidad del bloqueo: $6 * Bloqueo destinado a: $7 Puedes contactar con $1 o con otro de los [[{{MediaWiki:Grouppage-sysop}}|administradores]] para discutir el bloqueo. Ten en cuenta que no podrás utilizar la herramienta de «enviar correo electrónico a este usuario» a menos que tengas una dirección de correo electrónico válida registrada en tus [[Special:Preferences|preferencias de usuario]] y que el bloqueo no haya inhabilitado esta función. Tu actual dirección IP es $3, y el identificador del bloqueo es #$5. Por favor, incluye todos los datos mostrados aquí en cualquier consulta que hagas.", 'blockednoreason' => 'no se ha especificado el motivo', 'whitelistedittext' => 'Tienes que $1 para editar artículos.', 'confirmedittext' => 'Debes confirmar tu dirección electrónica antes de editar páginas. Por favor, establece y valida una dirección electrónica a través de tus [[Special:Preferences|preferencias de usuario]].', 'nosuchsectiontitle' => 'Sección no encontrada', 'nosuchsectiontext' => 'Has intentado editar una sección que no existe. Quizá ha sido movida o borrada mientras visitabas la página.', 'loginreqtitle' => 'Es necesario iniciar sesión', 'loginreqlink' => 'iniciar sesión', 'loginreqpagetext' => 'Debes $1 para ver otras páginas.', 'accmailtitle' => 'Se ha enviado la contraseña', 'accmailtext' => 'Se ha enviado a $2 una contraseña generada aleatoriamente para [[User talk:$1|$1]]. La contraseña para esta nueva cuenta puede cambiarse en [[Special:ChangePassword|la página destinada para ello]] después de haber iniciado sesión.', 'newarticle' => '(Nuevo)', 'newarticletext' => 'Has seguido un enlace a una página que aún no existe. Para crear esta página, escribe en el campo a continuación. Para más información, consulta la [[{{MediaWiki:Helppage}}|página de ayuda]]. Si llegaste aquí por error, vuelve a la página anterior.', 'anontalkpagetext' => "---- ''Esta es la página de discusión de un usuario anónimo que aún no ha creado una cuenta, o no la usa. Por lo tanto, tenemos que usar su dirección IP para identificarlo. Una dirección IP puede ser compartida por varios usuarios. Si eres un usuario anónimo y crees que se han dirigido a ti con comentarios improcedentes, por favor [[Special:UserLogin/signup|crea una cuenta]] o si ya la tienes [[Special:UserLogin|identifícate]] para evitar confusiones futuras con otros usuarios anónimos.''", 'noarticletext' => 'En este momento no hay texto en esta página. Puedes [[Special:Search/{{PAGENAME}}|buscar el título de esta página]] en otras páginas, <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} buscar en los registros], o [{{fullurl:{{FULLPAGENAME}}|action=edit}} editar esta página]</span>.', 'noarticletext-nopermission' => 'Actualmente no hay texto en esta página. Puedes [[Special:Search/{{PAGENAME}}|buscar este título de página]] en otras páginas, o <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} buscar en los registros relacionados]</span>, pero no tienes permiso para crear esta página.', 'missing-revision' => 'La revisión n.º $1 de la página llamada «{{PAGENAME}}» no existe. Normalmente esto ocurre cuando se sigue un enlace de historial obsoleto que apunta a una página ya borrada. Puedes encontrar detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].', 'userpage-userdoesnotexist' => 'La cuenta de usuario «<nowiki>$1</nowiki>» no está registrada. Por favor comprueba si quieres crear o editar esta página.', 'userpage-userdoesnotexist-view' => 'La cuenta de usuario «$1» no está registrada.', 'blocked-notice-logextract' => 'Este usuario está actualmente bloqueado. La última entrada del registro de bloqueos se proporciona debajo para mayor referencia:', 'clearyourcache' => "'''Nota:''' después de guardar, quizás necesites refrescar la caché de tu navegador para ver los cambios. * '''Firefox / Safari:''' Mantén presionada ''Mayús'' mientras pulsas el botón ''Actualizar'', o presiona ''Ctrl+F5'' o ''Ctrl+R'' (''⌘+R'' en Mac) * '''Google Chrome:''' presiona ''Ctrl+Shift+R'' (''⌘+Mayús+R'' en Mac) * '''Internet Explorer:''' mantén presionada ''Ctrl'' mientras pulsas ''Actualizar'', o presiona ''Ctrl+F5'' * '''Opera:''' vacía la caché en ''Herramientas → Preferencias''", 'usercssyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo CSS antes de guardarlo.", 'userjsyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo JS antes de guardarlo.", 'usercsspreview' => "'''Recuerda que sólo estás previsualizando tu CSS de usuario.''' '''¡Aún no se ha guardado!'''", 'userjspreview' => "'''¡Recuerda que solo estás previsualizando tu JavaScript de usuario.''' '''¡Aún no se ha guardado!'''", 'sitecsspreview' => "'''Recuerda que sólo estás previsualizando este CSS''' '''¡Aún no se ha guardado!'''", 'sitejspreview' => "'''Recuerda que sólo estás previsualizando este código JavaScript.''' '''¡Aún no se ha guardado!'''", 'userinvalidcssjstitle' => "'''Aviso:''' No existe la apariencia «$1». Recuerda que las páginas personalizadas ''.css'' y ''.js'' tienen un título en minúsculas. Por ejemplo, {{ns:user}}:Ejemplo/vector.css en vez de {{ns:user}}:Ejemplo/Vector.css.", 'updated' => '(Actualizado)', 'note' => "'''Nota:'''", 'previewnote' => "'''Recuerda que esto es solo una previsualización.''' ¡Tus cambios aún no se han guardado!", 'continue-editing' => 'Ir al área de edición', 'previewconflict' => 'Esta previsualización refleja el texto en el área de edición superior como aparecerá una vez guardados los cambios.', 'session_fail_preview' => "'''No se pudo procesar la edición debido a una pérdida de los datos de sesión.''' Inténtalo de nuevo. Si el problema persiste, [[Special:UserLogout|cierra la sesión]] y vuelve a identificarte.", 'session_fail_preview_html' => "'''Lo sentimos, no hemos podido procesar tu cambio debido a una pérdida de datos de sesión.''' ''Puesto que este wiki tiene el HTML puro habilitado, la visión preliminar está oculta para prevenirse contra ataques en JavaScript.'' '''Si éste es un intento legítimo de modificación, por favor, inténtalo de nuevo. Si aún así no funcionase, [[Special:UserLogout|cierra la sesión]] e ingresa de nuevo.'''", 'token_suffix_mismatch' => "'''Tu edición ha sido rechazada porque tu cliente ha mezclado los signos de puntuación en el token de edición. Se rechazó la edición para evitar que el texto de la página se corrompa. Esto sucede en ocasiones cuando se usa un servicio de proxy anónimo defectuoso.'''", 'edit_form_incomplete' => "'''Algunas partes del formulario de edición no llegaron al servidor, comprueba que tus ediciones están intactas e inténtalo de nuevo'''.", 'editing' => 'Editar $1', 'creating' => 'Crear la página $1', 'editingsection' => 'Editar $1 (sección)', 'editingcomment' => 'Editar $1 (sección nueva)', 'editconflict' => 'Conflicto de edición: $1', 'explainconflict' => "Alguien más ha cambiado esta página desde que empezaste a editarla. El área de texto superior contiene el texto de la página como existe actualmente. Tus cambios se muestran en el área de texto inferior. Si quieres grabar tus cambios, has de trasladarlos al área superior. '''Sólo''' el texto en el área de texto superior será grabado cuando pulses «{{int:savearticle}}».", 'yourtext' => 'Tu texto', 'storedversion' => 'Versión almacenada', 'nonunicodebrowser' => "'''Atención: Tu navegador no cumple la norma Unicode.''' Se ha activado un sistema de edición alternativo que te permitirá editar artículos con seguridad: los caracteres no ASCII aparecerán en la caja de edición como códigos hexadecimales.", 'editingold' => "'''Aviso: Estás editando una versión antigua de esta página.''' Si la guardas, se perderán los cambios realizados desde esta revisión.", 'yourdiff' => 'Diferencias', 'copyrightwarning' => "Por favor observa que todas las contribuciones a {{SITENAME}} se consideran hechas públicas bajo la $2 (véase $1 para más detalles). Si no deseas la modificación y distribución libre de tu obra, entonces no la pongas aquí.<br />También nos aseguras que tú escribiste esto y te pertenecen de los derechos de autor, o lo copiaste desde el dominio público u otra fuente libre. '''¡No uses escritos con copyright sin permiso!'''", 'copyrightwarning2' => "Por favor, ten en cuenta que todas las contribuciones a {{SITENAME}} pueden ser editadas, modificadas o eliminadas por otros colaboradores. Si no deseas que las modifiquen sin limitaciones y las distribuyan libremente, entonces no las pongas aquí.<br />También nos aseguras que tú escribiste esto y te pertenecen de los derechos de autor, o lo copiaste desde el dominio público u otra fuente libre. (véase $1 para más detalles). '''¡No uses escritos con copyright sin permiso!'''", 'longpageerror' => "'''Error: El texto que has enviado ocupa {{PLURAL:$1|un kilobyte|$1 kilobytes}}, que excede el máximo de {{PLURAL:$2|un kilobyte|$2 kilobytes}}.''' No se lo puede guardar.", 'readonlywarning' => "'''Advertencia: La base de datos ha sido bloqueada para mantenimiento, así que no podrás guardar tus ediciones en este momento.''' Quizás quieras copiar y pegar tu texto en un archivo de texto y guardarlo para después. El administrador que lo bloqueó ofreció esta explicación: $1", 'protectedpagewarning' => "'''Aviso: Esta página ha sido protegida de manera que solo usuarios con permisos de administrador puedan editarla.''' A continuación se muestra la última entrada de registro para referencia:", 'semiprotectedpagewarning' => "'''Nota:''' Esta página ha sido protegida para que solo usuarios registrados puedan editarla. A continuación se provee la última entrada de registro para referencia:", 'cascadeprotectedwarning' => "'''Aviso:''' Esta página está protegida, solo los administradores pueden editarla porque está incluida en {{PLURAL:$1|la siguiente página protegida|las siguientes páginas protegidas}} en cascada:", 'titleprotectedwarning' => "'''Aviso: Esta página está protegida de modo que se necesitan [[Special:ListGroupRights|derechos especificos]] para crearla.''' A continuación se muestra la última entrada de registro para referencia:", 'templatesused' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta página:', 'templatesusedpreview' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta previsualización:', 'templatesusedsection' => '{{PLURAL:$1|Plantilla usada|Plantillas usadas}} en esta sección:', 'template-protected' => '(protegida)', 'template-semiprotected' => '(semiprotegida)', 'hiddencategories' => 'Esta página es un miembro de {{PLURAL:$1|1 categoría oculta|$1 categorías ocultas}}:', 'edittools' => '<!-- Este texto aparecerá bajo los formularios de edición y subida. -->', 'nocreatetext' => '{{SITENAME}} ha restringido la posibilidad de crear nuevas páginas. Puede volver atrás y editar una página existente, [[Special:UserLogin|identificarte o crear una cuenta]].', 'nocreate-loggedin' => 'No tienes permiso para crear páginas nuevas.', 'sectioneditnotsupported-title' => 'Edición de sección no compatible', 'sectioneditnotsupported-text' => 'La edición de sección no es compatible con esta página.', 'permissionserrors' => 'Error de permiso', 'permissionserrorstext' => 'No tienes permiso para hacer eso, por {{PLURAL:$1|el siguiente motivo|los siguientes motivos}}:', 'permissionserrorstext-withaction' => 'No tienes permiso para $2, por {{PLURAL:$1|el siguiente motivo|los siguientes motivos}}:', 'recreate-moveddeleted-warn' => "'''Atención: estás volviendo a crear una página que ha sido borrada anteriormente.''' Deberías considerar si es apropiado continuar editando esta página. El registro de borrado y traslados para esta página están provistos aquí por conveniencia:", 'moveddeleted-notice' => 'Esta página ha sido borrada. El registro de borrados y traslados para la página están provistos debajo como referencia.', 'log-fulllog' => 'Ver el registro completo', 'edit-hook-aborted' => 'Edición cancelada por la extensión. No se aportaron explicaciones.', 'edit-gone-missing' => 'No se pudo actualizar la página. Parece que ha sido borrada.', 'edit-conflict' => 'Conflicto de edición.', 'edit-no-change' => 'Se ignoró tu revisión, porque no se hizo ningún cambio al texto.', 'postedit-confirmation' => 'Se ha guardado tu edición.', 'edit-already-exists' => 'No se pudo crear una página nueva. Ya existe.', 'defaultmessagetext' => 'Texto de mensaje predeterminado', 'content-failed-to-parse' => 'No se pudo analizar el contenido $2 del modelo $1: $3', 'invalid-content-data' => 'Datos de contenido inválidos', 'content-not-allowed-here' => 'El contenido "$1" no está permitido en la página [[$2]]', 'editwarning-warning' => 'Se perderán los cambios si se cierra esta página. Si has iniciado sesión, puedes desactivar este aviso en la sección «{{int:prefs-editing}}» de las preferencias.', 'editpage-notsupportedcontentformat-title' => 'Formato de contenido no admitido', 'editpage-notsupportedcontentformat-text' => 'El formato de contenido $1 no es compatible con el modelo de contenido $2.', # Content models 'content-model-wikitext' => 'texto wiki', 'content-model-text' => 'Texto sin formato', 'content-model-javascript' => 'JavaScript', 'content-model-css' => 'CSS', # Parser/template warnings 'expensive-parserfunction-warning' => 'Aviso: Esta página contiene demasiadas llamadas a funciones sintácticas costosas (#ifexist: y similares) Tiene {{PLURAL:$1|una llamada|$1 llamadas}}, pero debería tener menos de $2.', 'expensive-parserfunction-category' => 'Páginas con llamadas a funciones sintácticas demasiado costosas', 'post-expand-template-inclusion-warning' => 'Aviso: El tamaño de las plantillas incluidas es muy grande. Algunas plantillas no serán incluidas.', 'post-expand-template-inclusion-category' => 'Páginas con sobrecarga de plantillas', 'post-expand-template-argument-warning' => 'Aviso: Esta página contiene al menos un parámetro de plantilla que tiene un tamaño de expansión demasiado grande. Ese o esos parámetros han sido omitidos.', 'post-expand-template-argument-category' => 'Páginas que contienen plantillas con parámetros descartados', 'parser-template-loop-warning' => 'Detectado bucle de plantilla: [[$1]]', 'parser-template-recursion-depth-warning' => 'Se ha excedido el límite de recursión de plantillas ($1)', 'language-converter-depth-warning' => 'El límite de profundidad del convertidor de idioma ha excedido ($1)', 'node-count-exceeded-category' => 'Páginas donde se supera el número de nodos', 'node-count-exceeded-warning' => 'Página que ha superado el número de nodos', 'expansion-depth-exceeded-category' => 'Páginas donde se supera la profundidad de expansión', 'expansion-depth-exceeded-warning' => 'Página que ha superado la profundidad de expansión', 'parser-unstrip-loop-warning' => 'Se ha detectado un bucle "unstrip"', 'parser-unstrip-recursion-limit' => 'Se ha superado el límite de recursión de "unstrip" ($1)', 'converter-manual-rule-error' => 'Error detectado en la regla de conversión manual del lenguaje', # "Undo" feature 'undo-success' => 'La edición puede deshacerse. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces guarda los cambios para así deshacer la edición.', 'undo-failure' => 'No se puede deshacer la edición ya que otro usuario ha realizado una edición intermedia.', 'undo-norev' => 'La edición no puede ser deshecha porque no existe o ha sido borrada.', 'undo-nochange' => 'Parece que ya se ha deshecho la modificación.', 'undo-summary' => 'Deshecha la revisión $1 de [[Special:Contributions/$2|$2]] ([[User talk:$2|disc.]])', 'undo-summary-username-hidden' => 'Deshacer revisión $1 por usuario oculto', # Account creation failure 'cantcreateaccounttitle' => 'No se puede crear la cuenta', 'cantcreateaccount-text' => "La creación de cuentas desde esta dirección IP ('''$1''') ha sido bloqueada por [[User:$3|$3]]. El motivo dado por $3 es ''$2''", 'cantcreateaccount-range-text' => "La creación de cuentas de usuario desde direcciones IP en el rango '''$1''', que incluye tu dirección IP ('''$4'''), ha sido bloqueada por [[User:$3|$3]]. El motivo dado por $3 es ''$2''", # History pages 'viewpagelogs' => 'Ver los registros de esta página', 'nohistory' => 'No hay historial de ediciones para esta página.', 'currentrev' => 'Revisión actual', 'currentrev-asof' => 'Última revisión de $1', 'revisionasof' => 'Revisión de $1', 'revision-info' => 'Revisión a fecha de $1; $2', 'previousrevision' => '← Revisión anterior', 'nextrevision' => 'Revisión siguiente →', 'currentrevisionlink' => 'Revisión actual', 'cur' => 'act', 'next' => 'sig', 'last' => 'ant', 'page_first' => 'primeras', 'page_last' => 'últimas', 'histlegend' => "Selección de diferencias: marca los selectores de las versiones a comparar y pulsa ''enter'' o el botón de abajo.<br /> Leyenda: '''(act)''' = diferencias con la versión actual, '''(ant)''' = diferencias con la versión anterior, '''m''' = edición menor", 'history-fieldset-title' => 'Buscar en el historial', 'history-show-deleted' => 'Solo ediciones ocultadas', 'histfirst' => 'primeras', 'histlast' => 'últimas', 'historysize' => '({{PLURAL:$1|1 byte|$1 bytes}})', 'historyempty' => '(vacío)', # Revision feed 'history-feed-title' => 'Historial de revisiones', 'history-feed-description' => 'Historial de revisiones para esta página en el wiki', 'history-feed-item-nocomment' => '$1 en $2', 'history-feed-empty' => 'La página solicitada no existe. Puede haber sido borrada del wiki o renombrada. Prueba a [[Special:Search|buscar en el wiki]] nuevas páginas relevantes.', # Revision deletion 'rev-deleted-comment' => '(resumen de edición eliminado)', 'rev-deleted-user' => '(nombre de usuario eliminado)', 'rev-deleted-event' => '(entrada borrada)', 'rev-deleted-user-contribs' => '[nombre de usuario o dirección IP eliminada - edición ocultada de la lista de contribuciones]', 'rev-deleted-text-permission' => "Esta revisión de la página ha sido '''borrada'''. Puede haber detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].", 'rev-deleted-text-unhide' => "Esta revisión de la página ha sido '''borrada'''. Puede haber más detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados]. Como administrador todavía puedes [$1 ver esta revisión] si así lo deseas.", 'rev-suppressed-text-unhide' => "Esta revisión de la página ha sido '''suprimida'''. Puede haber más detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones]. Como administrador podrá seguir [$1 viendo esta revisión] si desea continuar.", 'rev-deleted-text-view' => "Esta revisión de la página ha sido '''borrada'''. Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].", 'rev-suppressed-text-view' => "Esta revisión de la página ha sido '''suprimida'''. Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].", 'rev-deleted-no-diff' => "No puedes ver esta diferencia porque una de las revisiones ha sido '''borrada'''. Puedes encontrar más detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].", 'rev-suppressed-no-diff' => "No puedes ver esta diferencia porque una de las revisiones ha sido '''borrada'''.", 'rev-deleted-unhide-diff' => "Una de las revisiones de esta diferencia ha sido '''borrada'''. Puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados]. Aún puede [$1 ver este cambio] si así lo desea.", 'rev-suppressed-unhide-diff' => "Una de las revisiones de esta diferencia ha sido '''suprimida'''. Puede haber detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones]. Aún puede [$1 ver esta diferencia] si desea así lo desea.", 'rev-deleted-diff-view' => "Una de las revisiones de esta diferencia ha sido '''borrada'''. Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrados].", 'rev-suppressed-diff-view' => "Una de las revisiones de esta diferencia ha sido '''suprimida'''. Aún tiene la posibilidad de verla; puede ampliar los detalles en el [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} registro de supresiones].", 'rev-delundel' => 'mostrar/ocultar', 'rev-showdeleted' => 'mostrar', 'revisiondelete' => 'Borrar/restaurar revisiones', 'revdelete-nooldid-title' => 'No hay revisión destino', 'revdelete-nooldid-text' => 'No se ha especificado una revisión o revisiones destino sobre las que realizar esta función.', 'revdelete-no-file' => 'El archivo especificado no existe.', 'revdelete-show-file-confirm' => '¿Quieres ver la revisión borrada del archivo «<nowiki>$1</nowiki>» del $2 a las $3?', 'revdelete-show-file-submit' => 'Sí', 'revdelete-selected' => "'''{{PLURAL:$2|Revisión seleccionada|Revisiones seleccionadas}} de [[:$1]]:'''", 'logdelete-selected' => "'''{{PLURAL:$1|Seleccionado un evento|Seleccionados eventos}}:'''", 'revdelete-text' => "Las revisiones borradas aún aparecerán en el historial de la página y en los registros, pero sus contenidos no serán accesibles al público.''' Otros administradores de {{SITENAME}} aún podrán acceder al contenido oculto y podrán deshacer el borrado a través de la misma interfaz, a menos que se establezcan restricciones adicionales.", 'revdelete-confirm' => 'Por favor confirma que deseas realizar la operación, que entiendes las consecuencias y que estás ejecutando dicha acción acorde con [[{{MediaWiki:Policy-url}}|las políticas]].', 'revdelete-suppress-text' => "La herramienta de supresión '''solo''' debería usarse en los siguientes casos: * información potencialmente injuriosa o calumniante. * información personal inapropiada, tal como: *: ''nombres, domicilios, números de teléfono, números de la seguridad social e información análoga.''", 'revdelete-legend' => 'Establecer restricciones de revisión:', 'revdelete-hide-text' => 'Texto de la revisión', 'revdelete-hide-image' => 'Ocultar el contenido del archivo', 'revdelete-hide-name' => 'Ocultar acción y objetivo', 'revdelete-hide-comment' => 'Resumen de edición', 'revdelete-hide-user' => 'Nombre/IP del editor', 'revdelete-hide-restricted' => 'Suprimir datos a los administradores así como al resto', 'revdelete-radio-same' => '(no cambiar)', 'revdelete-radio-set' => 'Oculta', 'revdelete-radio-unset' => 'Visible', 'revdelete-suppress' => 'Suprimir datos a los administradores así como al resto', 'revdelete-unsuppress' => 'Eliminar restricciones de revisiones restauradas', 'revdelete-log' => 'Motivo:', 'revdelete-submit' => 'Aplicar a {{PLURAL:$1|la revisión seleccionada|las revisiones seleccionadas}}', 'revdelete-success' => "'''La visibilidad de revisiones ha sido cambiada correctamente.'''", 'revdelete-failure' => "'''La visibilidad de la revisión no pudo ser establecida:''' $1", 'logdelete-success' => 'Visibilidad de eventos cambiada correctamente.', 'logdelete-failure' => "'''La visibilidad del registro no pudo ser ajustada:''' $1", 'revdel-restore' => 'cambiar visibilidad', 'pagehist' => 'Historial de la página', 'deletedhist' => 'Historial borrado', 'revdelete-hide-current' => 'Error al ocultar el objeto de fecha $1 a las $2: es la revisión actual. No puede ser ocultada.', 'revdelete-show-no-access' => 'Error mostrando el objeto de fecha $2, $1: este objeto ha sido marcado como "restringido". No tiene acceso a él.', 'revdelete-modify-no-access' => 'Error modificando el objeto de fecha $2, $1: este objeto ha sido marcado como "restringido". No tiene acceso a él.', 'revdelete-modify-missing' => 'Error modificando el objeto ID $1: ¡no se encuentra en la base de datos!', 'revdelete-no-change' => "'''Atención:''' la revisión de fecha $1 a las $2 ya tiene las restricciones de visibilidad solicitadas.", 'revdelete-concurrent-change' => 'Error modificando el objeto de fecha $2, $1: su estado parece haber sido cambiado por alguien más cuando tratabas de modificarlo. Por favor verifica los registros.', 'revdelete-only-restricted' => 'Error ocultando el item de fecha $2, $1: no puedes suprimir elementos de vista de los administradores sin seleccionar asímismo una de las otras opciones de visibilidad.', 'revdelete-reason-dropdown' => '*Razones de borrado comunes ** Violación a los derechos de autor ** Comentario o información personal inapropiados ** Nombre de usuario inapropiado ** Información potencialmente injuriosa o calumniante', 'revdelete-otherreason' => 'Otro motivo:', 'revdelete-reasonotherlist' => 'Otro motivo', 'revdelete-edit-reasonlist' => 'Editar motivos de borrado', 'revdelete-offender' => 'Autor de la revisión:', # Suppression log 'suppressionlog' => 'Registro de supresiones', 'suppressionlogtext' => 'A continuación hay una lista con los borrados y bloqueos cuyo contenido se encuentra oculto para los administradores. Véase la [[Special:BlockList|lista de bloqueos]] que incluye las prohibiciones y bloqueos actualmente operativos.', # History merging 'mergehistory' => 'Fusionar historiales de páginas', 'mergehistory-header' => 'Esta página te permite fusionar revisiones del historial de una página origen en otra más reciente. Asegúrate de que esto mantendrá la continuidad histórica de la página.', 'mergehistory-box' => 'Fusionar los historiales de dos páginas:', 'mergehistory-from' => 'Página origen:', 'mergehistory-into' => 'Página destino:', 'mergehistory-list' => 'Historial de ediciones fusionable', 'mergehistory-merge' => 'Las siguientes revisiones de [[:$1]] pueden fusionarse en [[:$2]]. Usa la columna de casillas para fusionar sólo las revisiones creadas en y antes de la fecha especificada. Nota que usar los enlaces de navegación borrará las selecciones de esta columna.', 'mergehistory-go' => 'Mostrar ediciones fusionables', 'mergehistory-submit' => 'Fusionar revisiones', 'mergehistory-empty' => 'No hay revisiones fusionables.', 'mergehistory-success' => '$3 {{PLURAL:$3|revisión|revisiones}} de [[:$1]] fusionadas de forma exitosa en [[:$2]].', 'mergehistory-fail' => 'No se puede realizar la fusión de historiales, por favor revisa la página y los parámetros de tiempo.', 'mergehistory-no-source' => 'La página origen $1 no existe.', 'mergehistory-no-destination' => 'La página destino $1 no existe.', 'mergehistory-invalid-source' => 'La página origen debe tener un título válido.', 'mergehistory-invalid-destination' => 'La página de destino ha de tener un título válido.', 'mergehistory-autocomment' => 'Fusionando [[:$1]] en [[:$2]]', 'mergehistory-comment' => 'Fusionando [[:$1]] en [[:$2]]: $3', 'mergehistory-same-destination' => 'Las páginas de origen y destino no pueden ser la misma', 'mergehistory-reason' => 'Motivo:', # Merge log 'mergelog' => 'Registro de fusiones', 'pagemerge-logentry' => 'fusionó [[$1]] en [[$2]] (revisiones hasta $3)', 'revertmerge' => 'Deshacer fusión', 'mergelogpagetext' => 'Debajo está una lista de las fusiones más recientes de historial de una página en otra.', # Diffs 'history-title' => 'Historial de revisiones para «$1»', 'difference-title' => 'Diferencia entre revisiones de «$1»', 'difference-title-multipage' => 'Diferencia entre las páginas «$1» y «$2»', 'difference-multipage' => '(Diferencia entre las páginas)', 'lineno' => 'Línea $1:', 'compareselectedversions' => 'Comparar versiones seleccionadas', 'showhideselectedversions' => 'Mostrar/ocultar versiones seleccionadas', 'editundo' => 'deshacer', 'diff-empty' => '(Sin diferencias)', 'diff-multi-sameuser' => '({{PLURAL:$1|Una revisión intermedia|$1 revisiones intermedias}} por el mismo usuario no mostrado)', 'diff-multi-manyusers' => '(No se {{PLURAL:$1|muestra una edición intermedia|muestran $1 ediciones intermedias}} de {{PLURAL:$2|un usuario|$2 usuarios}})', 'difference-missing-revision' => 'No {{PLURAL:$2|se ha encontrado|se han encontrado}} {{PLURAL:$2|una revisión|$2 revisiones}} de esta diferencia ($1). Esto suele deberse a seguir un enlace obsoleto hacia una página que ya ha sido borrada. Los detalles pueden encontrarse en el [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de borrado].', # Search results 'searchresults' => 'Resultados de la búsqueda', 'searchresults-title' => 'Resultados de la búsqueda de «$1»', 'toomanymatches' => 'Se han obtenido muchos resultados; por favor intenta una consulta diferente', 'titlematches' => 'Coincidencias de título de artículo', 'textmatches' => 'Coincidencias de texto de artículo', 'notextmatches' => 'No hay coincidencias de texto de artículo', 'prevn' => '{{PLURAL:$1|$1}} previas', 'nextn' => '{{PLURAL:$1|$1}} siguientes', 'prevn-title' => '$1 {{PLURAL:$1|resultado|resultados}} previos', 'nextn-title' => 'Próximos $1 {{PLURAL:$1|resultado|resultados}}', 'shown-title' => 'Mostrar $1 {{PLURAL:$1|resultado|resultados}} por página', 'viewprevnext' => 'Ver ($1 {{int:pipe-separator}} $2) ($3).', 'searchmenu-exists' => "'''Hay una página llamada \"[[:\$1]]\" en esta wiki.'''", 'searchmenu-new' => '<strong>Crear la página «[[:$1]]» en este wiki.</strong> {{PLURAL:$2|0=|Véase también la página encontrada con la búsqueda.|Véanse también los resultados de la búsqueda.}}', 'searchprofile-articles' => 'Páginas de contenido', 'searchprofile-project' => 'Páginas de ayuda y de proyecto', 'searchprofile-images' => 'Multimedia', 'searchprofile-everything' => 'Todo', 'searchprofile-advanced' => 'Avanzado', 'searchprofile-articles-tooltip' => 'Buscar en $1', 'searchprofile-project-tooltip' => 'Buscar en $1', 'searchprofile-images-tooltip' => 'Buscar archivos', 'searchprofile-everything-tooltip' => 'Buscar en todo el contenido (incluyendo páginas de discusión)', 'searchprofile-advanced-tooltip' => 'Buscar en espacios de nombres personalizados', 'search-result-size' => '$1 ({{PLURAL:$2|1 palabra|$2 palabras}})', 'search-result-category-size' => '{{PLURAL:$1|1 miembro|$1 miembros}} ({{PLURAL:$2|1 subcategoría|$2 subcategorías}}, {{PLURAL:$3|1 fichero|$3 ficheros}})', 'search-result-score' => 'Relevancia: $1%', 'search-redirect' => '(redirige desde $1)', 'search-section' => '(sección $1)', 'search-file-match' => '(coincide con el contenido del archivo)', 'search-suggest' => 'Quizás quieres buscar: $1', 'search-interwiki-caption' => 'Proyectos hermanos', 'search-interwiki-default' => 'Resultados de $1:', 'search-interwiki-more' => '(más)', 'search-relatedarticle' => 'Relacionado', 'searcheverything-enable' => 'Buscar en todos los espacios de nombres', 'searchrelated' => 'relacionado', 'searchall' => 'todos', 'showingresults' => "Abajo se {{PLURAL:$1|muestra '''1''' resultado|muestran hasta '''$1''' resultados}} comenzando por el n.º '''$2'''.", 'showingresultsnum' => "Abajo se {{PLURAL:$3|muestra '''1''' resultado|muestran los '''$3''' resultados}} comenzando por el n.º '''$2'''.", 'showingresultsheader' => "{{PLURAL:$5|Resultado '''$1''' de '''$3'''|Resultados '''$1-$2''' de '''$3'''}} para '''$4'''", 'search-nonefound' => 'No hay resultados que cumplan los criterios de búsqueda.', 'powersearch-legend' => 'Búsqueda avanzada', 'powersearch-ns' => 'Buscar en los espacios de nombres:', 'powersearch-redir' => 'Listar redirecciones', 'powersearch-togglelabel' => 'Seleccionar:', 'powersearch-toggleall' => 'Todos', 'powersearch-togglenone' => 'Ninguno', 'search-external' => 'Búsqueda externa', 'searchdisabled' => 'Las búsquedas en {{SITENAME}} están temporalmente desactivadas. Mientras tanto puedes buscar mediante Google, pero ten en cuenta que sus índices relativos a {{SITENAME}} pueden estar desactualizados.', 'search-error' => 'Ha ocurrido un error al buscar: $1', # Preferences page 'preferences' => 'Preferencias', 'mypreferences' => 'Preferencias', 'prefs-edits' => 'Cantidad de ediciones:', 'prefsnologintext2' => 'Necesitas $1 para definir las preferencias del usuario.', 'prefs-skin' => 'Apariencia', 'skin-preview' => 'Previsualizar', 'datedefault' => 'Sin preferencia', 'prefs-beta' => 'Funciones en pruebas', 'prefs-datetime' => 'Fecha y hora', 'prefs-labs' => 'Características de los laboratorios', 'prefs-user-pages' => 'Páginas de usuario', 'prefs-personal' => 'Perfil de usuario', 'prefs-rc' => 'Cambios recientes', 'prefs-watchlist' => 'Seguimiento', 'prefs-watchlist-days' => 'Número de días a mostrar en la lista de seguimiento:', 'prefs-watchlist-days-max' => 'Máximo $1 {{PLURAL:$1|día|días}}', 'prefs-watchlist-edits' => 'Número de ediciones a mostrar en la lista expandida:', 'prefs-watchlist-edits-max' => 'Cantidad máxima: 1000', 'prefs-watchlist-token' => 'Ficha de lista de seguimiento:', 'prefs-misc' => 'Miscelánea', 'prefs-resetpass' => 'Cambiar contraseña', 'prefs-changeemail' => 'Cambiar correo electrónico', 'prefs-setemail' => 'Establecer una dirección de correo electrónico', 'prefs-email' => 'Opciones de correo electrónico', 'prefs-rendering' => 'Apariencia', 'saveprefs' => 'Guardar', 'restoreprefs' => 'Restaurar la configuración predeterminada', 'prefs-editing' => 'Edición', 'rows' => 'Filas:', 'columns' => 'Columnas:', 'searchresultshead' => 'Búsquedas', 'stub-threshold' => 'Límite para formato de <a href="#" class="stub">enlace a esbozo</a> (bytes):', 'stub-threshold-disabled' => 'Desactivado', 'recentchangesdays' => 'Días a mostrar en cambios recientes:', 'recentchangesdays-max' => '(máximo {{PLURAL:$1|un día|$1 días}})', 'recentchangescount' => 'Número de ediciones a mostrar de manera predeterminada:', 'prefs-help-recentchangescount' => 'Esto incluye cambios recientes, historiales de página, y registros.', 'prefs-help-watchlist-token2' => 'Esta es la clave secreta para el canal de contenido web de tu lista de seguimiento. Cualquier persona que la conozca podría leer tu lista, así que no la compartas. [[Special:ResetTokens|Pulsa aquí si necesitas restablecerla]].', 'savedprefs' => 'Se han guardado tus preferencias.', 'timezonelegend' => 'Huso horario:', 'localtime' => 'Hora local:', 'timezoneuseserverdefault' => 'Usar la hora del servidor ($1)', 'timezoneuseoffset' => 'Otra (especifica la diferencia horaria)', 'servertime' => 'Hora del servidor:', 'guesstimezone' => 'Rellenar a partir de la hora del navegador', 'timezoneregion-africa' => 'África', 'timezoneregion-america' => 'América', 'timezoneregion-antarctica' => 'Antártida', 'timezoneregion-arctic' => 'Ártico', 'timezoneregion-asia' => 'Asia', 'timezoneregion-atlantic' => 'Océano Atlántico', 'timezoneregion-australia' => 'Australia', 'timezoneregion-europe' => 'Europa', 'timezoneregion-indian' => 'Océano Índico', 'timezoneregion-pacific' => 'Océano Pacífico', 'allowemail' => 'Aceptar correo electrónico de otros usuarios', 'prefs-searchoptions' => 'Buscar', 'prefs-namespaces' => 'Espacios de nombres', 'defaultns' => 'De lo contrario, buscar en estos espacios de nombres:', 'default' => 'predeterminado', 'prefs-files' => 'Archivos', 'prefs-custom-css' => 'CSS personalizado', 'prefs-custom-js' => 'JavaScript personalizado', 'prefs-common-css-js' => 'CSS/JS compartido para todas las skins:', 'prefs-reset-intro' => 'Puedes usar esta página para restaurar tus preferencias a las predeterminadas del sitio. Esto no se puede deshacer.', 'prefs-emailconfirm-label' => 'Confirmación de correo electrónico:', 'youremail' => 'Correo electrónico:', 'username' => '{{GENDER:$1|Nombre de usuario|Nombre de usuaria}}:', 'uid' => 'ID de {{GENDER:$1|usuario|usuaria}}:', 'prefs-memberingroups' => '{{GENDER:$2|Miembro}} {{PLURAL:$1|del grupo|de los grupos}}:', 'prefs-registration' => 'Fecha y hora de registro:', 'yourrealname' => 'Nombre real:', 'yourlanguage' => 'Idioma:', 'yourvariant' => 'Variante lingüística del contenido:', 'prefs-help-variant' => 'Tu variante u ortografía preferida para mostrar las páginas de contenido de este wiki.', 'yournick' => 'Firma nueva:', 'prefs-help-signature' => 'Los comentarios en páginas de discusión deberían firmarse con «<nowiki>~~~~</nowiki>», que se convertirá en tu firma con fecha y hora.', 'badsig' => 'El código de tu firma no es válido; comprueba las etiquetas HTML.', 'badsiglength' => 'Tu firma es muy larga. Debe contener un máximo de {{PLURAL:$1|un carácter|$1 caracteres}}.', 'yourgender' => 'Sexo:', 'gender-unknown' => 'Prefiero no especificarlo', 'gender-male' => 'Masculino', 'gender-female' => 'Femenino', 'prefs-help-gender' => 'Opcional: empleado para que sea usado correctamente el género por parte del software. Esta información será pública.', 'email' => 'Correo electrónico', 'prefs-help-realname' => 'El nombre real es opcional. Si decides proporcionarlo, se usará para dar atribución a tu trabajo.', 'prefs-help-email' => 'La dirección de correo electrónico es opcional, pero es necesaria para el restablecimiento de tu contraseña, en caso de que la olvides.', 'prefs-help-email-others' => 'También puedes permitir que otros usuarios te contacten por correo a través de un enlace en tus páginas de usuario y de discusión. Tu dirección de correo no se revela cuando otros usuarios te contactan.', 'prefs-help-email-required' => 'Es necesario proporcionar una dirección de correo electrónico.', 'prefs-info' => 'Información básica', 'prefs-i18n' => 'Internacionalización', 'prefs-signature' => 'Firma', 'prefs-dateformat' => 'Formato de fecha', 'prefs-timeoffset' => 'Diferencia horaria', 'prefs-advancedediting' => 'Opciones generales', 'prefs-editor' => 'Editor', 'prefs-preview' => 'Previsualización', 'prefs-advancedrc' => 'Opciones avanzadas', 'prefs-advancedrendering' => 'Opciones avanzadas', 'prefs-advancedsearchoptions' => 'Opciones avanzadas', 'prefs-advancedwatchlist' => 'Opciones avanzadas', 'prefs-displayrc' => 'Opciones de mostrado', 'prefs-displaysearchoptions' => 'Opciones de visualización', 'prefs-displaywatchlist' => 'Opciones de visualización', 'prefs-tokenwatchlist' => 'Clave', 'prefs-diffs' => 'Diferencias', 'prefs-help-prefershttps' => 'Esta preferencia tendrá efecto en tu próximo inicio de sesión.', 'prefs-tabs-navigation-hint' => 'Sugerencia: Puede utilizar las teclas de flecha izquierda y derecha para navegar entre las pestañas de la lista de pestañas.', # User preference: email validation using jQuery 'email-address-validity-valid' => 'La dirección de correo electrónico parece ser válida', 'email-address-validity-invalid' => 'Introduce una dirección de correo válida', # User rights 'userrights' => 'Gestión de permisos del usuario', 'userrights-lookup-user' => 'Configurar grupos de usuarios', 'userrights-user-editname' => 'Escriba un nombre de usuario:', 'editusergroup' => 'Modificar grupos de usuarios', 'editinguser' => "Cambiando los derechos del usuario '''[[User:$1|$1]]''' $2", 'userrights-editusergroup' => 'Modificar grupos de usuarios', 'saveusergroups' => 'Guardar grupos de usuarios', 'userrights-groupsmember' => 'Miembro de:', 'userrights-groupsmember-auto' => 'Miembro implícito de:', 'userrights-groups-help' => 'Puedes modificar los grupos a los que pertenece {{GENDER:$1|este usuario|esta usuaria}}: * Un recuadro marcado significa que {{GENDER:$1|el usuario|la usuaria}} está en ese grupo. * Un recuadro no marcado significa que {{GENDER:$1|el usuario|la usuaria}} no está en ese grupo. * Un * indica que no podrás eliminar el grupo una vez que lo agregues, o viceversa.', 'userrights-reason' => 'Motivo:', 'userrights-no-interwiki' => 'No tienes permiso para editar los grupos a los que pertenece un usuario en otros wikis.', 'userrights-nodatabase' => 'La base de datos $1 no existe o no es local.', 'userrights-nologin' => 'Debes [[Special:UserLogin|iniciar sesión]] con una cuenta de administrador para poder editar los grupos de los usuarios.', 'userrights-notallowed' => 'No tienes permiso para agregar o quitar derechos de usuario.', 'userrights-changeable-col' => 'Grupos que puedes cambiar', 'userrights-unchangeable-col' => 'Grupos que no puedes cambiar', 'userrights-conflict' => '¡Conflicto de cambio de los derechos de usuario! Por favor, revisar y confirmar tus cambios.', 'userrights-removed-self' => 'Usted eliminado con éxito sus propios derechos. Por lo tanto, usted ya no es capaz de acceder a esta página.', # Groups 'group' => 'Grupo:', 'group-user' => 'Usuarios', 'group-autoconfirmed' => 'Usuarios autoconfirmados', 'group-bot' => 'Bots', 'group-sysop' => 'Administradores', 'group-bureaucrat' => 'Burócratas', 'group-suppress' => 'Supresores de ediciones', 'group-all' => '(todos)', 'group-user-member' => '{{GENDER:$1|usuario|usuaria}}', 'group-autoconfirmed-member' => '{{GENDER:$1|usuario autoconfirmado|usuaria autoconfirmada}}', 'group-bot-member' => 'bot', 'group-sysop-member' => '{{GENDER:$1|administrador|administradora}}', 'group-bureaucrat-member' => 'burócrata', 'group-suppress-member' => '{{GENDER:$1|supresor|supresora}} de ediciones', 'grouppage-user' => '{{ns:project}}:Usuarios', 'grouppage-autoconfirmed' => '{{ns:project}}:Usuarios autoconfirmados', 'grouppage-bot' => '{{ns:project}}:Bots', 'grouppage-sysop' => '{{ns:project}}:Administradores', 'grouppage-bureaucrat' => '{{ns:project}}:Burócratas', 'grouppage-suppress' => '{{ns:project}}:Supresores de ediciones', # Rights 'right-read' => 'Leer páginas', 'right-edit' => 'Editar páginas', 'right-createpage' => 'Crear páginas que no sean páginas de discusión', 'right-createtalk' => 'Crear páginas de discusión', 'right-createaccount' => 'Crear cuentas de usuario nuevas', 'right-minoredit' => 'Marcar ediciones como menores', 'right-move' => 'Trasladar páginas', 'right-move-subpages' => 'Trasladar páginas con sus subpáginas', 'right-move-rootuserpages' => 'Trasladar páginas de usuario raíz', 'right-movefile' => 'Trasladar archivos', 'right-suppressredirect' => 'No crear redirecciones de las páginas fuente al trasladar páginas', 'right-upload' => 'Subir archivos', 'right-reupload' => 'Subir una nueva versión de un archivo existente', 'right-reupload-own' => 'Subir una nueva versión de un archivo creado por uno mismo', 'right-reupload-shared' => 'Sobreescribir localmente ficheros del repositorio multimedia', 'right-upload_by_url' => 'Subir un archivo a traves de un URL', 'right-purge' => 'Purgar la caché en el servidor sin tener que dar confirmación', 'right-autoconfirmed' => 'No ser afectado por los límites de frecuencia basados en el IP', 'right-bot' => 'Ser tratado como un programa automático', 'right-nominornewtalk' => 'No accionar el aviso de nuevos mensajes al realizar ediciones menores de páginas de discusión', 'right-apihighlimits' => 'Tener límites más altos de peticiones a través del API', 'right-writeapi' => 'Hacer uso del API para escribir', 'right-delete' => 'Borrar páginas', 'right-bigdelete' => 'Borrar páginas con historiales grandes', 'right-deletelogentry' => 'Borrar y recuperar entradas de registro específicas', 'right-deleterevision' => 'Borrar y restaurar revisiones específicas de páginas', 'right-deletedhistory' => 'Ver el historial de páginas borradas, sin el texto asociado', 'right-deletedtext' => 'Ver texto borrado y cambios entre revisiones borradas', 'right-browsearchive' => 'Buscar páginas borradas', 'right-undelete' => 'Restaurar una página', 'right-suppressrevision' => 'Revisar y restaurar revisiones escondidas por administradores', 'right-suppressionlog' => 'Ver registros privados', 'right-block' => 'Bloquear a otros usuarios para que no editen', 'right-blockemail' => 'Bloquear a un usuario para que no pueda mandar correos electrónicos', 'right-hideuser' => 'Bloquear un nombre de usuario, haciéndolo invisible', 'right-ipblock-exempt' => 'Pasar por encima de bloqueos de IPs, auto-bloqueos y bloqueos de rangos.', 'right-proxyunbannable' => 'Pasar por encima de bloqueos automáticos de proxies', 'right-unblockself' => 'Desbloquearse uno mismo', 'right-protect' => 'Cambiar niveles de protección y editar páginas protegidas en cascada', 'right-editprotected' => 'Editar páginas protegidas como «{{int:protect-level-sysop}}»', 'right-editsemiprotected' => 'Editar páginas protegidas como «{{int:protect-level-autoconfirmed}}»', 'right-editinterface' => 'Editar la interfaz de usuario', 'right-editusercssjs' => 'Editar las páginas de CSS y JS de otros usuarios', 'right-editusercss' => 'Editar las páginas de CSS de otros usuarios', 'right-edituserjs' => 'Editar las páginas de JS de otros usuarios', 'right-editmyusercss' => 'Editar tus archivos de usuario CSS', 'right-editmyuserjs' => 'Editar tus propios archivos JavaScript de usuario', 'right-viewmywatchlist' => 'Ver tu lista de seguimiento', 'right-editmywatchlist' => 'Editar tu lista de seguimiento. Algunas acciones seguirán agregando páginas aún sin este derecho.', 'right-viewmyprivateinfo' => 'Ver tu información privada (ej. email, nombre real)', 'right-editmyprivateinfo' => 'Editar tus propios datos privados (ej: email, nombre real)', 'right-editmyoptions' => 'Editar tus propias preferencias', 'right-rollback' => 'Revertir rápidamente las ediciones del último usuario que modificó una página en particular', 'right-markbotedits' => 'Marcar ediciones deshechas como ediciones de un bot', 'right-noratelimit' => 'No afectado por límites de frecuencia', 'right-import' => 'Importar páginas desde otras wikis', 'right-importupload' => 'Importar páginas de un archivo subido', 'right-patrol' => 'Marcar ediciones de otros como patrulladas', 'right-autopatrol' => 'Marcar como patrulladas sus ediciones automáticamente', 'right-patrolmarks' => 'Ver las marcas de patrullaje de cambios recientes', 'right-unwatchedpages' => 'Ver una lista de páginas no vigiladas', 'right-mergehistory' => 'Fusionar historiales', 'right-userrights' => 'Modificar todos los derechos de usuario', 'right-userrights-interwiki' => 'Modificar los derechos de usuarios en otros wikis', 'right-siteadmin' => 'Bloquear y desbloquear la base de datos', 'right-override-export-depth' => 'Exporta páginas incluyendo aquellas enlazadas hasta una profundidad de 5', 'right-sendemail' => 'Enviar un correo electrónico a otros usuarios', 'right-passwordreset' => 'Ver os correos electrónicos de restablecimiento de contraseñas', # Special:Log/newusers 'newuserlogpage' => 'Registro de creación de usuarios', 'newuserlogpagetext' => 'Este es un registro de creación de usuarios.', # User rights log 'rightslog' => 'Cambios de perfil de usuario', 'rightslogtext' => 'Este es un registro de cambios en los permisos de usuarios.', # Associated actions - in the sentence "You do not have permission to X" 'action-read' => 'leer esta página', 'action-edit' => 'modificar esta página', 'action-createpage' => 'crear páginas', 'action-createtalk' => 'crear páginas de discusión', 'action-createaccount' => 'crear esta cuenta de usuario', 'action-minoredit' => 'marcar este cambio como menor', 'action-move' => 'trasladar esta página', 'action-move-subpages' => 'trasladar esta página y sus subpáginas', 'action-move-rootuserpages' => 'trasladar páginas de usuario raíz', 'action-movefile' => 'trasladar este archivo', 'action-upload' => 'subir este archivo', 'action-reupload' => 'reemplazar este archivo existente', 'action-reupload-shared' => 'reemplazar este archivo existente en un depósito compartido', 'action-upload_by_url' => 'subir este archivo desde una dirección URL', 'action-writeapi' => 'utilizar el API de escritura', 'action-delete' => 'borrar esta página', 'action-deleterevision' => 'borrar esta revisión', 'action-deletedhistory' => 'ver el historial borrado de esta página', 'action-browsearchive' => 'buscar páginas borradas', 'action-undelete' => 'recuperar esta página', 'action-suppressrevision' => 'revisar y restaurar esta revisión escondida', 'action-suppressionlog' => 'ver este registro privado', 'action-block' => 'bloquear a este usuario para que no edite', 'action-protect' => 'cambiar los niveles de protección para esta página', 'action-rollback' => 'revertir rápidamente las ediciones del último usuario que modificó una página en particular', 'action-import' => 'importar páginas desde otro wiki', 'action-importupload' => 'importar páginas mediante la carga de un archivo', 'action-patrol' => 'marcar ediciones de otros como patrulladas', 'action-autopatrol' => 'marcar como patrulladas tus propias ediciones', 'action-unwatchedpages' => 'ver la lista de páginas no vigiladas', 'action-mergehistory' => 'fusionar el historial de esta página', 'action-userrights' => 'modificar todos los derechos de usuario', 'action-userrights-interwiki' => 'modificar los derechos de usuarios en otros wikis', 'action-siteadmin' => 'bloquear o desbloquear la base de datos', 'action-sendemail' => 'enviar correos electrónicos', 'action-editmywatchlist' => 'Editar tu lista de seguimiento', 'action-viewmywatchlist' => 'Ver tu lista de seguimiento', 'action-viewmyprivateinfo' => 'ver tu información privada', 'action-editmyprivateinfo' => 'Editar tu información privada', # Recent changes 'nchanges' => '$1 {{PLURAL:$1|cambio|cambios}}', 'enhancedrc-since-last-visit' => '$1 {{PLURAL:$1|desde la última visita}}', 'enhancedrc-history' => 'historial', 'recentchanges' => 'Cambios recientes', 'recentchanges-legend' => 'Opciones sobre cambios recientes', 'recentchanges-summary' => 'Sigue los cambios más recientes de la wiki en esta página.', 'recentchanges-noresult' => 'No hubo cambios durante el período seleccionado que respondan a esos criterios.', 'recentchanges-feed-description' => 'Realiza un seguimiento de los cambios más recientes en el wiki en este canal.', 'recentchanges-label-newpage' => 'Esta edición creó una nueva página', 'recentchanges-label-minor' => 'Esta es una edición menor', 'recentchanges-label-bot' => 'Esta edición fue realizada por un robot', 'recentchanges-label-unpatrolled' => 'Esta edición todavía no se ha patrullado', 'recentchanges-label-plusminus' => 'El tamaño de la página cambió esta cantidad de bytes', 'recentchanges-legend-heading' => "'''Leyenda:'''", 'recentchanges-legend-newpage' => '(véase también la [[Special:NewPages|lista de páginas nuevas]])', 'rcnotefrom' => 'A continuación se muestran los cambios desde <b>$2</b> (hasta <b>$1</b>).', 'rclistfrom' => 'Mostrar nuevos cambios desde $1', 'rcshowhideminor' => '$1 ediciones menores', 'rcshowhidebots' => '$1 bots', 'rcshowhideliu' => '$1 usuarios registrados', 'rcshowhideanons' => '$1 usuarios anónimos', 'rcshowhidepatr' => '$1 ediciones patrulladas', 'rcshowhidemine' => '$1 mis ediciones', 'rclinks' => 'Ver los últimos $1 cambios en los últimos $2 días.<br />$3', 'diff' => 'dif', 'hist' => 'hist', 'hide' => 'Ocultar', 'show' => 'mostrar', 'minoreditletter' => 'm', 'newpageletter' => 'N', 'boteditletter' => 'b', 'number_of_watching_users_pageview' => '[$1 {{PLURAL:$1|usuario|usuarios}} vigilando]', 'rc_categories' => 'Limitar a las categorías (separadas por «|»)', 'rc_categories_any' => 'Cualquiera', 'rc-change-size-new' => '$1 {{PLURAL:$1|byte|bytes}} después del cambio', 'newsectionsummary' => 'Nueva sección: /* $1 */', 'rc-enhanced-expand' => 'Mostrar detalles', 'rc-enhanced-hide' => 'Ocultar detalles', 'rc-old-title' => 'originalmente creado como "$1"', # Recent changes linked 'recentchangeslinked' => 'Cambios relacionados', 'recentchangeslinked-feed' => 'Cambios relacionados', 'recentchangeslinked-toolbox' => 'Cambios relacionados', 'recentchangeslinked-title' => 'Cambios relacionados con «$1»', 'recentchangeslinked-summary' => "Esta página es una lista de los últimos cambios en las páginas enlazadas desde una página (o en las pertenecientes a una categoría). Las páginas que están en tu [[Special:Watchlist|lista de seguimiento]] aparecen en '''negrita'''.", 'recentchangeslinked-page' => 'Nombre de la página:', 'recentchangeslinked-to' => 'Muestra los cambios recientes en lugar de la página indicada', # Upload 'upload' => 'Subir un archivo', 'uploadbtn' => 'Subir un archivo', 'reuploaddesc' => 'Regresar al formulario para subir.', 'upload-tryagain' => 'Envíe la descripción del archivo modificado', 'uploadnologin' => 'No has iniciado sesión', 'uploadnologintext' => 'Tienes que $1 para subir archivos.', 'upload_directory_missing' => 'El directorio de subida de archivos ($1) no existe, y no puede ser creado por el servidor.', 'upload_directory_read_only' => 'El servidor web no puede escribir en el directorio de subida de archivos ($1).', 'uploaderror' => 'Error al intentar subir archivo', 'upload-recreate-warning' => "'''Aviso: Un archivo con ese nombre ha sido eliminado o renombrado.''' A continuación se muestra el registro de borrados y traslados de esta página:", 'uploadtext' => "Utiliza el siguiente formulario para subir archivos. Para ver o buscar archivos subidos con anterioridad, ve a la [[Special:FileList|lista de archivos subidos]]. Los archivos subidos quedarán registrados además en el [[Special:Log/upload|registro de archivos subidos]] y los borrados en el [[Special:Log/delete|registro de borrados]]. Para incluir un archivo en una página, usa un enlace como los mostrados a continuación: * '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.jpg]]</nowiki></code>''' para usar el fichero en tamaño completo * '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.png|200px|thumb|left|texto descriptivo]]</nowiki></code>''' para una versión de 200 píxeles de ancho en una caja en el margen izquierdo con 'texto descriptivo' como descripción * '''<code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:File.ogg]]</nowiki></code>''' para enlazar directamente al fichero sin mostrarlo.", 'upload-permitted' => 'Tipos de archivo permitidos: $1.', 'upload-preferred' => 'Tipos de archivo preferidos: $1.', 'upload-prohibited' => 'Tipos de archivo prohibidos: $1.', 'uploadlog' => 'registro de subidas', 'uploadlogpage' => 'Subidas de archivos', 'uploadlogpagetext' => 'Abajo hay una lista de los últimos archivos subidos. Mira la [[Special:NewFiles|galería de archivos nuevos]] para una descripción visual', 'filename' => 'Nombre del archivo', 'filedesc' => 'Sumario', 'fileuploadsummary' => 'Descripción:', 'filereuploadsummary' => 'Cambios de archivo:', 'filestatus' => 'Estado de copyright:', 'filesource' => 'Fuente:', 'uploadedfiles' => 'Archivos subidos', 'ignorewarning' => 'Ignorar aviso y guardar de todos modos', 'ignorewarnings' => 'Ignorar cualquier aviso', 'minlength1' => 'Los nombres de archivo deben tener al menos una letra.', 'illegalfilename' => 'El nombre de archivo «$1» contiene caracteres que no están permitidos en títulos de páginas. Por favor, renombra el archivo e intenta volver a subirlo.', 'filename-toolong' => 'Los nombres de archivo no pueden tener más de 240 bytes.', 'badfilename' => 'El nombre de la imagen se ha cambiado a «$1».', 'filetype-mime-mismatch' => 'La extensión de archivo «.$1» no coincide con el tipo detectado de MIME del archivo ($2).', 'filetype-badmime' => 'No se permite subir archivos de tipo MIME «$1».', 'filetype-bad-ie-mime' => 'No se puede subir este archivo porque Internet Explorer podría considerarlo como «$1», que es un tipo de archivo no permitido y potencialmente peligroso.', 'filetype-unwanted-type' => "'''«.$1»''' no está entre los tipos de fichero aconsejados. {{PLURAL:$3|El único tipo aconsejado es|Los tipos aconsejados son}} $2.", 'filetype-banned-type' => '\'\'\'".$1"\'\'\' {{PLURAL:$4|no es un tipo de archivo permitido|no son tipos de archivos permitidos}}. {{PLURAL:$3|El tipo de archivo permitido es|Los tipos de archivos permitidos son}} $2.', 'filetype-missing' => 'El archivo no tiene extensión (como «.jpg»).', 'empty-file' => 'El archivo que enviaste estaba vacío.', 'file-too-large' => 'El archivo que enviste era demasiado grande.', 'filename-tooshort' => 'El nombre de archivo es demasiado corto.', 'filetype-banned' => 'El tipo de archivo está prohibido.', 'verification-error' => 'Este archivo no pasó la verificación de archivos.', 'hookaborted' => 'La modificación que ha intentado realizar fue cancelada por un adicional de extensión.', 'illegal-filename' => 'El nombre de archivo no está permitido.', 'overwrite' => 'Sobrescribir un archivo existente no está permitido.', 'unknown-error' => 'Ocurrió un error desconocido.', 'tmp-create-error' => 'No se pudo crear archivo temporal.', 'tmp-write-error' => 'Error al escribir archivo temporal.', 'large-file' => 'Se recomienda que los archivos no sean mayores de $1; este archivo ocupa $2.', 'largefileserver' => 'El tamaño de este archivo es mayor del que este servidor admite por configuración.', 'emptyfile' => 'El archivo que has intentado subir parece estar vacío; por favor, verifica que realmente se trate del archivo que intentabas subir.', 'windows-nonascii-filename' => 'Este wiki no admite nombres de archivo con caracteres especiales.', 'fileexists' => 'Ya existe un archivo con este nombre, por favor comprueba <strong>[[:$1]]</strong> si no estás seguro de querer cambiarlo. [[$1|thumb]]', 'filepageexists' => 'La página de descripción de este archivo ya ha sido creada en <strong>[[:$1]]</strong>, pero no existe actualmente ningún fichero con este nombre. El resumen que ha ingresado no aparecerá en la página de descripción. Para que el sumario aparezca, deberá editarlo manualmente. [[$1|thumb]]', 'fileexists-extension' => 'Existe un archivo con un nombre similar: [[$2|thumb]] * Nombre del archivo que se está subiendo: <strong>[[:$1]]</strong> * Nombre del archivo ya existente: <strong>[[:$2]]</strong> Por favor, elige un nombre diferente.', 'fileexists-thumbnail-yes' => "El archivo parece ser una imagen de tamaño reducido ''(thumbnail)''. [[$1|thumb]] Por favor comprueba el archivo <strong>[[:$1]]</strong>. Si el archivo comprobado es la misma imagen a tamaño original no es necesario subir un thumbnail más.", 'file-thumbnail-no' => "El nombre del archivo comienza con <strong>$1</strong>. Parece ser una imagen de tamaño reducido ''(thumbnail)''. Si tiene esta imagen a toda resolución súbala, si no, por favor cambie el nombre del archivo.", 'fileexists-forbidden' => 'Ya existe un archivo con este nombre, y no puede ser grabado encima de otro. Si quiere subir su archivo de todos modos, por favor vuelva atrás y utilice otro nombre. [[File:$1|thumb|center|$1]]', 'fileexists-shared-forbidden' => 'Ya existe un archivo con este nombre en el repositorio compartido. Si todavía quiere subir su archivo, por favor, regrese a la página anterior y use otro nombre. [[File:$1|thumb|center|$1]]', 'file-exists-duplicate' => 'Este archivo es un duplicado {{PLURAL:$1|del siguiente|de los siguientes}}:', 'file-deleted-duplicate' => 'Un archivo idéntico a este ([[:$1]]) ha sido borrado con anterioridad. Debes comprobar el historial de borrado del archivo ante de volver a subirlo.', 'file-deleted-duplicate-notitle' => 'Un archivo idéntico a este ha sido borrado con anterioridad, y el título ha sido suprimido. Deberías contactar con alguien capaz de ver los datos de archivos borrados para que revise esta situación antes de proceder a subir de nuevo este archivo.', 'uploadwarning' => 'Advertencia de subida de archivo', 'uploadwarning-text' => 'Por favor, modifique la descripción del archivo abajo indicada e inténtelo de nuevo.', 'savefile' => 'Guardar archivo', 'uploadedimage' => 'subió «[[$1]]»', 'overwroteimage' => 'subió una nueva versión de «[[$1]]»', 'uploaddisabled' => 'Subida de archivos deshabilitada', 'copyuploaddisabled' => 'Carga por URL deshabilitada.', 'uploadfromurl-queued' => 'Tu carga ha sido enviada a la cola.', 'uploaddisabledtext' => 'No es posible subir archivos.', 'php-uploaddisabledtext' => 'La subida de archivos está deshabilitada en PHP. Por favor compruebe <code>file_uploads</code> en php.ini.', 'uploadscripted' => 'Este archivo contiene script o código HTML que puede ser interpretado erróneamente por un navegador web.', 'uploadvirus' => '¡El archivo contiene un virus! Detalles: $1', 'uploadjava' => 'El archivo es un ZIP que contiene un archivo .class de Java. No se permite subir archivos Java, porque pueden causar que se puedan saltar restricciones de seguridad.', 'upload-source' => 'Archivo origen', 'sourcefilename' => 'Nombre del archivo origen:', 'sourceurl' => 'Dirección original:', 'destfilename' => 'Nombre del archivo de destino:', 'upload-maxfilesize' => 'Tamaño máximo del archivo: $1', 'upload-description' => 'Descripción de archivo', 'upload-options' => 'Opciones de carga', 'watchthisupload' => 'Vigilar este archivo', 'filewasdeleted' => 'Un archivo con este nombre se subió con anterioridad y posteriormente ha sido borrado. Deberías revisar el $1 antes de subirlo de nuevo.', 'filename-bad-prefix' => "El nombre del archivo que estás subiendo comienza por '''«$1»''', un nombre nada descriptivo de su contenido. Es un típico nombre de los que asignan automáticamente las cámaras digitales. Por favor, elige un nombre más descriptivo.", 'filename-prefix-blacklist' => ' #<!-- deja esta línea exactamente como está --> <pre> # La sintaxis de esta página es la siguiente: # * Todo texto que se encuentre después del carácter "#" hasta el final de la línea se tratará como un comentario y será ignorado # * Cualquier línea que no esté en blanco será interpretada como un prefijo típico en nombres de archivo que suelen asignar automáticamente las cámaras digitales CIMG # Casio DSC_ # Nikon DSCF # Fuji DSCN # Nikon DUW # algunos teléfonos móviles / celulares IMG # genérico JD # Jenoptik MGP # Pentax PICT # misc. #</pre> <!-- deja esta línea exactamente como está -->', 'upload-success-subj' => 'Subida con éxito', 'upload-success-msg' => 'Tu carga de [$2] fue exitosa. Está disponible aquí: [[:{{ns:file}}:$1]]', 'upload-failure-subj' => 'Problema en la carga', 'upload-failure-msg' => 'Hubo un problema durante la carga desde [$2]: $1', 'upload-warning-subj' => 'Alerta de carga', 'upload-warning-msg' => 'Hubo un problema con tu carga de [$2]. Puedes regresar al [[Special:Upload/stash/$1|formulario de carga]] para corregir este problema.', 'upload-proto-error' => 'Protocolo incorrecto', 'upload-proto-error-text' => 'Para subir archivos desde otra página la URL debe comenzar por <code>http://</code> o <code>ftp://</code>.', 'upload-file-error' => 'Error interno al subir el archivo', 'upload-file-error-text' => 'Ha ocurrido un error interno mientras se intentaba crear un fichero temporal en el servidor. Por favor, contacta con un [[Special:ListUsers/sysop|administrador]].', 'upload-misc-error' => 'Error desconocido en la subida', 'upload-misc-error-text' => 'Ha ocurrido un error durante la subida. Por favor verifica que la URL es válida y accesible e inténtalo de nuevo. Si el problema persiste, contacta con un [[Special:ListUsers/sysop|administrador]].', 'upload-too-many-redirects' => 'La URL contenía demasiadas redirecciones', 'upload-unknown-size' => 'Tamaño desconocido', 'upload-http-error' => 'Ha ocurrido un error HTTP: $1', 'upload-copy-upload-invalid-domain' => 'No se pueden realizar cargas remotas desde este dominio.', # File backend 'backend-fail-stream' => 'No se pudo transmitir el archivo «$1».', 'backend-fail-backup' => 'No pudo hacer copia de seguridad del archivo «$1».', 'backend-fail-notexists' => 'El archivo $1 no existe.', 'backend-fail-hashes' => 'No se pudieron obtener los hashes de los ficheros para compararlos.', 'backend-fail-notsame' => 'Ya existe un fichero distinto en $1.', 'backend-fail-invalidpath' => '$1 no es una ruta de almacenamiento válida', 'backend-fail-delete' => 'No se pudo borrar el archivo «$1».', 'backend-fail-describe' => 'No pudieron cambiar los metadatos del archivo "$1".', 'backend-fail-alreadyexists' => 'El archivo $1 ya existe.', 'backend-fail-store' => 'No se pudo almacenar el archivo $1 en $2.', 'backend-fail-copy' => 'No se pudo copiar el archivo $1 a $2.', 'backend-fail-move' => 'No se pudo trasladar el archivo $1 a $2.', 'backend-fail-opentemp' => 'No se pudo crear archivo temporal.', 'backend-fail-writetemp' => 'No se pudo escribir en el archivo temporal.', 'backend-fail-closetemp' => 'No se pudo cerrar el archivo temporal.', 'backend-fail-read' => 'No se pudo leer el archivo «$1».', 'backend-fail-create' => 'No se pudo escribir el archivo $1.', 'backend-fail-maxsize' => 'No se pudo escribir el archivo $1 porque es mayor de {{PLURAL:$2|un byte|$2 bytes}}.', 'backend-fail-readonly' => 'El servidor (back-end) de almacenamiento "$1" está actualmente en estado de sólo lectura. La razón aducida fue: "$2"', 'backend-fail-synced' => 'El archivo "$1" se encuentra en un estado incoherente dentro de los servidores (backends) de almacenamiento interno', 'backend-fail-connect' => 'No se pudo conectar al servidor (backend) de almacenamiento "$1".', 'backend-fail-internal' => 'Se ha producido un error desconocido en el servidor (backend) de almacenamiento "$1".', 'backend-fail-contenttype' => 'No se pudo determinar el tipo de contenido del archivo a guardar en " $1 ".', 'backend-fail-batchsize' => 'El servidor (back-end) de almacenamiento ha suministrado un lote de $1 {{PLURAL:$1|operación|operaciones}} de archivo; el límite es de $2 {{PLURAL:$2|operación|operaciones}}.', 'backend-fail-usable' => 'No se pudo leer o escribir el archivo "$1" debido a permisos insuficientes o directorios/contenedores desaparecidos.', # File journal errors 'filejournal-fail-dbconnect' => 'No se pudo conectar a la base de datos del registro del sistema de almacenamiento "$1".', 'filejournal-fail-dbquery' => 'No se pudo actualizar la base de datos del registro del sistema de almacenamiento "$1".', # Lock manager 'lockmanager-notlocked' => 'No se pudo desbloquear "$1": no se encontraba bloqueado.', 'lockmanager-fail-closelock' => 'No se pudo cerrar la referencia para el archivo de bloqueo de "$1".', 'lockmanager-fail-deletelock' => 'No se pudo eliminar el archivo de bloqueo para "$1".', 'lockmanager-fail-acquirelock' => 'No pudo adquirir el bloqueo para "$1".', 'lockmanager-fail-openlock' => 'No se pudo abrir el archivo de bloqueo para "$1".', 'lockmanager-fail-releaselock' => 'No se pudo liberar el bloqueo de "$1".', 'lockmanager-fail-db-bucket' => 'No se pudo contactar con las suficientes bases de datos del conjunto $1.', 'lockmanager-fail-db-release' => 'No se pudieron liberar los bloqueos registrados en la base de datos $1.', 'lockmanager-fail-svr-acquire' => 'No se pudieron obtener bloqueos en el servidor $1.', 'lockmanager-fail-svr-release' => 'No se pudieron liberar los bloqueos registrados en el servidor $1.', # ZipDirectoryReader 'zip-file-open-error' => 'Se encontró un error al abrir el archivo ZIP para su comprobación.', 'zip-wrong-format' => 'El archivo especificado no es un archivo ZIP.', 'zip-bad' => 'El archivo es un ZIP dañado o que no se puede leer. No se puede comprobar su seguridad.', 'zip-unsupported' => 'El archivo es un archivo que utiliza características ZIP no compatibles con MediaWiki. No puede comprobarse adecuadamente su seguridad.', # Special:UploadStash 'uploadstash' => 'Ficheros escondidos', 'uploadstash-summary' => 'Esta página da acceso a los ficheros enviados (o que están en el proceso de envío) pero que aún no han sido publicados en la wiki. Estos ficheros no son visibles para nadie, excepto para el usuario que los envió.', 'uploadstash-clear' => 'Borrar los ficheros escondidos', 'uploadstash-nofiles' => 'No tienes archivos escondidos.', 'uploadstash-badtoken' => 'No fue posible ejecutar esa operación, tal vez porque sus credenciales de edición expiraron. Reinténtelo.', 'uploadstash-errclear' => 'El borrado de los archivos no tuvo éxito.', 'uploadstash-refresh' => 'Actualizar la lista de archivos', 'invalid-chunk-offset' => 'Desplazamiento inválido del fragmento', # img_auth script messages 'img-auth-accessdenied' => 'Acceso denegado', 'img-auth-nopathinfo' => 'Falta PATH_INFO. El servidor no está configurado para proporcionar esta información. Es posible que esté basado en CGI y que no sea compatible con img_auth. Consulte https://www.mediawiki.org/wiki/Manual:Image_Authorization.', 'img-auth-notindir' => 'Ruta solicitad no esá en el directorio de cargas configurado', 'img-auth-badtitle' => 'Incapaz de construir un título válido de «$1».', 'img-auth-nologinnWL' => 'No has iniciado sesión y «$1» no está en la lista blanca.', 'img-auth-nofile' => 'El archivo «$1» no existe.', 'img-auth-isdir' => 'Estás tratando de acceder a un directorio «$1». Solo se permite el acceso a los archivos.', 'img-auth-streaming' => 'Streaming «$1».', 'img-auth-public' => 'La función de img_auth.php es mostrar archivos desde una wiki privada. Esta wiki está configurada como pública. Para óptima seguridad, img_auth.php está desactivado.', 'img-auth-noread' => 'El usuario no tiene acceso para leer «$1».', 'img-auth-bad-query-string' => 'La dirección URL tiene una cadena de consulta no válida.', # HTTP errors 'http-invalid-url' => 'URL inválida: $1', 'http-invalid-scheme' => 'Las URLs con el esquema «$1» no son compatibles.', 'http-request-error' => 'La solicitud HTTP falló debido a un error desconocido.', 'http-read-error' => 'Error de lectura HTTP.', 'http-timed-out' => 'La solicitud HTTP ha expirado.', 'http-curl-error' => 'Error al recuperar el URL: $1', 'http-bad-status' => 'Ha habido un problema durante la solicitud HTTP: $1 $2', # Some likely curl errors. More could be added from <http://curl.haxx.se/libcurl/c/libcurl-errors.html> 'upload-curl-error6' => 'No se pudo alcanzar la URL', 'upload-curl-error6-text' => 'La URL no pudo ser alcanzada. Por favor comprueba que la URL es correcta y el sitio web está funcionando.', 'upload-curl-error28' => 'Tiempo de espera excedido', 'upload-curl-error28-text' => 'La página tardó demasiado en responder. Por favor, comprueba que el servidor está funcionando, espera un poco y vuelva a intentarlo. Quizás desees intentarlo en otro momento de menos carga.', 'license' => 'Licencia:', 'license-header' => 'Licencia', 'nolicense' => 'Ninguna seleccionada', 'license-nopreview' => '(Previsualización no disponible)', 'upload_source_url' => ' (una URL válida y accesible públicamente)', 'upload_source_file' => ' (un archivo en tu disco)', # Special:ListFiles 'listfiles-summary' => 'Esta página especial muestra todos los archivos subidos. Cuando el usuario la filtra, solo se muestran los archivos cargados por el usuario en su versión más reciente.', 'listfiles_search_for' => 'Buscar por nombre de imagen:', 'imgfile' => 'archivo', 'listfiles' => 'Lista de archivos', 'listfiles_thumb' => 'Miniatura', 'listfiles_date' => 'Fecha', 'listfiles_name' => 'Nombre', 'listfiles_user' => 'Usuario', 'listfiles_size' => 'Tamaño (bytes)', 'listfiles_description' => 'Descripción', 'listfiles_count' => 'Versiones', 'listfiles-show-all' => 'Incluir versiones antiguas de las imágenes', 'listfiles-latestversion' => 'Versión actual', 'listfiles-latestversion-yes' => 'Sí', 'listfiles-latestversion-no' => 'No', # File description page 'file-anchor-link' => 'Archivo', 'filehist' => 'Historial del archivo', 'filehist-help' => 'Haz clic sobre una fecha/hora para ver el archivo a esa fecha.', 'filehist-deleteall' => 'borrar todo', 'filehist-deleteone' => 'borrar', 'filehist-revert' => 'revertir', 'filehist-current' => 'act', 'filehist-datetime' => 'Fecha y hora', 'filehist-thumb' => 'Miniatura', 'filehist-thumbtext' => 'Miniatura de la versión de $1', 'filehist-nothumb' => 'Sin miniatura', 'filehist-user' => 'Usuario', 'filehist-dimensions' => 'Dimensiones', 'filehist-filesize' => 'Tamaño', 'filehist-comment' => 'Comentario', 'filehist-missing' => 'No se encuentra el archivo', 'imagelinks' => 'Usos del archivo', 'linkstoimage' => '{{PLURAL:$1|La siguiente página enlaza|Las siguientes páginas enlazan}} a este archivo:', 'linkstoimage-more' => 'Hay más de {{PLURAL:$1|una página que enlaza|$1 páginas que enlazan}} con este archivo. La lista siguiente sólo muestra {{PLURAL:$1|la primera página que enlaza|las primeras $1 páginas que enlazan}} con este archivo. También puedes consultar la [[Special:WhatLinksHere/$2|lista completa]].', 'nolinkstoimage' => 'No hay páginas que enlacen a esta imagen.', 'morelinkstoimage' => 'Vea [[Special:WhatLinksHere/$1|más enlaces]] a este archivo.', 'linkstoimage-redirect' => '$1 (archivo de redirección) $2', 'duplicatesoffile' => '{{PLURAL:$1|El siguiente archivo es un duplicado|Los siguientes $1 archivos son duplicados}} de éste ([[Special:FileDuplicateSearch/$2|más detalles]]):', 'sharedupload' => 'Este archivo es de $1 y puede ser usado por otros proyectos.', 'sharedupload-desc-there' => 'Este archivo es de $1 y puede ser usado por otros proyectos. Por favor mira la [$2 página de descripción del archivo] para información adicional.', 'sharedupload-desc-here' => 'Este archivo es de $1 y puede ser usado por otros proyectos. La descripción en su [$2 página de descripción del archivo] está mostrada debajo.', 'sharedupload-desc-edit' => 'Este archivo es de $1 y puede ser utilizado por otros proyectos. Tal vez desee editar la descripción de su [$2 página de descripción del archivo] allí.', 'sharedupload-desc-create' => 'Este archivo es de $1 y puede ser utilizado por otros proyectos. Tal vez desee editar la descripción de su [$2 página de descripción del archivo] allí.', 'filepage-nofile' => 'No existe ningún archivo con este nombre.', 'filepage-nofile-link' => 'No existe ningún archivo con este nombre, pero puedes [$1 subirlo].', 'uploadnewversion-linktext' => 'Subir una nueva versión de este archivo', 'shared-repo-from' => 'de $1', 'shared-repo' => 'un repositorio compartido', 'filepage.css' => '/* Los estilos CSS colocados aquí se incluirán en las páginas de descripción de archivos, incluso en los wikis externos que incluyan estas páginas */', 'upload-disallowed-here' => 'No puedes sobrescribir este archivo.', # File reversion 'filerevert' => 'Revertir $1', 'filerevert-legend' => 'Reversión de archivos', 'filerevert-intro' => "Estás revirtiendo '''[[Media:$1|$1]]''' a la [$4 versión del $2 a las $3].", 'filerevert-comment' => 'Motivo:', 'filerevert-defaultcomment' => 'Revertido a la versión subida el $1 a las $2', 'filerevert-submit' => 'Revertir', 'filerevert-success' => "'''[[Media:$1|$1]]''' ha sido revertido a la [$4 versión del $2 a las $3].", 'filerevert-badversion' => 'No existe version local previa de este archivo con esa marca de tiempo.', # File deletion 'filedelete' => 'Borrar $1', 'filedelete-legend' => 'Borrar archivo', 'filedelete-intro' => "Estás borrando el archivo '''[[Media:$1|$1]]''' así como todo su historial.", 'filedelete-intro-old' => "Estás borrando la versión de '''[[Media:$1|$1]]''' del [$4 $2 a las $3].", 'filedelete-comment' => 'Motivo:', 'filedelete-submit' => 'Eliminar', 'filedelete-success' => "'''$1''' ha sido borrado.", 'filedelete-success-old' => "La version de '''[[Media:$1|$1]]''' del $2 a las $3 ha sido borrada.", 'filedelete-nofile' => "'''$1''' no existe.", 'filedelete-nofile-old' => "No existe una versión guardada de '''$1''' con los atributos especificados.", 'filedelete-otherreason' => 'Otra razón:', 'filedelete-reason-otherlist' => 'Otra razón', 'filedelete-reason-dropdown' => '*Razones de borrado habituales ** Violación de copyright ** Archivo duplicado', 'filedelete-edit-reasonlist' => 'Edita los motivos del borrado', 'filedelete-maintenance' => 'Borrado y restauración de archivos temporalmente deshabilitados durante el mantenimiento.', 'filedelete-maintenance-title' => 'No se puede eliminar el archivo', # MIME search 'mimesearch' => 'Búsqueda por MIME', 'mimesearch-summary' => 'Esta página permite el filtrado de ficheros por su tipo MIME. Entrada: contenttype/subtype, p. ej. <code>image/jpeg</code>.', 'mimetype' => 'Tipo MIME:', 'download' => 'descargar', # Unwatched pages 'unwatchedpages' => 'Páginas no vigiladas', # List redirects 'listredirects' => 'Lista de redirecciones', # Unused templates 'unusedtemplates' => 'Plantillas sin uso', 'unusedtemplatestext' => 'Aquí se enumeran todas las páginas en el espacio de nombres {{ns:template}} que no están incluidas en otras páginas. Recuerda mirar lo que enlaza a las plantillas antes de borrarlas.', 'unusedtemplateswlh' => 'otros enlaces', # Random page 'randompage' => 'Página aleatoria', 'randompage-nopages' => 'No hay páginas en los siguientes {{PLURAL:$2|espacio de nombre|espacios de nombre}}: $1.', # Random page in category 'randomincategory' => 'Página aleatoria en categoría', 'randomincategory-invalidcategory' => '"$1" no es una categoría válida.', 'randomincategory-nopages' => 'No hay páginas en la categoría [[:Category:$1|$1]].', 'randomincategory-selectcategory' => 'Obtener una página aleatoria de categoría: $1 $2.', 'randomincategory-selectcategory-submit' => 'Ir', # Random redirect 'randomredirect' => 'Ir a una redirección cualquiera', 'randomredirect-nopages' => 'No hay redirecciones en el espacio de nombres «$1».', # Statistics 'statistics' => 'Estadísticas', 'statistics-header-pages' => 'Estadísticas de páginas', 'statistics-header-edits' => 'Estadísticas de ediciones', 'statistics-header-views' => 'Estadísticas de visitas', 'statistics-header-users' => 'Estadísticas de usuario', 'statistics-header-hooks' => 'Otras estadísticas', 'statistics-articles' => 'Páginas de contenido', 'statistics-pages' => 'Páginas', 'statistics-pages-desc' => 'Todas las páginas en el wiki, incluyendo páginas de discusión, redirecciones, etc.', 'statistics-files' => 'Archivos subidos', 'statistics-edits' => 'Ediciones en páginas desde que {{SITENAME}} fue instalado', 'statistics-edits-average' => 'Media de ediciones por página', 'statistics-views-total' => 'Visitas totales', 'statistics-views-total-desc' => 'No se incluyen accesos a páginas no existentes ni páginas especiales', 'statistics-views-peredit' => 'Visitas por edición', 'statistics-users' => '[[Special:ListUsers|Usuarios]] registrados', 'statistics-users-active' => 'Usuarios activos', 'statistics-users-active-desc' => 'Usuarios que han ejecutado una acción en {{PLURAL:$1|el último día|los últimos $1 días}}', 'statistics-mostpopular' => 'Páginas más vistas', 'pageswithprop' => 'Páginas con una propiedad de página', 'pageswithprop-legend' => 'Páginas con una propiedad de página', 'pageswithprop-text' => 'Esta página muestra las páginas que usan la propiedad de una página en particular', 'pageswithprop-prop' => 'Nombre de la propiedad', 'pageswithprop-submit' => 'Ir', 'pageswithprop-prophidden-long' => 'hay un largo valor en la propiedad texto oculta ($1)', 'pageswithprop-prophidden-binary' => 'valor de la propiedad binaria oculta ($1)', 'doubleredirects' => 'Redirecciones dobles', 'doubleredirectstext' => 'Esta página contiene una lista de páginas que redirigen a otras páginas de redirección. Cada fila contiene enlaces a la segunda y tercera redirección, así como la primera línea de la segunda redirección, en la que usualmente se encontrará el artículo «real» al que la primera redirección debería apuntar. Las entradas <del>tachadas</del> han sido resueltas.', 'double-redirect-fixed-move' => '[[$1]] ha sido trasladado, ahora es una redirección a [[$2]]', 'double-redirect-fixed-maintenance' => 'Corrigiendo la doble redirección desde [[$1]] a [[$2]].', 'double-redirect-fixer' => 'Corrector de redirecciones', 'brokenredirects' => 'Redirecciones incorrectas', 'brokenredirectstext' => 'Las siguientes redirecciones enlazan a páginas que no existen:', 'brokenredirects-edit' => 'editar', 'brokenredirects-delete' => 'borrar', 'withoutinterwiki' => 'Páginas sin interwikis', 'withoutinterwiki-summary' => 'Las siguientes páginas no enlazan a versiones en otros idiomas:', 'withoutinterwiki-legend' => 'Prefijo', 'withoutinterwiki-submit' => 'Mostrar', 'fewestrevisions' => 'Artículos con menos ediciones', # Miscellaneous special pages 'nbytes' => '$1 {{PLURAL:$1|byte|bytes}}', 'ncategories' => '$1 {{PLURAL:$1|categoría|categorías}}', 'ninterwikis' => '$1 {{PLURAL:$1|interwiki|interwikis}}', 'nlinks' => '$1 {{PLURAL:$1|enlace|enlaces}}', 'nmembers' => '$1 {{PLURAL:$1|artículo|artículos}}', 'nmemberschanged' => '$1 → $2 {{PLURAL:$2|miembro|miembros}}', 'nrevisions' => '$1 {{PLURAL:$1|revisión|revisiones}}', 'nviews' => '$1 {{PLURAL:$1|vista|vistas}}', 'nimagelinks' => 'Usado en {{PLURAL:$1|una página|$1 páginas}}', 'ntransclusions' => 'usado en {{PLURAL:$1|una página|$1 páginas}}', 'specialpage-empty' => 'Esta página está vacía.', 'lonelypages' => 'Páginas huérfanas', 'lonelypagestext' => 'Las siguientes páginas no están enlazadas ni transcluídas en otras páginas de {{SITENAME}}.', 'uncategorizedpages' => 'Páginas sin categorizar', 'uncategorizedcategories' => 'Categorías sin categorizar', 'uncategorizedimages' => 'Imágenes sin categorizar', 'uncategorizedtemplates' => 'Plantillas sin categorizar', 'unusedcategories' => 'Categorías sin uso', 'unusedimages' => 'Imágenes sin uso', 'popularpages' => 'Páginas populares', 'wantedcategories' => 'Categorías requeridas', 'wantedpages' => 'Páginas requeridas', 'wantedpages-badtitle' => 'Título inválido en conjunto de resultados: $1', 'wantedfiles' => 'Ficheros requeridos', 'wantedfiletext-cat' => 'Los siguientes archivos están en uso, pero no existen. Es posible que algunos de ellos estén almacenados en repositorios externos y se hayan incluido aquí por error; dichas entradas aparecen <del>tachadas</del>. De igual manera, las páginas que incluyen archivos inexistentes se enumeran en [[:$1]].', 'wantedfiletext-nocat' => 'Los siguientes archivos están en uso, pero no existen. Es posible que algunos de ellos estén almacenados en repositorios externos y se hayan incluido aquí por error; dichas entradas aparecen <del>tachadas</del>.', 'wantedtemplates' => 'Plantillas requeridas', 'mostlinked' => 'Artículos más enlazados', 'mostlinkedcategories' => 'Categorías más enlazadas', 'mostlinkedtemplates' => 'Plantillas más enlazadas', 'mostcategories' => 'Páginas con más categorías', 'mostimages' => 'Imágenes más usadas', 'mostinterwikis' => 'Páginas con más interwikis', 'mostrevisions' => 'Artículos con más ediciones', 'prefixindex' => 'Todas las páginas con prefijo', 'prefixindex-namespace' => 'Todas las páginas con el prefijo (espacio de nombres $1)', 'prefixindex-strip' => 'Prefijo de la hilera en la lista', 'shortpages' => 'Páginas cortas', 'longpages' => 'Páginas largas', 'deadendpages' => 'Páginas sin salida', 'deadendpagestext' => 'Las siguientes páginas no enlazan a otras páginas de {{SITENAME}}.', 'protectedpages' => 'Páginas protegidas', 'protectedpages-indef' => 'Sólo protecciones indefinidas', 'protectedpages-cascade' => 'Sólo protecciones en cascada', 'protectedpages-noredirect' => 'Ocultar redirecciones', 'protectedpagesempty' => 'Actualmente no hay ninguna página protegida con esos parámetros.', 'protectedtitles' => 'Títulos protegidos', 'protectedtitlesempty' => 'Actualmente no existen entradas protegidas con esos parámetros.', 'listusers' => 'Lista de usuarios', 'listusers-editsonly' => 'Muestra sólo usuarios con ediciones', 'listusers-creationsort' => 'Ordenado por fecha de creación', 'listusers-desc' => 'Ordenar de forma descendente', 'usereditcount' => '$1 {{PLURAL:$1|edición|ediciones}}', 'usercreated' => '{{GENDER:$3|Registrado|Registrada}} el $1 a las $2', 'newpages' => 'Páginas nuevas', 'newpages-username' => 'Nombre de usuario', 'ancientpages' => 'Artículos más antiguos', 'move' => 'Trasladar', 'movethispage' => 'Trasladar esta página', 'unusedimagestext' => 'Los siguientes archivos existen pero no están insertados en ninguna página. Por favor note que otros sitios web pueden vincular a un archivo con un URL directo, y por tanto pueden ser listados aquí a pesar de estar en uso activo.', 'unusedcategoriestext' => 'Las siguientes categorías han sido creadas, pero ningún artículo o categoría las utiliza.', 'notargettitle' => 'No hay página objetivo', 'notargettext' => 'Especifique sobre qué página desea llevar a cabo esta acción.', 'nopagetitle' => 'No existe la página destino', 'nopagetext' => 'La página destino que ha especificado no existe.', 'pager-newer-n' => '{{PLURAL:$1|1 siguiente|$1 siguientes}}', 'pager-older-n' => '{{PLURAL:$1|1 anterior|$1 anteriores}}', 'suppress' => 'Supresor de ediciones', 'querypage-disabled' => 'Esta página especial está deshabilitada por motivos de rendimiento.', # Book sources 'booksources' => 'Fuentes de libros', 'booksources-search-legend' => 'Buscar fuentes de libros', 'booksources-go' => 'Ir', 'booksources-text' => 'Abajo hay una lista de enlaces a otros sitios que venden libros nuevos y usados, puede que contengan más información sobre los libros que estás buscando.', 'booksources-invalid-isbn' => 'El número de ISBN no parece ser válido; comprueba los errores copiándolo de la fuente original.', # Special:Log 'specialloguserlabel' => 'Usuario:', 'speciallogtitlelabel' => 'Objetivo (título o usuario):', 'log' => 'Registros', 'all-logs-page' => 'Todos los registros públicos', 'alllogstext' => 'Vista combinada de todos los registros de {{SITENAME}}. Puedes filtrar la vista seleccionando un tipo de registro, el nombre del usuario o la página afectada. Se distinguen mayúsculas de minúsculas.', 'logempty' => 'No hay elementos en el registro con esas condiciones.', 'log-title-wildcard' => 'Buscar títulos que empiecen con este texto', 'showhideselectedlogentries' => 'Mostrar u ocultar las entradas seleccionadas del registro', # Special:AllPages 'allpages' => 'Todas las páginas', 'alphaindexline' => '$1 a $2', 'nextpage' => 'Siguiente página ($1)', 'prevpage' => 'Página anterior ($1)', 'allpagesfrom' => 'Mostrar páginas que empiecen por:', 'allpagesto' => 'Mostrar páginas terminadas con:', 'allarticles' => 'Todos los artículos', 'allinnamespace' => 'Todas las páginas (espacio de nombres $1)', 'allpagessubmit' => 'Mostrar', 'allpagesprefix' => 'Mostrar páginas con el prefijo:', 'allpagesbadtitle' => 'El título dado era inválido o tenía un prefijo de enlace inter-idioma o inter-wiki. Puede contener uno o más caracteres que no se pueden usar en títulos.', 'allpages-bad-ns' => '{{SITENAME}} no tiene un espacio de nombres llamado «$1».', 'allpages-hide-redirects' => 'Ocultar redirecciones', # SpecialCachedPage 'cachedspecial-viewing-cached-ttl' => 'Usted está viendo una versión en caché de esta página, que puede tener hasta $1 días de antigüedad.', 'cachedspecial-viewing-cached-ts' => 'Está viendo una versión en caché de esta página, que puede no estar completamente actualizada.', 'cachedspecial-refresh-now' => 'Ver lo más reciente.', # Special:Categories 'categories' => 'Categorías', 'categoriespagetext' => 'Las siguientes {{PLURAL:$1|categoría contiene|categorías contienen}} páginas o medios. No se muestran aquí las [[Special:UnusedCategories|categorías sin uso]]. Véase también las [[Special:WantedCategories|categorías requeridas]].', 'categoriesfrom' => 'Mostrar categorías que empiecen por:', 'special-categories-sort-count' => 'ordenar por conteo', 'special-categories-sort-abc' => 'ordenar alfabéticamente', # Special:DeletedContributions 'deletedcontributions' => 'Contribuciones borradas de usuario', 'deletedcontributions-title' => 'Contribuciones borradas de usuario', 'sp-deletedcontributions-contribs' => 'contribuciones', # Special:LinkSearch 'linksearch' => 'Enlaces externos', 'linksearch-pat' => 'Patrón de búsqueda:', 'linksearch-ns' => 'Espacio de nombre:', 'linksearch-ok' => 'Buscar', 'linksearch-text' => 'Se pueden usar caracteres comodín como "*.wikipedia.org". Es necesario, por lo menos, un dominio de alto nivel, por ejemplo "*.org".<br /> {{PLURAL:$2|Protocolo|Protocolos}} soportados: <code>$1</code> (si no se especifica ninguno, el protocolo por defecto es http://).', 'linksearch-line' => '$1 enlazado desde $2', 'linksearch-error' => 'Los comodines sólo pueden aparecer al principio del nombre de sitio.', # Special:ListUsers 'listusersfrom' => 'Mostrar usuarios que empiecen por:', 'listusers-submit' => 'Mostrar', 'listusers-noresult' => 'No se encontró al usuario.', 'listusers-blocked' => '({{GENDER:$1|bloqueado|bloqueada}})', # Special:ActiveUsers 'activeusers' => 'Lista de usuarios activos', 'activeusers-intro' => 'Esta es una lista de usuarios que han tenido alguna actividad en los últimos $1 {{PLURAL:$1|día|días}}.', 'activeusers-count' => '$1 {{PLURAL:$1|acción|acciones}} en los últimos {{PLURAL:$3|día|$3 días}}', 'activeusers-from' => 'Mostrando a los usuarios empezando por:', 'activeusers-hidebots' => 'Ocultar robots', 'activeusers-hidesysops' => 'Ocultar administradores', 'activeusers-noresult' => 'No se encontraron usuarios.', # Special:ListGroupRights 'listgrouprights' => 'Permisos del grupo de usuarios', 'listgrouprights-summary' => 'La siguiente es una lista de los grupos de usuario definidos en esta wiki y de sus privilegios de acceso asociados. Puede haber información adicional sobre privilegios individuales en [[{{MediaWiki:Listgrouprights-helppage}}]]', 'listgrouprights-key' => 'Leyenda: * <span class="listgrouprights-granted">Derecho concedido</span> * <span class="listgrouprights-revoked">Derecho revocado</span>', 'listgrouprights-group' => 'Grupo', 'listgrouprights-rights' => 'Derechos', 'listgrouprights-helppage' => 'Help:Derechos de grupos', 'listgrouprights-members' => '(ver los miembros de este grupo)', 'listgrouprights-addgroup' => 'Agregar {{PLURAL:$2|grupo|grupos}}: $1', 'listgrouprights-removegroup' => 'Eliminar {{PLURAL:$2|grupo|grupos}}: $1', 'listgrouprights-addgroup-all' => 'Agregar todos los grupos', 'listgrouprights-removegroup-all' => 'Eliminar todos los grupos', 'listgrouprights-addgroup-self' => 'Agregar {{PLURAL:$2|grupo|grupos}} a tu propia cuenta: $1', 'listgrouprights-removegroup-self' => 'Eliminar {{PLURAL:$2|grupo|grupos}} de tu propia cuenta: $1', 'listgrouprights-addgroup-self-all' => 'Agregar todos los grupos a tu propia cuenta', 'listgrouprights-removegroup-self-all' => 'Eliminar todos los grupos de tu propia cuenta', # Email user 'mailnologin' => 'Ninguna dirección de envio', 'mailnologintext' => 'Debes [[Special:UserLogin|iniciar sesión]] y tener una dirección electrónica válida en tus [[Special:Preferences|preferencias]] para enviar un correo electrónico a otros usuarios.', 'emailuser' => 'Enviar un correo electrónico a {{GENDER:{{BASEPAGENAME}}|este usuario|esta usuaria}}', 'emailuser-title-target' => 'Enviar un correo electrónico a {{GENDER:$1|este usuario|esta usuaria}}', 'emailuser-title-notarget' => 'Enviar un correo electrónico al usuario', 'emailpage' => 'Enviar un correo electrónico a un usuario', 'emailpagetext' => 'Puedes usar el formulario de abajo para enviar un correo electrónico a {{GENDER:$1|este usuario|esta usuaria}}. La dirección de correo electrónico que indicaste en [[Special:Preferences|tus preferencias de usuario]] aparecerá en el campo "Remitente" o "De" para que el destinatario pueda responderte.', 'usermailererror' => 'El sistema de correo devolvió un error:', 'defemailsubject' => 'Correo electrónico enviado por el usuario «$1» desde {{SITENAME}}', 'usermaildisabled' => 'Correo electrónico del usuario deshabilitado', 'usermaildisabledtext' => 'No puedes enviar correos electrónicos a otros usuarios en esta wiki', 'noemailtitle' => 'No hay dirección de correo electrónico', 'noemailtext' => 'Este usuario no ha especificado una dirección de correo electrónico válida.', 'nowikiemailtitle' => 'correos electrónicos no permitidos', 'nowikiemailtext' => 'Este usuario ha elegido no recibir correos electrónicos de otros usuarios.', 'emailnotarget' => 'Nombre de usuario no existente o no válido para el destinatario.', 'emailtarget' => 'Introduce el nombre de usuario del destinatario', 'emailusername' => 'Nombre de usuario:', 'emailusernamesubmit' => 'Enviar', 'email-legend' => 'Enviar un correo electrónico a otro usuario de {{SITENAME}}', 'emailfrom' => 'De:', 'emailto' => 'Para:', 'emailsubject' => 'Asunto:', 'emailmessage' => 'Mensaje:', 'emailsend' => 'Enviar', 'emailccme' => 'Enviarme una copia de mi mensaje.', 'emailccsubject' => 'Copia de tu mensaje a $1: $2', 'emailsent' => 'Correo electrónico enviado', 'emailsenttext' => 'Se ha enviado tu mensaje de correo electrónico.', 'emailuserfooter' => 'Este correo electrónico fue enviado por $1 a $2 a través de la función «Enviar un correo electrónico a este usuario» en {{SITENAME}}.', # User Messenger 'usermessage-summary' => 'Dejando un mensaje de sistema.', 'usermessage-editor' => 'Mensajero del sistema', # Watchlist 'watchlist' => 'Lista de seguimiento', 'mywatchlist' => 'Lista de seguimiento', 'watchlistfor2' => 'Para $1 $2', 'nowatchlist' => 'No tienes ninguna página en tu lista de seguimiento.', 'watchlistanontext' => 'Para ver o editar las entradas de tu lista de seguimiento es necesario $1.', 'watchnologin' => 'No has iniciado sesión', 'watchnologintext' => 'Debes [[Special:UserLogin|iniciar sesión]] para modificar tu lista de seguimiento.', 'addwatch' => 'Añadir a la lista de seguimiento', 'addedwatchtext' => 'La página «[[:$1]]» ha sido añadida a tu [[Special:Watchlist|lista de seguimiento]]. Los cambios futuros en esta página y en su página de discusión asociada se indicarán ahí.', 'removewatch' => 'Quitar de la lista de seguimiento', 'removedwatchtext' => 'Se ha eliminado la página «[[:$1]]» de tu [[Special:Watchlist|lista de seguimiento]].', 'watch' => 'Vigilar', 'watchthispage' => 'Vigilar esta página', 'unwatch' => 'Dejar de vigilar', 'unwatchthispage' => 'Dejar de vigilar', 'notanarticle' => 'No es un artículo', 'notvisiblerev' => 'La última revisión de un usuario diferente ha sido borrada', 'watchlist-details' => '{{PLURAL:$1|$1 página|$1 páginas}} en su lista de seguimiento, sin contar las de discusión.', 'wlheader-enotif' => 'La notificación por correo está activada.', 'wlheader-showupdated' => "Las páginas modificadas desde su última visita aparecen en '''negrita'''.", 'watchmethod-recent' => 'revisando cambios recientes en páginas vigiladas', 'watchmethod-list' => 'revisando las páginas vigiladas en busca de cambios recientes', 'watchlistcontains' => 'Tu lista de seguimiento posee $1 {{PLURAL:$1|página|páginas}}.', 'iteminvalidname' => "Problema con el artículo '$1', nombre inválido...", 'wlnote2' => 'A continuación se muestran los cambios de {{PLURAL:$1|la última hora|las últimas <strong>$1</strong> horas}}, a partir del $2, $3.', 'wlshowlast' => 'Ver los cambios de las últimas $1 horas, $2 días $3', 'watchlist-options' => 'Opciones de la lista de seguimiento', # Displayed when you click the "watch" button and it is in the process of watching 'watching' => 'Vigilando...', 'unwatching' => 'Eliminando de la lista de seguimiento...', 'watcherrortext' => 'Ocurrió un error al cambiar la configuración de tu lista de seguimiento para «$1».', 'enotif_mailer' => 'Notificación por correo de {{SITENAME}}', 'enotif_reset' => 'Marcar todas las páginas como visitadas', 'enotif_impersonal_salutation' => 'usuario de {{SITENAME}}', 'enotif_subject_deleted' => '$2 ha borrado la página $1 de {{SITENAME}}', 'enotif_subject_created' => '$2 ha creado la página $1 en {{SITENAME}}', 'enotif_subject_moved' => '$2 ha trasladado la página $1 de {{SITENAME}}', 'enotif_subject_restored' => '$2 ha restaurado la página $1 de {{SITENAME}}', 'enotif_subject_changed' => '$2 ha modificado la página $1 de {{SITENAME}}', 'enotif_body_intro_deleted' => 'La página $1 de {{SITENAME}} ha sido borrada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3.', 'enotif_body_intro_created' => 'La página $1 de {{SITENAME}} ha sido creada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.', 'enotif_body_intro_moved' => 'La página $1 de {{SITENAME}} ha sido trasladada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.', 'enotif_body_intro_restored' => 'La página $1 de {{SITENAME}} ha sido restaurada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.', 'enotif_body_intro_changed' => 'La página $1 de {{SITENAME}} ha sido cambiada el $PAGEEDITDATE por {{GENDER:$2|$2}}, véase $3 para la revisión actual.', 'enotif_lastvisited' => 'Consulta $1 para ver todos los cambios realizados desde tu última visita.', 'enotif_lastdiff' => 'Consulta $1 para ver este cambio.', 'enotif_anon_editor' => 'usuario anónimo $1', 'enotif_body' => 'Hola, $WATCHINGUSERNAME: $PAGEINTRO $NEWPAGE Resumen del editor: $PAGESUMMARY $PAGEMINOREDIT Contacta al editor: correo: $PAGEEDITOR_EMAIL wiki: $PAGEEDITOR_WIKI No enviaremos más notificaciones si ocurre más actividad, a menos que visites esta página con la sesión iniciada. También puedes restablecer los estados de notificación para todas las páginas en tu lista de seguimiento. Atentamente, el sistema de notificaciones de {{SITENAME}} -- Para cambiar tus ajustes de notificación por correo, visita {{canonicalurl:{{#special:Preferences}}}} Para cambiar los ajustes de tu lista de seguimiento, visita {{canonicalurl:{{#special:EditWatchlist}}}} Para quitar la página de tu lista de seguimiento, visita $UNWATCHURL Para ayuda y comentarios: {{canonicalurl:{{MediaWiki:Helppage}}}}', 'created' => 'creada', 'changed' => 'modificada', # Delete 'deletepage' => 'Borrar esta página', 'confirm' => 'Confirmar', 'excontent' => 'el contenido era: «$1»', 'excontentauthor' => 'el contenido era: «$1» (y el único autor fue «[[Special:Contributions/$2|$2]]»)', 'exbeforeblank' => 'El contenido antes de blanquear era: «$1»', 'exblank' => 'la página estaba vacía', 'delete-confirm' => 'Borrar «$1»', 'delete-legend' => 'Borrar', 'historywarning' => "'''Aviso:''' La página que estás a punto de borrar tiene un historial de aproximadamente $1 {{PLURAL:$1|revisión|revisiones}}:", 'confirmdeletetext' => 'Estás a punto de borrar una página en forma permanente, así como todo su historial. Por favor, confirma que realmente quieres hacer eso, que entiendes las consecuencias, y que lo estás haciendo de acuerdo con [[{{MediaWiki:Policy-url}}|las políticas]].', 'actioncomplete' => 'Acción completada', 'actionfailed' => 'Acción fallida', 'deletedtext' => '«$1» ha sido borrado. Véase $2 para un registro de los borrados recientes.', 'dellogpage' => 'Registro de borrados', 'dellogpagetext' => 'A continuación se muestra una lista de los borrados más recientes.', 'deletionlog' => 'registro de borrados', 'reverted' => 'Revertido a una revisión anterior', 'deletecomment' => 'Motivo:', 'deleteotherreason' => 'Otro motivo:', 'deletereasonotherlist' => 'Otro motivo', 'deletereason-dropdown' => '*Razones comunes de borrado ** Spam ** Vandalismo ** Violación de copyright ** A petición del mismo autor ** Redirección incorrecta', 'delete-edit-reasonlist' => 'Editar razones de borrado', 'delete-toobig' => 'Esta página tiene un historial muy grande, con más de $1 {{PLURAL:$1|revisión|revisiones}}. Borrar este tipo de páginas ha sido restringido para prevenir posibles problemas en {{SITENAME}}.', 'delete-warning-toobig' => 'Esta página tiene un historial de más de $1 {{PLURAL:$1|revisión|revisiones}}. Eliminarla puede perturbar las operaciones de la base de datos de {{SITENAME}}. Ten cuidado al borrar.', 'deleting-backlinks-warning' => "'''Advertencia:''' Otras páginas están enlazadas o son inclusión desde la página que estás por eliminar.", # Rollback 'rollback' => 'Revertir ediciones', 'rollback_short' => 'Revertir', 'rollbacklink' => 'revertir', 'rollbacklinkcount' => 'revertir $1 {{PLURAL:$1|edición|ediciones}}', 'rollbacklinkcount-morethan' => 'revertir más de $1 {{PLURAL:$1|edición|ediciones}}', 'rollbackfailed' => 'No se pudo revertir', 'cantrollback' => 'No se puede revertir la edición; el último colaborador es el único autor de esta página.', 'alreadyrolled' => 'No se puede revertir la última edición de [[:$1]] hecha por [[User:$2|$2]] ([[User talk:$2|discusión]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]); alguien más ya ha editado o revertido esa página. La última edición fue hecha por [[User:$3|$3]] ([[User talk:$3|discusión]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).', 'editcomment' => "El resumen de la edición fue: ''«$1»''.", 'revertpage' => 'Revertidos los cambios de [[Special:Contributions/$2|$2]] ([[User talk:$2|disc.]]) a la última edición de [[User:$1|$1]]', 'revertpage-nouser' => 'Revertidas las ediciones hechas por un usuario oculto a la última revisión hecha por [[User:$1|$1]]', 'rollback-success' => 'Revertidas las ediciones de $1; recuperada la última versión de $2.', # Edit tokens 'sessionfailure-title' => 'Error de sesión', 'sessionfailure' => 'Parece que hay un problema con tu sesión; esta acción ha sido cancelada como medida de precaución contra secuestros de sesión. Por favor, pulsa «Atrás», recarga la página de la que viniste e inténtalo de nuevo.', # Protect 'protectlogpage' => 'Registro de protección', 'protectlogtext' => 'Abajo se presenta una lista de protección y desprotección de página. Véase [[Special:ProtectedPages|la lista de páginas protegidas]] para ver las protecciones activas en páginas.', 'protectedarticle' => 'protegió «[[$1]]»', 'modifiedarticleprotection' => 'cambió el nivel de protección de «[[$1]]»', 'unprotectedarticle' => 'desprotegió «[[$1]]»', 'movedarticleprotection' => 'cambiadas protecciones de «[[$2]]» a «[[$1]]»', 'protect-title' => 'Cambiando el nivel de protección de «$1»', 'protect-title-notallowed' => 'Ver el nivel de protección de «$1»', 'prot_1movedto2' => 'heredando la protección al trasladar [[$1]] a [[$2]]', 'protect-badnamespace-title' => 'Espacio de nombres no protegible', 'protect-badnamespace-text' => 'Las páginas de este espacio de nombres no pueden ser protegidas', 'protect-norestrictiontypes-text' => 'Esta página no se puede proteger ya que no hay ningún tipo de restricción disponible.', 'protect-norestrictiontypes-title' => 'Página no protegible', 'protect-legend' => 'Confirmar protección', 'protectcomment' => 'Motivo:', 'protectexpiry' => 'Caducidad:', 'protect_expiry_invalid' => 'Tiempo de caducidad incorrecto.', 'protect_expiry_old' => 'El tiempo de expiración está en el pasado.', 'protect-unchain-permissions' => 'Desbloquear opciones de protección adicionales', 'protect-text' => "Puedes ver y modificar el nivel de protección de la página '''$1'''.", 'protect-locked-blocked' => "No puede cambiar los niveles de protección estando bloqueado. A continuación se muestran las opciones actuales de la página '''$1''':", 'protect-locked-dblock' => "Los niveles de protección no se pueden cambiar debido a un bloqueo activo de la base de datos. A continuación se muestran las opciones actuales de la página '''$1''':", 'protect-locked-access' => "Su cuenta no tiene permiso para cambiar los niveles de protección de una página. A continuación se muestran las opciones actuales de la página '''$1''':", 'protect-cascadeon' => 'Actualmente esta página está protegida porque está incluida en {{PLURAL:$1|la siguiente página|las siguientes páginas}}, que tienen activada la opción de protección en cascada. Puedes cambiar el nivel de protección de esta página, pero no afectará a la protección en cascada.', 'protect-default' => 'Permitir todos los usuarios', 'protect-fallback' => 'Solo permitir usuarios con el permiso «$1»', 'protect-level-autoconfirmed' => 'Solo permitir usuarios autoconfirmados', 'protect-level-sysop' => 'Solo permitir administradores', 'protect-summary-cascade' => 'en cascada', 'protect-expiring' => 'caduca el $1 (UTC)', 'protect-expiring-local' => 'caduca el $1', 'protect-expiry-indefinite' => 'indefinido', 'protect-cascade' => 'Protección en cascada - proteger todas las páginas incluidas en ésta.', 'protect-cantedit' => 'No puedes cambiar el nivel de protección porque no tienes permiso para hacer ediciones.', 'protect-othertime' => 'Especificar caducidad:', 'protect-othertime-op' => 'otra (especificar)', 'protect-existing-expiry' => 'Fecha de caducidad actual: $2 a las $3', 'protect-otherreason' => 'Otra razón:', 'protect-otherreason-op' => 'Otra razón', 'protect-dropdown' => '*Razones de protección habituales **Vandalismo excesivo **Spam excesivo **Guerra de ediciones **Página muy visitada', 'protect-edit-reasonlist' => 'Editar las razones de protección', 'protect-expiry-options' => '1 hora:1 hour,1 día:1 day,1 semana:1 week,2 semanas:2 weeks,1 mes:1 month,3 meses:3 months,6 meses:6 months,1 año:1 year,para siempre:infinite', 'restriction-type' => 'Permiso:', 'restriction-level' => 'Nivel de restricción:', 'minimum-size' => 'Tamaño mínimo', 'maximum-size' => 'Tamaño máximo:', 'pagesize' => '(bytes)', # Restrictions (nouns) 'restriction-edit' => 'Editar', 'restriction-move' => 'Pueden trasladar', 'restriction-create' => 'Crear', 'restriction-upload' => 'Subir', # Restriction levels 'restriction-level-sysop' => 'completamente protegida', 'restriction-level-autoconfirmed' => 'semiprotegida', 'restriction-level-all' => 'cualquier nivel', # Undelete 'undelete' => 'Restaurar una página borrada', 'undeletepage' => 'Ver y restaurar páginas borradas', 'undeletepagetitle' => "'''Las siguientes son las revisiones borradas de [[:$1|$1]]'''.", 'viewdeletedpage' => 'Ver páginas borradas', 'undeletepagetext' => '{{PLURAL:$1|La siguiente página ha sido borrada pero aún está en el archivo y puede ser restaurada.|Las siguientes $1 páginas han sido borradas pero aún están en el archivo y pueden ser restauradas.}} Puede que el archivo se limpie periódicamente.', 'undelete-fieldset-title' => 'Restaurar revisiones', 'undeleteextrahelp' => "Para restaurar todo el historial de la página, deja todas las casillas sin seleccionar y pulsa '''''{{int:undeletebtn}}'''''. Para realizar una restauración selectiva, marca las revisiones a ser restauradas y pulsa '''''{{int:undeletebtn}}'''''.", 'undeleterevisions' => '$1 {{PLURAL:$1|revisión|revisiones}} archivadas', 'undeletehistory' => 'Si restauras una página, todas sus revisiones serán restauradas al historial. Si una nueva página con el mismo nombre ha sido creada desde que se borró la original, las versiones restauradas aparecerán como historial anterior, y la revisión actual de la página actual no se reemplazará automáticamente.', 'undeleterevdel' => 'No se deshará el borrado si éste resulta en el borrado parcial de la última revisión de la página. En tal caso, desmarque o muestre las revisiones borradas más recientes. Las revisiones de archivos que no tiene permitido ver no se restaurarán.', 'undeletehistorynoadmin' => 'El artículo ha sido borrado. La razón de su eliminación se indica abajo en el resumen, así como los detalles de las ediciones realizadas antes del borrado. El texto completo del artículo está disponible sólo para usuarios con permisos de administrador.', 'undelete-revision' => 'Edición borrada de $1 (fechada $4, a $5) por $3:', 'undeleterevision-missing' => 'Revisión no válida o perdida. Puede deberse a un enlace incorrecto, o a que la revisión haya sido restaurada o eliminada del archivo.', 'undelete-nodiff' => 'No existe una revisión previa.', 'undeletebtn' => 'Restaurar', 'undeletelink' => 'ver/restaurar', 'undeleteviewlink' => 'ver', 'undeleteinvert' => 'Invertir selección', 'undeletecomment' => 'Razón:', 'undeletedrevisions' => '{{PLURAL:$1|Una edición restaurada|$1 ediciones restauradas}}', 'undeletedrevisions-files' => '$1 {{PLURAL:$1|ediciones restauradas y $2 archivo restaurado|ediciones y $2 archivos restaurados}}', 'undeletedfiles' => '$1 {{PLURAL:$1|archivo restaurado|archivos restaurados}}', 'cannotundelete' => 'Hubo un error durante la restauración: $1', 'undeletedpage' => "'''Se ha restaurado $1''' Consulta el [[Special:Log/delete|registro de borrados]] para ver una lista de los últimos borrados y restauraciones.", 'undelete-header' => 'En el [[Special:Log/delete|registro de borrados]] se listan las páginas eliminadas.', 'undelete-search-title' => 'Buscar páginas borradas', 'undelete-search-box' => 'Buscar páginas borradas', 'undelete-search-prefix' => 'Mostrar páginas que empiecen por:', 'undelete-search-submit' => 'Buscar', 'undelete-no-results' => 'No se encontraron páginas borradas para ese criterio de búsqueda.', 'undelete-filename-mismatch' => 'No se puede restaurar la versión con marca de tiempo $1: No concuerda el nombre de fichero', 'undelete-bad-store-key' => 'No se puede restaurar la versión con marca de tiempo $1: el fichero fue omitido antes del borrado.', 'undelete-cleanup-error' => 'Error al borrar el archivo no utilizado "$1".', 'undelete-missing-filearchive' => 'No se ha podido restaurar el archivo de ID $1 debido a que no está en la base de datos. Puede que ya haya sido restaurado.', 'undelete-error' => 'Error restaurando la página', 'undelete-error-short' => 'Error restaurando archivo: $1', 'undelete-error-long' => 'Se encontraron errores mientras se restauraba el archivo: $1', 'undelete-show-file-confirm' => '¿Estás seguro de que quieres ver una revisión borrada del archivo «<nowiki>$1</nowiki>» del $2 a las $3?', 'undelete-show-file-submit' => 'Sí', # Namespace form on various pages 'namespace' => 'Espacio de nombres:', 'invert' => 'Invertir selección', 'tooltip-invert' => 'Marca esta casilla para ocultar los cambios a las páginas dentro del espacio de nombres seleccionado (y el espacio de nombres asociado si está activada)', 'namespace_association' => 'Espacio de nombres asociado', 'tooltip-namespace_association' => 'Marca esta casilla para incluir también el espacio de nombres de discusión asociado con el espacio de nombres seleccionado', 'blanknamespace' => '(Principal)', # Contributions 'contributions' => 'Contribuciones {{GENDER:$1|del usuario|de la usuaria}}', 'contributions-title' => 'Contribuciones {{GENDER:$1|del usuario|de la usuaria}} $1', 'mycontris' => 'Contribuciones', 'contribsub2' => 'Para {{GENDER:$3|$1}} ($2)', 'nocontribs' => 'No se encontraron cambios que cumplieran estos criterios.', 'uctop' => '(edición actual)', 'month' => 'Desde el mes (y anteriores):', 'year' => 'Desde el año (y anteriores):', 'sp-contributions-newbies' => 'Mostrar solo las contribuciones de usuarios nuevos', 'sp-contributions-newbies-sub' => 'Para cuentas nuevas', 'sp-contributions-newbies-title' => 'Contribuciones de usuarios nuevos', 'sp-contributions-blocklog' => 'registro de bloqueos', 'sp-contributions-deleted' => 'contribuciones de usuario borradas', 'sp-contributions-uploads' => 'subidas', 'sp-contributions-logs' => 'registros', 'sp-contributions-talk' => 'discusión', 'sp-contributions-userrights' => 'administración de derechos de usuarios', 'sp-contributions-blocked-notice' => 'Este usuario está actualmente bloqueado. La última entrada del registro de bloqueos es presentada debajo para mayor referencia:', 'sp-contributions-blocked-notice-anon' => 'Esta dirección IP se encuentra actualmente bloqueada. A continuación se muestra la última entrada del registro de bloqueos para mayor referencia.', 'sp-contributions-search' => 'Buscar contribuciones', 'sp-contributions-username' => 'Dirección IP o nombre de usuario:', 'sp-contributions-toponly' => 'Solo mostrar últimas ediciones de página', 'sp-contributions-submit' => 'Buscar', # What links here 'whatlinkshere' => 'Lo que enlaza aquí', 'whatlinkshere-title' => 'Páginas que enlazan con «$1»', 'whatlinkshere-page' => 'Página:', 'linkshere' => "Las siguientes páginas enlazan a '''[[:$1]]''':", 'nolinkshere' => "Ninguna página enlaza con '''[[:$1]]'''.", 'nolinkshere-ns' => "Ninguna página enlaza con '''[[:$1]]''' en el espacio de nombres elegido.", 'isredirect' => 'página redirigida', 'istemplate' => 'inclusión', 'isimage' => 'Enlace de imagen', 'whatlinkshere-prev' => '{{PLURAL:$1|previa|previas $1}}', 'whatlinkshere-next' => '{{PLURAL:$1|siguiente|siguientes $1}}', 'whatlinkshere-links' => '← enlaces', 'whatlinkshere-hideredirs' => '$1 redirecciones', 'whatlinkshere-hidetrans' => '$1 inclusiones', 'whatlinkshere-hidelinks' => '$1 enlaces', 'whatlinkshere-hideimages' => '$1 enlaces a archivos', 'whatlinkshere-filters' => 'Filtros', # Block/unblock 'autoblockid' => 'Bloqueo automático #$1', 'block' => 'Bloquear usuario', 'unblock' => 'Desbloquear usuario', 'blockip' => 'Bloquear usuario', 'blockip-legend' => 'Bloquear usuario', 'blockiptext' => 'Usa el siguiente formulario para bloquear el acceso de escritura desde una dirección IP específica o nombre de usuario. Esto debería hacerse sólo para prevenir vandalismos, y de acuerdo a las [[{{MediaWiki:Policy-url}}|políticas]]. Explica la razón específica del bloqueo (por ejemplo, citando las páginas en particular que han sido objeto de vandalismo).', 'ipadressorusername' => 'Dirección IP o nombre de usuario:', 'ipbexpiry' => 'Caducidad:', 'ipbreason' => 'Motivo:', 'ipbreason-dropdown' => '*Motivos comunes de bloqueo ** Añadir información falsa ** Eliminar contenido de las páginas ** Publicitar enlaces a otras páginas web ** Añadir basura a las páginas ** Comportamiento intimidatorio u hostil ** Abuso de múltiples cuentas ** Nombre de usuario inaceptable', 'ipb-hardblock' => 'Impedir que los usuarios identificados editen desde esta dirección IP', 'ipbcreateaccount' => 'Prevenir la creación de cuentas de usuario', 'ipbemailban' => 'Prevenir que el usuario envíe correo electrónico', 'ipbenableautoblock' => 'Bloquear automáticamente la dirección IP usada por este usuario y cualquier IP posterior desde la cual intente editar', 'ipbsubmit' => 'Bloquear a este usuario', 'ipbother' => 'Especificar caducidad', 'ipboptions' => '2 horas:2 hours,1 día:1 day,3 días:3 days,1 semana:1 week,2 semanas:2 weeks,1 mes:1 month,3 meses:3 months,6 meses:6 months,1 año:1 year,para siempre:infinite', 'ipbhidename' => 'Ocultar nombre de usuario de ediciones y listas', 'ipbwatchuser' => 'Vigilar las páginas de usuario y de discusión de este usuario', 'ipb-disableusertalk' => 'Impedir que este usuario edite su propia página de discusión mientras esté bloqueado', 'ipb-change-block' => 'Rebloquear al usuario con estos datos', 'ipb-confirm' => 'Confirmar bloqueo', 'badipaddress' => 'La dirección IP no tiene el formato correcto.', 'blockipsuccesssub' => 'Bloqueo realizado con éxito', 'blockipsuccesstext' => '"[[Special:Contributions/$1|$1]]" ha sido bloqueado.<br /> Véase la [[Special:BlockList|lista de bloqueos]] para revisarlo.', 'ipb-blockingself' => '¡Estás a punto de bloquearte a ti mismo! ¿Estás seguro de que quieres hacerlo?', 'ipb-confirmhideuser' => 'Estás a punto de bloquear un usuario con la opción de supresión activada. Esto suprimirá el nombre de usuario en todas las listas y entradas de registro. ¿Estás seguro de que deseas proceder?', 'ipb-confirmaction' => 'Si estás seguro de querer hacerlo, por favor, marca el campo «{{int:ipb-confirm}}» que hay al final.', 'ipb-edit-dropdown' => 'Editar motivo del bloqueo', 'ipb-unblock-addr' => 'Desbloquear $1', 'ipb-unblock' => 'Desbloquear un usuario o una IP', 'ipb-blocklist' => 'Ver bloqueos vigentes', 'ipb-blocklist-contribs' => 'Contribuciones de $1', 'unblockip' => 'Desbloquear usuario', 'unblockiptext' => 'Use el formulario a continuación para devolver los permisos de escritura a una dirección IP que ha sido bloqueada.', 'ipusubmit' => 'Desactivar este bloqueo', 'unblocked' => '[[User:$1|$1]] ha sido {{GENDER:$1|desbloqueado|desbloqueada}}', 'unblocked-range' => '$1 ha sido desbloqueado', 'unblocked-id' => 'Se ha eliminado el bloqueo $1', 'blocklist' => 'Usuarios bloqueados', 'ipblocklist' => 'Usuarios bloqueados', 'ipblocklist-legend' => 'Encontrar a un usuario bloqueado', 'blocklist-userblocks' => 'Ocultar bloqueos de cuenta', 'blocklist-tempblocks' => 'Ocultar bloqueos temporales', 'blocklist-addressblocks' => 'Ocultar bloqueos de una sola dirección IP', 'blocklist-rangeblocks' => 'Ocultar bloqueos de rango', 'blocklist-timestamp' => 'Fecha y hora', 'blocklist-target' => 'Destino', 'blocklist-expiry' => 'Caduca', 'blocklist-by' => 'Administrador bloqueante', 'blocklist-params' => 'Parámetros de bloqueo', 'blocklist-reason' => 'Motivo', 'ipblocklist-submit' => 'Buscar', 'ipblocklist-localblock' => 'Bloqueo local', 'ipblocklist-otherblocks' => 'Otros {{PLURAL:$1|bloqueo| bloqueos}}', 'infiniteblock' => 'infinito', 'expiringblock' => 'expira el $1 a las $2', 'anononlyblock' => 'sólo anón.', 'noautoblockblock' => 'bloqueo automático deshabilitado', 'createaccountblock' => 'creación de cuenta bloqueada', 'emailblock' => 'correo electrónico bloqueado', 'blocklist-nousertalk' => 'no puede editar su propia página de discusión', 'ipblocklist-empty' => 'La lista de bloqueos está vacía.', 'ipblocklist-no-results' => 'El nombre de usuario o IP indicado no está bloqueado.', 'blocklink' => 'bloquear', 'unblocklink' => 'desbloquear', 'change-blocklink' => 'cambiar bloqueo', 'contribslink' => 'contribuciones', 'emaillink' => 'enviar correo electrónico', 'autoblocker' => 'Has sido bloqueado automáticamente porque tu dirección IP ha sido usada recientemente por «[[User:$1|$1]]». El motivo por el que se bloqueó a [[User:$1|$1]] es «$2».', 'blocklogpage' => 'Registro de bloqueos', 'blocklog-showlog' => 'Este usuario ha sido bloqueado previamente. Debajo se provee el registro de bloqueos para mayor referencia:', 'blocklog-showsuppresslog' => 'Este usuario ha sido bloqueado y ocultado. Se provee el registro de supresiones para más detalle:', 'blocklogentry' => 'bloqueó a [[$1]] $3 durante un plazo de $2', 'reblock-logentry' => 'cambió el bloqueo para [[$1]] con una caducidad de $2 $3', 'blocklogtext' => 'Esto es un registro de acciones de bloqueo y desbloqueo de usuarios. Las direcciones IP bloqueadas automáticamente no aparecen aquí. Consulta la [[Special:BlockList|lista de bloqueos]] para ver la lista de bloqueos y prohibiciones de operar en vigor.', 'unblocklogentry' => 'desbloqueó a $1', 'block-log-flags-anononly' => 'sólo anónimos', 'block-log-flags-nocreate' => 'desactivada la creación de cuentas', 'block-log-flags-noautoblock' => 'bloqueo automático desactivado', 'block-log-flags-noemail' => 'correo electrónico deshabilitado', 'block-log-flags-nousertalk' => 'no puede editar su propia página de discusión', 'block-log-flags-angry-autoblock' => 'autobloqueo avanzado habilitado', 'block-log-flags-hiddenname' => 'nombre de usuario ocultado', 'range_block_disabled' => 'La facultad de administrador de crear bloqueos por rangos está deshabilitada.', 'ipb_expiry_invalid' => 'El tiempo de caducidad no es válido.', 'ipb_expiry_temp' => 'Los bloqueos a nombres de usuario ocultos deben ser permanentes.', 'ipb_hide_invalid' => 'No se puede suprimir esta cuenta; tiene más de {{PLURAL:$1|una edición|$1 ediciones}}.', 'ipb_already_blocked' => '"$1" ya se encuentra bloqueado.', 'ipb-needreblock' => '$1 ya está bloqueado. ¿Quieres cambiar el bloqueo?', 'ipb-otherblocks-header' => '{{PLURAL:$1|Otro bloqueo|Otros bloqueos}}', 'unblock-hideuser' => 'No se puede desbloquear a este usuario, porque su nombre de usuario está oculto.', 'ipb_cant_unblock' => "'''Error''': Número ID $1 de bloqueo no encontrado. Pudo haber sido desbloqueado ya.", 'ipb_blocked_as_range' => 'Error: la dirección IP $1 no está bloqueada directamente y no puede ser desbloqueada. Sin embargo, está bloqueada como parte del rango $2, que puede ser desbloqueado.', 'ip_range_invalid' => 'El rango de IP no es válido.', 'ip_range_toolarge' => 'Los bloqueos de rango superiores a /$1 no están permitidos.', 'proxyblocker' => 'Bloqueador de proxies', 'proxyblockreason' => 'Su dirección IP ha sido bloqueada porque es un proxy abierto. Por favor, contacte con su proveedor de servicios de Internet o con su servicio de asistencia técnica e infórmeles de este grave problema de seguridad.', 'sorbsreason' => 'Su dirección IP está listada como proxy abierto en DNSBL.', 'sorbs_create_account_reason' => 'Su dirección IP está listada como proxy abierto en DNSBL. No puede crear una cuenta', 'xffblockreason' => 'Una dirección IP presente en la cabecera X-Forwarded-For, tuya o del servidor proxy que estás usando, ha sido bloqueada. El motivo original del bloqueo fue: $1', 'cant-see-hidden-user' => 'El usuario que está intentando bloquear ya ha sido bloqueado y oculto. Puesto que usted no tiene el derecho hideuser, usted no puede ver o editar los bloqueos del usuario.', 'ipbblocked' => 'No puedes bloquear o desbloquear a otros usuarios porque estás bloqueado', 'ipbnounblockself' => 'No puedes desbloquearte', # Developer tools 'lockdb' => 'Bloquear la base de datos', 'unlockdb' => 'Desbloquear la base de datos', 'lockdbtext' => 'El bloqueo de la base de datos impedirá a todos los usuarios editar páginas, cambiar sus preferencias, modificar sus listas de seguimiento y cualquier otra función que requiera realizar cambios en la base de datos. Por favor, confirme que ésto es precisamente lo que quiere hacer y que desbloqueará la base de datos tan pronto haya finalizado las operaciones de mantenimiento.', 'unlockdbtext' => 'El desbloqueo de la base de datos permitirá a todos los usuarios editar páginas, cambiar sus preferencias, modificar sus listas de seguimiento y cualesquiera otras funciones que impliquen modificar la base de datos. Por favor, confirme que esto es precisamente lo que quiere hacer.', 'lockconfirm' => 'Sí, realmente quiero bloquear la base de datos.', 'unlockconfirm' => 'Sí, realmente quiero desbloquear la base de datos.', 'lockbtn' => 'Bloquear la base de datos', 'unlockbtn' => 'Desbloquear la base de datos', 'locknoconfirm' => 'No ha confirmado lo que desea hacer.', 'lockdbsuccesssub' => 'El bloqueo se ha realizado con éxito', 'unlockdbsuccesssub' => 'El desbloqueo se ha realizado con éxito', 'lockdbsuccesstext' => 'La base de datos de {{SITENAME}} ha sido bloqueada. <br />Recuerde retirar el bloqueo después de completar las tareas de mantenimiento.', 'unlockdbsuccesstext' => 'La base de datos de {{SITENAME}} ha sido desbloqueada.', 'lockfilenotwritable' => 'El archivo-cerrojo de la base de datos no tiene permiso de escritura. Para bloquear o desbloquear la base de datos, este archivo tiene que ser escribible por el servidor web.', 'databasenotlocked' => 'La base de datos no está bloqueada.', 'lockedbyandtime' => '(por {{GENDER:$1|$1}} el $2 a las $3)', # Move page 'move-page' => 'Trasladar $1', 'move-page-legend' => 'Renombrar página', 'movepagetext' => "Mediante el siguiente formulario puedes renombrar una página, moviendo todo su historial al nombre nuevo. El título anterior redirigirá al nuevo. Puedes actualizar automáticamente las redirecciones que apuntan al título original. Si eliges no hacerlo, asegúrate de revisar posibles redirecciones [[Special:DoubleRedirects|dobles]] o [[Special:BrokenRedirects|rotas]]. Tú eres responsable de asegurar que los enlaces continúen funcionando correctamente. Nota que la página '''no''' se moverá si ya hay una página con el título nuevo, a menos de que ésta sea una redirección y no tenga historial de ediciones pasadas. Esto significa que puedes deshacer el renombrado en caso de un error, y que no puedes sobreescribir una página existente. '''Aviso''' Esto puede representar un cambio drástico e inesperado para una página popular; asegúrate de entender las consecuencias de esta acción antes de proceder.", 'movepagetext-noredirectfixer' => "Usando el siguiente formulario se renombrará una página, trasladando todo su historial al nuevo nombre. El título anterior se convertirá en una redirección al nuevo título. Asegúrate de no dejar [[Special:DoubleRedirects|redirecciones dobles]] o [[Special:BrokenRedirects|rotas]]. Tú eres responsable de hacer que los enlaces sigan apuntando adonde se supone que deberían hacerlo. Recuerda que la página '''no''' será renombrada si ya existe una página con el nuevo título, a no ser que sea una página vacía o una redirección sin historial. Esto significa que podrás renombrar una página a su título original si has cometido un error, pero que no podrás sobrescribir una página existente. '''¡Aviso!''' Este puede ser un cambio drástico e inesperado para una página popular; por favor, asegúrate de entender las consecuencias del procedimiento antes de seguir adelante.", 'movepagetalktext' => "La página de discusión asociada, si existe, será renombrada automáticamente '''a menos que:''' *Estés trasladando la página entre espacios de nombres diferentes, *Una página de discusión no vacía ya exista con el nombre nuevo, o *No marques el recuadro «Renombrar la página de discusión asociada». En estos casos, deberás trasladar manualmente el contenido de la página de discusión.", 'movearticle' => 'Renombrar página', 'moveuserpage-warning' => "'''Aviso:''' estás a punto de trasladar una página de usuario. Ten en cuenta que solo será trasladada la página; el usuario '''no''' será renombrado.", 'movenologintext' => 'Es necesario ser usuario registrado y [[Special:UserLogin|haber iniciado sesión]] para renombrar una página.', 'movenotallowed' => 'No tienes permiso para trasladar páginas.', 'movenotallowedfile' => 'No tienes permiso para trasladar archivos.', 'cant-move-user-page' => 'No tienes permiso para trasladar páginas de usuario (excepto subpáginas).', 'cant-move-to-user-page' => 'No tienes permiso para trasladar una página a una página de usuario (excepto a subpáginas de usuario).', 'newtitle' => 'A título nuevo:', 'move-watch' => 'Vigilar páginas de origen y destino', 'movepagebtn' => 'Renombrar página', 'pagemovedsub' => 'Renombrado realizado con éxito', 'movepage-moved' => "'''«$1» ha sido trasladado a «$2».'''", 'movepage-moved-redirect' => 'Se ha creado una redirección.', 'movepage-moved-noredirect' => 'Se ha suprimido la creación de la redirección.', 'articleexists' => 'Ya existe una página con ese nombre, o el nombre que has escogido no es válido. Por favor, elige otro nombre.', 'cantmove-titleprotected' => 'No puedes trasladar la página a esta ubicación, porque el nuevo título ha sido protegido para evitar su creación.', 'movetalk' => 'Renombrar la página de discusión asociada', 'move-subpages' => 'Intentar trasladar las subpáginas (hasta $1)', 'move-talk-subpages' => 'Intentar trasladar las subpáginas de discusión (hasta $1)', 'movepage-page-exists' => 'La página $1 ya existe, por lo que no puede ser renombrada automáticamente.', 'movepage-page-moved' => 'La página $1 ha sido trasladada a $2.', 'movepage-page-unmoved' => 'La página $1 no se ha podido trasladar a $2.', 'movepage-max-pages' => 'Se {{PLURAL:$1|ha trasladado un máximo de una página|han trasladado un máximo de $1 páginas}}, y no van a trasladarse más automáticamente.', 'movelogpage' => 'Registro de traslados', 'movelogpagetext' => 'Abajo se encuentra una lista de páginas trasladadas.', 'movesubpage' => '{{PLURAL:$1|Subpágina|Subpáginas}}', 'movesubpagetext' => 'Esta página tiene {{PLURAL:$1|la siguiente subpágina|las siguientes $1 subpáginas}}:', 'movenosubpage' => 'Esta página no tiene subpáginas.', 'movereason' => 'Motivo:', 'revertmove' => 'revertir', 'delete_and_move' => 'Borrar y trasladar', 'delete_and_move_text' => '==Se necesita borrado== La página de destino ("[[:$1]]") ya existe. ¿Quiere borrarla para permitir al traslado?', 'delete_and_move_confirm' => 'Sí, borrar la página', 'delete_and_move_reason' => 'Borrada para trasladar [[$1]]', 'selfmove' => 'Los títulos de origen y destino son los mismos; no se puede trasladar una página sobre sí misma.', 'immobile-source-namespace' => 'No se pueden trasladar páginas en el espacio de nombres «$1»', 'immobile-target-namespace' => 'No se puede trasladar páginas al espacio de nombres «$1»', 'immobile-target-namespace-iw' => 'Un enlace interwiki no es un destino válido para trasladar una página.', 'immobile-source-page' => 'Esta página no se puede renombrar.', 'immobile-target-page' => 'No se puede trasladar a tal título.', 'bad-target-model' => 'El destino deseado utiliza un modelo diferente de contenido. No se puede realizar la conversión de $1 a $2.', 'imagenocrossnamespace' => 'No se puede trasladar el fichero a otro espacio de nombres', 'nonfile-cannot-move-to-file' => 'No es posible trasladar lo que no es un archivo al espacio de nombres de archivo', 'imagetypemismatch' => 'La nueva extensión de archivo no corresponde con su tipo', 'imageinvalidfilename' => 'El nombre del fichero de destino no es válido', 'fix-double-redirects' => 'Actualizar las redirecciones que apuntan al título original', 'move-leave-redirect' => 'Dejar una redirección', 'protectedpagemovewarning' => "'''Advertencia:''' Esta página ha sido bloqueada de tal manera que solamente usuarios con privilegios de administrador puedan trasladarla. A continuación se muestra la última entrada de registro para referencia:", 'semiprotectedpagemovewarning' => "'''Nota:''' Esta página ha sido bloqueada para que solamente usuarios registrados pueden moverla. A continuación se muestra la última entrada de registro para referencia:", 'move-over-sharedrepo' => '== El archivo existe == [[:$1]] existe en un repositorio compartido. El traslado a este título invalidará la compartición del archivo.', 'file-exists-sharedrepo' => 'El nombre de archivo elegido ya está siendo usado en un repositorio compartido. Por favor, elige otro nombre.', # Export 'export' => 'Exportar páginas', 'exporttext' => 'Puedes exportar el texto y el historial de ediciones de una página en particular o de un conjunto de páginas a un texto XML. En el futuro, este texto podría importarse en otro wiki que ejecutase MediaWiki a través de [[Special:Import|importar página]]. Para exportar páginas, escribe los títulos en la caja de texto de abajo, un título por línea, y selecciona si quieres la versión actual junto a las versiones anteriores, con las líneas del historial, o sólo la versión actual con la información sobre la última edición. En el último caso también puedes usar un enlace, por ejemplo [[{{#Special:Export}}/{{MediaWiki:Mainpage}}]] para la página "[[{{MediaWiki:Mainpage}}]]".', 'exportall' => 'Exportar todas las páginas', 'exportcuronly' => 'Incluye sólo la revisión actual, no el historial de revisiones al completo.', 'exportnohistory' => "---- '''Nota:''' Exportar el historial completo de páginas a través de este formulario ha sido deshabilitado debido a problemas de rendimiento del servidor.", 'exportlistauthors' => 'Incluir una lista completa de colaboradores para cada página', 'export-submit' => 'Exportar', 'export-addcattext' => 'Añadir páginas desde la categoría:', 'export-addcat' => 'Añadir', 'export-addnstext' => 'Agregar páginas del nombre del sitio:', 'export-addns' => 'Agregar', 'export-download' => 'Guardar como archivo', 'export-templates' => 'Incluir plantillas', 'export-pagelinks' => 'Incluir páginas enlazadas a una profundidad de:', # Namespace 8 related 'allmessages' => 'Todos los mensajes de MediaWiki', 'allmessagesname' => 'Nombre', 'allmessagesdefault' => 'Texto predeterminado', 'allmessagescurrent' => 'Texto actual', 'allmessagestext' => 'Esta es una lista de mensajes del sistema disponibles en el espacio de nombres MediaWiki: Por favor visita [https://www.mediawiki.org/wiki/Localisation Localización MediaWiki] y [//translatewiki.net translatewiki.net] si deseas contribuir con la localización genérica MediaWiki.', 'allmessagesnotsupportedDB' => "Esta página no está disponible porque '''\$wgUseDatabaseMessages''' está deshabilitado.", 'allmessages-filter-legend' => 'Filtro', 'allmessages-filter' => 'Filtrar por estado de personalización:', 'allmessages-filter-unmodified' => 'Sin modificar', 'allmessages-filter-all' => 'Todos', 'allmessages-filter-modified' => 'Modificados', 'allmessages-prefix' => 'Filtrar por prefijo:', 'allmessages-language' => 'Idioma:', 'allmessages-filter-submit' => 'Ir', 'allmessages-filter-translate' => 'Traducir', # Thumbnails 'thumbnail-more' => 'Aumentar', 'filemissing' => 'Falta archivo', 'thumbnail_error' => 'Error al crear miniatura: $1', 'thumbnail_error_remote' => 'Mensaje de error de $1 : $2', 'djvu_page_error' => 'Página DjVu fuera de rango', 'djvu_no_xml' => 'Imposible obtener XML para el archivo DjVu', 'thumbnail-temp-create' => 'No se ha podido crear el archivo temporal de la miniatura', 'thumbnail-dest-create' => 'No se ha podido guardar la miniatura', 'thumbnail_invalid_params' => 'Parámetros del thumbnail no válidos', 'thumbnail_dest_directory' => 'Incapaz de crear el directorio de destino', 'thumbnail_image-type' => 'Tipo de imagen no contemplado', 'thumbnail_gd-library' => 'Configuración de la librería GD incompleta: falta la función $1', 'thumbnail_image-missing' => 'El fichero parece no existir: $1', # Special:Import 'import' => 'Importar páginas', 'importinterwiki' => 'Importación transwiki', 'import-interwiki-text' => 'Selecciona un wiki y un título de página para importar. Las fechas de revisiones y los nombres de editores se preservarán. Todas las importaciones transwiki se registran en el [[Special:Log/import|registro de importaciones]].', 'import-interwiki-source' => 'Wiki o página origen:', 'import-interwiki-history' => 'Copiar todas las versiones históricas para esta página', 'import-interwiki-templates' => 'Incluir todas las plantillas', 'import-interwiki-submit' => 'Importar', 'import-interwiki-namespace' => 'Espacio de nombres de destino:', 'import-interwiki-rootpage' => 'Página raíz del destino (opcional):', 'import-upload-filename' => 'Nombre de archivo:', 'import-comment' => 'Comentario:', 'importtext' => 'Por favor, exporta el archivo desde el wiki de origen usando la [[Special:Export|herramienta de exportación]], guárdalo en tu disco y súbelo aquí.', 'importstart' => 'Importando páginas...', 'import-revision-count' => '$1 {{PLURAL:$1|revisión|revisiones}}', 'importnopages' => 'No hay páginas que importar.', 'imported-log-entries' => 'Importados $1 {{PLURAL:$1|entradas de registro|entradas de registro}}.', 'importfailed' => 'La importación ha fallado: $1', 'importunknownsource' => 'Tipo de fuente de importación desconocida', 'importcantopen' => 'No se pudo importar el archivo', 'importbadinterwiki' => 'Enlace interwiki anómalo', 'importnotext' => 'Vacío o sin texto', 'importsuccess' => '¡La importación se ha realizado con éxito!', 'importhistoryconflict' => 'Existen revisiones en conflicto en el historial (puede que se haya importado esta página antes)', 'importnosources' => 'No hay fuentes de importación transwiki y no está permitido subir directamente el historial.', 'importnofile' => 'No se subieron archivos de importación.', 'importuploaderrorsize' => 'Falló la carga del archivo de importaciones. Su tamaño es superior al máximo permitido.', 'importuploaderrorpartial' => 'Falló la subida del fichero de importación. Se subió sólo parcialmente.', 'importuploaderrortemp' => 'Falló la subida del fichero de importación. No hay un directorio temporal.', 'import-parse-failure' => 'Error de lectura al importar XML', 'import-noarticle' => '¡No hay páginas para importar!', 'import-nonewrevisions' => 'Ninguna revisión fue importada (todas ya estaban presentes o fueron omitido debido a errores).', 'xml-error-string' => '$1 en la línea $2, col $3 (byte $4): $5', 'import-upload' => 'Subir datos XML', 'import-token-mismatch' => 'Pérdida de datos de sesión. Por favor, inténtalo de nuevo.', 'import-invalid-interwiki' => 'No se puede importar de la wiki especificada.', 'import-error-edit' => 'La página $1 no se importó porque no tienes permisos para editarla.', 'import-error-create' => 'La página «$1» no se importó porque no tienes permisos para crearla.', 'import-error-interwiki' => 'La página "$1" no se ha importado porque su nombre está reservado para la vinculación externa (interwikis).', 'import-error-special' => 'La página "$1" no se ha importado porque pertenece a un espacio de nombres especial que no admite páginas.', 'import-error-invalid' => 'La página "$1" no se ha importado porque su nombre no es válido.', 'import-error-unserialize' => 'La revisión $2 de la página "$1" no pudo dejar de hacerse en serie. Se informó de la revisión para utilizar el modelo de contenidos $3 ejecutado en serie como $4.', 'import-options-wrong' => '{{PLURAL:$2|Opción errónea|Opciones erróneas}}: <nowiki>$1</nowiki>', 'import-rootpage-invalid' => 'La página raíz dada es un título inválido.', 'import-rootpage-nosubpage' => 'El espacio de nombres "$1" de la página raíz no permite subpáginas.', # Import log 'importlogpage' => 'Registro de importaciones', 'importlogpagetext' => 'Importaciones administrativas de páginas con historial desde otros wikis.', 'import-logentry-upload' => 'importó [[$1]] por subida de archivo', 'import-logentry-upload-detail' => '$1 {{PLURAL:$1|revisión|revisiones}}', 'import-logentry-interwiki' => 'transwikificada $1', 'import-logentry-interwiki-detail' => '$1 {{PLURAL:$1|revisión|revisiones}} desde $2', # JavaScriptTest 'javascripttest' => 'Pruebas de JavaScript', 'javascripttest-title' => 'Pruebas de $1 en ejecución', 'javascripttest-pagetext-noframework' => 'Esta página está reservada para ejecutar pruebas de JavaScript.', 'javascripttest-pagetext-unknownframework' => 'Marco de pruebas desconocido "$1".', 'javascripttest-pagetext-frameworks' => 'Por favor, seleccione uno de los marcos de pruebas siguientes: $1', 'javascripttest-pagetext-skins' => 'Elija un aspecto (skin) para ejecutar las pruebas:', 'javascripttest-qunit-intro' => 'Consulte la [$1 documentación sobre las pruebas] en mediawiki.org.', 'javascripttest-qunit-heading' => 'Conjunto de pruebas MediaWiki JavaScript QUnit', # Tooltip help for the actions 'tooltip-pt-userpage' => 'Tu página de {{gender:|usuario|usuaria}}', 'tooltip-pt-anonuserpage' => 'La página de usuario de la IP desde la que editas', 'tooltip-pt-mytalk' => 'Tu página de discusión', 'tooltip-pt-anontalk' => 'Discusión sobre ediciones hechas desde esta dirección IP', 'tooltip-pt-preferences' => 'Tus preferencias', 'tooltip-pt-watchlist' => 'Lista de páginas cuyos cambios vigilas', 'tooltip-pt-mycontris' => 'Lista de tus contribuciones', 'tooltip-pt-login' => 'Te recomendamos iniciar sesión, sin embargo no es obligatorio', 'tooltip-pt-logout' => 'Salir de la sesión', 'tooltip-ca-talk' => 'Discusión acerca del artículo', 'tooltip-ca-edit' => 'Puedes editar esta página. Utiliza el botón de previsualización antes de guardar', 'tooltip-ca-addsection' => 'Inicia una nueva sección', 'tooltip-ca-viewsource' => 'Esta página está protegida. Puedes ver su código fuente', 'tooltip-ca-history' => 'Versiones anteriores de esta página y sus autores', 'tooltip-ca-protect' => 'Proteger esta página', 'tooltip-ca-unprotect' => 'Cambiar protección de esta página', 'tooltip-ca-delete' => 'Borrar esta página', 'tooltip-ca-undelete' => 'Restaurar las ediciones hechas a esta página antes de que fuese borrada', 'tooltip-ca-move' => 'Trasladar esta página', 'tooltip-ca-watch' => 'Añadir esta página a tu lista de seguimiento', 'tooltip-ca-unwatch' => 'Borrar esta página de su lista de seguimiento', 'tooltip-search' => 'Buscar en {{SITENAME}}', 'tooltip-search-go' => 'Ir al artículo con este nombre exacto si existe', 'tooltip-search-fulltext' => 'Busca este texto en las páginas', 'tooltip-p-logo' => 'Visitar la página principal', 'tooltip-n-mainpage' => 'Visitar la página principal', 'tooltip-n-mainpage-description' => 'Visitar la página principal', 'tooltip-n-portal' => 'Acerca del proyecto, lo que puedes hacer, dónde encontrar información', 'tooltip-n-currentevents' => 'Información de contexto sobre acontecimientos actuales', 'tooltip-n-recentchanges' => 'Lista de cambios recientes en el wiki', 'tooltip-n-randompage' => 'Cargar una página al azar', 'tooltip-n-help' => 'El lugar para aprender', 'tooltip-t-whatlinkshere' => 'Lista de todas las páginas del wiki que enlazan aquí', 'tooltip-t-recentchangeslinked' => 'Cambios recientes en las páginas que enlazan con ésta', 'tooltip-feed-rss' => 'Sindicación RSS de esta página', 'tooltip-feed-atom' => 'Sindicación Atom de esta página', 'tooltip-t-contributions' => 'Lista de contribuciones de este usuario', 'tooltip-t-emailuser' => 'Enviar un mensaje de correo a este usuario', 'tooltip-t-upload' => 'Subir imágenes o archivos multimedia', 'tooltip-t-specialpages' => 'Lista de todas las páginas especiales', 'tooltip-t-print' => 'Versión imprimible de esta página', 'tooltip-t-permalink' => 'Enlace permanente a esta versión de la página', 'tooltip-ca-nstab-main' => 'Ver el artículo', 'tooltip-ca-nstab-user' => 'Ver la página de usuario', 'tooltip-ca-nstab-media' => 'Ver la página de multimedia', 'tooltip-ca-nstab-special' => 'Esta es una página especial, no se puede editar la página en sí', 'tooltip-ca-nstab-project' => 'Ver la página de proyecto', 'tooltip-ca-nstab-image' => 'Ver la página de la imagen', 'tooltip-ca-nstab-mediawiki' => 'Ver el mensaje de sistema', 'tooltip-ca-nstab-template' => 'Ver la plantilla', 'tooltip-ca-nstab-help' => 'Ver la página de ayuda', 'tooltip-ca-nstab-category' => 'Ver la página de categoría', 'tooltip-minoredit' => 'Marcar este cambio como menor', 'tooltip-save' => 'Guardar los cambios', 'tooltip-preview' => 'Previsualiza los cambios realizados. ¡Por favor, hazlo antes de grabar!', 'tooltip-diff' => 'Muestra los cambios que ha introducido en el texto.', 'tooltip-compareselectedversions' => 'Ver las diferencias entre las dos versiones seleccionadas de esta página.', 'tooltip-watch' => 'Añadir esta página a tu lista de seguimiento', 'tooltip-watchlistedit-normal-submit' => 'Borrar páginas', 'tooltip-watchlistedit-raw-submit' => 'Actualizar lista de seguimiento', 'tooltip-recreate' => 'Recupera una página que ha sido borrada', 'tooltip-upload' => 'Empieza la subida', 'tooltip-rollback' => '«Revertir» revierte todas las ediciones del último usuario con un solo clic.', 'tooltip-undo' => '«Deshacer» revierte la edición seleccionada y abre la página de edición en el modo de previsualización. Permite añadir una razón al resumen de edición.', 'tooltip-preferences-save' => 'Guardar las preferencias', 'tooltip-summary' => 'Introduce un breve resumen', 'interlanguage-link-title' => '$1 ($2)', # Stylesheets 'common.css' => '/* El CSS colocado en esta página será aplicado a todas las apariencias */', 'cologneblue.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia Cologne Blue */', 'monobook.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia "MonoBook" */', 'modern.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia Moderna */', 'vector.css' => '/* El CSS colocado en esta página afectará a los usuarios que usen la apariencia "Vector" */', 'print.css' => '/* Los estilos CSS colocados aquí afectarán la impresión */', 'noscript.css' => '/* Los estilos CSS colocados aquí se aplicarán a los usuarios que hayan desactivado el JavaScript en su navegador */', 'group-autoconfirmed.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Usuarios autoconfirmados */', 'group-bot.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Bots */', 'group-sysop.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Administradores */', 'group-bureaucrat.css' => '/* Los estilos CSS colocados aquí se aplicarán para todos los usuarios del grupo Burócratas */', # Scripts 'common.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios en cada carga de página */', 'cologneblue.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la piel Colonia azul */', 'monobook.js' => '/* El código JavaScript que se ponga aquí será cargado por los usuarios de la apariencia MonoBook */', 'modern.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la apariencia Moderna */', 'vector.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios que usen la apariencia Vector */', 'group-autoconfirmed.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Usuarios autoconfirmados */', 'group-bot.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Bots */', 'group-sysop.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Administradores */', 'group-bureaucrat.js' => '/* Cualquier código JavaScript escrito aquí se cargará para todos los usuarios del grupo Burócratas */', # Metadata 'notacceptable' => 'El servidor wiki no puede proveer los datos en un formato que su cliente (navegador) pueda entender.', # Attribution 'anonymous' => '{{PLURAL:$1|Usuario anónimo|Usuarios anónimos}} de {{SITENAME}}', 'siteuser' => '{{GENDER:$1|Usuario|Usuaria}} $1 de {{SITENAME}}', 'anonuser' => '{{SITENAME}} usuario anónimo $1', 'lastmodifiedatby' => 'Esta página fue modificada por última vez en $2, $1 por $3.', 'othercontribs' => 'Basado en el trabajo de $1.', 'others' => 'otros', 'siteusers' => '{{PLURAL:$2|Usuario|Usuarios}} $1 de {{SITENAME}}', 'anonusers' => '{{SITENAME}} {{PLURAL:$2|usuario|usuarios}} anónimos $1', 'creditspage' => 'Créditos de la página', 'nocredits' => 'No hay información de créditos para esta página.', # Spam protection 'spamprotectiontitle' => 'Filtro de protección contra spam', 'spamprotectiontext' => 'La página que quería guardar fue bloqueada por el filtro de spam. Esto podría estar causado por un enlace a un sitio externo incluido en la lista negra.', 'spamprotectionmatch' => 'El siguiente texto es el que activó nuestro filtro de spam: $1', 'spambot_username' => 'Limpieza de spam de MediaWiki', 'spam_reverting' => 'Revirtiendo a la última versión que no contenga enlaces a $1', 'spam_blanking' => 'Todas las revisiones contienen enlaces a $1, blanqueando', 'spam_deleting' => 'Todas las revisiones que contienen enlaces a $1, en proceso de eliminación', 'simpleantispam-label' => 'Comprobación anti-spam ¡NO rellenes esto!', # Info page 'pageinfo-title' => 'Información para «$1»', 'pageinfo-not-current' => 'Lo sentimos, no es posible mostrar esta información para las revisiones antiguas.', 'pageinfo-header-basic' => 'Información básica', 'pageinfo-header-edits' => 'Historial de ediciones', 'pageinfo-header-restrictions' => 'Protección de página', 'pageinfo-header-properties' => 'Propiedades de página', 'pageinfo-display-title' => 'Visualizar el título', 'pageinfo-default-sort' => 'Criterio de ordenación predeterminado', 'pageinfo-length' => 'Longitud de la página (en bytes)', 'pageinfo-article-id' => 'Identificador ID de la página', 'pageinfo-language' => 'Idioma de la página', 'pageinfo-content-model' => 'Modelo de contenido de la página', 'pageinfo-robot-policy' => 'Indización por robots', 'pageinfo-robot-index' => 'Permitido', 'pageinfo-robot-noindex' => 'No permitido', 'pageinfo-views' => 'Número de vistas', 'pageinfo-watchers' => 'Número de usuarios que vigilan la página', 'pageinfo-few-watchers' => 'Menos de $1 {{PLURAL:$1|vigilante|vigilantes}}', 'pageinfo-redirects-name' => 'Número de redirecciones a esta página', 'pageinfo-redirects-value' => '$1', 'pageinfo-subpages-name' => 'Subpáginas de esta página', 'pageinfo-subpages-value' => '$1 ($2 {{PLURAL:$2|redirección|redirecciones}}; $3 {{PLURAL:$3|no-redirección|no-redirecciones}})', 'pageinfo-firstuser' => 'Creador de la página', 'pageinfo-firsttime' => 'Fecha de creación de la página', 'pageinfo-lastuser' => 'Último editor', 'pageinfo-lasttime' => 'Fecha de la última edición', 'pageinfo-edits' => 'Número total de ediciones', 'pageinfo-authors' => 'Número total de autores distintos', 'pageinfo-recent-edits' => 'Número de ediciones recientes (en los últimos $1)', 'pageinfo-recent-authors' => 'Número de autores distintos recientes', 'pageinfo-magic-words' => '{{PLURAL:$1|Palabra mágica|Palabras mágicas}} ($1)', 'pageinfo-hidden-categories' => '{{PLURAL:$1|Categoría oculta|Categorías ocultas}} ($1)', 'pageinfo-templates' => '{{PLURAL:$1|Plantilla incluida|Plantillas incluidas}} ($1)', 'pageinfo-transclusions' => '{{PLURAL:$1|Página incluida|Páginas incluidas}} ($1)', 'pageinfo-toolboxlink' => 'Información de la página', 'pageinfo-redirectsto' => 'Redirige a', 'pageinfo-redirectsto-info' => 'Información', 'pageinfo-contentpage' => 'Contado como página de contenido', 'pageinfo-contentpage-yes' => 'Sí', 'pageinfo-protect-cascading' => 'Protecciones en serie activadas', 'pageinfo-protect-cascading-yes' => 'Sí', 'pageinfo-protect-cascading-from' => 'Protecciones en serie activadas', 'pageinfo-category-info' => 'Información de la categoría', 'pageinfo-category-pages' => 'Número de páginas', 'pageinfo-category-subcats' => 'Número de subcategorías', 'pageinfo-category-files' => 'Número de archivos', # Skin names 'skinname-cologneblue' => 'Colonia azul', 'skinname-monobook' => 'MonoBook', 'skinname-modern' => 'Moderna', 'skinname-vector' => 'Vector', # Patrolling 'markaspatrolleddiff' => 'Marcar como revisado', 'markaspatrolledtext' => 'Marcar este artículo como revisado', 'markedaspatrolled' => 'Marcado como revisado', 'markedaspatrolledtext' => 'La revisión seleccionada de [[:$1|$1]] ha sido marcada como revisada.', 'rcpatroldisabled' => 'Se ha desactivado la supervisión de cambios recientes', 'rcpatroldisabledtext' => 'La capacidad de revisar los Cambios Recientes está deshabilitada en este momento.', 'markedaspatrollederror' => 'No se puede marcar como patrullada', 'markedaspatrollederrortext' => 'Debes especificar una revisión para marcarla como patrullada.', 'markedaspatrollederror-noautopatrol' => 'No tienes permisos para marcar tus propios cambios como revisados.', 'markedaspatrollednotify' => 'Este cambio realizado en $1 se ha marcado como revisado.', 'markedaspatrollederrornotify' => 'Error al marcar como revisado.', # Patrol log 'patrol-log-page' => 'Registro de revisiones', 'patrol-log-header' => 'Este es un registro de revisiones patrulladas.', 'log-show-hide-patrol' => '$1 registro de patrullaje', # Image deletion 'deletedrevision' => 'Borrada revisión antigua $1', 'filedeleteerror-short' => 'Se produjo un error al borrar el archivo: $1', 'filedeleteerror-long' => 'Se han producido errores mientras se borraba el archivo: $1', 'filedelete-missing' => 'No se pudo borrar el archivo "$1" porque no existe.', 'filedelete-old-unregistered' => 'La revisión de archivo "$1" no está en la base de datos.', 'filedelete-current-unregistered' => 'El archivo «$1» no existe en la base de datos.', 'filedelete-archive-read-only' => 'El servidor web no logra escribir en el directorio archivo "$1".', # Browsing diffs 'previousdiff' => '← Edición anterior', 'nextdiff' => 'Edición siguiente →', # Media information 'mediawarning' => "'''Atención''': Este fichero puede contener código malicioso. Ejecutarlo podría comprometer la seguridad de su equipo.", 'imagemaxsize' => "Límite de tamaño de imagen:<br />''(para páginas de descripción de archivo)''", 'thumbsize' => 'Tamaño de las vistas en miniatura:', 'widthheight' => '$1 × $2', 'widthheightpage' => '$1 × $2, $3 {{PLURAL:|página|páginas}}', 'file-info' => 'tamaño de archivo: $1; tipo MIME: $2', 'file-info-size' => '$1 × $2 píxeles; tamaño de archivo: $3; tipo MIME: $4', 'file-info-size-pages' => '$1 × $2 píxeles, tamaño de archivo: $3, tipo MIME: $4, $5 {{PLURAL:$5|página|páginas}}', 'file-nohires' => 'No disponible a mayor resolución.', 'svg-long-desc' => 'archivo SVG, nominalmente $1 × $2 píxeles, tamaño de archivo: $3', 'svg-long-desc-animated' => 'Archivo SVG animado, nominalmente de $1 × $2 píxeles, tamaño del archivo: $3', 'svg-long-error' => 'Archivo SVG no válido: $1', 'show-big-image' => 'Archivo original', 'show-big-image-preview' => 'Tamaño de esta previsualización: $1.', 'show-big-image-other' => '{{PLURAL:$2|Otra resolución|Otras resoluciones}}: $1.', 'show-big-image-size' => '$1 × $2 píxeles', 'file-info-gif-looped' => 'bucleado', 'file-info-gif-frames' => '$1 {{PLURAL:$1|frame|frames}}', 'file-info-png-looped' => 'bucleado', 'file-info-png-repeat' => 'reproducido $1 {{PLURAL:$1|vez|veces}}', 'file-info-png-frames' => '$1 {{PLURAL:$1|marco|marcos}}', 'file-no-thumb-animation' => "'''Nota: debido a limitaciones técnicas, las miniaturas de este archivo no están animadas.'''", 'file-no-thumb-animation-gif' => "'''Nota: Debido a limitaciones técnicas, las miniaturas de imágenes GIF de alta resolución como esta no están animadas.'''", # Special:NewFiles 'newimages' => 'Galería de imágenes nuevas', 'imagelisttext' => "Debajo hay una lista de '''$1''' {{PLURAL:$1|imagen|imágenes}} ordenadas $2.", 'newimages-summary' => 'Esta página especial muestra una galería de los últimos archivos subidos.', 'newimages-legend' => 'Nombre del fichero', 'newimages-label' => 'Nombre del fichero (o una parte):', 'showhidebots' => '($1 bots)', 'noimages' => 'No hay nada que ver.', 'ilsubmit' => 'Buscar', 'bydate' => 'por fecha', 'sp-newimages-showfrom' => 'Mostrar nuevas imágenes empezando por $2, $1', # Video information, used by Language::formatTimePeriod() to format lengths in the above messages 'seconds-abbrev' => '$1s', 'minutes-abbrev' => '$1m', 'hours-abbrev' => '$1h', 'days-abbrev' => '$1d', 'seconds' => '{{PLURAL:$1|un segundo|$1 segundos}}', 'minutes' => '{{PLURAL:$1|un minuto|$1 minutos}}', 'hours' => '{{PLURAL:$1|una hora|$1 horas}}', 'days' => '{{PLURAL:$1|un día|$1 días}}', 'weeks' => '{{PLURAL:$1|$1 semana|$1 semanas}}', 'months' => '{{PLURAL:$1|$1 mes|$1 meses}}', 'years' => '{{PLURAL:$1|$1 año|$1 años}}', 'ago' => 'hace $1', 'just-now' => 'Ahora mismo', # Human-readable timestamps 'hours-ago' => 'hace $1 {{PLURAL:$1|hora|horas}}', 'minutes-ago' => 'hace {{PLURAL:$1|un minuto|$1 minutos}}', 'seconds-ago' => 'hace $1 {{PLURAL:$1|segundo|segundos}}', 'monday-at' => 'El lunes a las $1', 'tuesday-at' => 'El martes a las $1', 'wednesday-at' => 'El miércoles a las $1', 'thursday-at' => 'El jueves a las $1', 'friday-at' => 'El viernes a las $1', 'saturday-at' => 'El sábado a las $1', 'sunday-at' => 'El domingo a las $1', 'yesterday-at' => 'Ayer a las $1', # Bad image list 'bad_image_list' => 'El formato es el siguiente: Solo se reconocen elementos de lista (líneas que comienzan con «*»). El primer enlace de cada línea debe ser un enlace al archivo que se quiere bloquear. Todos los demás enlaces en la misma línea se tomarán como excepciones (es decir, páginas donde sí se puede usar el archivo).', # Metadata 'metadata' => 'Metadatos', 'metadata-help' => 'Este archivo contiene información adicional (metadatos), probablemente añadida por la cámara digital, el escáner o el programa usado para crearlo o digitalizarlo. Si el archivo ha sido modificado desde su estado original, pueden haberse perdido algunos detalles.', 'metadata-expand' => 'Mostrar datos detallados', 'metadata-collapse' => 'Ocultar datos detallados', 'metadata-fields' => 'Los campos de metadatos que se listan en este mensaje se mostrarán en la página de descripción de la imagen aún cuando la tabla de metadatos esté plegada. Existen otros campos que se mantendrán ocultos por defecto. * make * model * datetimeoriginal * exposuretime * fnumber * isospeedratings * focallength * artist * copyright * imagedescription * gpslatitude * gpslongitude * gpsaltitude', # Exif tags 'exif-imagewidth' => 'Anchura', 'exif-imagelength' => 'Altura', 'exif-bitspersample' => 'Bits por componente', 'exif-compression' => 'Esquema de compresión', 'exif-photometricinterpretation' => 'Composición de pixel', 'exif-orientation' => 'Orientación', 'exif-samplesperpixel' => 'Número de componentes', 'exif-planarconfiguration' => 'Distribución de datos', 'exif-ycbcrsubsampling' => 'Razón de submuestreo de Y a C', 'exif-ycbcrpositioning' => 'Posicionamientos Y y C', 'exif-xresolution' => 'Resolución horizontal', 'exif-yresolution' => 'Resolución vertical', 'exif-stripoffsets' => 'Localización de datos de imagen', 'exif-rowsperstrip' => 'Número de filas por banda', 'exif-stripbytecounts' => 'Bytes por banda comprimida', 'exif-jpeginterchangeformat' => 'Desplazamiento al JPEG SOI', 'exif-jpeginterchangeformatlength' => 'Bytes de datos JPEG', 'exif-whitepoint' => 'Cromacidad de punto blanco', 'exif-primarychromaticities' => 'Cromacidades primarias', 'exif-ycbcrcoefficients' => 'Coeficientes de la matriz de transformación de espacio de color', 'exif-referenceblackwhite' => 'Pareja de valores blanco y negro de referencia', 'exif-datetime' => 'Fecha y hora de modificación del archivo', 'exif-imagedescription' => 'Título de la imagen', 'exif-make' => 'Fabricante de la cámara', 'exif-model' => 'Modelo de cámara', 'exif-software' => 'Software usado', 'exif-artist' => 'Autor', 'exif-copyright' => 'Titular de los derechos de autor', 'exif-exifversion' => 'Versión Exif', 'exif-flashpixversion' => 'Versión admitida de Flashpix', 'exif-colorspace' => 'Espacio de color', 'exif-componentsconfiguration' => 'Significado de cada componente', 'exif-compressedbitsperpixel' => 'Modo de compresión de la imagen', 'exif-pixelydimension' => 'Ancho de la imagen', 'exif-pixelxdimension' => 'Altura de la imagen', 'exif-usercomment' => 'Comentarios de usuario', 'exif-relatedsoundfile' => 'Archivo de audio relacionado', 'exif-datetimeoriginal' => 'Fecha y hora de la generación de los datos', 'exif-datetimedigitized' => 'Fecha y hora de la digitalización', 'exif-subsectime' => 'Fecha y hora (precisión por debajo del segundo)', 'exif-subsectimeoriginal' => 'Fecha y hora de la generación de los datos (precisión por debajo del segundo)', 'exif-subsectimedigitized' => 'Fecha y hora de la digitalización (precisión por debajo del segundo)', 'exif-exposuretime' => 'Tiempo de exposición', 'exif-exposuretime-format' => '$1 seg ($2)', 'exif-fnumber' => 'Número F', 'exif-exposureprogram' => 'Programa de exposición', 'exif-spectralsensitivity' => 'Sensibilidad espectral', 'exif-isospeedratings' => 'Calificación de velocidad ISO', 'exif-shutterspeedvalue' => 'Velocidad de obturación APEX', 'exif-aperturevalue' => 'Apertura APEX', 'exif-brightnessvalue' => 'Brillo APEX', 'exif-exposurebiasvalue' => 'Sesgo de exposición', 'exif-maxaperturevalue' => 'Valor máximo de apertura', 'exif-subjectdistance' => 'Distancia al sujeto', 'exif-meteringmode' => 'Modo de medición', 'exif-lightsource' => 'Fuente de luz', 'exif-flash' => 'Flash', 'exif-focallength' => 'Longitud focal de la lente', 'exif-subjectarea' => 'Área del sujeto', 'exif-flashenergy' => 'Energía del flash', 'exif-focalplanexresolution' => 'Resolución X del plano focal', 'exif-focalplaneyresolution' => 'Resolución Y del plano focal', 'exif-focalplaneresolutionunit' => 'Unidad de resolución del plano focal', 'exif-subjectlocation' => 'Localización del sujeto', 'exif-exposureindex' => 'Índice de exposición', 'exif-sensingmethod' => 'Método de sensor', 'exif-filesource' => 'Fuente de archivo', 'exif-scenetype' => 'Tipo de escena', 'exif-customrendered' => 'Procesador personalizado de imagen', 'exif-exposuremode' => 'Modo de exposición', 'exif-whitebalance' => 'Balance de blanco', 'exif-digitalzoomratio' => 'Razón de zoom digital', 'exif-focallengthin35mmfilm' => 'Longitud focal en película de 35 mm', 'exif-scenecapturetype' => 'Tipo de captura de escena', 'exif-gaincontrol' => 'Control de escena', 'exif-contrast' => 'Contraste', 'exif-saturation' => 'Saturación', 'exif-sharpness' => 'Agudeza', 'exif-devicesettingdescription' => 'Descripción de los ajustes del dispositivo', 'exif-subjectdistancerange' => 'Rango de distancia al sujeto', 'exif-imageuniqueid' => 'ID único de imagen', 'exif-gpsversionid' => 'Versión de la etiqueta GPS', 'exif-gpslatituderef' => 'Latitud norte o sur', 'exif-gpslatitude' => 'Latitud', 'exif-gpslongituderef' => 'Longitud este u oeste', 'exif-gpslongitude' => 'Longitud', 'exif-gpsaltituderef' => 'Refencia de altitud', 'exif-gpsaltitude' => 'Altitud', 'exif-gpstimestamp' => 'Tiempo GPS (reloj atómico)', 'exif-gpssatellites' => 'Satélites usados para la medición', 'exif-gpsstatus' => 'Estado del receptor', 'exif-gpsmeasuremode' => 'Modo de medición', 'exif-gpsdop' => 'Precisión de medición', 'exif-gpsspeedref' => 'Unidad de velocidad', 'exif-gpsspeed' => 'Velocidad del receptor GPS', 'exif-gpstrackref' => 'Referencia para la dirección del movimiento', 'exif-gpstrack' => 'Dirección del movimiento', 'exif-gpsimgdirectionref' => 'Referencia de la dirección de imágen', 'exif-gpsimgdirection' => 'Dirección de imagen', 'exif-gpsmapdatum' => 'Utilizados datos de medición geodésica', 'exif-gpsdestlatituderef' => 'Referencia para la latitud del destino', 'exif-gpsdestlatitude' => 'Destino de latitud', 'exif-gpsdestlongituderef' => 'Referencia para la longitud del destino', 'exif-gpsdestlongitude' => 'Longitud del destino', 'exif-gpsdestbearingref' => 'Referencia para la orientación al destino', 'exif-gpsdestbearing' => 'Orientación del destino', 'exif-gpsdestdistanceref' => 'Referencia para la distancia al destino', 'exif-gpsdestdistance' => 'Distancia al destino', 'exif-gpsprocessingmethod' => 'Nombre del método de procesado GPS', 'exif-gpsareainformation' => 'Nombre de la área GPS', 'exif-gpsdatestamp' => 'Fecha GPS', 'exif-gpsdifferential' => 'Corrección diferencial de GPS', 'exif-jpegfilecomment' => 'Comentario de archivo JPEG', 'exif-keywords' => 'Palabras clave', 'exif-worldregioncreated' => 'Región del mundo en la que se tomó la imagen', 'exif-countrycreated' => 'País en el que se tomó la imagen', 'exif-countrycodecreated' => 'Código para el país en el que la imagen fue tomada', 'exif-provinceorstatecreated' => 'Provincia o estado en el que la imagen fue tomada', 'exif-citycreated' => 'Ciudad en la que se tomó la imagen', 'exif-sublocationcreated' => 'Región de la ciudad en la que la foto fue tomada', 'exif-worldregiondest' => 'Región del mundo mostrada', 'exif-countrydest' => 'País mostrado', 'exif-countrycodedest' => 'Código de país mostrado', 'exif-provinceorstatedest' => 'Provincia o estado mostrado', 'exif-citydest' => 'Ciudad mostrada', 'exif-sublocationdest' => 'Región de la ciudad mostrada', 'exif-objectname' => 'Título breve', 'exif-specialinstructions' => 'Instrucciones especiales', 'exif-headline' => 'Encabezado', 'exif-credit' => 'Crédito/proveedor', 'exif-source' => 'Fuente', 'exif-editstatus' => 'Estado editorial de la imagen', 'exif-urgency' => 'Urgencia', 'exif-fixtureidentifier' => 'Nome del elemento habitual', 'exif-locationdest' => 'Ubicación mostrada', 'exif-locationdestcode' => 'Código de la ubicación mostrada', 'exif-objectcycle' => 'Hora del día para la cual está destinado este archivo', 'exif-contact' => 'Información de contacto', 'exif-writer' => 'Escritor', 'exif-languagecode' => 'Idioma', 'exif-iimversion' => 'Versión IIM', 'exif-iimcategory' => 'Categoría', 'exif-iimsupplementalcategory' => 'Categorías suplementarias', 'exif-datetimeexpires' => 'No usar después de', 'exif-datetimereleased' => 'Lanzado el', 'exif-originaltransmissionref' => 'Código de ubicación de transmisión original', 'exif-identifier' => 'Identificador', 'exif-lens' => 'Lente utilizada', 'exif-serialnumber' => 'Número de serie de la cámara', 'exif-cameraownername' => 'Propietario de la cámara', 'exif-label' => 'Etiqueta', 'exif-datetimemetadata' => 'Fecha en la cual fueron modificados por última vez los metadatos', 'exif-nickname' => 'Nombre informal de la imagen', 'exif-rating' => 'Valoración (sobre 5)', 'exif-rightscertificate' => 'Certificado de gestión de derechos', 'exif-copyrighted' => 'Estado de copyright', 'exif-copyrightowner' => 'Titular del copyright', 'exif-usageterms' => 'Términos de uso', 'exif-webstatement' => 'Declaración de derechos de autor en línea', 'exif-originaldocumentid' => 'Id. único del documento original', 'exif-licenseurl' => 'URL para la licencia de copyright', 'exif-morepermissionsurl' => 'Información de licencia alternativa', 'exif-attributionurl' => 'Cuando reutilices este trabajo, por favor enlaza a', 'exif-preferredattributionname' => 'Al volver a utilizar este trabajo, por favor da crédito', 'exif-pngfilecomment' => 'Comentario de archivo PNG', 'exif-disclaimer' => 'Aviso legal', 'exif-contentwarning' => 'Advertencia de contenido', 'exif-giffilecomment' => 'Comentario de archivo GIF', 'exif-intellectualgenre' => 'Tipo de elemento', 'exif-subjectnewscode' => 'Código de asunto', 'exif-scenecode' => 'Código de escena IPTC', 'exif-event' => 'Evento representado', 'exif-organisationinimage' => 'Organización representada', 'exif-personinimage' => 'Persona representada', 'exif-originalimageheight' => 'Altura de la imagen antes de que fuera recortada', 'exif-originalimagewidth' => 'Ancho de la imagen antes de que fuera recortada', # Exif attributes 'exif-compression-1' => 'Sin comprimir', 'exif-compression-2' => 'CCITT Group 3 1-Dimensional Modified Huffman run length encoding', 'exif-compression-3' => 'Codificación de fax CCITT grupo 3', 'exif-compression-4' => 'Codificación de fax CCITT grupo 4', 'exif-copyrighted-true' => 'Con derechos de autor', 'exif-copyrighted-false' => 'No se ha definido el estado del copyright', 'exif-unknowndate' => 'Fecha desconocida', 'exif-orientation-1' => 'Normal', 'exif-orientation-2' => 'Volteada horizontalmente', 'exif-orientation-3' => 'Rotada 180°', 'exif-orientation-4' => 'Volteada verticalmente', 'exif-orientation-5' => 'Rotada 90° CCW y volteada verticalmente', 'exif-orientation-6' => 'Rotada 90° a la izquierda', 'exif-orientation-7' => 'Rotada 90° CW y volteada verticalmente', 'exif-orientation-8' => 'Rotada 90° a la derecha', 'exif-planarconfiguration-1' => 'formato panorámico', 'exif-planarconfiguration-2' => 'formato plano', 'exif-colorspace-65535' => 'Sin calibrar', 'exif-componentsconfiguration-0' => 'no existe', 'exif-exposureprogram-0' => 'No definido', 'exif-exposureprogram-1' => 'Manual', 'exif-exposureprogram-2' => 'Programa normal', 'exif-exposureprogram-3' => 'Prioridad de apertura', 'exif-exposureprogram-4' => 'Prioridad de obturador', 'exif-exposureprogram-5' => 'Programa creativo (con prioridad a la profundidad de campo)', 'exif-exposureprogram-6' => 'Programa de acción (alta velocidad de obturador)', 'exif-exposureprogram-7' => 'Modo retrato (para primeros planos con el fondo desenfocado)', 'exif-exposureprogram-8' => 'Modo panorama (para fotos panorámicas con el fondo enfocado)', 'exif-subjectdistance-value' => '$1 metros', 'exif-meteringmode-0' => 'Desconocido', 'exif-meteringmode-1' => 'Media', 'exif-meteringmode-2' => 'Promedio centrado', 'exif-meteringmode-3' => 'Puntual', 'exif-meteringmode-4' => 'Multipunto', 'exif-meteringmode-5' => 'Patrón', 'exif-meteringmode-6' => 'Parcial', 'exif-meteringmode-255' => 'Otro', 'exif-lightsource-0' => 'Desconocido', 'exif-lightsource-1' => 'Luz diurna', 'exif-lightsource-2' => 'Fluorescente', 'exif-lightsource-3' => 'Tungsteno (luz incandescente)', 'exif-lightsource-4' => 'Flash', 'exif-lightsource-9' => 'Buen tiempo', 'exif-lightsource-10' => 'Tiempo nublado', 'exif-lightsource-11' => 'Penumbra', 'exif-lightsource-12' => 'Fluorescente de luz diurna (D 5700 – 7100K)', 'exif-lightsource-13' => 'Fluorescente de día soleado (N 4600 – 5400K)', 'exif-lightsource-14' => 'Fluorescente blanco frío (W 3900 – 4500K)', 'exif-lightsource-15' => 'Fluroescente blanco (WW 3200 – 3700K)', 'exif-lightsource-17' => 'Luz estándar A', 'exif-lightsource-18' => 'Luz estándar B', 'exif-lightsource-19' => 'Luz estándar C', 'exif-lightsource-24' => 'Tungsteno de estudio ISO', 'exif-lightsource-255' => 'Otra fuente de luz', # Flash modes 'exif-flash-fired-0' => 'No se disparó el flash', 'exif-flash-fired-1' => 'Flash disparado', 'exif-flash-return-0' => 'no hay función de detección del retorno de la luz estroboscópica', 'exif-flash-return-2' => 'no se detectó retorno de luz estroboscópica', 'exif-flash-return-3' => 'detectado retorno de luz estroboscópica', 'exif-flash-mode-1' => 'disparo de flash forzado', 'exif-flash-mode-2' => 'disparo de flash anulado', 'exif-flash-mode-3' => 'modo automático', 'exif-flash-function-1' => 'Modo sin flash', 'exif-flash-redeye-1' => 'modo de reducción de ojos rojos', 'exif-focalplaneresolutionunit-2' => 'pulgadas', 'exif-sensingmethod-1' => 'No definido', 'exif-sensingmethod-2' => 'Sensor de área de color de un chip', 'exif-sensingmethod-3' => 'Sensor de área de color de dos chips', 'exif-sensingmethod-4' => 'Sensor de área de color de tres chips', 'exif-sensingmethod-5' => 'Sensor de área secuencial de color', 'exif-sensingmethod-7' => 'Sensor trilineal', 'exif-sensingmethod-8' => 'Sensor lineal secuencial de color', 'exif-filesource-3' => 'Cámara digital', 'exif-scenetype-1' => 'Una imagen directamente fotografiada', 'exif-customrendered-0' => 'Proceso normal', 'exif-customrendered-1' => 'Proceso personalizado', 'exif-exposuremode-0' => 'Exposición automática', 'exif-exposuremode-1' => 'Exposición manual', 'exif-exposuremode-2' => 'Auto bracket', 'exif-whitebalance-0' => 'Balance de blanco automático', 'exif-whitebalance-1' => 'Balance de blanco manual', 'exif-scenecapturetype-0' => 'Estándar', 'exif-scenecapturetype-1' => 'Paisaje', 'exif-scenecapturetype-2' => 'Retrato', 'exif-scenecapturetype-3' => 'Escena nocturna', 'exif-gaincontrol-0' => 'Ninguna', 'exif-gaincontrol-1' => 'Bajo aumento de ganancia', 'exif-gaincontrol-2' => 'Alto aumento de ganancia', 'exif-gaincontrol-3' => 'Baja disminución de ganancia', 'exif-gaincontrol-4' => 'Alta disminución de ganancia', 'exif-contrast-0' => 'Normal', 'exif-contrast-1' => 'Suave', 'exif-contrast-2' => 'Duro', 'exif-saturation-0' => 'Normal', 'exif-saturation-1' => 'Baja saturación', 'exif-saturation-2' => 'Alta saturación', 'exif-sharpness-0' => 'Normal', 'exif-sharpness-1' => 'Suave', 'exif-sharpness-2' => 'Dura', 'exif-subjectdistancerange-0' => 'Desconocida', 'exif-subjectdistancerange-1' => 'Macro', 'exif-subjectdistancerange-2' => 'Vista cercana', 'exif-subjectdistancerange-3' => 'Vista lejana', # Pseudotags used for GPSLatitudeRef and GPSDestLatitudeRef 'exif-gpslatitude-n' => 'Latitud norte', 'exif-gpslatitude-s' => 'Latitud sur', # Pseudotags used for GPSLongitudeRef and GPSDestLongitudeRef 'exif-gpslongitude-e' => 'Longitud este', 'exif-gpslongitude-w' => 'Longitud oeste', # Pseudotags used for GPSAltitudeRef 'exif-gpsaltitude-above-sealevel' => '$1 {{PLURAL:$1|metro|metros}} sobre el nivel del mar', 'exif-gpsaltitude-below-sealevel' => '$1 {{PLURAL:$1|metro|metros}} bajo el nivel del mar', 'exif-gpsstatus-a' => 'Medida en progreso', 'exif-gpsstatus-v' => 'Interoperabilidad de medida', 'exif-gpsmeasuremode-2' => 'Medición bidimensional', 'exif-gpsmeasuremode-3' => 'Medición tridimensional', # Pseudotags used for GPSSpeedRef 'exif-gpsspeed-k' => 'Kilómetros por hora', 'exif-gpsspeed-m' => 'Millas por hora', 'exif-gpsspeed-n' => 'Nudos', # Pseudotags used for GPSDestDistanceRef 'exif-gpsdestdistance-k' => 'Kilómetros', 'exif-gpsdestdistance-m' => 'Millas', 'exif-gpsdestdistance-n' => 'Millas náuticas', 'exif-gpsdop-excellent' => 'Excelente ($1)', 'exif-gpsdop-good' => 'Bueno ( $1 )', 'exif-gpsdop-moderate' => 'Moderado ($1)', 'exif-gpsdop-fair' => 'Pasable ($1)', 'exif-gpsdop-poor' => 'Pobre ( $1 )', 'exif-objectcycle-a' => 'Sólo por la mañana', 'exif-objectcycle-p' => 'Sólo por el atardecer', 'exif-objectcycle-b' => 'Tanto por la mañana y por la tarde', # Pseudotags used for GPSTrackRef, GPSImgDirectionRef and GPSDestBearingRef 'exif-gpsdirection-t' => 'Dirección real', 'exif-gpsdirection-m' => 'Dirección magnética', 'exif-ycbcrpositioning-1' => 'Centrado', 'exif-ycbcrpositioning-2' => 'Co-localizados', 'exif-dc-contributor' => 'Colaboradores', 'exif-dc-coverage' => 'Ámbito espacial o temporal del medio', 'exif-dc-date' => 'Fecha(s)', 'exif-dc-publisher' => 'Editorial', 'exif-dc-relation' => 'Medios relacionados', 'exif-dc-rights' => 'Derechos', 'exif-dc-source' => 'Medios de origen', 'exif-dc-type' => 'Tipo de medio', 'exif-rating-rejected' => 'Rechazado', 'exif-isospeedratings-overflow' => 'Más de 65535', 'exif-iimcategory-ace' => 'Arte, cultura y entretenimiento', 'exif-iimcategory-clj' => 'Crimen y ley', 'exif-iimcategory-dis' => 'Desastres y accidentes', 'exif-iimcategory-fin' => 'Economía y negocios', 'exif-iimcategory-edu' => 'Educación', 'exif-iimcategory-evn' => 'Medio ambiente', 'exif-iimcategory-hth' => 'Salud', 'exif-iimcategory-hum' => 'Interés humano', 'exif-iimcategory-lab' => 'Trabajo', 'exif-iimcategory-lif' => 'Estilo de vida y ocio', 'exif-iimcategory-pol' => 'Política', 'exif-iimcategory-rel' => 'Religión y creencias', 'exif-iimcategory-sci' => 'Ciencia y tecnología', 'exif-iimcategory-soi' => 'Cuestiones sociales', 'exif-iimcategory-spo' => 'Deportes', 'exif-iimcategory-war' => 'Guerra, conflictos y disturbios', 'exif-iimcategory-wea' => 'Clima', 'exif-urgency-normal' => 'Normal ($1)', 'exif-urgency-low' => 'Bajo ($1)', 'exif-urgency-high' => 'Alto ($1)', 'exif-urgency-other' => 'Prioridad definida por el usuario ($1)', # 'all' in various places, this might be different for inflected languages 'watchlistall2' => 'todos', 'namespacesall' => 'todos', 'monthsall' => 'todos', # Email address confirmation 'confirmemail' => 'Confirmar dirección de correo electrónico', 'confirmemail_noemail' => 'No tienes una dirección de correo electrónico válida en tus [[Special:Preferences|preferencias de usuario]].', 'confirmemail_text' => '{{SITENAME}} requiere la validación de tu dirección de correo antes de usarlo. Pulsa el botón de abajo para enviar la confirmación. El correo incluirá un enlace con un código. Introdúcelo para confirmar la validez de tu dirección.', 'confirmemail_pending' => 'Ya se te ha enviado un código de confirmación; si creaste una cuenta recientemente, puede que tengas que esperar unos minutos para que te llegue antes de intentar pedir un nuevo código.', 'confirmemail_send' => 'Envíar el código de confimación.', 'confirmemail_sent' => 'Confirmación de correo enviada.', 'confirmemail_oncreate' => 'Se ha enviado un código de confirmación a tu dirección de correo electrónico. Este código no es necesario para iniciar sesión, pero necesitarás proporcionarlo antes de activar cualquier función basada en correo electrónico en el wiki.', 'confirmemail_sendfailed' => 'No fue posible enviar el correo de confirmación. Por favor, comprueba la validez de la dirección de correo. El servidor indicó el error: $1', 'confirmemail_invalid' => 'Código de confirmación incorrecto. El código debe haber expirado.', 'confirmemail_needlogin' => 'Necesitas $1 para confirmar tu dirección electrónica.', 'confirmemail_success' => 'Su dirección de correo ha sido confirmada Ahora puedes [[Special:UserLogin|identificarte]] y colaborar en el wiki.', 'confirmemail_loggedin' => 'Tu dirección de correo electrónico ha sido confirmada.', 'confirmemail_subject' => 'confirmación de la dirección de correo de {{SITENAME}}', 'confirmemail_body' => 'Alguien, probablemente usted mismo, ha registrado desde la dirección IP $1 la cuenta "$2" en {{SITENAME}}, utilizando esta dirección de correo. Para confirmar que esta cuenta realmente le pertenece y activar el correo en {{SITENAME}}, siga este enlace: $3 Si la cuenta *no* es suya, siga este otro enlace para cancelar la confirmación de la dirección de correo: $5 El código de confirmación expirará en $4.', 'confirmemail_body_changed' => 'Alguien, probablemente tú, ha modificado la dirección de correo electrónico asociado a la cuenta "$2" hacia esta en {{SITENAME}}, desde la dirección IP $1. Para confirmar que esta cuenta realmente te pertenece y reactivar las funciones de correo electrónico en {{SITENAME}}, abre este enlace en su navegador: $3 Si la cuenta *no* te pertenece, sigue el siguiente enlace para cancelar la confirmación: $5 Este código de confirmación expirará el $4.', 'confirmemail_body_set' => 'Alguien, probablemente tu desde la dirección IP $1, ha cambiado la dirección de correo electrónico de la cuenta $2 a esta dirección en {{SITENAME}}. Para confirmar que esta cuenta realmente te pertenece y activar las capacidades del correo electrónico en {{SITENAME}}, abre este enlace en tu navegador: $3 Si la cuenta *no* te pertenece sigue entonces este otro enlace para cancelar la confirmación del correo electrónico: $5 Este código de confirmación caducará el $4.', 'confirmemail_invalidated' => 'La confirmación de la dirección de correo electrónico ha sido cancelada', 'invalidateemail' => 'Cancelar confirmación de correo electrónico', # Scary transclusion 'scarytranscludedisabled' => '[Transclusión interwiki está deshabilitada]', 'scarytranscludefailed' => '[Obtención de plantilla falló para $1]', 'scarytranscludefailed-httpstatus' => '[Error de recuperación de plantilla para $1: HTTP $2]', 'scarytranscludetoolong' => '[El URL es demasiado largo]', # Delete conflict 'deletedwhileediting' => "'''Aviso''': ¡Esta página fue borrada después de que usted empezara a editar!", 'confirmrecreate' => "El usuario [[User:$1|$1]] ([[User talk:$1|disc.]]) borró esta página después de que comenzaste a editarla, por el motivo: : ''$2'' Confirma que realmente quieres volver a crear esta página.", 'confirmrecreate-noreason' => 'El usuario [[User:$1|$1]] ([[User talk:$1|discusión]]) borró esta página después de que comenzaras a editarla. Por favor confirma que realmente quieres recrear esta página.', 'recreate' => 'Crear de nuevo', # action=purge 'confirm_purge_button' => 'Aceptar', 'confirm-purge-top' => '¿Limpiar la caché de esta página?', 'confirm-purge-bottom' => 'Purgar una página limpia la caché y fuerza a que aparezca la versión más actual.', # action=watch/unwatch 'confirm-watch-button' => 'Aceptar', 'confirm-watch-top' => '¿Añadir esta página a tu lista de seguimiento?', 'confirm-unwatch-button' => 'Aceptar', 'confirm-unwatch-top' => '¿Quitar esta página de tu lista de seguimiento?', # Separators for various lists, etc. 'comma-separator' => ',&#32;', 'quotation-marks' => '«$1»', # Multipage image navigation 'imgmultipageprev' => '← página anterior', 'imgmultipagenext' => 'siguiente página →', 'imgmultigo' => '¡Ir!', 'imgmultigoto' => 'Ir a la página $1', # Language selector for translatable SVGs 'img-lang-default' => '(idioma predeterminado)', 'img-lang-info' => 'Renderizar esta imagen en $1. $2', 'img-lang-go' => 'Adelante', # Table pager 'ascending_abbrev' => 'asc', 'descending_abbrev' => 'desc', 'table_pager_next' => 'Página siguiente', 'table_pager_prev' => 'Página anterior', 'table_pager_first' => 'Primera página', 'table_pager_last' => 'Última página', 'table_pager_limit' => 'Mostrar $1 elementos por página', 'table_pager_limit_label' => 'Elementos por página:', 'table_pager_limit_submit' => 'Ir', 'table_pager_empty' => 'No hay resultados', # Auto-summaries 'autosumm-blank' => 'Página blanqueada', 'autosumm-replace' => 'Página reemplazada por «$1»', 'autoredircomment' => 'Página redirigida a [[$1]]', 'autosumm-new' => 'Página creada con «$1»', # Live preview 'livepreview-loading' => 'Cargando…', 'livepreview-ready' => 'Cargando… ¡Listo!', 'livepreview-failed' => '¡La previsualización al vuelo falló! Prueba la previsualización normal.', 'livepreview-error' => 'No se pudo conectar: $1 «$2». Intenta usar la previsualización normal.', # Friendlier slave lag warnings 'lag-warn-normal' => 'Los cambios realizados en {{PLURAL:$1|el último segundo|los últimos $1 segundos}} podrían no mostrarse en esta lista.', 'lag-warn-high' => 'Debido a una alta latencia el servidor de base de datos, los cambios realizados en {{PLURAL:$1|el último segundo|los últimos $1 segundos}} podrían no mostrarse en esta lista.', # Watchlist editor 'watchlistedit-numitems' => 'Tu lista de seguimiento tiene {{PLURAL:$1|una página |$1 páginas}}, excluyendo las páginas de discusión.', 'watchlistedit-noitems' => 'Tu lista de seguimiento está vacía.', 'watchlistedit-normal-title' => 'Editar lista de seguimiento', 'watchlistedit-normal-legend' => 'Borrar títulos de la lista de seguimiento', 'watchlistedit-normal-explain' => 'A continuación se listan las páginas en tu lista de seguimiento. Para quitar un título, marca la casilla junto a él, y pulsa «{{int:Watchlistedit-normal-submit}}». También puedes [[Special:EditWatchlist/raw|editar la lista en crudo]].', 'watchlistedit-normal-submit' => 'Borrar páginas', 'watchlistedit-normal-done' => '{{PLURAL:$1|1 página ha sido borrada|$1 páginas han sido borradas}} de tu lista de seguimiento:', 'watchlistedit-raw-title' => 'Editar lista de seguimiento en crudo', 'watchlistedit-raw-legend' => 'Editar tu lista de seguimiento en modo texto', 'watchlistedit-raw-explain' => 'A continuación se listan las páginas en tu lista de seguimiento. Esta lista puede editarse añadiendo o eliminando líneas de la lista; un título por línea. Cuando acabes, pulsa «{{int:Watchlistedit-raw-submit}}». También puedes [[Special:EditWatchlist|usar el editor estándar]].', 'watchlistedit-raw-titles' => 'Páginas:', 'watchlistedit-raw-submit' => 'Actualizar lista de seguimiento', 'watchlistedit-raw-done' => 'Tu lista de seguimiento se ha actualizado.', 'watchlistedit-raw-added' => '{{PLURAL:$1|Se ha añadido una página|Se han añadido $1 páginas}}:', 'watchlistedit-raw-removed' => '{{PLURAL:$1|Una página ha sido borrada|$1 páginas han sido borradas}}:', # Watchlist editing tools 'watchlisttools-view' => 'Ver cambios', 'watchlisttools-edit' => 'Ver y editar tu lista de seguimiento', 'watchlisttools-raw' => 'Editar lista de seguimiento en crudo', # Signatures 'signature' => '[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|discusión]])', # Core parser functions 'unknown_extension_tag' => 'Etiqueta desconocida «$1»', 'duplicate-defaultsort' => "'''Atención:''' La clave de ordenamiento predeterminada «$2» anula la clave de ordenamiento anterior «$1».", # Special:Version 'version' => 'Versión', 'version-extensions' => 'Extensiones instaladas', 'version-specialpages' => 'Páginas especiales', 'version-parserhooks' => 'Extensiones del analizador sintáctico', 'version-variables' => 'Variables', 'version-antispam' => 'Prevención de spam', 'version-skins' => 'Apariencias', 'version-other' => 'Otro', 'version-mediahandlers' => 'Manejadores multimedia', 'version-hooks' => 'Extensiones', 'version-parser-extensiontags' => 'Etiquetas de extensiones sintácticas', 'version-parser-function-hooks' => 'Extensiones de funciones sintácticas', 'version-hook-name' => 'Nombre de la extensión', 'version-hook-subscribedby' => 'Suscrito por', 'version-version' => '($1)', 'version-license' => 'Licencia de MediaWiki', 'version-ext-license' => 'Licencia', 'version-ext-colheader-name' => 'Extensión', 'version-ext-colheader-version' => 'Versión', 'version-ext-colheader-license' => 'Licencia', 'version-ext-colheader-description' => 'Descripción', 'version-ext-colheader-credits' => 'Autores', 'version-license-title' => 'Licencia para $1', 'version-license-not-found' => 'No se han encontrado información detallada de licencia para esta extensión.', 'version-credits-title' => 'Reconocimiento para $1', 'version-credits-not-found' => 'No se ha encontrado información detallada de reconocimiento para esta extensión.', 'version-poweredby-credits' => "Este wiki funciona gracias a '''[https://www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.", 'version-poweredby-others' => 'otros', 'version-poweredby-translators' => 'Traductores de translatewiki.net', 'version-credits-summary' => 'Queremos reconocer a las siguientes personas por su contribución a [[Special:Version|MediaWiki]].', 'version-license-info' => 'MediaWiki es software libre; puedes redistribuirlo y/o modificarlo bajo los términos de la Licencia General Pública de GNU como la publica la Free Software Foundation; ya sea la versión 2 de la licencia, o (a tu elección) cualquier versión posterior. MediaWiki se distribuye con la esperanza de que será útil, pero SIN NINGUNA GARANTÍA; sin siquiera con la garantía implícita de COMERCIALIZACIÓN o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Consulta la Licencia Pública General de GNU para más detalles. Has recibido [{{SERVER}}{{SCRIPTPATH}}/COPYING una copia de la Licencia Pública General de GNU] junto a este programa; si no es así, escríbele a la Free Software Foundation, Inc., Calle Franklin 51, quinto piso, Boston, MA 02110-1301, EE. UU. o [//www.gnu.org/licenses/old-licenses/gpl-2.0.html léela en línea].', 'version-software' => 'Software instalado', 'version-software-product' => 'Producto', 'version-software-version' => 'Versión', 'version-entrypoints' => 'URL del punto de entrada', 'version-entrypoints-header-entrypoint' => 'Punto de entrada', 'version-entrypoints-header-url' => 'Dirección URL', 'version-entrypoints-articlepath' => '[https://www.mediawiki.org/wiki/Manual:$wgArticlePath Ruta del artículo]', 'version-entrypoints-scriptpath' => '[https://www.mediawiki.org/wiki/Manual:$wgScriptPath Ruta de la secuencia de comandos (script)]', # Special:Redirect 'redirect' => 'Redirigir por archivo, usuario, página o ID de revisión', 'redirect-legend' => 'Redirigir a un archivo o página', 'redirect-summary' => 'Esta página especial redirige a un fichero (dado un nombre de fichero), a una página (dado un identificador de revisión o de página) o a una página de usuario (dado un identificador numérico de usuario). Uso: [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/revision/328429]], o [[{{#Special:Redirect}}/user/101]].', 'redirect-submit' => 'Ir', 'redirect-lookup' => 'Buscar:', 'redirect-value' => 'Valor:', 'redirect-user' => 'Id. del usuario', 'redirect-page' => 'ID de la página', 'redirect-revision' => 'Revisión de página', 'redirect-file' => 'Nombre de fichero', 'redirect-not-exists' => 'No se encontró el valor', # Special:FileDuplicateSearch 'fileduplicatesearch' => 'Búsqueda de archivos duplicados', 'fileduplicatesearch-summary' => 'Búsqueda de archivos duplicados en base a su valor hash.', 'fileduplicatesearch-legend' => 'Busca duplicados', 'fileduplicatesearch-filename' => 'Nombre del fichero:', 'fileduplicatesearch-submit' => 'Buscar', 'fileduplicatesearch-info' => '$1 × $2 píxeles<br />Tamaño: $3<br />Tipo MIME: $4', 'fileduplicatesearch-result-1' => 'El archivo «$1» no tiene duplicados idénticos.', 'fileduplicatesearch-result-n' => 'El archivo «$1» tiene {{PLURAL:$2|1 duplicado idéntico|$2 duplicados idénticos}}.', 'fileduplicatesearch-noresults' => 'Ningún archivo con el nombre «$1» encontrado.', # Special:SpecialPages 'specialpages' => 'Páginas especiales', 'specialpages-note-top' => 'Leyenda', 'specialpages-note' => '* Páginas especiales normales * <span class="mw-specialpagerestricted">Páginas especiales restringidas.</span> * <span class="mw-specialpagecached">Páginas especiales en caché (podrían ser obsoletas).</span>', 'specialpages-group-maintenance' => 'Reportes de mantenimiento', 'specialpages-group-other' => 'Otras páginas especiales', 'specialpages-group-login' => 'Iniciar sesión / Crear cuenta', 'specialpages-group-changes' => 'Cambios recientes y registros', 'specialpages-group-media' => 'Páginas sobre archivos', 'specialpages-group-users' => 'Usuarios y permisos', 'specialpages-group-highuse' => 'Páginas sobre usos', 'specialpages-group-pages' => 'Listas de páginas', 'specialpages-group-pagetools' => 'Herramientas de páginas', 'specialpages-group-wiki' => 'Herramientas y datos', 'specialpages-group-redirects' => 'Búsquedas y redirecciones', 'specialpages-group-spam' => 'Herramientas anti-SPAM', # Special:BlankPage 'blankpage' => 'Página vacía', 'intentionallyblankpage' => 'Esta pagina está en blanco de manera intencionada.', # External image whitelist 'external_image_whitelist' => ' #Deja esta línea exactamente como está<pre> #Colocar fragmentos de expresiones regulares (sólo la parte que va entre los //) debajo #Estos coincidirán con los URLs de las imágenes externas (hotlinked) #Aquellos que coincidan serán mostrados como imágenes, de lo contrario solamente un vínculo a la imagen será mostrada #Las líneas que empiezan por «#» se consideran comentarios #Esta es insensible a las mayúsculas #Colocar todos los fragmentos regex arriba de esta línea. Deja esta línea exactamente como está</pre>', # Special:Tags 'tags' => 'Etiquetas de cambios', 'tag-filter' => 'Filtro de [[Special:Tags|etiquetas]]:', 'tag-filter-submit' => 'Filtro', 'tag-list-wrapper' => '([[Special:Tags|{{PLURAL:$1|Etiqueta|Etiquetas}}]]: $2)', 'tags-title' => 'Etiquetas', 'tags-intro' => 'Esta página lista las etiquetas con las que el software puede marcar una edición y su significado.', 'tags-tag' => 'Nombre de etiqueta', 'tags-display-header' => 'Apariencia de la lista de cambios', 'tags-description-header' => 'Descripción completa de significado', 'tags-active-header' => '¿Activo?', 'tags-hitcount-header' => 'Cambios etiquetados', 'tags-active-yes' => 'Sí', 'tags-active-no' => 'No', 'tags-edit' => 'editar', 'tags-hitcount' => '$1 {{PLURAL:$1|cambio|cambios}}', # Special:ComparePages 'comparepages' => 'Comparar páginas', 'compare-page1' => 'Página 1', 'compare-page2' => 'Página 2', 'compare-rev1' => 'Revisión 1', 'compare-rev2' => 'Revisión 2', 'compare-submit' => 'Comparar', 'compare-invalid-title' => 'El título especificado es inválido.', 'compare-title-not-exists' => 'El título especificado no existe.', 'compare-revision-not-exists' => 'La revisión especificada no existe.', # Database error messages 'dberr-header' => 'Este wiki tiene un problema', 'dberr-problems' => 'Lo sentimos. Este sitio está experimentando dificultades técnicas.', 'dberr-again' => 'Prueba a recargar dentro de unos minutos.', 'dberr-info' => '(No se puede contactar con la base de datos del servidor: $1)', 'dberr-info-hidden' => '(No se puede contactar con la base de datos del servidor)', 'dberr-usegoogle' => 'Mientras tanto puedes probar buscando a través de Google.', 'dberr-outofdate' => 'Ten en cuenta que su índice de nuestro contenido puede estar desactualizado.', 'dberr-cachederror' => 'La siguiente es una página guardada de la página solicitada, y puede no estar actualizada.', # HTML forms 'htmlform-invalid-input' => 'Hay problemas con alguno de los datos que has ingresado', 'htmlform-select-badoption' => 'El valor que especificaste no es una opción válida.', 'htmlform-int-invalid' => 'El valor que especificaste no es un entero.', 'htmlform-float-invalid' => 'El valor que ha especificado no es un número.', 'htmlform-int-toolow' => 'El valor que especificaste está debajo del mínimo de $1', 'htmlform-int-toohigh' => 'El valor que especificaste está arriba del máximo de $1', 'htmlform-required' => 'Este valor es obligatorio', 'htmlform-submit' => 'Enviar', 'htmlform-reset' => 'Deshacer cambios', 'htmlform-selectorother-other' => 'Otro', 'htmlform-no' => 'No', 'htmlform-yes' => 'Sí', 'htmlform-chosen-placeholder' => 'Selecciona una opción', # SQLite database support 'sqlite-has-fts' => '$1 con soporte para búsqueda de texto completo', 'sqlite-no-fts' => '$1 sin soporte para búsqueda de texto completo', # New logging system 'logentry-delete-delete' => '$1 {{GENDER:$2|borró}} la página «$3»', 'logentry-delete-restore' => '$1 restauró la página «$3»', 'logentry-delete-event' => '$1 {{GENDER:$2|modificó}} la visibilidad de {{PLURAL:$5|un evento|$5 eventos}} del registro en $3: $4', 'logentry-delete-revision' => '$1 {{GENDER:$2|modificó}} la visibilidad de {{PLURAL:$5|una revisión |$5 revisiones}} en la página $3: $4', 'logentry-delete-event-legacy' => '$1 ha {{GENDER:$2|cambiado}} la visibilidad de registro de eventos en $3', 'logentry-delete-revision-legacy' => '$1 ha {{GENDER:$2|cambiado}} la visibilidad de las revisiones en la página $3', 'logentry-suppress-delete' => '$1 {{GENDER:$2|borró}}, con restricciones para administradores aplicadas, la página $3', 'logentry-suppress-event' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de {{PLURAL:$5|una edición|$5 ediciones}} en la página $3: $4', 'logentry-suppress-revision' => '$1 modificó secretamente la visibilidad de {{PLURAL:$5|una edición|$5 ediciones}} en la página $3: $4', 'logentry-suppress-event-legacy' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de los eventos del registro en $3', 'logentry-suppress-revision-legacy' => '$1 {{GENDER:$2|modificó}} secretamente la visibilidad de varias ediciones en la página $3', 'revdelete-content-hid' => 'contenido ocultado', 'revdelete-summary-hid' => 'resumen de edición oculto', 'revdelete-uname-hid' => 'nombre de usuario ocultado', 'revdelete-content-unhid' => 'contenido mostrado', 'revdelete-summary-unhid' => 'resumen de edición mostrado', 'revdelete-uname-unhid' => 'nombre de usuario mostrado', 'revdelete-restricted' => 'restricciones para administradores aplicadas', 'revdelete-unrestricted' => 'restricciones para administradores eliminadas', 'logentry-move-move' => '$1 movió la página $3 a $4', 'logentry-move-move-noredirect' => '$1 movió la página $3 a $4 sin dejar una redirección', 'logentry-move-move_redir' => '$1 movió la página $3 a $4 sobre una redirección', 'logentry-move-move_redir-noredirect' => '$1 movió la página $3 a $4 sobre una redirección y sin dejar una redirección', 'logentry-patrol-patrol' => '$1 {{GENDER:$2|marcó}} como patrullada la edición $4 de la página $3', 'logentry-patrol-patrol-auto' => '$1 {{GENDER:$2|marcó}} automáticamente la edición $4 de la página $3 como patrullada', 'logentry-newusers-newusers' => 'La cuenta de usuario $1 ha sido {{GENDER:$2|creada}}', 'logentry-newusers-create' => 'La cuenta de usuario $1 ha sido creada', 'logentry-newusers-create2' => 'La cuenta de usuario $3 ha sido creada por $1', 'logentry-newusers-byemail' => 'la cuenta de usuario $3 ha sido creada por $1 y la contraseña ha sido enviada por correo', 'logentry-newusers-autocreate' => 'La cuenta $1 fue creada automáticamente', 'logentry-rights-rights' => '$1 modificó los grupos a los que pertenece $3: de $4 a $5', 'logentry-rights-rights-legacy' => '$1 modificó los grupos a los que pertenece $3', 'logentry-rights-autopromote' => '$1 ha sido {{GENDER:$2|promocionado|promocionada}} automáticamente de $4 a $5', 'rightsnone' => '(ninguno)', # Feedback 'feedback-bugornote' => 'Si estás preparado para describir en detalle un problema técnico, [$1 informa de un bug] por favor. En otro caso, puedes usar el siguiente formulario. Tu comentario será añadido a la página [$3 $2], junto con tu nombre de usuario y el navegador que usas.', 'feedback-subject' => 'Asunto:', 'feedback-message' => 'Mensaje:', 'feedback-cancel' => 'Cancelar', 'feedback-submit' => 'Enviar comentarios', 'feedback-adding' => 'Añadiendo comentarios a la página...', 'feedback-error1' => 'Error: No se reconoce resultado de API', 'feedback-error2' => 'Error: Falló la edición', 'feedback-error3' => 'Error: No hay respuesta de la API', 'feedback-thanks' => '¡Gracias! Su comentario ha sido anotado en la página [$2 $1].', 'feedback-close' => 'Hecho', 'feedback-bugcheck' => '¡Perfecto! Únicamente comprueba que no sea un [$1 fallo conocido].', 'feedback-bugnew' => 'Lo he comprobado. Informar de un nuevo fallo.', # Search suggestions 'searchsuggest-search' => 'Buscar', 'searchsuggest-containing' => 'que contiene...', # API errors 'api-error-badaccess-groups' => 'No puedes cargar archivos en este wiki.', 'api-error-badtoken' => 'Error interno: Símbolo incorrecto.', 'api-error-copyuploaddisabled' => 'La subida por URL está desactivada en este servidor.', 'api-error-duplicate' => 'Ya existe{{PLURAL:$1| [$2 otro archivo]|[$2 n otros archivos]}} en el sitio con el mismo contenido.', 'api-error-duplicate-archive' => 'Ya {{PLURAL:$1|existía [$2 otro archivo]|existían [$2 otros archivos]}} en el sitio con el mismo contenido, pero {{PLURAL:$1|fue|fueron}} {{PLURAL:$1|eliminado|eliminados}}.', 'api-error-duplicate-archive-popup-title' => '{{PLURAL:$1|Archivo|Archivos}} {{PLURAL:$1|duplicado|duplicados}} que ya se han eliminado', 'api-error-duplicate-popup-title' => '{{PLURAL:$1|Archivo|Archivos}} {{PLURAL:$1|duplicado|duplicados}}', 'api-error-empty-file' => 'El archivo que enviaste estaba vacío.', 'api-error-emptypage' => 'No se pueden crear páginas nuevas que estén vacías.', 'api-error-fetchfileerror' => 'Error interno: Algo salió mal mientras se obtenía el archivo.', 'api-error-fileexists-forbidden' => 'Ya existe el archivo "$1" y no se puede sobreescribir.', 'api-error-fileexists-shared-forbidden' => 'Ya existe "$1" en el repositorio de archivos compartidos y no se puede sobreescribir.', 'api-error-file-too-large' => 'El archivo que enviaste era demasiado grande.', 'api-error-filename-tooshort' => 'El nombre de archivo es demasiado corto.', 'api-error-filetype-banned' => 'Este tipo de archivo está prohibido.', 'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|no es un tipo de archivo permitido|no son tipos de archivos permitidos}}. {{PLURAL:$3|El tipo de archivo permitido es|Los tipos de archivos permitidos son}} $2.', 'api-error-filetype-missing' => 'El archivo no tiene extensión de archivo.', 'api-error-hookaborted' => 'La modificación que intentaste hacer fue cancelada por un gancho de extensión.', 'api-error-http' => 'Error interno: No se puede conectar al servidor.', 'api-error-illegal-filename' => 'El nombre de archivo no está permitido.', 'api-error-internal-error' => 'Error interno: Algo salió mal al procesar tu subida en el wiki.', 'api-error-invalid-file-key' => 'Error interno: No se encontró el archivo en el almacenamiento temporal.', 'api-error-missingparam' => 'Error interno: Faltan parámetros en la solicitud.', 'api-error-missingresult' => 'Error interno: No se pudo determinar si la copia tuvo éxito.', 'api-error-mustbeloggedin' => 'Debes iniciar sesión para subir archivos.', 'api-error-mustbeposted' => 'Error interno: La solicitud requiere HTTP POST.', 'api-error-noimageinfo' => 'La carga se realizó correctamente, pero el servidor no nos dio ninguna información sobre el archivo.', 'api-error-nomodule' => 'Error interno: No hay un módulo de carga configurado.', 'api-error-ok-but-empty' => 'Error interno: No hay respuesta del servidor.', 'api-error-overwrite' => 'No se permite sobrescribir un archivo existente.', 'api-error-stashfailed' => 'Error interno: El servidor no pudo almacenar el archivo temporal.', 'api-error-publishfailed' => 'Error interno: el servidor no pudo publicar el archivo temporal.', 'api-error-stasherror' => 'Ha ocurrido un error al subir el archivo al depósito.', 'api-error-timeout' => 'El servidor no respondió en el plazo previsto.', 'api-error-unclassified' => 'Ocurrió un error desconocido.', 'api-error-unknown-code' => 'Error desconocido: «$1»', 'api-error-unknown-error' => 'Error interno: Algo salió mal al intentar cargar el archivo.', 'api-error-unknown-warning' => 'Advertencia desconocida: $1', 'api-error-unknownerror' => 'Error desconocido: «$1».', 'api-error-uploaddisabled' => 'Las subidas están desactivadas en este wiki.', 'api-error-verification-error' => 'Este archivo puede estar dañado, o tiene una extensión incorrecta.', # Durations 'duration-seconds' => '$1 {{PLURAL:$1|segundo|segundos}}', 'duration-minutes' => '$1 {{PLURAL:$1|minuto|minutos}}', 'duration-hours' => '$1 {{PLURAL:$1|hora|horas}}', 'duration-days' => '$1 {{PLURAL:$1|día|días}}', 'duration-weeks' => '$1 {{PLURAL:$1|semana|semanas}}', 'duration-years' => '$1 {{PLURAL:$1|año|años}}', 'duration-decades' => '$1 {{PLURAL:$1|década|décadas}}', 'duration-centuries' => '$1 {{PLURAL:$1|siglo|siglos}}', 'duration-millennia' => '$1 {{PLURAL:$1|milenio|milenios}}', # Image rotation 'rotate-comment' => 'Imagen girada por $1 {{PLURAL:$1|grado|grados}} en el sentido de las agujas del reloj', # Limit report 'limitreport-title' => 'Datos de perfilado del analizador:', 'limitreport-cputime' => 'Tiempo de uso de CPU', 'limitreport-cputime-value' => '$1 {{PLURAL:$1|segundo|segundos}}', 'limitreport-walltime' => 'Tiempo real de uso', 'limitreport-walltime-value' => '$1 {{PLURAL:$1|segundo|segundos}}', 'limitreport-ppvisitednodes' => 'N.º de nodos visitados por el preprocesador', 'limitreport-ppgeneratednodes' => 'N.º de nodos generados por el preprocesador', 'limitreport-postexpandincludesize' => 'Tamaño de inclusión posexpansión', 'limitreport-postexpandincludesize-value' => '$1/$2 {{PLURAL:$2|byte|bytes}}', 'limitreport-templateargumentsize' => 'Argumento del tamaño de la plantilla', 'limitreport-templateargumentsize-value' => '$1/$2 {{PLURAL:$2|byte|bytes}}', 'limitreport-expansiondepth' => 'Profundidad máxima de expansión', 'limitreport-expensivefunctioncount' => 'Cuenta de la funcion expansiva del analizador', # Special:ExpandTemplates 'expandtemplates' => 'Expandir plantillas', 'expand_templates_intro' => 'Esta página especial toma un texto wiki y expande todas sus plantillas recursivamente. También expande las funciones sintácticas como <code><nowiki>{{</nowiki>#language:…}}</code>, y variables como <code><nowiki>{{</nowiki>CURRENTDAY}}</code>. De hecho, expande casi cualquier cosa que esté entre llaves dobles.', 'expand_templates_title' => 'Título de la página, útil para expandir <nowiki>{{PAGENAME}}</nowiki> o similares', 'expand_templates_input' => 'Texto a expandir:', 'expand_templates_output' => 'Resultado:', 'expand_templates_xml_output' => 'Salida XML', 'expand_templates_html_output' => 'Salida HTML en crudo', 'expand_templates_ok' => 'Aceptar', 'expand_templates_remove_comments' => 'Eliminar comentarios (<!-- ... -->)', 'expand_templates_remove_nowiki' => 'Suprimir <nowiki> etiquetas en resultado', 'expand_templates_generate_xml' => 'Mostrar el árbol XML.', 'expand_templates_generate_rawhtml' => 'Mostrar HTML en crudo', 'expand_templates_preview' => 'Previsualización', # Unknown messages 'uploadinvalidxml' => 'No se pudo analizar el XML del archivo cargado.', ); // Changes by Gershon Bialer to fix image namespace $namespaceNames[NS_FILE] = 'Imagen'; $namespaceNames[NS_FILE_TALK] = 'Imagen_discusión'; unset($namespaceAliases['Imagen']); unset($namespaceAliases['Imagen_Discusión']); $namespaceAliases['Archivo'] = NS_FILE; $namespaceAliases['Archivo_Discusión'] = NS_FILE_TALK;
legoktm/wikihow-src
languages/messages/MessagesEs.php
PHP
gpl-2.0
270,207
<?php function tie_home_tabs(){ $home_tabs_active = tie_get_option('home_tabs_box'); $home_tabs = tie_get_option('home_tabs'); $Posts = 5; if( $home_tabs_active && $home_tabs ): ?> <div id="cats-tabs-box" class="cat-box-content clear cat-box"> <div class="cat-tabs-header"> <ul> <?php foreach ($home_tabs as $cat ) { ?> <li><a href="#catab<?php echo $cat; ?>"><?php echo get_the_category_by_ID($cat) ?></a></li> <?php } ?> </ul> </div> <?php $cat_num = 0; foreach ($home_tabs as $cat ) { $count = 0; $cat_num ++; $cat_query = new WP_Query('cat='.$cat.'&posts_per_page='.$Posts); ?> <div id="catab<?php echo $cat; ?>" class="cat-tabs-wrap cat-tabs-wrap<?php echo $cat_num; ?>"> <?php if($cat_query->have_posts()): ?> <ul> <?php while ( $cat_query->have_posts() ) : $cat_query->the_post(); $count ++ ;?> <?php if($count == 1) : ?> <li <?php tie_post_class('first-news'); ?>> <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?> <div class="post-thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"> <?php tie_thumb( 'tie-medium' ); ?> <span class="overlay-icon"></span> </a> </div><!-- post-thumbnail /--> <?php endif; ?> <h2 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php get_template_part( 'includes/boxes-meta' ); ?> <div class="entry"> <?php tie_excerpt_home() ?> <a class="more-link" href="<?php the_permalink() ?>"><?php _e( 'Read More &raquo;', 'tie' ) ?></a> </div> </li><!-- .first-news --> <?php else: ?> <li <?php tie_post_class(); ?>> <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?> <div class="post-thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php tie_thumb(); ?><span class="overlay-icon"></span></a> </div><!-- post-thumbnail /--> <?php endif; ?> <h3 class="post-box-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3> <?php get_template_part( 'includes/boxes-meta' ); ?> </li> <?php endif; ?> <?php endwhile;?> </ul> <div class="clear"></div> <?php endif; ?> </div> <?php } ?> </div><!-- #cats-tabs-box /--> <?php endif; } ?>
shiedman/wordpress
wp-content/themes/sahifa/functions/home-cat-tabs.php
PHP
gpl-2.0
2,817
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Cyclos is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.controls.reports.members.transactions; import java.util.Collection; import java.util.Map; import nl.strohalm.cyclos.entities.accounts.AccountType; import nl.strohalm.cyclos.entities.accounts.transactions.PaymentFilter; import nl.strohalm.cyclos.entities.groups.MemberGroup; import nl.strohalm.cyclos.utils.DataObject; import nl.strohalm.cyclos.entities.utils.Period; public class MembersTransactionsReportDTO extends DataObject { public static enum DetailsLevel { SUMMARY, TRANSACTIONS; } private static final long serialVersionUID = -5856820625601506756L; private boolean memberName; private boolean brokerUsername; private boolean brokerName; private Collection<AccountType> accountTypes; private Collection<MemberGroup> memberGroups; private Period period; private boolean incomingTransactions; private boolean outgoingTransactions; private boolean includeNoTraders; private DetailsLevel detailsLevel; private Collection<PaymentFilter> transactionsPaymentFilters; private Map<PaymentFilter, Integer> transactionsColSpan; private Map<AccountType, Collection<PaymentFilter>> paymentFiltersByAccountType; public Collection<AccountType> getAccountTypes() { return accountTypes; } public int getBrokerColSpan() { int colspan = 0; if (isBrokerName()) { colspan++; } if (isBrokerUsername()) { colspan++; } return colspan; } public DetailsLevel getDetailsLevel() { return detailsLevel; } public int getMemberColSpan() { if (isMemberName()) { return 2; } else { return 1; } } public Collection<MemberGroup> getMemberGroups() { return memberGroups; } public Map<AccountType, Collection<PaymentFilter>> getPaymentFiltersByAccountType() { return paymentFiltersByAccountType; } public Period getPeriod() { return period; } public Map<PaymentFilter, Integer> getTransactionsColSpan() { return transactionsColSpan; } public Collection<PaymentFilter> getTransactionsPaymentFilters() { return transactionsPaymentFilters; } public boolean isBrokerName() { return brokerName; } public boolean isBrokerUsername() { return brokerUsername; } public boolean isDebitsAndCredits() { return isIncomingTransactions() && isOutgoingTransactions(); } public boolean isIncludeNoTraders() { return includeNoTraders; } public boolean isIncomingTransactions() { return incomingTransactions; } public boolean isMemberName() { return memberName; } public boolean isOutgoingTransactions() { return outgoingTransactions; } public boolean isTransactions() { return isIncomingTransactions() || isOutgoingTransactions(); } public void setAccountTypes(final Collection<AccountType> accountTypes) { this.accountTypes = accountTypes; } public void setBrokerName(final boolean brokerName) { this.brokerName = brokerName; } public void setBrokerUsername(final boolean brokerUsername) { this.brokerUsername = brokerUsername; } public void setDetailsLevel(final DetailsLevel detailsLevel) { this.detailsLevel = detailsLevel; } public void setIncludeNoTraders(final boolean includeNoTraders) { this.includeNoTraders = includeNoTraders; } public void setIncomingTransactions(final boolean incomingTransactions) { this.incomingTransactions = incomingTransactions; } public void setMemberGroups(final Collection<MemberGroup> memberGroups) { this.memberGroups = memberGroups; } public void setMemberName(final boolean memberName) { this.memberName = memberName; } public void setOutgoingTransactions(final boolean outgoingTransactions) { this.outgoingTransactions = outgoingTransactions; } public void setPaymentFiltersByAccountType(final Map<AccountType, Collection<PaymentFilter>> paymentFiltersByAccountType) { this.paymentFiltersByAccountType = paymentFiltersByAccountType; } public void setPeriod(final Period period) { this.period = period; } public void setTransactionsColSpan(final Map<PaymentFilter, Integer> transactionsColSpan) { this.transactionsColSpan = transactionsColSpan; } public void setTransactionsPaymentFilters(final Collection<PaymentFilter> transactionsPaymentFilters) { this.transactionsPaymentFilters = transactionsPaymentFilters; } }
mateli/OpenCyclos
src/main/java/nl/strohalm/cyclos/controls/reports/members/transactions/MembersTransactionsReportDTO.java
Java
gpl-2.0
5,944
<?php /* * Old Pricing Table */ /* vc_map( array( 'name' =>'Webnus PricingTable', 'base' => 'pricing_table', 'category' => __( 'Webnus Shortcodes', 'WEBNUS_TEXT_DOMAIN' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Title', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'title', 'value' => 'Title', 'description' => __( 'Enter the Pricing Table Title', 'WEBNUS_TEXT_DOMAIN') ), array( 'type' => 'textfield', 'heading' => __( 'Price', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'price', 'value' => '$30', 'description' => __( 'Enter the Pricing Table Price', 'WEBNUS_TEXT_DOMAIN') ), array( 'type' => 'textfield', 'heading' => __( 'Period', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'period', 'value' => '/Month', 'description' => __( 'Enter the Pricing Table Period', 'WEBNUS_TEXT_DOMAIN') ), array( 'type' => 'textfield', 'heading' => __( 'Link URL', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'link', 'value' => '#', 'description' => __( 'Enter the Pricing Table Link URL', 'WEBNUS_TEXT_DOMAIN') ), array( 'type' => 'textfield', 'heading' => __( 'Link Title', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'link_title', 'value' => 'Order Now', 'description' => __( 'Enter the Pricing Table Link Text', 'WEBNUS_TEXT_DOMAIN') ), array( 'type' => 'textarea_html', 'heading' => __( 'Table Items', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'content', 'value' => '[price_item]2 Users[/price_item][price_item]100 mb Disk space[/price_item][price_item]20 Gig Data transfer[/price_item][price_item]Starter Admin Panel[/price_item][price_item]- APIs[/price_item][price_item]Email Support[/price_item]', 'description' => __( 'Enter the Pricing Table Content, [price_item] Acceptable', 'WEBNUS_TEXT_DOMAIN') ), ), ) ); */ global $wpdb; $query = "SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE 'css3_grid_shortcode_settings%' ORDER BY option_name"; $pricing_tables_list = $wpdb->get_results($query); $css3GridAllShortcodeIds = array(); foreach($pricing_tables_list as $pricing_table) $css3GridAllShortcodeIds[] = substr($pricing_table->option_name,29,strlen($pricing_table->option_name)); sort($css3GridAllShortcodeIds); vc_map( array( 'name' =>'Webnus Css3PricingTable', 'base' => 'css3_grid', "description" => "Pricing table", "icon" => "webnus_pricingtable", 'category' => __( 'Webnus Shortcodes', 'WEBNUS_TEXT_DOMAIN' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Pricing table ID', 'WEBNUS_TEXT_DOMAIN' ), 'param_name' => 'id', 'value' => $css3GridAllShortcodeIds, 'description' => __( 'Select the pricing table ID', 'WEBNUS_TEXT_DOMAIN') ), ), ) ); ?>
anujsm/test
wp-content/themes/florida-wp/inc/visualcomposer/shortcodes/12-pricingtable.php
PHP
gpl-2.0
3,222
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #include "Chiika/browser/preferences_test.h" #include <sstream> #include <string> #include <vector> #include "include/base/cef_logging.h" #include "include/cef_command_line.h" #include "include/cef_parser.h" namespace client { namespace preferences_test { namespace { const char kTestUrl[] = "http://tests/preferences"; // Application-specific error codes. const int kMessageFormatError = 1; const int kPreferenceApplicationError = 1; // Common to all messages. const char kNameKey[] = "name"; const char kNameValueGet[] = "preferences_get"; const char kNameValueSet[] = "preferences_set"; const char kNameValueState[] = "preferences_state"; // Used with "preferences_get" messages. const char kIncludeDefaultsKey[] = "include_defaults"; // Used with "preferences_set" messages. const char kPreferencesKey[] = "preferences"; // Handle messages in the browser process. Only accessed on the UI thread. class Handler : public CefMessageRouterBrowserSide::Handler { public: typedef std::vector<std::string> NameVector; Handler() { CEF_REQUIRE_UI_THREAD(); } // Called due to cefQuery execution in preferences.html. bool OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 query_id, const CefString& request, bool persistent, CefRefPtr<Callback> callback) OVERRIDE { CEF_REQUIRE_UI_THREAD(); // Only handle messages from the test URL. std::string url = frame->GetURL(); if (url.find(kTestUrl) != 0) return false; // Parse |request| as a JSON dictionary. CefRefPtr<CefDictionaryValue> request_dict = ParseJSON(request); if (!request_dict) { callback->Failure(kMessageFormatError, "Incorrect message format"); return true; } // Verify the "name" key. if (!VerifyKey(request_dict, kNameKey, VTYPE_STRING, callback)) return true; const std::string& message_name = request_dict->GetString(kNameKey); if (message_name == kNameValueGet) { // JavaScript is requesting a JSON representation of the preferences tree. // Verify the "include_defaults" key. if (!VerifyKey(request_dict, kIncludeDefaultsKey, VTYPE_BOOL, callback)) return true; const bool include_defaults = request_dict->GetBool(kIncludeDefaultsKey); OnPreferencesGet(browser, include_defaults, callback); return true; } else if (message_name == kNameValueSet) { // JavaScript is requesting that preferences be updated to match the // specified JSON representation. // Verify the "preferences" key. if (!VerifyKey(request_dict, kPreferencesKey, VTYPE_DICTIONARY, callback)) return true; CefRefPtr<CefDictionaryValue> preferences = request_dict->GetDictionary(kPreferencesKey); OnPreferencesSet(browser, preferences, callback); return true; } else if (message_name == kNameValueState) { // JavaScript is requesting global state information. OnPreferencesState(browser, callback); return true; } return false; } private: // Execute |callback| with the preferences dictionary as a JSON string. static void OnPreferencesGet(CefRefPtr<CefBrowser> browser, bool include_defaults, CefRefPtr<Callback> callback) { CefRefPtr<CefRequestContext> context = browser->GetHost()->GetRequestContext(); // Retrieve all preference values. CefRefPtr<CefDictionaryValue> prefs = context->GetAllPreferences(include_defaults); // Serialize the preferences to JSON and return to the JavaScript caller. callback->Success(GetJSON(prefs)); } // Set preferences based on the contents of |preferences|. Execute |callback| // with a descriptive result message. static void OnPreferencesSet(CefRefPtr<CefBrowser> browser, CefRefPtr<CefDictionaryValue> preferences, CefRefPtr<Callback> callback) { CefRefPtr<CefRequestContext> context = browser->GetHost()->GetRequestContext(); CefRefPtr<CefValue> value = CefValue::Create(); value->SetDictionary(preferences); std::string error; NameVector changed_names; // Apply preferences. This may result in errors. const bool success = ApplyPrefs(context, std::string(), value, error, changed_names); // Create a message that accurately represents the result. std::string message; if (!changed_names.empty()) { std::stringstream ss; ss << "Successfully changed " << changed_names.size() << " preferences; "; for (size_t i = 0; i < changed_names.size(); ++i) { ss << changed_names[i]; if (i < changed_names.size() - 1) ss << ", "; } message = ss.str(); } if (!success) { DCHECK(!error.empty()); if (!message.empty()) message += "\n"; message += error; } if (changed_names.empty()) { if (!message.empty()) message += "\n"; message += "No preferences changed."; } // Return the message to the JavaScript caller. if (success) callback->Success(message); else callback->Failure(kPreferenceApplicationError, message); } // Execute |callback| with the global state dictionary as a JSON string. static void OnPreferencesState(CefRefPtr<CefBrowser> browser, CefRefPtr<Callback> callback) { CefRefPtr<CefCommandLine> command_line = CefCommandLine::GetGlobalCommandLine(); CefRefPtr<CefDictionaryValue> dict = CefDictionaryValue::Create(); // If spell checking is disabled via the command-line then it cannot be // enabled via preferences. dict->SetBool("spellcheck_disabled", command_line->HasSwitch("disable-spell-checking")); // If proxy settings are configured via the command-line then they cannot // be modified via preferences. dict->SetBool("proxy_configured", command_line->HasSwitch("no-proxy-server") || command_line->HasSwitch("proxy-auto-detect") || command_line->HasSwitch("proxy-pac-url") || command_line->HasSwitch("proxy-server")); // If allow running insecure content is enabled via the command-line then it // cannot be enabled via preferences. dict->SetBool("allow_running_insecure_content", command_line->HasSwitch("allow-running-insecure-content")); // Serialize the state to JSON and return to the JavaScript caller. callback->Success(GetJSON(dict)); } // Convert a JSON string to a dictionary value. static CefRefPtr<CefDictionaryValue> ParseJSON(const CefString& string) { CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC); if (value.get() && value->GetType() == VTYPE_DICTIONARY) return value->GetDictionary(); return NULL; } // Convert a dictionary value to a JSON string. static CefString GetJSON(CefRefPtr<CefDictionaryValue> dictionary) { CefRefPtr<CefValue> value = CefValue::Create(); value->SetDictionary(dictionary); return CefWriteJSON(value, JSON_WRITER_DEFAULT); } // Verify that |key| exists in |dictionary| and has type |value_type|. Fails // |callback| and returns false on failure. static bool VerifyKey(CefRefPtr<CefDictionaryValue> dictionary, const char* key, cef_value_type_t value_type, CefRefPtr<Callback> callback) { if (!dictionary->HasKey(key) || dictionary->GetType(key) != value_type) { callback->Failure(kMessageFormatError, "Missing or incorrectly formatted message key: " + std::string(key)); return false; } return true; } // Apply preferences. Returns true on success. Returns false and sets |error| // to a descriptive error string on failure. |changed_names| is the list of // preferences that were successfully changed. static bool ApplyPrefs(CefRefPtr<CefRequestContext> context, const std::string& name, CefRefPtr<CefValue> value, std::string& error, NameVector& changed_names) { if (!name.empty() && context->HasPreference(name)) { // The preference exists. Set the value. return SetPref(context, name, value, error, changed_names); } if (value->GetType() == VTYPE_DICTIONARY) { // A dictionary type value that is not an existing preference. Try to set // each of the elements individually. CefRefPtr<CefDictionaryValue> dict = value->GetDictionary(); CefDictionaryValue::KeyList keys; dict->GetKeys(keys); for (size_t i = 0; i < keys.size(); ++i) { const std::string& key = keys[i]; const std::string& current_name = name.empty() ? key : name + "." + key; if (!ApplyPrefs(context, current_name, dict->GetValue(key), error, changed_names)) { return false; } } return true; } error = "Trying to create an unregistered preference: " + name; return false; } // Set a specific preference value. Returns true if the value is set // successfully or has not changed. If the value has changed then |name| will // be added to |changed_names|. Returns false and sets |error| to a // descriptive error string on failure. static bool SetPref(CefRefPtr<CefRequestContext> context, const std::string& name, CefRefPtr<CefValue> value, std::string& error, NameVector& changed_names) { CefRefPtr<CefValue> existing_value = context->GetPreference(name); DCHECK(existing_value); if (value->GetType() == VTYPE_STRING && existing_value->GetType() != VTYPE_STRING) { // Since |value| is coming from JSON all basic types will be represented // as strings. Convert to the expected data type. const std::string& string_val = value->GetString(); switch (existing_value->GetType()) { case VTYPE_BOOL: if (string_val == "true" || string_val == "1") value->SetBool(true); else if (string_val == "false" || string_val == "0") value->SetBool(false); break; case VTYPE_INT: value->SetInt(atoi(string_val.c_str())); break; case VTYPE_DOUBLE: value->SetInt(atof(string_val.c_str())); break; default: // Other types cannot be converted. break; } } // Nothing to do if the value hasn't changed. if (existing_value->IsEqual(value)) return true; // Attempt to set the preference. CefString error_str; if (!context->SetPreference(name, value, error_str)) { error = error_str.ToString() + ": " + name; return false; } // The preference was set successfully. changed_names.push_back(name); return true; } DISALLOW_COPY_AND_ASSIGN(Handler); }; } // namespace void CreateMessageHandlers(test_runner::MessageHandlerSet& handlers) { handlers.insert(new Handler()); } } // namespace preferences_test } // namespace client
arkenthera/ChiikaCef
Chiika/browser/preferences_test.cc
C++
gpl-2.0
11,565
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace AutomationService.Data.DynamicDataItem { public delegate void LogMessageFn(String xsMessage); [DataContract] public class ExecutionJobEnvironment { // Visible for debugging public Stack<DataItemComposite> aoDataStack; // Debugging public List<DataItemComposite> aoDebuggingStack; // Logging messages public LogMessageFn oLogMessage; public ExecutionJobEnvironment(LogMessageFn xoLoggingFunction) { oLogMessage = xoLoggingFunction; aoDataStack = new Stack<DataItemComposite>(); aoDebuggingStack = new List<DataItemComposite>(); } public void PushDataContainer(DataItemComposite xoContainer) { aoDataStack.Push(xoContainer); aoDebuggingStack.Add(xoContainer); } public DataItemComposite PeekDataContainer() { return aoDataStack.Peek(); } public DataItemComposite PopDataContainer() { return aoDataStack.Pop(); } } }
Aegz/AutomationSuite
AutomationBackEnd/Data/DynamicDataItem/ExecutionJobEnvironment.cs
C#
gpl-2.0
1,236
<?php if($mylayout == 'empty') include('emptypage-layout.php'); if( $mylayout == 'blankempty') include('blankemptypage-layout.php'); if($mylayout == 'client') include('client-layout.php'); ?>
narasimha99/medbid
wp-content/plugins/networklocum/app/views/layouts/public.php
PHP
gpl-2.0
196
<?php namespace ascio\v3; class PollQueue { /** * @var PollQueueRequest $request */ protected $request = null; /** * @param PollQueueRequest $request */ public function __construct($request) { $this->request = $request; } /** * @return PollQueueRequest */ public function getRequest() { return $this->request; } /** * @param PollQueueRequest $request * @return \ascio\v3\PollQueue */ public function setRequest($request) { $this->request = $request; return $this; } }
rendermani/ascio-php-examples
aws-v3/service/PollQueue.php
PHP
gpl-2.0
639
# -*- coding: utf-8 -*- """ logol_analyse provide some analyse tools for logol xml results. Without any option, it will provide the number of hit, how many sequences have at least one hit, and a graph with the repartition of the hits. Usage: logol_analyse.py <input> <data> [options] options: --graph, -g=<name> The graph name, to save it directly. --help, -h It call help. UNBELIEVABLE!!!!! --nograph -n No graph creation --origin, -o INT The 0 emplacement on sequences [default: 150] --position -p=<name> Return a file containing position of each motif --result -r=<name> Save a fasta file with the matched sequences. --signature, -s=<name> Create a file with for each sequences the hits. --hits, -t Display a hits/sequences graph. --version, -v Maybe it's a trap ^^ --xclude, -x=<name> Create a file containing all unmatched sequences """ ########## # IMPORT # ########## import matplotlib.pyplot as plt import pylab import glob import os from docopt import docopt from lxml import etree from Bio import SeqIO ############# # ARGUMENTS # ############# if __name__ == '__main__': arguments = docopt(__doc__, version = '1.3') ######## # MAIN # ######## def __main__(arguments): total = 0 count = 0 hit = [] se = set() # Contain sequences header hits_per_seq = [] # Here we check all the .xml file for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*.xml"): nb_hit = 0 total += 1 tree = etree.parse(f) # Collect of the hit beginning and ID for seq in tree.xpath("/sequences/match/begin"): count += 1 nb_hit +=1 hit.append(int(seq.text)-int(arguments['--origin'])) [se.add(a.text) for a in tree.xpath("/sequences/fastaHeader")] if nb_hit > 0: hits_per_seq.append(nb_hit) print("Nombre de hits: "+str(count)) print("Nombre de séquences touchées: "+str(len(se))+" sur "+str(total)) print("Nombre max de hits par séquences: "+str(max(hits_per_seq))) if arguments['--result'] != None: seq_match(se) if arguments['--xclude'] != None: seq_no_match(se) if arguments['--nograph'] == False: graph(hit) if arguments['--signature'] != None: save_signature() if arguments['--position'] != None: save_position() if arguments['--hits'] != False: display_hits(hits_per_seq) ############# # FUNCTIONS # ############# def seq_match(seq): out = open(os.getcwd()+'/'+arguments['--result'], 'w') data = open(os.getcwd()+'/'+arguments['<data>'], "rU") for s in SeqIO.parse(data, "fasta"): if s.id in seq: out.write(s.format("fasta")) out.close() data.close() def seq_no_match(seq): out = open(os.getcwd()+'/'+arguments['--xclude'], 'w') data = open(os.getcwd()+'/'+arguments['<data>'], "rU") for s in SeqIO.parse(data, "fasta"): if s.id not in seq: out.write(s.format("fasta")) out.close() data.close() def graph(hit): plt.hist(hit, range(min(hit), max(hit))) plt.xticks(range(min(hit), max(hit), 10)) plt.xlabel("Emplacement des hits sur les séquences") plt.ylabel("Nombre de hits") if arguments['--graph'] != None: plt.savefig(arguments['--graph']+'.png') pylab.close() else: plt.show() def save_signature(): sign = open(os.getcwd()+'/'+arguments['--signature'], 'w') for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*"): fr = [] # Will have the last char of var, which is frag nb c = 0 tree = etree.parse(f) if tree.xpath("/sequences/match/variable") != []: [sign.write('>'+h.text+'\n') for h in tree.xpath("/sequences/fastaHeader")] [fr.append((int(i.get("name")[-1]))) for i in tree.xpath("/sequences/match/variable")] m = max(fr) # Fragments number to have the complete match for i in tree.xpath("/sequences/match/variable/content"): c += 1 sign.write(i.text) if c >= m: sign.write("\n") c = 0 sign.close() def save_position(): begin = [] # Will contain all the begining number end = [] seq = [] # Will contain all the sequences found iD = [] # Will contair the sequences ID n = 0 # nb of line we will have to write i = 0 pos = open(os.getcwd()+'/'+arguments['--position'], 'w') pos.write("ID\tbegin\tsequence\tend\n") for f in glob.glob(os.getcwd()+"/"+arguments['<input>']+"*"): tree = etree.parse(f) for s in tree.xpath("/sequences/match/variable/content"): n += 1 seq.append(s.text) [iD.append(h.text) for h in tree.xpath("/sequences/fastaHeader")] for b in tree.xpath("/sequences/match/variable/begin"): begin.append(str(b.text)) for e in tree.xpath("/sequences/match/variable/end"): end.append(str(e.text)) # Now, we write those info into the file while i < n: pos.write(iD[i]+"\t"+begin[i]+"\t"+seq[i]+"\t"+end[i]+"\n") i += 1 pos.close() def display_hits(hits_per_seq): plt.hist(hits_per_seq, range(min(hits_per_seq), max(hits_per_seq))) plt.xticks(range(min(hits_per_seq), max(hits_per_seq), 1)) plt.xlabel("Nombre de hits par séquences") plt.ylabel("Nombre de séquences") plt.show() ########## # LAUNCH # ########## __main__(arguments)
Nedgang/logol_analyse
analyse_logol.py
Python
gpl-2.0
5,660
//======================================================================== // // SplashOutputDev.cc // // Copyright 2003 Glyph & Cog, LLC // //======================================================================== //======================================================================== // // Modified under the Poppler project - http://poppler.freedesktop.org // // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // // Copyright (C) 2005 Takashi Iwai <tiwai@suse.de> // Copyright (C) 2006 Stefan Schweizer <genstef@gentoo.org> // Copyright (C) 2006-2014 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com> // Copyright (C) 2006 Scott Turner <scotty1024@mac.com> // Copyright (C) 2007 Koji Otani <sho@bbr.jp> // Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com> // Copyright (C) 2009-2014 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2009 William Bader <williambader@hotmail.com> // Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de> // Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com> // Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha@gmail.com> // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com> // Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com> // Copyright (C) 2011 Andrea Canciani <ranma42@gmail.com> // Copyright (C) 2011, 2012 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com> // Copyright (C) 2013 Li Junling <lijunling@sina.com> // Copyright (C) 2014 Ed Porras <ed@moto-research.com> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== #include <config.h> #ifdef USE_GCC_PRAGMAS #pragma implementation #endif #include <string.h> #include <math.h> #include "goo/gfile.h" #include "GlobalParams.h" #include "Error.h" #include "Object.h" #include "Gfx.h" #include "GfxFont.h" #include "Page.h" #include "PDFDoc.h" #include "Link.h" #include "FontEncodingTables.h" #include "fofi/FoFiTrueType.h" #include "splash/SplashBitmap.h" #include "splash/SplashGlyphBitmap.h" #include "splash/SplashPattern.h" #include "splash/SplashScreen.h" #include "splash/SplashPath.h" #include "splash/SplashState.h" #include "splash/SplashErrorCodes.h" #include "splash/SplashFontEngine.h" #include "splash/SplashFont.h" #include "splash/SplashFontFile.h" #include "splash/SplashFontFileID.h" #include "splash/Splash.h" #include "SplashOutputDev.h" #ifdef VMS #if (__VMS_VER < 70000000) extern "C" int unlink(char *filename); #endif #endif #ifdef _MSC_VER #include <float.h> #define isfinite(x) _finite(x) #endif #ifdef __sun #include <ieeefp.h> #define isfinite(x) finite(x) #endif static inline void convertGfxColor(SplashColorPtr dest, SplashColorMode colorMode, GfxColorSpace *colorSpace, GfxColor *src) { SplashColor color; GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif // make gcc happy color[0] = color[1] = color[2] = 0; #if SPLASH_CMYK color[3] = 0; #endif switch (colorMode) { case splashModeMono1: case splashModeMono8: colorSpace->getGray(src, &gray); color[0] = colToByte(gray); break; case splashModeXBGR8: color[3] = 255; case splashModeBGR8: case splashModeRGB8: colorSpace->getRGB(src, &rgb); color[0] = colToByte(rgb.r); color[1] = colToByte(rgb.g); color[2] = colToByte(rgb.b); break; #if SPLASH_CMYK case splashModeCMYK8: colorSpace->getCMYK(src, &cmyk); color[0] = colToByte(cmyk.c); color[1] = colToByte(cmyk.m); color[2] = colToByte(cmyk.y); color[3] = colToByte(cmyk.k); break; case splashModeDeviceN8: colorSpace->getDeviceN(src, &deviceN); for (int i = 0; i < SPOT_NCOMPS + 4; i++) color[i] = colToByte(deviceN.c[i]); break; #endif } splashColorCopy(dest, color); } //------------------------------------------------------------------------ // SplashGouraudPattern //------------------------------------------------------------------------ SplashGouraudPattern::SplashGouraudPattern(GBool bDirectColorTranslationA, GfxState *stateA, GfxGouraudTriangleShading *shadingA, SplashColorMode modeA) { SplashColor defaultColor; GfxColor srcColor; state = stateA; shading = shadingA; mode = modeA; bDirectColorTranslation = bDirectColorTranslationA; shadingA->getColorSpace()->getDefaultColor(&srcColor); convertGfxColor(defaultColor, mode, shadingA->getColorSpace(), &srcColor); gfxMode = shadingA->getColorSpace()->getMode(); } SplashGouraudPattern::~SplashGouraudPattern() { } void SplashGouraudPattern::getParameterizedColor(double colorinterp, SplashColorMode mode, SplashColorPtr dest) { GfxColor src; GfxColorSpace* srcColorSpace = shading->getColorSpace(); int colorComps = 3; #if SPLASH_CMYK if (mode == splashModeCMYK8) colorComps=4; else if (mode == splashModeDeviceN8) colorComps=4 + SPOT_NCOMPS; #endif shading->getParameterizedColor(colorinterp, &src); if (bDirectColorTranslation) { for (int m = 0; m < colorComps; ++m) dest[m] = colToByte(src.c[m]); } else { convertGfxColor(dest, mode, srcColorSpace, &src); } } //------------------------------------------------------------------------ // SplashUnivariatePattern //------------------------------------------------------------------------ SplashUnivariatePattern::SplashUnivariatePattern(SplashColorMode colorModeA, GfxState *stateA, GfxUnivariateShading *shadingA) { Matrix ctm; double xMin, yMin, xMax, yMax; shading = shadingA; state = stateA; colorMode = colorModeA; state->getCTM(&ctm); ctm.invertTo(&ictm); // get the function domain t0 = shading->getDomain0(); t1 = shading->getDomain1(); dt = t1 - t0; stateA->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); shadingA->setupCache(&ctm, xMin, yMin, xMax, yMax); gfxMode = shadingA->getColorSpace()->getMode(); } SplashUnivariatePattern::~SplashUnivariatePattern() { } GBool SplashUnivariatePattern::getColor(int x, int y, SplashColorPtr c) { GfxColor gfxColor; double xc, yc, t; ictm.transform(x, y, &xc, &yc); if (! getParameter (xc, yc, &t)) return gFalse; shading->getColor(t, &gfxColor); convertGfxColor(c, colorMode, shading->getColorSpace(), &gfxColor); return gTrue; } GBool SplashUnivariatePattern::testPosition(int x, int y) { double xc, yc, t; ictm.transform(x, y, &xc, &yc); if (! getParameter (xc, yc, &t)) return gFalse; return (t0 < t1) ? (t > t0 && t < t1) : (t > t1 && t < t0); } //------------------------------------------------------------------------ // SplashRadialPattern //------------------------------------------------------------------------ #define RADIAL_EPSILON (1. / 1024 / 1024) SplashRadialPattern::SplashRadialPattern(SplashColorMode colorModeA, GfxState *stateA, GfxRadialShading *shadingA): SplashUnivariatePattern(colorModeA, stateA, shadingA) { SplashColor defaultColor; GfxColor srcColor; shadingA->getCoords(&x0, &y0, &r0, &dx, &dy, &dr); dx -= x0; dy -= y0; dr -= r0; a = dx*dx + dy*dy - dr*dr; if (fabs(a) > RADIAL_EPSILON) inva = 1.0 / a; shadingA->getColorSpace()->getDefaultColor(&srcColor); convertGfxColor(defaultColor, colorModeA, shadingA->getColorSpace(), &srcColor); } SplashRadialPattern::~SplashRadialPattern() { } GBool SplashRadialPattern::getParameter(double xs, double ys, double *t) { double b, c, s0, s1; // We want to solve this system of equations: // // 1. (x - xc(s))^2 + (y -yc(s))^2 = rc(s)^2 // 2. xc(s) = x0 + s * (x1 - xo) // 3. yc(s) = y0 + s * (y1 - yo) // 4. rc(s) = r0 + s * (r1 - ro) // // To simplify the system a little, we translate // our coordinates to have the origin in (x0,y0) xs -= x0; ys -= y0; // Then we have to solve the equation: // A*s^2 - 2*B*s + C = 0 // where // A = dx^2 + dy^2 - dr^2 // B = xs*dx + ys*dy + r0*dr // C = xs^2 + ys^2 - r0^2 b = xs*dx + ys*dy + r0*dr; c = xs*xs + ys*ys - r0*r0; if (fabs(a) <= RADIAL_EPSILON) { // A is 0, thus the equation simplifies to: // -2*B*s + C = 0 // If B is 0, we can either have no solution or an indeterminate // equation, thus we behave as if we had an invalid solution if (fabs(b) <= RADIAL_EPSILON) return gFalse; s0 = s1 = 0.5 * c / b; } else { double d; d = b*b - a*c; if (d < 0) return gFalse; d = sqrt (d); s0 = b + d; s1 = b - d; // If A < 0, one of the two solutions will have negative radius, // thus it will be ignored. Otherwise we know that s1 <= s0 // (because d >=0 implies b - d <= b + d), so if both are valid it // will be the true solution. s0 *= inva; s1 *= inva; } if (r0 + s0 * dr >= 0) { if (0 <= s0 && s0 <= 1) { *t = t0 + dt * s0; return gTrue; } else if (s0 < 0 && shading->getExtend0()) { *t = t0; return gTrue; } else if (s0 > 1 && shading->getExtend1()) { *t = t1; return gTrue; } } if (r0 + s1 * dr >= 0) { if (0 <= s1 && s1 <= 1) { *t = t0 + dt * s1; return gTrue; } else if (s1 < 0 && shading->getExtend0()) { *t = t0; return gTrue; } else if (s1 > 1 && shading->getExtend1()) { *t = t1; return gTrue; } } return gFalse; } #undef RADIAL_EPSILON //------------------------------------------------------------------------ // SplashAxialPattern //------------------------------------------------------------------------ SplashAxialPattern::SplashAxialPattern(SplashColorMode colorModeA, GfxState *stateA, GfxAxialShading *shadingA): SplashUnivariatePattern(colorModeA, stateA, shadingA) { SplashColor defaultColor; GfxColor srcColor; shadingA->getCoords(&x0, &y0, &x1, &y1); dx = x1 - x0; dy = y1 - y0; mul = 1 / (dx * dx + dy * dy); shadingA->getColorSpace()->getDefaultColor(&srcColor); convertGfxColor(defaultColor, colorModeA, shadingA->getColorSpace(), &srcColor); } SplashAxialPattern::~SplashAxialPattern() { } GBool SplashAxialPattern::getParameter(double xc, double yc, double *t) { double s; xc -= x0; yc -= y0; s = (xc * dx + yc * dy) * mul; if (0 <= s && s <= 1) { *t = t0 + dt * s; } else if (s < 0 && shading->getExtend0()) { *t = t0; } else if (s > 1 && shading->getExtend1()) { *t = t1; } else { return gFalse; } return gTrue; } //------------------------------------------------------------------------ // Type 3 font cache size parameters #define type3FontCacheAssoc 8 #define type3FontCacheMaxSets 8 #define type3FontCacheSize (128*1024) //------------------------------------------------------------------------ // Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result. static inline Guchar div255(int x) { return (Guchar)((x + (x >> 8) + 0x80) >> 8); } #if SPLASH_CMYK #include "GfxState_helpers.h" //------------------------------------------------------------------------- // helper for Blend functions (convert CMYK to RGB, do blend, convert back) //------------------------------------------------------------------------- // based in GfxState.cc static void cmykToRGB(SplashColorPtr cmyk, SplashColor rgb) { double c, m, y, k, c1, m1, y1, k1, r, g, b; c = colToDbl(byteToCol(cmyk[0])); m = colToDbl(byteToCol(cmyk[1])); y = colToDbl(byteToCol(cmyk[2])); k = colToDbl(byteToCol(cmyk[3])); c1 = 1 - c; m1 = 1 - m; y1 = 1 - y; k1 = 1 - k; cmykToRGBMatrixMultiplication(c, m, y, k, c1, m1, y1, k1, r, g, b); rgb[0] = colToByte(clip01(dblToCol(r))); rgb[1] = colToByte(clip01(dblToCol(g))); rgb[2] = colToByte(clip01(dblToCol(b))); } static void rgbToCMYK(SplashColor rgb, SplashColorPtr cmyk) { GfxColorComp c, m, y, k; c = clip01(gfxColorComp1 - byteToCol(rgb[0])); m = clip01(gfxColorComp1 - byteToCol(rgb[1])); y = clip01(gfxColorComp1 - byteToCol(rgb[2])); k = c; if (m < k) { k = m; } if (y < k) { k = y; } cmyk[0] = colToByte(c - k); cmyk[1] = colToByte(m - k); cmyk[2] = colToByte(y - k); cmyk[3] = colToByte(k); } #endif //------------------------------------------------------------------------ // Blend functions //------------------------------------------------------------------------ static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = (rgbDest[i] * rgbSrc[i]) / 255; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = (dest[i] * src[i]) / 255; } } } static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] + rgbSrc[i] - (rgbDest[i] * rgbSrc[i]) / 255; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255; } } } static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] < 0x80 ? (rgbSrc[i] * 2 * rgbDest[i]) / 255 : 255 - 2 * ((255 - rgbSrc[i]) * (255 - rgbDest[i])) / 255; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] < 0x80 ? (src[i] * 2 * dest[i]) / 255 : 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255; } } } static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] < rgbSrc[i] ? rgbDest[i] : rgbSrc[i]; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] < src[i] ? dest[i] : src[i]; } } } static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] > rgbSrc[i] ? rgbDest[i] : rgbSrc[i]; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] > src[i] ? dest[i] : src[i]; } } } static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i, x; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { if (rgbSrc[i] == 255) { rgbBlend[i] = 255; } else { x = (rgbDest[i] * 255) / (255 - rgbSrc[i]); rgbBlend[i] = x <= 255 ? x : 255; } } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { if (src[i] == 255) { blend[i] = 255; } else { x = (dest[i] * 255) / (255 - src[i]); blend[i] = x <= 255 ? x : 255; } } } } static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i, x; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { if (rgbSrc[i] == 0) { rgbBlend[i] = 0; } else { x = ((255 - rgbDest[i]) * 255) / rgbSrc[i]; rgbBlend[i] = x <= 255 ? 255 - x : 0; } } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { if (src[i] == 0) { blend[i] = 0; } else { x = ((255 - dest[i]) * 255) / src[i]; blend[i] = x <= 255 ? 255 - x : 0; } } } } static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbSrc[i] < 0x80 ? (rgbDest[i] * 2 * rgbSrc[i]) / 255 : 255 - 2 * ((255 - rgbDest[i]) * (255 - rgbSrc[i])) / 255; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = src[i] < 0x80 ? (dest[i] * 2 * src[i]) / 255 : 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255; } } } static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i, x; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { if (rgbSrc[i] < 0x80) { rgbBlend[i] = rgbDest[i] - (255 - 2 * rgbSrc[i]) * rgbDest[i] * (255 - rgbDest[i]) / (255 * 255); } else { if (rgbDest[i] < 0x40) { x = (((((16 * rgbDest[i] - 12 * 255) * rgbDest[i]) / 255) + 4 * 255) * rgbDest[i]) / 255; } else { x = (int)sqrt(255.0 * rgbDest[i]); } rgbBlend[i] = rgbDest[i] + (2 * rgbSrc[i] - 255) * (x - rgbDest[i]) / 255; } } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { if (src[i] < 0x80) { blend[i] = dest[i] - (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) / (255 * 255); } else { if (dest[i] < 0x40) { x = (((((16 * dest[i] - 12 * 255) * dest[i]) / 255) + 4 * 255) * dest[i]) / 255; } else { x = (int)sqrt(255.0 * dest[i]); } blend[i] = dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255; } } } } static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] < rgbSrc[i] ? rgbSrc[i] - rgbDest[i] : rgbDest[i] - rgbSrc[i]; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i]; } } } static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { int i; #if SPLASH_CMYK if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) { SplashColor rgbSrc; SplashColor rgbDest; SplashColor rgbBlend; cmykToRGB(src, rgbSrc); cmykToRGB(dest, rgbDest); for (i = 0; i < 3; ++i) { rgbBlend[i] = rgbDest[i] + rgbSrc[i] - (2 * rgbDest[i] * rgbSrc[i]) / 255; } rgbToCMYK(rgbBlend, blend); } else #endif { for (i = 0; i < splashColorModeNComps[cm]; ++i) { blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255; } } } static int getLum(int r, int g, int b) { return (int)(0.3 * r + 0.59 * g + 0.11 * b); } static int getSat(int r, int g, int b) { int rgbMin, rgbMax; rgbMin = rgbMax = r; if (g < rgbMin) { rgbMin = g; } else if (g > rgbMax) { rgbMax = g; } if (b < rgbMin) { rgbMin = b; } else if (b > rgbMax) { rgbMax = b; } return rgbMax - rgbMin; } static void clipColor(int rIn, int gIn, int bIn, Guchar *rOut, Guchar *gOut, Guchar *bOut) { int lum, rgbMin, rgbMax; lum = getLum(rIn, gIn, bIn); rgbMin = rgbMax = rIn; if (gIn < rgbMin) { rgbMin = gIn; } else if (gIn > rgbMax) { rgbMax = gIn; } if (bIn < rgbMin) { rgbMin = bIn; } else if (bIn > rgbMax) { rgbMax = bIn; } if (rgbMin < 0) { *rOut = (Guchar)(lum + ((rIn - lum) * lum) / (lum - rgbMin)); *gOut = (Guchar)(lum + ((gIn - lum) * lum) / (lum - rgbMin)); *bOut = (Guchar)(lum + ((bIn - lum) * lum) / (lum - rgbMin)); } else if (rgbMax > 255) { *rOut = (Guchar)(lum + ((rIn - lum) * (255 - lum)) / (rgbMax - lum)); *gOut = (Guchar)(lum + ((gIn - lum) * (255 - lum)) / (rgbMax - lum)); *bOut = (Guchar)(lum + ((bIn - lum) * (255 - lum)) / (rgbMax - lum)); } else { *rOut = rIn; *gOut = gIn; *bOut = bIn; } } static void setLum(Guchar rIn, Guchar gIn, Guchar bIn, int lum, Guchar *rOut, Guchar *gOut, Guchar *bOut) { int d; d = lum - getLum(rIn, gIn, bIn); clipColor(rIn + d, gIn + d, bIn + d, rOut, gOut, bOut); } static void setSat(Guchar rIn, Guchar gIn, Guchar bIn, int sat, Guchar *rOut, Guchar *gOut, Guchar *bOut) { int rgbMin, rgbMid, rgbMax; Guchar *minOut, *midOut, *maxOut; if (rIn < gIn) { rgbMin = rIn; minOut = rOut; rgbMid = gIn; midOut = gOut; } else { rgbMin = gIn; minOut = gOut; rgbMid = rIn; midOut = rOut; } if (bIn > rgbMid) { rgbMax = bIn; maxOut = bOut; } else if (bIn > rgbMin) { rgbMax = rgbMid; maxOut = midOut; rgbMid = bIn; midOut = bOut; } else { rgbMax = rgbMid; maxOut = midOut; rgbMid = rgbMin; midOut = minOut; rgbMin = bIn; minOut = bOut; } if (rgbMax > rgbMin) { *midOut = (Guchar)((rgbMid - rgbMin) * sat) / (rgbMax - rgbMin); *maxOut = (Guchar)sat; } else { *midOut = *maxOut = 0; } *minOut = 0; } static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { Guchar r0, g0, b0; #ifdef SPLASH_CMYK Guchar r1, g1, b1; int i; SplashColor src2, dest2; #endif switch (cm) { case splashModeMono1: case splashModeMono8: blend[0] = dest[0]; break; case splashModeXBGR8: src[3] = 255; case splashModeRGB8: case splashModeBGR8: setSat(src[0], src[1], src[2], getSat(dest[0], dest[1], dest[2]), &r0, &g0, &b0); setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]), &blend[0], &blend[1], &blend[2]); break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: for (i = 0; i < 4; i++) { // convert to additive src2[i] = 0xff - src[i]; dest2[i] = 0xff - dest[i]; } // NB: inputs have already been converted to additive mode setSat(src2[0], src2[1], src2[2], getSat(dest2[0], dest2[1], dest2[2]), &r0, &g0, &b0); setLum(r0, g0, b0, getLum(dest2[0], dest2[1], dest2[2]), &r1, &g1, &b1); blend[0] = r1; blend[1] = g1; blend[2] = b1; blend[3] = dest2[3]; for (i = 0; i < 4; i++) { // convert back to subtractive blend[i] = 0xff - blend[i]; } break; #endif } } static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { Guchar r0, g0, b0; #ifdef SPLASH_CMYK Guchar r1, g1, b1; int i; SplashColor src2, dest2; #endif switch (cm) { case splashModeMono1: case splashModeMono8: blend[0] = dest[0]; break; case splashModeXBGR8: src[3] = 255; case splashModeRGB8: case splashModeBGR8: setSat(dest[0], dest[1], dest[2], getSat(src[0], src[1], src[2]), &r0, &g0, &b0); setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]), &blend[0], &blend[1], &blend[2]); break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: for (i = 0; i < 4; i++) { // convert to additive src2[i] = 0xff - src[i]; dest2[i] = 0xff - dest[i]; } setSat(dest2[0], dest2[1], dest2[2], getSat(src2[0], src2[1], src2[2]), &r0, &g0, &b0); setLum(r0, g0, b0, getLum(dest2[0], dest2[1], dest2[2]), &r1, &g1, &b1); blend[0] = r1; blend[1] = g1; blend[2] = b1; blend[3] = dest2[3]; for (i = 0; i < 4; i++) { // convert back to subtractive blend[i] = 0xff - blend[i]; } break; #endif } } static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { #if SPLASH_CMYK Guchar r, g, b; int i; SplashColor src2, dest2; #endif switch (cm) { case splashModeMono1: case splashModeMono8: blend[0] = dest[0]; break; case splashModeXBGR8: src[3] = 255; case splashModeRGB8: case splashModeBGR8: setLum(src[0], src[1], src[2], getLum(dest[0], dest[1], dest[2]), &blend[0], &blend[1], &blend[2]); break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: for (i = 0; i < 4; i++) { // convert to additive src2[i] = 0xff - src[i]; dest2[i] = 0xff - dest[i]; } setLum(src2[0], src2[1], src2[2], getLum(dest2[0], dest2[1], dest2[2]), &r, &g, &b); blend[0] = r; blend[1] = g; blend[2] = b; blend[3] = dest2[3]; for (i = 0; i < 4; i++) { // convert back to subtractive blend[i] = 0xff - blend[i]; } break; #endif } } static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { #if SPLASH_CMYK Guchar r, g, b; int i; SplashColor src2, dest2; #endif switch (cm) { case splashModeMono1: case splashModeMono8: blend[0] = dest[0]; break; case splashModeXBGR8: src[3] = 255; case splashModeRGB8: case splashModeBGR8: setLum(dest[0], dest[1], dest[2], getLum(src[0], src[1], src[2]), &blend[0], &blend[1], &blend[2]); break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: for (i = 0; i < 4; i++) { // convert to additive src2[i] = 0xff - src[i]; dest2[i] = 0xff - dest[i]; } setLum(dest2[0], dest2[1], dest2[2], getLum(src2[0], src2[1], src2[2]), &r, &g, &b); blend[0] = r; blend[1] = g; blend[2] = b; blend[3] = src2[3]; for (i = 0; i < 4; i++) { // convert back to subtractive blend[i] = 0xff - blend[i]; } break; #endif } } // NB: This must match the GfxBlendMode enum defined in GfxState.h. static const SplashBlendFunc splashOutBlendFuncs[] = { NULL, &splashOutBlendMultiply, &splashOutBlendScreen, &splashOutBlendOverlay, &splashOutBlendDarken, &splashOutBlendLighten, &splashOutBlendColorDodge, &splashOutBlendColorBurn, &splashOutBlendHardLight, &splashOutBlendSoftLight, &splashOutBlendDifference, &splashOutBlendExclusion, &splashOutBlendHue, &splashOutBlendSaturation, &splashOutBlendColor, &splashOutBlendLuminosity }; //------------------------------------------------------------------------ // SplashOutFontFileID //------------------------------------------------------------------------ class SplashOutFontFileID: public SplashFontFileID { public: SplashOutFontFileID(Ref *rA) { r = *rA; } ~SplashOutFontFileID() {} GBool matches(SplashFontFileID *id) { return ((SplashOutFontFileID *)id)->r.num == r.num && ((SplashOutFontFileID *)id)->r.gen == r.gen; } private: Ref r; }; //------------------------------------------------------------------------ // T3FontCache //------------------------------------------------------------------------ struct T3FontCacheTag { Gushort code; Gushort mru; // valid bit (0x8000) and MRU index }; class T3FontCache { public: T3FontCache(Ref *fontID, double m11A, double m12A, double m21A, double m22A, int glyphXA, int glyphYA, int glyphWA, int glyphHA, GBool aa, GBool validBBoxA); ~T3FontCache(); GBool matches(Ref *idA, double m11A, double m12A, double m21A, double m22A) { return fontID.num == idA->num && fontID.gen == idA->gen && m11 == m11A && m12 == m12A && m21 == m21A && m22 == m22A; } Ref fontID; // PDF font ID double m11, m12, m21, m22; // transform matrix int glyphX, glyphY; // pixel offset of glyph bitmaps int glyphW, glyphH; // size of glyph bitmaps, in pixels GBool validBBox; // false if the bbox was [0 0 0 0] int glyphSize; // size of glyph bitmaps, in bytes int cacheSets; // number of sets in cache int cacheAssoc; // cache associativity (glyphs per set) Guchar *cacheData; // glyph pixmap cache T3FontCacheTag *cacheTags; // cache tags, i.e., char codes }; T3FontCache::T3FontCache(Ref *fontIDA, double m11A, double m12A, double m21A, double m22A, int glyphXA, int glyphYA, int glyphWA, int glyphHA, GBool validBBoxA, GBool aa) { int i; fontID = *fontIDA; m11 = m11A; m12 = m12A; m21 = m21A; m22 = m22A; glyphX = glyphXA; glyphY = glyphYA; glyphW = glyphWA; glyphH = glyphHA; validBBox = validBBoxA; // sanity check for excessively large glyphs (which most likely // indicate an incorrect BBox) i = glyphW * glyphH; if (i > 100000 || glyphW > INT_MAX / glyphH || glyphW <= 0 || glyphH <= 0) { glyphW = glyphH = 100; validBBox = gFalse; } if (aa) { glyphSize = glyphW * glyphH; } else { glyphSize = ((glyphW + 7) >> 3) * glyphH; } cacheAssoc = type3FontCacheAssoc; for (cacheSets = type3FontCacheMaxSets; cacheSets > 1 && cacheSets * cacheAssoc * glyphSize > type3FontCacheSize; cacheSets >>= 1) ; if (glyphSize < 10485760 / cacheAssoc / cacheSets) { cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize); } else { error(errSyntaxWarning, -1, "Not creating cacheData for T3FontCache, it asked for too much memory.\n" " This could teoretically result in wrong rendering,\n" " but most probably the document is bogus.\n" " Please report a bug if you think the rendering may be wrong because of this."); cacheData = NULL; } if (cacheData != NULL) { cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc, sizeof(T3FontCacheTag)); for (i = 0; i < cacheSets * cacheAssoc; ++i) { cacheTags[i].mru = i & (cacheAssoc - 1); } } else { cacheTags = NULL; } } T3FontCache::~T3FontCache() { gfree(cacheData); gfree(cacheTags); } struct T3GlyphStack { Gushort code; // character code //----- cache info T3FontCache *cache; // font cache for the current font T3FontCacheTag *cacheTag; // pointer to cache tag for the glyph Guchar *cacheData; // pointer to cache data for the glyph //----- saved state SplashBitmap *origBitmap; Splash *origSplash; double origCTM4, origCTM5; T3GlyphStack *next; // next object on stack }; //------------------------------------------------------------------------ // SplashTransparencyGroup //------------------------------------------------------------------------ struct SplashTransparencyGroup { int tx, ty; // translation coordinates SplashBitmap *tBitmap; // bitmap for transparency group GfxColorSpace *blendingColorSpace; GBool isolated; //----- for knockout SplashBitmap *shape; GBool knockout; SplashCoord knockoutOpacity; GBool fontAA; //----- saved state SplashBitmap *origBitmap; Splash *origSplash; SplashTransparencyGroup *next; }; //------------------------------------------------------------------------ // SplashOutputDev //------------------------------------------------------------------------ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA, int bitmapRowPadA, GBool reverseVideoA, SplashColorPtr paperColorA, GBool bitmapTopDownA, GBool allowAntialiasA, SplashThinLineMode thinLineMode, GBool overprintPreviewA) { colorMode = colorModeA; bitmapRowPad = bitmapRowPadA; bitmapTopDown = bitmapTopDownA; bitmapUpsideDown = gFalse; allowAntialias = allowAntialiasA; vectorAntialias = allowAntialias && globalParams->getVectorAntialias() && colorMode != splashModeMono1; overprintPreview = overprintPreviewA; enableFreeTypeHinting = gFalse; enableSlightHinting = gFalse; setupScreenParams(72.0, 72.0); reverseVideo = reverseVideoA; if (paperColorA != NULL) { splashColorCopy(paperColor, paperColorA); } else { splashClearColor(paperColor); } skipHorizText = gFalse; skipRotatedText = gFalse; keepAlphaChannel = paperColorA == NULL; doc = NULL; bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode, colorMode != splashModeMono1, bitmapTopDown); splash = new Splash(bitmap, vectorAntialias, &screenParams); splash->setMinLineWidth(globalParams->getMinLineWidth()); splash->setThinLineMode(thinLineMode); splash->clear(paperColor, 0); fontEngine = NULL; nT3Fonts = 0; t3GlyphStack = NULL; font = NULL; needFontUpdate = gFalse; textClipPath = NULL; transpGroupStack = NULL; nestCount = 0; xref = NULL; } void SplashOutputDev::setupScreenParams(double hDPI, double vDPI) { screenParams.size = globalParams->getScreenSize(); screenParams.dotRadius = globalParams->getScreenDotRadius(); screenParams.gamma = (SplashCoord)globalParams->getScreenGamma(); screenParams.blackThreshold = (SplashCoord)globalParams->getScreenBlackThreshold(); screenParams.whiteThreshold = (SplashCoord)globalParams->getScreenWhiteThreshold(); switch (globalParams->getScreenType()) { case screenDispersed: screenParams.type = splashScreenDispersed; if (screenParams.size < 0) { screenParams.size = 4; } break; case screenClustered: screenParams.type = splashScreenClustered; if (screenParams.size < 0) { screenParams.size = 10; } break; case screenStochasticClustered: screenParams.type = splashScreenStochasticClustered; if (screenParams.size < 0) { screenParams.size = 64; } if (screenParams.dotRadius < 0) { screenParams.dotRadius = 2; } break; case screenUnset: default: // use clustered dithering for resolution >= 300 dpi // (compare to 299.9 to avoid floating point issues) if (hDPI > 299.9 && vDPI > 299.9) { screenParams.type = splashScreenStochasticClustered; if (screenParams.size < 0) { screenParams.size = 64; } if (screenParams.dotRadius < 0) { screenParams.dotRadius = 2; } } else { screenParams.type = splashScreenDispersed; if (screenParams.size < 0) { screenParams.size = 4; } } } } SplashOutputDev::~SplashOutputDev() { int i; for (i = 0; i < nT3Fonts; ++i) { delete t3FontCache[i]; } if (fontEngine) { delete fontEngine; } if (splash) { delete splash; } if (bitmap) { delete bitmap; } } void SplashOutputDev::startDoc(PDFDoc *docA) { int i; doc = docA; if (fontEngine) { delete fontEngine; } fontEngine = new SplashFontEngine( #if HAVE_T1LIB_H globalParams->getEnableT1lib(), #endif #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H globalParams->getEnableFreeType(), enableFreeTypeHinting, enableSlightHinting, #endif allowAntialias && globalParams->getAntialias() && colorMode != splashModeMono1); for (i = 0; i < nT3Fonts; ++i) { delete t3FontCache[i]; } nT3Fonts = 0; } void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) { int w, h; double *ctm; SplashCoord mat[6]; SplashColor color; xref = xrefA; if (state) { setupScreenParams(state->getHDPI(), state->getVDPI()); w = (int)(state->getPageWidth() + 0.5); if (w <= 0) { w = 1; } h = (int)(state->getPageHeight() + 0.5); if (h <= 0) { h = 1; } } else { w = h = 1; } SplashThinLineMode thinLineMode = splashThinLineDefault; if (splash) { thinLineMode = splash->getThinLineMode(); delete splash; splash = NULL; } if (!bitmap || w != bitmap->getWidth() || h != bitmap->getHeight()) { if (bitmap) { delete bitmap; bitmap = NULL; } bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, colorMode != splashModeMono1, bitmapTopDown); if (!bitmap->getDataPtr()) { delete bitmap; w = h = 1; bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, colorMode != splashModeMono1, bitmapTopDown); } } splash = new Splash(bitmap, vectorAntialias, &screenParams); splash->setThinLineMode(thinLineMode); splash->setMinLineWidth(globalParams->getMinLineWidth()); if (state) { ctm = state->getCTM(); mat[0] = (SplashCoord)ctm[0]; mat[1] = (SplashCoord)ctm[1]; mat[2] = (SplashCoord)ctm[2]; mat[3] = (SplashCoord)ctm[3]; mat[4] = (SplashCoord)ctm[4]; mat[5] = (SplashCoord)ctm[5]; splash->setMatrix(mat); } switch (colorMode) { case splashModeMono1: case splashModeMono8: color[0] = 0; break; case splashModeXBGR8: color[3] = 255; case splashModeRGB8: case splashModeBGR8: color[0] = color[1] = color[2] = 0; break; #if SPLASH_CMYK case splashModeCMYK8: color[0] = color[1] = color[2] = color[3] = 0; break; case splashModeDeviceN8: for (int i = 0; i < 4 + SPOT_NCOMPS; i++) color[i] = 0; break; #endif } splash->setStrokePattern(new SplashSolidColor(color)); splash->setFillPattern(new SplashSolidColor(color)); splash->setLineCap(splashLineCapButt); splash->setLineJoin(splashLineJoinMiter); splash->setLineDash(NULL, 0, 0); splash->setMiterLimit(10); splash->setFlatness(1); // the SA parameter supposedly defaults to false, but Acrobat // apparently hardwires it to true splash->setStrokeAdjust(globalParams->getStrokeAdjust()); splash->clear(paperColor, 0); } void SplashOutputDev::endPage() { if (colorMode != splashModeMono1 && !keepAlphaChannel) { splash->compositeBackground(paperColor); } } void SplashOutputDev::saveState(GfxState *state) { splash->saveState(); } void SplashOutputDev::restoreState(GfxState *state) { splash->restoreState(); needFontUpdate = gTrue; } void SplashOutputDev::updateAll(GfxState *state) { updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateLineWidth(state); updateFlatness(state); updateMiterLimit(state); updateStrokeAdjust(state); updateFillColorSpace(state); updateFillColor(state); updateStrokeColorSpace(state); updateStrokeColor(state); needFontUpdate = gTrue; } void SplashOutputDev::updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32) { double *ctm; SplashCoord mat[6]; ctm = state->getCTM(); mat[0] = (SplashCoord)ctm[0]; mat[1] = (SplashCoord)ctm[1]; mat[2] = (SplashCoord)ctm[2]; mat[3] = (SplashCoord)ctm[3]; mat[4] = (SplashCoord)ctm[4]; mat[5] = (SplashCoord)ctm[5]; splash->setMatrix(mat); } void SplashOutputDev::updateLineDash(GfxState *state) { double *dashPattern; int dashLength; double dashStart; SplashCoord dash[20]; int i; state->getLineDash(&dashPattern, &dashLength, &dashStart); if (dashLength > 20) { dashLength = 20; } for (i = 0; i < dashLength; ++i) { dash[i] = (SplashCoord)dashPattern[i]; if (dash[i] < 0) { dash[i] = 0; } } splash->setLineDash(dash, dashLength, (SplashCoord)dashStart); } void SplashOutputDev::updateFlatness(GfxState *state) { #if 0 // Acrobat ignores the flatness setting, and always renders curves // with a fairly small flatness value splash->setFlatness(state->getFlatness()); #endif } void SplashOutputDev::updateLineJoin(GfxState *state) { splash->setLineJoin(state->getLineJoin()); } void SplashOutputDev::updateLineCap(GfxState *state) { splash->setLineCap(state->getLineCap()); } void SplashOutputDev::updateMiterLimit(GfxState *state) { splash->setMiterLimit(state->getMiterLimit()); } void SplashOutputDev::updateLineWidth(GfxState *state) { splash->setLineWidth(state->getLineWidth()); } void SplashOutputDev::updateStrokeAdjust(GfxState * /*state*/) { #if 0 // the SA parameter supposedly defaults to false, but Acrobat // apparently hardwires it to true splash->setStrokeAdjust(state->getStrokeAdjust()); #endif } void SplashOutputDev::updateFillColorSpace(GfxState *state) { #if SPLASH_CMYK if (colorMode == splashModeDeviceN8) state->getFillColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif } void SplashOutputDev::updateStrokeColorSpace(GfxState *state) { #if SPLASH_CMYK if (colorMode == splashModeDeviceN8) state->getStrokeColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif } void SplashOutputDev::updateFillColor(GfxState *state) { GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif switch (colorMode) { case splashModeMono1: case splashModeMono8: state->getFillGray(&gray); splash->setFillPattern(getColor(gray)); break; case splashModeXBGR8: case splashModeRGB8: case splashModeBGR8: state->getFillRGB(&rgb); splash->setFillPattern(getColor(&rgb)); break; #if SPLASH_CMYK case splashModeCMYK8: state->getFillCMYK(&cmyk); splash->setFillPattern(getColor(&cmyk)); break; case splashModeDeviceN8: state->getFillDeviceN(&deviceN); splash->setFillPattern(getColor(&deviceN)); break; #endif } } void SplashOutputDev::updateStrokeColor(GfxState *state) { GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif switch (colorMode) { case splashModeMono1: case splashModeMono8: state->getStrokeGray(&gray); splash->setStrokePattern(getColor(gray)); break; case splashModeXBGR8: case splashModeRGB8: case splashModeBGR8: state->getStrokeRGB(&rgb); splash->setStrokePattern(getColor(&rgb)); break; #if SPLASH_CMYK case splashModeCMYK8: state->getStrokeCMYK(&cmyk); splash->setStrokePattern(getColor(&cmyk)); break; case splashModeDeviceN8: state->getStrokeDeviceN(&deviceN); splash->setStrokePattern(getColor(&deviceN)); break; #endif } } SplashPattern *SplashOutputDev::getColor(GfxGray gray) { SplashColor color; if (reverseVideo) { gray = gfxColorComp1 - gray; } color[0] = colToByte(gray); return new SplashSolidColor(color); } SplashPattern *SplashOutputDev::getColor(GfxRGB *rgb) { GfxColorComp r, g, b; SplashColor color; if (reverseVideo) { r = gfxColorComp1 - rgb->r; g = gfxColorComp1 - rgb->g; b = gfxColorComp1 - rgb->b; } else { r = rgb->r; g = rgb->g; b = rgb->b; } color[0] = colToByte(r); color[1] = colToByte(g); color[2] = colToByte(b); if (colorMode == splashModeXBGR8) color[3] = 255; return new SplashSolidColor(color); } #if SPLASH_CMYK SplashPattern *SplashOutputDev::getColor(GfxCMYK *cmyk) { SplashColor color; color[0] = colToByte(cmyk->c); color[1] = colToByte(cmyk->m); color[2] = colToByte(cmyk->y); color[3] = colToByte(cmyk->k); return new SplashSolidColor(color); } SplashPattern *SplashOutputDev::getColor(GfxColor *deviceN) { SplashColor color; for (int i = 0; i < 4 + SPOT_NCOMPS; i++) color[i] = colToByte(deviceN->c[i]); return new SplashSolidColor(color); } #endif void SplashOutputDev::setOverprintMask(GfxColorSpace *colorSpace, GBool overprintFlag, int overprintMode, GfxColor *singleColor, GBool grayIndexed) { #if SPLASH_CMYK Guint mask; GfxCMYK cmyk; GBool additive = gFalse; int i; if (colorSpace->getMode() == csIndexed) { setOverprintMask(((GfxIndexedColorSpace *)colorSpace)->getBase(), overprintFlag, overprintMode, singleColor, grayIndexed); return; } if (overprintFlag && overprintPreview) { mask = colorSpace->getOverprintMask(); if (singleColor && overprintMode && colorSpace->getMode() == csDeviceCMYK) { colorSpace->getCMYK(singleColor, &cmyk); if (cmyk.c == 0) { mask &= ~1; } if (cmyk.m == 0) { mask &= ~2; } if (cmyk.y == 0) { mask &= ~4; } if (cmyk.k == 0) { mask &= ~8; } } if (grayIndexed) { mask &= ~7; } else if (colorSpace->getMode() == csSeparation) { GfxSeparationColorSpace *deviceSep = (GfxSeparationColorSpace *)colorSpace; additive = deviceSep->getName()->cmp("All") != 0 && mask == 0x0f && !deviceSep->isNonMarking(); } else if (colorSpace->getMode() == csDeviceN) { GfxDeviceNColorSpace *deviceNCS = (GfxDeviceNColorSpace *)colorSpace; additive = mask == 0x0f && !deviceNCS->isNonMarking(); for (i = 0; i < deviceNCS->getNComps() && additive; i++) { if (deviceNCS->getColorantName(i)->cmp("Cyan") == 0) { additive = gFalse; } else if (deviceNCS->getColorantName(i)->cmp("Magenta") == 0) { additive = gFalse; } else if (deviceNCS->getColorantName(i)->cmp("Yellow") == 0) { additive = gFalse; } else if (deviceNCS->getColorantName(i)->cmp("Black") == 0) { additive = gFalse; } } } } else { mask = 0xffffffff; } splash->setOverprintMask(mask, additive); #endif } void SplashOutputDev::updateBlendMode(GfxState *state) { splash->setBlendFunc(splashOutBlendFuncs[state->getBlendMode()]); } void SplashOutputDev::updateFillOpacity(GfxState *state) { splash->setFillAlpha((SplashCoord)state->getFillOpacity()); if (transpGroupStack != NULL && (SplashCoord)state->getFillOpacity() < transpGroupStack->knockoutOpacity) { transpGroupStack->knockoutOpacity = (SplashCoord)state->getFillOpacity(); } } void SplashOutputDev::updateStrokeOpacity(GfxState *state) { splash->setStrokeAlpha((SplashCoord)state->getStrokeOpacity()); if (transpGroupStack != NULL && (SplashCoord)state->getStrokeOpacity() < transpGroupStack->knockoutOpacity) { transpGroupStack->knockoutOpacity = (SplashCoord)state->getStrokeOpacity(); } } void SplashOutputDev::updateFillOverprint(GfxState *state) { splash->setFillOverprint(state->getFillOverprint()); } void SplashOutputDev::updateStrokeOverprint(GfxState *state) { splash->setStrokeOverprint(state->getStrokeOverprint()); } void SplashOutputDev::updateOverprintMode(GfxState *state) { splash->setOverprintMode(state->getOverprintMode()); } void SplashOutputDev::updateTransfer(GfxState *state) { Function **transfer; Guchar red[256], green[256], blue[256], gray[256]; double x, y; int i; transfer = state->getTransfer(); if (transfer[0] && transfer[0]->getInputSize() == 1 && transfer[0]->getOutputSize() == 1) { if (transfer[1] && transfer[1]->getInputSize() == 1 && transfer[1]->getOutputSize() == 1 && transfer[2] && transfer[2]->getInputSize() == 1 && transfer[2]->getOutputSize() == 1 && transfer[3] && transfer[3]->getInputSize() == 1 && transfer[3]->getOutputSize() == 1) { for (i = 0; i < 256; ++i) { x = i / 255.0; transfer[0]->transform(&x, &y); red[i] = (Guchar)(y * 255.0 + 0.5); transfer[1]->transform(&x, &y); green[i] = (Guchar)(y * 255.0 + 0.5); transfer[2]->transform(&x, &y); blue[i] = (Guchar)(y * 255.0 + 0.5); transfer[3]->transform(&x, &y); gray[i] = (Guchar)(y * 255.0 + 0.5); } } else { for (i = 0; i < 256; ++i) { x = i / 255.0; transfer[0]->transform(&x, &y); red[i] = green[i] = blue[i] = gray[i] = (Guchar)(y * 255.0 + 0.5); } } } else { for (i = 0; i < 256; ++i) { red[i] = green[i] = blue[i] = gray[i] = (Guchar)i; } } splash->setTransfer(red, green, blue, gray); } void SplashOutputDev::updateFont(GfxState * /*state*/) { needFontUpdate = gTrue; } void SplashOutputDev::doUpdateFont(GfxState *state) { GfxFont *gfxFont; GfxFontLoc *fontLoc; GfxFontType fontType; SplashOutFontFileID *id; SplashFontFile *fontFile; SplashFontSrc *fontsrc = NULL; FoFiTrueType *ff; Object refObj, strObj; GooString *fileName; char *tmpBuf; int tmpBufLen; int *codeToGID; double *textMat; double m11, m12, m21, m22, fontSize; int faceIndex = 0; SplashCoord mat[4]; int n, i; GBool recreateFont = gFalse; GBool doAdjustFontMatrix = gFalse; needFontUpdate = gFalse; font = NULL; fileName = NULL; tmpBuf = NULL; fontLoc = NULL; if (!(gfxFont = state->getFont())) { goto err1; } fontType = gfxFont->getType(); if (fontType == fontType3) { goto err1; } // sanity-check the font size - skip anything larger than 10 inches // (this avoids problems allocating memory for the font cache) if (state->getTransformedFontSize() > 10 * (state->getHDPI() + state->getVDPI())) { goto err1; } // check the font file cache id = new SplashOutFontFileID(gfxFont->getID()); if ((fontFile = fontEngine->getFontFile(id))) { delete id; } else { if (!(fontLoc = gfxFont->locateFont((xref) ? xref : doc->getXRef(), gFalse))) { error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } // embedded font if (fontLoc->locType == gfxFontLocEmbedded) { // if there is an embedded font, read it to memory tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : doc->getXRef(), &tmpBufLen); if (! tmpBuf) goto err2; // external font } else { // gfxFontLocExternal fileName = fontLoc->path; fontType = fontLoc->fontType; doAdjustFontMatrix = gTrue; } fontsrc = new SplashFontSrc; if (fileName) fontsrc->setFile(fileName, gFalse); else fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue); // load the font file switch (fontType) { case fontType1: if (!(fontFile = fontEngine->loadType1Font( id, fontsrc, (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontType1C: if (!(fontFile = fontEngine->loadType1CFont( id, fontsrc, (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontType1COT: if (!(fontFile = fontEngine->loadOpenTypeT1CFont( id, fontsrc, (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontTrueType: case fontTrueTypeOT: if (fileName) ff = FoFiTrueType::load(fileName->getCString()); else ff = FoFiTrueType::make(tmpBuf, tmpBufLen); if (ff) { codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); n = 256; delete ff; // if we're substituting for a non-TrueType font, we need to mark // all notdef codes as "do not draw" (rather than drawing TrueType // notdef glyphs) if (gfxFont->getType() != fontTrueType && gfxFont->getType() != fontTrueTypeOT) { for (i = 0; i < 256; ++i) { if (codeToGID[i] == 0) { codeToGID[i] = -1; } } } } else { codeToGID = NULL; n = 0; } if (!(fontFile = fontEngine->loadTrueTypeFont( id, fontsrc, codeToGID, n))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontCIDType0: case fontCIDType0C: if (!(fontFile = fontEngine->loadCIDFont( id, fontsrc))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontCIDType0COT: if (((GfxCIDFont *)gfxFont)->getCIDToGID()) { n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen(); codeToGID = (int *)gmallocn(n, sizeof(int)); memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(int)); } else { codeToGID = NULL; n = 0; } if (!(fontFile = fontEngine->loadOpenTypeCFFFont( id, fontsrc, codeToGID, n))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; case fontCIDType2: case fontCIDType2OT: codeToGID = NULL; n = 0; if (((GfxCIDFont *)gfxFont)->getCIDToGID()) { n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen(); if (n) { codeToGID = (int *)gmallocn(n, sizeof(int)); memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(int)); } } else { if (fileName) ff = FoFiTrueType::load(fileName->getCString()); else ff = FoFiTrueType::make(tmpBuf, tmpBufLen); if (! ff) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n); delete ff; } if (!(fontFile = fontEngine->loadTrueTypeFont( id, fontsrc, codeToGID, n, faceIndex))) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); goto err2; } break; default: // this shouldn't happen goto err2; } fontFile->doAdjustMatrix = doAdjustFontMatrix; } // get the font matrix textMat = state->getTextMat(); fontSize = state->getFontSize(); m11 = textMat[0] * fontSize * state->getHorizScaling(); m12 = textMat[1] * fontSize * state->getHorizScaling(); m21 = textMat[2] * fontSize; m22 = textMat[3] * fontSize; // create the scaled font mat[0] = m11; mat[1] = m12; mat[2] = m21; mat[3] = m22; font = fontEngine->getFont(fontFile, mat, splash->getMatrix()); // for substituted fonts: adjust the font matrix -- compare the // width of 'm' in the original font and the substituted font if (fontFile->doAdjustMatrix && !gfxFont->isCIDFont()) { double w1, w2; CharCode code; char *name; for (code = 0; code < 256; ++code) { if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) && name[0] == 'm' && name[1] == '\0') { break; } } if (code < 256) { w1 = ((Gfx8BitFont *)gfxFont)->getWidth(code); w2 = font->getGlyphAdvance(code); if (!gfxFont->isSymbolic() && w2 > 0) { // if real font is substantially narrower than substituted // font, reduce the font size accordingly if (w1 > 0.01 && w1 < 0.9 * w2) { w1 /= w2; m11 *= w1; m21 *= w1; recreateFont = gTrue; } } } } if (recreateFont) { mat[0] = m11; mat[1] = m12; mat[2] = m21; mat[3] = m22; font = fontEngine->getFont(fontFile, mat, splash->getMatrix()); } delete fontLoc; if (fontsrc && !fontsrc->isFile) fontsrc->unref(); return; err2: delete id; delete fontLoc; err1: if (fontsrc && !fontsrc->isFile) fontsrc->unref(); return; } void SplashOutputDev::stroke(GfxState *state) { SplashPath *path; if (state->getStrokeColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getStrokeColorSpace(), state->getStrokeOverprint(), state->getOverprintMode(), state->getStrokeColor()); path = convertPath(state, state->getPath(), gFalse); splash->stroke(path); delete path; } void SplashOutputDev::fill(GfxState *state) { SplashPath *path; if (state->getFillColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); path = convertPath(state, state->getPath(), gTrue); splash->fill(path, gFalse); delete path; } void SplashOutputDev::eoFill(GfxState *state) { SplashPath *path; if (state->getFillColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); path = convertPath(state, state->getPath(), gTrue); splash->fill(path, gTrue); delete path; } void SplashOutputDev::clip(GfxState *state) { SplashPath *path; path = convertPath(state, state->getPath(), gTrue); splash->clipToPath(path, gFalse); delete path; } void SplashOutputDev::eoClip(GfxState *state) { SplashPath *path; path = convertPath(state, state->getPath(), gTrue); splash->clipToPath(path, gTrue); delete path; } void SplashOutputDev::clipToStrokePath(GfxState *state) { SplashPath *path, *path2; path = convertPath(state, state->getPath(), gFalse); path2 = splash->makeStrokePath(path, state->getLineWidth()); delete path; splash->clipToPath(path2, gFalse); delete path2; } SplashPath *SplashOutputDev::convertPath(GfxState *state, GfxPath *path, GBool dropEmptySubpaths) { SplashPath *sPath; GfxSubpath *subpath; int n, i, j; n = dropEmptySubpaths ? 1 : 0; sPath = new SplashPath(); for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); if (subpath->getNumPoints() > n) { sPath->moveTo((SplashCoord)subpath->getX(0), (SplashCoord)subpath->getY(0)); j = 1; while (j < subpath->getNumPoints()) { if (subpath->getCurve(j)) { sPath->curveTo((SplashCoord)subpath->getX(j), (SplashCoord)subpath->getY(j), (SplashCoord)subpath->getX(j+1), (SplashCoord)subpath->getY(j+1), (SplashCoord)subpath->getX(j+2), (SplashCoord)subpath->getY(j+2)); j += 3; } else { sPath->lineTo((SplashCoord)subpath->getX(j), (SplashCoord)subpath->getY(j)); ++j; } } if (subpath->isClosed()) { sPath->close(); } } } return sPath; } void SplashOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen) { SplashPath *path; int render; GBool doFill, doStroke, doClip, strokeAdjust; double m[4]; GBool horiz; if (skipHorizText || skipRotatedText) { state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]); horiz = m[0] > 0 && fabs(m[1]) < 0.001 && fabs(m[2]) < 0.001 && m[3] < 0; if ((skipHorizText && horiz) || (skipRotatedText && !horiz)) { return; } } // check for invisible text -- this is used by Acrobat Capture render = state->getRender(); if (render == 3) { return; } if (needFontUpdate) { doUpdateFont(state); } if (!font) { return; } x -= originX; y -= originY; doFill = !(render & 1) && !state->getFillColorSpace()->isNonMarking(); doStroke = ((render & 3) == 1 || (render & 3) == 2) && !state->getStrokeColorSpace()->isNonMarking(); doClip = render & 4; path = NULL; if (doStroke || doClip) { if ((path = font->getGlyphPath(code))) { path->offset((SplashCoord)x, (SplashCoord)y); } } // don't use stroke adjustment when stroking text -- the results // tend to be ugly (because characters with horizontal upper or // lower edges get misaligned relative to the other characters) strokeAdjust = gFalse; // make gcc happy if (doStroke) { strokeAdjust = splash->getStrokeAdjust(); splash->setStrokeAdjust(gFalse); } // fill and stroke if (doFill && doStroke) { if (path) { setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); splash->fill(path, gFalse); setOverprintMask(state->getStrokeColorSpace(), state->getStrokeOverprint(), state->getOverprintMode(), state->getStrokeColor()); splash->stroke(path); } // fill } else if (doFill) { setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); splash->fillChar((SplashCoord)x, (SplashCoord)y, code, font); // stroke } else if (doStroke) { if (path) { setOverprintMask(state->getStrokeColorSpace(), state->getStrokeOverprint(), state->getOverprintMode(), state->getStrokeColor()); splash->stroke(path); } } // clip if (doClip) { if (path) { if (textClipPath) { textClipPath->append(path); } else { textClipPath = path; path = NULL; } } } if (doStroke) { splash->setStrokeAdjust(strokeAdjust); } if (path) { delete path; } } GBool SplashOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) { GfxFont *gfxFont; Ref *fontID; double *ctm, *bbox; T3FontCache *t3Font; T3GlyphStack *t3gs; GBool validBBox; double m[4]; GBool horiz; double x1, y1, xMin, yMin, xMax, yMax, xt, yt; int i, j; if (skipHorizText || skipRotatedText) { state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]); horiz = m[0] > 0 && fabs(m[1]) < 0.001 && fabs(m[2]) < 0.001 && m[3] < 0; if ((skipHorizText && horiz) || (skipRotatedText && !horiz)) { return gTrue; } } if (!(gfxFont = state->getFont())) { return gFalse; } fontID = gfxFont->getID(); ctm = state->getCTM(); state->transform(0, 0, &xt, &yt); // is it the first (MRU) font in the cache? if (!(nT3Fonts > 0 && t3FontCache[0]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3]))) { // is the font elsewhere in the cache? for (i = 1; i < nT3Fonts; ++i) { if (t3FontCache[i]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3])) { t3Font = t3FontCache[i]; for (j = i; j > 0; --j) { t3FontCache[j] = t3FontCache[j - 1]; } t3FontCache[0] = t3Font; break; } } if (i >= nT3Fonts) { // create new entry in the font cache if (nT3Fonts == splashOutT3FontCacheSize) { t3gs = t3GlyphStack; while (t3gs != NULL) { if (t3gs->cache == t3FontCache[nT3Fonts - 1]) { error(errSyntaxWarning, -1, "t3FontCache reaches limit but font still on stack in SplashOutputDev::beginType3Char"); return gTrue; } t3gs = t3gs->next; } delete t3FontCache[nT3Fonts - 1]; --nT3Fonts; } for (j = nT3Fonts; j > 0; --j) { t3FontCache[j] = t3FontCache[j - 1]; } ++nT3Fonts; bbox = gfxFont->getFontBBox(); if (bbox[0] == 0 && bbox[1] == 0 && bbox[2] == 0 && bbox[3] == 0) { // unspecified bounding box -- just take a guess xMin = xt - 5; xMax = xMin + 30; yMax = yt + 15; yMin = yMax - 45; validBBox = gFalse; } else { state->transform(bbox[0], bbox[1], &x1, &y1); xMin = xMax = x1; yMin = yMax = y1; state->transform(bbox[0], bbox[3], &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } state->transform(bbox[2], bbox[1], &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } state->transform(bbox[2], bbox[3], &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } validBBox = gTrue; } t3FontCache[0] = new T3FontCache(fontID, ctm[0], ctm[1], ctm[2], ctm[3], (int)floor(xMin - xt) - 2, (int)floor(yMin - yt) - 2, (int)ceil(xMax) - (int)floor(xMin) + 4, (int)ceil(yMax) - (int)floor(yMin) + 4, validBBox, colorMode != splashModeMono1); } } t3Font = t3FontCache[0]; // is the glyph in the cache? i = (code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc; for (j = 0; j < t3Font->cacheAssoc; ++j) { if (t3Font->cacheTags != NULL) { if ((t3Font->cacheTags[i+j].mru & 0x8000) && t3Font->cacheTags[i+j].code == code) { drawType3Glyph(state, t3Font, &t3Font->cacheTags[i+j], t3Font->cacheData + (i+j) * t3Font->glyphSize); return gTrue; } } } // push a new Type 3 glyph record t3gs = new T3GlyphStack(); t3gs->next = t3GlyphStack; t3GlyphStack = t3gs; t3GlyphStack->code = code; t3GlyphStack->cache = t3Font; t3GlyphStack->cacheTag = NULL; t3GlyphStack->cacheData = NULL; haveT3Dx = gFalse; return gFalse; } void SplashOutputDev::endType3Char(GfxState *state) { T3GlyphStack *t3gs; double *ctm; if (t3GlyphStack->cacheTag) { --nestCount; memcpy(t3GlyphStack->cacheData, bitmap->getDataPtr(), t3GlyphStack->cache->glyphSize); delete bitmap; delete splash; bitmap = t3GlyphStack->origBitmap; splash = t3GlyphStack->origSplash; ctm = state->getCTM(); state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3], t3GlyphStack->origCTM4, t3GlyphStack->origCTM5); updateCTM(state, 0, 0, 0, 0, 0, 0); drawType3Glyph(state, t3GlyphStack->cache, t3GlyphStack->cacheTag, t3GlyphStack->cacheData); } t3gs = t3GlyphStack; t3GlyphStack = t3gs->next; delete t3gs; } void SplashOutputDev::type3D0(GfxState *state, double wx, double wy) { haveT3Dx = gTrue; } void SplashOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { double *ctm; T3FontCache *t3Font; SplashColor color; double xt, yt, xMin, xMax, yMin, yMax, x1, y1; int i, j; // ignore multiple d0/d1 operators if (haveT3Dx) { return; } haveT3Dx = gTrue; if (unlikely(t3GlyphStack == NULL)) { error(errSyntaxWarning, -1, "t3GlyphStack was null in SplashOutputDev::type3D1"); return; } if (unlikely(t3GlyphStack->origBitmap != NULL)) { error(errSyntaxWarning, -1, "t3GlyphStack origBitmap was not null in SplashOutputDev::type3D1"); return; } if (unlikely(t3GlyphStack->origSplash != NULL)) { error(errSyntaxWarning, -1, "t3GlyphStack origSplash was not null in SplashOutputDev::type3D1"); return; } t3Font = t3GlyphStack->cache; // check for a valid bbox state->transform(0, 0, &xt, &yt); state->transform(llx, lly, &x1, &y1); xMin = xMax = x1; yMin = yMax = y1; state->transform(llx, ury, &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } state->transform(urx, lly, &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } state->transform(urx, ury, &x1, &y1); if (x1 < xMin) { xMin = x1; } else if (x1 > xMax) { xMax = x1; } if (y1 < yMin) { yMin = y1; } else if (y1 > yMax) { yMax = y1; } if (xMin - xt < t3Font->glyphX || yMin - yt < t3Font->glyphY || xMax - xt > t3Font->glyphX + t3Font->glyphW || yMax - yt > t3Font->glyphY + t3Font->glyphH) { if (t3Font->validBBox) { error(errSyntaxWarning, -1, "Bad bounding box in Type 3 glyph"); } return; } if (t3Font->cacheTags == NULL) return; // allocate a cache entry i = (t3GlyphStack->code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc; for (j = 0; j < t3Font->cacheAssoc; ++j) { if ((t3Font->cacheTags[i+j].mru & 0x7fff) == t3Font->cacheAssoc - 1) { t3Font->cacheTags[i+j].mru = 0x8000; t3Font->cacheTags[i+j].code = t3GlyphStack->code; t3GlyphStack->cacheTag = &t3Font->cacheTags[i+j]; t3GlyphStack->cacheData = t3Font->cacheData + (i+j) * t3Font->glyphSize; } else { ++t3Font->cacheTags[i+j].mru; } } // save state t3GlyphStack->origBitmap = bitmap; t3GlyphStack->origSplash = splash; ctm = state->getCTM(); t3GlyphStack->origCTM4 = ctm[4]; t3GlyphStack->origCTM5 = ctm[5]; // create the temporary bitmap if (colorMode == splashModeMono1) { bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1, splashModeMono1, gFalse); splash = new Splash(bitmap, gFalse, t3GlyphStack->origSplash->getScreen()); color[0] = 0; splash->clear(color); color[0] = 0xff; } else { bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1, splashModeMono8, gFalse); splash = new Splash(bitmap, vectorAntialias, t3GlyphStack->origSplash->getScreen()); color[0] = 0x00; splash->clear(color); color[0] = 0xff; } splash->setMinLineWidth(globalParams->getMinLineWidth()); splash->setThinLineMode(splashThinLineDefault); splash->setFillPattern(new SplashSolidColor(color)); splash->setStrokePattern(new SplashSolidColor(color)); //~ this should copy other state from t3GlyphStack->origSplash? state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3], -t3Font->glyphX, -t3Font->glyphY); updateCTM(state, 0, 0, 0, 0, 0, 0); ++nestCount; } void SplashOutputDev::drawType3Glyph(GfxState *state, T3FontCache *t3Font, T3FontCacheTag * /*tag*/, Guchar *data) { SplashGlyphBitmap glyph; setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); glyph.x = -t3Font->glyphX; glyph.y = -t3Font->glyphY; glyph.w = t3Font->glyphW; glyph.h = t3Font->glyphH; glyph.aa = colorMode != splashModeMono1; glyph.data = data; glyph.freeData = gFalse; splash->fillGlyph(0, 0, &glyph); } void SplashOutputDev::beginTextObject(GfxState *state) { } void SplashOutputDev::endTextObject(GfxState *state) { if (textClipPath) { splash->clipToPath(textClipPath, gFalse); delete textClipPath; textClipPath = NULL; } } struct SplashOutImageMaskData { ImageStream *imgStr; GBool invert; int width, height, y; }; GBool SplashOutputDev::imageMaskSrc(void *data, SplashColorPtr line) { SplashOutImageMaskData *imgMaskData = (SplashOutImageMaskData *)data; Guchar *p; SplashColorPtr q; int x; if (imgMaskData->y == imgMaskData->height) { return gFalse; } if (!(p = imgMaskData->imgStr->getLine())) { return gFalse; } for (x = 0, q = line; x < imgMaskData->width; ++x) { *q++ = *p++ ^ imgMaskData->invert; } ++imgMaskData->y; return gTrue; } void SplashOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) { double *ctm; SplashCoord mat[6]; SplashOutImageMaskData imgMaskData; if (state->getFillColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); ctm = state->getCTM(); for (int i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) return; } mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; imgMaskData.imgStr = new ImageStream(str, width, 1, 1); imgMaskData.imgStr->reset(); imgMaskData.invert = invert ? 0 : 1; imgMaskData.width = width; imgMaskData.height = height; imgMaskData.y = 0; splash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat, t3GlyphStack != NULL); if (inlineImg) { while (imgMaskData.y < height) { imgMaskData.imgStr->getLine(); ++imgMaskData.y; } } delete imgMaskData.imgStr; str->close(); } void SplashOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg, double *baseMatrix) { double *ctm; SplashCoord mat[6]; SplashOutImageMaskData imgMaskData; Splash *maskSplash; SplashColor maskColor; double bbox[4] = {0, 0, 1, 1}; // default; if (state->getFillColorSpace()->isNonMarking()) { return; } ctm = state->getCTM(); for (int i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) return; } beginTransparencyGroup(state, bbox, NULL, gFalse, gFalse, gFalse); baseMatrix[4] -= transpGroupStack->tx; baseMatrix[5] -= transpGroupStack->ty; ctm = state->getCTM(); mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; imgMaskData.imgStr = new ImageStream(str, width, 1, 1); imgMaskData.imgStr->reset(); imgMaskData.invert = invert ? 0 : 1; imgMaskData.width = width; imgMaskData.height = height; imgMaskData.y = 0; maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); maskSplash = new Splash(maskBitmap, vectorAntialias); maskColor[0] = 0; maskSplash->clear(maskColor); maskColor[0] = 0xff; maskSplash->setFillPattern(new SplashSolidColor(maskColor)); maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat, t3GlyphStack != NULL); delete maskSplash; delete imgMaskData.imgStr; str->close(); } void SplashOutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) { double bbox[4] = {0,0,1,1}; // dummy /* transfer mask to alpha channel! */ // memcpy(maskBitmap->getAlphaPtr(), maskBitmap->getDataPtr(), bitmap->getRowSize() * bitmap->getHeight()); // memset(maskBitmap->getDataPtr(), 0, bitmap->getRowSize() * bitmap->getHeight()); Guchar *dest = bitmap->getAlphaPtr(); Guchar *src = maskBitmap->getDataPtr(); for (int c= 0; c < maskBitmap->getRowSize() * maskBitmap->getHeight(); c++) { dest[c] = src[c]; } delete maskBitmap; maskBitmap = NULL; endTransparencyGroup(state); baseMatrix[4] += transpGroupStack->tx; baseMatrix[5] += transpGroupStack->ty; paintTransparencyGroup(state, bbox); } struct SplashOutImageData { ImageStream *imgStr; GfxImageColorMap *colorMap; SplashColorPtr lookup; int *maskColors; SplashColorMode colorMode; int width, height, y; }; GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, Guchar * /*alphaLine*/) { SplashOutImageData *imgData = (SplashOutImageData *)data; Guchar *p; SplashColorPtr q, col; GfxRGB rgb; GfxGray gray; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif int nComps, x; if (imgData->y == imgData->height) { return gFalse; } if (!(p = imgData->imgStr->getLine())) { return gFalse; } nComps = imgData->colorMap->getNumPixelComps(); if (imgData->lookup) { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) { *q++ = imgData->lookup[*p]; } break; case splashModeRGB8: case splashModeBGR8: for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) { col = &imgData->lookup[3 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; } break; case splashModeXBGR8: for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) { col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = col[3]; } break; #if SPLASH_CMYK case splashModeCMYK8: for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) { col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = col[3]; } break; case splashModeDeviceN8: for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) { col = &imgData->lookup[(SPOT_NCOMPS+4) * *p]; for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = col[cp]; } break; #endif } } else { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { imgData->colorMap->getGray(p, &gray); *q++ = colToByte(gray); } break; case splashModeRGB8: case splashModeBGR8: if (imgData->colorMap->useRGBLine()) { imgData->colorMap->getRGBLine(p, (Guchar *) colorLine, imgData->width); } else { for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { imgData->colorMap->getRGB(p, &rgb); *q++ = colToByte(rgb.r); *q++ = colToByte(rgb.g); *q++ = colToByte(rgb.b); } } break; case splashModeXBGR8: if (imgData->colorMap->useRGBLine()) { imgData->colorMap->getRGBXLine(p, (Guchar *) colorLine, imgData->width); } else { for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { imgData->colorMap->getRGB(p, &rgb); *q++ = colToByte(rgb.r); *q++ = colToByte(rgb.g); *q++ = colToByte(rgb.b); *q++ = 255; } } break; #if SPLASH_CMYK case splashModeCMYK8: if (imgData->colorMap->useCMYKLine()) { imgData->colorMap->getCMYKLine(p, (Guchar *) colorLine, imgData->width); } else { for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { imgData->colorMap->getCMYK(p, &cmyk); *q++ = colToByte(cmyk.c); *q++ = colToByte(cmyk.m); *q++ = colToByte(cmyk.y); *q++ = colToByte(cmyk.k); } } break; case splashModeDeviceN8: if (imgData->colorMap->useDeviceNLine()) { imgData->colorMap->getDeviceNLine(p, (Guchar *) colorLine, imgData->width); } else { for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { imgData->colorMap->getDeviceN(p, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = colToByte(deviceN.c[cp]); } } break; #endif } } ++imgData->y; return gTrue; } GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine, Guchar *alphaLine) { SplashOutImageData *imgData = (SplashOutImageData *)data; Guchar *p, *aq; SplashColorPtr q, col; GfxRGB rgb; GfxGray gray; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif Guchar alpha; int nComps, x, i; if (imgData->y == imgData->height) { return gFalse; } if (!(p = imgData->imgStr->getLine())) { return gFalse; } nComps = imgData->colorMap->getNumPixelComps(); for (x = 0, q = colorLine, aq = alphaLine; x < imgData->width; ++x, p += nComps) { alpha = 0; for (i = 0; i < nComps; ++i) { if (p[i] < imgData->maskColors[2*i] || p[i] > imgData->maskColors[2*i+1]) { alpha = 0xff; break; } } if (imgData->lookup) { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: *q++ = imgData->lookup[*p]; break; case splashModeRGB8: case splashModeBGR8: col = &imgData->lookup[3 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; break; case splashModeXBGR8: col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = 255; break; #if SPLASH_CMYK case splashModeCMYK8: col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = col[3]; break; case splashModeDeviceN8: col = &imgData->lookup[(SPOT_NCOMPS+4) * *p]; for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = col[cp]; break; #endif } *aq++ = alpha; } else { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: imgData->colorMap->getGray(p, &gray); *q++ = colToByte(gray); break; case splashModeXBGR8: case splashModeRGB8: case splashModeBGR8: imgData->colorMap->getRGB(p, &rgb); *q++ = colToByte(rgb.r); *q++ = colToByte(rgb.g); *q++ = colToByte(rgb.b); if (imgData->colorMode == splashModeXBGR8) *q++ = 255; break; #if SPLASH_CMYK case splashModeCMYK8: imgData->colorMap->getCMYK(p, &cmyk); *q++ = colToByte(cmyk.c); *q++ = colToByte(cmyk.m); *q++ = colToByte(cmyk.y); *q++ = colToByte(cmyk.k); break; case splashModeDeviceN8: imgData->colorMap->getDeviceN(p, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = colToByte(deviceN.c[cp]); break; #endif } *aq++ = alpha; } } ++imgData->y; return gTrue; } struct TilingSplashOutBitmap { SplashBitmap *bitmap; SplashPattern *pattern; SplashColorMode colorMode; int paintType; int repeatX; int repeatY; int y; }; GBool SplashOutputDev::tilingBitmapSrc(void *data, SplashColorPtr colorLine, Guchar *alphaLine) { TilingSplashOutBitmap *imgData = (TilingSplashOutBitmap *)data; if (imgData->y == imgData->bitmap->getHeight()) { imgData->repeatY--; if (imgData->repeatY == 0) return gFalse; imgData->y = 0; } if (imgData->paintType == 1) { const SplashColorMode cMode = imgData->bitmap->getMode(); SplashColorPtr q = colorLine; // For splashModeBGR8 and splashModeXBGR8 we need to use getPixel // for the others we can use raw access if (cMode == splashModeBGR8 || cMode == splashModeXBGR8) { for (int m = 0; m < imgData->repeatX; m++) { for (int x = 0; x < imgData->bitmap->getWidth(); x++) { imgData->bitmap->getPixel(x, imgData->y, q); q += splashColorModeNComps[cMode]; } } } else { const int n = imgData->bitmap->getRowSize(); SplashColorPtr p; for (int m = 0; m < imgData->repeatX; m++) { p = imgData->bitmap->getDataPtr() + imgData->y * imgData->bitmap->getRowSize(); for (int x = 0; x < n; ++x) { *q++ = *p++; } } } if (alphaLine != NULL) { SplashColorPtr aq = alphaLine; SplashColorPtr p; const int n = imgData->bitmap->getWidth() - 1; for (int m = 0; m < imgData->repeatX; m++) { p = imgData->bitmap->getAlphaPtr() + imgData->y * imgData->bitmap->getWidth(); for (int x = 0; x < n; ++x) { *aq++ = *p++; } // This is a hack, because of how Splash antialias works if we overwrite the // last alpha pixel of the tile most/all of the files look much better *aq++ = (n == 0) ? *p : *(p - 1); } } } else { SplashColor col, pat; SplashColorPtr dest = colorLine; for (int m = 0; m < imgData->repeatX; m++) { for (int x = 0; x < imgData->bitmap->getWidth(); x++) { imgData->bitmap->getPixel(x, imgData->y, col); imgData->pattern->getColor(x, imgData->y, pat); for (int i = 0; i < splashColorModeNComps[imgData->colorMode]; ++i) { #if SPLASH_CMYK if (imgData->colorMode == splashModeCMYK8 || imgData->colorMode == splashModeDeviceN8) dest[i] = div255(pat[i] * (255 - col[0])); else #endif dest[i] = 255 - div255((255 - pat[i]) * (255 - col[0])); } dest += splashColorModeNComps[imgData->colorMode]; } } if (alphaLine != NULL) { const int y = (imgData->y == imgData->bitmap->getHeight() - 1 && imgData->y > 50) ? imgData->y - 1 : imgData->y; SplashColorPtr aq = alphaLine; SplashColorPtr p; const int n = imgData->bitmap->getWidth(); for (int m = 0; m < imgData->repeatX; m++) { p = imgData->bitmap->getAlphaPtr() + y * imgData->bitmap->getWidth(); for (int x = 0; x < n; ++x) { *aq++ = *p++; } } } } ++imgData->y; return gTrue; } void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) { double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; SplashColorMode srcMode; SplashImageSource src; GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GBool grayIndexed = gFalse; GfxColor deviceN; #endif Guchar pix; int n, i; ctm = state->getCTM(); for (i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) return; } mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; imgData.imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); imgData.imgStr->reset(); imgData.colorMap = colorMap; imgData.maskColors = maskColors; imgData.colorMode = colorMode; imgData.width = width; imgData.height = height; imgData.y = 0; // special case for one-channel (monochrome/gray/separation) images: // build a lookup table here imgData.lookup = NULL; if (colorMap->getNumPixelComps() == 1) { n = 1 << colorMap->getBits(); switch (colorMode) { case splashModeMono1: case splashModeMono8: imgData.lookup = (SplashColorPtr)gmalloc(n); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getGray(&pix, &gray); imgData.lookup[i] = colToByte(gray); } break; case splashModeRGB8: case splashModeBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 3); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+2] = colToByte(rgb.b); } break; case splashModeXBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[4*i] = colToByte(rgb.r); imgData.lookup[4*i+1] = colToByte(rgb.g); imgData.lookup[4*i+2] = colToByte(rgb.b); imgData.lookup[4*i+3] = 255; } break; #if SPLASH_CMYK case splashModeCMYK8: grayIndexed = colorMap->getColorSpace()->getMode() != csDeviceGray; imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getCMYK(&pix, &cmyk); if (cmyk.c != 0 || cmyk.m != 0 || cmyk.y != 0) { grayIndexed = gFalse; } imgData.lookup[4*i] = colToByte(cmyk.c); imgData.lookup[4*i+1] = colToByte(cmyk.m); imgData.lookup[4*i+2] = colToByte(cmyk.y); imgData.lookup[4*i+3] = colToByte(cmyk.k); } break; case splashModeDeviceN8: colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); grayIndexed = colorMap->getColorSpace()->getMode() != csDeviceGray; imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getCMYK(&pix, &cmyk); if (cmyk.c != 0 || cmyk.m != 0 || cmyk.y != 0) { grayIndexed = gFalse; } colorMap->getDeviceN(&pix, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) imgData.lookup[(SPOT_NCOMPS+4)*i +cp] = colToByte(deviceN.c[cp]); } break; #endif } } #if SPLASH_CMYK setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), NULL, grayIndexed); #else setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), NULL); #endif if (colorMode == splashModeMono1) { srcMode = splashModeMono8; } else { srcMode = colorMode; } src = maskColors ? &alphaImageSrc : &imageSrc; splash->drawImage(src, &imgData, srcMode, maskColors ? gTrue : gFalse, width, height, mat, interpolate); if (inlineImg) { while (imgData.y < height) { imgData.imgStr->getLine(); ++imgData.y; } } gfree(imgData.lookup); delete imgData.imgStr; str->close(); } struct SplashOutMaskedImageData { ImageStream *imgStr; GfxImageColorMap *colorMap; SplashBitmap *mask; SplashColorPtr lookup; SplashColorMode colorMode; int width, height, y; }; GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine, Guchar *alphaLine) { SplashOutMaskedImageData *imgData = (SplashOutMaskedImageData *)data; Guchar *p, *aq; SplashColorPtr q, col; GfxRGB rgb; GfxGray gray; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif Guchar alpha; Guchar *maskPtr; int maskBit; int nComps, x; if (imgData->y == imgData->height) { return gFalse; } if (!(p = imgData->imgStr->getLine())) { return gFalse; } nComps = imgData->colorMap->getNumPixelComps(); maskPtr = imgData->mask->getDataPtr() + imgData->y * imgData->mask->getRowSize(); maskBit = 0x80; for (x = 0, q = colorLine, aq = alphaLine; x < imgData->width; ++x, p += nComps) { alpha = (*maskPtr & maskBit) ? 0xff : 0x00; if (!(maskBit >>= 1)) { ++maskPtr; maskBit = 0x80; } if (imgData->lookup) { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: *q++ = imgData->lookup[*p]; break; case splashModeRGB8: case splashModeBGR8: col = &imgData->lookup[3 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; break; case splashModeXBGR8: col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = 255; break; #if SPLASH_CMYK case splashModeCMYK8: col = &imgData->lookup[4 * *p]; *q++ = col[0]; *q++ = col[1]; *q++ = col[2]; *q++ = col[3]; break; case splashModeDeviceN8: col = &imgData->lookup[(SPOT_NCOMPS+4) * *p]; for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = col[cp]; break; #endif } *aq++ = alpha; } else { switch (imgData->colorMode) { case splashModeMono1: case splashModeMono8: imgData->colorMap->getGray(p, &gray); *q++ = colToByte(gray); break; case splashModeXBGR8: case splashModeRGB8: case splashModeBGR8: imgData->colorMap->getRGB(p, &rgb); *q++ = colToByte(rgb.r); *q++ = colToByte(rgb.g); *q++ = colToByte(rgb.b); if (imgData->colorMode == splashModeXBGR8) *q++ = 255; break; #if SPLASH_CMYK case splashModeCMYK8: imgData->colorMap->getCMYK(p, &cmyk); *q++ = colToByte(cmyk.c); *q++ = colToByte(cmyk.m); *q++ = colToByte(cmyk.y); *q++ = colToByte(cmyk.k); break; case splashModeDeviceN8: imgData->colorMap->getDeviceN(p, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) *q++ = colToByte(deviceN.c[cp]); break; #endif } *aq++ = alpha; } } ++imgData->y; return gTrue; } void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GBool maskInterpolate) { GfxImageColorMap *maskColorMap; Object maskDecode, decodeLow, decodeHigh; double *ctm; SplashCoord mat[6]; SplashOutMaskedImageData imgData; SplashOutImageMaskData imgMaskData; SplashColorMode srcMode; SplashBitmap *maskBitmap; Splash *maskSplash; SplashColor maskColor; GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif Guchar pix; int n, i; #if SPLASH_CMYK colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), NULL); // If the mask is higher resolution than the image, use // drawSoftMaskedImage() instead. if (maskWidth > width || maskHeight > height) { decodeLow.initInt(maskInvert ? 0 : 1); decodeHigh.initInt(maskInvert ? 1 : 0); maskDecode.initArray((xref) ? xref : doc->getXRef()); maskDecode.arrayAdd(&decodeLow); maskDecode.arrayAdd(&decodeHigh); maskColorMap = new GfxImageColorMap(1, &maskDecode, new GfxDeviceGrayColorSpace()); maskDecode.free(); drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate, maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate); delete maskColorMap; } else { //----- scale the mask image to the same size as the source image mat[0] = (SplashCoord)width; mat[1] = 0; mat[2] = 0; mat[3] = (SplashCoord)height; mat[4] = 0; mat[5] = 0; imgMaskData.imgStr = new ImageStream(maskStr, maskWidth, 1, 1); imgMaskData.imgStr->reset(); imgMaskData.invert = maskInvert ? 0 : 1; imgMaskData.width = maskWidth; imgMaskData.height = maskHeight; imgMaskData.y = 0; maskBitmap = new SplashBitmap(width, height, 1, splashModeMono1, gFalse); maskSplash = new Splash(maskBitmap, gFalse); maskColor[0] = 0; maskSplash->clear(maskColor); maskColor[0] = 0xff; maskSplash->setFillPattern(new SplashSolidColor(maskColor)); maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData, maskWidth, maskHeight, mat, gFalse); delete imgMaskData.imgStr; maskStr->close(); delete maskSplash; //----- draw the source image ctm = state->getCTM(); for (i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) { delete maskBitmap; return; } } mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; imgData.imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); imgData.imgStr->reset(); imgData.colorMap = colorMap; imgData.mask = maskBitmap; imgData.colorMode = colorMode; imgData.width = width; imgData.height = height; imgData.y = 0; // special case for one-channel (monochrome/gray/separation) images: // build a lookup table here imgData.lookup = NULL; if (colorMap->getNumPixelComps() == 1) { n = 1 << colorMap->getBits(); switch (colorMode) { case splashModeMono1: case splashModeMono8: imgData.lookup = (SplashColorPtr)gmalloc(n); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getGray(&pix, &gray); imgData.lookup[i] = colToByte(gray); } break; case splashModeRGB8: case splashModeBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 3); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+2] = colToByte(rgb.b); } break; case splashModeXBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[4*i] = colToByte(rgb.r); imgData.lookup[4*i+1] = colToByte(rgb.g); imgData.lookup[4*i+2] = colToByte(rgb.b); imgData.lookup[4*i+3] = 255; } break; #if SPLASH_CMYK case splashModeCMYK8: imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getCMYK(&pix, &cmyk); imgData.lookup[4*i] = colToByte(cmyk.c); imgData.lookup[4*i+1] = colToByte(cmyk.m); imgData.lookup[4*i+2] = colToByte(cmyk.y); imgData.lookup[4*i+3] = colToByte(cmyk.k); } break; case splashModeDeviceN8: imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getDeviceN(&pix, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) imgData.lookup[(SPOT_NCOMPS+4)*i + cp] = colToByte(deviceN.c[cp]); } break; #endif } } if (colorMode == splashModeMono1) { srcMode = splashModeMono8; } else { srcMode = colorMode; } splash->drawImage(&maskedImageSrc, &imgData, srcMode, gTrue, width, height, mat, interpolate); delete maskBitmap; gfree(imgData.lookup); delete imgData.imgStr; str->close(); } } void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap, GBool maskInterpolate) { double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; SplashOutImageData imgMaskData; SplashColorMode srcMode; SplashBitmap *maskBitmap; Splash *maskSplash; SplashColor maskColor; GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif Guchar pix; int n, i; #if SPLASH_CMYK colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), NULL); ctm = state->getCTM(); for (i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) return; } mat[0] = ctm[0]; mat[1] = ctm[1]; mat[2] = -ctm[2]; mat[3] = -ctm[3]; mat[4] = ctm[2] + ctm[4]; mat[5] = ctm[3] + ctm[5]; //----- set up the soft mask imgMaskData.imgStr = new ImageStream(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits()); imgMaskData.imgStr->reset(); imgMaskData.colorMap = maskColorMap; imgMaskData.maskColors = NULL; imgMaskData.colorMode = splashModeMono8; imgMaskData.width = maskWidth; imgMaskData.height = maskHeight; imgMaskData.y = 0; n = 1 << maskColorMap->getBits(); imgMaskData.lookup = (SplashColorPtr)gmalloc(n); for (i = 0; i < n; ++i) { pix = (Guchar)i; maskColorMap->getGray(&pix, &gray); imgMaskData.lookup[i] = colToByte(gray); } maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); maskSplash = new Splash(maskBitmap, vectorAntialias); maskColor[0] = 0; maskSplash->clear(maskColor); maskSplash->drawImage(&imageSrc, &imgMaskData, splashModeMono8, gFalse, maskWidth, maskHeight, mat, maskInterpolate); delete imgMaskData.imgStr; maskStr->close(); gfree(imgMaskData.lookup); delete maskSplash; splash->setSoftMask(maskBitmap); //----- draw the source image imgData.imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); imgData.imgStr->reset(); imgData.colorMap = colorMap; imgData.maskColors = NULL; imgData.colorMode = colorMode; imgData.width = width; imgData.height = height; imgData.y = 0; // special case for one-channel (monochrome/gray/separation) images: // build a lookup table here imgData.lookup = NULL; if (colorMap->getNumPixelComps() == 1) { n = 1 << colorMap->getBits(); switch (colorMode) { case splashModeMono1: case splashModeMono8: imgData.lookup = (SplashColorPtr)gmalloc(n); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getGray(&pix, &gray); imgData.lookup[i] = colToByte(gray); } break; case splashModeRGB8: case splashModeBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 3); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+2] = colToByte(rgb.b); } break; case splashModeXBGR8: imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getRGB(&pix, &rgb); imgData.lookup[4*i] = colToByte(rgb.r); imgData.lookup[4*i+1] = colToByte(rgb.g); imgData.lookup[4*i+2] = colToByte(rgb.b); imgData.lookup[4*i+3] = 255; } break; #if SPLASH_CMYK case splashModeCMYK8: imgData.lookup = (SplashColorPtr)gmallocn(n, 4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getCMYK(&pix, &cmyk); imgData.lookup[4*i] = colToByte(cmyk.c); imgData.lookup[4*i+1] = colToByte(cmyk.m); imgData.lookup[4*i+2] = colToByte(cmyk.y); imgData.lookup[4*i+3] = colToByte(cmyk.k); } break; case splashModeDeviceN8: imgData.lookup = (SplashColorPtr)gmallocn(n, SPOT_NCOMPS+4); for (i = 0; i < n; ++i) { pix = (Guchar)i; colorMap->getDeviceN(&pix, &deviceN); for (int cp = 0; cp < SPOT_NCOMPS+4; cp++) imgData.lookup[(SPOT_NCOMPS+4)*i + cp] = colToByte(deviceN.c[cp]); } break; #endif } } if (colorMode == splashModeMono1) { srcMode = splashModeMono8; } else { srcMode = colorMode; } splash->drawImage(&imageSrc, &imgData, srcMode, gFalse, width, height, mat, interpolate); splash->setSoftMask(NULL); gfree(imgData.lookup); delete imgData.imgStr; str->close(); } GBool SplashOutputDev::checkTransparencyGroup(GfxState *state, GBool knockout) { if (state->getFillOpacity() != 1 || state->getStrokeOpacity() != 1 || state->getAlphaIsShape() || state->getBlendMode() != gfxBlendNormal || splash->getSoftMask() != NULL || knockout) return gTrue; return transpGroupStack != NULL && transpGroupStack->shape != NULL; } void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, GfxColorSpace *blendingColorSpace, GBool isolated, GBool knockout, GBool forSoftMask) { SplashTransparencyGroup *transpGroup; SplashColor color; double xMin, yMin, xMax, yMax, x, y; int tx, ty, w, h, i; // transform the bbox state->transform(bbox[0], bbox[1], &x, &y); xMin = xMax = x; yMin = yMax = y; state->transform(bbox[0], bbox[3], &x, &y); if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } state->transform(bbox[2], bbox[1], &x, &y); if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } state->transform(bbox[2], bbox[3], &x, &y); if (x < xMin) { xMin = x; } else if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } else if (y > yMax) { yMax = y; } tx = (int)floor(xMin); if (tx < 0) { tx = 0; } else if (tx >= bitmap->getWidth()) { tx = bitmap->getWidth() - 1; } ty = (int)floor(yMin); if (ty < 0) { ty = 0; } else if (ty >= bitmap->getHeight()) { ty = bitmap->getHeight() - 1; } w = (int)ceil(xMax) - tx + 1; if (tx + w > bitmap->getWidth()) { w = bitmap->getWidth() - tx; } if (w < 1) { w = 1; } h = (int)ceil(yMax) - ty + 1; if (ty + h > bitmap->getHeight()) { h = bitmap->getHeight() - ty; } if (h < 1) { h = 1; } // push a new stack entry transpGroup = new SplashTransparencyGroup(); transpGroup->tx = tx; transpGroup->ty = ty; transpGroup->blendingColorSpace = blendingColorSpace; transpGroup->isolated = isolated; transpGroup->shape = (knockout && !isolated) ? SplashBitmap::copy(bitmap) : NULL; transpGroup->knockout = (knockout && isolated); transpGroup->knockoutOpacity = 1.0; transpGroup->next = transpGroupStack; transpGroupStack = transpGroup; // save state transpGroup->origBitmap = bitmap; transpGroup->origSplash = splash; transpGroup->fontAA = fontEngine->getAA(); //~ this handles the blendingColorSpace arg for soft masks, but //~ not yet for transparency groups // switch to the blending color space if (forSoftMask && isolated && blendingColorSpace) { if (blendingColorSpace->getMode() == csDeviceGray || blendingColorSpace->getMode() == csCalGray || (blendingColorSpace->getMode() == csICCBased && blendingColorSpace->getNComps() == 1)) { colorMode = splashModeMono8; } else if (blendingColorSpace->getMode() == csDeviceRGB || blendingColorSpace->getMode() == csCalRGB || (blendingColorSpace->getMode() == csICCBased && blendingColorSpace->getNComps() == 3)) { //~ does this need to use BGR8? colorMode = splashModeRGB8; #if SPLASH_CMYK } else if (blendingColorSpace->getMode() == csDeviceCMYK || (blendingColorSpace->getMode() == csICCBased && blendingColorSpace->getNComps() == 4)) { colorMode = splashModeCMYK8; #endif } } // create the temporary bitmap bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, gTrue, bitmapTopDown, bitmap->getSeparationList()); splash = new Splash(bitmap, vectorAntialias, transpGroup->origSplash->getScreen()); if (transpGroup->next != NULL && transpGroup->next->knockout) { fontEngine->setAA(gFalse); } splash->setThinLineMode(transpGroup->origSplash->getThinLineMode()); splash->setMinLineWidth(globalParams->getMinLineWidth()); //~ Acrobat apparently copies at least the fill and stroke colors, and //~ maybe other state(?) -- but not the clipping path (and not sure //~ what else) //~ [this is likely the same situation as in type3D1()] splash->setFillPattern(transpGroup->origSplash->getFillPattern()->copy()); splash->setStrokePattern( transpGroup->origSplash->getStrokePattern()->copy()); if (isolated) { for (i = 0; i < splashMaxColorComps; ++i) { color[i] = 0; } if (colorMode == splashModeXBGR8) color[3] = 255; splash->clear(color, 0); } else { SplashBitmap *shape = (knockout) ? transpGroup->shape : (transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->shape : transpGroup->origBitmap; int shapeTx = (knockout) ? tx : (transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->tx + tx : tx; int shapeTy = (knockout) ? ty : (transpGroup->next != NULL && transpGroup->next->shape != NULL) ? transpGroup->next->ty + ty : ty; splash->blitTransparent(transpGroup->origBitmap, tx, ty, 0, 0, w, h); splash->setInNonIsolatedGroup(shape, shapeTx, shapeTy); } transpGroup->tBitmap = bitmap; state->shiftCTMAndClip(-tx, -ty); updateCTM(state, 0, 0, 0, 0, 0, 0); ++nestCount; } void SplashOutputDev::endTransparencyGroup(GfxState *state) { // restore state --nestCount; delete splash; bitmap = transpGroupStack->origBitmap; colorMode = bitmap->getMode(); splash = transpGroupStack->origSplash; state->shiftCTMAndClip(transpGroupStack->tx, transpGroupStack->ty); updateCTM(state, 0, 0, 0, 0, 0, 0); } void SplashOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) { SplashBitmap *tBitmap; SplashTransparencyGroup *transpGroup; GBool isolated; int tx, ty; tx = transpGroupStack->tx; ty = transpGroupStack->ty; tBitmap = transpGroupStack->tBitmap; isolated = transpGroupStack->isolated; // paint the transparency group onto the parent bitmap // - the clip path was set in the parent's state) if (tx < bitmap->getWidth() && ty < bitmap->getHeight()) { SplashCoord knockoutOpacity = (transpGroupStack->next != NULL) ? transpGroupStack->next->knockoutOpacity : transpGroupStack->knockoutOpacity; splash->setOverprintMask(0xffffffff, gFalse); splash->composite(tBitmap, 0, 0, tx, ty, tBitmap->getWidth(), tBitmap->getHeight(), gFalse, !isolated, transpGroupStack->next != NULL && transpGroupStack->next->knockout, knockoutOpacity); fontEngine->setAA(transpGroupStack->fontAA); if (transpGroupStack->next != NULL && transpGroupStack->next->shape != NULL) { transpGroupStack->next->knockout = gTrue; } } // pop the stack transpGroup = transpGroupStack; transpGroupStack = transpGroup->next; if (transpGroupStack != NULL && transpGroup->knockoutOpacity < transpGroupStack->knockoutOpacity) { transpGroupStack->knockoutOpacity = transpGroup->knockoutOpacity; } delete transpGroup->shape; delete transpGroup; delete tBitmap; } void SplashOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor) { SplashBitmap *softMask, *tBitmap; Splash *tSplash; SplashTransparencyGroup *transpGroup; SplashColor color; SplashColorPtr p; GfxGray gray; GfxRGB rgb; #if SPLASH_CMYK GfxCMYK cmyk; GfxColor deviceN; #endif double lum, lum2; int tx, ty, x, y; tx = transpGroupStack->tx; ty = transpGroupStack->ty; tBitmap = transpGroupStack->tBitmap; // composite with backdrop color if (!alpha && tBitmap->getMode() != splashModeMono1) { //~ need to correctly handle the case where no blending color //~ space is given if (transpGroupStack->blendingColorSpace) { tSplash = new Splash(tBitmap, vectorAntialias, transpGroupStack->origSplash->getScreen()); switch (tBitmap->getMode()) { case splashModeMono1: // transparency is not supported in mono1 mode break; case splashModeMono8: transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray); color[0] = colToByte(gray); tSplash->compositeBackground(color); break; case splashModeXBGR8: color[3] = 255; case splashModeRGB8: case splashModeBGR8: transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb); color[0] = colToByte(rgb.r); color[1] = colToByte(rgb.g); color[2] = colToByte(rgb.b); tSplash->compositeBackground(color); break; #if SPLASH_CMYK case splashModeCMYK8: transpGroupStack->blendingColorSpace->getCMYK(backdropColor, &cmyk); color[0] = colToByte(cmyk.c); color[1] = colToByte(cmyk.m); color[2] = colToByte(cmyk.y); color[3] = colToByte(cmyk.k); tSplash->compositeBackground(color); break; case splashModeDeviceN8: transpGroupStack->blendingColorSpace->getDeviceN(backdropColor, &deviceN); for (int cp=0; cp < SPOT_NCOMPS+4; cp++) color[cp] = colToByte(deviceN.c[cp]); tSplash->compositeBackground(color); break; #endif } delete tSplash; } } softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); unsigned char fill = 0; if (transpGroupStack->blendingColorSpace) { transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray); fill = colToByte(gray); } memset(softMask->getDataPtr(), fill, softMask->getRowSize() * softMask->getHeight()); p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx; int xMax = tBitmap->getWidth(); int yMax = tBitmap->getHeight(); if (xMax + tx > bitmap->getWidth()) xMax = bitmap->getWidth() - tx; if (yMax + ty > bitmap->getHeight()) yMax = bitmap->getHeight() - ty; for (y = 0; y < yMax; ++y) { for (x = 0; x < xMax; ++x) { if (alpha) { if (transferFunc) { lum = tBitmap->getAlpha(x, y) / 255.0; transferFunc->transform(&lum, &lum2); p[x] = (int)(lum2 * 255.0 + 0.5); } else p[x] = tBitmap->getAlpha(x, y); } else { tBitmap->getPixel(x, y, color); // convert to luminosity switch (tBitmap->getMode()) { case splashModeMono1: case splashModeMono8: lum = color[0] / 255.0; break; case splashModeXBGR8: case splashModeRGB8: case splashModeBGR8: lum = (0.3 / 255.0) * color[0] + (0.59 / 255.0) * color[1] + (0.11 / 255.0) * color[2]; break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: lum = (1 - color[3] / 255.0) - (0.3 / 255.0) * color[0] - (0.59 / 255.0) * color[1] - (0.11 / 255.0) * color[2]; if (lum < 0) { lum = 0; } break; #endif } if (transferFunc) { transferFunc->transform(&lum, &lum2); } else { lum2 = lum; } p[x] = (int)(lum2 * 255.0 + 0.5); } } p += softMask->getRowSize(); } splash->setSoftMask(softMask); // pop the stack transpGroup = transpGroupStack; transpGroupStack = transpGroup->next; delete transpGroup; delete tBitmap; } void SplashOutputDev::clearSoftMask(GfxState *state) { splash->setSoftMask(NULL); } void SplashOutputDev::setPaperColor(SplashColorPtr paperColorA) { splashColorCopy(paperColor, paperColorA); } int SplashOutputDev::getBitmapWidth() { return bitmap->getWidth(); } int SplashOutputDev::getBitmapHeight() { return bitmap->getHeight(); } SplashBitmap *SplashOutputDev::takeBitmap() { SplashBitmap *ret; ret = bitmap; bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode, colorMode != splashModeMono1, bitmapTopDown); return ret; } void SplashOutputDev::getModRegion(int *xMin, int *yMin, int *xMax, int *yMax) { splash->getModRegion(xMin, yMin, xMax, yMax); } void SplashOutputDev::clearModRegion() { splash->clearModRegion(); } #if 1 //~tmp: turn off anti-aliasing temporarily GBool SplashOutputDev::getVectorAntialias() { return splash->getVectorAntialias(); } void SplashOutputDev::setVectorAntialias(GBool vaa) { vectorAntialias = vaa; splash->setVectorAntialias(vaa); } #endif void SplashOutputDev::setFreeTypeHinting(GBool enable, GBool enableSlightHintingA) { enableFreeTypeHinting = enable; enableSlightHinting = enableSlightHintingA; } GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *catalog, Object *str, double *ptm, int paintType, int /*tilingType*/, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) { PDFRectangle box; Gfx *gfx; Splash *formerSplash = splash; SplashBitmap *formerBitmap = bitmap; double width, height; int surface_width, surface_height, result_width, result_height, i; int repeatX, repeatY; SplashCoord matc[6]; Matrix m1; double *ctm, savedCTM[6]; double kx, ky, sx, sy; GBool retValue = gFalse; width = bbox[2] - bbox[0]; height = bbox[3] - bbox[1]; if (xStep != width || yStep != height) return gFalse; // calculate offsets ctm = state->getCTM(); for (i = 0; i < 6; ++i) { savedCTM[i] = ctm[i]; } state->concatCTM(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); state->concatCTM(1, 0, 0, 1, bbox[0], bbox[1]); ctm = state->getCTM(); for (i = 0; i < 6; ++i) { if (!isfinite(ctm[i])) { state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]); return gFalse; } } matc[4] = x0 * xStep * ctm[0] + y0 * yStep * ctm[2] + ctm[4]; matc[5] = x0 * xStep * ctm[1] + y0 * yStep * ctm[3] + ctm[5]; if (splashAbs(ctm[1]) > splashAbs(ctm[0])) { kx = -ctm[1]; ky = ctm[2] - (ctm[0] * ctm[3]) / ctm[1]; } else { kx = ctm[0]; ky = ctm[3] - (ctm[1] * ctm[2]) / ctm[0]; } result_width = (int) ceil(fabs(kx * width * (x1 - x0))); result_height = (int) ceil(fabs(ky * height * (y1 - y0))); kx = state->getHDPI() / 72.0; ky = state->getVDPI() / 72.0; m1.m[0] = (ptm[0] == 0) ? fabs(ptm[2]) * kx : fabs(ptm[0]) * kx; m1.m[1] = 0; m1.m[2] = 0; m1.m[3] = (ptm[3] == 0) ? fabs(ptm[1]) * ky : fabs(ptm[3]) * ky; m1.m[4] = 0; m1.m[5] = 0; m1.transform(width, height, &kx, &ky); surface_width = (int) ceil (fabs(kx)); surface_height = (int) ceil (fabs(ky)); sx = (double) result_width / (surface_width * (x1 - x0)); sy = (double) result_height / (surface_height * (y1 - y0)); m1.m[0] *= sx; m1.m[3] *= sy; m1.transform(width, height, &kx, &ky); if(fabs(kx) < 1 && fabs(ky) < 1) { kx = std::min<double>(kx, ky); ky = 2 / kx; m1.m[0] *= ky; m1.m[3] *= ky; m1.transform(width, height, &kx, &ky); surface_width = (int) ceil (fabs(kx)); surface_height = (int) ceil (fabs(ky)); repeatX = x1 - x0; repeatY = y1 - y0; } else { if ((unsigned long) result_width * result_height > 0x800000L) { state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]); return gFalse; } while(fabs(kx) > 16384 || fabs(ky) > 16384) { // limit pattern bitmap size m1.m[0] /= 2; m1.m[3] /= 2; m1.transform(width, height, &kx, &ky); } surface_width = (int) ceil (fabs(kx)); surface_height = (int) ceil (fabs(ky)); // adjust repeat values to completely fill region repeatX = result_width / surface_width; repeatY = result_height / surface_height; if (surface_width * repeatX < result_width) repeatX++; if (surface_height * repeatY < result_height) repeatY++; if (x1 - x0 > repeatX) repeatX = x1 - x0; if (y1 - y0 > repeatY) repeatY = y1 - y0; } // restore CTM and calculate rotate and scale with rounded matric state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]); state->concatCTM(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); state->concatCTM(width * repeatX, 0, 0, height * repeatY, bbox[0], bbox[1]); ctm = state->getCTM(); matc[0] = ctm[0]; matc[1] = ctm[1]; matc[2] = ctm[2]; matc[3] = ctm[3]; if (surface_width == 0 || surface_height == 0) { state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]); return gFalse; } m1.transform(bbox[0], bbox[1], &kx, &ky); m1.m[4] = -kx; m1.m[5] = -ky; bitmap = new SplashBitmap(surface_width, surface_height, 1, (paintType == 1) ? colorMode : splashModeMono8, gTrue); splash = new Splash(bitmap, gTrue); if (paintType == 2) { SplashColor clearColor; #if SPLASH_CMYK clearColor[0] = (colorMode == splashModeCMYK8 || colorMode == splashModeDeviceN8) ? 0x00 : 0xFF; #else clearColor[0] = 0xFF; #endif splash->clear(clearColor, 0); } else { splash->clear(paperColor, 0); } splash->setThinLineMode(formerSplash->getThinLineMode()); splash->setMinLineWidth(globalParams->getMinLineWidth()); box.x1 = bbox[0]; box.y1 = bbox[1]; box.x2 = bbox[2]; box.y2 = bbox[3]; gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL, gfxA->getXRef()); // set pattern transformation matrix gfx->getState()->setCTM(m1.m[0], m1.m[1], m1.m[2], m1.m[3], m1.m[4], m1.m[5]); updateCTM(gfx->getState(), m1.m[0], m1.m[1], m1.m[2], m1.m[3], m1.m[4], m1.m[5]); gfx->display(str); delete splash; splash = formerSplash; TilingSplashOutBitmap imgData; imgData.bitmap = bitmap; imgData.paintType = paintType; imgData.pattern = splash->getFillPattern(); imgData.colorMode = colorMode; imgData.y = 0; imgData.repeatX = repeatX; imgData.repeatY = repeatY; SplashBitmap *tBitmap = bitmap; bitmap = formerBitmap; result_width = tBitmap->getWidth() * imgData.repeatX; result_height = tBitmap->getHeight() * imgData.repeatY; if (splashAbs(matc[1]) > splashAbs(matc[0])) { kx = -matc[1]; ky = matc[2] - (matc[0] * matc[3]) / matc[1]; } else { kx = matc[0]; ky = matc[3] - (matc[1] * matc[2]) / matc[0]; } kx = result_width / (fabs(kx) + 1); ky = result_height / (fabs(ky) + 1); state->concatCTM(kx, 0, 0, ky, 0, 0); ctm = state->getCTM(); matc[0] = ctm[0]; matc[1] = ctm[1]; matc[2] = ctm[2]; matc[3] = ctm[3]; GBool minorAxisZero = matc[1] == 0 && matc[2] == 0; if (matc[0] > 0 && minorAxisZero && matc[3] > 0) { // draw the tiles for (int y = 0; y < imgData.repeatY; ++y) { for (int x = 0; x < imgData.repeatX; ++x) { x0 = splashFloor(matc[4]) + x * tBitmap->getWidth(); y0 = splashFloor(matc[5]) + y * tBitmap->getHeight(); splash->blitImage(tBitmap, gTrue, x0, y0); } } retValue = gTrue; } else { retValue = splash->drawImage(&tilingBitmapSrc, &imgData, colorMode, gTrue, result_width, result_height, matc, gFalse, gTrue) == splashOk; } delete tBitmap; delete gfx; return retValue; } GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading) { GfxColorSpaceMode shadingMode = shading->getColorSpace()->getMode(); GBool bDirectColorTranslation = gFalse; // triggers an optimization. switch (colorMode) { case splashModeRGB8: bDirectColorTranslation = (shadingMode == csDeviceRGB); break; #if SPLASH_CMYK case splashModeCMYK8: case splashModeDeviceN8: bDirectColorTranslation = (shadingMode == csDeviceCMYK || shadingMode == csDeviceN); break; #endif default: break; } SplashGouraudColor *splashShading = new SplashGouraudPattern(bDirectColorTranslation, state, shading, colorMode); // restore vector antialias because we support it here if (shading->isParameterized()) { GBool vaa = getVectorAntialias(); GBool retVal = gFalse; setVectorAntialias(gTrue); retVal = splash->gouraudTriangleShadedFill(splashShading); setVectorAntialias(vaa); return retVal; } delete splashShading; return gFalse; } GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePattern *pattern, double tMin, double tMax) { double xMin, yMin, xMax, yMax; SplashPath *path; GBool vaa = getVectorAntialias(); // restore vector antialias because we support it here setVectorAntialias(gTrue); GBool retVal = gFalse; // get the clip region bbox if (pattern->getShading()->getHasBBox()) { pattern->getShading()->getBBox(&xMin, &yMin, &xMax, &yMax); } else { state->getClipBBox(&xMin, &yMin, &xMax, &yMax); xMin = floor (xMin); yMin = floor (yMin); xMax = ceil (xMax); yMax = ceil (yMax); { Matrix ctm, ictm; double x[4], y[4]; int i; state->getCTM(&ctm); ctm.invertTo(&ictm); ictm.transform(xMin, yMin, &x[0], &y[0]); ictm.transform(xMax, yMin, &x[1], &y[1]); ictm.transform(xMin, yMax, &x[2], &y[2]); ictm.transform(xMax, yMax, &x[3], &y[3]); xMin = xMax = x[0]; yMin = yMax = y[0]; for (i = 1; i < 4; i++) { xMin = std::min<double>(xMin, x[i]); yMin = std::min<double>(yMin, y[i]); xMax = std::max<double>(xMax, x[i]); yMax = std::max<double>(yMax, y[i]); } } } // fill the region state->moveTo(xMin, yMin); state->lineTo(xMax, yMin); state->lineTo(xMax, yMax); state->lineTo(xMin, yMax); state->closePath(); path = convertPath(state, state->getPath(), gTrue); #if SPLASH_CMYK pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), NULL); retVal = (splash->shadedFill(path, pattern->getShading()->getHasBBox(), pattern) == splashOk); state->clearPath(); setVectorAntialias(vaa); delete path; return retVal; } GBool SplashOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) { SplashAxialPattern *pattern = new SplashAxialPattern(colorMode, state, shading); GBool retVal = univariateShadedFill(state, pattern, tMin, tMax); delete pattern; return retVal; } GBool SplashOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double tMin, double tMax) { SplashRadialPattern *pattern = new SplashRadialPattern(colorMode, state, shading); GBool retVal = univariateShadedFill(state, pattern, tMin, tMax); delete pattern; return retVal; }
anujkhare/poppler
poppler/SplashOutputDev.cc
C++
gpl-2.0
124,396
/*********************************************************************** AlignTrackingMarkers - Utility to define a reasonable coordinate system based on tracking marker positions detected by an optical tracking system. Copyright (c) 2008-2010 Oliver Kreylos This file is part of the Vrui calibration utility package. The Vrui calibration utility package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Vrui calibration utility package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Vrui calibration utility package; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #include <string.h> #include <stdlib.h> #include <stdexcept> #include <utility> #include <vector> #include <iostream> #include <Misc/ThrowStdErr.h> #include <Math/Math.h> #include <Math/Constants.h> #include <Geometry/Point.h> #include <Geometry/AffineCombiner.h> #include <Geometry/Vector.h> #include <Geometry/OrthonormalTransformation.h> #include <Geometry/Ray.h> #include <Geometry/SolidHitResult.h> #include <Geometry/Sphere.h> #include <Geometry/Cylinder.h> #include <Geometry/GeometryValueCoders.h> #include <GL/gl.h> #include <GL/GLColorTemplates.h> #include <GL/GLColor.h> #include <GL/GLMaterial.h> #include <GL/GLModels.h> #include <GL/GLGeometryWrappers.h> #include <GL/GLTransformationWrappers.h> #include <GLMotif/Blind.h> #include <GLMotif/Label.h> #include <GLMotif/Button.h> #include <GLMotif/ToggleButton.h> #include <GLMotif/TextField.h> #include <GLMotif/RowColumn.h> #include <GLMotif/Menu.h> #include <GLMotif/PopupMenu.h> #include <GLMotif/PopupWindow.h> #include <Vrui/Vrui.h> #include <Vrui/InputDevice.h> #include <Vrui/ToolManager.h> #include <Vrui/Tool.h> #include <Vrui/GenericToolFactory.h> #include <Vrui/Application.h> #include "ReadOptiTrackMarkerFile.h" #include "NaturalPointClient.h" namespace { /************************************************************************************** Helper function to query relative marker positions from a NaturalPoint tracking server: **************************************************************************************/ void queryRigidBody(const char* naturalPointServerName,int rigidBodyId,double scale,bool flipZ,std::vector<Geometry::Point<double,3> >& markers) { /* Open a connection to the NaturalPoint server: */ NaturalPointClient npc(naturalPointServerName,1510,"224.0.0.1",1511); std::cout<<"Server name: "<<npc.getServerName()<<std::endl; std::cout<<"Server version: "<<npc.getServerVersion()[0]<<'.'<<npc.getServerVersion()[1]<<'.'<<npc.getServerVersion()[2]<<'.'<<npc.getServerVersion()[3]<<std::endl; std::cout<<"Protocol version: "<<npc.getProtocolVersion()[0]<<'.'<<npc.getProtocolVersion()[1]<<'.'<<npc.getProtocolVersion()[2]<<'.'<<npc.getProtocolVersion()[3]<<std::endl; /* Track the requested rigid body for a number of frames to calculate average relative marker positions: */ std::cout<<"Please show the rigid body with ID "<<rigidBodyId<<" to the OptiTrack system"<<std::endl; unsigned int numFrames=0; std::vector<NaturalPointClient::Point> initialMarkers; std::vector<NaturalPointClient::Point::AffineCombiner> markerCombiners; while(numFrames<50) { /* Wait for the next frame from the NaturalPoint engine: */ const NaturalPointClient::Frame& frame=npc.waitForNextFrame(); /* Check if the frame contains the requested rigid body: */ for(std::vector<NaturalPointClient::RigidBody>::const_iterator rbIt=frame.rigidBodies.begin();rbIt!=frame.rigidBodies.end();++rbIt) if(rbIt->id==rigidBodyId) { /* Check if this is the first frame: */ if(numFrames==0) { std::cout<<"Found rigid body "<<rigidBodyId<<", capturing frames..."<<std::flush; for(std::vector<NaturalPointClient::Point>::const_iterator mIt=rbIt->markers.begin();mIt!=rbIt->markers.end();++mIt) { /* Transform the marker to rigid body coordinates: */ NaturalPointClient::Point m=NaturalPointClient::Point::origin+rbIt->orientation.inverseTransform(*mIt-rbIt->position); /* Store the initial marker position and create an accumulator: */ initialMarkers.push_back(m); markerCombiners.push_back(NaturalPointClient::Point::AffineCombiner()); } } /* Find the best match for each marker in the initial configuration and accumulate their positions: */ for(std::vector<NaturalPointClient::Point>::const_iterator mIt=rbIt->markers.begin();mIt!=rbIt->markers.end();++mIt) { /* Transform the marker to rigid body coordinates: */ NaturalPointClient::Point m=NaturalPointClient::Point::origin+rbIt->orientation.inverseTransform(*mIt-rbIt->position); /* Find the best-matching initial marker: */ size_t bestIndex=0; NaturalPointClient::Scalar bestDist2=Geometry::sqrDist(m,initialMarkers[0]); for(size_t i=1;i<initialMarkers.size();++i) { NaturalPointClient::Scalar dist2=Geometry::sqrDist(m,initialMarkers[i]); if(bestDist2>dist2) { bestIndex=i; bestDist2=dist2; } } /* Accumulate the point: */ markerCombiners[bestIndex].addPoint(m); } ++numFrames; } } std::cout<<" done"<<std::endl; /* Store the averaged marker positions: */ for(std::vector<NaturalPointClient::Point::AffineCombiner>::iterator mcIt=markerCombiners.begin();mcIt!=markerCombiners.end();++mcIt) { Geometry::Point<double,3> m; for(int i=0;i<3;++i) m[i]=double(mcIt->getPoint()[i])*scale; if(flipZ) m[2]=-m[2]; markers.push_back(m); } } } class AlignTrackingMarkers:public Vrui::Application { /* Embedded classes: */ private: typedef double Scalar; typedef Geometry::Point<Scalar,3> Point; typedef Geometry::Vector<Scalar,3> Vector; typedef Geometry::OrthonormalTransformation<Scalar,3> ONTransform; typedef Geometry::Ray<Scalar,3> Ray; typedef std::vector<Point> PointList; typedef std::pair<Point,Point> Line; typedef std::vector<Line> LineList; class MarkerTool; typedef Vrui::GenericToolFactory<MarkerTool> MarkerToolFactory; class MarkerTool:public Vrui::Tool,public Vrui::Application::Tool<AlignTrackingMarkers> { friend class Vrui::GenericToolFactory<MarkerTool>; /* Elements: */ private: static MarkerToolFactory* factory; GLMotif::PopupWindow* dialogPopup; // Marker tool's measurement dialog box GLMotif::TextField* pos[2][3]; // Current position text fields GLMotif::TextField* dist; // Current distance text field bool dragging; // Flag whether the tool is currently dragging a line or the origin Point start; // Starting point of the currently dragged line Point current; // Current end point of currently dragged line /* Constructors and destructors: */ public: MarkerTool(const Vrui::ToolFactory* sFactory,const Vrui::ToolInputAssignment& inputAssignment); virtual ~MarkerTool(void); /* Methods from class Vrui::Tool: */ virtual const Vrui::ToolFactory* getFactory(void) const { return factory; } virtual void buttonCallback(int buttonSlotIndex,Vrui::InputDevice::ButtonCallbackData* cbData); virtual void frame(void); virtual void display(GLContextData& contextData) const; }; /* Elements: */ private: ONTransform transform; // Transformation from original coordinate system to aligned coordinate system Scalar axisLength; // Length for the initial coordinate axes Scalar markerSize; // Size to draw markers in scaled local tracker coordinates Scalar lineSize; // Size to draw lines in scaled local tracker coordinates PointList markers; // List of marker positions in scaled local tracker coordinates LineList lines; // List of lines used to define coordinate axes GLMotif::PopupMenu* mainMenuPopup; // The program's main menu bool moveOrigin; // Flag whether marker tools will move the transformation's origin /* Private methods: */ GLMotif::PopupMenu* createMainMenu(void); // Creates the program's main menu /* Constructors and destructors: */ public: AlignTrackingMarkers(int& argc,char**& argv,char**& appDefaults); virtual ~AlignTrackingMarkers(void); /* Methods from class Vrui::Application: */ virtual void display(GLContextData& contextData) const; /* New methods: */ Point snap(const Point& p) const; // Snaps a 3D point to the existing markers/lines Point snap(const Ray& ray) const; // Snaps a 3D ray to the existing markers/lines Point snap(const Point& start,const Point& p) const; // Snaps a 3D point to the existing markers/lines, with line start point for angle snapping Point snap(const Point& start,const Ray& ray) const; // Snaps a 3D ray to the existing markers/lines, with line start point for angle snapping void addLine(const Point& p1,const Point& p2); // Adds a line to the list void setOrigin(const Point& p); // Sets the current coordinate system's origin void removeLastLineCallback(Misc::CallbackData* cbData); // Removes the most recently added line void alignXAxisCallback(Misc::CallbackData* cbData); // Aligns the X axis to the most recently added line void alignNegXAxisCallback(Misc::CallbackData* cbData); // Aligns the negative X axis to the most recently added line void alignYAxisCallback(Misc::CallbackData* cbData); // Aligns the Y axis to the most recently added line void alignNegYAxisCallback(Misc::CallbackData* cbData); // Aligns the negative Y axis to the most recently added line void alignZAxisCallback(Misc::CallbackData* cbData); // Aligns the Z axis to the most recently added line void alignNegZAxisCallback(Misc::CallbackData* cbData); // Aligns the negative Z axis to the most recently added line void moveOriginCallback(GLMotif::ToggleButton::ValueChangedCallbackData* cbData); // Moves the origin of the coordinate system }; /********************************************************* Static elements of class AlignTrackingMarkers::MarkerTool: *********************************************************/ AlignTrackingMarkers::MarkerToolFactory* AlignTrackingMarkers::MarkerTool::factory=0; /************************************************* Methods of class AlignTrackingMarkers::MarkerTool: *************************************************/ AlignTrackingMarkers::MarkerTool::MarkerTool(const Vrui::ToolFactory* sFactory,const Vrui::ToolInputAssignment& inputAssignment) :Vrui::Tool(sFactory,inputAssignment), dialogPopup(0), dragging(false) { /* Create the measurement dialog: */ dialogPopup=new GLMotif::PopupWindow("DialogPopup",Vrui::getWidgetManager(),"Marker Measurements"); dialogPopup->setResizableFlags(true,false); GLMotif::RowColumn* dialog=new GLMotif::RowColumn("Dialog",dialogPopup,false); dialog->setNumMinorWidgets(2); new GLMotif::Label("Pos1Label",dialog,"Point 1"); GLMotif::RowColumn* pos1Box=new GLMotif::RowColumn("Pos1Box",dialog,false); pos1Box->setOrientation(GLMotif::RowColumn::HORIZONTAL); pos1Box->setPacking(GLMotif::RowColumn::PACK_GRID); for(int i=0;i<3;++i) { char labelName[40]; snprintf(labelName,sizeof(labelName),"Pos1-%d",i+1); pos[0][i]=new GLMotif::TextField(labelName,pos1Box,12); pos[0][i]->setPrecision(6); } pos1Box->manageChild(); new GLMotif::Label("Pos2Label",dialog,"Point 2"); GLMotif::RowColumn* pos2Box=new GLMotif::RowColumn("Pos2Box",dialog,false); pos2Box->setOrientation(GLMotif::RowColumn::HORIZONTAL); pos2Box->setPacking(GLMotif::RowColumn::PACK_GRID); for(int i=0;i<3;++i) { char labelName[40]; snprintf(labelName,sizeof(labelName),"Pos2-%d",i+1); pos[1][i]=new GLMotif::TextField(labelName,pos2Box,12); pos[1][i]->setPrecision(6); } pos2Box->manageChild(); new GLMotif::Label("DistLabel",dialog,"Distance"); GLMotif::RowColumn* distBox=new GLMotif::RowColumn("DistBox",dialog,false); distBox->setOrientation(GLMotif::RowColumn::HORIZONTAL); distBox->setPacking(GLMotif::RowColumn::PACK_GRID); dist=new GLMotif::TextField("Dist",distBox,16); dist->setPrecision(10); new GLMotif::Blind("Blind",distBox); distBox->manageChild(); dialog->manageChild(); /* Pop up the measurement dialog: */ Vrui::popupPrimaryWidget(dialogPopup); } AlignTrackingMarkers::MarkerTool::~MarkerTool(void) { /* Pop down and destroy the measurement dialog: */ Vrui::popdownPrimaryWidget(dialogPopup); delete dialogPopup; } void AlignTrackingMarkers::MarkerTool::buttonCallback(int,Vrui::InputDevice::ButtonCallbackData* cbData) { if(cbData->newButtonState) { /* Begin dragging a line or moving the origin: */ start=current; /* Clear the measurement dialog: */ Point s=application->transform.inverseTransform(start); for(int i=0;i<3;++i) { pos[0][i]->setValue(double(s[i])); pos[1][i]->setString(""); } dist->setString(""); dragging=true; } else { if(!application->moveOrigin) { /* Stop dragging the current line: */ application->addLine(start,current); } dragging=false; } } void AlignTrackingMarkers::MarkerTool::frame(void) { /* Get pointer to input device that caused the event: */ Vrui::InputDevice* device=getButtonDevice(0); /* Snap the current input device to the existing marker set: */ Vrui::NavTrackerState transform=Vrui::getDeviceTransformation(device); if(device->isRayDevice()) { if(dragging) current=application->snap(start,Ray(transform.getOrigin(),transform.transform(device->getDeviceRayDirection()))); else current=application->snap(Ray(transform.getOrigin(),transform.transform(device->getDeviceRayDirection()))); } else { if(dragging) current=application->snap(start,transform.getOrigin()); else current=application->snap(transform.getOrigin()); } /* Update the measurement dialog: */ Point c=application->transform.inverseTransform(current); if(dragging&&!application->moveOrigin) { for(int i=0;i<3;++i) pos[1][i]->setValue(double(c[i])); dist->setValue(double(Geometry::dist(start,current))); } else { for(int i=0;i<3;++i) pos[0][i]->setValue(double(c[i])); } if(dragging&&application->moveOrigin) application->setOrigin(current); } void AlignTrackingMarkers::MarkerTool::display(GLContextData& contextData) const { if(dragging&&!application->moveOrigin) { /* Draw the currently dragged line: */ glPushAttrib(GL_ENABLE_BIT|GL_LINE_BIT); glDisable(GL_LIGHTING); glLineWidth(1.0f); glPushMatrix(); glMultMatrix(Vrui::getNavigationTransformation()); glBegin(GL_LINES); glColor3f(1.0f,0.0f,0.0f); glVertex(start); glVertex(current); glEnd(); glPopMatrix(); glPopAttrib(); } } /************************************* Methods of class AlignTrackingMarkers: *************************************/ GLMotif::PopupMenu* AlignTrackingMarkers::createMainMenu(void) { /* Create a popup shell to hold the main menu: */ GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager()); mainMenuPopup->setTitle("Marker Alignment"); /* Create the main menu itself: */ GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false); /* Create the menu buttons: */ GLMotif::Button* removeLastLineButton=new GLMotif::Button("RemoveLastLineButton",mainMenu,"Remove Last Line"); removeLastLineButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::removeLastLineCallback); GLMotif::Button* alignXAxisButton=new GLMotif::Button("AlignXAxisButton",mainMenu,"Align X Axis"); alignXAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignXAxisCallback); GLMotif::Button* alignNegXAxisButton=new GLMotif::Button("AlignNegXAxisButton",mainMenu,"Align -X Axis"); alignNegXAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegXAxisCallback); GLMotif::Button* alignYAxisButton=new GLMotif::Button("AlignYAxisButton",mainMenu,"Align Y Axis"); alignYAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignYAxisCallback); GLMotif::Button* alignNegYAxisButton=new GLMotif::Button("AlignNegYAxisButton",mainMenu,"Align -Y Axis"); alignNegYAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegYAxisCallback); GLMotif::Button* alignZAxisButton=new GLMotif::Button("AlignZAxisButton",mainMenu,"Align Z Axis"); alignZAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignZAxisCallback); GLMotif::Button* alignNegZAxisButton=new GLMotif::Button("AlignNegZAxisButton",mainMenu,"Align -Z Axis"); alignNegZAxisButton->getSelectCallbacks().add(this,&AlignTrackingMarkers::alignNegZAxisCallback); GLMotif::ToggleButton* moveOriginToggle=new GLMotif::ToggleButton("MoveOriginToggle",mainMenu,"Move Origin"); moveOriginToggle->getValueChangedCallbacks().add(this,&AlignTrackingMarkers::moveOriginCallback); /* Finish building the main menu: */ mainMenu->manageChild(); return mainMenuPopup; } AlignTrackingMarkers::AlignTrackingMarkers(int& argc,char**& argv,char**& appDefaults) :Vrui::Application(argc,argv,appDefaults), transform(ONTransform::identity), markerSize(Scalar(Vrui::getInchFactor())*Scalar(0.25)), lineSize(markerSize/Scalar(3)), mainMenuPopup(0), moveOrigin(false) { /* Create and register the marker tool class: */ MarkerToolFactory* markerToolFactory=new MarkerToolFactory("MarkerTool","Marker Selector",0,*Vrui::getToolManager()); markerToolFactory->setNumButtons(1); markerToolFactory->setButtonFunction(0,"Select Markers"); Vrui::getToolManager()->addClass(markerToolFactory,Vrui::ToolManager::defaultToolFactoryDestructor); /* Parse the command line: */ const char* fileName=0; const char* bodyName=0; const char* naturalPointServerName=0; int naturalPointRigidBodyId=-1; Scalar scale=Scalar(1); bool flipZ=false; for(int i=1;i<argc;++i) { if(argv[i][0]=='-') { if(strcasecmp(argv[i]+1,"size")==0) { ++i; markerSize=Scalar(atof(argv[i])); } else if(strcasecmp(argv[i]+1,"scale")==0) { ++i; scale=Scalar(atof(argv[i])); } else if(strcasecmp(argv[i]+1,"inches")==0) { /* Set scale factor from meters to inches: */ scale=Scalar(1000)/Scalar(25.4); } else if(strcasecmp(argv[i]+1,"flipZ")==0) flipZ=true; else if(strcasecmp(argv[i]+1,"npc")==0) { ++i; naturalPointServerName=argv[i]; ++i; naturalPointRigidBodyId=atoi(argv[i]); } } else if(fileName==0) fileName=argv[i]; else bodyName=argv[i]; } if((fileName==0||bodyName==0)&&(naturalPointServerName==0||naturalPointRigidBodyId==-1)) { std::cerr<<"Usage: "<<argv[0]<<" ( <rigid body definition file name> <rigid body name> ) | ( -npc <NaturalPoint server name> <rigid body ID> ) [-scale <unit scale factor>] [-inches] [-flipZ] [-size <marker size>]"<<std::endl; Misc::throwStdErr("AlignTrackingMarkers::AlignTrackingMarkers: No file name and rigid body name or NaturalPoint server name and rigid body ID provided"); } if(fileName!=0&&bodyName!=0) { /* Determine the marker file name's extension: */ const char* extPtr=0; for(const char* fnPtr=fileName;*fnPtr!='\0';++fnPtr) if(*fnPtr=='.') extPtr=fnPtr; /* Read the marker file: */ if(extPtr!=0&&strcasecmp(extPtr,".rdef")==0) readOptiTrackMarkerFile(fileName,bodyName,scale,flipZ,markers); else Misc::throwStdErr("AlignTrackingMarkers::AlignTrackingMarkers: marker file %s has unrecognized extension",fileName); } else { /* Get a rigid body definition from the NaturalPoint server: */ queryRigidBody(naturalPointServerName,naturalPointRigidBodyId,scale,flipZ,markers); } /* Create the main menu: */ mainMenuPopup=createMainMenu(); Vrui::setMainMenu(mainMenuPopup); /* Initialize the navigation transformation: */ Point::AffineCombiner centroidC; for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) centroidC.addPoint(*mIt); Point centroid=centroidC.getPoint(); Scalar maxSqrDist=Scalar(0); for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) { Scalar sqrDist=Geometry::sqrDist(centroid,*mIt); if(maxSqrDist<sqrDist) maxSqrDist=sqrDist; } axisLength=Math::sqrt(maxSqrDist)*Scalar(2); Vrui::setNavigationTransformation(centroid,axisLength); } AlignTrackingMarkers::~AlignTrackingMarkers(void) { /* Print the updated transformation: */ std::cout<<"Final transformation: "<<Misc::ValueCoder<ONTransform>::encode(transform)<<std::endl; /* Delete the main menu: */ delete mainMenuPopup; } void AlignTrackingMarkers::display(GLContextData& contextData) const { /* Set up OpenGL state: */ glPushAttrib(GL_ENABLE_BIT|GL_LINE_BIT); glDisable(GL_LIGHTING); glLineWidth(1.0f); /* Draw the current coordinate axes: */ glPushMatrix(); glMultMatrix(transform); glBegin(GL_LINES); glColor3f(1.0f,0.0f,0.0f); glVertex3f(-axisLength,0.0f,0.0f); glVertex3f( axisLength,0.0f,0.0f); glColor3f(0.0f,1.0f,0.0f); glVertex3f(0.0f,-axisLength,0.0f); glVertex3f(0.0f, axisLength,0.0f); glColor3f(0.0f,0.0f,1.0f); glVertex3f(0.0f,0.0f,-axisLength); glVertex3f(0.0f,0.0f, axisLength); glEnd(); glPopMatrix(); glEnable(GL_LIGHTING); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glMaterial(GLMaterialEnums::FRONT,GLMaterial(GLMaterial::Color(1.0f,1.0f,1.0f),GLMaterial::Color(1.0f,1.0f,1.0f),25.0f)); static const GLColor<GLfloat,3> markerColors[8]= { GLColor<GLfloat,3>(0.75f,0.25f,0.25f), GLColor<GLfloat,3>(0.25f,0.75f,0.25f), GLColor<GLfloat,3>(0.25f,0.25f,0.75f), GLColor<GLfloat,3>(0.75f,0.75f,0.25f), GLColor<GLfloat,3>(0.25f,0.75f,0.75f), GLColor<GLfloat,3>(0.75f,0.25f,0.75f), GLColor<GLfloat,3>(0.33f,0.33f,0.33f), GLColor<GLfloat,3>(0.67f,0.67f,0.67f) }; glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT,GL_AMBIENT_AND_DIFFUSE); /* Draw all markers: */ int colorIndex=0; for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt,++colorIndex) { glPushMatrix(); glTranslate(*mIt-Point::origin); glColor(markerColors[colorIndex%8]); glDrawSphereIcosahedron(markerSize,4); glPopMatrix(); } /* Draw all lines: */ for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt) { Point p1=lIt->first; Point p2=lIt->second; Vector axis=p2-p1; Scalar height=Geometry::mag(axis); axis/=height; Vector x=Geometry::normal(axis); x.normalize(); Vector y=Geometry::cross(axis,x); y.normalize(); glBegin(GL_QUAD_STRIP); glColor3f(0.5f,0.5f,0.5f); for(int i=0;i<=12;++i) { Scalar angle=Scalar(2)*Math::Constants<Scalar>::pi*Scalar(i)/Scalar(12); Vector normal=x*Math::cos(angle)+y*Math::sin(angle); glNormal(normal); glVertex(p2+normal*lineSize); glVertex(p1+normal*lineSize); } glEnd(); } /* Reset OpenGL state: */ glPopAttrib(); } AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& p) const { Point bestPoint=p; Scalar bestSqrDist=Math::sqr(markerSize); /* Compare the point against all lines: */ for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt) { Point p1=lIt->first; Point p2=lIt->second; Vector axis=p2-p1; Scalar height=Geometry::mag(axis); axis/=height; Scalar sqrDist=Scalar(0); Vector pp1=p-p1; Scalar along=pp1*axis; if(along<Scalar(0)) sqrDist+=Math::sqr(along); else if(along>height) sqrDist+=Math::sqr(along-height); sqrDist+=Geometry::sqr(pp1)-Math::sqr(along); sqrDist*=Scalar(9); if(sqrDist<bestSqrDist) { if(along<=Scalar(0)) bestPoint=p1; else if(along>=height) bestPoint=p2; else bestPoint=p1+axis*along; bestSqrDist=sqrDist; } } /* Compare the point against all markers: */ for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) { Scalar sqrDist=Geometry::sqrDist(*mIt,p); if(sqrDist<bestSqrDist) { bestPoint=*mIt; bestSqrDist=sqrDist; } } return bestPoint; } AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Ray& ray) const { Point bestPoint=ray.getOrigin(); Scalar bestLambda=Math::Constants<Scalar>::max; /* Compare the ray against all lines: */ for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt) { Geometry::Cylinder<Scalar,3> cylinder(lIt->first,lIt->second,lineSize); Geometry::Cylinder<Scalar,3>::HitResult hr=cylinder.intersectRay(ray); if(hr.isValid()&&hr.getParameter()<bestLambda) { bestPoint=cylinder.getP1()+cylinder.getAxis()*((ray(hr.getParameter())-cylinder.getP1())*cylinder.getAxis()); bestLambda=hr.getParameter(); } } /* Compare the ray against all markers: */ for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) { Geometry::Sphere<Scalar,3> sphere(*mIt,markerSize); Geometry::Sphere<Scalar,3>::HitResult hr=sphere.intersectRay(ray); if(hr.isValid()&&hr.getParameter()<bestLambda) { bestPoint=*mIt; bestLambda=hr.getParameter(); } } return bestPoint; } AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& start,const AlignTrackingMarkers::Point& p) const { Point bestPoint=p; Scalar bestSqrDist=Math::sqr(markerSize); /* Compare the point against all lines: */ for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt) { Point p1=lIt->first; Point p2=lIt->second; Vector axis=p2-p1; Scalar height=Geometry::mag(axis); axis/=height; Scalar sqrDist=Scalar(0); Vector pp1=p-p1; Scalar along=pp1*axis; if(along<Scalar(0)) sqrDist+=Math::sqr(along); else if(along>height) sqrDist+=Math::sqr(along-height); sqrDist+=Geometry::sqr(pp1)-Math::sqr(along); sqrDist*=Scalar(9); if(sqrDist<bestSqrDist) { if(along<=Scalar(0)) bestPoint=p1; else if(along>=height) bestPoint=p2; else bestPoint=p1+axis*along; /* Check if the two lines' angles should be snapped to a right angle: */ Vector line=start-bestPoint; Scalar cosAngle=(axis*line)/Geometry::mag(line); if(Math::abs(cosAngle)<Math::cos(Math::rad(Scalar(85)))) bestPoint=p1+axis*((start-p1)*axis); bestSqrDist=sqrDist; } } /* Compare the point against all markers: */ for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) { Scalar sqrDist=Geometry::sqrDist(*mIt,p); if(sqrDist<bestSqrDist) { bestPoint=*mIt; bestSqrDist=sqrDist; } } return bestPoint; } AlignTrackingMarkers::Point AlignTrackingMarkers::snap(const AlignTrackingMarkers::Point& start,const AlignTrackingMarkers::Ray& ray) const { Point bestPoint=ray.getOrigin(); Scalar bestLambda=Math::Constants<Scalar>::max; /* Compare the ray against all lines: */ for(LineList::const_iterator lIt=lines.begin();lIt!=lines.end();++lIt) { Geometry::Cylinder<Scalar,3> cylinder(lIt->first,lIt->second,lineSize); Geometry::Cylinder<Scalar,3>::HitResult hr=cylinder.intersectRay(ray); if(hr.isValid()&&hr.getParameter()<bestLambda) { bestPoint=cylinder.getP1()+cylinder.getAxis()*((ray(hr.getParameter())-cylinder.getP1())*cylinder.getAxis()); /* Check if the two lines' angles should be snapped to a right angle: */ Vector line=start-bestPoint; Scalar cosAngle=(cylinder.getAxis()*line)/Geometry::mag(line); if(Math::abs(cosAngle)<Math::cos(Math::rad(Scalar(85)))) bestPoint=cylinder.getP1()+cylinder.getAxis()*((start-cylinder.getP1())*cylinder.getAxis()); bestLambda=hr.getParameter(); } } /* Compare the ray against all markers: */ for(PointList::const_iterator mIt=markers.begin();mIt!=markers.end();++mIt) { Geometry::Sphere<Scalar,3> sphere(*mIt,markerSize); Geometry::Sphere<Scalar,3>::HitResult hr=sphere.intersectRay(ray); if(hr.isValid()&&hr.getParameter()<bestLambda) { bestPoint=*mIt; bestLambda=hr.getParameter(); } } return bestPoint; } void AlignTrackingMarkers::addLine(const AlignTrackingMarkers::Point& p1,const AlignTrackingMarkers::Point& p2) { /* Store the line: */ lines.push_back(std::make_pair(p1,p2)); Vrui::requestUpdate(); } void AlignTrackingMarkers::setOrigin(const AlignTrackingMarkers::Point& p) { transform.leftMultiply(ONTransform::translate(p-transform.getOrigin())); transform.renormalize(); Vrui::requestUpdate(); } void AlignTrackingMarkers::removeLastLineCallback(Misc::CallbackData* cbData) { if(!lines.empty()) lines.pop_back(); Vrui::requestUpdate(); } void AlignTrackingMarkers::alignXAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's X axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(1,0,0),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::alignNegXAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's -X axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(-1,0,0),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::alignYAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's Y axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,1,0),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::alignNegYAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's -Y axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,-1,0),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::alignZAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's Z axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,0,1),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::alignNegZAxisCallback(Misc::CallbackData* cbData) { if(!lines.empty()) { /* Get the last line's direction in current system coordinates: */ Vector line=transform.inverseTransform(lines.back().second-lines.back().first); /* Align the coordinate system's -Z axis with the line direction: */ transform*=ONTransform::rotate(ONTransform::Rotation::rotateFromTo(Vector(0,0,-1),line)); transform.renormalize(); } Vrui::requestUpdate(); } void AlignTrackingMarkers::moveOriginCallback(GLMotif::ToggleButton::ValueChangedCallbackData* cbData) { moveOrigin=cbData->set; } /************* Main function: *************/ int main(int argc,char* argv[]) { try { char** appDefaults=0; AlignTrackingMarkers app(argc,argv,appDefaults); app.run(); } catch(std::runtime_error err) { std::cerr<<"Caught exception "<<err.what()<<std::endl; return 1; } return 0; }
VisualIdeation/Vrui-2.2-003
Calibration/AlignTrackingMarkers.cpp
C++
gpl-2.0
32,122
/******************************** * 프로젝트 : gargoyle-rax * 패키지 : com.kyj.fx.rax * 작성일 : 2018. 7. 3. * 작성자 : KYJ *******************************/ package com.kyj.fx.rax; import java.util.function.Function; import com.kyj.fx.commons.utils.FxUtil; import com.kyj.fx.commons.utils.ValueUtil; import com.kyj.fx.rax.item.FormulaParameter; import javafx.scene.paint.Color; import javafx.scene.text.Font; /** * * Utility Function.<br/> * * * @author KYJ * */ public abstract class AbstractFomulaParameterToLabelFunction implements Function<FormulaParameter, RaxVirtualCommentLabel> { @Override public RaxVirtualCommentLabel apply(FormulaParameter stepParam) { RaxVirtualCommentLabel lbl = null; if (ValueUtil.isNotEmpty(stepParam)) { lbl = new RaxVirtualCommentLabel(toString(stepParam)); lbl.setTextFill(Color.DEEPSKYBLUE); } if (lbl != null) { lbl.setFont(Font.font(8.0d)); lbl.setBackground(FxUtil.getBackgroundColor(Color.WHITESMOKE)); } return lbl; } public abstract String toString(FormulaParameter stepParam); }
callakrsos/Gargoyle
gargoyle-rax/src/main/java/com/kyj/fx/rax/AbstractFomulaParameterToLabelFunction.java
Java
gpl-2.0
1,093
/* KeePass Password Safe - The Open-Source Password Manager Copyright (C) 2003-2019 Dominik Reichl <dominik.reichl@t-online.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Security; using System.Text; #if !KeePassUAP using System.Security.Cryptography; #endif using KeePassLib.Resources; namespace KeePassLib.Cryptography.Cipher { public sealed class StandardAesEngine : ICipherEngine { #if !KeePassUAP private const CipherMode SaeCipherMode = CipherMode.CBC; private const PaddingMode SaePaddingMode = PaddingMode.PKCS7; #endif private static PwUuid g_uuidAes = null; public static PwUuid AesUuid { get { PwUuid pu = g_uuidAes; if(pu == null) { pu = new PwUuid(new byte[] { 0x31, 0xC1, 0xF2, 0xE6, 0xBF, 0x71, 0x43, 0x50, 0xBE, 0x58, 0x05, 0x21, 0x6A, 0xFC, 0x5A, 0xFF }); g_uuidAes = pu; } return pu; } } public PwUuid CipherUuid { get { return StandardAesEngine.AesUuid; } } public string DisplayName { get { return ("AES/Rijndael (" + KLRes.KeyBits.Replace(@"{PARAM}", "256") + ", FIPS 197)"); } } private static void ValidateArguments(Stream s, bool bEncrypt, byte[] pbKey, byte[] pbIV) { if(s == null) { Debug.Assert(false); throw new ArgumentNullException("s"); } if(pbKey == null) { Debug.Assert(false); throw new ArgumentNullException("pbKey"); } if(pbKey.Length != 32) { Debug.Assert(false); throw new ArgumentOutOfRangeException("pbKey"); } if(pbIV == null) { Debug.Assert(false); throw new ArgumentNullException("pbIV"); } if(pbIV.Length != 16) { Debug.Assert(false); throw new ArgumentOutOfRangeException("pbIV"); } if(bEncrypt) { Debug.Assert(s.CanWrite); if(!s.CanWrite) throw new ArgumentException("Stream must be writable!"); } else // Decrypt { Debug.Assert(s.CanRead); if(!s.CanRead) throw new ArgumentException("Stream must be readable!"); } } private static Stream CreateStream(Stream s, bool bEncrypt, byte[] pbKey, byte[] pbIV) { StandardAesEngine.ValidateArguments(s, bEncrypt, pbKey, pbIV); #if KeePassUAP return StandardAesEngineExt.CreateStream(s, bEncrypt, pbKey, pbIV); #else SymmetricAlgorithm a = CryptoUtil.CreateAes(); if(a.BlockSize != 128) // AES block size { Debug.Assert(false); a.BlockSize = 128; } a.KeySize = 256; a.Mode = SaeCipherMode; a.Padding = SaePaddingMode; ICryptoTransform t; if(bEncrypt) t = a.CreateEncryptor(pbKey, pbIV); else t = a.CreateDecryptor(pbKey, pbIV); if(t == null) { Debug.Assert(false); throw new SecurityException("Unable to create AES transform!"); } return new CryptoStreamEx(s, t, bEncrypt ? CryptoStreamMode.Write : CryptoStreamMode.Read, a); #endif } public Stream EncryptStream(Stream s, byte[] pbKey, byte[] pbIV) { return StandardAesEngine.CreateStream(s, true, pbKey, pbIV); } public Stream DecryptStream(Stream s, byte[] pbKey, byte[] pbIV) { return StandardAesEngine.CreateStream(s, false, pbKey, pbIV); } } }
joshuadugie/KeePass-2.x
KeePassLib/Cryptography/Cipher/StandardAesEngine.cs
C#
gpl-2.0
3,938
<?php $this->breadcrumbs = array( 'Danh mục tuyển dụng' => array('index'), 'Manage', ); $this->menu = array( array('label' => 'Thêm mới', 'url' => array('create')) ); Yii::app()->clientScript->registerScript('search', " $('.search-button').click(function(){ $('.search-form').toggle(); return false; }); $('.search-form form').submit(function(){ $('#product-grid').yiiGridView('update', { data: $(this).serialize() }); return false; }); "); ?> <h1>Danh sách</h1> <?php echo CHtml::link('Tìm kiếm', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array( 'model' => $model, )); ?> </div><!-- search-form --> <?php $form = $this->beginWidget('CActiveForm', array( 'enableAjaxValidation' => TRUE, )); ?> <?php $this->widget('zii.widgets.grid.CGridView', array( 'id' => 'album-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'selectableRows' => 2, 'columns' => array( array( 'id' => 'autoId', 'class' => 'CCheckBoxColumn', 'selectableRows' => '50', ), array( 'name' => 'location', 'value' => 'CHtml::textField("setLocation[$data->id]",$data->location)', 'type' => 'raw', ), array( 'name' => 'education', 'value' => function($data) { if ($data->education == Jobs::JOB_UNIVERSITY) $item = 'Đại học'; elseif ($data->education == Jobs::JOB_COLLEGE) $item = 'Cao đẳng'; elseif ($data->education == Jobs::JOB_INTERMEDIATE) $item = 'Trung cấp'; else $item = 'Lao động phổ thông'; return $item; }, 'filter' => array(Jobs::JOB_UNIVERSITY => 'Đại học', Jobs::JOB_COLLEGE => 'Cao Đẳng', Jobs::JOB_INTERMEDIATE => ' Trung cấp', Jobs::JOB_GENERAL => 'Lao động phổ thông'), ), array( 'name' => 'wage', 'value' => 'CHtml::textField("setWage[$data->id]",$data->wage)', 'type' => 'raw', ), array( 'name' => 'gender', 'value' => function($data) { if ($data->gender == 1) $item = 'Nam'; elseif ($data->gender == 0) $item = 'Nữ'; else $item = 'Nam/Nữ'; return $item; }, 'filter' => array(1 => 'Nam', '2' => 'Nữ', '10' => 'Nam/Nữ'), ), array( 'name' => 'job_type', 'value' => 'CHtml::textField("setJob_type[$data->id]",$data->job_type,array("style"=>"width:100px;"))', 'type' => 'raw', 'filter' => FALSE, ), array( 'name' => 'probation_period', 'value' => 'CHtml::textField("setProbation_period[$data->id]",$data->probation_period,array("style"=>"width:100px;"))', 'type' => 'raw', 'filter' => FALSE, ), array(// display 'create_time' using an expression 'name' => 'create_time', 'value' => 'CHtml::textField("setCreate_time[$data->id]", date("d-m-Y", $data->create_time),array("style"=>"width:80px;"))', 'type' => 'raw', 'filter' => FALSE, ), array(// display 'create_time' using an expression 'name' => 'update_time', 'value' => 'CHtml::textField("setUpdate_time[$data->id]", date("d-m-Y", $data->update_time),array("style"=>"width:80px;"))', 'type' => 'raw', 'filter' => FALSE, ), array( 'name' => 'status', 'value' => '$data->status==1?"Hiện":"Ẩn"', 'filter' => array(1 => 'Hiện', 0 => 'Ẩn'), ), array( 'class' => 'CButtonColumn', ), ), )); ?> <script> function reloadGrid(data) { $.fn.yiiGridView.update('album-grid'); } </script> <span>Tick chọn:</span> <?php echo CHtml::ajaxSubmitButton('Filter', array('jobs/ajaxUpdate'), array(), array("style" => "display:none;")); ?> <?php echo CHtml::ajaxSubmitButton('Hiện', array('jobs/ajaxUpdate', 'act' => 'doActive'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Ẩn', array('jobs/ajaxUpdate', 'act' => 'doInactive'), array('success' => 'reloadGrid')); ?> <br/><BR> <span> Cập nhật: </span> <?php echo CHtml::ajaxSubmitButton('Vị trí', array('jobs/ajaxUpdate', 'act' => 'doLocation'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Mức lương', array('jobs/ajaxUpdate', 'act' => 'dowage'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Hình thức làm việc', array('jobs/ajaxUpdate', 'act' => 'doJob_type'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Thời gian thử việc', array('jobs/ajaxUpdate', 'act' => 'doProbation_period'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Thứ hạng', array('jobs/ajaxUpdate', 'act' => 'doSortRank'), array('success' => 'reloadGrid')); ?> <?php echo CHtml::ajaxSubmitButton('Ngày hết hạn', array('jobs/ajaxUpdate', 'act' => 'doUpdate_time'), array('success' => 'reloadGrid')); ?> <?php $this->endWidget(); ?> <style> #preview { position: absolute; border: 1px solid #ccc; background: #333; padding: 5px; display: none; color: #fff; } #preview img { max-width: 500px; max-height: 500px; } </style>
sonha/camera
protected/views/admin/jobs/admin.php
PHP
gpl-2.0
5,774
package net.minecraft.src; public class RequestDelete extends Request { public RequestDelete(String par1Str, int par2, int par3) { super(par1Str, par2, par3); } public RequestDelete func_96370_f() { try { this.field_96367_a.setDoOutput(true); this.field_96367_a.setRequestMethod("DELETE"); this.field_96367_a.connect(); return this; } catch (Exception var2) { throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); } } public Request func_96359_e() { return this.func_96370_f(); } }
LolololTrololol/InsertNameHere
minecraft/net/minecraft/src/RequestDelete.java
Java
gpl-2.0
662
/** * Created by kuku on 10/01/15. */ $(document).ready(function(){ $('.form-usuario-perfil').attr('disabled', 'disabled'); //Disable }); $(".editarFormularioUsuarioPerfil").click(mostrarBotonesPerfil); function mostrarBotonesPerfil(){ $("#botoneraPerfil").show("slow"); $(".editarFormularioUsuarioPerfil").hide("slow"); }
IsmiKin/Podonet
web/js/usuario/perfilUsuario.js
JavaScript
gpl-2.0
342
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateExperimentScientistsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('experiment_scientists', function (Blueprint $table) { $table->id(); $table->integer('experiment_id'); $table->integer('user_id'); $table->timestamps(); // $table->foreign('experiment_id')->references('id')->on('experiments'); // $table->foreign('user_id')->references('id')->on('users'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('experiment_scientists'); } }
khaivngo/QuickEval
database/migrations/2021_05_14_012802_create_experiment_scientists_table.php
PHP
gpl-2.0
870
<?php /* Finding the path to the wp-admin folder */ $iswin = preg_match('/:\\\/', dirname(__file__)); $slash = ($iswin) ? "\\" : "/"; $wp_path = preg_split('/(?=((\\\|\/)wp-content)).*/', dirname(__file__)); $wp_path = (isset($wp_path[0]) && $wp_path[0] != "") ? $wp_path[0] : $_SERVER["DOCUMENT_ROOT"]; /** Load WordPress Administration Bootstrap */ require_once($wp_path . $slash . 'wp-load.php'); require_once($wp_path . $slash . 'wp-admin' . $slash . 'admin.php'); load_plugin_textdomain( 'kimili-flash-embed', FALSE, 'kimili-flash-embed/langs/'); $title = "Kimili Flash Embed"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> <title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( $title ); ?> &#8212; WordPress</title> <?php wp_admin_css( 'css/global' ); wp_admin_css(); wp_admin_css( 'css/colors' ); wp_admin_css( 'css/ie' ); $hook_suffix = ''; if ( isset($page_hook) ) $hook_suffix = "$page_hook"; else if ( isset($plugin_page) ) $hook_suffix = "$plugin_page"; else if ( isset($pagenow) ) $hook_suffix = "$pagenow"; do_action("admin_print_styles-$hook_suffix"); do_action('admin_print_styles'); do_action("admin_print_scripts-$hook_suffix"); do_action('admin_print_scripts'); do_action("admin_head-$hook_suffix"); do_action('admin_head'); ?> <link rel="stylesheet" href="<?php echo plugins_url('/kimili-flash-embed/css/generator.css'); ?>?ver=<?php echo $KimiliFlashEmbed->version ?>" type="text/css" media="screen" title="no title" charset="utf-8" /> <script src="<?php echo plugins_url('/kimili-flash-embed/js/kfe.js'); ?>?ver=<?php echo $KimiliFlashEmbed->version ?>" type="text/javascript" charset="utf-8"></script> <!-- <?php echo wp_specialchars($title." Tag Generator" ); ?> is heavily based on SWFObject 2 HTML and JavaScript generator v1.2 <http://code.google.com/p/swfobject/> Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> --> </head> <body class="<?php echo apply_filters( 'admin_body_class', '' ); ?>"> <div class="wrap" id="KFE_Generator"> <h2><?php echo wp_specialchars($title." ".__("Tag Generator",'kimili-flash-embed') ); ?></h2> <div class="note"><?php _e('Asterisk (<span class="req">*</span>) indicates required field','kimili-flash-embed'); ?></div> <fieldset> <legend><?php _e("SWFObject Configuration",'kimili-flash-embed'); ?> [ <a id="toggle1" href="#">-</a> ]</legend> <div id="toggleable1"> <div class="col1"> <label for="publishingMethod"><?php _e("Publish method",'kimili-flash-embed'); ?>:</label> <span class="req">*</span> </div> <div class="col2"> <select id="publishingMethod" name="publishmethod"> <option value="static" <?php if (!get_option('kml_flashembed_publish_method')) echo "selected=\"selected\""; ?>><?php _e("Static publishing",'kimili-flash-embed'); ?></option> <option value="dynamic" <?php if (get_option('kml_flashembed_publish_method')) echo "selected=\"selected\""; ?>><?php _e("Dynamic publishing",'kimili-flash-embed'); ?></option> </select> <a id="togglePublishingMethodHelp" href="#"><?php _e("what is this?",'kimili-flash-embed'); ?></a> </div> <div class="clear">&nbsp;</div> <div id="publishingMethodHelp" class="help"> <h2><?php _e("Static publishing",'kimili-flash-embed'); ?></h2> <h3><?php _e("Description",'kimili-flash-embed'); ?></h3> <p><?php _e("Embed Flash content and alternative content using standards compliant markup, and use unobtrusive JavaScript to resolve the issues that markup alone cannot solve.",'kimili-flash-embed'); ?></p> <h3><?php _e("Pros",'kimili-flash-embed'); ?></h3> <p><?php _e("The embedding of Flash content does not rely on JavaScript and the actual authoring of standards compliant markup is promoted.",'kimili-flash-embed'); ?></p> <h3><?php _e("Cons",'kimili-flash-embed'); ?></h3> <p><?php _e("Does not solve 'click-to-activate' mechanisms in Internet Explorer 6+ and Opera 9+.",'kimili-flash-embed'); ?></p> <h2><?php _e("Dynamic publishing",'kimili-flash-embed'); ?></h2> <h3><?php _e("Description",'kimili-flash-embed'); ?></h3> <p><?php _e("Create alternative content using standards compliant markup and embed Flash content with unobtrusive JavaScript.",'kimili-flash-embed'); ?></p> <h3><?php _e("Pros",'kimili-flash-embed'); ?></h3> <p><?php _e("Avoids 'click-to-activate' mechanisms in Internet Explorer 6+ and Opera 9+.",'kimili-flash-embed'); ?></p> <h3><?php _e("Cons",'kimili-flash-embed'); ?></h3> <p><?php _e("The embedding of Flash content relies on JavaScript, so if you have the Flash plug-in installed, but have JavaScript disabled or use a browser that doesn't support JavaScript, you will not be able to see your Flash content, however you will see alternative content instead. Flash content will also not be shown on a device like Sony PSP, which has very poor JavaScript support, and automated tools like RSS readers are not able to pick up Flash content.",'kimili-flash-embed'); ?></p> </div> <div class="col1"> <label title="<?php _e("Flash version consists of major, minor and release version",'kimili-flash-embed'); ?>" class="info"><?php _e("Flash Version",'kimili-flash-embed'); ?></label>: <span class="req">*</span> </div> <div class="col2"> <input type="text" id="major" name="major" value="<?php echo get_option('kml_flashembed_version_major'); ?>" size="4" maxlength="2" /> . <input type="text" id="minor" name="minor" value="<?php echo get_option('kml_flashembed_version_minor'); ?>" size="4" maxlength="4" /> . <input type="text" id="release" name="release" value="<?php echo get_option('kml_flashembed_version_revision'); ?>" size="4" maxlength="4" /> </div> <div class="clear">&nbsp;</div> <div class="col1"> <label for="expressInstall" title="<?php _e("Check checkbox to activate express install functionality on your swf.",'kimili-flash-embed'); ?>" class="info"><?php _e("Adobe Express Install",'kimili-flash-embed'); ?>:</label> </div> <div class="col2"> <input type="checkbox" id="expressInstall" name="useexpressinstall" value="true" <?php if (get_option('kml_flashembed_use_express_install')) echo "checked=\"checked\""; ?> /> </div> <div class="clear">&nbsp;</div> <div id="toggleReplaceId"> <div class="col1"> <label for="replaceId"><?php _e("HTML container ID",'kimili-flash-embed'); ?>:</label> </div> <div class="col2"> <input type="text" id="replaceId" name="replaceId" value="" size="20" /> <a id="toggleReplaceIdHelp" href="#"><?php _e("what is this?",'kimili-flash-embed'); ?></a> </div> <div id="replaceIdHelp" class="help"> <p><?php _e("Specifies the id attribute of the HTML container element that will be replaced with Flash content if enough JavaScript and Flash support is available.",'kimili-flash-embed'); ?></p> <p><?php _e("This HTML container will be generated automatically and will embed your alternative HTML content as defined in the HTML section.",'kimili-flash-embed'); ?></p> <p><?php _e("If you don't define an ID here, KFE will randomly generate an ID for you.",'kimili-flash-embed'); ?></p> </div> <div class="clear">&nbsp;</div> </div> </div> </fieldset> <fieldset> <legend><?php _e("SWF definition",'kimili-flash-embed'); ?> [ <a id="toggle2" href="#">-</a> ]</legend> <div id="toggleable2"> <div class="col1"> <label for="swf" title="<?php _e("The relative or absolute path to your Flash content .swf file",'kimili-flash-embed'); ?>" class="info"><?php _e("Flash (.swf)",'kimili-flash-embed'); ?>:</label> <span class="req">*</span> </div> <div class="col2"> <input type="text" id="swf" name="movie" value="<?php echo get_option('kml_flashembed_filename'); ?>" size="20" /> </div> <div class="clear">&nbsp;</div> <div class="col1"> <label title="<?php _e("Width &times; height (unit)",'kimili-flash-embed'); ?>" class="info"><?php _e("Dimensions",'kimili-flash-embed'); ?>:</label> <span class="req">*</span> </div> <div class="col2"> <input type="text" id="width" name="width" value="<?php echo get_option('kml_flashembed_width'); ?>" size="5" maxlength="5" /> &times; <input type="text" id="height" name="height" value="<?php echo get_option('kml_flashembed_height'); ?>" size="5" maxlength="5" /> <select id="unit" name="unit"> <option <?php if (get_option('kml_flashembed_dimensions_unit') == "pixels") echo "selected=\"selected\""; ?> value="pixels"><?php _e("pixels",'kimili-flash-embed'); ?></option> <option <?php if (get_option('kml_flashembed_dimensions_unit') == "percentage") echo "selected=\"selected\""; ?> value="percentage"><?php _e("percentage",'kimili-flash-embed'); ?></option> </select> </div> <div class="clear">&nbsp;</div> <div id="toggleAttsParamsContainer"> <div class="col1"><label class="info" title="<?php _e("HTML object element attributes",'kimili-flash-embed'); ?>"><?php _e("Attributes",'kimili-flash-embed'); ?>:</label></div> <div class="col3"> <label for="attId" class="info" title="<?php _e("Uniquely identifies the Flash movie so that it can be referenced using a scripting language or by CSS",'kimili-flash-embed'); ?>"><?php _e("Flash content ID",'kimili-flash-embed'); ?></label> </div> <div class="col4"> <input type="text" id="attId" name="fid" value="<?php echo get_option('kml_flashembed_flash_id'); ?>" size="15" /> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="attClass" class="info" title="<?php _e("Classifies the Flash movie so that it can be referenced using a scripting language or by CSS",'kimili-flash-embed'); ?>">class</label> </div> <div class="col4"> <input type="text" id="attClass" name="targetclass" value="<?php echo get_option('kml_flashembed_target_class'); ?>" size="15" /> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="align" class="info" title="<?php _e("HTML alignment of the object element. If this attribute is omitted, it by default centers the movie and crops edges if the browser window is smaller than the movie. NOTE: Using this attribute is not valid in XHTML 1.0 Strict.",'kimili-flash-embed'); ?>">align</label> </div> <div class="col4"> <select id="align" name="align"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_align') == "left") echo "selected=\"selected\""; ?> value="left">left</option> <option <?php if (get_option('kml_flashembed_align') == "right") echo "selected=\"selected\""; ?> value="right">right</option> <option <?php if (get_option('kml_flashembed_align') == "top") echo "selected=\"selected\""; ?> value="top">top</option> <option <?php if (get_option('kml_flashembed_align') == "bottom") echo "selected=\"selected\""; ?> value="bottom">bottom</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1"> <label class="info" title="<?php _e("HTML object element nested param elements",'kimili-flash-embed'); ?>"><?php _e("Parameters",'kimili-flash-embed'); ?>:</label> </div> <div class="col3"> <label for="play" class="info" title="<?php _e("Specifies whether the movie begins playing immediately on loading in the browser. The default value is true if this attribute is omitted.",'kimili-flash-embed'); ?>">play</label> </div> <div class="col4"> <select id="play" name="play"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_play') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_play') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="col3"> <label for="loop" class="info" title="<?php _e("Specifies whether the movie repeats indefinitely or stops when it reaches the last frame. The default value is true if this attribute is omitted",'kimili-flash-embed'); ?>.">loop</label> </div> <div class="col4"> <select id="loop" name="loop"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_loop') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_loop') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="menu" class="info" title="<?php _e("Shows a shortcut menu when users right-click (Windows) or control-click (Macintosh) the SWF file. To show only About Flash in the shortcut menu, deselect this option. By default, this option is set to true.",'kimili-flash-embed'); ?>">menu</label> </div> <div class="col4"> <select id="menu" name="menu"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_menu') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_menu') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="col3"> <label for="quality" class="info" title="<?php _e("Specifies the trade-off between processing time and appearance. The default value is 'high' if this attribute is omitted.",'kimili-flash-embed'); ?>">quality</label> </div> <div class="col4"> <select id="quality" name="quality"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_quality') == "best") echo "selected=\"selected\""; ?> value="best">best</option> <option <?php if (get_option('kml_flashembed_quality') == "high") echo "selected=\"selected\""; ?> value="high">high</option> <option <?php if (get_option('kml_flashembed_quality') == "medium") echo "selected=\"selected\""; ?> value="medium">medium</option> <option <?php if (get_option('kml_flashembed_quality') == "autohigh") echo "selected=\"selected\""; ?> value="autohigh">autohigh</option> <option <?php if (get_option('kml_flashembed_quality') == "autolow") echo "selected=\"selected\""; ?> value="autolow">autolow</option> <option <?php if (get_option('kml_flashembed_quality') == "low") echo "selected=\"selected\""; ?> value="low">low</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="scale" class="info" title="<?php _e("Specifies scaling, aspect ratio, borders, distortion and cropping for if you have changed the document's original width and height.",'kimili-flash-embed'); ?>">scale</label> </div> <div class="col4"> <select id="scale" name="scale"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_scale') == "showall") echo "selected=\"selected\""; ?> value="showall">showall</option> <option <?php if (get_option('kml_flashembed_scale') == "noborder") echo "selected=\"selected\""; ?> value="noborder">noborder</option> <option <?php if (get_option('kml_flashembed_scale') == "exactfit") echo "selected=\"selected\""; ?> value="exactfit">exactfit</option> <option <?php if (get_option('kml_flashembed_scale') == "noscale") echo "selected=\"selected\""; ?> value="noscale">noscale</option> </select> </div> <div class="col3"> <label for="salign" class="info" title="<?php _e("Specifies where the content is placed within the application window and how it is cropped.",'kimili-flash-embed'); ?>">salign</label> </div> <div class="col4"> <select id="salign" name="salign"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_salign') == "tl") echo "selected=\"selected\""; ?> value="tl">tl</option> <option <?php if (get_option('kml_flashembed_salign') == "tr") echo "selected=\"selected\""; ?> value="tr">tr</option> <option <?php if (get_option('kml_flashembed_salign') == "bl") echo "selected=\"selected\""; ?> value="bl">bl</option> <option <?php if (get_option('kml_flashembed_salign') == "br") echo "selected=\"selected\""; ?> value="br">br</option> <option <?php if (get_option('kml_flashembed_salign') == "l") echo "selected=\"selected\""; ?> value="l">l</option> <option <?php if (get_option('kml_flashembed_salign') == "t") echo "selected=\"selected\""; ?> value="t">t</option> <option <?php if (get_option('kml_flashembed_salign') == "r") echo "selected=\"selected\""; ?> value="r">r</option> <option <?php if (get_option('kml_flashembed_salign') == "b") echo "selected=\"selected\""; ?> value="b">b</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="wmode" class="info" title="<?php _e("Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. The default value is 'window' if this attribute is omitted.",'kimili-flash-embed'); ?>">wmode</label> </div> <div class="col4"> <select id="wmode" name="wmode"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_wmode') == "window") echo "selected=\"selected\""; ?> value="window">window</option> <option <?php if (get_option('kml_flashembed_wmode') == "opaque") echo "selected=\"selected\""; ?> value="opaque">opaque</option> <option <?php if (get_option('kml_flashembed_wmode') == "transparent") echo "selected=\"selected\""; ?> value="transparent">transparent</option> <option <?php if (get_option('kml_flashembed_wmode') == "direct") echo "selected=\"selected\""; ?> value="direct">direct</option> <option <?php if (get_option('kml_flashembed_wmode') == "gpu") echo "selected=\"selected\""; ?> value="gpu">gpu</option> </select> </div> <div class="col3"> <label for="bgcolor" class="info" title="<?php _e("Hexadecimal RGB value in the format #RRGGBB, which specifies the background color of the movie, which will override the background color setting specified in the Flash file.",'kimili-flash-embed'); ?>">bgcolor</label> </div> <div class="col4"> <input type="text" id="bgcolor" name="bgcolor" value="<?php echo get_option('kml_flashembed_bgcolor'); ?>" size="15" maxlength="7" /> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="devicefont" class="info" title="<?php _e("Specifies whether static text objects that the Device Font option has not been selected for will be drawn using device fonts anyway, if the necessary fonts are available from the operating system.",'kimili-flash-embed'); ?>">devicefont</label> </div> <div class="col4"> <select id="devicefont" name="devicefont"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_devicefont') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_devicefont') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="col3"> <label for="seamlesstabbing" class="info" title="<?php _e("Specifies whether users are allowed to use the Tab key to move keyboard focus out of a Flash movie and into the surrounding HTML (or the browser, if there is nothing focusable in the HTML following the Flash movie). The default value is true if this attribute is omitted.",'kimili-flash-embed'); ?>">seamlesstabbing</label> </div> <div class="col4"> <select id="seamlesstabbing" name="seamlesstabbing"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_seamlesstabbing') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_seamlesstabbing') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="swliveconnect" class="info" title="<?php _e("Specifies whether the browser should start Java when loading the Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same page, Java must be running for the FSCommand to work.",'kimili-flash-embed'); ?>">swliveconnect</label> </div> <div class="col4"> <select id="swliveconnect" name="swliveconnect"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_swliveconnect') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_swliveconnect') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="col3"> <label for="allowfullscreen" class="info" title="<?php _e("Enables full-screen mode. The default value is false if this attribute is omitted. You must have version 9,0,28,0 or greater of Flash Player installed to use full-screen mode.",'kimili-flash-embed'); ?>">allowfullscreen</label> </div> <div class="col4"> <select id="allowfullscreen" name="allowfullscreen"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_allowfullscreen') == "true") echo "selected=\"selected\""; ?> value="true">true</option> <option <?php if (get_option('kml_flashembed_allowfullscreen') == "false") echo "selected=\"selected\""; ?> value="false">false</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="allowscriptaccess" class="info" title="<?php _e("Controls the ability to perform outbound scripting from within a Flash SWF. The default value is 'always' if this attribute is omitted.",'kimili-flash-embed'); ?>">allowscriptaccess</label> </div> <div class="col4"> <select id="allowscriptaccess" name="allowscriptaccess"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_allowscriptaccess') == "always") echo "selected=\"selected\""; ?> value="always">always</option> <option <?php if (get_option('kml_flashembed_allowscriptaccess') == "sameDomain") echo "selected=\"selected\""; ?> value="sameDomain">sameDomain</option> <option <?php if (get_option('kml_flashembed_allowscriptaccess') == "never") echo "selected=\"selected\""; ?> value="never">never</option> </select> </div> <div class="col3"> <label for="allownetworking" class="info" title="<?php _e("Controls a SWF file's access to network functionality. The default value is 'all' if this attribute is omitted.",'kimili-flash-embed'); ?>">allownetworking</label> </div> <div class="col4"> <select id="allownetworking" name="allownetworking"> <option value=""><?php _e("Choose",'kimili-flash-embed'); ?>...</option> <option <?php if (get_option('kml_flashembed_allownetworking') == "all") echo "selected=\"selected\""; ?> value="all">all</option> <option <?php if (get_option('kml_flashembed_allownetworking') == "internal") echo "selected=\"selected\""; ?> value="internal">internal</option> <option <?php if (get_option('kml_flashembed_allownetworking') == "none") echo "selected=\"selected\""; ?> value="none">none</option> </select> </div> <div class="clear">&nbsp;</div> <div class="col1">&nbsp;</div> <div class="col3"> <label for="base" class="info" title="<?php _e("Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.",'kimili-flash-embed'); ?>">base</label> </div> <div class="col5"> <input type="text" id="base" name="base" value="<?php echo get_option('kml_flashembed_base'); ?>" size="15" /> </div> <div class="clear">&nbsp;</div> <div class="col1"> <label class="info" title="<?php _e("Method to pass variables to a Flash movie. You need to separate individual name/variable pairs with a semicolon (i.e. name=John Doe ; count=3).",'kimili-flash-embed'); ?>">fvars:</label> </div> <div class="col2"> <textarea name="fvars" id="fvars" rows="4" cols="40"><?php echo stripcslashes(get_option('kml_flashembed_fvars')); ?></textarea> </div> </div> <div class="clear">&nbsp;</div> <div class="col1"><a id="toggleAttsParams" href="#"><?php _e("more",'kimili-flash-embed'); ?></a></div> <div class="clear">&nbsp;</div> </div> </fieldset> <fieldset> <legend><?php _e("Alternative Content",'kimili-flash-embed'); ?> [ <a id="toggle3" href="#">-</a> ]</legend> <div id="toggleable3"> <div class="col2"> <label for="alternativeContent"><?php _e("Alternative content",'kimili-flash-embed'); ?>:</label> <a id="toggleAlternativeContentHelp" href="#alternativeContentHelp"><?php _e("what is this",'kimili-flash-embed'); ?>?</a> </div> <div id="alternativeContentHelp" class="help"> <p> <?php _e("The object element allows you to nest alternative HTML content inside of it, which will be displayed if Flash is not installed or supported. This content will also be picked up by search engines, making it a great tool for creating search-engine-friendly content.",'kimili-flash-embed'); ?> </p> <p><?php _e("Summarized, you should use alternative content for the following:",'kimili-flash-embed'); ?></p> <ul> <li><?php _e("When you like to create content that is accessible for people who browse the Web without plugins",'kimili-flash-embed'); ?></li> <li><?php _e("When you like to create search-engine-friendly content",'kimili-flash-embed'); ?></li> <li><?php _e("To tell visitors that they can have a richer user experience by downloading the Flash plugin",'kimili-flash-embed'); ?></li> </ul> </div> <div class="clear"> </div> <div class="col2"> <textarea id="alternativeContent" name="alternativeContent" rows="6" cols="10"><?php echo stripcslashes(get_option('kml_flashembed_alt_content')); ?></textarea> </div> <div class="clear"> </div> </div> </fieldset> <div class="col1"> <input type="button" class="button" id="generate" name="generate" value="<?php _e("Generate",'kimili-flash-embed'); ?>" /> </div> </div> <script type="text/javascript" charset="utf-8"> // <![CDATA[ jQuery(document).ready(function(){ try { Kimili.Flash.Generator.initialize(); Kimili.Flash.Generator.i18n = { more : "<?php _e("more",'kimili-flash-embed'); ?>", less : "<?php _e("less",'kimili-flash-embed'); ?>" }; } catch (e) { throw "<?php _e("Kimili is not defined. This generator isn't going to put a KFE tag in your code.",'kimili-flash-embed'); ?>"; } }); // ]]> </script> </body> </html>
EthanBlast/Glam-Star-Life
wp-content/plugins/kimili-flash-embed/admin/config.php
PHP
gpl-2.0
28,850
package main import ( "fmt" "log" "net/http" "os" "strconv" "github.com/akamensky/argparse" "github.com/skip2/go-qrcode" ) type Config struct { Port *int } func handle(w http.ResponseWriter, r *http.Request) { log.Printf("%s %s %s %s", r.RemoteAddr, r.Method, r.URL, r.Proto) w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Content-Type", "text/html") var err error level := qrcode.Highest size := 256 h := r.FormValue("h") l := r.FormValue("l") s := r.FormValue("s") if s != "" { size, err = strconv.Atoi(s) if err != nil { log.Print(err) w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, "bad request") return } } switch l { case "low": level = qrcode.Low case "Medium": level = qrcode.Medium case "high": level = qrcode.High case "highest": level = qrcode.Highest default: level = qrcode.Highest } png, err := qrcode.Encode(h, level, size) if err == nil { w.Header().Set("Content-Type", "image/png") log.Printf("encode [%s]", h) w.Write(png) } else { log.Print(err) w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, "bad request") } } func main() { parser := argparse.NewParser("QrcodeGen", "Qrcode service") config := Config{} config.Port = parser.Int("p", "port", &argparse.Options{Default: 8301, Help: "set port"}) err := parser.Parse(os.Args) if err != nil { fmt.Print(parser.Usage(err)) os.Exit(2) } http.HandleFunc("/", handle) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *config.Port), nil)) os.Exit(0) }
LaoQi/icode
qrcodegen/qrcodeGen.go
GO
gpl-2.0
1,540
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using HA4IoT.Contracts.Api; using HA4IoT.Contracts.Services; using HA4IoT.Contracts.Services.Backup; using HA4IoT.Contracts.Services.Resources; using HA4IoT.Contracts.Services.Settings; using HA4IoT.Contracts.Services.Storage; using HA4IoT.Settings; using Newtonsoft.Json.Linq; namespace HA4IoT.Services.Resources { [ApiServiceClass(typeof(IResourceService))] public class ResourceService : ServiceBase, IResourceService { private const string StorageFilename = "ResourceService.json"; private const string BackupKeyName = "Resources"; private readonly object _syncRoot = new object(); private readonly List<Resource> _resources = new List<Resource>(); private readonly IStorageService _storageService; private readonly ISettingsService _settingsService; private ControllerSettings _controllerSettings; public ResourceService(IBackupService backupService, IStorageService storageService, ISettingsService settingsService) { if (backupService == null) throw new ArgumentNullException(nameof(backupService)); if (storageService == null) throw new ArgumentNullException(nameof(storageService)); if (settingsService == null) throw new ArgumentNullException(nameof(settingsService)); _storageService = storageService; _settingsService = settingsService; backupService.CreatingBackup += (s, e) => CreateBackup(e); backupService.RestoringBackup += (s, e) => RestoreBackup(e); } public void Initialize() { _controllerSettings = _settingsService.GetSettings<ControllerSettings>(); lock (_syncRoot) { TryLoadResources(); } } public void RegisterText(Enum id, string value) { var uri = GenerateUri(id); lock (_syncRoot) { var resource = _resources.FirstOrDefault(r => r.Uri.Equals(uri)); if (resource != null) { return; } resource = new Resource(uri, value); _resources.Add(resource); SaveResources(); } } public string GetText(Enum id) { var uri = GenerateUri(id); lock (_syncRoot) { var resource = _resources.FirstOrDefault(r => r.Uri.Equals(uri)); if (resource == null) { return $"#Resource '{uri}' not found."; } var resourceValue = resource.Values.FirstOrDefault(rv => rv.LanguageCode.Equals(_controllerSettings.Language)); if (resourceValue == null) { return resource.DefaultValue; } return resourceValue.Value; } } public string GetText(Enum id, params object[] formatParameterObjects) { if (formatParameterObjects == null) throw new ArgumentNullException(nameof(formatParameterObjects)); var text = GetText(id); foreach (var formatParameter in formatParameterObjects) { foreach (var property in formatParameter.GetType().GetProperties()) { text = ReplaceFormatParameter(text, property.Name, property.GetValue(formatParameter)); } } return text; } public string GetText(Enum id, IDictionary<string, object> formatParameters) { if (formatParameters == null) throw new ArgumentNullException(nameof(formatParameters)); var text = GetText(id); foreach (var formatParameter in formatParameters) { text = ReplaceFormatParameter(text, formatParameter.Key, formatParameter.Value); } return text; } [ApiMethod] public void SetTexts(IApiContext apiContext) { lock (_syncRoot) { var request = apiContext.Request.ToObject<SetTextsRequest>(); if (request?.Resources == null || !request.Resources.Any()) { apiContext.ResultCode = ApiResultCode.InvalidBody; return; } foreach (var updatedResource in request.Resources) { var existingResource = _resources.FirstOrDefault(r => r.Uri.Equals(updatedResource.Uri)); if (existingResource != null) { _resources.Remove(existingResource); } _resources.Add(updatedResource); } SaveResources(); } } [ApiMethod] public void GetTexts(IApiContext apiContext) { lock (_syncRoot) { var request = apiContext.Request.ToObject<GetTextsRequest>(); var matchingResources = _resources; if (!string.IsNullOrEmpty(request.Category)) { matchingResources = _resources.Where(r => r.Uri.StartsWith(request.Category + ".")).ToList(); } apiContext.Response["Resources"] = JToken.FromObject(matchingResources); } } private void TryLoadResources() { List<Resource> persistedResources; if (_storageService.TryRead(StorageFilename, out persistedResources)) { _resources.AddRange(persistedResources); } } private void SaveResources() { _storageService.Write(StorageFilename, _resources); } private string GenerateUri(Enum id) { return $"{id.GetType().Name}.{id}"; } private string ReplaceFormatParameter(string text, string name, object value) { return text.Replace("{" + name + "}", Convert.ToString(value)); } private void CreateBackup(BackupEventArgs backupEventArgs) { lock (_syncRoot) { backupEventArgs.Backup[BackupKeyName] = JToken.FromObject(_resources); } } private void RestoreBackup(BackupEventArgs backupEventArgs) { if (backupEventArgs.Backup.Property(BackupKeyName) == null) { return; } var resources = backupEventArgs.Backup[BackupKeyName].Value<List<Resource>>(); lock (_syncRoot) { _resources.Clear(); _resources.AddRange(resources); } } } }
byrialsen/HA4IoT
SDK/HA4IoT/Services/Resources/ResourceService.cs
C#
gpl-2.0
7,003
(function($){ $(function(){ boxHeight(0.4,0.7); var imgSrc1 = $('.view-banner .views-field-field-image-banner img').attr('src'); var current2 = $('.view-banner .views-field-field-image-banner'); $('.view-banner .views-field-field-image-banner img').remove(); $(current2).append('<div class="backbg"></div>'); $('.view-banner .views-field-field-image-banner .backbg').css('background-image', 'url(' + imgSrc1 + ')'); var imgSrc1 = $('#header-image img').attr('src'); var current2 = $('#header-image'); $('#header-image img').remove(); $(current2).append('<div class="backbg"></div>'); $('#header-image .backbg').css('background-image', 'url(' + imgSrc1 + ')'); function boxHeight(w,h) { var height=$(window).height(); var width=$(window).width(); $('#block-views-team-bio-block').css({'height':h*height}); $('#block-views-team-bio-block').css({'width':w*width}); } if($(window).width()<950) { boxHeight(0.7,0.6); } if($(window).width()<767) { boxHeight(0.8,0.7); } $(window).resize(function(){ boxHeight(0.4,0.7); if($(window).width()<950) { boxHeight(0.7,0.6); } if($(window).width()<767) { boxHeight(0.8,0.7); } }); }); })(jQuery);
CCI-Studios/RE-Dale
sites/all/themes/redale/js/background-size.js
JavaScript
gpl-2.0
1,248
<?php /** * ------------------------------------------------------------------------- * Fields plugin for GLPI * ------------------------------------------------------------------------- * * LICENSE * * This file is part of Fields. * * Fields is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Fields is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Fields. If not, see <http://www.gnu.org/licenses/>. * ------------------------------------------------------------------------- * @copyright Copyright (C) 2013-2022 by Fields plugin team. * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html * @link https://github.com/pluginsGLPI/fields * ------------------------------------------------------------------------- */ include "../../../inc/includes.php"; if (preg_match('/[a-z]/i', $_REQUEST['ddtype']) !== 1) { throw new \RuntimeException(sprintf('Invalid itemtype "%"', $_REQUEST['ddtype'])); } $path = PLUGINFIELDS_FRONT_PATH . '/' . $_REQUEST['ddtype'] . '.form.php'; require_once $path;
pluginsGLPI/fields
front/commondropdown.form.php
PHP
gpl-2.0
1,481
/** * \file PropertyTreeTest.hpp * \brief PropertyTree unit test header file * */ /* * This file is part of OndALear collection of open source components. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Copyright (C) 2008 Amnon Janiv <amnon.janiv@ondalear.com> * * Initial version: 2011-11-11 * Author: Amnon Janiv <amnon.janiv@ondalear.com> */ /* * $Id: $ */ #ifndef ONDALEAR_TEST_PropertyTreeTest_HPP #define ONDALEAR_TEST_PropertyTreeTest_HPP #include "core/CoreIncludes.hpp" #include "test/Unittest.hpp" #include "container/PropertyTree.hpp" namespace ondalear { namespace test { namespace container { /** * \class PropertyTreeTest * \brief PropertyTree class features test * */ class CORE_API PropertyTreeTest : public Unittest { public: PropertyTreeTest(); void test_lifecycle(); void test_value_string(); void test_operator_general(); void test_value_template_integer(); void test_value_template_bool(); void test_value_template_string(); void test_util(); void test_value_tree(); void test_iteration(); protected: PropertyTree buildPropertyTree(); }; } //namespace container } //namespace test } //namespace ondalear DECLARE_USING_TYPE(ondalear::test::container,PropertyTreeTest); #endif //ONDALEAR_TEST_PropertyTreeTest_HPP
ajaniv/softwarebook
c++/Container/ContainerTest/PropertyTreeTest.hpp
C++
gpl-2.0
1,435
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using Configuration; using Domain; using Core; using Extensions; namespace Extensions { public static class CollectionExtensions { /// <summary> /// Merge elements in the ordered sequence <code>collection</code> based on <code>groupSelector</code>. Return results for each group using <code>resultSelector</code>. /// </summary> /// <param name="collection"></param> /// <param name="groupSelector"></param> /// <param name="resultSelector"></param> /// <returns></returns> public static IEnumerable<TResult> GroupMerge<T,TResult>(this IEnumerable<T> collection,Func<T,T,int> orderingFunction,Func<IEnumerable<T>,T,bool> groupSelector,Func<IEnumerable<T>,TResult> resultSelector) { // Create groups by the group selector var groups=new List<List<T>>(); foreach(T item in collection.OrderBy(item => item,orderingFunction)) { var groupForItem=groups.FirstOrDefault(group => groupSelector.Invoke(group,item)); if(groupForItem!=null) { groupForItem.Add(item); } else { var newGroup=new List<T>(); newGroup.Add(item); groups.Add(newGroup); } } // And project the results for each group using the resultSelector return groups.Select(group => resultSelector.Invoke(group)); } public static IEnumerable<T> OrderBy<T>(this IEnumerable<T> objects, Func<T,T,int> orderingFunction) { return objects.OrderBy(t => t, new LambdaComparer<T> (orderingFunction)); } public static IEnumerable<T> OrderBy<T,TKey>(this IEnumerable<T> objects, Func<T,TKey> keySelector, Func<TKey,TKey,int> orderingFunction) { return objects.OrderBy(keySelector, new LambdaComparer<TKey> (orderingFunction)); } public static IEnumerable<T> FetchAllRelated<T>(this IEnumerable<T> objects) where T:class,new() { return Prefetcher<T>.FetchAllRelated(objects); } public static IEnumerable<T> FetchRelated<T>(this IEnumerable<T> objects,params Expression<Func<T,object>>[] propertySelectors) where T:class,new() { return Prefetcher<T>.FetchRelated(objects,propertySelectors); } public static bool IsSubSetOf<T>(this IEnumerable<T> objects, IEnumerable<T> otherObjects) { return !objects.Except (otherObjects).Any (); } public static string ToIdString<T>(this IEnumerable<T> objects) where T: HasId { return objects.Select(c => c.id).ToIdString(); } public static string ToIdString(this IEnumerable<int> objects) { return objects.Aggregate("",(str,obj) => string.IsNullOrEmpty(str)?obj.ToString():string.Format("{0},{1}",str,obj)); } } }
olale/GenericDAO
GenericDAO/Extensions/CollectionExtensions.cs
C#
gpl-2.0
2,940
// display the calendar here var hotelTable = document.getElementById("hotelCalendarTable"); var defaultData = hotelTable.innerHTML; var stringHTML = ""; var date=31; var count=0; // stringHTML = "<tr><td>1</td><td>2</td></tr>"; var table = document.getElementById("hotelCalendarTable"); for (var i = 1; i <= date; i++) { if (count === 0){ stringHTML += "<tr>"; count++ } if (count === 7 || i === date) { stringHTML += "<td>" + i + "</td></tr>"; count=0; } else { stringHTML += "<td>" + i + "</td>"; count++; } } hotelTable.innerHTML += stringHTML;
Athit101/ITE220
Week2-2/js/calendar.js
JavaScript
gpl-2.0
566
<?php /** * @package HikaShop for Joomla! * @version 2.6.1 * @author hikashop.com * @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php class hikashopOrderHelper { var $table = ''; var $pkey = ''; var $groupMap = ''; var $groupVal = ''; var $orderingMap = ''; function order($down = true, $useCID = true) { $database = JFactory::getDBO(); if($down){ $sign = '>'; $dir = 'ASC'; }else{ $sign = '<'; $dir = 'DESC'; } $orders = JRequest::getVar( 'order', array(), '', 'array' ); if($useCID) { $ids = JRequest::getVar( 'cid', array(), '', 'array' ); } else { $ids = array_keys($orders); } $orderingMap = $this->orderingMap; $id = (int) $ids[0]; $pkey = $this->pkey; if(!empty($this->main_pkey)){ $main = $this->main_pkey; }else{ $main = $pkey; } $query = 'SELECT a.'.$orderingMap.',a.'.$pkey.' FROM '.hikashop_table($this->table).' as b, '.hikashop_table($this->table).' as a'; $query .= ' WHERE a.'.$orderingMap.' '.$sign.' b.'.$orderingMap.' AND b.'.$main.' = '.$id.$this->group(false,'a').$this->group(false,'b'); $query .= ' ORDER BY a.'.$orderingMap.' '.$dir.' LIMIT 1'; $database->setQuery($query); $secondElement = $database->loadObject(); if(empty($secondElement)) return false; $firstElement = new stdClass(); if($main==$pkey){ $firstElement->$pkey = $id; }else{ $database->setQuery('SELECT '.$pkey.' FROM '.hikashop_table($this->table).' WHERE '.$main.' = '.$id.$this->group(false)); $firstElement->$pkey = (int)$database->loadResult(); } $firstElement->$orderingMap = $secondElement->$orderingMap; if($down)$secondElement->$orderingMap--; else $secondElement->$orderingMap++; $status1 = $database->updateObject(hikashop_table($this->table),$firstElement,$pkey); $status2 = $database->updateObject(hikashop_table($this->table),$secondElement,$pkey); $status = $status1 && $status2; if($status){ if (!HIKASHOP_PHP5) { $app =& JFactory::getApplication(); }else{ $app = JFactory::getApplication(); } $app->enqueueMessage(JText::_( 'NEW_ORDERING_SAVED' ), 'message'); } return $status; } function save($useCID = true) { $app = JFactory::getApplication(); $pkey = $this->pkey; if(!empty($this->main_pkey)){ $main = $this->main_pkey; }else{ $main = $pkey; } $orderingMap = $this->orderingMap; $order = JRequest::getVar('order', array(), 'post', 'array'); if($useCID) { $cid = JRequest::getVar('cid', array(), 'post', 'array'); JArrayHelper::toInteger($cid); } else { $cid = array_keys($order); } if(empty($cid)) { $app->enqueueMessage(JText::_('ERROR_ORDERING'), 'error'); return false; } $database = JFactory::getDBO(); if(!empty($this->groupMap)){ $query = 'SELECT `'.$main.'` FROM '.hikashop_table($this->table).' WHERE `'.$main.'` IN ('.implode(',',$cid).') '. $this->group(); $database->setQuery($query); if(!HIKASHOP_J25){ $results = $database->loadResultArray(); } else { $results = $database->loadColumn(); } $newcid = array(); $neworder=array(); foreach($cid as $key => $val){ if(in_array($val,$results)){ $newcid[] = $val; if($useCID) { $neworder[] = $order[$key]; } else { $neworder[] = $order[$val]; } } } $cid = $newcid; $order = $neworder; if($main!=$pkey){ $query = 'SELECT `'.$main.'`,`'.$pkey.'` FROM '.hikashop_table($this->table).' WHERE `'.$main.'` IN ('.implode(',',$cid).') '. $this->group(); $database->setQuery($query); $results = $database->loadObjectList($main); $newcid=array(); foreach($cid as $id){ $newcid[] = $results[$id]->$pkey; } $cid = $newcid; } } if(empty($cid)) { $app->enqueueMessage(JText::_( 'ERROR_ORDERING' ), 'error'); return false; } $query = 'SELECT `'.$orderingMap.'`,`'.$pkey.'` FROM '.hikashop_table($this->table).' WHERE `'.$pkey.'` NOT IN ('.implode(',',$cid).') ' . $this->group(); $query .= ' ORDER BY `'.$orderingMap.'` ASC'; $database->setQuery($query); $results = $database->loadObjectList($pkey); $oldResults = $results; asort($order); $newOrder = array(); while(!empty($order) || !empty($results)){ $dbElement = reset($results); if(!empty($order) && empty($dbElement->$orderingMap) || (!empty($order) && reset($order) <= $dbElement->$orderingMap)){ $newOrder[] = $cid[(int)key($order)]; unset($order[key($order)]); }else{ $newOrder[] = $dbElement->$pkey; unset($results[$dbElement->$pkey]); } } $i = 1; $status = true; $element = new stdClass(); foreach($newOrder as $val){ $element->$pkey = $val; $element->$orderingMap = $i; if(!isset($oldResults[$val]) || $oldResults[$val]->$orderingMap != $i){ $status = $database->updateObject(hikashop_table($this->table),$element,$pkey) && $status; } $i++; } if($status){ $app->enqueueMessage(JText::_( 'NEW_ORDERING_SAVED' ), 'message'); }else{ $app->enqueueMessage(JText::_( 'ERROR_ORDERING' ), 'error'); } return $status; } function reOrder() { $db = JFactory::getDBO(); $orderingMap = $this->orderingMap; $query = 'SELECT MAX(`'.$orderingMap.'`) FROM '.hikashop_table($this->table) . $this->group(true); $db->setQuery($query); $max = $db->loadResult(); $max++; $query = 'UPDATE '.hikashop_table($this->table).' SET `'.$orderingMap.'` ='.$max.' WHERE `'.$orderingMap.'`=0' . $this->group(); $db->setQuery($query); $db->query(); $query = 'SELECT `'.$orderingMap.'`,`'.$this->pkey.'` FROM '.hikashop_table($this->table) . $this->group(true); $query .= ' ORDER BY `'.$orderingMap.'` ASC'; $db->setQuery($query); $results = $db->loadObjectList(); $i = 1; if(!empty($results)){ foreach($results as $oneResult){ if($oneResult->$orderingMap != $i){ $oneResult->$orderingMap = $i; $db->updateObject( hikashop_table($this->table), $oneResult, $this->pkey); } $i++; } } } function group($addWhere = false,$table = '') { if(!empty($this->groupMap)){ $db = JFactory::getDBO(); if(is_array($this->groupMap)){ $groups = array(); foreach($this->groupMap as $k => $group){ if(!empty($table)){ $group = $table.'.'.$group; } $groups[]= $group.' = '.$db->Quote($this->groupVal[$k]); } $groups = ' ' . implode(' AND ',$groups); }else{ $groups = ' ' .(!empty($table)?$table.'.':''). $this->groupMap.' = '.$db->Quote($this->groupVal); } if($addWhere){ $groups = ' WHERE'.$groups; }else{ $groups = ' AND'.$groups; } }else{ $groups=''; } return $groups; } }
githubupttik/upttik
administrator/components/com_hikashop/helpers/order.php
PHP
gpl-2.0
6,728
/** * @file region.cc * @author Thomas M. Howard (tmhoward@csail.mit.edu) * Matthew R. Walter (mwalter@csail.mit.edu) * @version 1.0 * * @section LICENSE * * This file is part of h2sl. * * Copyright (C) 2014 by the Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see * <http://www.gnu.org/licenses/gpl-2.0.html> or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * * @section DESCRIPTION * * The implementation of a class used to describe a region of space */ #include "h2sl/region.h" using namespace std; using namespace h2sl; Region:: Region( const string& regionType, const Object& object ) : Grounding(), _object( object ) { insert_prop< std::string >( _properties, "region_type", regionType ); } Region:: Region( xmlNodePtr root ) : Grounding(), _object() { insert_prop< std::string >( _properties, "region_type", "na" ); from_xml( root ); } Region:: ~Region() { } Region:: Region( const Region& other ) : Grounding( other ), _object( other._object ){ } Region& Region:: operator=( const Region& other ) { _properties = other._properties; _object = other._object; return (*this); } bool Region:: operator==( const Region& other )const{ if( region_type() != other.region_type() ){ return false; } if( _object != other._object ){ return false; } else { return true; } } bool Region:: operator!=( const Region& other )const{ return !( *this == other ); } Grounding* Region:: dup( void )const{ return new Region( *this ); } void Region:: to_xml( const string& filename )const{ xmlDocPtr doc = xmlNewDoc( ( xmlChar* )( "1.0" ) ); xmlNodePtr root = xmlNewDocNode( doc, NULL, ( xmlChar* )( "root" ), NULL ); xmlDocSetRootElement( doc, root ); to_xml( doc, root ); xmlSaveFormatFileEnc( filename.c_str(), doc, "UTF-8", 1 ); xmlFreeDoc( doc ); return; } void Region:: to_xml( xmlDocPtr doc, xmlNodePtr root )const{ xmlNodePtr node = xmlNewDocNode( doc, NULL, ( const xmlChar* )( "region" ), NULL ); xmlNewProp( node, ( const xmlChar* )( "region_type" ), ( const xmlChar* )( get_prop< std::string >( _properties, "region_type" ).c_str() ) ); _object.to_xml( doc, node ); xmlAddChild( root, node ); return; } void Region:: from_xml( const string& filename ){ xmlDoc * doc = NULL; xmlNodePtr root = NULL; doc = xmlReadFile( filename.c_str(), NULL, 0 ); if( doc != NULL ){ root = xmlDocGetRootElement( doc ); if( root->type == XML_ELEMENT_NODE ){ xmlNodePtr l1 = NULL; for( l1 = root->children; l1; l1 = l1->next ){ if( l1->type == XML_ELEMENT_NODE ){ if( xmlStrcmp( l1->name, ( const xmlChar* )( "region" ) ) == 0 ){ from_xml( l1 ); } } } } xmlFreeDoc( doc ); } return; } void Region:: from_xml( xmlNodePtr root ){ region_type() = "na"; _object = Object(); if( root->type == XML_ELEMENT_NODE ){ pair< bool, string > region_type_prop = has_prop< std::string >( root, "region_type" ); if( region_type_prop.first ){ region_type() = region_type_prop.second; } for( xmlNodePtr l1 = root->children; l1; l1 = l1->next ){ if( l1->type == XML_ELEMENT_NODE ){ if( xmlStrcmp( l1->name, ( const xmlChar* )( "object" ) ) == 0 ){ _object.from_xml( l1 ); } } } } return; } namespace h2sl { ostream& operator<<( ostream& out, const Region& other ) { out << "Region("; out << "region_type=\"" << other.region_type() << "\","; out << "object=" << other.object(); out << ")"; return out; } }
tmhoward/h2sl
src/symbol/region.cc
C++
gpl-2.0
4,358
// // view_dialogs.hpp // BoE // // Created by Celtic Minstrel on 17-01-21. // // #ifndef BOE_VIEW_DIALOGS_HPP #define BOE_VIEW_DIALOGS_HPP void put_item_info(class cDialog& me, const class cItem& s_i, const class cScenario& scen); void put_monst_info(class cDialog& me, const class cMonster& store_m, const class cScenario& scen); void put_monst_info(class cDialog& me, const class cCreature& store_m, const class cScenario& scen); #endif
calref/cboe
src/view_dialogs.hpp
C++
gpl-2.0
446
<?php declare (strict_types = 1); namespace Drupal\Tests\business\Kernel; use Drupal\business\Tests\BusinessTestHelper; use Drupal\invoices\Tests\BaseTestHelper; use Drupal\KernelTests\Core\Entity\EntityKernelTestBase; /** * CRUD tests for the Business module. * * @group business */ class BusinessCrudTest extends EntityKernelTestBase { use BaseTestHelper; use BusinessTestHelper; /** * {@inheritdoc} */ public static $modules = [ 'address', 'business', 'entity_reference_validators', 'libphonenumber', 'views', ]; /** * The database connection. * * @var \Drupal\Core\Database\Connection */ protected $connection; /** * The entity type manager. * * @var \Drupal\core\Entity\EntityTypeManagerInterface */ protected $entityTypeManager; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->connection = $this->container->get('database'); $this->entityTypeManager = $this->container->get('entity_type.manager'); $this->installEntitySchema('business'); $this->installConfig(['business']); } /** * Tests creating, reading, updating and deleting of businesses. */ public function testBusinessCrud() { // Check that the database table exists and is empty. $this->assertTrue($this->connection->schema()->tableExists('business'), 'The business database table exists.'); $this->assertBusinessTableEmpty('The business database is initially empty.'); // @todo Throw a failure when there are more fields available on the entity // than are currently being tested - expand test coverage. // Check if a new business can be saved to the database. $values = $this->randomBusinessValues(); $business = $this->createBusiness($values); $business->save(); $this->assertBusinessTableNotEmpty('The business database table is no longer empty after creating a business.'); // Check that the business data can be read from the database. $reloaded_business = $this->reloadEntity($business); $this->assertBusinessProperties($reloaded_business, $values, 'The business that was saved to the database can be read correctly.'); // Update the business and check that the new values were written to the // database. $new_values = $this->randomBusinessValues(); $this->updateEntity($business, $new_values); $business->save(); $this->assertBusinessProperties($business, $new_values, 'The business has been updated correctly.'); $reloaded_business = $this->reloadEntity($business); $this->assertBusinessProperties($reloaded_business, $new_values, 'The business has been updated correctly in the database.'); // Delete the business. The database should be empty again. $business->delete(); $this->assertBusinessTableEmpty('The business can be deleted from the database.'); } }
pfrenssen/invoices
web/modules/custom/business/tests/src/Kernel/BusinessCrudTest.php
PHP
gpl-2.0
2,893
#include "SparseDataLoader.h" void SparseDataLoader::readSparseData(std::string filename){ std::ifstream file (filename); std::string temp; std::getline(file, temp); while (std::getline(file, temp)) { std::istringstream buffer(temp); std::vector<int> tmpLine((std::istream_iterator<int>(buffer)), std::istream_iterator<int>()); std::vector<std::pair<int,float>> tmpVector; for(std::vector<int>::iterator it = tmpLine.begin(); it != tmpLine.end();++it) { int index = *it; if(index > maxIndex) maxIndex = index; ++it; tmpVector.push_back(std::make_pair(index,(float) *it)); } this->rowVector.push_back(tmpVector); } file.close(); } void SparseDataLoader::displayRow(){ for(SparseDataVector::iterator it = rowVector.begin(); it != rowVector.end(); ++it) { for(std::vector<std::pair<int,float>>::iterator rowIt = (*it).begin(); rowIt != (*it).end(); ++rowIt) { std::cout << "Index slowa: " << (*rowIt).first << " liczba wystapien " << (*rowIt).second <<" "; } std::cout << std::endl; } } SparseDataVector SparseDataLoader::getRowVector() { return rowVector; }
adam-andrzejczak/k_plus_triangle
SparseDataLoader.cpp
C++
gpl-2.0
1,281
#!/usr/bin/python import sys import csv import json import pycountry import codecs from collections import defaultdict class Region(object): def __init__(self, name, code=None, level=0, parent=None, verbose=False): self.name = name self.code = code self.level = level self.contains = [] self.parent = parent try: self.country = pycountry.countries.get(numeric='%03d' % (int(code))) except: self.country = None if verbose: print "Created region %s in parent %s" % (name, parent) def add(self, region): self.contains.append(region) def get_countries(self): ''' return list of countries (pycountry objects) in this region ''' if self.country: return [ self.country ] clist = [] for region in self.contains: clist += region.get_countries() return clist def includes_country(self, cc): ''' Return True if this region has country with country code alpha2=cc ''' if self.country is not None and self.country.alpha2==cc: return True for region in self.contains: if region.includes_country(cc): return True return False def __unicode__(self): return ("<[%d] " % self.level) + self.name + " in " + str(self.parent or 'None') + " >" __str__ = __unicode__ #cdat = csv.DictReader(codecs.open('un_world_geographic_regions.csv','rU', encoding='utf8')) cdat = csv.DictReader(open('un_world_geographic_regions.csv','rU')) regions = {} regions_by_level = defaultdict(list) current_region = Region("World", '001', 5) verbose = True stack = [] for cd in cdat: level = int(cd.get('Level', 0) or 0) inlevel = level code = cd['Numerical_code'] name = cd['name'] if not name: # skip blank # print "skipping %s" % cd continue if not name in regions: region = Region(name, code, level, parent=None) regions[name] = region regions_by_level[level].append(region) else: region = regions[name] level = region.level if level==0: # it's a country: always add to current_region current_region.add(region) if region.parent is None: region.parent = current_region elif inlevel < 0: # add to current_region, and don't change current_region print "==> Adding to current_region" print "Stack has %s" % map(str, stack) current_region.add(region) elif level < current_region.level: # subregion: add, then make region the current one current_region.add(region) if region.parent is None: region.parent = current_region stack.append(current_region) # use stack for parents current_region = region else: # go up until at right level if verbose: print "==> Going up tree" print "Stack has %s" % map(str, stack) while current_region.level <= level: current_region = stack.pop() current_region.add(region) if region.parent is None: region.parent = current_region stack.append(current_region) # use stack for parents current_region = region if verbose: print " added: " + str(region) #----------------------------------------------------------------------------- # output csv's of countries in each region, with alpha2 country code print "-"*77 print "France: " print regions['France'] print "Americas: " print regions['Americas'] print "Haiti: " print regions['Haiti'] print print map(str, regions['Americas'].contains) print regions['Asia'] print map(str, regions['Asia'].contains) print regions['Europe'] print map(str, regions['Europe'].contains) print regions['Africa'] print map(str, regions['Africa'].contains) print "latin america:" print regions['Latin America and the Caribbean'] print map(str, regions['Latin America and the Caribbean'].contains) # sys.exit(0) def dump_region(cset, name, verbose=True): fn = "Countries_in_%s.csv" % name fp = codecs.open(fn, 'w', encoding='utf8') fp.write('cc, code, name\n') for country in cset: #fp.write(('%s,%s,' % (country.alpha2, country.numeric)) + country.name + '\n') fp.write(('%s,%s,' % (country.alpha2, country.numeric))) fp.write(country.name + '\n') #fp.write(country.alpha2 + '\n') fp.close() if verbose: print "Wrote %s" % fn for level in range(4,0,-1): print "Regions in Level %d: " % level for r in regions_by_level[level]: print " %s" % r dump_region(r.get_countries(), r.name, verbose=False) #----------------------------------------------------------------------------- # Africa print "-"*77 print "Countries in Africa:" # cset = [ dict(name=x.name, cc=x.alpha2) for x in regions['Africa'].get_countries() ] # print json.dumps(cset, indent=2) dump_region(regions['Africa'].get_countries(), 'Africa') #----------------------------------------------------------------------------- # Least developed countries print "-"*77 rname = "Least developed countries" print "Countries in %s:" % rname #cset = [ dict(name=x.name, cc=x.alpha2) for x in regions[rname].get_countries() ] #print json.dumps(cset, indent=2) dump_region(regions[rname].get_countries(), rname) #----------------------------------------------------------------------------- # developing nations rnames = ['Africa', 'Americas', 'Caribbean', 'Central America', 'South America', 'Asia', 'Oceania'] rset = set() for rname in rnames: rset = rset.union(set(regions[rname].get_countries())) dump_region(regions[rname].get_countries(), rname) # remove northern america, Japan, Australia, New Zealand northam = regions['Northern America'].get_countries() rset = rset.difference(northam) rset = rset.difference(regions['Japan'].get_countries()) rset = rset.difference(regions['Australia'].get_countries()) rset = rset.difference(regions['New Zealand'].get_countries()) dump_region(rset, 'Developing_Nations') #----------------------------------------------------------------------------- # sub-saharan africa = Africa - Northern Africa + Sudan rnames = ['Africa'] rset = set() for rname in rnames: rset = rset.union(set(regions[rname].get_countries())) rset = rset.difference(regions['Northern Africa'].get_countries()) rset = rset.union(set(regions['Sudan'].get_countries())) dump_region(rset, 'Sub-Saharan-Africa')
mitodl/world_geographic_regions
CountriesByRegion.py
Python
gpl-2.0
6,565
# Created by Thomas Jones on 17/12/2015 - thomas@tomtecsolutions.com # pingspec.py, a plugin for minqlx to spec players who have network latency over a certain amount. # This plugin is released to everyone, for any purpose. It comes with no warranty, no guarantee it works, it's released AS IS. # You can modify everything, except for lines 1-4 and the !tomtec_versions code. They're there to indicate I whacked this together originally. Please make it better :D """ This plugin requires Minqlx Core version v0.4.1 or greater. The following cvars are used on this plugin: qlx_pingSpecSecondsBetweenChecks: Specifies the seconds between checking every player's ping. Default: 15 qlx_pingSpecMaxPing: Specifies the maximum ping permitted on the server before the user is put to spec. Default: 125 """ import minqlx class pingspec(minqlx.Plugin): def __init__(self): self.add_hook("frame", self.process_frame, priority=minqlx.PRI_LOWEST) self.add_command("tomtec_versions", self.cmd_showversion) self.set_cvar_once("qlx_pingSpecSecondsBetweenChecks", "15") self.set_cvar_once("qlx_pingSpecMaxPing", "125") self.plugin_version = "1.3" # Don't touch this: self.frame_counter = 0 def process_frame(self): self.frame_counter += 1 if self.frame_counter == (int(self.get_cvar("qlx_pingSpecSecondsBetweenChecks")) * int(minqlx.get_cvar("sv_fps"))): self.frame_counter = 0 self.check_ping() def check_ping(self): for player in self.players(): if player.ping > int(self.get_cvar("qlx_pingSpecMaxPing")): if self.game.state == "warmup": player.tell("^1Your ping is over the maximum ping tolerated here ({}).".format(self.get_cvar("qlx_pingSpecMaxPing"))) player.tell("You will be put to spec when the game starts if it remains above the threshold.") else: if player.team != "spectator": player.put("spectator") self.msg("{} has been put in spec automatically for having a ping over {}.".format(player.clean_name, self.get_cvar("qlx_pingSpecMaxPing"))) player.tell("^1Your ping is over {}, the threshold.^7".format(self.get_cvar("qlx_pingSpecMaxPing"))) player.tell("You have been put in spec.") def cmd_showversion(self, player, msg, channel): channel.reply("^4pingspec.py^7 - version {}, created by Thomas Jones on 17/12/2015.".format(self.plugin_version))
tjone270/QuakeLiveDS_Scripts
minqlx-plugins/archive/beta/pingspec.py
Python
gpl-2.0
2,601
/////////////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2006-2015 Esper Team. All rights reserved. / // http://esper.codehaus.org / // ---------------------------------------------------------------------------------- / // The software in this package is published under the terms of the GPL license / // a copy of which has been included with this distribution in the license.txt file. / /////////////////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.IO; using System.Linq; using com.espertech.esper.common.client; using com.espertech.esper.common.@internal.epl.agg.core; using com.espertech.esper.common.@internal.epl.enummethod.dot; using com.espertech.esper.common.@internal.epl.expression.agg.accessagg; using com.espertech.esper.common.@internal.epl.expression.chain; using com.espertech.esper.common.@internal.epl.expression.core; using com.espertech.esper.common.@internal.epl.expression.table; using com.espertech.esper.common.@internal.epl.expression.visitor; using com.espertech.esper.common.@internal.epl.index.advanced.index.quadtree; using com.espertech.esper.common.@internal.epl.join.analyze; using com.espertech.esper.common.@internal.epl.streamtype; using com.espertech.esper.common.@internal.epl.table.compiletime; using com.espertech.esper.common.@internal.epl.variable.compiletime; using com.espertech.esper.common.@internal.@event.core; using com.espertech.esper.common.@internal.@event.property; using com.espertech.esper.common.@internal.@event.propertyparser; using com.espertech.esper.common.@internal.rettype; using com.espertech.esper.common.@internal.settings; using com.espertech.esper.compat; using com.espertech.esper.compat.collections; namespace com.espertech.esper.common.@internal.epl.expression.dot.core { /// <summary> /// Represents an Dot-operator expression, for use when "(expression).method(...).method(...)" /// </summary> public class ExprDotNodeImpl : ExprNodeBase, ExprDotNode, ExprStreamRefNode, ExprNodeInnerNodeProvider { private IList<Chainable> _chainSpec; private readonly bool _isDuckTyping; private readonly bool _isUdfCache; [NonSerialized] private ExprDotNodeForge _forge; public ExprDotNodeImpl( IList<Chainable> chainSpec, bool isDuckTyping, bool isUDFCache) { _chainSpec = chainSpec.AsReadOnlyList(); // for safety, make it unmodifiable the list _isDuckTyping = isDuckTyping; _isUdfCache = isUDFCache; } public override ExprNode Validate(ExprValidationContext validationContext) { // check for plannable methods: these are validated according to different rules var appDotMethod = GetAppDotMethod(validationContext.IsFilterExpression); if (appDotMethod != null) { return appDotMethod; } // determine if there is an implied binding, replace first chain element with evaluation node if there is if (validationContext.StreamTypeService.HasTableTypes && validationContext.TableCompileTimeResolver != null && _chainSpec.Count > 1 && _chainSpec[0] is ChainableName) { var tableNode = TableCompileTimeUtil.GetTableNodeChainable( validationContext.StreamTypeService, _chainSpec, validationContext.IsAllowTableAggReset, validationContext.TableCompileTimeResolver); if (tableNode != null) { var node = ExprNodeUtilityValidate.GetValidatedSubtree(ExprNodeOrigin.DOTNODE, tableNode.First, validationContext); if (tableNode.Second.IsEmpty()) { return node; } IList<Chainable> modifiedChainX = new List<Chainable>(tableNode.Second); ChainSpec = modifiedChainX; AddChildNode(node); } } // handle aggregation methods: method on aggregation state coming from certain aggregations or from table column (both table-access or table-in-from-clause) // this is done here as a walker does not have the information that the validated child node has var aggregationMethodNode = HandleAggregationMethod(validationContext); if (aggregationMethodNode != null) { if (aggregationMethodNode.Second.IsEmpty()) { return aggregationMethodNode.First; } IList<Chainable> modifiedChainX = new List<Chainable>(aggregationMethodNode.Second); ChainSpec = modifiedChainX; ChildNodes[0] = aggregationMethodNode.First; } // validate all parameters ExprNodeUtilityValidate.Validate(ExprNodeOrigin.DOTNODEPARAMETER, _chainSpec, validationContext); // determine if there are enumeration method expressions in the chain var hasEnumerationMethod = false; foreach (var chain in _chainSpec) { if (!(chain is ChainableCall)) { continue; } var call = (ChainableCall) chain; if (EnumMethodResolver.IsEnumerationMethod(call.Name, validationContext.ImportService)) { hasEnumerationMethod = true; break; } } // The root node expression may provide the input value: // Such as "window(*).DoIt(...)" or "(select * from Window).DoIt()" or "prevwindow(sb).DoIt(...)", // in which case the expression to act on is a child expression // var streamTypeService = validationContext.StreamTypeService; if (ChildNodes.Length != 0) { // the root expression is the first child node var rootNode = ChildNodes[0]; // the root expression may also provide a lambda-function input (Iterator<EventBean>) // Determine collection-type and evaluator if any for root node var enumSrc = ExprDotNodeUtility.GetEnumerationSource( rootNode, validationContext.StreamTypeService, hasEnumerationMethod, validationContext.IsDisablePropertyExpressionEventCollCache, validationContext.StatementRawInfo, validationContext.StatementCompileTimeService); EPType typeInfoX; if (enumSrc.ReturnType == null) { typeInfoX = EPTypeHelper.SingleValue(rootNode.Forge.EvaluationType); // not a collection type, treat as scalar } else { typeInfoX = enumSrc.ReturnType; } var evalsX = ExprDotNodeUtility.GetChainEvaluators( enumSrc.StreamOfProviderIfApplicable, typeInfoX, _chainSpec, validationContext, _isDuckTyping, new ExprDotNodeFilterAnalyzerInputExpr()); _forge = new ExprDotNodeForgeRootChild( this, null, null, null, hasEnumerationMethod, rootNode.Forge, enumSrc.Enumeration, typeInfoX, evalsX.Chain, evalsX.ChainWithUnpack, false); return null; } // No root node, and this is a 1-element chain i.e. "something(param,...)". // Plug-in single-row methods are not handled here. // Plug-in aggregation methods are not handled here. if (_chainSpec.Count == 1) { var chainable = _chainSpec[0]; if (!(chainable is ChainableCall)) { throw new IllegalStateException("Unexpected chainable : " + chainable); } var call = (ChainableCall) chainable; if (call.Parameters.IsEmpty()) { throw HandleNotFound(call.Name); } // single-parameter can resolve to a property Pair<PropertyResolutionDescriptor, string> propertyInfoPairX = null; try { propertyInfoPairX = ExprIdentNodeUtil.GetTypeFromStream( streamTypeService, call.Name, streamTypeService.HasPropertyAgnosticType, false, validationContext.TableCompileTimeResolver); } catch (ExprValidationPropertyException) { // fine } // if not a property then try built-in single-row non-grammar functions if (propertyInfoPairX == null && call.Name.Equals(ImportServiceCompileTimeConstants.EXT_SINGLEROW_FUNCTION_TRANSPOSE, StringComparison.InvariantCultureIgnoreCase)) { if (call.Parameters.Count != 1) { throw new ExprValidationException( "The " + ImportServiceCompileTimeConstants.EXT_SINGLEROW_FUNCTION_TRANSPOSE + " function requires a single parameter expression"); } _forge = new ExprDotNodeForgeTransposeAsStream(this, call.Parameters[0].Forge); } else if (call.Parameters.Count != 1) { throw HandleNotFound(call.Name); } else { if (propertyInfoPairX == null) { throw new ExprValidationException( "Unknown single-row function, aggregation function or mapped or indexed property named '" + call.Name + "' could not be resolved"); } _forge = GetPropertyPairEvaluator(call.Parameters[0].Forge, propertyInfoPairX, validationContext); } return null; } // handle the case where the first chain spec element is a stream name. ExprValidationException prefixedStreamNumException = null; var prefixedStreamNumber = PrefixedStreamName(_chainSpec, validationContext.StreamTypeService); if (prefixedStreamNumber != -1) { var first = (ChainableName) _chainSpec[0]; var specAfterStreamName = _chainSpec[1]; // Attempt to resolve as property Pair<PropertyResolutionDescriptor, string> propertyInfoPairX = null; try { var propName = first.Name + "." + specAfterStreamName.GetRootNameOrEmptyString(); propertyInfoPairX = ExprIdentNodeUtil.GetTypeFromStream( streamTypeService, propName, streamTypeService.HasPropertyAgnosticType, true, validationContext.TableCompileTimeResolver); } catch (ExprValidationPropertyException) { // fine } if (propertyInfoPairX != null) { IList<Chainable> chain = new List<Chainable>(_chainSpec); // handle "property[x]" and "property(x)" if (chain.Count == 2 && specAfterStreamName.GetParametersOrEmpty().Count == 1) { _forge = GetPropertyPairEvaluator(specAfterStreamName.GetParametersOrEmpty()[0].Forge, propertyInfoPairX, validationContext); return null; } chain.RemoveAt(0); chain.RemoveAt(0); var desc = HandlePropertyInfoPair( true, specAfterStreamName, chain, propertyInfoPairX, hasEnumerationMethod, validationContext, this); desc.Apply(this); return null; } // Attempt to resolve as event-underlying object instance method var eventType = validationContext.StreamTypeService.EventTypes[prefixedStreamNumber]; var type = eventType.UnderlyingType; IList<Chainable> remainderChain = new List<Chainable>(_chainSpec); remainderChain.RemoveAt(0); ExprValidationException methodEx = null; ExprDotForge[] underlyingMethodChain = null; try { var typeInfoX = EPTypeHelper.SingleValue(type); if (validationContext.TableCompileTimeResolver.ResolveTableFromEventType(eventType) != null) { typeInfoX = new ClassEPType(typeof(object[])); } underlyingMethodChain = ExprDotNodeUtility.GetChainEvaluators( prefixedStreamNumber, typeInfoX, remainderChain, validationContext, false, new ExprDotNodeFilterAnalyzerInputStream(prefixedStreamNumber)) .ChainWithUnpack; } catch (ExprValidationException ex) { methodEx = ex; // expected - may not be able to find the methods on the underlying } ExprDotForge[] eventTypeMethodChain = null; ExprValidationException enumDatetimeEx = null; FilterExprAnalyzerAffector filterExprAnalyzerAffector = null; try { var typeInfoX = EPTypeHelper.SingleEvent(eventType); var chain = ExprDotNodeUtility.GetChainEvaluators( prefixedStreamNumber, typeInfoX, remainderChain, validationContext, false, new ExprDotNodeFilterAnalyzerInputStream(prefixedStreamNumber)); eventTypeMethodChain = chain.ChainWithUnpack; filterExprAnalyzerAffector = chain.FilterAnalyzerDesc; } catch (ExprValidationException ex) { enumDatetimeEx = ex; // expected - may not be able to find the methods on the underlying } if (underlyingMethodChain != null) { _forge = new ExprDotNodeForgeStream( this, filterExprAnalyzerAffector, prefixedStreamNumber, eventType, underlyingMethodChain, true); } else if (eventTypeMethodChain != null) { _forge = new ExprDotNodeForgeStream( this, filterExprAnalyzerAffector, prefixedStreamNumber, eventType, eventTypeMethodChain, false); } if (_forge != null) { return null; } else { var remainerName = remainderChain[0].GetRootNameOrEmptyString(); if (ExprDotNodeUtility.IsDatetimeOrEnumMethod(remainerName, validationContext.ImportService)) { prefixedStreamNumException = enumDatetimeEx; } else { prefixedStreamNumException = new ExprValidationException( "Failed to solve '" + remainerName + "' to either an date-time or enumeration method, an event property or a method on the event underlying object: " + methodEx.Message, methodEx); } } } // There no root node, in this case the classname or property name is provided as part of the chain. // Such as "MyClass.myStaticLib(...)" or "mycollectionproperty.DoIt(...)" // IList<Chainable> modifiedChain = new List<Chainable>(_chainSpec); var firstItem = modifiedChain.DeleteAt(0); var firstItemName = firstItem.GetRootNameOrEmptyString(); Pair<PropertyResolutionDescriptor, string> propertyInfoPair = null; try { propertyInfoPair = ExprIdentNodeUtil.GetTypeFromStream( streamTypeService, firstItemName, streamTypeService.HasPropertyAgnosticType, true, validationContext.TableCompileTimeResolver); } catch (ExprValidationPropertyException) { // not a property } // If property then treat it as such if (propertyInfoPair != null) { var desc = HandlePropertyInfoPair( false, firstItem, modifiedChain, propertyInfoPair, hasEnumerationMethod, validationContext, this); desc.Apply(this); return null; } // If variable then resolve as such var variable = validationContext.VariableCompileTimeResolver.Resolve(firstItemName); if (variable != null) { if (variable.OptionalContextName != null) { throw new ExprValidationException("Method invocation on context-specific variable is not supported"); } EPType typeInfoX; ExprDotStaticMethodWrap wrap; if (variable.Type.IsArray) { typeInfoX = EPTypeHelper.CollectionOfSingleValue( variable.Type.GetElementType(), variable.Type); wrap = new ExprDotStaticMethodWrapArrayScalar(variable.VariableName, variable.Type); } else if (variable.EventType != null) { typeInfoX = EPTypeHelper.SingleEvent(variable.EventType); wrap = null; } else { typeInfoX = EPTypeHelper.SingleValue(variable.Type); wrap = null; } var evalsX = ExprDotNodeUtility.GetChainEvaluators( null, typeInfoX, modifiedChain, validationContext, false, new ExprDotNodeFilterAnalyzerInputStatic()); _forge = new ExprDotNodeForgeVariable(this, variable, wrap, evalsX.ChainWithUnpack); return null; } // try resolve as enumeration class with value var enumconstantDesc = ImportCompileTimeUtil.ResolveIdentAsEnumConst( firstItemName, validationContext.ImportService, validationContext.ClassProvidedExtension, false); if (enumconstantDesc != null && modifiedChain[0] is ChainableCall) { // try resolve method var methodSpec = (ChainableCall) modifiedChain[0]; var enumvalue = firstItemName; ExprNodeUtilResolveExceptionHandler handler = new ProxyExprNodeUtilResolveExceptionHandler() { ProcHandle = (ex) => { return new ExprValidationException( "Failed to resolve method '" + methodSpec.Name + "' on enumeration value '" + enumvalue + "': " + ex.Message); }, }; var wildcardType = validationContext.StreamTypeService.EventTypes.Length != 1 ? null : validationContext.StreamTypeService.EventTypes[0]; var methodDesc = ExprNodeUtilityResolve.ResolveMethodAllowWildcardAndStream( enumconstantDesc.Value.GetType().Name, enumconstantDesc.Value.GetType(), methodSpec.Name, methodSpec.Parameters, wildcardType != null, wildcardType, handler, methodSpec.Name, validationContext.StatementRawInfo, validationContext.StatementCompileTimeService); // method resolved, hook up modifiedChain.RemoveAt(0); // we identified this piece var optionalLambdaWrapX = ExprDotStaticMethodWrapFactory.Make( methodDesc.ReflectionMethod, modifiedChain, null, validationContext); var typeInfoX = optionalLambdaWrapX != null ? optionalLambdaWrapX.TypeInfo : EPTypeHelper.SingleValue(methodDesc.ReflectionMethod.ReturnType); var evalsX = ExprDotNodeUtility.GetChainEvaluators( null, typeInfoX, modifiedChain, validationContext, false, new ExprDotNodeFilterAnalyzerInputStatic()); _forge = new ExprDotNodeForgeStaticMethod( this, false, firstItemName, methodDesc.ReflectionMethod, methodDesc.ChildForges, false, evalsX.ChainWithUnpack, optionalLambdaWrapX, false, enumconstantDesc, validationContext.StatementName, methodDesc.IsLocalInlinedClass); return null; } // if prefixed by a stream name, we are giving up if (prefixedStreamNumException != null) { throw prefixedStreamNumException; } // If class then resolve as class var secondItem = modifiedChain.DeleteAt(0); var allowWildcard = validationContext.StreamTypeService.EventTypes.Length == 1; EventType streamZeroType = null; if (validationContext.StreamTypeService.EventTypes.Length > 0) { streamZeroType = validationContext.StreamTypeService.EventTypes[0]; } var secondItemName = secondItem.GetRootNameOrEmptyString(); var separator = string.IsNullOrWhiteSpace(secondItemName) ? "" : "."; var msgHandler = new ExprNodeUtilResolveExceptionHandlerDefault(firstItemName + separator + secondItemName, false); var method = ExprNodeUtilityResolve.ResolveMethodAllowWildcardAndStream( firstItemName, null, secondItem.GetRootNameOrEmptyString(), secondItem.GetParametersOrEmpty(), allowWildcard, streamZeroType, msgHandler, secondItem.GetRootNameOrEmptyString(), validationContext.StatementRawInfo, validationContext.StatementCompileTimeService); var isConstantParameters = method.IsAllConstants && _isUdfCache; var isReturnsConstantResult = isConstantParameters && modifiedChain.IsEmpty(); // this may return a pair of null if there is no lambda or the result cannot be wrapped for lambda-function use var optionalLambdaWrap = ExprDotStaticMethodWrapFactory.Make(method.ReflectionMethod, modifiedChain, null, validationContext); var typeInfo = optionalLambdaWrap != null ? optionalLambdaWrap.TypeInfo : EPTypeHelper.SingleValue(method.ReflectionMethod.ReturnType); var evals = ExprDotNodeUtility.GetChainEvaluators( null, typeInfo, modifiedChain, validationContext, false, new ExprDotNodeFilterAnalyzerInputStatic()); _forge = new ExprDotNodeForgeStaticMethod( this, isReturnsConstantResult, firstItemName, method.ReflectionMethod, method.ChildForges, isConstantParameters, evals.ChainWithUnpack, optionalLambdaWrap, false, null, validationContext.StatementName, method.IsLocalInlinedClass); return null; } private static PropertyInfoPairDesc HandlePropertyInfoPair( bool nestedComplexProperty, Chainable firstItem, IList<Chainable> chain, Pair<PropertyResolutionDescriptor, string> propertyInfoPair, bool hasEnumerationMethod, ExprValidationContext validationContext, ExprDotNodeImpl myself) { var streamTypeService = validationContext.StreamTypeService; var propertyName = propertyInfoPair.First.PropertyName; var streamId = propertyInfoPair.First.StreamNum; var streamType = (EventTypeSPI) streamTypeService.EventTypes[streamId]; ExprEnumerationForge enumerationForge = null; EPType inputType; ExprForge rootNodeForge = null; EventPropertyGetterSPI getter; var rootIsEventBean = false; if (firstItem is ChainableName) { getter = streamType.GetGetterSPI(propertyName); // Handle first-chainable not an array if (!(chain[0] is ChainableArray)) { var allowEnum = nestedComplexProperty || hasEnumerationMethod; var propertyEval = ExprDotNodeUtility.GetPropertyEnumerationSource( propertyName, streamId, streamType, allowEnum, validationContext.IsDisablePropertyExpressionEventCollCache); enumerationForge = propertyEval.Enumeration; inputType = propertyEval.ReturnType; rootNodeForge = new PropertyDotNonLambdaForge(streamId, getter, propertyInfoPair.First.PropertyType.GetBoxedType()); } else { // first-chainable is an array, use array-of-fragments or array-of-type var array = (ChainableArray) chain[0]; var indexExpression = ChainableArray.ValidateSingleIndexExpr(array.Indexes, () => "property '" + propertyName + "'"); var propertyType = streamType.GetPropertyType(propertyName); var fragmentEventType = streamType.GetFragmentType(propertyName); if (fragmentEventType != null && fragmentEventType.IsIndexed) { // handle array-of-fragment by including the array operation in the root inputType = EPTypeHelper.SingleEvent(fragmentEventType.FragmentType); chain = chain.SubList(1, chain.Count); // we remove the array operation from the chain as its handled by the forge rootNodeForge = new PropertyDotNonLambdaFragmentIndexedForge(streamId, getter, indexExpression, propertyName); rootIsEventBean = true; } else if (propertyType.IsArray) { // handle array-of-type by simple property and array operation as part of chain inputType = EPTypeHelper.SingleValue(propertyType); rootNodeForge = new PropertyDotNonLambdaForge(streamId, getter, propertyInfoPair.First.PropertyType.GetBoxedType()); } else { throw new ExprValidationException("Invalid array operation for property '" + propertyName + "'"); } } } else { // property with parameter - mapped or indexed property getter = null; var call = (ChainableCall) firstItem; var desc = EventTypeUtility.GetNestablePropertyDescriptor( streamTypeService.EventTypes[propertyInfoPair.First.StreamNum], call.Name); if (call.Parameters.Count > 1) { throw new ExprValidationException("Property '" + call.Name + "' may not be accessed passing 2 or more parameters"); } var paramEval = call.Parameters[0].Forge; inputType = EPTypeHelper.SingleValue(desc.PropertyComponentType); if (desc.IsMapped) { if (paramEval.EvaluationType != typeof(string)) { throw new ExprValidationException( "Parameter expression to mapped property '" + propertyName + "' is expected to return a string-type value but returns " + paramEval.EvaluationType.CleanName()); } var mappedGetter = ((EventTypeSPI) propertyInfoPair.First.StreamEventType).GetGetterMappedSPI(propertyName); if (mappedGetter == null) { throw new ExprValidationException("Mapped property named '" + propertyName + "' failed to obtain getter-object"); } rootNodeForge = new PropertyDotNonLambdaMappedForge(streamId, mappedGetter, paramEval, desc.PropertyComponentType); } if (desc.IsIndexed) { if (paramEval.EvaluationType.GetBoxedType() != typeof(int?)) { throw new ExprValidationException( "Parameter expression to mapped property '" + propertyName + "' is expected to return a Integer-type value but returns " + paramEval.EvaluationType.CleanName()); } var indexedGetter = ((EventTypeSPI) propertyInfoPair.First.StreamEventType).GetGetterIndexedSPI(propertyName); if (indexedGetter == null) { throw new ExprValidationException("Mapped property named '" + propertyName + "' failed to obtain getter-object"); } rootNodeForge = new PropertyDotNonLambdaIndexedForge(streamId, indexedGetter, paramEval, desc.PropertyComponentType); } } // try to build chain based on the input (non-fragment) ExprDotNodeRealizedChain evals; var filterAnalyzerInputProp = new ExprDotNodeFilterAnalyzerInputProp(propertyInfoPair.First.StreamNum, propertyName); try { evals = ExprDotNodeUtility.GetChainEvaluators(streamId, inputType, chain, validationContext, myself._isDuckTyping, filterAnalyzerInputProp); } catch (ExprValidationException) { if (inputType is EventEPType || inputType is EventMultiValuedEPType) { throw; } // try building the chain based on the fragment event type (i.e. A.after(B) based on A-configured start time where A is a fragment) var fragment = propertyInfoPair.First.FragmentEventType; if (fragment == null) { throw; } rootIsEventBean = true; EPType fragmentTypeInfo; if (!fragment.IsIndexed) { if (chain[0] is ChainableArray) { throw new ExprValidationException("Cannot perform array operation as property '" + propertyName + "' does not return an array"); } fragmentTypeInfo = EPTypeHelper.SingleEvent(fragment.FragmentType); } else { fragmentTypeInfo = EPTypeHelper.ArrayOfEvents(fragment.FragmentType); } inputType = fragmentTypeInfo; rootNodeForge = new PropertyDotNonLambdaFragmentForge(streamId, getter, fragment.IsIndexed); evals = ExprDotNodeUtility.GetChainEvaluators( propertyInfoPair.First.StreamNum, fragmentTypeInfo, chain, validationContext, myself._isDuckTyping, filterAnalyzerInputProp); } var filterExprAnalyzerAffector = evals.FilterAnalyzerDesc; var streamNumReferenced = propertyInfoPair.First.StreamNum; var forge = new ExprDotNodeForgeRootChild( myself, filterExprAnalyzerAffector, streamNumReferenced, propertyName, hasEnumerationMethod, rootNodeForge, enumerationForge, inputType, evals.Chain, evals.ChainWithUnpack, !rootIsEventBean); return new PropertyInfoPairDesc(forge); } private Pair<ExprDotNodeAggregationMethodRootNode, IList<Chainable>> HandleAggregationMethod(ExprValidationContext validationContext) { if (_chainSpec.IsEmpty() || ChildNodes.Length == 0) { return null; } var chainFirst = _chainSpec[0]; if (chainFirst is ChainableArray) { return null; } var rootNode = ChildNodes[0]; var aggMethodParams = chainFirst.GetParametersOrEmpty().ToArray(); var aggMethodName = chainFirst.GetRootNameOrEmptyString(); // handle property, such as "sortedcolumn.floorKey('a')" since "floorKey" can also be a property if (chainFirst is ChainableName) { var prop = PropertyParserNoDep.ParseAndWalkLaxToSimple(chainFirst.GetRootNameOrEmptyString(), false); if (prop is MappedProperty) { var mappedProperty = (MappedProperty) prop; aggMethodName = mappedProperty.PropertyNameAtomic; aggMethodParams = new ExprNode[] {new ExprConstantNodeImpl(mappedProperty.Key)}; } } if (!(rootNode is ExprTableAccessNodeSubprop) && !(rootNode is ExprAggMultiFunctionNode) && !(rootNode is ExprTableIdentNode)) { return null; } ExprDotNodeAggregationMethodForge aggregationMethodForge; if (rootNode is ExprAggMultiFunctionNode) { // handle local aggregation var mf = (ExprAggMultiFunctionNode) rootNode; if (!mf.AggregationForgeFactory.AggregationPortableValidation.IsAggregationMethod(aggMethodName, aggMethodParams, validationContext)) { return null; } aggregationMethodForge = new ExprDotNodeAggregationMethodForgeLocal( this, aggMethodName, aggMethodParams, mf.AggregationForgeFactory.AggregationPortableValidation, mf); } else if (rootNode is ExprTableIdentNode) { // handle table-column via from-clause var tableSubprop = (ExprTableIdentNode) rootNode; var column = tableSubprop.TableMetadata.Columns.Get(tableSubprop.ColumnName); if (!(column is TableMetadataColumnAggregation)) { return null; } var columnAggregation = (TableMetadataColumnAggregation) column; if (aggMethodName.ToLowerInvariant().Equals("reset")) { if (!validationContext.IsAllowTableAggReset) { throw new ExprValidationException(AggregationPortableValidationBase.INVALID_TABLE_AGG_RESET); } aggregationMethodForge = new ExprDotNodeAggregationMethodForgeTableReset( this, aggMethodName, aggMethodParams, columnAggregation.AggregationPortableValidation, tableSubprop, columnAggregation); } else { if (columnAggregation.IsMethodAgg || !columnAggregation.AggregationPortableValidation.IsAggregationMethod(aggMethodName, aggMethodParams, validationContext)) { return null; } aggregationMethodForge = new ExprDotNodeAggregationMethodForgeTableIdent( this, aggMethodName, aggMethodParams, columnAggregation.AggregationPortableValidation, tableSubprop, columnAggregation); } } else if (rootNode is ExprTableAccessNodeSubprop) { // handle table-column via table-access var tableSubprop = (ExprTableAccessNodeSubprop) rootNode; var column = tableSubprop.TableMeta.Columns.Get(tableSubprop.SubpropName); if (!(column is TableMetadataColumnAggregation)) { return null; } var columnAggregation = (TableMetadataColumnAggregation) column; if (columnAggregation.IsMethodAgg || !columnAggregation.AggregationPortableValidation.IsAggregationMethod(aggMethodName, aggMethodParams, validationContext)) { return null; } aggregationMethodForge = new ExprDotNodeAggregationMethodForgeTableAccess( this, aggMethodName, aggMethodParams, columnAggregation.AggregationPortableValidation, tableSubprop, columnAggregation); } else { throw new IllegalStateException("Unhandled aggregation method root node"); } // validate aggregationMethodForge.Validate(validationContext); var newChain = _chainSpec.Count == 1 ? (IList<Chainable>) EmptyList<Chainable>.Instance : new List<Chainable>(_chainSpec.SubList(1, _chainSpec.Count)); var root = new ExprDotNodeAggregationMethodRootNode(aggregationMethodForge); root.AddChildNode(rootNode); return new Pair<ExprDotNodeAggregationMethodRootNode, IList<Chainable>>(root, newChain); } public FilterExprAnalyzerAffector GetAffector(bool isOuterJoin) { CheckValidated(_forge); return isOuterJoin ? null : _forge.FilterExprAnalyzerAffector; } private ExprDotNodeForge GetPropertyPairEvaluator( ExprForge parameterForge, Pair<PropertyResolutionDescriptor, string> propertyInfoPair, ExprValidationContext validationContext) { var propertyName = propertyInfoPair.First.PropertyName; var propertyDesc = EventTypeUtility.GetNestablePropertyDescriptor(propertyInfoPair.First.StreamEventType, propertyName); if (propertyDesc == null || (!propertyDesc.IsMapped && !propertyDesc.IsIndexed)) { throw new ExprValidationException( "Unknown single-row function, aggregation function or mapped or indexed property named '" + propertyName + "' could not be resolved"); } var streamNum = propertyInfoPair.First.StreamNum; EventPropertyGetterMappedSPI mappedGetter = null; EventPropertyGetterIndexedSPI indexedGetter = null; var propertyType = typeof(object); if (propertyDesc.IsMapped) { if (parameterForge.EvaluationType != typeof(string)) { throw new ExprValidationException( "Parameter expression to mapped property '" + propertyDesc.PropertyName + "' is expected to return a string-type value but returns " + parameterForge.EvaluationType.CleanName()); } mappedGetter = ((EventTypeSPI) propertyInfoPair.First.StreamEventType).GetGetterMappedSPI(propertyInfoPair.First.PropertyName); if (mappedGetter == null) { throw new ExprValidationException("Mapped property named '" + propertyName + "' failed to obtain getter-object"); } } else { if (parameterForge.EvaluationType.GetBoxedType() != typeof(int?)) { throw new ExprValidationException( "Parameter expression to indexed property '" + propertyDesc.PropertyName + "' is expected to return a Integer-type value but returns " + parameterForge.EvaluationType.CleanName()); } indexedGetter = ((EventTypeSPI) propertyInfoPair.First.StreamEventType).GetGetterIndexedSPI(propertyInfoPair.First.PropertyName); if (indexedGetter == null) { throw new ExprValidationException("Indexed property named '" + propertyName + "' failed to obtain getter-object"); } } if (propertyDesc.PropertyComponentType != null) { propertyType = propertyDesc.PropertyComponentType.GetBoxedType(); } return new ExprDotNodeForgePropertyExpr( this, validationContext.StatementName, propertyDesc.PropertyName, streamNum, parameterForge, propertyType, indexedGetter, mappedGetter); } private int PrefixedStreamName( IList<Chainable> chainSpec, StreamTypeService streamTypeService) { if (chainSpec.Count < 1) { return -1; } var spec = chainSpec[0]; if (!(spec is ChainableName)) { return -1; } var name = (ChainableName) spec; return streamTypeService.GetStreamNumForStreamName(name.Name); } public override void Accept(ExprNodeVisitor visitor) { base.Accept(visitor); ExprNodeUtilityQuery.AcceptChain(visitor, _chainSpec); } public override void Accept(ExprNodeVisitorWithParent visitor) { base.Accept(visitor); ExprNodeUtilityQuery.AcceptChain(visitor, _chainSpec); } public override void AcceptChildnodes( ExprNodeVisitorWithParent visitor, ExprNode parent) { base.AcceptChildnodes(visitor, parent); ExprNodeUtilityQuery.AcceptChain(visitor, _chainSpec, this); } public override void ReplaceUnlistedChildNode( ExprNode nodeToReplace, ExprNode newNode) { ExprNodeUtilityModify.ReplaceChainChildNode(nodeToReplace, newNode, _chainSpec); } public IList<Chainable> ChainSpec { get => _chainSpec; set => _chainSpec = value.AsReadOnlyList(); } public ExprEvaluator ExprEvaluator { get { CheckValidated(_forge); return _forge.ExprEvaluator; } } public bool IsConstantResult { get { CheckValidated(_forge); return _forge.IsReturnsConstantResult; } } public override ExprForge Forge { get { CheckValidated(_forge); return _forge; } } public int? StreamReferencedIfAny { get { CheckValidated(_forge); return _forge.StreamNumReferenced; } } public string RootPropertyNameIfAny { get { CheckValidated(_forge); return _forge.RootPropertyName; } } public override void ToPrecedenceFreeEPL( TextWriter writer, ExprNodeRenderableFlags flags) { if (ChildNodes.Length != 0) { writer.Write(ExprNodeUtilityPrint.ToExpressionStringMinPrecedenceSafe(ChildNodes[0])); } ExprNodeUtilityPrint.ToExpressionString(_chainSpec, writer, ChildNodes.Length != 0, null); } public override ExprPrecedenceEnum Precedence => ExprPrecedenceEnum.UNARY; public IDictionary<string, object> EventType => null; public override bool EqualsNode( ExprNode node, bool ignoreStreamPrefix) { if (!(node is ExprDotNodeImpl)) { return false; } var other = (ExprDotNodeImpl) node; if (other._chainSpec.Count != _chainSpec.Count) { return false; } for (var i = 0; i < _chainSpec.Count; i++) { if (!_chainSpec[i].Equals(other._chainSpec[i])) { return false; } } return true; } public IList<ExprNode> AdditionalNodes => ExprNodeUtilityQuery.CollectChainParameters(_chainSpec); public VariableMetaData IsVariableOpGetName(VariableCompileTimeResolver variableCompileTimeResolver) { if (_chainSpec.Count > 0 && _chainSpec[0] is ChainableName) { return variableCompileTimeResolver.Resolve(((ChainableName) _chainSpec[0]).Name); } return null; } private ExprValidationException HandleNotFound(string name) { var appDotMethodDidYouMean = GetAppDotMethodDidYouMean(); var message = "Unknown single-row function, expression declaration, script or aggregation function named '" + name + "' could not be resolved"; if (appDotMethodDidYouMean != null) { message += " (did you mean '" + appDotMethodDidYouMean + "')"; } return new ExprValidationException(message); } private string GetAppDotMethodDidYouMean() { var lhsName = _chainSpec[0].GetRootNameOrEmptyString().ToLowerInvariant(); if (lhsName.Equals("rectangle")) { return "rectangle.intersects"; } if (lhsName.Equals("point")) { return "point.inside"; } return null; } private ExprAppDotMethodImpl GetAppDotMethod(bool filterExpression) { if (_chainSpec.Count < 2) { return null; } if (!(_chainSpec[1] is ChainableCall)) { return null; } var call = (ChainableCall) _chainSpec[1]; var lhsName = _chainSpec[0].GetRootNameOrEmptyString(); var operationName = call.Name.ToLowerInvariant(); var pointInside = lhsName.Equals("point") && operationName.Equals("inside"); var rectangleIntersects = lhsName.Equals("rectangle") && operationName.Equals("intersects"); if (!pointInside && !rectangleIntersects) { return null; } if (call.Parameters.Count != 1) { throw GetAppDocMethodException(lhsName, operationName); } var param = call.Parameters[0]; if (!(param is ExprDotNode)) { throw GetAppDocMethodException(lhsName, operationName); } var compared = (ExprDotNode) call.Parameters[0]; if (compared.ChainSpec.Count != 1) { throw GetAppDocMethodException(lhsName, operationName); } var rhsName = compared.ChainSpec[0].GetRootNameOrEmptyString().ToLowerInvariant(); var pointInsideRectangle = pointInside && rhsName.Equals("rectangle"); var rectangleIntersectsRectangle = rectangleIntersects && rhsName.Equals("rectangle"); if (!pointInsideRectangle && !rectangleIntersectsRectangle) { throw GetAppDocMethodException(lhsName, operationName); } var lhsExpressions = _chainSpec[0].GetParametersOrEmpty(); ExprNode[] indexNamedParameter = null; IList<ExprNode> lhsExpressionsValues = new List<ExprNode>(); foreach (var lhsExpression in lhsExpressions) { if (lhsExpression is ExprNamedParameterNode) { var named = (ExprNamedParameterNode) lhsExpression; if (named.ParameterName.Equals(ExprDotNodeConstants.FILTERINDEX_NAMED_PARAMETER, StringComparison.InvariantCultureIgnoreCase)) { if (!filterExpression) { throw new ExprValidationException("The '" + named.ParameterName + "' named parameter can only be used in in filter expressions"); } indexNamedParameter = named.ChildNodes; } else { throw new ExprValidationException(lhsName + " does not accept '" + named.ParameterName + "' as a named parameter"); } } else { lhsExpressionsValues.Add(lhsExpression); } } var lhs = ExprNodeUtilityQuery.ToArray(lhsExpressionsValues); var rhs = ExprNodeUtilityQuery.ToArray(compared.ChainSpec[0].GetParametersOrEmpty()); SettingsApplicationDotMethod predefined; if (pointInsideRectangle) { predefined = new SettingsApplicationDotMethodPointInsideRectangle(this, lhsName, lhs, operationName, rhsName, rhs, indexNamedParameter); } else { predefined = new SettingsApplicationDotMethodRectangeIntersectsRectangle(this, lhsName, lhs, operationName, rhsName, rhs, indexNamedParameter); } return new ExprAppDotMethodImpl(predefined); } public bool IsLocalInlinedClass => _forge.IsLocalInlinedClass; private ExprValidationException GetAppDocMethodException( string lhsName, string operationName) { return new ExprValidationException(lhsName + "." + operationName + " requires a single rectangle as parameter"); } private class PropertyInfoPairDesc { public PropertyInfoPairDesc(ExprDotNodeForgeRootChild forge) { Forge = forge; } public ExprDotNodeForgeRootChild Forge { get; } public void Apply(ExprDotNodeImpl node) { node._forge = Forge; } } } } // end of namespace
espertechinc/nesper
src/NEsper.Common/common/internal/epl/expression/dot/core/ExprDotNodeImpl.cs
C#
gpl-2.0
41,544
package org.openymsg.legacy.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.experimental.categories.Category; import org.openymsg.SlowTest; import org.openymsg.legacy.network.FireEvent; import org.openymsg.legacy.network.ServiceType; import org.openymsg.legacy.network.Session; import org.openymsg.legacy.network.Status; import org.openymsg.legacy.network.YahooProtocol; import org.openymsg.legacy.network.YahooUser; import org.openymsg.legacy.network.event.SessionFriendEvent; import org.openymsg.legacy.network.event.WaitListener; import org.openymsg.legacy.roster.Roster; import java.io.IOException; import java.util.Collection; import java.util.HashSet; public class StatusIT extends YahooTestAbstract { /** * Checks if every Status long value is unique. */ @Test public void testGetValue() { final Collection<Long> checkedValues = new HashSet<Long>(); final Status[] types = Status.values(); for (int i = 0; i < types.length; i++) { final Long statusLongValue = Long.valueOf(types[i].getValue()); assertFalse("Non-unique Status value " + types[i].getValue(), checkedValues.contains(statusLongValue)); checkedValues.add(statusLongValue); } } // @Test public void testChangeStatus() throws IllegalArgumentException, IOException { final Roster roster = sess1.getRoster(); final boolean existinList = roster.containsUser(OTHERUSR); if (!existinList) { roster.add(new YahooUser(OTHERUSR, "group", YahooProtocol.YAHOO)); listener1.waitForEvent(5, ServiceType.FRIENDADD); } changeStatus(Status.BRB); changeStatus(Status.BUSY); changeStatus(Status.NOTATHOME); changeStatus(Status.NOTATDESK); changeStatus(Status.NOTINOFFICE); changeStatus(Status.ONPHONE); changeStatus(Status.ONVACATION); changeStatus(Status.OUTTOLUNCH); changeStatus(Status.STEPPEDOUT); changeStatus(Status.INVISIBLE); changeStatus(Status.OFFLINE); changeStatus(Status.AVAILABLE); } // @Test // TODO: this test fails because the two user are not subscribed to each // other. public void testReceiveLogoutStatus() throws Exception { sess2.logout(); FireEvent event = listener1.waitForEvent(5, ServiceType.Y6_STATUS_UPDATE); assertNotNull(event); System.out.println(event); SessionFriendEvent sfe = (SessionFriendEvent) event.getEvent(); assertEquals(sfe.getUser().getId(), OTHERUSR); assertEquals(sfe.getUser().getStatus(), Status.OFFLINE); sess2.login(OTHERUSR, OTHERPWD); } private void changeStatus(Status status) throws IllegalArgumentException, IOException { listener1.clearEvents(); sess2.setStatus(status); FireEvent event = listener1.waitForEvent(5, ServiceType.Y6_STATUS_UPDATE); assertNotNull(event); SessionFriendEvent sfe = (SessionFriendEvent) event.getEvent(); assertEquals(sfe.getUser().getId(), OTHERUSR); assertEquals(sfe.getUser().getStatus(), status); } @Test @Category(SlowTest.class) public void testServerBanYouout4AnotherLoginWithSameUser() throws Exception { Session sessKiller = new Session(); listener2.clearEvents(); Thread.sleep(500); WaitListener sl = new WaitListener(sessKiller); sessKiller.login(OTHERUSR, OTHERPWD); sl.waitForEvent(5, ServiceType.LOGON); FireEvent event = listener2.waitForEvent(5, ServiceType.LOGOFF); assertNotNull(event); sess2.login(OTHERUSR, OTHERPWD); listener2.waitForEvent(5, ServiceType.LOGON); } }
OpenYMSG/openymsg
src/test/java/org/openymsg/legacy/test/StatusIT.java
Java
gpl-2.0
3,490
package de.bitbrain.craft.graphics.shader; import com.badlogic.gdx.graphics.g2d.Batch; /** * Handles multiple shaders for a single target * * @author Miguel Gonzalez <miguel-gonzalez@gmx.de> * @since 0.1 * @version 0.1 */ public interface ShadeArea { // =========================================================== // Constants // =========================================================== // =========================================================== // Methods // =========================================================== /** * * * @param batch * @param delta * @param currentShader */ void draw(Batch batch, float delta); }
bitbrain-gaming/craft
core/src/de/bitbrain/craft/graphics/shader/ShadeArea.java
Java
gpl-2.0
676
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package utilesFXAvisos.forms.util; import ListDatos.IBusquedaListener; import utilesFX.*; import ListDatos.IFilaDatos; import ListDatos.JListDatos; import javafx.collections.ObservableList; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; /** * * @author eduardo */ public class JTableViewEventos extends JTableViewCZ { private IBusquedaListener moListRecuperar; public JTableViewEventos() { super(); } @Override public void setModel(JListDatos poList, ObservableList<IFilaDatos> poListObservable) throws Exception { moList = poList; asignarEventos(); getColumns().clear(); layout(); TableColumn filaCol = new TableColumn("Tareas"); filaCol.setCellFactory(column -> { return new TableCell<IFilaDatos, IFilaDatos>() { private JPanelTableRender moRenderEventos = new JPanelTableRender(); private JTableRenderEventoParam moParam = new JTableRenderEventoParam(); @Override protected void updateItem(IFilaDatos item, boolean empty) { super.updateItem(item, empty); if (item == null || empty) { setText(null); setStyle(""); } else { moParam.setFila((IFilaDatos)item ); moRenderEventos.setValue(moParam, false); setGraphic(moRenderEventos); } } }; }); filaCol.setCellValueFactory(new TableCellValueEventos()); filaCol.setOnEditCommit(null); filaCol.setId(String.valueOf(0)); filaCol.setEditable(poList.getFields(0).isEditable()); getColumns().add(filaCol); reengancharTabla(poList, poListObservable); } }
Creativa3d/box3d
paquetesGUIFX/src/utilesFXAvisos/forms/util/JTableViewEventos.java
Java
gpl-2.0
2,135
<?php defined('WYSIJA') or die('Restricted access'); class WYSIJA_control_front_confirm extends WYSIJA_control_front{ var $model='user'; var $view='confirm'; function WYSIJA_control_front_confirm(){ parent::WYSIJA_control_front(); } function _testKeyuser(){ $this->helperUser=WYSIJA::get('user','helper'); $this->userData=$this->helperUser->checkUserKey(); add_action('init',array($this,'testsession')); if(!$this->userData){ $this->title=__('Page does not exist.',WYSIJA); $this->subtitle=__('Please verify your link to this page.',WYSIJA); return false; } return true; } /** * confirm subscription page * return boolean */ function subscribe(){ $list_ids=array(); if(isset($_REQUEST['wysiconf'])) $list_ids= unserialize(base64_decode($_REQUEST['wysiconf'])); $model_list=WYSIJA::get('list','model'); $lists_names_res=$model_list->get(array('name'),array('list_id'=>$list_ids)); $names=array(); foreach($lists_names_res as $nameob) $names[]=$nameob['name']; $model_config=WYSIJA::get('config','model'); // we need to call the translation otherwise it will not be loaded and translated $model_config->add_translated_default(); $this->title=$model_config->getValue('subscribed_title'); if(!isset($model_config->values['subscribed_title'])) $this->title=__('You\'ve subscribed to: %1$s',WYSIJA); $this->title=sprintf($this->title, implode(', ', $names)); $this->subtitle=$model_config->getValue('subscribed_subtitle'); if(!isset($model_config->values['subscribed_subtitle'])) $this->subtitle=__("Yup, we've added you to our list. You'll hear from us shortly.",WYSIJA); if(!isset($_REQUEST['demo'])){ if($this->_testKeyuser()){ //user is not confirmed yet if((int)$this->userData['details']['status']<1){ $this->helperUser->subscribe($this->userData['details']['user_id'],true, false,$list_ids); $this->helperUser->uid=$this->userData['details']['user_id']; // send a notification to the email specified in the settings if required to if($model_config->getValue('emails_notified') && $model_config->getValue('emails_notified_when_sub')){ $this->helperUser->_notify($this->userData['details']['email']); } return true; }else{ if(isset($_REQUEST['wysiconf'])){ $needs_subscription=false; foreach($this->userData['lists'] as $list){ if(in_array($list['list_id'],$list_ids) && (int)$list['sub_date']<1){ $needs_subscription=true; } } if($needs_subscription){ $this->helperUser->subscribe($this->userData['details']['user_id'],true,false,$list_ids); $this->title=sprintf($model_config->getValue('subscribed_title'), implode(', ', $names)); $this->subtitle=$model_config->getValue('subscribed_subtitle'); // send a notification to the email specified in the settings if required to if($model_config->getValue('emails_notified') && $model_config->getValue('emails_notified_when_sub')){ $this->helperUser->_notify($this->userData['details']['email'], true, $list_ids); } }else{ $this->title=sprintf(__('You are already subscribed to : %1$s',WYSIJA), implode(', ', $names)); } }else{ $this->title=__('You are already subscribed.',WYSIJA); } return true; } } } return true; } function unsubscribe(){ $model_config=WYSIJA::get('config','model'); // we need to call the translation otherwise it will not be loaded and translated $model_config->add_translated_default(); $this->title=$model_config->getValue('unsubscribed_title'); if(!isset($model_config->values['unsubscribed_title'])) $this->title=__("You've unsubscribed!",WYSIJA); $this->subtitle=$model_config->getValue('unsubscribed_subtitle'); if(!isset($model_config->values['unsubscribed_subtitle'])) $this->subtitle=__("Great, you'll never hear from us again!",WYSIJA); $undo_paramsurl=array( 'wysija-page'=>1, 'controller'=>'confirm', 'action'=>'undounsubscribe', 'wysija-key'=>$_REQUEST['wysija-key'] ); if(!isset($_REQUEST['demo'])){ if($this->_testKeyuser()){ $statusint=(int)$this->userData['details']['status']; if( ($model_config->getValue('confirm_dbleoptin') && $statusint>0) || (!$model_config->getValue('confirm_dbleoptin') && $statusint>=0)){ $listids=$this->helperUser->unsubscribe($this->userData['details']['user_id']); $this->helperUser->uid=$this->userData['details']['user_id']; if($model_config->getValue('emails_notified') && $model_config->getValue('emails_notified_when_unsub')) $this->helperUser->_notify($this->userData['details']['email'],false,$listids); }else{ $this->title=__('You are already unsubscribed.',WYSIJA); return false; } } } else $undo_paramsurl['demo'] = 1; $this->subtitle .= str_replace( array('[link]','[/link]'), array('<a href="'.WYSIJA::get_permalink($model_config->getValue('confirm_email_link'),$undo_paramsurl).'">','</a>'), '<p><b>'.__('You made a mistake? [link]Undo unsubscribe[/link].',WYSIJA)).'</b></p>'; return true; } function undounsubscribe(){ $model_config=WYSIJA::get('config','model'); // we need to call the translation otherwise it will not be loaded and translated $model_config->add_translated_default(); $this->title =__("You've been subscribed!",WYSIJA); $user_object = false; if(!isset($_REQUEST['demo'])){ if($this->_testKeyuser()){ $user_object = (object)$this->userData['details']; $this->helperUser->undounsubscribe($this->userData['details']['user_id']); } } //manage subcription link if(($model_config->getValue('manage_subscriptions'))){ $helper_user = WYSIJA::get('config','helper'); $model_user = WYSIJA::get('user','model'); $editsubscriptiontxt = $model_config->getValue('manage_subscriptions_linkname'); if(empty($editsubscriptiontxt)) $editsubscriptiontxt =__('Edit your subscription',WYSIJA); $this->subtitle = '<p>'.$model_user->getEditsubLink($user_object,false,'').'.</p>'; } return true; } function subscriptions(){ $data=array(); //get the user_id out of the params passed if($this->_testKeyuser()){ $data['user']=$this->userData; //get the list of user $model_list=WYSIJA::get('list','model'); $model_list->orderBy('ordering','ASC'); $data['list']=$model_list->get(array('list_id','name','description'),array('is_enabled'=>true,'is_public'=>true)); $this->title=sprintf(__('Edit your subscriber profile: %1$s',WYSIJA),$data['user']['details']['email']); $this->subtitle=$this->viewObj->subscriptions($data); return true; } } function resend(){ $this->title='The link you clicked has expired'; $this->subtitle=$this->viewObj->resend(); } function resendconfirm(){ //make sure the user has the right to access this action if($this->requireSecurity()){ //resend email $helper_mailer=WYSIJA::get('mailer','helper'); $helper_mailer->sendOne((int)$_REQUEST['email_id'],(int)$_REQUEST['user_id']); $this->title='Please check your inbox!'; $this->subtitle='<h3>A new email with working links has been sent to you.<h3/>'; } } function save(){ //get the user_id out of the params passed */ if($this->_testKeyuser()){ //update the general details */ $userid=$_REQUEST['wysija']['user']['user_id']; unset($_REQUEST['wysija']['user']['user_id']); $model_config=WYSIJA::get('config','model'); // we need to call the translation otherwise it will not be loaded and translated $model_config->add_translated_default(); $this->helperUser->uid=$userid; //if the status changed we might need to send notifications */ if((int)$_REQUEST['wysija']['user']['status'] !=(int)$this->userData['details']['status']){ if($_REQUEST['wysija']['user']['status']>0){ if($model_config->getValue('emails_notified_when_sub')) $this->helperUser->_notify($this->userData['details']['email']); }else{ if($model_config->getValue('emails_notified_when_unsub')) $this->helperUser->_notify($this->userData['details']['email'],false); } } //check whether the email address has changed if so then we should make sure that the new address doesnt exists already if(isset($_REQUEST['wysija']['user']['email'])){ $_REQUEST['wysija']['user']['email']=trim($_REQUEST['wysija']['user']['email']); if($this->userData['details']['email']!=$_REQUEST['wysija']['user']['email']){ $this->modelObj->reset(); $result=$this->modelObj->getOne(false,array('email'=>$_REQUEST['wysija']['user']['email'])); if($result){ $this->error(sprintf(__('Email %1$s already exists.',WYSIJA),$_REQUEST['wysija']['user']['email']),1); unset($_REQUEST['wysija']['user']['email']); } } } $this->modelObj->update($_REQUEST['wysija']['user'],array('user_id'=>$userid)); $id=$userid; $hUser=WYSIJA::get('user','helper'); //update the list subscriptions */ //run the unsubscribe process if needed if((int)$_REQUEST['wysija']['user']['status']==-1){ $hUser->unsubscribe($id); } //update subscriptions */ $modelUL=WYSIJA::get('user_list','model'); $modelUL->backSave=true; /* list of core list */ $modelLIST=WYSIJA::get('list','model'); $results=$modelLIST->get(array('list_id'),array('is_enabled'=>'0')); $core_listids=array(); foreach($results as $res){ $core_listids[]=$res['list_id']; } //0 - get current lists of the user $userlists=$modelUL->get(array('list_id','unsub_date'),array('user_id'=>$id)); $oldlistids=$newlistids=array(); foreach($userlists as $listdata) $oldlistids[$listdata['list_id']]=$listdata['unsub_date']; $config=WYSIJA::get('config','model'); $dbloptin=$config->getValue('confirm_dbleoptin'); //1 - insert new user_list if(isset($_POST['wysija']['user_list']) && $_POST['wysija']['user_list']){ $modelUL->reset(); $modelUL->update(array('sub_date'=>time()),array('user_id'=>$id)); foreach($_POST['wysija']['user_list']['list_id'] as $list_id){ //if the list is not already recorded for the user then we will need to insert it if(!isset($oldlistids[$list_id])){ $modelUL->reset(); $newlistids[]=$list_id; $dataul=array('user_id'=>$id,'list_id'=>$list_id,'sub_date'=>time()); //if double optin is on then we want to send a confirmation email for newly added subscription if($dbloptin){ unset($dataul['sub_date']); $modelUL->nohook=true; } $modelUL->insert($dataul); //if the list is recorded already then let's check the status, if it is an unsubed one then we update it }else{ if($oldlistids[$list_id]>0){ $modelUL->reset(); $modelUL->update(array('unsub_date'=>0,'sub_date'=>time()),array('user_id'=>$id,'list_id'=>$list_id)); } //$alreadysubscribelistids[]=$list_id; } } } //if a confirmation email needs to be sent then we send it if($dbloptin && !empty($newlistids)){ $hUser->sendConfirmationEmail($id,true,$newlistids); } // list ids $list_ids = !empty($_POST['wysija']['user_list']['list_id']) ? $_POST['wysija']['user_list']['list_id'] : array(); if(is_array($list_ids) === false) $list_ids = array(); $notEqual = array_merge($core_listids, $list_ids); //delete the lists from which you've removed yourself $condiFirst = array('notequal'=>array('list_id'=> $notEqual), 'equal' => array('user_id' => $id, 'unsub_date' => 0)); $modelUL=WYSIJA::get('user_list','model'); $modelUL->update(array('unsub_date'=>time()),$condiFirst); $modelUL->reset(); $this->notice(__('Newsletter profile has been updated.',WYSIJA)); $this->subscriptions(); //reset post otherwise wordpress will not recognise the post !!! $_POST=array(); } return true; } }
eyanai/hop
wp-content/plugins/wysija-newsletters/controllers/front/confirm.php
PHP
gpl-2.0
14,472
<?php include("config_mynonprofit.php"); include("connect.php"); include("functions.php"); include("template_header.php"); ?> <h1>A confirmation email has been sent</h1><p>Follow the enclosed link to activate your account.</p> </body> </html>
Enjabain/My-NP
register-success.php
PHP
gpl-2.0
244
package netdata.packet; import netdata.Payload; public class ARPpacket extends Packet{ public enum OPERATION{ REQUEST, REPLY }; private int type; private OPERATION arpOp; private String sourceMAC, destMAC = null; public ARPpacket(String sourceip, String destip, String sourceMAC, String destMAC, int type, OPERATION op, short TTL) { super(sourceip, destip, TTL, null); this.sourceMAC = sourceMAC; this.destMAC = destMAC; this.type = type; this.arpOp = op; // TODO Auto-generated constructor stub } public int getProtocolType() { return type; } public OPERATION getOperation() { return arpOp; } public String getSourceMAC() { return sourceMAC; } public String getDestinationMAC() { return destMAC; } }
frawg/NetFramework
src/netdata/packet/ARPpacket.java
Java
gpl-2.0
768
<?php /** * @version SVN: <svn_id> * @package Quick2cart * @author Techjoomla <extensions@techjoomla.com> * @copyright Copyright (c) 2009-2016 TechJoomla. All rights reserved. * @license GNU General Public License version 2 or later. */ // No direct access. defined('_JEXEC') or die(); jimport('joomla.form.formfield'); /** * Supports an HTML select list of gateways * * @since 1.6 */ class JFormFieldBssetup extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'Bssetup'; /** * Function to fetch elements * * @return STRING html */ public function getInput() { return $this->fetchElement($this->name, $this->value, $this->element, $this->options['control']); } /** * Function to fetch elements * * @param STRING $name name * @param STRING $value value * @param STRING $node node * @param STRING $control_name control_name * * @return STRING html */ public function fetchElement($name, $value, $node, $control_name) { $actionLink = JURI::base() . "index.php?option=com_quick2cart&view=dashboard&layout=setup"; // Show link for payment plugins. $html = '<a href="' . $actionLink . '" target="_blank" class="btn btn-small btn-primary ">' . JText::_('COM_QUICK2CART_CLICK_BS_SETUP_INSTRUCTION') . '</a>'; return $html; } }
nitesh146/Motleymart
administrator/components/com_quick2cart/assets/elements/bssetup.php
PHP
gpl-2.0
1,407
/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <string> #include "Spell.h" #include "SpellAuras.h" #include "SpellScript.h" #include "SpellMgr.h" bool _SpellScript::_Validate(SpellInfo const* entry) { if (!Validate(entry)) { sLog->outError("TSCR: Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str()); return false; } return true; } void _SpellScript::_Register() { m_currentScriptState = SPELL_SCRIPT_STATE_REGISTRATION; Register(); m_currentScriptState = SPELL_SCRIPT_STATE_NONE; } void _SpellScript::_Unload() { m_currentScriptState = SPELL_SCRIPT_STATE_UNLOADING; Unload(); m_currentScriptState = SPELL_SCRIPT_STATE_NONE; } void _SpellScript::_Init(std::string const* scriptname, uint32 spellId) { m_currentScriptState = SPELL_SCRIPT_STATE_NONE; m_scriptName = scriptname; m_scriptSpellId = spellId; } std::string const* _SpellScript::_GetScriptName() const { return m_scriptName; } _SpellScript::EffectHook::EffectHook(uint8 _effIndex) { // effect index must be in range <0;2>, allow use of special effindexes ASSERT(_effIndex == EFFECT_ALL || _effIndex == EFFECT_FIRST_FOUND || _effIndex < MAX_SPELL_EFFECTS); effIndex = _effIndex; } uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEntry) { uint8 mask = 0; if ((effIndex == EFFECT_ALL) || (effIndex == EFFECT_FIRST_FOUND)) { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if ((effIndex == EFFECT_FIRST_FOUND) && mask) return mask; if (CheckEffect(spellEntry, i)) mask |= (uint8)1<<i; } } else { if (CheckEffect(spellEntry, effIndex)) mask |= (uint8)1<<effIndex; } return mask; } bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex) { return GetAffectedEffectsMask(spellEntry) & 1<<effIndex; } std::string _SpellScript::EffectHook::EffIndexToString() { switch (effIndex) { case EFFECT_ALL: return "EFFECT_ALL"; case EFFECT_FIRST_FOUND: return "EFFECT_FIRST_FOUND"; case EFFECT_0: return "EFFECT_0"; case EFFECT_1: return "EFFECT_1"; case EFFECT_2: return "EFFECT_2"; } return "Invalid Value"; } bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) { if (!spellEntry->Effects[effIndex].Effect && !effName) return true; if (!spellEntry->Effects[effIndex].Effect) return false; return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].Effect == effName); } std::string _SpellScript::EffectNameCheck::ToString() { switch (effName) { case SPELL_EFFECT_ANY: return "SPELL_EFFECT_ANY"; default: char num[10]; sprintf (num, "%u", effName); return num; } } bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) { if (!spellEntry->Effects[effIndex].ApplyAuraName && !effAurName) return true; if (!spellEntry->Effects[effIndex].ApplyAuraName) return false; return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName); } std::string _SpellScript::EffectAuraNameCheck::ToString() { switch (effAurName) { case SPELL_AURA_ANY: return "SPELL_AURA_ANY"; default: char num[10]; sprintf (num, "%u", effAurName); return num; } } SpellScript::CastHandler::CastHandler(SpellCastFnType _pCastHandlerScript) { pCastHandlerScript = _pCastHandlerScript; } void SpellScript::CastHandler::Call(SpellScript* spellScript) { (spellScript->*pCastHandlerScript)(); } SpellScript::CheckCastHandler::CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript) { _checkCastHandlerScript = checkCastHandlerScript; } SpellCastResult SpellScript::CheckCastHandler::Call(SpellScript* spellScript) { return (spellScript->*_checkCastHandlerScript)(); } SpellScript::EffectHandler::EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : _SpellScript::EffectNameCheck(_effName), _SpellScript::EffectHook(_effIndex) { pEffectHandlerScript = _pEffectHandlerScript; } std::string SpellScript::EffectHandler::ToString() { return "Index: " + EffIndexToString() + " Name: " +_SpellScript::EffectNameCheck::ToString(); } bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { return _SpellScript::EffectNameCheck::Check(spellEntry, effIndex); } void SpellScript::EffectHandler::Call(SpellScript* spellScript, SpellEffIndex effIndex) { (spellScript->*pEffectHandlerScript)(effIndex); } SpellScript::HitHandler::HitHandler(SpellHitFnType _pHitHandlerScript) { pHitHandlerScript = _pHitHandlerScript; } void SpellScript::HitHandler::Call(SpellScript* spellScript) { (spellScript->*pHitHandlerScript)(); } SpellScript::UnitTargetHandler::UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : _SpellScript::EffectHook(_effIndex), targetType(_targetType) { pUnitTargetHandlerScript = _pUnitTargetHandlerScript; } std::string SpellScript::UnitTargetHandler::ToString() { std::ostringstream oss; oss << "Index: " << EffIndexToString() << " Target: " << targetType; return oss.str(); } bool SpellScript::UnitTargetHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { if (!targetType) return false; return (effIndex == EFFECT_ALL) || (spellEntry->Effects[effIndex].TargetA.GetTarget() == targetType || spellEntry->Effects[effIndex].TargetB.GetTarget() == targetType); } void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list<Unit*>& unitTargets) { (spellScript->*pUnitTargetHandlerScript)(unitTargets); } bool SpellScript::_Validate(SpellInfo const* entry) { for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<UnitTargetHandler>::iterator itr = OnUnitTargetSelect.begin(); itr != OnUnitTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnUnitTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); return _SpellScript::_Validate(entry); } bool SpellScript::_Load(Spell* spell) { m_spell = spell; _PrepareScriptCall((SpellScriptHookType)SPELL_SCRIPT_STATE_LOADING); bool load = Load(); _FinishScriptCall(); return load; } void SpellScript::_InitHit() { m_hitPreventEffectMask = 0; m_hitPreventDefaultEffectMask = 0; } void SpellScript::_PrepareScriptCall(SpellScriptHookType hookType) { m_currentScriptState = hookType; } void SpellScript::_FinishScriptCall() { m_currentScriptState = SPELL_SCRIPT_STATE_NONE; } bool SpellScript::IsInCheckCastHook() const { return m_currentScriptState == SPELL_SCRIPT_HOOK_CHECK_CAST; } bool SpellScript::IsInTargetHook() const { switch (m_currentScriptState) { case SPELL_SCRIPT_HOOK_EFFECT_LAUNCH_TARGET: case SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET: case SPELL_SCRIPT_HOOK_BEFORE_HIT: case SPELL_SCRIPT_HOOK_HIT: case SPELL_SCRIPT_HOOK_AFTER_HIT: return true; } return false; } bool SpellScript::IsInHitPhase() const { return (m_currentScriptState >= HOOK_SPELL_HIT_START && m_currentScriptState < HOOK_SPELL_HIT_END); } bool SpellScript::IsInEffectHook() const { return (m_currentScriptState >= SPELL_SCRIPT_HOOK_EFFECT_LAUNCH && m_currentScriptState <= SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET); } Unit* SpellScript::GetCaster() { return m_spell->GetCaster(); } Unit* SpellScript::GetOriginalCaster() { return m_spell->GetOriginalCaster(); } SpellInfo const* SpellScript::GetSpellInfo() { return m_spell->GetSpellInfo(); } WorldLocation const* SpellScript::GetTargetDest() { if (m_spell->m_targets.HasDst()) return m_spell->m_targets.GetDstPos(); return NULL; } void SpellScript::SetTargetDest(WorldLocation& loc) { m_spell->m_targets.SetDst(loc); } Unit* SpellScript::GetTargetUnit() { return m_spell->m_targets.GetUnitTarget(); } GameObject* SpellScript::GetTargetGObj() { return m_spell->m_targets.GetGOTarget(); } Item* SpellScript::GetTargetItem() { return m_spell->m_targets.GetItemTarget(); } Unit* SpellScript::GetHitUnit() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->unitTarget; } Creature* SpellScript::GetHitCreature() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (m_spell->unitTarget) return m_spell->unitTarget->ToCreature(); else return NULL; } Player* SpellScript::GetHitPlayer() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (m_spell->unitTarget) return m_spell->unitTarget->ToPlayer(); else return NULL; } Item* SpellScript::GetHitItem() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->itemTarget; } GameObject* SpellScript::GetHitGObj() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->gameObjTarget; } WorldLocation* SpellScript::GetHitDest() { if (!IsInEffectHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->destTarget; } int32 SpellScript::GetHitDamage() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return 0; } return m_spell->m_damage; } void SpellScript::SetHitDamage(int32 damage) { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return; } m_spell->m_damage = damage; } int32 SpellScript::GetHitHeal() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return 0; } return m_spell->m_healing; } void SpellScript::SetHitHeal(int32 heal) { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return; } m_spell->m_healing = heal; } Aura* SpellScript::GetHitAura() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (!m_spell->m_spellAura) return NULL; if (m_spell->m_spellAura->IsRemoved()) return NULL; return m_spell->m_spellAura; } void SpellScript::PreventHitAura() { if (!IsInTargetHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return; } if (m_spell->m_spellAura) m_spell->m_spellAura->Remove(); } void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return; } m_hitPreventEffectMask |= 1 << effIndex; PreventHitDefaultEffect(effIndex); } void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return; } m_hitPreventDefaultEffectMask |= 1 << effIndex; } int32 SpellScript::GetEffectValue() { if (!IsInEffectHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); return 0; } return m_spell->damage; } Item* SpellScript::GetCastItem() { return m_spell->m_CastItem; } void SpellScript::CreateItem(uint32 effIndex, uint32 itemId) { m_spell->DoCreateItem(effIndex, itemId); } SpellInfo const* SpellScript::GetTriggeringSpell() { return m_spell->m_triggeredByAuraSpell; } void SpellScript::FinishCast(SpellCastResult result) { m_spell->SendCastResult(result); m_spell->finish(result == SPELL_CAST_OK); } void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result) { if (!IsInCheckCastHook()) { sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId); return; } m_spell->m_customError = result; } SpellValue const* SpellScript::GetSpellValue() { return m_spell->m_spellValue; } bool AuraScript::_Validate(SpellInfo const* entry) { for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr) if (!entry->HasAreaAuraEffect()) sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); for (std::list<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); for (std::list<AuraDispelHandler>::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectApplyHandler>::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectApplyHandler>::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectApplyHandler>::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectPeriodicHandler>::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectUpdatePeriodicHandler>::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectCalcAmountHandler>::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectCalcPeriodicHandler>::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectCalcSpellModHandler>::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectAbsorbHandler>::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectAbsorbHandler>::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectManaShieldHandler>::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list<EffectManaShieldHandler>::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); return _SpellScript::_Validate(entry); } AuraScript::CheckAreaTargetHandler::CheckAreaTargetHandler(AuraCheckAreaTargetFnType _pHandlerScript) { pHandlerScript = _pHandlerScript; } bool AuraScript::CheckAreaTargetHandler::Call(AuraScript* auraScript, Unit* _target) { return (auraScript->*pHandlerScript)(_target); } AuraScript::AuraDispelHandler::AuraDispelHandler(AuraDispelFnType _pHandlerScript) { pHandlerScript = _pHandlerScript; } void AuraScript::AuraDispelHandler::Call(AuraScript* auraScript, DispelInfo* _dispelInfo) { (auraScript->*pHandlerScript)(_dispelInfo); } AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName) : _SpellScript::EffectAuraNameCheck(_effName), _SpellScript::EffectHook(_effIndex) { } bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) { return _SpellScript::EffectAuraNameCheck::Check(spellEntry, effIndex); } std::string AuraScript::EffectBase::ToString() { return "Index: " + EffIndexToString() + " AuraName: " +_SpellScript::EffectAuraNameCheck::ToString(); } AuraScript::EffectPeriodicHandler::EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectPeriodicHandler::Call(AuraScript* auraScript, AuraEffect const* _aurEff) { (auraScript->*pEffectHandlerScript)(_aurEff); } AuraScript::EffectUpdatePeriodicHandler::EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectUpdatePeriodicHandler::Call(AuraScript* auraScript, AuraEffect* aurEff) { (auraScript->*pEffectHandlerScript)(aurEff); } AuraScript::EffectCalcAmountHandler::EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectCalcAmountHandler::Call(AuraScript* auraScript, AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) { (auraScript->*pEffectHandlerScript)(aurEff, amount, canBeRecalculated); } AuraScript::EffectCalcPeriodicHandler::EffectCalcPeriodicHandler(AuraEffectCalcPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectCalcPeriodicHandler::Call(AuraScript* auraScript, AuraEffect const* aurEff, bool& isPeriodic, int32& periodicTimer) { (auraScript->*pEffectHandlerScript)(aurEff, isPeriodic, periodicTimer); } AuraScript::EffectCalcSpellModHandler::EffectCalcSpellModHandler(AuraEffectCalcSpellModFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectCalcSpellModHandler::Call(AuraScript* auraScript, AuraEffect const* aurEff, SpellModifier*& spellMod) { (auraScript->*pEffectHandlerScript)(aurEff, spellMod); } AuraScript::EffectApplyHandler::EffectApplyHandler(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; mode = _mode; } void AuraScript::EffectApplyHandler::Call(AuraScript* auraScript, AuraEffect const* _aurEff, AuraEffectHandleModes _mode) { if (_mode & mode) (auraScript->*pEffectHandlerScript)(_aurEff, _mode); } AuraScript::EffectAbsorbHandler::EffectAbsorbHandler(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectBase(_effIndex, SPELL_AURA_SCHOOL_ABSORB) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectAbsorbHandler::Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) { (auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, absorbAmount); } AuraScript::EffectManaShieldHandler::EffectManaShieldHandler(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectBase(_effIndex, SPELL_AURA_MANA_SHIELD) { pEffectHandlerScript = _pEffectHandlerScript; } void AuraScript::EffectManaShieldHandler::Call(AuraScript* auraScript, AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) { (auraScript->*pEffectHandlerScript)(aurEff, dmgInfo, absorbAmount); } bool AuraScript::_Load(Aura* aura) { m_aura = aura; _PrepareScriptCall((AuraScriptHookType)SPELL_SCRIPT_STATE_LOADING, NULL); bool load = Load(); _FinishScriptCall(); return load; } void AuraScript::_PrepareScriptCall(AuraScriptHookType hookType, AuraApplication const* aurApp) { m_scriptStates.push(ScriptStateStore(m_currentScriptState, m_auraApplication, m_defaultActionPrevented)); m_currentScriptState = hookType; m_defaultActionPrevented = false; m_auraApplication = aurApp; } void AuraScript::_FinishScriptCall() { ScriptStateStore stateStore = m_scriptStates.top(); m_currentScriptState = stateStore._currentScriptState; m_auraApplication = stateStore._auraApplication; m_defaultActionPrevented = stateStore._defaultActionPrevented; m_scriptStates.pop(); } bool AuraScript::_IsDefaultActionPrevented() { switch (m_currentScriptState) { case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: case AURA_SCRIPT_HOOK_EFFECT_ABSORB: return m_defaultActionPrevented; default: ASSERT(false && "AuraScript::_IsDefaultActionPrevented is called in a wrong place"); return false; } } void AuraScript::PreventDefaultAction() { switch (m_currentScriptState) { case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: case AURA_SCRIPT_HOOK_EFFECT_ABSORB: m_defaultActionPrevented = true; break; default: sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId); break; } } SpellInfo const* AuraScript::GetSpellInfo() const { return m_aura->GetSpellInfo(); } uint32 AuraScript::GetId() const { return m_aura->GetId(); } uint64 AuraScript::GetCasterGUID() const { return m_aura->GetCasterGUID(); } Unit* AuraScript::GetCaster() const { return m_aura->GetCaster(); } WorldObject* AuraScript::GetOwner() const { return m_aura->GetOwner(); } Unit* AuraScript::GetUnitOwner() const { return m_aura->GetUnitOwner(); } DynamicObject* AuraScript::GetDynobjOwner() const { return m_aura->GetDynobjOwner(); } void AuraScript::Remove(uint32 removeMode) { m_aura->Remove((AuraRemoveMode)removeMode); } Aura* AuraScript::GetAura() const { return m_aura; } AuraObjectType AuraScript::GetType() const { return m_aura->GetType(); } int32 AuraScript::GetDuration() const { return m_aura->GetDuration(); } void AuraScript::SetDuration(int32 duration, bool withMods) { m_aura->SetDuration(duration, withMods); } void AuraScript::RefreshDuration() { m_aura->RefreshDuration(); } time_t AuraScript::GetApplyTime() const { return m_aura->GetApplyTime(); } int32 AuraScript::GetMaxDuration() const { return m_aura->GetMaxDuration(); } void AuraScript::SetMaxDuration(int32 duration) { m_aura->SetMaxDuration(duration); } int32 AuraScript::CalcMaxDuration() const { return m_aura->CalcMaxDuration(); } bool AuraScript::IsExpired() const { return m_aura->IsExpired(); } bool AuraScript::IsPermanent() const { return m_aura->IsPermanent(); } uint8 AuraScript::GetCharges() const { return m_aura->GetCharges(); } void AuraScript::SetCharges(uint8 charges) { m_aura->SetCharges(charges); } uint8 AuraScript::CalcMaxCharges() const { return m_aura->CalcMaxCharges(); } bool AuraScript::ModCharges(int8 num, AuraRemoveMode removeMode /*= AURA_REMOVE_BY_DEFAULT*/) { return m_aura->ModCharges(num, removeMode); } bool AuraScript::DropCharge(AuraRemoveMode removeMode) { return m_aura->DropCharge(removeMode); } uint8 AuraScript::GetStackAmount() const { return m_aura->GetStackAmount(); } void AuraScript::SetStackAmount(uint8 num) { m_aura->SetStackAmount(num); } bool AuraScript::ModStackAmount(int32 num, AuraRemoveMode removeMode) { return m_aura->ModStackAmount(num, removeMode); } bool AuraScript::IsPassive() const { return m_aura->IsPassive(); } bool AuraScript::IsDeathPersistent() const { return m_aura->IsDeathPersistent(); } bool AuraScript::HasEffect(uint8 effIndex) const { return m_aura->HasEffect(effIndex); } AuraEffect* AuraScript::GetEffect(uint8 effIndex) const { return m_aura->GetEffect(effIndex); } bool AuraScript::HasEffectType(AuraType type) const { return m_aura->HasEffectType(type); } Unit* AuraScript::GetTarget() const { switch (m_currentScriptState) { case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY: case AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: case AURA_SCRIPT_HOOK_EFFECT_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_MANASHIELD: case AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD: return m_auraApplication->GetTarget(); default: sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId); } return NULL; } AuraApplication const* AuraScript::GetTargetApplication() const { return m_auraApplication; }
BlackWolfsDen/Justicar-WoW
src/server/game/Spells/SpellScript.cpp
C++
gpl-2.0
34,032
#define MIKTEX_UTF8_WRAP_ALL 1 #include <miktex/utf8wrap.h> #include <iostream> #include <string> using namespace std; #if defined(_MSC_VER) # define MAIN wmain #else # define MAIN main #endif void FatalError(const string & msg) { cerr << msg << endl; throw 1; } void Run() { string test = u8"\U000000E4\U000000F6\U000000FC\U000000DF"; string dirname = test + ".dir"; string filename = dirname + "/" + test + ".txt"; if (_mkdir(dirname.c_str()) != 0) { FatalError("cannot _mkdir " + dirname); } FILE * stream = fopen(filename.c_str(), "wb"); if (stream == nullptr) { FatalError("cannot open " + filename); } for (const char & ch : test) { putc(ch, stream); } putc('\n', stream); fclose(stream); if (_access(filename.c_str(), 0) != 0) { FatalError("cannot _access " + filename); } struct stat statbuf; if (stat(filename.c_str(), &statbuf) != 0) { FatalError("cannot stat " + filename); } cout << statbuf.st_size << " bytes written" << endl; if (remove(filename.c_str()) != 0) { FatalError("cannot remove " + filename); } if (_rmdir(dirname.c_str()) != 0) { FatalError("cannot _rmdir " + dirname); } } int MAIN() { try { Run(); return 0; } catch (int x) { return x; } }
drazenzadravec/nequeo
Tools/MikTex/Libraries/MiKTeX/UTF8Wrap/static/utf8wrap.cpp
C++
gpl-2.0
1,290
<?php /** * @copyright Ilch 2.0 * @package ilch */ return array ( 'menuCalendarList' => 'Calender', 'noCalendar' => 'no Entries available', 'term' => 'Term', 'title' => 'Title', 'text' => 'Text', 'color' => 'Term Color', 'place' => 'Place', 'start' => 'Start', 'end' => 'End', 'description' => 'Description', 'noDescription' => 'no Description available', 'at' => 'at', 'clock' => 'o\'clock', );
jurri/Ilch-2.0
application/modules/calendar/translations/en.php
PHP
gpl-2.0
452
var interface_data_cell_phone = [ [ "callButtonClicked:", "interface_data_cell_phone.html#abb91ce98f4b5920f486508bbf150c68a", null ], [ "mainTextLabel", "interface_data_cell_phone.html#aefc998f3932ae7f2decba1eaaec427c0", null ], [ "titleLabel", "interface_data_cell_phone.html#a0c3e159f8e753caaaa07fe67776faacb", null ] ];
BiCoR/RailsServer
public/doc/iphone_client/interface_data_cell_phone.js
JavaScript
gpl-2.0
334
/****************************************************************************** * Icinga 2 * * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software Foundation * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ #include "methods/icingachecktask.hpp" #include "icinga/cib.hpp" #include "icinga/service.hpp" #include "icinga/icingaapplication.hpp" #include "base/application.hpp" #include "base/objectlock.hpp" #include "base/utility.hpp" #include "base/perfdatavalue.hpp" #include "base/function.hpp" #include "base/configtype.hpp" using namespace icinga; REGISTER_SCRIPTFUNCTION_NS(Internal, IcingaCheck, &IcingaCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros"); void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { if (resolvedMacros && !useResolvedMacros) return; double interval = Utility::GetTime() - Application::GetStartTime(); if (interval > 60) interval = 60; /* use feature stats perfdata */ std::pair<Dictionary::Ptr, Array::Ptr> feature_stats = CIB::GetFeatureStats(); Array::Ptr perfdata = feature_stats.second; perfdata->Add(new PerfdataValue("active_host_checks", CIB::GetActiveHostChecksStatistics(interval) / interval)); perfdata->Add(new PerfdataValue("passive_host_checks", CIB::GetPassiveHostChecksStatistics(interval) / interval)); perfdata->Add(new PerfdataValue("active_host_checks_1min", CIB::GetActiveHostChecksStatistics(60))); perfdata->Add(new PerfdataValue("passive_host_checks_1min", CIB::GetPassiveHostChecksStatistics(60))); perfdata->Add(new PerfdataValue("active_host_checks_5min", CIB::GetActiveHostChecksStatistics(60 * 5))); perfdata->Add(new PerfdataValue("passive_host_checks_5min", CIB::GetPassiveHostChecksStatistics(60 * 5))); perfdata->Add(new PerfdataValue("active_host_checks_15min", CIB::GetActiveHostChecksStatistics(60 * 15))); perfdata->Add(new PerfdataValue("passive_host_checks_15min", CIB::GetPassiveHostChecksStatistics(60 * 15))); perfdata->Add(new PerfdataValue("active_service_checks", CIB::GetActiveServiceChecksStatistics(interval) / interval)); perfdata->Add(new PerfdataValue("passive_service_checks", CIB::GetPassiveServiceChecksStatistics(interval) / interval)); perfdata->Add(new PerfdataValue("active_service_checks_1min", CIB::GetActiveServiceChecksStatistics(60))); perfdata->Add(new PerfdataValue("passive_service_checks_1min", CIB::GetPassiveServiceChecksStatistics(60))); perfdata->Add(new PerfdataValue("active_service_checks_5min", CIB::GetActiveServiceChecksStatistics(60 * 5))); perfdata->Add(new PerfdataValue("passive_service_checks_5min", CIB::GetPassiveServiceChecksStatistics(60 * 5))); perfdata->Add(new PerfdataValue("active_service_checks_15min", CIB::GetActiveServiceChecksStatistics(60 * 15))); perfdata->Add(new PerfdataValue("passive_service_checks_15min", CIB::GetPassiveServiceChecksStatistics(60 * 15))); CheckableCheckStatistics scs = CIB::CalculateServiceCheckStats(); perfdata->Add(new PerfdataValue("min_latency", scs.min_latency)); perfdata->Add(new PerfdataValue("max_latency", scs.max_latency)); perfdata->Add(new PerfdataValue("avg_latency", scs.avg_latency)); perfdata->Add(new PerfdataValue("min_execution_time", scs.min_execution_time)); perfdata->Add(new PerfdataValue("max_execution_time", scs.max_execution_time)); perfdata->Add(new PerfdataValue("avg_execution_time", scs.avg_execution_time)); ServiceStatistics ss = CIB::CalculateServiceStats(); perfdata->Add(new PerfdataValue("num_services_ok", ss.services_ok)); perfdata->Add(new PerfdataValue("num_services_warning", ss.services_warning)); perfdata->Add(new PerfdataValue("num_services_critical", ss.services_critical)); perfdata->Add(new PerfdataValue("num_services_unknown", ss.services_unknown)); perfdata->Add(new PerfdataValue("num_services_pending", ss.services_pending)); perfdata->Add(new PerfdataValue("num_services_unreachable", ss.services_unreachable)); perfdata->Add(new PerfdataValue("num_services_flapping", ss.services_flapping)); perfdata->Add(new PerfdataValue("num_services_in_downtime", ss.services_in_downtime)); perfdata->Add(new PerfdataValue("num_services_acknowledged", ss.services_acknowledged)); double uptime = Utility::GetTime() - Application::GetStartTime(); perfdata->Add(new PerfdataValue("uptime", uptime)); HostStatistics hs = CIB::CalculateHostStats(); perfdata->Add(new PerfdataValue("num_hosts_up", hs.hosts_up)); perfdata->Add(new PerfdataValue("num_hosts_down", hs.hosts_down)); perfdata->Add(new PerfdataValue("num_hosts_pending", hs.hosts_pending)); perfdata->Add(new PerfdataValue("num_hosts_unreachable", hs.hosts_unreachable)); perfdata->Add(new PerfdataValue("num_hosts_flapping", hs.hosts_flapping)); perfdata->Add(new PerfdataValue("num_hosts_in_downtime", hs.hosts_in_downtime)); perfdata->Add(new PerfdataValue("num_hosts_acknowledged", hs.hosts_acknowledged)); std::vector<Endpoint::Ptr> endpoints = ConfigType::GetObjectsByType<Endpoint>(); double lastMessageSent = 0; double lastMessageReceived = 0; double messagesSentPerSecond = 0; double messagesReceivedPerSecond = 0; double bytesSentPerSecond = 0; double bytesReceivedPerSecond = 0; for (Endpoint::Ptr endpoint : endpoints) { if (endpoint->GetLastMessageSent() > lastMessageSent) lastMessageSent = endpoint->GetLastMessageSent(); if (endpoint->GetLastMessageReceived() > lastMessageReceived) lastMessageReceived = endpoint->GetLastMessageReceived(); messagesSentPerSecond += endpoint->GetMessagesSentPerSecond(); messagesReceivedPerSecond += endpoint->GetMessagesReceivedPerSecond(); bytesSentPerSecond += endpoint->GetBytesSentPerSecond(); bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond(); } perfdata->Add(new PerfdataValue("last_messages_sent", lastMessageSent)); perfdata->Add(new PerfdataValue("last_messages_received", lastMessageReceived)); perfdata->Add(new PerfdataValue("sum_messages_sent_per_second", messagesSentPerSecond)); perfdata->Add(new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond)); cr->SetOutput("Icinga 2 has been running for " + Utility::FormatDuration(uptime) + ". Version: " + Application::GetAppVersion()); cr->SetPerformanceData(perfdata); double lastReloadFailed = Application::GetLastReloadFailed(); if (lastReloadFailed > 0) { cr->SetOutput(cr->GetOutput() + "; Last reload attempt failed at " + Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", lastReloadFailed)); cr->SetState(ServiceWarning); } else cr->SetState(ServiceOK); service->ProcessCheckResult(cr); }
Tontonitch/icinga2
lib/methods/icingachecktask.cpp
C++
gpl-2.0
8,065
//////////////////////////////////////////////////////////// // // File: parser.cpp // Author: Frank Boerman // Parsers for files /////////////////////////////////////////////////////////// //#pragma warning(disable : 4244) //converting double to int is needed when calculating gridsize, so disable that warning //#pragma warning(disable : 4018)//same goes for signed/unsigned mismatch (due to if statements) #include <string> #include <sstream> #include <iostream> #include <fstream> #include "drawtools.h" #include <list> #include "GameOfLife.h" #include "List.h" #include "Parser.h" #include <limits> #include <sstream> #include "SharedGlobals.h" #include "Colours.h" using namespace std; //the parser for .gol files int* GOLParser(std::string filename, int maxwidht, int maxheight, list<item*>* DrawList, int* cell_dimension) { int gridsize[2]; ifstream file; string fline; file.open(filename); if (file.fail()) //open the stream { cout << "Error reading file " << filename << endl; return nullptr; } //due to rewriting parts of this procedure the code looks a bit silly and can be written more elogant. however there was no more time left for that List<string>* parsedfile = new List<string>(); //list of strings that holds the int leftline = numeric_limits<int>::max(); //holds the position of most left live cell while (getline(file, fline)) //fetch line per line of the file { if (fline.find("O") != string::npos) //if there is an living cell in the line { stringstream parsedline; for (int i = 0; i < (int)fline.size(); i++)//iterate through the line { //send the line to the stream, save the most left cell encountered in the file if (fline[i] == 'O') { if (i < leftline) { leftline = i; } } parsedline << fline[i]; //if (fline[i] == 'O' || parsedline.tellp() > 0) //{ // parsedline << fline[i]; // //line_list->append(fline[i]); //} } if (parsedline.tellp() > 0) { //parsedfile->append(*line_list); parsedfile->append(parsedline.str()); } } } //find the largest line and also correct the line to drop all not needed dead cells after last living one, and all not needed dead cells before the most left living cell in the figure int maxsizex = 0; for (int i = 0; i < parsedfile->len(); i++) { string line = parsedfile->Get_String(i); //cut the line to only include the necesarry cells for the figure string line_corrected = line.substr(0, line.find_last_of('O')+1).substr(leftline,string::npos);//NOTETOSELF: leave two substrings because of offset parsedfile->Set(i, line_corrected); //save the corrected line int line_length = line_corrected.size(); if (line_length > maxsizex) //save the biggest size of length { maxsizex = line_length; } } //calculate minimal height and width int minheight = (2 * WHITEBAND + parsedfile->len())* *cell_dimension; int minwidth = (2 * WHITEBAND + maxsizex)* *cell_dimension; //check against the constraints given //if figure doesnt fit with the given whiteband, than resize the cell_dimension of all the cells if (minheight > maxheight) { *cell_dimension = (int)floor(maxheight/parsedfile->len()); if (minwidth > maxwidht) { if (floor(maxwidht / maxsizex) < *cell_dimension) { *cell_dimension = (int)floor(maxwidht / maxsizex); } gridsize[0] = *cell_dimension * (2 * WHITEBAND + maxsizex); } else { gridsize[0] = maxwidht; } gridsize[1] = *cell_dimension * (2 * WHITEBAND + parsedfile->len()); } else if (minwidth > maxwidht) { *cell_dimension = (int)floor(maxwidht / maxsizex); gridsize[0] = *cell_dimension * (2 * WHITEBAND + maxsizex); gridsize[1] = maxheight; } else { gridsize[0] = maxwidht; gridsize[1] = maxheight; } //init the grid gridheight = gridsize[1] / *cell_dimension; gridwidth = (gridsize[0] / *cell_dimension); GLOBAL_GRID = new cell**[gridsize[0] / *cell_dimension]; float p1[2], p2[2]; int gridy = gridsize[1] / *cell_dimension; int gridx = gridsize[0] / *cell_dimension; for (int x = 0; x < gridx;x++)//travers through the grid and create the cells, fill in the figure { p1[0] = x * (int)*cell_dimension; p2[0] = (x + 1) * (int)*cell_dimension; GLOBAL_GRID[x] = new cell*[gridsize[1] / *cell_dimension];//create the height row for (int y = 0; y < gridy; y++) { p1[1] = y * (int)*cell_dimension; p2[1] = (y + 1) * (int)*cell_dimension; //create the new square square* sqr = new square(DrawList, p1, p2, LINECOLOR, Blue); //check if were outside the sidebands if (x >= WHITEBAND && y >= WHITEBAND && (y-WHITEBAND) < parsedfile->len() && (x-WHITEBAND) < maxsizex){ //check if x is in reange of the parsed line string line = parsedfile->Get_String((parsedfile->len() - 1) - (y - WHITEBAND)); if ((x - WHITEBAND) >= (int)line.size()) { GLOBAL_GRID[x][y] = new cell(sqr, 0); } else { //create the new cell //change the y because grid is drawn bottom up, while file is parsed top down //cout << "DEBUG: x: " << x << " y:" << y << endl; if (line[x - WHITEBAND] == 'O') { GLOBAL_GRID[x][y] = new cell(sqr, 1); } else { GLOBAL_GRID[x][y] = new cell(sqr, 0); } } } else { //if not than just insert empty cell GLOBAL_GRID[x][y] = new cell(sqr, 0); } } } cout << "dimension calculated: " << *cell_dimension << " gridwidth: " << gridwidth << " gridheight: " << gridheight << endl; //update the whitelines for (int x = 0; x < gridwidth; x++) { for (int y = 0; y < gridheight; y++) { GLOBAL_GRID[x][y]->CheckNeighbors(x, y); } } //return the size return gridsize; } string findstring(string line) { int first = line.find_first_of("\""); int last = line.find_last_of("\""); return line.substr(first, last - first); } void readEDIF(string fname, string* windowname, list<item*>* DrawList) //old parser { ifstream file; string fline; file.open(fname); if (file.fail()) { cout << "Error reading file " << fname << endl; return; } cout << "Parsing file " << fname << endl; while (getline(file, fline)) { stringstream sstream(fline); string command, title, ftext; float p1[2], p2[2], clr[3], width; pixel* pxl; line* ln; text* txt; if (fline[0] != '.' || fline == "") { //comment line continue; } switch (fline[1]) { case 'd': //change window title *windowname = findstring(sstream.str()); cout << "Parsed windowname: " << windowname << endl; break; case 'p': //draw pixel sstream >> command >> p1[0] >> p1[1] >> clr[0] >> clr[1] >> clr[2]; pxl = new pixel(DrawList, p1, clr); cout << "Parsed a pixel: "; pxl->print(); break; case 't': //draw text sstream >> command >> p1[0] >> p1[1] >> clr[0] >> clr[1] >> clr[2]; ftext = findstring(sstream.str()); txt = new text(DrawList, ftext, clr, p1[0], p1[1]); cout << "Parsed a string: "; txt->print(); break; case 'l': //draw line sstream >> command >> p1[0] >> p1[1] >> p2[0] >> p2[1] >> clr[0] >> clr[1] >> clr[2] >> width; ln = new line(DrawList, p1, p2, clr, width); cout << "Parsed a line: "; ln->print(); break; } } }
williewonka/computation2_C
Computation2_finaltask/GameOfLife/Parser.cpp
C++
gpl-2.0
7,205
<?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\CMS\Event\WebAsset; \defined('JPATH_PLATFORM') or die; use BadMethodCallException; use Joomla\CMS\Event\AbstractImmutableEvent; /** * Event class for WebAsset events * * @since 4.0.0 */ abstract class AbstractEvent extends AbstractImmutableEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = array()) { if (!\array_key_exists('subject', $arguments)) { throw new BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided"); } parent::__construct($name, $arguments); } }
twister65/joomla-cms
libraries/src/Event/WebAsset/AbstractEvent.php
PHP
gpl-2.0
979
# Copyright (C) 2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Author: Chris Lumens <clumens@redhat.com> from dogtail.predicate import GenericPredicate from dogtail.utils import doDelay from . import UITestCase # This test case handles the livecd case on the summary hub where everything # works as intended. On this spoke, we are testing the following: # # * Clicking the Quit button brings up a dialog asking if you're sure, though # we're not going to test that confirming actually quits. # * The Begin Installation button is insensitive, since no disks have yet # been selected. # * Only the Date & Time, Keyboard, Installation Destination, and Network Config # spoke selectors are visible. class LiveCDSummaryTestCase(UITestCase): def check_quit_button(self): self.click_button("Quit") self.check_dialog_displayed("Quit") self.click_button("No") def check_begin_installation_button(self): button = self.find("Begin Installation", "push button") self.assertIsNotNone(button, msg="Begin Installation button not found") self.assertTrue(button.showing, msg="Begin Installation button should be displayed") self.assertFalse(button.sensitive, msg="Begin Installation button should not be sensitive") def check_shown_spoke_selectors(self): # FIXME: This forces English. validSelectors = ["DATE & TIME", "KEYBOARD", "INSTALLATION DESTINATION", "NETWORK & HOSTNAME"] selectors = self.ana.findChildren(GenericPredicate(roleName="spoke selector")) self.assertEqual(len(selectors), len(validSelectors), msg="Incorrect number of spoke selectors shown") # Validate that only the spoke selectors we expect are shown. At the same time, # we can also validate the status of each selector. This only validates the # initial state of everything. Once we start clicking on spokes, things are # going to change. # FIXME: This encodes default information. for selector in selectors: if selector.name == "DATE & TIME": self.assertEqual(selector.description, "Americas/New York timezone") elif selector.name == "KEYBOARD": self.assertEqual(selector.description, "English (US)") elif selector.name == "INSTALLATION DESTINATION": # We don't know how many disks are going to be involved - if there's # just one, anaconda selects it by default. If there's more than # one, it selects none. self.assertIn(selector.description, ["Automatic partitioning selected", "No disks selected"]) elif selector.name == "NETWORK & HOSTNAME": self.assertRegexpMatches(selector.description, "Wired (.+) connected") else: self.fail("Invalid spoke selector shown on livecd: %s" % selector.name) def _run(self): # Before doing anything, verify we are on the right screen. doDelay(5) self.check_window_displayed("INSTALLATION SUMMARY") # And now we can check everything else on the screen. self.check_quit_button() self.check_begin_installation_button() self.check_shown_spoke_selectors() self.check_warning_bar()
itoed/anaconda
tests/gui/inside/summary.py
Python
gpl-2.0
3,986
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width" /> <title><?php wp_title( ' | ', true, 'right' ); ?></title> <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" /> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <?php //wp_head(); ?> <script> /********** My functions **********/ $(document).ready(function() { // The maximum supported horizontal resolution, cloud width, and banner height var maxres = 1260; var cloud_width = 256; var banner_height = $("#banner").height; // The current weather condition var condition = "snow"; // The number of clouds and a helper variable (sorry) var clouds = 10; var range = (maxres + cloud_width) / clouds; // Place all clouds dynamically for (var i = 0; i < clouds; i++) { var offset = Math.floor(i * range + Math.random() * range - cloud_width) $("#clouds").append( "<div class='cloud' style='left: " + offset + "px;'> \ <img src='http://www.harvardrunningclub.com/wp-content/uploads/2014/05/cloud_tiny" + (i%4 + 1) + ".png' alt=''> \ </div>"); } // If there is a weather condition if (condition != "") { // Create a weather box under each cloud for displaying weather $(".cloud").each(function() { $(this).append("<div class='weather'></div>"); }); // Add the appropriate weather condition $(".weather").each(function() { var offset = Math.random() * 200 - 320; $(this).append( "<div class='condition' style='top: " + offset + "px;'> \ <img src='http://www.harvardrunningclub.com/wp-content/uploads/2014/05/" + condition + ".png'> \ </div>"); }); } // This function is called every 40ms setInterval(function() { // Update cloud movement, wrapping around the screen $("#clouds").width($("body").width()); $(".cloud").each(function() { var pos = $(this).position().left - 1; if (pos < -cloud_width || pos > maxres) pos = maxres; $(this).css("left", pos); }); // Update weather condition movement $(".condition").each(function() { var pos = $(this).position().top + 2; if (pos > 100) pos = -120; $(this).css("top", pos); }); }, 40); }); </script> </head> <body>
Koda1004/harvardrunningclub
wp-content/themes/simple and clean/header.php
PHP
gpl-2.0
2,330
<?php /* Plugin Name: Memcached Description: Memcached backend for the WP Object Cache. Version: 2.1.2 Plugin URI: http://wordpress.org/extend/plugins/memcached/ Author: Ryan Boren, Denis de Bernardy, Matt Martz, Km.Van Install this file to wp-content/object-cache.php */ function wp_cache_add($key, $data, $group = '', $expire = 0) { global $wp_object_cache; return $wp_object_cache->add($key, $data, $group, $expire); } function wp_cache_incr($key, $n = 1, $group = '') { global $wp_object_cache; return $wp_object_cache->incr($key, $n, $group); } function wp_cache_decr($key, $n = 1, $group = '') { global $wp_object_cache; return $wp_object_cache->decr($key, $n, $group); } function wp_cache_close() { global $wp_object_cache; return $wp_object_cache->close(); } function wp_cache_delete($key, $group = '') { global $wp_object_cache; return $wp_object_cache->delete($key, $group); } function wp_cache_flush() { global $wp_object_cache; return $wp_object_cache->flush(); } function wp_cache_get($key, $group = '', $force = false) { global $wp_object_cache; return $wp_object_cache->get($key, $group, $force); } function wp_cache_init() { global $wp_object_cache; $wp_object_cache = new WP_Object_Cache(); } function wp_cache_replace($key, $data, $group = '', $expire = 0) { global $wp_object_cache; return $wp_object_cache->replace($key, $data, $group, $expire); } function wp_cache_set($key, $data, $group = '', $expire = 0) { global $wp_object_cache; if ( defined('WP_INSTALLING') == false ) return $wp_object_cache->set($key, $data, $group, $expire); else return $wp_object_cache->delete($key, $group); } function wp_cache_add_global_groups( $groups ) { global $wp_object_cache; $wp_object_cache->add_global_groups($groups); } function wp_cache_add_non_persistent_groups( $groups ) { global $wp_object_cache; $wp_object_cache->add_non_persistent_groups($groups); } class WP_Object_Cache { var $global_groups = []; var $no_mc_groups = []; var $cache = []; var $mc = []; var $stats = []; var $group_ops = []; var $cache_enabled = true; var $default_expiration = 0; //29 days var $ns_key = ''; var $ns_time = ''; function add($id, $data, $group = null, $expire = 0) { if(!$group) $group = 'default'; $key = $this->key($id, $group); if ( is_object( $data ) ) $data = clone $data; if ( in_array($group, $this->no_mc_groups) ) { $this->cache[$key] = $data; return true; } elseif ( isset($this->cache[$key]) && $this->cache[$key] !== false ) { return false; } $mc =& $this->get_mc($group); if($expire === 0) $expire = $this->default_expiration; $result = $mc->add($key, $data, false, $expire); if ( false !== $result ) { @ ++$this->stats['add']; $this->group_ops[$group][] = "add $id"; $this->cache[$key] = $data; } return $result; } function add_global_groups($groups) { if ( ! is_array($groups) ) $groups = (array) $groups; $this->global_groups = array_merge($this->global_groups, $groups); $this->global_groups = array_unique($this->global_groups); } function add_non_persistent_groups($groups) { if ( ! is_array($groups) ) $groups = (array) $groups; $this->no_mc_groups = array_merge($this->no_mc_groups, $groups); $this->no_mc_groups = array_unique($this->no_mc_groups); } function incr($id, $n = 1, $group = 'default' ) { if(!$group) $group = 'default'; $key = $this->key($id, $group); $mc =& $this->get_mc($group); $this->cache[ $key ] = $mc->increment( $key, $n ); return $this->cache[ $key ]; } function decr($id, $n = 1, $group = 'default' ) { if(!$group) $group = 'default'; $key = $this->key($id, $group); $mc =& $this->get_mc($group); $this->cache[ $key ] = $mc->decrement( $key, $n ); return $this->cache[ $key ]; } function close() { foreach ( $this->mc as $bucket => $mc ) $mc->close(); } function delete($id, $group = 'default') { if(!$group) $group = 'default'; $key = $this->key($id, $group); if ( in_array($group, $this->no_mc_groups) ) { unset($this->cache[$key]); return true; } $mc =& $this->get_mc($group); $result = $mc->delete($key); @ ++$this->stats['delete']; $this->group_ops[$group][] = "delete $id"; if ( false !== $result ) unset($this->cache[$key]); return $result; } function flush() { // Don't flush if multi-blog. if ( function_exists('is_site_admin') || defined('CUSTOM_USER_TABLE') && defined('CUSTOM_USER_META_TABLE') ) return true; $ret = true; foreach ( array_keys($this->mc) as $group ){ if(strpos($group,WP_CACHE_KEY_SALT) !== false){ $mc =& $this->get_mc('default'); $this->ns_time = $_SERVER['REQUEST_TIME']; $ret = $mc->set($this->ns_key,$_SERVER['REQUEST_TIME']); //$ret &= $this->mc[$group]->flush(); return $ret; } } return $ret; } function get($id, $group = null, $force = false) { if(!$group) $group = 'default'; $key = $this->key($id, $group); $mc =& $this->get_mc($group); if ( isset($this->cache[$key]) && ( !$force || in_array($group, $this->no_mc_groups) ) ) { if ( is_object( $this->cache[$key] ) ) $value = clone $this->cache[$key]; else $value = $this->cache[$key]; } else if ( in_array($group, $this->no_mc_groups) ) { $this->cache[$key] = $value = false; } else { $value = $mc->get($key); if ( NULL === $value ){ $value = false; } $this->cache[$key] = $value; } @ ++$this->stats['get']; $this->group_ops[$group][] = "get $id"; if ( 'checkthedatabaseplease' === $value ) { unset( $this->cache[$key] ); $value = false; } return $value; } function get_multi( $groups ) { /* format: $get['group-name'] = array( 'key1', 'key2' ); */ $return = []; foreach ( $groups as $group => $ids ) { $mc =& $this->get_mc($group); foreach ( $ids as $id ) { $key = $this->key($id, $group); if ( isset($this->cache[$key]) ) { if ( is_object( $this->cache[$key] ) ) $return[$key] = clone $this->cache[$key]; else $return[$key] = $this->cache[$key]; continue; } else if ( in_array($group, $this->no_mc_groups) ) { $return[$key] = false; continue; } else { $return[$key] = $mc->get($key); } } if ( $to_get ) { $vals = $mc->get_multi( $to_get ); $return = array_merge( $return, $vals ); } } @ ++$this->stats['get_multi']; $this->group_ops[$group][] = "get_multi $id"; $this->cache = array_merge( $this->cache, $return ); return $return; } function key($key, $group) { if ( false !== array_search($group, $this->global_groups) ) $prefix = $this->global_prefix; else $prefix = $this->blog_prefix; return $this->ns_time . $prefix . $group . ':' . $key; } function replace($id, $data, $group = null, $expire = 0) { if(!$group) $group = 'default'; $key = $this->key($id, $group); if($expire === 0) $expire = $this->default_expiration; $mc =& $this->get_mc($group); if ( is_object( $data ) ) $data = clone $data; $result = $mc->replace($key, $data, false, $expire); if ( false !== $result ) $this->cache[$key] = $data; return $result; } function set($id, $data, $group = null, $expire = 0) { if(!$group) $group = 'default'; $key = $this->key($id, $group); if ( isset($this->cache[$key]) && ('checkthedatabaseplease' === $this->cache[$key]) ) return false; if ( is_object($data) ) $data = clone $data; $this->cache[$key] = $data; if ( in_array($group, $this->no_mc_groups) ) return true; if($expire === 0) $expire = $this->default_expiration; $mc =& $this->get_mc($group); $result = $mc->set($key, $data, false, $expire); return $result; } function colorize_debug_line($line) { $colors = array( 'get' => 'green', 'set' => 'purple', 'add' => 'blue', 'delete' => 'red'); $cmd = substr($line, 0, strpos($line, ' ')); $cmd2 = "<span style='color:{$colors[$cmd]}'>$cmd</span>"; return $cmd2 . substr($line, strlen($cmd)) . "\n"; } function stats() { echo "<p>\n"; foreach ( $this->stats as $stat => $n ) { echo "<strong>$stat</strong> $n"; echo "<br/>\n"; } echo "</p>\n"; echo "<h3>Memcached:</h3>"; foreach ( $this->group_ops as $group => $ops ) { if ( !isset($_GET['debug_queries']) && 500 < count($ops) ) { $ops = array_slice( $ops, 0, 500 ); echo "<big>Too many to show! <a href='" . add_query_arg( 'debug_queries', 'true' ) . "'>Show them anyway</a>.</big>\n"; } echo "<h4>$group commands</h4>"; echo "<pre>\n"; $lines = []; foreach ( $ops as $op ) { $lines[] = $this->colorize_debug_line($op); } print_r($lines); echo "</pre>\n"; } if ( $this->debug ) var_dump($this->memcache_debug); } function &get_mc($group = null) { if(!$group) $group = 'default'; $group = WP_CACHE_KEY_SALT . $group; if ( isset($this->mc[$group]) ) return $this->mc[$group]; return $this->mc[WP_CACHE_KEY_SALT . 'default']; } function failure_callback($host, $port) { die('Can not connect memcache server.'); } function __construct() { if(!class_exists('Memcache')){ die('Your server is NOT support Memcache service, please delete "wp-content/object-cache.php" and refresh page.'); } global $memcached_servers,$_wp_using_ext_object_cache; if ( !defined( 'WP_CACHE_KEY_SALT' ) ){ define( 'WP_CACHE_KEY_SALT', md5(AUTH_KEY) ); } $_wp_using_ext_object_cache = true; if ( isset($memcached_servers) ){ $buckets = $memcached_servers; }else{ $buckets = array('127.0.0.1'); } $buckets = array(WP_CACHE_KEY_SALT . 'default' => $buckets); foreach ( $buckets as $bucket => $servers) { $this->mc[$bucket] = new Memcache(); foreach ( $servers as $server ) { $node_port = explode(':', $server); $node = $node_port[0]; $port = isset($node_port[1]) ? $node_port[1] : (int)ini_get('memcache.default_port'); if ( !$port ) $port = 11211; $this->mc[$bucket]->addServer($node, $port, true, 1, 1, 15, true, array($this, 'failure_callback')); $this->mc[$bucket]->setCompressThreshold(20000, 0.2); } } global $blog_id, $table_prefix; $this->global_prefix = ''; $this->blog_prefix = ''; if ( function_exists( 'is_multisite' ) ) { $this->global_prefix = ( is_multisite() || defined('CUSTOM_USER_TABLE') && defined('CUSTOM_USER_META_TABLE') ) ? '' : $table_prefix; $this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix ) . ':'; } $this->cache_hits =& $this->stats['get']; $this->cache_misses =& $this->stats['add']; /** * set nameplace time */ $mc =& $this->get_mc('default'); $this->ns_key = 'nskey_' . WP_CACHE_KEY_SALT; $this->ns_time = $mc->get($this->ns_key); if(!$this->ns_time){ $mc->set($this->ns_key,$_SERVER['REQUEST_TIME']); $this->ns_time = $_SERVER['REQUEST_TIME']; } } }
hensonvip/zzyzan
wp-content/themes/mx/addons/cache/object-cache.php
PHP
gpl-2.0
11,422
using System; using Server.Network; using Server.Items; namespace Server.Items { [FlipableAttribute( 0x27A8, 0x27F3 )] public class Bokuto : BaseSword { public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.CrushingBlow; } } public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ArmorIgnore; } } public override int AosStrengthReq{ get{ return 20; } } public override int AosMinDamage{ get{ return 9; } } public override int AosMaxDamage{ get{ return 11; } } public override int AosSpeed{ get{ return 53; } } public override int OldStrengthReq{ get{ return 20; } } public override int OldMinDamage{ get{ return 9; } } public override int OldMaxDamage{ get{ return 11; } } public override int OldSpeed{ get{ return 53; } } public override int DefHitSound{ get{ return 0x536; } } public override int DefMissSound{ get{ return 0x23A; } } public override int InitMinHits{ get{ return 25; } } public override int InitMaxHits{ get{ return 50; } } [Constructable] public Bokuto() : base( 0x27A8 ) { Weight = 7.0; } public Bokuto( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); /*int version = */reader.ReadInt(); } } }
brodock/sunuo
scripts/legacy/Items/Weapons/SE Weapons/Bokuto.cs
C#
gpl-2.0
1,431
// // -------------------------------------------------------------------------- // Gurux Ltd // // // // // Version: $Revision: 9806 $, // $Date: 2018-01-12 11:44:00 +0200 (pe, 12 tammi 2018) $ // $Author: gurux01 $ // // Copyright (c) Gurux Ltd // //--------------------------------------------------------------------------- // // DESCRIPTION // // This file is a part of Gurux Device Framework. // // Gurux Device Framework is Open Source software; you can redistribute it // and/or modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 of the License. // Gurux Device Framework is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU General Public License for more details. // // More information of Gurux DLMS/COSEM Director: https://www.gurux.org/GXDLMSDirector // // This code is licensed under the GNU General Public License v2. // Full text may be retrieved at http://www.gnu.org/licenses/gpl-2.0.txt //--------------------------------------------------------------------------- using System.Collections; using System.ComponentModel; namespace GXDLMSDirector { public class GXConformanceValueDescriptorCollection : PropertyDescriptorCollection { public GXConformanceValueDescriptorCollection(PropertyDescriptor[] properties) : base(properties) { } public override PropertyDescriptorCollection Sort(IComparer comparer) { GXConformanceValue customComparer = new GXConformanceValue(); return base.Sort(customComparer); } } }
Gurux/GXDLMSDirector
Development/ConformanceTests/Internal/GXConformanceValueDescriptorCollection.cs
C#
gpl-2.0
1,766
<?php /** * Test of authorisation object logic * * @author Stuart Prescott * @copyright Copyright Stuart Prescott * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: auth.php,v 1.3 2006/01/05 02:32:07 stuart Exp $ * @package Bumblebee * @subpackage Tests */ ini_set('error_reporting', E_ALL); $validusers = array('stuartp', 'stup1', 'stuart_p', 'stu-p', 's1234', '123s', 'stu@p', 'stup@nano.net', 'stu.p', 'stu+p' ); $invalidusers = array('stu/p', 'stu\'p', 'stu"p', 'stu!p', 'stu%p', 'stu#p', 'stu=p', 'stu\\p', '-stup', '@stup', '', ' ', ' stup', 'stup ', 'stu p' ); $regexp = '/^[a-z0-9][a-z0-9@\-_.+]+$/'; foreach ($validusers as $name) { printf("%-20s: %s\n", $name, (preg_match($regexp, $name) ? 'OK, VALID' : 'ERROR, INVALID')); } foreach ($invalidusers as $name) { printf("%-20s: %s\n", $name, (preg_match($regexp, $name) ? 'ERROR, VALID' : 'OK, INVALID')); } ?>
nausica/bumblebee
inc/bb/test/auth.php
PHP
gpl-2.0
1,056
#include "stdafx.h" // // this is the path to amplugin.h and all the plugin/libs // by default all the libs, (debug/x64/x86) are copied to the /Plugins/ folder. // // If you want to copy them somewhere else // 1) Make sure that the inlcude path below is valid // 2) Make sure that the library path is valid // Project > Properties > Linker > "Aditional Library properties" // The path that was used is relative to the "Piger" project. #include "../../amplugin.h" PLUGIN_API AM_RESPONSE am_Msg(AM_MSG msg, AM_UINT wParam, AM_INT lParam) { switch (msg) { case AM_MSG_INIT: { // // the plugin manager. AmPlugin* p = (AmPlugin*)(lParam); // // get the full path of this plugin // call 'getCommand( 0, ... ) and it will return this file. WCHAR szPath[MAX_PATH]; size_t l = p->GetCommand(0, MAX_PATH, szPath); // // This is the name of the action e will call // the second param is who to call when this happens // in this case, we want Piger to call us back here. // but we could launch something else. p->AddAction(L"OnTop", szPath); } break; case AM_MSG_DEINIT: break; case AM_MSG_MAIN: { // // Our action as called! AmPlugin* p = (AmPlugin*)(lParam); // get the window HWND hWnd = (HWND)p->GetForegroundWindow(); // is it a valid handle? if (NULL != hWnd) { if (::GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) { // Revert back ::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } else { // Make topmost ::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } MessageBeep(MB_ICONINFORMATION); } else { MessageBeep(MB_ICONERROR); } } break; case AM_MSG_NAME: // get the name of this action // WPARAM is the size of the buffer. // LPARAM is the buffer, (wchar_t*) return AM_RESP_NOT_SUPPORTED; break; case AM_MSG_PATH_CMD: // this is the root path of the commands, %appdata%\myoddweb\ActionMonitor\RootCommands case AM_MSG_PATH_IN: // this is the path of actions called on Piger start up, %appdata%\myoddweb\ActionMonitor\RootCommands\__in case AM_MSG_PATH_OUT: // this is the path of actions called on Piger closing down, %appdata%\myoddweb\ActionMonitor\RootCommands\__out case AM_MSG_PATH_TMP: // this is the path ignored by piger, %appdata%\myoddweb\ActionMonitor\RootCommands\__tmp case AM_MSG_PATH_PLUGIN: // the path where the plugins are located, (also where _we_ are located). // Paths - lParam is a pointer to const wchar_t* // const wchar_t* path = (const wchar_t*)lParam return AM_RESP_NOT_SUPPORTED; break; default: break; } // not handled here. return AM_RESP_NOT_SUPPORTED; }
FFMG/myoddweb.piger
plugins/OnTop/OnTop/OnTop.cpp
C++
gpl-2.0
2,935
using System; using System.Linq; namespace BirthdayGreetings { public class BirthdayGreetingsEngine { private readonly PeopleRepository _peopleRepository; private readonly GreetingsDeliveryService _greetingsDeliverService; public BirthdayGreetingsEngine(PeopleRepository peopleRepository, GreetingsDeliveryService greetingsDeliverService) { _peopleRepository = peopleRepository; _greetingsDeliverService = greetingsDeliverService; } public void SendGreetingsToPeopleBornInThis(DateTime date) { var people = _peopleRepository.GetAll().ToList(); if (!people.Any()) return; var recipients = people.Where(p => p.Birthday.Month == date.Month && p.Birthday.Day == date.Day).ToList(); if (!recipients.Any()) return; var greetings = recipients.Select(CreateGreetingDto); _greetingsDeliverService.Deliver(greetings); } private static GreetingDto CreateGreetingDto(PersonDto p) { return new GreetingDto { Email = p.Email, Text = string.Format("Dear {0} {1}, happy birthday!", p.FirstName, p.LastName) }; } } }
PaoloLaurenti/BirthdayGreetingsKata
src/BirthdayGreetings/BirthdayGreetingsEngine.cs
C#
gpl-2.0
1,320
<script language="javascript"> function fncSubmit() { document.house.submit(); } function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; $("#ygis").val (lat); $("#xgis").val (lng); } </script> <?php $pcucode = $data->GetStringData("select offid as cc from office where offid<>'0000x' limit 1"); if ($_POST['exec'] == 'true'): $sqlupdate = "update house set hid='" . $_POST['hid'] . "', hno='" . $_POST['hno'] . "', road='" . $_POST['road'] . "', telephonehouse='" . $_POST['telephonehouse'] . "', area='" . $_POST['area'] . "', communityno='" . $_POST['communityno'] . "', housechar='" . $_POST['housechar'] . "', housecharground='" . $_POST['housecharground'] . "', xgis='" . $_POST['xgis'] . "', ygis='" . $_POST['ygis'] . "', pid='" . $_POST['pid'] . "', pidvola='" . $_POST['pidvola'] . "', usernamedoc='" . $_POST['usernamedoc'] . "', pcucodeperson='" . $pcucode . "', pcucodepersonvola='" . $pcucode . "' where hcode='" . $_POST['hcode'] . "'"; $db->exec($sqlupdate); echo "<script> "; echo"alert('บันทึกเสร็จเรียบร้อยครับ')"; echo "</script> "; echo "<script>"; echo "window.location='index.php?url=" . $encode->encodeUrl('page/familyfolder/family_folder.php') . "&house_id=" .$_POST['hcode'] . "';"; echo "</script>"; endif; ?> <form name="house" id="house" method="post"> <?php $hcode = $encode->decodeUrl($_REQUEST['hcode']); $sql = "select h.pcucodeperson,h.pid,h.pcucodepersonvola,h.pidvola, h.area,h.pcucode,h.hcode,h.villcode,h.hid,h.hno,h.road, h.telephonehouse,h.communityno,h.housechar,h.housecharground, h.housepic,h.xgis,h.ygis,h.usernamedoc from house as h where h.hcode='" . $hcode . "'"; $result = $db->query($sql, PDO::FETCH_OBJ); foreach ($result as $row) { ?> <ul data-role="listview" data-theme="a" data-divider-theme="a" data-inset="true" > <li data-role='list-divider'><h4>แก้ไขรายละเอียดบ้าน</h4></li> <input type="hidden" name="exec" value="true"> <input type="hidden" name="hcode" value="<?= $hcode ?>"> <li> <div class="ui-field-contain"> <label for="hid">รหัสทะเบียนบ้าน :</label> <input type="text" data-mini="true" name="hid" id="hid" value="<?= $row->hid; ?>" placeholder="รหัสทะเบียนบ้าน"> </div> <div class="ui-field-contain"> <label for="hno">บ้านเลขที่ :</label> <input type="text" data-mini="true" name="hno" id="hno" value="<?= $row->hno; ?>" placeholder="บ้านเลขที่"> </div> <div class="ui-field-contain"> <label for="road">ถนน :</label> <input type="text" data-mini="true" name="road" id="road" value="<?= $row->road; ?>" placeholder="ถนน"> </div> <div class="ui-field-contain"> <label for="telephonehouse">เบอร์โทรศัพท์ :</label> <input type="text" data-mini="true" name="telephonehouse" id="telephonehouse" value="<?= $row->telephonehouse; ?>" placeholder="เบอร์โทรศัพท์"> </div> <div class="ui-field-contain"> <label for="area">เขตที่ตั้ง :</label> <select name="area" id="area" data-native-menu="false" data-mini="true" class="filterable-select"> <option value="<?= $row->area ?>"><?php if ($row->area == 1):echo"อบต."; else:echo"เทศบาล"; endif; ?></option> <option value="1">อบต.</option> <option value="2">เทศบาล</option> </select> </div> <div class="ui-field-contain"> <label for="communityno">ลำดับที่ของชุมชน :</label> <input type="text" data-mini="true" name="communityno" id="communityno" value="<?= $row->communityno; ?>" placeholder="ลำดับที่ของชุมชน"> </div> <div class="ui-field-contain"> <label for="housechar">ลักษณะที่ตั้งของบ้าน :</label> <select name="housechar" id="housechar" data-native-menu="false" data-mini="true" class="filterable-select"> <option value="<?= $row->housechar; ?>"><?= $data->GetStringData("select housechar_name as cc from chousechar where housechar='" . $row->housechar . "'"); ?></option> <?php $sqlhc = "select * from chousechar"; $hc = $db->query($sqlhc, PDO::FETCH_OBJ); foreach ($hc as $h) { ?> <option value="<?= $h->housechar ?>"><?= $h->housechar_name ?></option> <?php } ?> </select> </div> <div class="ui-field-contain"> <label for="housecharground">ลักษณะพื้นที่ของบ้าน :</label> <input type="text" data-mini="true" name="housecharground" id="housecharground" value="<?= $row->housecharground; ?>" placeholder="ลักษณะพื้นที่ที่ตั้งของบ้าน"> </div> <div class="ui-field-contain"> <label for="ygis">ละติจูด :</label> <input type="text" data-mini="true" name="ygis" id="ygis" value="<?= $row->ygis; ?>" placeholder="ละติจูด"> </div> <div class="ui-field-contain"> <label for="xgis">ลองจิจูด :</label> <input type="text" data-mini="true" name="xgis" id="xgis" value="<?= $row->xgis; ?>" placeholder="ลองจิจูด"> </div> <div class="ui-field-contain"> <label>ระบุพิกัดอัตโนมัติ:</label> <a href="#" class="ui-btn ui-mini ui-btn-f ui-icon-location ui-btn-icon-left" onclick="getLocation()">GPS</a> </div> <div class="ui-field-contain"> <label for="pid">หัวหน้าครอบครัว :</label> <select name="pid" id="pid" data-native-menu="false" data-mini="true"> <option value="<?= $row->pid; ?>"><?= $data->GetStringData("select concat(t.titlename,p.fname,' ',p.lname) as cc from ctitle t, person p where t.titlecode=p.prename and p.pid='" . $row->pid . "'"); ?></option> <?php $sqlpid = "SELECT p.pid, concat(t.titlename,p.fname,' ',p.lname) as ptname from ctitle t, person p where t.titlecode=p.prename and p.hcode='" . $hcode . "' order by p.birth"; $rpid = $db->query($sqlpid, PDO::FETCH_OBJ); foreach ($rpid as $p) { ?> <option value="<?= $p->pid ?>"><?= $p->ptname ?></option> <?php } ?> </select> </div> <div class="ui-field-contain"> <label for="pidvola">อสม. :</label> <select name="pidvola" data-native-menu="true" data-mini="true"> <option value="<?= $row->pidvola; ?>"><?= $data->GetStringData("select concat(t.titlename,p.fname,' ',p.lname) as cc from ctitle t, person p where t.titlecode=p.prename and p.pid='" . $row->pidvola . "'"); ?></option> <?php $sqlpidvo = "select p.pid,concat(t.titlename,p.fname,' ',p.lname) as ptname from person p, persontype pt, ctitle t,house h where t.titlecode=p.prename and pt.typecode='09' and p.pid=pt.pid and h.hcode=p.hcode and p.pcucodeperson=h.pcucode and h.villcode='" . $row->villcode . "'"; $rpidvo = $db->query($sqlpidvo, PDO::FETCH_OBJ); foreach ($rpidvo as $pvo) { ?> <option value="<?= $pvo->pid ?>"><?= $pvo->ptname ?></option> <?php } ?> </select> </div> <div class="ui-field-contain"> <label for="usernamedoc">จนท.สธ :</label> <select name="usernamedoc" data-native-menu="true" data-mini="true"> <option value="<?= $row->usernamedoc; ?>"><?= $data->GetStringData("select concat(fname,' ',lname) as cc from user where username='" . $row->usernamedoc . "'"); ?></option> <?php $sqldoc = "SELECT u.username,concat(fname,' ',lname) as dname from user u where u.markdelete is null and u.fname is not null "; $doc = $db->query($sqldoc, PDO::FETCH_OBJ); foreach ($doc as $d) { ?> <option value="<?= $d->username ?>"><?= $d->dname ?></option> <?php } ?> </select> </div> </li> </ul> <?php } ?> <div data-role="footer" data-position="fixed" data-theme="d"> <div data-role="navbar"> <ul> <li> <a href="#menu" data-inline="true" data-mini="true" data-icon="check" onclick="fncSubmit();" > บันทึก </a> </li> </ul> </div> </div> </form>
kukks205/jhhc
page/familyfolder/house_edt.php
PHP
gpl-2.0
10,864
/* Smooth scrolling Changes links that link to other parts of this page to scroll smoothly to those links rather than jump to them directly, which can be a little disorienting. sil, http://www.kryogenix.org/ v1.0 2003-11-11 v1.1 2005-06-16 wrap it up in an object */ var ss = { fixAllLinks: function() { // Get a list of all links in the page var allLinks = document.getElementsByTagName('a'); // Walk through the list for (var i=0;i<allLinks.length;i++) { var lnk = allLinks[i]; if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) || ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) { // If the link is internal to the page (begins in #) // then attach the smoothScroll function as an onclick // event handler ss.addEvent(lnk,'click',ss.smoothScroll); } } }, smoothScroll: function(e) { // This is an event handler; get the clicked on element, // in a cross-browser fashion if (window.event) { target = window.event.srcElement; } else if (e) { target = e.target; } else return; // Make sure that the target is an element, not a text node // within an element if (target.nodeName.toLowerCase() != 'a') { target = target.parentNode; } // Paranoia; check this is an A tag if (target.nodeName.toLowerCase() != 'a') return; // Find the <a name> tag corresponding to this href // First strip off the hash (first character) anchor = target.hash.substr(1); // Now loop all A tags until we find one with that name var allLinks = document.getElementsByTagName('a'); var destinationLink = null; for (var i=0;i<allLinks.length;i++) { var lnk = allLinks[i]; if (lnk.name && (lnk.name == anchor)) { destinationLink = lnk; break; } } if (!destinationLink) destinationLink = document.getElementById(anchor); // If we didn't find a destination, give up and let the browser do // its thing if (!destinationLink) return true; // Find the destination's position var destx = destinationLink.offsetLeft; var desty = destinationLink.offsetTop; var thisNode = destinationLink; while (thisNode.offsetParent && (thisNode.offsetParent != document.body)) { thisNode = thisNode.offsetParent; destx += thisNode.offsetLeft; desty += thisNode.offsetTop; } // Stop any current scrolling clearInterval(ss.INTERVAL); cypos = ss.getCurrentYPos(); ss_stepsize = parseInt((desty-cypos)/ss.STEPS); ss.INTERVAL = setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10); // And stop the actual click happening if (window.event) { window.event.cancelBubble = true; window.event.returnValue = false; } if (e && e.preventDefault && e.stopPropagation) { e.preventDefault(); e.stopPropagation(); } }, scrollWindow: function(scramount,dest,anchor) { wascypos = ss.getCurrentYPos(); isAbove = (wascypos < dest); window.scrollTo(0,wascypos + scramount); iscypos = ss.getCurrentYPos(); isAboveNow = (iscypos < dest); if ((isAbove != isAboveNow) || (wascypos == iscypos)) { // if we've just scrolled past the destination, or // we haven't moved from the last scroll (i.e., we're at the // bottom of the page) then scroll exactly to the link window.scrollTo(0,dest); // cancel the repeating timer clearInterval(ss.INTERVAL); // and jump to the link directly so the URL's right location.hash = anchor; } }, getCurrentYPos: function() { if (document.body && document.body.scrollTop) return document.body.scrollTop; if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop; if (window.pageYOffset) return window.pageYOffset; return 0; }, addEvent: function(elm, evType, fn, useCapture) { // addEvent and removeEvent // cross-browser event handling for IE5+, NS6 and Mozilla // By Scott Andrew if (elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent){ var r = elm.attachEvent("on"+evType, fn); return r; } else { alert("Handler could not be removed"); } } } ss.STEPS = 20; ss.addEvent(window,"load",ss.fixAllLinks);
tatematsu/tatematsu
common/js/scroll.js
JavaScript
gpl-2.0
4,557
<?php /** * @version 2.0 + * @package Open Source Excellence Security Suite * @subpackage Centrora Security Firewall * @subpackage Open Source Excellence WordPress Firewall * @author Open Source Excellence {@link http://www.opensource-excellence.com} * @author Created on 01-Jun-2013 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * @Copyright Copyright (C) 2008 - 2012- ... Open Source Excellence */ if (!defined('OSE_FRAMEWORK') && !defined('OSE_ADMINPATH') && !defined('_JEXEC')) { die('Direct Access Not Allowed'); } require_once(dirname(__FILE__).ODS.'oseDB2.php'); class oseDB2Joomla extends oseDB2 { public function __construct() { $this->dbo = $this->getConnection(); $this->setPrefix (); } protected function setPrefix() { $config = oseJoomla::getConfig(); $this->prefix = $config->prefix; } public function getConnection() { $config = oseJoomla::getConfig(); $host = explode(':', $config->host); if (!empty($host[1])) { $connection = new CDbConnection('mysql:host='.$host[0].';port='.$host[1].';dbname='.$config->db, $config->user, $config->password); } else { $connection = new CDbConnection('mysql:host='.$host[0].';dbname='.$config->db, $config->user, $config->password); } return $connection; } public function getTableList() { $query = "SHOW TABLES ; "; $this->setQuery($query); $results = $this->loadResultArray(); $list = array(); $config = oseJoomla::getConfig(); $index = "Tables_in_".$config->db; foreach ($results as $result) { if (!preg_match("/(ose_app_geoip)|(osefirewall_country)/", $result[$index])) { $tmp = array_values($result); $list[] = $tmp[0]; } } return $list; } }
amang-cuelogic/wp_test
wp-content/plugins/ose-firewall/framework/oseframework/db/joomla.php
PHP
gpl-2.0
2,392
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for # the Earth and Planetary Sciences # Copyright (C) 2012 - 2022 by the BurnMan team, released under the GNU # GPL v2 or later. """ example_fit_solution -------------------- This example demonstrates how to fit parameters for solution models using a range of compositionally-variable experimental data. The example in this file deals with finding optimized parameters for the forsterite-fayalite binary using a mixture of volume and seismic velocity data. teaches: - least squares fitting for solution data """ import numpy as np import matplotlib.pyplot as plt from numpy import random import burnman from burnman.utils.misc import pretty_print_values from burnman.optimize.eos_fitting import fit_XPTp_data from burnman.optimize.nonlinear_fitting import plot_residuals, extreme_values from burnman.optimize.nonlinear_fitting import corner_plot from burnman.optimize.nonlinear_fitting import weighted_residual_plot if __name__ == "__main__": # Set np.array printing precision to be low # (for more readable covariance matrices) np.set_printoptions(precision=1) # First, let's create a solution to optimise. # In this case, we choose a solution model that exists in # the BurnMan repository; the Mg-Fe olivine from # the Stixrude and Lithgow-Bertelloni dataset solution = burnman.minerals.SLB_2011.mg_fe_olivine() solution.set_state(1.e5, 300.) print('Names of endmembers in the olivine solution:') print(solution.endmember_names) print('') # Fit parameters are provided via a list of lists. # The first element of each list is a string that corresponds # either to one of the keys in an endmember parameter dictionary, # or to an excess property for a binary join in the solution. # The next parameters correspond to the indices of the endmembers # to which the parameter corresponds. # Here, we choose to fit he standard state volume, isothermal # bulk modulus and its first derivative for both endmembers. # Endmember 0 is forsterite, and Endmember 1 is fayalite. # We also choose to fit the excess volume on the binary join. fit_params = [['V_0', 0], ['V_0', 1], ['K_0', 0], ['K_0', 1], ['Kprime_0', 0], ['Kprime_0', 1], ['G_0', 0], ['G_0', 1], ['V', 0, 1]] # Next, we make some synthetic data n_data = 100 data = [] data_covariances = [] flags = [] # For this example, we add some Gaussian noise # to the volumes of olivines on the binary between # 0-10 GPa and 300-1300 K. # Here 1 standard deviation is set as 0.1% of the # volume at P and T f_Verror = 1.e-3 # Choose a specific seed for the random number generator # so that this example is reproducible. random.seed(10) for i in range(n_data): x_fa = random.random() P = random.random() * 1.e10 T = random.random() * 1000. + 300. X = [1.-x_fa, x_fa] solution.set_composition(X) solution.set_state(P, T) f = (1. + (random.normal() - 0.5)*f_Verror) V = solution.V * f data.append([1.-x_fa, x_fa, P, T, V]) data_covariances.append(np.zeros((5, 5))) data_covariances[-1][4, 4] = np.power(solution.V*f_Verror, 2.) flags.append('V') # Here, we add one awful data point in the middle of the domain # We do this to demonstrate the semi-automatic removal of bad data # using extreme value theory. solution.set_composition([0.5, 0.5]) solution.set_state(5.e9, 800.) data.append([0.5, 0.5, 5.e9, 800., solution.V + 3.e-7]) data_covariances.append(np.zeros((5, 5))) data_covariances[-1][4, 4] = np.power(solution.V*f_Verror, 2.) flags.append('V') # Now create some velocity data, again adding # some Gaussian noise. # Here 1 standard deviation is set as 1% of the # P wave velocity at P and T n_data = 20 f_Vperror = 1.e-2 for i in range(n_data): x_fa = random.random() P = random.random() * 1.e10 T = random.random() * 1000. + 300. X = [1.-x_fa, x_fa] solution.set_composition(X) solution.set_state(P, T) f = (1. + (random.normal() - 0.5)*f_Vperror) Vp = solution.p_wave_velocity * f data.append([1.-x_fa, x_fa, P, T, Vp]) data_covariances.append(np.zeros((5, 5))) data_covariances[-1][4, 4] = np.power(solution.p_wave_velocity * f_Vperror, 2.) flags.append('p_wave_velocity') data = np.array(data) data_covariances = np.array(data_covariances) flags = np.array(flags) # Here are some (optional) initial step sizes for the optimizer. delta_params = np.array([1.e-8, 1.e-8, 1.e7, 1.e7, 1.e-1, 1.e-1, 1.e-1, 1.e-1, 1.e-8]) # And some bounds. For this example the bounds are not necessary, # but if the data is somewhat shaky it can be useful to provide some # guidance for the least squares minimizer. bounds = np.array([[0, np.inf], [0, np.inf], [0, np.inf], [0, np.inf], [3.5, 6.], [3.5, 6.], [0, np.inf], [0, np.inf], [-np.inf, np.inf]]) param_tolerance = 1.e-5 # Finally, some post-processing options confidence_interval = 0.95 remove_outliers = True good_data_confidence_interval = 0.99 properties_for_data_comparison_plots = [('V', 1.e6, 'Volume (cm^3/mol)'), ('p_wave_velocity', 1.e-3, '$V_P$ (km/s)')] # The following line fits the parameters to the data we defined above. print('Starting to fit user-defined data. Please be patient.') fitted_eos = fit_XPTp_data(solution=solution, flags=flags, fit_params=fit_params, data=data, data_covariances=data_covariances, delta_params=delta_params, bounds=bounds, param_tolerance=param_tolerance, verbose=False) # Print the optimized parameters print('Optimized equation of state:') pretty_print_values(fitted_eos.popt, fitted_eos.pcov, fitted_eos.fit_params_strings) print('\nParameters:') print(fitted_eos.popt) print('\nFull covariance matrix:') print(fitted_eos.pcov) print('\nGoodness of fit:') print(fitted_eos.goodness_of_fit) print('\n') # Create a plot of the residuals fig, ax = plt.subplots() plot_residuals(ax=ax, weighted_residuals=fitted_eos.weighted_residuals, flags=fitted_eos.flags) plt.show() val_extreme = extreme_values(fitted_eos.weighted_residuals, good_data_confidence_interval) confidence_bound, indices, probabilities = val_extreme if indices != [] and remove_outliers is True: print(f'Removing {len(indices):d} outliers' f' (at the {good_data_confidence_interval*100.:.1f}% ' 'confidence interval) and refitting. ' 'Please wait just a little longer.') mask = [i for i in range(len(fitted_eos.weighted_residuals)) if i not in indices] data = data[mask] flags = flags[mask] data_covariances = data_covariances[mask] fitted_eos = fit_XPTp_data(solution=solution, flags=flags, fit_params=fit_params, data=data, data_covariances=data_covariances, param_tolerance=param_tolerance, verbose=False) # Print the optimized parameters print('Optimized equation of state:') pretty_print_values(fitted_eos.popt, fitted_eos.pcov, fitted_eos.fit_params_strings) print('\nParameters:') print(fitted_eos.popt) print('\nFull covariance matrix:') print(fitted_eos.pcov) print('\nGoodness of fit:') print(fitted_eos.goodness_of_fit) print('\n') # Create a plot of the residuals fig, ax = plt.subplots() plot_residuals(ax=ax, weighted_residuals=fitted_eos.weighted_residuals, flags=fitted_eos.flags) plt.show() # Create a corner plot of the covariances fig, ax_array = corner_plot(popt=fitted_eos.popt, pcov=fitted_eos.pcov, param_names=fitted_eos.fit_params_strings) plt.show() # Create plots for the weighted residuals of each type of measurement enum_prps = enumerate(properties_for_data_comparison_plots) for i, (material_property, scaling, name) in enum_prps: fig, ax = plt.subplots() weighted_residual_plot(ax=ax, model=fitted_eos, flag=material_property, sd_limit=3, cmap=plt.cm.RdYlBu, plot_axes=[2, 3], scale_axes=[1.e-9, 1.]) ax.set_title(f'Weighted residual plot for {name:s}') ax.set_xlabel('Pressure (GPa)') ax.set_ylabel('Temperature (K)') plt.show()
geodynamics/burnman
examples/example_fit_solution.py
Python
gpl-2.0
9,817
/* Control over an attribute of a line Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package ddf.minim.javax.sound.sampled; /** * A control provides the ability to affect some attribute of a line, for * instance its volume. * * @since 1.3 */ public abstract class Control { /** * This describes a single control. * * @since 1.3 */ public static class Type { private String name; /** * Create a new Type given its name. * * @param name * the name of the type */ protected Type(String name) { this.name = name; } public final boolean equals(Object o) { return super.equals(o); } public final int hashCode() { return super.hashCode(); } /** * Return the name of this Type. */ public final String toString() { return name; } } private Type type; /** * Create a new Control given its Type. * * @param type * the type */ protected Control(Type type) { this.type = type; } /** * Return the Type of this Control. */ public Type getType() { return type; } /** * Return a String descrsibing this control. In particular the value will * include the name of the associated Type. */ public String toString() { return type.toString(); } }
DASAR/Minim-Android
src/ddf/minim/javax/sound/sampled/Control.java
Java
gpl-2.0
3,000
<?php // The Query $args = array( 'post_type'=> 'pizza', 'cat' => 2, 'p' => 50 ); $the_query = new WP_Query( $args); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $theme_options = ifne( $GLOBALS, 'theme_options', array() ); $page_fields = get_fields(); // Content goes here ?> <a href="#"><?php the_title(); ?></a> <div class="menu-item"> <div class="fb-like" data-href="http://herospizza.com.au" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div> <?php $image = ifne( $page_fields, 'pizza_banner' ); ?> <img src="<?php echo $image['url']; ?>" alt="<?php the_title(); ?>" class="pizza-banner" /> <?php $image = ifne( $page_fields, 'pizza_thumbnail' ); ?> <div class="pizza-thumb-wrap" style="background-image: url(<?php echo $image['url'];?>)"> <span class="price-overlay"></span> <span class="price"><?php echo ifne( $page_fields, 'price' ); ?></span> </div><!-- .pizza-thumb-wrap --> <div class="menu-content"> <h3 class="menu-title"><?php the_title(); ?> (<?php echo ifne( $page_fields, 'alternate' ); ?>)</h3> <p><?php the_content(); ?></p> <h5>Ingredients:</h5> <p><?php echo ifne( $page_fields, 'ingredients' ); ?></p> </div><!-- .menu-content --> <table> <thead> <tr> <td width="14%">Energy /100g</td> <td width="14%">Calories /100g</td> <td width="14%">Protein /100g</td> <td width="14%">Fat total /100g</td> <td width="14%">Fat sat /100g</td> <td width="14%">Carbs /100g</td> <td width="14%">Sodium /100g</td> </tr> </thead> <tbody> <tr> <td width="14%"><?php echo ifne( $page_fields, 'energy' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'calories' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'protein' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'fat_total' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'fat_sat' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'carbs' ); ?></td> <td width="14%"><?php echo ifne( $page_fields, 'sodium' ); ?></td> </tr> </tbody> </table> </div><!-- .menu-item --> <?php } } /* Restore original Post Data */ wp_reset_postdata(); ?>
guardiancomics/Heros-Pizza
wp-content/themes/herospizza/parts/pizzas/sides_superhumanSpinach.php
PHP
gpl-2.0
2,274
using System; using Newtonsoft.Json; namespace Ombi.Settings.Settings.Models.Notifications { public class DiscordNotificationSettings : Settings { public bool Enabled { get; set; } public string WebhookUrl { get; set; } public string Username { get; set; } public string Icon { get; set; } public bool HideUser { get; set; } [JsonIgnore] public string WebHookId => SplitWebUrl(4); [JsonIgnore] public string Token => SplitWebUrl(5); private string SplitWebUrl(int index) { if (!WebhookUrl.StartsWith("http", StringComparison.CurrentCulture)) { WebhookUrl = "https://" + WebhookUrl; } var split = WebhookUrl.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); return split.Length < index ? string.Empty : split[index]; } } }
tidusjar/Ombi
src/Ombi.Settings/Settings/Models/Notifications/DiscordNotificationSettings.cs
C#
gpl-2.0
956
<?php /** * Openinghtml Module class file * * @category Markup * @package Xiphe\HTML * @author Hannes Diercks <xiphe@gmx.de> * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE * @link https://github.com/Xiphe/-HTML/blob/master/modules/Openinghtml.php */ namespace Xiphe\HTML\modules; use Xiphe\HTML\core as Core; /** * Openinghtml Module class * * @category Markup * @package Xiphe\HTML * @author Hannes Diercks <xiphe@gmx.de> * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE * @link https://github.com/Xiphe/-HTML */ class Openinghtml extends Core\BasicModule implements Core\ModuleInterface { /** * Module Logic * * @return void */ public function execute() { $this->htmlattrs = array('class' => 'no-js'.$this->ieClass(' ').$this->browserClass(' ')); $this->headattrs = array(); if ($this->called == 'xhtml') { $this->xhtml(); } else { $this->html5(); } } /** * Generate a XHTML header. * * @return void */ public function xhtml() { $this->htmlattrs['xmlns'] = 'http://www.w3.org/1999/xhtml'; echo '<?xml version="1.0" ?>'; Core\Generator::lineBreak(); echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'; Core\Generator::lineBreak(); Core\Config::set('tabs', '++'); Core\Generator::tabs(); echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; Core\Generator::lineBreak(); Core\Config::set('tabs', '--'); echo $this->getHtml(); echo $this->getHead(); } /** * Generate a HTML5 header. * * @return void */ public function html5() { echo '<!DOCTYPE HTML>'; Core\Generator::lineBreak(); echo $this->getHtml(); echo $this->getHead(); \Xiphe\HTML::get()->utf8() ->meta('http-equiv=X-UA-Compatible|content=IE\=edge,chrome\=1'); } /** * Returns the actual html tag. * * @return Tag */ public function getHtml() { $html = new Core\Tag( 'html', array((isset($this->args[1]) ? $this->args[1] : null)), array('generate', 'start') ); $html->setAttrs($this->htmlattrs); return $html; } /** * Returns the head tag. * * @return Tag */ public function getHead() { $head = new Core\Tag( 'head', array((isset($this->args[0]) ? $this->args[0] : null)), array('generate', 'start') ); $head->setAttrs($this->headattrs); return $head; } /** * Checks if \Xiphe\THETOOLS exists and append ie classes. * * @param string $before separator. * * @return string */ public function ieClass($before = '') { $sIeClass = ''; if (class_exists('Xiphe\THEMASTER\core\THEMASTER')) { if (\Xiphe\THETOOLS::is_browser('ie')) { if (\Xiphe\THETOOLS::is_browser('ie6x')) { $sIeClass = $before.'lt-ie10 lt-ie9 lt-ie8 lt-ie7'; } elseif (\Xiphe\THETOOLS::is_browser('ie7x')) { $sIeClass = $before.'lt-ie10 lt-ie9 lt-ie8'; } elseif (\Xiphe\THETOOLS::is_browser('ie8x')) { $sIeClass = $before.'lt-ie10 lt-ie9'; } elseif (\Xiphe\THETOOLS::is_browser('ie9x')) { $sIeClass = $before.'lt-ie10'; } } } return $sIeClass; } /** * Checks if \Xiphe\THETOOLS exists and appends browser classes. * * @param string $before separator. * * @return string */ public function browserClass($before = '') { if (class_exists('Xiphe\THEMASTER\core\THEMASTER')) { $browser = str_replace(' ', '_', strtolower(\Xiphe\THETOOLS::get_browser())); $version = str_replace('.', '-', \Xiphe\THETOOLS::get_browserVersion()); $engine = strtolower(\Xiphe\THETOOLS::get_layoutEngine()); if (!empty($engine)) { $engine .=' '; } return "$before$engine$browser $browser-$version"; } return ''; } }
Xiphe/DropboxConflictMerger
src/Xiphe/HTML/modules/Openinghtml.php
PHP
gpl-2.0
4,576
/* * Copyright (C) 2013 David Graeff <david.graeff@udo.edu> * Based on Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> * Released under the terms of the GNU GPL v2.0. */ #include "qconf.h" #include "mainwindow.h" #include <qglobal.h> #include <QApplication> #include <QDebug> #include "../expr.h" #include "../lkc.h" void fixup_rootmenu(struct menu *menu) { struct menu *child; static int menu_cnt = 0; menu->flags |= MENU_ROOT; for (child = menu->list; child; child = child->next) { if (child->prompt && child->prompt->type == P_MENU) { menu_cnt++; fixup_rootmenu(child); menu_cnt--; } else if (!menu_cnt) fixup_rootmenu(child); } } static const char *progname; static void usage(void) { qDebug() << QApplication::tr("%s <config>\n").arg(progname); exit(0); } int main(int ac, char** av) { const char *name; bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); progname = av[0]; QApplication configApp(ac, av); // Important for QSetting to store settings in .config/kernel.org/qconf configApp.setApplicationName("qconf"); configApp.setOrganizationDomain("kernel.org"); if (ac > 1 && av[1][0] == '-') { switch (av[1][1]) { case 'h': case '?': usage(); } } if (ac > 2 && av[1][0] == '-') { name = av[2]; } else if(ac>1) { name = av[1]; } else { printf("No config file!\n"); usage(); exit(0); } conf_parse(name); fixup_rootmenu(&rootmenu); conf_read(NULL); //zconfdump(stdout); qconf_MainWindow v; configApp.setQuitOnLastWindowClosed(true); v.show(); configApp.exec(); return 0; }
davidgraeff/linux
scripts/kconfig/qconfig/qconf.cc
C++
gpl-2.0
1,598
/* Kopete Oscar Protocol connection.cpp - independent protocol encapsulation Copyright (c) 2004-2005 by Matt Rogers <mattr@kde.org> Based on code Copyright (c) 2004 SuSE Linux AG <http://www.suse.com> Based on Iris, Copyright (C) 2003 Justin Karneges Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org> ************************************************************************* * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * ************************************************************************* */ #include "connection.h" #include "client.h" #include "connector.h" #include "oscarclientstream.h" #include "rateclassmanager.h" #include "task.h" #include "transfer.h" #include <kapplication.h> #include <kdebug.h> #include "oscartypeclasses.h" const Oscar::WORD StarSequences[] = { 5695, 23595, 23620, 23049, 0x2886, 0x2493, 23620, 23049, 2853, 17372, 1255, 1796, 1657, 13606, 1930, 23918, 31234, 30120, 0x1BEA, 0x5342, 0x30CC, 0x2294, 0x5697, 0x25FA, 0x3C26, 0x3303, 0x078A, 0x0FC5, 0x25D6, 0x26EE,0x7570, 0x7F33, 0x4E94, 0x07C9, 0x7339, 0x42A8 //0x39B1, 0x1F07 }; class ConnectionPrivate { public: DWORD snacSequence; WORD flapSequence; QValueList<int> familyList; RateClassManager* rateClassManager; ClientStream* clientStream; Connector* connector; Client* client; Task* root; }; Connection::Connection( Connector* connector, ClientStream* cs, const char* name ) : QObject( 0, name ) { d = new ConnectionPrivate(); d->clientStream = cs; d->client = 0; d->connector = connector; d->rateClassManager = new RateClassManager( this ); d->root = new Task( this, true /* isRoot */ ); m_loggedIn = false; initSequence(); } Connection::~Connection() { delete d->rateClassManager; delete d->clientStream; delete d->connector; delete d->root; delete d; } void Connection::setClient( Client* c ) { d->client = c; connect( c, SIGNAL( loggedIn() ), this, SLOT( loggedIn() ) ); } void Connection::connectToServer( const QString& host, bool auth ) { connect( d->clientStream, SIGNAL( error( int ) ), this, SLOT( streamSocketError( int ) ) ); connect( d->clientStream, SIGNAL( readyRead() ), this, SLOT( streamReadyRead() ) ); connect( d->clientStream, SIGNAL( connected() ), this, SIGNAL( connected() ) ); d->clientStream->connectToServer( host, auth ); } void Connection::close() { d->clientStream->close(); reset(); } bool Connection::isSupported( int family ) const { return ( d->familyList.findIndex( family ) != -1 ); } QValueList<int> Connection::supportedFamilies() const { return d->familyList; } void Connection::addToSupportedFamilies( const QValueList<int>& familyList ) { d->familyList += familyList; } void Connection::addToSupportedFamilies( int family ) { d->familyList.append( family ); } void Connection::taskError( const Oscar::SNAC& s, int errCode ) { d->client->notifyTaskError( s, errCode, false /*fatal*/ ); } void Connection::fatalTaskError( const Oscar::SNAC& s, int errCode ) { d->client->notifyTaskError( s, errCode, true /* fatal */ ); } Oscar::Settings* Connection::settings() const { return d->client->clientSettings(); } Q_UINT16 Connection::flapSequence() { d->flapSequence++; if ( d->flapSequence >= 0x8000 ) //the max flap sequence is 0x8000 ( HEX ) d->flapSequence = 1; return d->flapSequence; } Q_UINT32 Connection::snacSequence() { d->snacSequence++; return d->snacSequence; } QString Connection::userId() const { return d->client->userId(); } QString Connection::password() const { return d->client->password(); } bool Connection::isIcq() const { return d->client->isIcq(); } Task* Connection::rootTask() const { return d->root; } SSIManager* Connection::ssiManager() const { return d->client->ssiManager(); } const Oscar::ClientVersion* Connection::version() const { return d->client->version(); } bool Connection::isLoggedIn() const { return m_loggedIn; } RateClassManager* Connection::rateManager() const { return d->rateClassManager; } void Connection::send( Transfer* request ) const { if( !d->clientStream ) { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No stream to write on!" << endl; return; } d->rateClassManager->queue( request ); } void Connection::forcedSend( Transfer* request ) const { if ( !d->clientStream ) { kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No stream to write on" << endl; return; } d->clientStream->write( request ); } void Connection::initSequence() { d->snacSequence = ( KApplication::random() & 0xFFFF ); int startSequencesIndex = KApplication::random() % ((sizeof StarSequences) / (sizeof StarSequences[0])); d->flapSequence = StarSequences[startSequencesIndex] - 1; } void Connection::distribute( Transfer * transfer ) const { //d->rateClassManager->recalcRateLevels(); if( !rootTask()->take( transfer ) ) kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "root task refused transfer" << endl; delete transfer; } void Connection::reset() { //clear the family list d->familyList.clear(); d->rateClassManager->reset(); } void Connection::streamReadyRead() { // take the incoming transfer and distribute it to the task tree Transfer * transfer = d->clientStream->read(); distribute( transfer ); } void Connection::loggedIn() { m_loggedIn = true; } void Connection::streamSocketError( int code ) { emit socketError( code, d->clientStream->errorText() ); } #include "connection.moc" //kate: tab-width 4; indent-mode csands;
iegor/kdenetwork
kopete/protocols/oscar/liboscar/connection.cpp
C++
gpl-2.0
5,832
using GraphPlugins; namespace GraphCodec { class CustomCodecConfig : ICodecConfig { public IGraphCodec CreateGraphCodec() { return new CustomGraphCodec(); } public string GetCodecName() { return "Custom"; } } }
imefGames/GraphViewer
GraphCodec/CustomCodecConfig.cs
C#
gpl-2.0
300
package Arboles; /** * Esta clase crea una lista y Nodos * * @author Christian A. Rodriguez * @version 1.0 * @since 25octubre2015 */ public class Funciones { Mensajes mensajes = new Mensajes(); Nodo raiz; int cantidad = 0; int altura = 0; Nodo izquierda, derecha; public Funciones() { raiz = null; } /** * Método permite crear la lista desde el inicio ingresado cada nodo por * parte de la clase Estudiante * * @param dato Numero */ public void adicionarNodoArbol(int dato) { Nodo nuevo; nuevo = new Nodo(); nuevo.dato = dato; nuevo.izquierda = null; nuevo.derecha = null; if (raiz == null) { raiz = nuevo; } else { Nodo anterior = null, nodo; nodo = raiz; while (nodo != null) { anterior = nodo; if (dato < nodo.dato) { nodo = nodo.izquierda; } else { nodo = nodo.derecha; } } if (dato < anterior.dato) { anterior.izquierda = nuevo; } else { anterior.derecha = nuevo; } } } private void imprimirPre(Nodo nodo) { if (nodo != null) { System.out.print(nodo.dato + " "); mensajes.mostrarInformacion(nodo.dato + " "); imprimirPre(nodo.izquierda); imprimirPre(nodo.derecha); } } public void imprimirPre() { imprimirPre(raiz); System.out.println(); } private void imprimirEntre(Nodo nodo) { if (nodo != null) { imprimirEntre(nodo.izquierda); System.out.print(nodo.dato + " "); mensajes.mostrarInformacion(nodo.dato + " "); imprimirEntre(nodo.derecha); } } public void imprimirEntre() { imprimirEntre(raiz); System.out.println(); } private void imprimirPost(Nodo nodo) { if (nodo != null) { imprimirPost(nodo.izquierda); imprimirPost(nodo.derecha); System.out.print(nodo.dato + " "); mensajes.mostrarInformacion(nodo.dato + " "); } } public void imprimirPost() { imprimirPost(raiz); System.out.println(); } public void cantidad(Nodo reco) { if (reco != null) { cantidad++; cantidad(reco.izquierda); cantidad(reco.derecha); } } public int cantidad() { cantidad = 0; cantidad(raiz); return cantidad; } private void cantidadNodosHoja(Nodo reco) { if (reco != null) { if (reco.izquierda == null && reco.derecha == null) { cantidad++; } cantidadNodosHoja(reco.izquierda); cantidadNodosHoja(reco.derecha); } } public int cantidadNodosHoja() { cantidad = 0; cantidadNodosHoja(raiz); return cantidad; } private void imprimirEntreConNivel(Nodo reco, int nivel) { if (reco != null) { imprimirEntreConNivel(reco.izquierda, nivel + 1); System.out.print(reco.dato + " (" + nivel + ") - "); imprimirEntreConNivel(reco.derecha, nivel + 1); } } public void imprimirEntreConNivel() { imprimirEntreConNivel(raiz, 1); System.out.println(); } private void retornarAltura(Nodo reco, int nivel) { if (reco != null) { retornarAltura(reco.izquierda, nivel + 1); if (nivel > altura) { altura = nivel; } retornarAltura(reco.derecha, nivel + 1); } } public int retornarAltura() { altura = 0; retornarAltura(raiz, 1); return altura; } public void mayorValor() { if (raiz != null) { Nodo reco = raiz; while (reco.derecha != null) { reco = reco.derecha; } mensajes.mostrarInformacion("Mayor valor del árbol:" + reco.dato); } } }
cristian0193/EstructuraDatos
EstructuraDatos1/src/Arboles/Funciones.java
Java
gpl-2.0
4,396
'use strict'; var config = require('./config') function init(opts) { Object.assign(config, opts) } module.exports = { init: init, routes: require('./routes'), models: require('./models'), entry: require('./entry'), channel: require('./channel'), user: require('./user'), security: require('./security'), wpml: require('../common/wpml'), riot: require('../common/riot'), config: config, webmention: require('./webmention'), store: require('./store') }
dogada/coect-umedia
server/index.js
JavaScript
gpl-2.0
480
package com.github.acme.tests.transfer; import java.io.IOException; /** * @author alex.dobjanschi * @since 9:36 AM 10/24/14 */ public interface FileTransfer { void transferBetweenAAndB(FileSystem fileSystemA, FileSystem fileSystemB) throws IOException; }
djalexd/test-25
file-transfer/src/main/java/com/github/acme/tests/transfer/FileTransfer.java
Java
gpl-2.0
266
define("ace/theme/yesterday",["require","exports","module","ace/lib/dom"], function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-yesterday"; exports.cssText = ".ace-yesterday .ace_gutter {\ background: #fff;\ border-right: 1px solid #ddd;\ color: #999;\ font-size: 10pt\ }\ .ace-yesterday .ace_print-margin {\ width: 1px;\ background: #f6f6f6\ }\ .ace-yesterday {\ background-color: #FFFFFF;\ color: #4D4D4C\ }\ .ace-yesterday .ace_cursor {\ color: #AEAFAD\ }\ .ace_scroller.ace_scroll-left {\ box-shadow: none\ }\ .ace-yesterday .ace_marker-layer .ace_selection {\ background: #D6D6D6\ }\ .ace-yesterday.ace_multiselect .ace_selection.ace_start {\ box-shadow: 0 0 3px 0px #FFFFFF;\ border-radius: 2px\ }\ .ace-yesterday .ace_marker-layer .ace_step {\ background: rgb(255, 255, 0)\ }\ .ace-yesterday .ace_marker-layer .ace_bracket {\ margin: -1px 0 0 -1px;\ border: 1px solid #D1D1D1\ }\ .ace-yesterday .ace_marker-layer .ace_active-line {\ background: #EFEFEF\ }\ .ace-yesterday .ace_gutter-active-line {\ background-color : #dcdcdc\ }\ .ace-yesterday .ace_marker-layer .ace_selected-word {\ border: 1px solid #D6D6D6\ }\ .ace-yesterday .ace_invisible {\ color: #D1D1D1\ }\ .ace-yesterday .ace_keyword,\ .ace-yesterday .ace_meta,\ .ace-yesterday .ace_storage,\ .ace-yesterday .ace_storage.ace_type,\ .ace-yesterday .ace_support.ace_type {\ color: #8959A8\ }\ .ace-yesterday .ace_keyword.ace_operator {\ color: #3E999F\ }\ .ace-yesterday .ace_constant.ace_character,\ .ace-yesterday .ace_constant.ace_language,\ .ace-yesterday .ace_constant.ace_numeric,\ .ace-yesterday .ace_keyword.ace_other.ace_unit,\ .ace-yesterday .ace_support.ace_constant,\ .ace-yesterday .ace_variable.ace_parameter {\ color: #F5871F\ }\ .ace-yesterday .ace_constant.ace_other {\ color: #666969\ }\ .ace-yesterday .ace_invalid {\ color: #FFFFFF;\ background-color: #C82829\ }\ .ace-yesterday .ace_invalid.ace_deprecated {\ color: #FFFFFF;\ background-color: #8959A8\ }\ .ace-yesterday .ace_fold {\ background-color: #4271AE;\ border-color: #4D4D4C\ }\ .ace-yesterday .ace_entity.ace_name.ace_function,\ .ace-yesterday .ace_support.ace_function,\ .ace-yesterday .ace_variable {\ color: #4271AE\ }\ .ace-yesterday .ace_support.ace_class,\ .ace-yesterday .ace_support.ace_type {\ color: #C99E00\ }\ .ace-yesterday .ace_heading,\ .ace-yesterday .ace_markup.ace_heading,\ .ace-yesterday .ace_string {\ color: #718C00\ }\ .ace-yesterday .ace_entity.ace_name.ace_tag,\ .ace-yesterday .ace_entity.ace_other.ace_attribute-name,\ .ace-yesterday .ace_meta.ace_tag,\ .ace-yesterday .ace_string.ace_regexp,\ .ace-yesterday .ace_variable {\ color: #C82829\ }\ .ace-yesterday .ace_comment {\ color: #8E908C\ }\ .ace-yesterday .ace_indent-guide {\ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y\ }"; var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); });
DHUers/rigidoj
lib/assets/javascripts/ace/theme-yesterday.js
JavaScript
gpl-2.0
3,006
package clustering.results; public class ResultadoMerge { public int[][] merge; public final int length; public ResultadoMerge(int size) { merge=new int[2][size]; length=size; } public int[] getId1(){ return merge[0]; } public int[] getId2(){ return merge[1]; } }
LBAB-Humboldt/JavaHierarchicalClustering
HierarchicalClustering/src/clustering/results/ResultadoMerge.java
Java
gpl-2.0
281
<?php /** * Class FieldTypesService * * @package ModelFramework\FieldTypesService * @author Vladimir Pasechnik vladimir.pasechnik@gmail.com * @author Stanislav Burikhin stanislav.burikhin@gmail.com */ namespace ModelFramework\FieldTypesService; use ModelFramework\ConfigService\ConfigAwareInterface; use ModelFramework\ConfigService\ConfigAwareTrait; class FiledTypesService implements FieldTypesServiceInterface, ConfigAwareInterface { use ConfigAwareTrait; /** * @param string $type * @param string $part * * @return array * @throws \Exception */ public function getFieldPart( $type, $part ) { return $this->getConfigDomainPart( 'fieldTypes', $type, $part ); // $_config = $this->getConfigPart( $type ); // if ( !isset( $_config[ $part ] ) ) // { // throw new \Exception( 'Unknown type "' . $type . '" for ' . $part ); // } // // return $_config[ $part ]; } /** * @param string $type * * @return array * @throws \Exception */ public function getInputFilter( $type ) { return $this->getFieldPart( $type, 'filter' ); } /** * @param string $type * * @return array * @throws \Exception */ public function getField( $type ) { return $this->getFieldPart( $type, 'field' ); } /** * @param string $type * * @return array * @throws \Exception */ public function getFormElement( $type ) { return $this->getFieldPart( $type, 'element' ); } /** * @param string $modelName * * @return array */ public function getUtilityFields( $modelName = '' ) { return [ 'fields' => [ '_id' => [ 'type' => 'pk', 'fieldtype' => '_id', 'datatype' => 'string', 'default' => '', 'label' => 'ID', 'source' => '_id', ], '_acl' => [ 'type' => 'field', 'fieldtype' => 'array', 'datatype' => 'array', 'default' => [ ], 'label' => 'acl', 'source' => '_acl', ], ], 'filters' => [ '_id' => $this->getInputFilter( 'text' ) ], ]; } }
modelframework/modelframework
src/ModelFramework/FieldTypesService/FiledTypesService.php
PHP
gpl-2.0
2,494
<?php /** * glFusion CMS * * UTF-8 Language File for Links Plugin * * @license GNU General Public License version 2 or later * http://www.opensource.org/licenses/gpl-license.php * * Copyright (C) 2008-2018 by the following authors: * Mark R. Evans mark AT glfusion DOT org * * Based on prior work Copyright (C) 2001-2007 by the following authors: * Tony Bibbs - tony AT tonybibbs DOT com * Trinity Bays - trinity93 AT gmail DOT com * Tom Willett - twillett AT users DOT sourceforge DOT net * */ if (!defined ('GVERSION')) { die ('This file cannot be used on its own.'); } global $LANG32; ############################################################################### # Array Format: # $LANGXX[YY]: $LANG - variable name # XX - file id number # YY - phrase id number ############################################################################### /** * the link plugin's lang array * * @global array $LANG_LINKS */ $LANG_LINKS = array( 10 => 'Submissions', 14 => 'Links', 84 => 'Links', 88 => 'No new links', 114 => 'Links', 116 => 'Add A Link', 117 => 'Report Broken Link', 118 => 'Broken Link Report', 119 => 'The following link has been reported to be broken: ', 120 => 'To edit the link, click here: ', 121 => 'The broken Link was reported by: ', 122 => 'Thank you for reporting this broken link. The administrator will correct the problem as soon as possible', 123 => 'Thank you', 124 => 'Go', 125 => 'Categories', 126 => 'You are here:', 'root' => 'Root', 'error_header' => 'Link Submission Error', 'verification_failed' => 'The URL specified does not appear to be a valid URL', 'category_not_found' => 'The Category does not appear to be valid', 'no_links' => 'No links have been entered.', ); ############################################################################### # for stats /** * the link plugin's lang stats array * * @global array $LANG_LINKS_STATS */ $LANG_LINKS_STATS = array( 'links' => 'Links (Clicks) in the System', 'stats_headline' => 'Top Ten Links', 'stats_page_title' => 'Links', 'stats_hits' => 'Hits', 'stats_no_hits' => 'It appears that there are no links on this site or no one has ever clicked on one.', ); ############################################################################### # for the search /** * the link plugin's lang search array * * @global array $LANG_LINKS_SEARCH */ $LANG_LINKS_SEARCH = array( 'results' => 'Link Results', 'title' => 'Title', 'date' => 'Date Added', 'author' => 'Submited by', 'hits' => 'Clicks' ); ############################################################################### # for the submission form /** * the link plugin's lang submit form array * * @global array $LANG_LINKS_SUBMIT */ $LANG_LINKS_SUBMIT = array( 1 => 'Submit a Link', 2 => 'Link', 3 => 'Category', 4 => 'Other', 5 => 'If other, please specify', 6 => 'Error: Missing Category', 7 => 'When selecting "Other" please also provide a category name', 8 => 'Title', 9 => 'URL', 10 => 'Category', 11 => 'Link Submissions', 12 => 'Submitted By', ); ############################################################################### # autotag description $LANG_LI_AUTOTAG = array( 'desc_link' => 'Link: to the detail page for a Link on this site; link_text defaults to the link name. usage: [link:<i>link_id</i> {link_text}]', ); ############################################################################### # Messages for COM_showMessage the submission form $PLG_links_MESSAGE1 = "Thank-you for submitting a link to {$_CONF['site_name']}. It has been submitted to our staff for approval. If approved, your link will be seen in the <a href={$_CONF['site_url']}/links/index.php>links</a> section."; $PLG_links_MESSAGE2 = 'Your link has been successfully saved.'; $PLG_links_MESSAGE3 = 'The link has been successfully deleted.'; $PLG_links_MESSAGE4 = "Thank-you for submitting a link to {$_CONF['site_name']}. You can see it now in the <a href={$_CONF['site_url']}/links/index.php>links</a> section."; $PLG_links_MESSAGE5 = "You do not have sufficient access rights to view this category."; $PLG_links_MESSAGE6 = 'You do not have sufficient rights to edit this category.'; $PLG_links_MESSAGE7 = 'Please enter a Category Name and Description.'; $PLG_links_MESSAGE10 = 'Your category has been successfully saved.'; $PLG_links_MESSAGE11 = 'You are not allowed to set the id of a category to "site" or "user" - these are reserved for internal use.'; $PLG_links_MESSAGE12 = 'You are trying to make a parent category the child of it\'s own subcategory. This would create an orphan category, so please first move the child category or categories up to a higher level.'; $PLG_links_MESSAGE13 = 'The category has been successfully deleted.'; $PLG_links_MESSAGE14 = 'Category contains links and/or categories. Please remove these first.'; $PLG_links_MESSAGE15 = 'You do not have sufficient rights to delete this category.'; $PLG_links_MESSAGE16 = 'No such category exists.'; $PLG_links_MESSAGE17 = 'This category id is already in use.'; // Messages for the plugin upgrade $PLG_links_MESSAGE3001 = 'Plugin upgrade not supported.'; $PLG_links_MESSAGE3002 = $LANG32[9]; ############################################################################### # admin/link.php /** * the link plugin's lang admin array * * @global array $LANG_LINKS_ADMIN */ $LANG_LINKS_ADMIN = array( 1 => 'Link Editor', 2 => 'Link ID', 3 => 'Link Title', 4 => 'Link URL', 5 => 'Category', 6 => '(include http://)', 7 => 'Other', 8 => 'Link Hits', 9 => 'Link Description', 10 => 'You need to provide a link Title, URL and Description.', 11 => 'Link Administration', 12 => 'To modify or delete a link, click on that link\'s edit icon below. To create a new link or a new category, click on "New link" or "New category" above. To edit multiple categories, click on "Edit categories" above.', 14 => 'Link Category', 16 => 'Access Denied', 17 => "You are trying to access a link that you don't have rights to. This attempt has been logged. Please <a href=\"{$_CONF['site_admin_url']}/plugins/links/index.php\">go back to the link administration screen</a>.", 20 => 'If other, specify', 21 => 'save', 22 => 'cancel', 23 => 'delete', 24 => 'Link not found', 25 => 'The link you selected for editing could not be found.', 26 => 'Validate Links', 27 => 'HTML Status', 28 => 'Edit category', 29 => 'Enter or edit the details below.', 30 => 'Category', 31 => 'Description', 32 => 'Category ID', 33 => 'Topic', 34 => 'Parent', 35 => 'All', 40 => 'Edit this category', 41 => 'Add', 42 => 'Delete this category', 43 => 'Site categories', 44 => 'Add Subcategory', 46 => 'User %s tried to delete a category to which they do not have access rights', 50 => 'Category Admin', 51 => 'New Link', 52 => 'New Root Category', 53 => 'Links Admin', 54 => 'Link Category Administration', 55 => 'Edit categories below. Note that you cannot delete a category that contains other categories or links - you should delete these first, or move them to another category.', 56 => 'Category Editor', 57 => 'Not validated yet', 58 => 'Validate now', 59 => '<br /><br />To validate all links displayed, please click on the "Validate now" link below. The validation process may take some time depending on the amount of links displayed.', 60 => 'User %s tried illegally to edit category %s.', 61 => 'Owner', 62 => 'Last Updated', 63 => 'Are you sure you want to delete this link?', 64 => 'Are you sure you want to delete this category?', 65 => 'Moderate Link', 66 => 'This screen allows you to create / edit links.', 67 => 'This screen allows you to create / edit a links category.', ); $LANG_LINKS_STATUS = array( 100 => "Continue", 101 => "Switching Protocols", 200 => "OK", 201 => "Created", 202 => "Accepted", 203 => "Non-Authoritative Information", 204 => "No Content", 205 => "Reset Content", 206 => "Partial Content", 300 => "Multiple Choices", 301 => "Moved Permanently", 302 => "Found", 303 => "See Other", 304 => "Not Modified", 305 => "Use Proxy", 307 => "Temporary Redirect", 400 => "Bad Request", 401 => "Unauthorized", 402 => "Payment Required", 403 => "Forbidden", 404 => "Not Found", 405 => "Method Not Allowed", 406 => "Not Acceptable", 407 => "Proxy Authentication Required", 408 => "Request Timeout", 409 => "Conflict", 410 => "Gone", 411 => "Length Required", 412 => "Precondition Failed", 413 => "Request Entity Too Large", 414 => "Request-URI Too Long", 415 => "Unsupported Media Type", 416 => "Requested Range Not Satisfiable", 417 => "Expectation Failed", 500 => "Internal Server Error", 501 => "Not Implemented", 502 => "Bad Gateway", 503 => "Service Unavailable", 504 => "Gateway Timeout", 505 => "HTTP Version Not Supported", 999 => "Connection Timed out" ); // Localization of the Admin Configuration UI $LANG_configsections['links'] = array( 'label' => 'Links', 'title' => 'Links Configuration' ); $LANG_confignames['links'] = array( 'linksloginrequired' => 'Links Login Required', 'linksubmission' => 'Enable Link Submission Queue', 'newlinksinterval' => 'New Links Interval', 'hidenewlinks' => 'Hide New Links', 'hidelinksmenu' => 'Hide Links Menu Entry', 'linkcols' => 'Categories per Column', 'linksperpage' => 'Links per Page', 'show_top10' => 'Show Top 10 Links', 'notification' => 'Notification Email', 'delete_links' => 'Delete Links with Owner', 'aftersave' => 'After Saving Link', 'show_category_descriptions' => 'Show Category Description', 'root' => 'ID of Root Category', 'default_permissions' => 'Link Default Permissions', 'target_blank' => 'Open Links in New Window', 'displayblocks' => 'Display glFusion Blocks', 'submission' => 'Link Submission', ); $LANG_configsubgroups['links'] = array( 'sg_main' => 'Main Settings' ); $LANG_fs['links'] = array( 'fs_public' => 'Public Links List Settings', 'fs_admin' => 'Links Admin Settings', 'fs_permissions' => 'Default Permissions' ); $LANG_configSelect['links'] = array( 0 => array(1=>'True', 0=>'False'), 1 => array(true=>'True', false=>'False'), 9 => array('item'=>'Forward to Linked Site', 'list'=>'Display Admin List', 'plugin'=>'Display Public List', 'home'=>'Display Home', 'admin'=>'Display Admin'), 12 => array(0=>'No access', 2=>'Read-Only', 3=>'Read-Write'), 13 => array(0=>'Left Blocks', 1=>'Right Blocks', 2=>'Left & Right Blocks', 3=>'None'), 14 => array(0=>'None', 1=>'Logged-in Only', 2=>'Anyone', 3=>'None') ); ?>
glFusion/glfusion
private/plugins/links/language/english_utf-8.php
PHP
gpl-2.0
11,040
/****************************************************************************** * Icinga 2 * * Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software Foundation * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ #include "icinga/compatutility.hpp" #include "icinga/checkcommand.hpp" #include "icinga/eventcommand.hpp" #include "icinga/pluginutility.hpp" #include "icinga/service.hpp" #include "base/utility.hpp" #include "base/configtype.hpp" #include "base/objectlock.hpp" #include "base/convert.hpp" #include <boost/foreach.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/join.hpp> using namespace icinga; /* command */ String CompatUtility::GetCommandLine(const Command::Ptr& command) { Value commandLine = command->GetCommandLine(); String result; if (commandLine.IsObjectType<Array>()) { Array::Ptr args = commandLine; ObjectLock olock(args); String arg; BOOST_FOREACH(arg, args) { // This is obviously incorrect for non-trivial cases. result += " \"" + EscapeString(arg) + "\""; } } else if (!commandLine.IsEmpty()) { result = EscapeString(Convert::ToString(commandLine)); } else { result = "<internal>"; } return result; } String CompatUtility::GetCommandNamePrefix(const Command::Ptr command) { if (!command) return Empty; String prefix; if (command->GetType() == ConfigType::GetByName("CheckCommand")) prefix = "check_"; else if (command->GetType() == ConfigType::GetByName("NotificationCommand")) prefix = "notification_"; else if (command->GetType() == ConfigType::GetByName("EventCommand")) prefix = "event_"; return prefix; } String CompatUtility::GetCommandName(const Command::Ptr command) { if (!command) return Empty; return GetCommandNamePrefix(command) + command->GetName(); } /* host */ int CompatUtility::GetHostCurrentState(const Host::Ptr& host) { if (host->GetState() != HostUp && !host->IsReachable()) return 2; /* hardcoded compat state */ return host->GetState(); } String CompatUtility::GetHostStateString(const Host::Ptr& host) { if (host->GetState() != HostUp && !host->IsReachable()) return "UNREACHABLE"; /* hardcoded compat state */ return Host::StateToString(host->GetState()); } String CompatUtility::GetHostAlias(const Host::Ptr& host) { if (!host->GetDisplayName().IsEmpty()) return host->GetName(); else return host->GetDisplayName(); } int CompatUtility::GetHostNotifyOnDown(const Host::Ptr& host) { unsigned long notification_state_filter = GetCheckableNotificationStateFilter(host); if (notification_state_filter & (1<<ServiceCritical) || notification_state_filter & (1<<ServiceWarning)) return 1; return 0; } int CompatUtility::GetHostNotifyOnUnreachable(const Host::Ptr& host) { unsigned long notification_state_filter = GetCheckableNotificationStateFilter(host); if (notification_state_filter & (1<<ServiceUnknown)) return 1; return 0; } /* service */ String CompatUtility::GetCheckableCommandArgs(const Checkable::Ptr& checkable) { CheckCommand::Ptr command = checkable->GetCheckCommand(); Dictionary::Ptr args = new Dictionary(); if (command) { Host::Ptr host; Service::Ptr service; tie(host, service) = GetHostService(checkable); String command_line = GetCommandLine(command); Dictionary::Ptr command_vars = command->GetVars(); if (command_vars) { ObjectLock olock(command_vars); BOOST_FOREACH(const Dictionary::Pair& kv, command_vars) { String macro = "$" + kv.first + "$"; // this is too simple if (command_line.Contains(macro)) args->Set(kv.first, kv.second); } } Dictionary::Ptr host_vars = host->GetVars(); if (host_vars) { ObjectLock olock(host_vars); BOOST_FOREACH(const Dictionary::Pair& kv, host_vars) { String macro = "$" + kv.first + "$"; // this is too simple if (command_line.Contains(macro)) args->Set(kv.first, kv.second); macro = "$host.vars." + kv.first + "$"; if (command_line.Contains(macro)) args->Set(kv.first, kv.second); } } if (service) { Dictionary::Ptr service_vars = service->GetVars(); if (service_vars) { ObjectLock olock(service_vars); BOOST_FOREACH(const Dictionary::Pair& kv, service_vars) { String macro = "$" + kv.first + "$"; // this is too simple if (command_line.Contains(macro)) args->Set(kv.first, kv.second); macro = "$service.vars." + kv.first + "$"; if (command_line.Contains(macro)) args->Set(kv.first, kv.second); } } } String arg_string; ObjectLock olock(args); BOOST_FOREACH(const Dictionary::Pair& kv, args) { arg_string += Convert::ToString(kv.first) + "=" + Convert::ToString(kv.second) + "!"; } return arg_string; } return Empty; } int CompatUtility::GetCheckableCheckType(const Checkable::Ptr& checkable) { return (checkable->GetEnableActiveChecks() ? 0 : 1); } double CompatUtility::GetCheckableCheckInterval(const Checkable::Ptr& checkable) { return checkable->GetCheckInterval() / 60.0; } double CompatUtility::GetCheckableRetryInterval(const Checkable::Ptr& checkable) { return checkable->GetRetryInterval() / 60.0; } String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable) { TimePeriod::Ptr check_period = checkable->GetCheckPeriod(); if (check_period) return check_period->GetName(); else return "24x7"; } int CompatUtility::GetCheckableHasBeenChecked(const Checkable::Ptr& checkable) { return (checkable->GetLastCheckResult() ? 1 : 0); } int CompatUtility::GetCheckableProblemHasBeenAcknowledged(const Checkable::Ptr& checkable) { return (checkable->GetAcknowledgement() != AcknowledgementNone ? 1 : 0); } int CompatUtility::GetCheckableAcknowledgementType(const Checkable::Ptr& checkable) { return static_cast<int>(checkable->GetAcknowledgement()); } int CompatUtility::GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable) { return (checkable->GetEnablePassiveChecks() ? 1 : 0); } int CompatUtility::GetCheckableActiveChecksEnabled(const Checkable::Ptr& checkable) { return (checkable->GetEnableActiveChecks() ? 1 : 0); } int CompatUtility::GetCheckableEventHandlerEnabled(const Checkable::Ptr& checkable) { return (checkable->GetEnableEventHandler() ? 1 : 0); } int CompatUtility::GetCheckableFlapDetectionEnabled(const Checkable::Ptr& checkable) { return (checkable->GetEnableFlapping() ? 1 : 0); } int CompatUtility::GetCheckableIsFlapping(const Checkable::Ptr& checkable) { return (checkable->IsFlapping() ? 1 : 0); } int CompatUtility::GetCheckableIsReachable(const Checkable::Ptr& checkable) { return (checkable->IsReachable() ? 1 : 0); } double CompatUtility::GetCheckablePercentStateChange(const Checkable::Ptr& checkable) { return checkable->GetFlappingCurrent(); } int CompatUtility::GetCheckableProcessPerformanceData(const Checkable::Ptr& checkable) { return (checkable->GetEnablePerfdata() ? 1 : 0); } String CompatUtility::GetCheckableEventHandler(const Checkable::Ptr& checkable) { String event_command_str; EventCommand::Ptr eventcommand = checkable->GetEventCommand(); if (eventcommand) event_command_str = eventcommand->GetName(); return event_command_str; } String CompatUtility::GetCheckableCheckCommand(const Checkable::Ptr& checkable) { String check_command_str; CheckCommand::Ptr checkcommand = checkable->GetCheckCommand(); if (checkcommand) check_command_str = checkcommand->GetName(); return check_command_str; } int CompatUtility::GetCheckableIsVolatile(const Checkable::Ptr& checkable) { return (checkable->GetVolatile() ? 1 : 0); } double CompatUtility::GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable) { return checkable->GetFlappingThreshold(); } double CompatUtility::GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable) { return checkable->GetFlappingThreshold(); } int CompatUtility::GetCheckableFreshnessChecksEnabled(const Checkable::Ptr& checkable) { return (checkable->GetCheckInterval() > 0 ? 1 : 0); } int CompatUtility::GetCheckableFreshnessThreshold(const Checkable::Ptr& checkable) { return static_cast<int>(checkable->GetCheckInterval()); } double CompatUtility::GetCheckableStaleness(const Checkable::Ptr& checkable) { if (checkable->HasBeenChecked() && checkable->GetLastCheck() > 0) return (Utility::GetTime() - checkable->GetLastCheck()) / (checkable->GetCheckInterval() * 3600); return 0.0; } int CompatUtility::GetCheckableIsAcknowledged(const Checkable::Ptr& checkable) { return (checkable->IsAcknowledged() ? 1 : 0); } int CompatUtility::GetCheckableNoMoreNotifications(const Checkable::Ptr& checkable) { if (CompatUtility::GetCheckableNotificationNotificationInterval(checkable) == 0 && !checkable->GetVolatile()) return 1; return 0; } int CompatUtility::GetCheckableInCheckPeriod(const Checkable::Ptr& checkable) { TimePeriod::Ptr timeperiod = checkable->GetCheckPeriod(); /* none set means always checked */ if (!timeperiod) return 1; return (timeperiod->IsInside(Utility::GetTime()) ? 1 : 0); } int CompatUtility::GetCheckableInNotificationPeriod(const Checkable::Ptr& checkable) { BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { ObjectLock olock(notification); TimePeriod::Ptr timeperiod = notification->GetPeriod(); /* first notification wins */ if (timeperiod) return (timeperiod->IsInside(Utility::GetTime()) ? 1 : 0); } /* none set means always notified */ return 1; } /* vars attr */ Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const CustomVarObject::Ptr& object) { Dictionary::Ptr vars = object->GetVars(); if (!vars) return Dictionary::Ptr(); return vars; } String CompatUtility::GetCustomAttributeConfig(const CustomVarObject::Ptr& object, const String& name) { Dictionary::Ptr vars = object->GetVars(); if (!vars) return Empty; return vars->Get(name); } Array::Ptr CompatUtility::GetModifiedAttributesList(const CustomVarObject::Ptr& object) { Array::Ptr mod_attr_list = new Array(); if (object->GetType() != ConfigType::GetByName("Host") && object->GetType() != ConfigType::GetByName("Service") && object->GetType() != ConfigType::GetByName("User") && object->GetType() != ConfigType::GetByName("CheckCommand") && object->GetType() != ConfigType::GetByName("EventCommand") && object->GetType() != ConfigType::GetByName("NotificationCommand")) return mod_attr_list; int flags = object->GetModifiedAttributes(); if ((flags & ModAttrNotificationsEnabled)) mod_attr_list->Add("notifications_enabled"); if ((flags & ModAttrActiveChecksEnabled)) mod_attr_list->Add("active_checks_enabled"); if ((flags & ModAttrPassiveChecksEnabled)) mod_attr_list->Add("passive_checks_enabled"); if ((flags & ModAttrFlapDetectionEnabled)) mod_attr_list->Add("flap_detection_enabled"); if ((flags & ModAttrEventHandlerEnabled)) mod_attr_list->Add("event_handler_enabled"); if ((flags & ModAttrPerformanceDataEnabled)) mod_attr_list->Add("performance_data_enabled"); if ((flags & ModAttrNormalCheckInterval)) mod_attr_list->Add("check_interval"); if ((flags & ModAttrRetryCheckInterval)) mod_attr_list->Add("retry_interval"); if ((flags & ModAttrEventHandlerCommand)) mod_attr_list->Add("event_handler_command"); if ((flags & ModAttrCheckCommand)) mod_attr_list->Add("check_command"); if ((flags & ModAttrMaxCheckAttempts)) mod_attr_list->Add("max_check_attemps"); if ((flags & ModAttrCheckTimeperiod)) mod_attr_list->Add("check_timeperiod"); if ((flags & ModAttrCustomVariable)) mod_attr_list->Add("custom_variable"); return mod_attr_list; } /* notifications */ int CompatUtility::GetCheckableNotificationsEnabled(const Checkable::Ptr& checkable) { return (checkable->GetEnableNotifications() ? 1 : 0); } int CompatUtility::GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable) { double last_notification = 0.0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { if (notification->GetLastNotification() > last_notification) last_notification = notification->GetLastNotification(); } return static_cast<int>(last_notification); } int CompatUtility::GetCheckableNotificationNextNotification(const Checkable::Ptr& checkable) { double next_notification = 0.0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { if (next_notification == 0 || notification->GetNextNotification() < next_notification) next_notification = notification->GetNextNotification(); } return static_cast<int>(next_notification); } int CompatUtility::GetCheckableNotificationNotificationNumber(const Checkable::Ptr& checkable) { int notification_number = 0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { if (notification->GetNotificationNumber() > notification_number) notification_number = notification->GetNotificationNumber(); } return notification_number; } double CompatUtility::GetCheckableNotificationNotificationInterval(const Checkable::Ptr& checkable) { double notification_interval = -1; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { if (notification_interval == -1 || notification->GetInterval() < notification_interval) notification_interval = notification->GetInterval(); } if (notification_interval == -1) notification_interval = 60; return notification_interval / 60.0; } String CompatUtility::GetCheckableNotificationNotificationPeriod(const Checkable::Ptr& checkable) { TimePeriod::Ptr notification_period; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { if (notification->GetPeriod()) notification_period = notification->GetPeriod(); } if (!notification_period) return Empty; return notification_period->GetName(); } String CompatUtility::GetCheckableNotificationNotificationOptions(const Checkable::Ptr& checkable) { Host::Ptr host; Service::Ptr service; tie(host, service) = GetHostService(checkable); unsigned long notification_type_filter = 0; unsigned long notification_state_filter = 0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { notification_type_filter = notification->GetTypeFilter(); notification_state_filter = notification->GetStateFilter(); } std::vector<String> notification_options; /* notification state filters */ if (service) { if (notification_state_filter & (1<<ServiceWarning)) { notification_options.push_back("w"); } if (notification_state_filter & (1<<ServiceUnknown)) { notification_options.push_back("u"); } if (notification_state_filter & (1<<ServiceCritical)) { notification_options.push_back("c"); } } else { if (notification_state_filter & (1<<HostDown)) { notification_options.push_back("d"); } } /* notification type filters */ if (notification_type_filter & (1<<NotificationRecovery)) { notification_options.push_back("r"); } if (notification_type_filter & (1<<NotificationFlappingStart) || notification_type_filter & (1<<NotificationFlappingEnd)) { notification_options.push_back("f"); } if (notification_type_filter & (1<<NotificationDowntimeStart) || notification_type_filter & (1<<NotificationDowntimeEnd) || notification_type_filter & (1<<NotificationDowntimeRemoved)) { notification_options.push_back("s"); } return boost::algorithm::join(notification_options, ","); } int CompatUtility::GetCheckableNotificationTypeFilter(const Checkable::Ptr& checkable) { unsigned long notification_type_filter = 0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { ObjectLock olock(notification); notification_type_filter = notification->GetTypeFilter(); } return notification_type_filter; } int CompatUtility::GetCheckableNotificationStateFilter(const Checkable::Ptr& checkable) { unsigned long notification_state_filter = 0; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { ObjectLock olock(notification); notification_state_filter = notification->GetStateFilter(); } return notification_state_filter; } int CompatUtility::GetCheckableNotifyOnWarning(const Checkable::Ptr& checkable) { if (GetCheckableNotificationStateFilter(checkable) & (1<<ServiceWarning)) return 1; return 0; } int CompatUtility::GetCheckableNotifyOnCritical(const Checkable::Ptr& checkable) { if (GetCheckableNotificationStateFilter(checkable) & (1<<ServiceCritical)) return 1; return 0; } int CompatUtility::GetCheckableNotifyOnUnknown(const Checkable::Ptr& checkable) { if (GetCheckableNotificationStateFilter(checkable) & (1<<ServiceUnknown)) return 1; return 0; } int CompatUtility::GetCheckableNotifyOnRecovery(const Checkable::Ptr& checkable) { if (GetCheckableNotificationTypeFilter(checkable) & (1<<NotificationRecovery)) return 1; return 0; } int CompatUtility::GetCheckableNotifyOnFlapping(const Checkable::Ptr& checkable) { unsigned long notification_type_filter = GetCheckableNotificationTypeFilter(checkable); if (notification_type_filter & (1<<NotificationFlappingStart) || notification_type_filter & (1<<NotificationFlappingEnd)) return 1; return 0; } int CompatUtility::GetCheckableNotifyOnDowntime(const Checkable::Ptr& checkable) { unsigned long notification_type_filter = GetCheckableNotificationTypeFilter(checkable); if (notification_type_filter & (1<<NotificationDowntimeStart) || notification_type_filter & (1<<NotificationDowntimeEnd) || notification_type_filter & (1<<NotificationDowntimeRemoved)) return 1; return 0; } std::set<User::Ptr> CompatUtility::GetCheckableNotificationUsers(const Checkable::Ptr& checkable) { /* Service -> Notifications -> (Users + UserGroups -> Users) */ std::set<User::Ptr> allUsers; std::set<User::Ptr> users; BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { ObjectLock olock(notification); users = notification->GetUsers(); std::copy(users.begin(), users.end(), std::inserter(allUsers, allUsers.begin())); BOOST_FOREACH(const UserGroup::Ptr& ug, notification->GetUserGroups()) { std::set<User::Ptr> members = ug->GetMembers(); std::copy(members.begin(), members.end(), std::inserter(allUsers, allUsers.begin())); } } return allUsers; } std::set<UserGroup::Ptr> CompatUtility::GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable) { std::set<UserGroup::Ptr> usergroups; /* Service -> Notifications -> UserGroups */ BOOST_FOREACH(const Notification::Ptr& notification, checkable->GetNotifications()) { ObjectLock olock(notification); BOOST_FOREACH(const UserGroup::Ptr& ug, notification->GetUserGroups()) { usergroups.insert(ug); } } return usergroups; } String CompatUtility::GetCheckResultOutput(const CheckResult::Ptr& cr) { if (!cr) return Empty; String output; String raw_output = cr->GetOutput(); /* * replace semi-colons with colons in output * semi-colon is used as delimiter in various interfaces */ boost::algorithm::replace_all(raw_output, ";", ":"); size_t line_end = raw_output.Find("\n"); return raw_output.SubStr(0, line_end); } String CompatUtility::GetCheckResultLongOutput(const CheckResult::Ptr& cr) { if (!cr) return Empty; String long_output; String output; String raw_output = cr->GetOutput(); /* * replace semi-colons with colons in output * semi-colon is used as delimiter in various interfaces */ boost::algorithm::replace_all(raw_output, ";", ":"); size_t line_end = raw_output.Find("\n"); if (line_end > 0 && line_end != String::NPos) { long_output = raw_output.SubStr(line_end+1, raw_output.GetLength()); return EscapeString(long_output); } return Empty; } String CompatUtility::GetCheckResultPerfdata(const CheckResult::Ptr& cr) { if (!cr) return String(); return PluginUtility::FormatPerfdata(cr->GetPerformanceData()); } String CompatUtility::EscapeString(const String& str) { String result = str; boost::algorithm::replace_all(result, "\n", "\\n"); return result; } String CompatUtility::UnEscapeString(const String& str) { String result = str; boost::algorithm::replace_all(result, "\\n", "\n"); return result; } std::pair<unsigned long, unsigned long> CompatUtility::ConvertTimestamp(double time) { unsigned long time_sec = static_cast<long>(time); unsigned long time_usec = (time - time_sec) * 1000 * 1000; return std::make_pair(time_sec, time_usec); } int CompatUtility::MapNotificationReasonType(NotificationType type) { switch (type) { case NotificationDowntimeStart: return 5; case NotificationDowntimeEnd: return 6; case NotificationDowntimeRemoved: return 7; case NotificationCustom: return 8; case NotificationAcknowledgement: return 1; case NotificationProblem: return 0; case NotificationRecovery: return 0; case NotificationFlappingStart: return 2; case NotificationFlappingEnd: return 3; default: return 0; } } int CompatUtility::MapExternalCommandType(const String& name) { if (name == "NONE") return 0; if (name == "ADD_HOST_COMMENT") return 1; if (name == "DEL_HOST_COMMENT") return 2; if (name == "ADD_SVC_COMMENT") return 3; if (name == "DEL_SVC_COMMENT") return 4; if (name == "ENABLE_SVC_CHECK") return 5; if (name == "DISABLE_SVC_CHECK") return 6; if (name == "SCHEDULE_SVC_CHECK") return 7; if (name == "DELAY_SVC_NOTIFICATION") return 9; if (name == "DELAY_HOST_NOTIFICATION") return 10; if (name == "DISABLE_NOTIFICATIONS") return 11; if (name == "ENABLE_NOTIFICATIONS") return 12; if (name == "RESTART_PROCESS") return 13; if (name == "SHUTDOWN_PROCESS") return 14; if (name == "ENABLE_HOST_SVC_CHECKS") return 15; if (name == "DISABLE_HOST_SVC_CHECKS") return 16; if (name == "SCHEDULE_HOST_SVC_CHECKS") return 17; if (name == "DELAY_HOST_SVC_NOTIFICATIONS") return 19; if (name == "DEL_ALL_HOST_COMMENTS") return 20; if (name == "DEL_ALL_SVC_COMMENTS") return 21; if (name == "ENABLE_SVC_NOTIFICATIONS") return 22; if (name == "DISABLE_SVC_NOTIFICATIONS") return 23; if (name == "ENABLE_HOST_NOTIFICATIONS") return 24; if (name == "DISABLE_HOST_NOTIFICATIONS") return 25; if (name == "ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST") return 26; if (name == "DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST") return 27; if (name == "ENABLE_HOST_SVC_NOTIFICATIONS") return 28; if (name == "DISABLE_HOST_SVC_NOTIFICATIONS") return 29; if (name == "PROCESS_SERVICE_CHECK_RESULT") return 30; if (name == "SAVE_STATE_INFORMATION") return 31; if (name == "READ_STATE_INFORMATION") return 32; if (name == "ACKNOWLEDGE_HOST_PROBLEM") return 33; if (name == "ACKNOWLEDGE_SVC_PROBLEM") return 34; if (name == "START_EXECUTING_SVC_CHECKS") return 35; if (name == "STOP_EXECUTING_SVC_CHECKS") return 36; if (name == "START_ACCEPTING_PASSIVE_SVC_CHECKS") return 37; if (name == "STOP_ACCEPTING_PASSIVE_SVC_CHECKS") return 38; if (name == "ENABLE_PASSIVE_SVC_CHECKS") return 39; if (name == "DISABLE_PASSIVE_SVC_CHECKS") return 40; if (name == "ENABLE_EVENT_HANDLERS") return 41; if (name == "DISABLE_EVENT_HANDLERS") return 42; if (name == "ENABLE_HOST_EVENT_HANDLER") return 43; if (name == "DISABLE_HOST_EVENT_HANDLER") return 44; if (name == "ENABLE_SVC_EVENT_HANDLER") return 45; if (name == "DISABLE_SVC_EVENT_HANDLER") return 46; if (name == "ENABLE_HOST_CHECK") return 47; if (name == "DISABLE_HOST_CHECK") return 48; if (name == "START_OBSESSING_OVER_SVC_CHECKS") return 49; if (name == "STOP_OBSESSING_OVER_SVC_CHECKS") return 50; if (name == "REMOVE_HOST_ACKNOWLEDGEMENT") return 51; if (name == "REMOVE_SVC_ACKNOWLEDGEMENT") return 52; if (name == "SCHEDULE_FORCED_HOST_SVC_CHECKS") return 53; if (name == "SCHEDULE_FORCED_SVC_CHECK") return 54; if (name == "SCHEDULE_HOST_DOWNTIME") return 55; if (name == "SCHEDULE_SVC_DOWNTIME") return 56; if (name == "ENABLE_HOST_FLAP_DETECTION") return 57; if (name == "DISABLE_HOST_FLAP_DETECTION") return 58; if (name == "ENABLE_SVC_FLAP_DETECTION") return 59; if (name == "DISABLE_SVC_FLAP_DETECTION") return 60; if (name == "ENABLE_FLAP_DETECTION") return 61; if (name == "DISABLE_FLAP_DETECTION") return 62; if (name == "ENABLE_HOSTGROUP_SVC_NOTIFICATIONS") return 63; if (name == "DISABLE_HOSTGROUP_SVC_NOTIFICATIONS") return 64; if (name == "ENABLE_HOSTGROUP_HOST_NOTIFICATIONS") return 65; if (name == "DISABLE_HOSTGROUP_HOST_NOTIFICATIONS") return 66; if (name == "ENABLE_HOSTGROUP_SVC_CHECKS") return 67; if (name == "DISABLE_HOSTGROUP_SVC_CHECKS") return 68; if (name == "CANCEL_HOST_DOWNTIME") return 69; if (name == "CANCEL_SVC_DOWNTIME") return 70; if (name == "CANCEL_ACTIVE_HOST_DOWNTIME") return 71; if (name == "CANCEL_PENDING_HOST_DOWNTIME") return 72; if (name == "CANCEL_ACTIVE_SVC_DOWNTIME") return 73; if (name == "CANCEL_PENDING_SVC_DOWNTIME") return 74; if (name == "CANCEL_ACTIVE_HOST_SVC_DOWNTIME") return 75; if (name == "CANCEL_PENDING_HOST_SVC_DOWNTIME") return 76; if (name == "FLUSH_PENDING_COMMANDS") return 77; if (name == "DEL_HOST_DOWNTIME") return 78; if (name == "DEL_SVC_DOWNTIME") return 79; if (name == "ENABLE_FAILURE_PREDICTION") return 80; if (name == "DISABLE_FAILURE_PREDICTION") return 81; if (name == "ENABLE_PERFORMANCE_DATA") return 82; if (name == "DISABLE_PERFORMANCE_DATA") return 83; if (name == "SCHEDULE_HOSTGROUP_HOST_DOWNTIME") return 84; if (name == "SCHEDULE_HOSTGROUP_SVC_DOWNTIME") return 85; if (name == "SCHEDULE_HOST_SVC_DOWNTIME") return 86; if (name == "PROCESS_HOST_CHECK_RESULT") return 87; if (name == "START_EXECUTING_HOST_CHECKS") return 88; if (name == "STOP_EXECUTING_HOST_CHECKS") return 89; if (name == "START_ACCEPTING_PASSIVE_HOST_CHECKS") return 90; if (name == "STOP_ACCEPTING_PASSIVE_HOST_CHECKS") return 91; if (name == "ENABLE_PASSIVE_HOST_CHECKS") return 92; if (name == "DISABLE_PASSIVE_HOST_CHECKS") return 93; if (name == "START_OBSESSING_OVER_HOST_CHECKS") return 94; if (name == "STOP_OBSESSING_OVER_HOST_CHECKS") return 95; if (name == "SCHEDULE_HOST_CHECK") return 96; if (name == "SCHEDULE_FORCED_HOST_CHECK") return 98; if (name == "START_OBSESSING_OVER_SVC") return 99; if (name == "STOP_OBSESSING_OVER_SVC") return 100; if (name == "START_OBSESSING_OVER_HOST") return 101; if (name == "STOP_OBSESSING_OVER_HOST") return 102; if (name == "ENABLE_HOSTGROUP_HOST_CHECKS") return 103; if (name == "DISABLE_HOSTGROUP_HOST_CHECKS") return 104; if (name == "ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS") return 105; if (name == "DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS") return 106; if (name == "ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS") return 107; if (name == "DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS") return 108; if (name == "ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS") return 109; if (name == "DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS") return 110; if (name == "ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS") return 111; if (name == "DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS") return 112; if (name == "ENABLE_SERVICEGROUP_SVC_CHECKS") return 113; if (name == "DISABLE_SERVICEGROUP_SVC_CHECKS") return 114; if (name == "ENABLE_SERVICEGROUP_HOST_CHECKS") return 115; if (name == "DISABLE_SERVICEGROUP_HOST_CHECKS") return 116; if (name == "ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS") return 117; if (name == "DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS") return 118; if (name == "ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS") return 119; if (name == "DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS") return 120; if (name == "SCHEDULE_SERVICEGROUP_HOST_DOWNTIME") return 121; if (name == "SCHEDULE_SERVICEGROUP_SVC_DOWNTIME") return 122; if (name == "CHANGE_GLOBAL_HOST_EVENT_HANDLER") return 123; if (name == "CHANGE_GLOBAL_SVC_EVENT_HANDLER") return 124; if (name == "CHANGE_HOST_EVENT_HANDLER") return 125; if (name == "CHANGE_SVC_EVENT_HANDLER") return 126; if (name == "CHANGE_HOST_CHECK_COMMAND") return 127; if (name == "CHANGE_SVC_CHECK_COMMAND") return 128; if (name == "CHANGE_NORMAL_HOST_CHECK_INTERVAL") return 129; if (name == "CHANGE_NORMAL_SVC_CHECK_INTERVAL") return 130; if (name == "CHANGE_RETRY_SVC_CHECK_INTERVAL") return 131; if (name == "CHANGE_MAX_HOST_CHECK_ATTEMPTS") return 132; if (name == "CHANGE_MAX_SVC_CHECK_ATTEMPTS") return 133; if (name == "SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME") return 134; if (name == "ENABLE_HOST_AND_CHILD_NOTIFICATIONS") return 135; if (name == "DISABLE_HOST_AND_CHILD_NOTIFICATIONS") return 136; if (name == "SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME") return 137; if (name == "ENABLE_SERVICE_FRESHNESS_CHECKS") return 138; if (name == "DISABLE_SERVICE_FRESHNESS_CHECKS") return 139; if (name == "ENABLE_HOST_FRESHNESS_CHECKS") return 140; if (name == "DISABLE_HOST_FRESHNESS_CHECKS") return 141; if (name == "SET_HOST_NOTIFICATION_NUMBER") return 142; if (name == "SET_SVC_NOTIFICATION_NUMBER") return 143; if (name == "CHANGE_HOST_CHECK_TIMEPERIOD") return 144; if (name == "CHANGE_SVC_CHECK_TIMEPERIOD") return 145; if (name == "PROCESS_FILE") return 146; if (name == "CHANGE_CUSTOM_HOST_VAR") return 147; if (name == "CHANGE_CUSTOM_SVC_VAR") return 148; if (name == "CHANGE_CUSTOM_CONTACT_VAR") return 149; if (name == "ENABLE_CONTACT_HOST_NOTIFICATIONS") return 150; if (name == "DISABLE_CONTACT_HOST_NOTIFICATIONS") return 151; if (name == "ENABLE_CONTACT_SVC_NOTIFICATIONS") return 152; if (name == "DISABLE_CONTACT_SVC_NOTIFICATIONS") return 153; if (name == "ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS") return 154; if (name == "DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS") return 155; if (name == "ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS") return 156; if (name == "DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS") return 157; if (name == "CHANGE_RETRY_HOST_CHECK_INTERVAL") return 158; if (name == "SEND_CUSTOM_HOST_NOTIFICATION") return 159; if (name == "SEND_CUSTOM_SVC_NOTIFICATION") return 160; if (name == "CHANGE_HOST_NOTIFICATION_TIMEPERIOD") return 161; if (name == "CHANGE_SVC_NOTIFICATION_TIMEPERIOD") return 162; if (name == "CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD") return 163; if (name == "CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD") return 164; if (name == "CHANGE_HOST_MODATTR") return 165; if (name == "CHANGE_SVC_MODATTR") return 166; if (name == "CHANGE_CONTACT_MODATTR") return 167; if (name == "CHANGE_CONTACT_MODHATTR") return 168; if (name == "CHANGE_CONTACT_MODSATTR") return 169; if (name == "SYNC_STATE_INFORMATION") return 170; if (name == "DEL_DOWNTIME_BY_HOST_NAME") return 171; if (name == "DEL_DOWNTIME_BY_HOSTGROUP_NAME") return 172; if (name == "DEL_DOWNTIME_BY_START_TIME_COMMENT") return 173; if (name == "ACKNOWLEDGE_HOST_PROBLEM_EXPIRE") return 174; if (name == "ACKNOWLEDGE_SVC_PROBLEM_EXPIRE") return 175; if (name == "DISABLE_NOTIFICATIONS_EXPIRE_TIME") return 176; if (name == "CUSTOM_COMMAND") return 999; return 0; }
ogg1980/icinga2
lib/icinga/compatutility.cpp
C++
gpl-2.0
32,466
<?php /** * Shop System Plugins - Terms of Use * * The plugins offered are provided free of charge by Qenta Payment CEE GmbH * (abbreviated to Qenta CEE) and are explicitly not part of the Qenta CEE range of * products and services. * * They have been tested and approved for full functionality in the standard configuration * (status on delivery) of the corresponding shop system. They are under General Public * License Version 2 (GPLv2) and can be used, developed and passed on to third parties under * the same terms. * * However, Qenta CEE does not provide any guarantee or accept any liability for any errors * occurring when used in an enhanced, customized shop system configuration. * * Operation in an enhanced, customized configuration is at your own risk and requires a * comprehensive test phase by the user of the plugin. * * Customers use the plugins at their own risk. Qenta CEE does not guarantee their full * functionality neither does Qenta CEE assume liability for any disadvantages related to * the use of the plugins. Additionally, Qenta CEE does not guarantee the full functionality * for customized shop systems or installed plugins of other vendors of plugins within the same * shop system. * * Customers are responsible for testing the plugin's functionality before starting productive * operation. * * By installing the plugin into the shop system the customer agrees to these terms of use. * Please do not use the plugin if you do not agree to these terms of use! */ /** * Config class * * Handles configuration settings, basketcreation and addressinformation * * @since 1.3.0 */ class WC_Gateway_WCP_Config { /** * Payment gateway settings * * @since 1.3.0 * @access protected * @var array */ protected $_settings; /** * Test/Demo configurations * * @since 1.3.0 * @access protected * @var array */ protected $_presets = array( 'demo' => array( 'customer_id' => 'D200001', 'shop_id' => '', 'secret' => 'B8AKTPWBRMNBV455FG6M2DANE99WU2', 'backendpw' => 'jcv45z' ), 'test' => array( 'customer_id' => 'D200411', 'shop_id' => '', 'secret' => 'CHCSH7UGHVVX2P7EHDHSY4T2S4CGYK4QBE4M5YUUG2ND5BEZWNRZW5EJYVJQ', 'backendpw' => '2g4f9q2m' ), 'test3d' => array( 'customer_id' => 'D200411', 'shop_id' => '3D', 'secret' => 'DP4TMTPQQWFJW34647RM798E9A5X7E8ATP462Z4VGZK53YEJ3JWXS98B9P4F', 'backendpw' => '2g4f9q2m' ) ); /** * WC_Gateway_WCP_Config constructor. * * @since 1.3.0 * * @param $gateway_settings */ public function __construct( $gateway_settings ) { $this->_settings = $gateway_settings; } /** * Handles configuration modes and returns config array for FrontendClient * * @since 1.3.0 * * @return array * */ public function get_client_config() { $config_mode = $this->_settings['configuration']; if ( array_key_exists( $config_mode, $this->_presets ) ) { return Array( 'CUSTOMER_ID' => $this->_presets[ $config_mode ]['customer_id'], 'SHOP_ID' => $this->_presets[ $config_mode ]['shop_id'], 'SECRET' => $this->_presets[ $config_mode ]['secret'], 'LANGUAGE' => $this->get_language_code(), ); } else { return Array( 'CUSTOMER_ID' => trim( $this->_settings['customer_id'] ), 'SHOP_ID' => trim( $this->_settings['shop_id'] ), 'SECRET' => trim( $this->_settings['secret'] ), 'LANGUAGE' => $this->get_language_code(), ); } } /** * Getter for customer id * * @since 1.3.2 * * @return string */ public function get_customer_id() { $config_mode = $this->_settings['configuration']; if ( array_key_exists( $config_mode, $this->_presets ) ) { return $this->_presets[ $config_mode ]['customer_id']; } else { return trim( $this->_settings['customer_id'] ); } } /** * Extract language code from locale settings * * @since 1.3.0 * @return mixed */ public function get_language_code() { $locale = get_locale(); $parts = explode( '_', $locale ); return $parts[0]; } /** * Return configured secret * * @return string */ public function get_secret() { $config = $this->get_client_config(); return $config['SECRET']; } /** * Checks is ratepay enabled * * @since 1.3.8 * @param $payment_provider * @return boolean */ public function is_ratepay_enabled($payment_provider) { return $this->_settings[$payment_provider] == 'ratepay'; } }
wirecard/woocommerce-wcp
woocommerce-qenta-checkout-page/classes/class-woocommerce-wcp-config.php
PHP
gpl-2.0
4,522
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * Sales order view items block * * @author Magento Core Team <core@magentocommerce.com> */ namespace Magento\Shipping\Block; /** * @api * @since 100.0.2 */ class Items extends \Magento\Sales\Block\Items\AbstractItems { /** * Core registry * * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Registry $registry * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data = [] ) { $this->_coreRegistry = $registry; parent::__construct($context, $data); } /** * Retrieve current order model instance * * @return \Magento\Sales\Model\Order */ public function getOrder() { return $this->_coreRegistry->registry('current_order'); } /** * @param object $shipment * @return string */ public function getPrintShipmentUrl($shipment) { return $this->getUrl('*/*/printShipment', ['shipment_id' => $shipment->getId()]); } /** * @param object $order * @return string */ public function getPrintAllShipmentsUrl($order) { return $this->getUrl('*/*/printShipment', ['order_id' => $order->getId()]); } /** * Get html of shipment comments block * * @param \Magento\Sales\Model\Order\Shipment $shipment * @return string */ public function getCommentsHtml($shipment) { $html = ''; $comments = $this->getChildBlock('shipment_comments'); if ($comments) { $comments->setEntity($shipment)->setTitle(__('About Your Shipment')); $html = $comments->toHtml(); } return $html; } }
kunj1988/Magento2
app/code/Magento/Shipping/Block/Items.php
PHP
gpl-2.0
2,035
<?php /** * @file * Provides hook documentation for PGAPI module. */ function hook_pgapi_callback($transaction) { } function hook_pgapi_format_price($type, $price, $symbol) { } function hook_pgapi_transaction($status, $transaction) { } function hook_pgapi_transaction_all($status, $transaction) { } function hook_pgapi_gw($op, $a3 = NULL, $a4 = NULL) { } function hook_pgapi_transaction_status(&$status) { } function hook_pgapi_transaction_workflow(&$workflow) { }
usabilidoido/corais
sites/all/modules/pgapi/pgapi.api.php
PHP
gpl-2.0
489
class Ruby_highline < PACKMAN::Package url PACKMAN.gem_url('highline-1.7.2.gem') sha1 'd7114ed98c5651b928cc7195aded7b0000e09689' version '1.7.2' label :try_system_package_first def install PACKMAN.gem "install highline-#{version}.gem" end def remove PACKMAN.gem 'uninstall -x highline' end def installed? PACKMAN.is_gem_installed? 'highline', version end end
dongli/packman
packages/ruby_highline.rb
Ruby
gpl-2.0
395