diff --git a/examples/injectme.coffee b/examples/injectme.coffee index 15a79890ec..ae4927d572 100644 --- a/examples/injectme.coffee +++ b/examples/injectme.coffee @@ -13,7 +13,7 @@ if phantom? console.log "* Script will 'inject' itself in a page..." page.open "about:blank", (status) -> if status is "success" - if page.injectJs("injectme.js") + if page.injectJs("injectme.coffee") console.log "... done injecting itself!" else console.log "... fail! Check the $PWD?!" diff --git a/examples/netsniff.coffee b/examples/netsniff.coffee index 184a8ca3c7..215618183e 100644 --- a/examples/netsniff.coffee +++ b/examples/netsniff.coffee @@ -70,7 +70,7 @@ createHAR = (address, title, startTime, resources) -> id: address title: title pageTimings: {} - ] + ] entries: entries page = require('webpage').create() diff --git a/python/pyphantomjs/bootstrap.js b/python/pyphantomjs/bootstrap.js new file mode 100644 index 0000000000..5c7328e52d --- /dev/null +++ b/python/pyphantomjs/bootstrap.js @@ -0,0 +1,57 @@ +/*jslint sloppy: true, nomen: true */ +/*global window:true,phantom:true */ + +/* + This file is part of the PhantomJS project from Ofi Labs. + + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Ivan De Marino + Copyright (C) 2011 James Roe + Copyright (C) 2011 execjosh, http://execjosh.blogspot.com + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +function require(name) { + + var code, func, exports; + + if (name === 'webpage' || name === 'fs') { + code = phantom.loadModuleSource(name); + func = new Function("exports", "window", code); + exports = {}; + if (name === 'fs') { + exports = phantom.createFilesystem(); + } + func.call({}, exports, {}); + return exports; + } + + if (typeof exports === 'undefined') { + throw 'Unknown module ' + name + ' for require()'; + } +} + +// Legacy way to use WebPage +window.WebPage = require('webpage').create; diff --git a/python/pyphantomjs/config.py b/python/pyphantomjs/config.py index 8d688e9c58..62015db05b 100644 --- a/python/pyphantomjs/config.py +++ b/python/pyphantomjs/config.py @@ -20,13 +20,15 @@ import sys import codecs -from PyQt4.QtCore import QObject, QFile, qWarning +from PyQt4.QtCore import QObject, qWarning from PyQt4.QtWebKit import QWebPage +from utils import QPyFile + class Config(QObject): def __init__(self, parent, jsonFile): - QObject.__init__(self, parent) + super(Config, self).__init__(parent) with codecs.open(jsonFile, encoding='utf-8') as fd: json = fd.read() @@ -38,7 +40,8 @@ def __init__(self, parent, jsonFile): 'ignoreSslErrors': { 'mapping': 'ignore_ssl_errors', 'default': False }, 'loadImages': { 'mapping': 'load_images', 'default': True }, 'loadPlugins': { 'mapping': 'load_plugins', 'default': False }, - 'localAccessRemote': { 'mapping': 'local_access_remote', 'default': False }, + 'localToRemoteUrlAccessEnabled': { 'mapping': 'local_to_remote_url_access', 'default': False }, + 'maxDiskCacheSize': { 'mapping': 'max_disk_cache_size', 'default': -1 }, 'outputEncoding': { 'mapping': 'output_encoding', 'default': 'System' }, 'proxy': { 'mapping': 'proxy', 'default': None }, 'scriptEncoding': { 'mapping': 'script_encoding', 'default': 'utf-8' }, @@ -54,13 +57,8 @@ def __init__(self, parent, jsonFile): qWarning('Config file MUST be in JSON format!') return - file_ = QFile(':/configurator.js') - if not file_.open(QFile.ReadOnly): - sys.exit('Unable to load JSON configurator!') - configurator = str(file_.readAll()) - file_.close() - if not configurator: - sys.exit('Unable to set-up JSON configurator!') + with QPyFile(':/configurator.js') as f: + configurator = f.readAll().data() webPage = QWebPage(self) diff --git a/python/pyphantomjs/cookiejar.py b/python/pyphantomjs/cookiejar.py index 39e33b158e..449fba19db 100644 --- a/python/pyphantomjs/cookiejar.py +++ b/python/pyphantomjs/cookiejar.py @@ -23,7 +23,7 @@ class CookieJar(QNetworkCookieJar): def __init__(self, parent, cookieFile): - QNetworkCookieJar.__init__(self, parent) + super(CookieJar, self).__init__(parent) self.m_cookieFile = cookieFile diff --git a/python/pyphantomjs/csconverter.py b/python/pyphantomjs/csconverter.py index 8e85ff1c2e..80184ea206 100644 --- a/python/pyphantomjs/csconverter.py +++ b/python/pyphantomjs/csconverter.py @@ -19,10 +19,12 @@ import sys -from PyQt4.QtCore import QObject, QFile +from PyQt4.QtCore import QObject from PyQt4.QtGui import QApplication from PyQt4.QtWebKit import QWebPage +from utils import QPyFile + class CSConverter(QObject): _instance = None @@ -32,14 +34,12 @@ def __new__(cls, *args, **kwargs): return cls._instance def __init__(self): - QObject.__init__(self, QApplication.instance()) + super(CSConverter, self).__init__(QApplication.instance()) + self.m_webPage = QWebPage(self) - converter = QFile(':/resources/coffee-script.js') - if not converter.open(QFile.ReadOnly): - sys.exit('CoffeeScript compiler is not available!') - script = str(converter.readAll()) - converter.close() + with QPyFile(':/resources/coffee-script.js') as f: + script = f.readAll().data() self.m_webPage.mainFrame().evaluateJavaScript(script) self.m_webPage.mainFrame().addToJavaScriptWindowObject('converter', self) diff --git a/python/pyphantomjs/filesystem.py b/python/pyphantomjs/filesystem.py index 376ac458e8..0faa1ef5c5 100644 --- a/python/pyphantomjs/filesystem.py +++ b/python/pyphantomjs/filesystem.py @@ -35,7 +35,7 @@ class File(QObject): def __init__(self, parent, openfile): - QObject.__init__(self, parent) + super(File, self).__init__(parent) self.m_file = openfile @@ -111,8 +111,14 @@ def writeLine(self, data): class FileSystem(QObject): + _instance = None + def __new__(cls, *args, **kwargs): + if cls._instance is None: + cls._instance = super(FileSystem, cls).__new__(cls, *args, **kwargs) + return cls._instance + def __init__(self, parent): - QObject.__init__(self, parent) + super(FileSystem, self).__init__(parent) do_action('FileSystemInit') diff --git a/python/pyphantomjs/modules/fs.js b/python/pyphantomjs/modules/fs.js new file mode 100644 index 0000000000..8aa0c49693 --- /dev/null +++ b/python/pyphantomjs/modules/fs.js @@ -0,0 +1,162 @@ +/*jslint sloppy: true, nomen: true */ +/*global exports:true */ + +/* + This file is part of the PhantomJS project from Ofi Labs. + + Copyright (C) 2011 Ivan De Marino + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// JavaScript "shim" to throw exceptions in case a critical operation fails. + +/** Open and return a "file" object. + * It will throw exception if it fails. + * + * @param path Path of the file to open + * @param mode Open Mode. A string made of 'r', 'w', 'a/+' characters. + * @return "file" object + */ +exports.open = function (path, mode) { + var file = exports._open(path, mode); + if (file) { + return file; + } + throw "Unable to open file '" + path + "'"; +}; + +/** Open, read and return content of a file. + * It will throw an exception if it fails. + * + * @param path Path of the file to read from + * @return file content + */ +exports.read = function (path) { + var f = exports.open(path, 'r'), + content = f.read(); + + f.close(); + return content; +}; + +/** Open and write content to a file + * It will throw an exception if it fails. + * + * @param path Path of the file to read from + * @param content Content to write to the file + * @param mode Open Mode. A string made of 'w' or 'a / +' characters. + */ +exports.write = function (path, content, mode) { + var f = exports.open(path, mode); + + f.write(content); + f.close(); +}; + +/** Return the size of a file, in bytes. + * It will throw an exception if it fails. + * + * @param path Path of the file to read the size of + * @return File size in bytes + */ +exports.size = function (path) { + var size = exports._size(path); + if (size !== -1) { + return size; + } + throw "Unable to read file '" + path + "' size"; +}; + +/** Copy a file. + * It will throw an exception if it fails. + * + * @param source Path of the source file + * @param destination Path of the destination file + */ +exports.copy = function (source, destination) { + if (!exports._copy(source, destination)) { + throw "Unable to copy file '" + source + "' at '" + destination + "'"; + } +}; + +/** Copy a directory tree. + * It will throw an exception if it fails. + * + * @param source Path of the source directory tree + * @param destination Path of the destination directory tree + */ +exports.copyTree = function (source, destination) { + if (!exports._copyTree(source, destination)) { + throw "Unable to copy directory tree '" + source + "' at '" + destination + "'"; + } +}; + +/** Move a file. + * It will throw an exception if it fails. + * + * @param source Path of the source file + * @param destination Path of the destination file + */ +exports.move = function (source, destination) { + exports.copy(source, destination); + exports.remove(source); +}; + +/** Removes a file. + * It will throw an exception if it fails. + * + * @param path Path of the file to remove + */ +exports.remove = function (path) { + if (!exports._remove(path)) { + throw "Unable to remove file '" + path + "'"; + } +}; + +/** Removes a directory. + * It will throw an exception if it fails. + * + * @param path Path of the directory to remove + */ +exports.removeDirectory = function (path) { + if (!exports._removeDirectory(path)) { + throw "Unable to remove directory '" + path + "'"; + } +}; + +/** Removes a directory tree. + * It will throw an exception if it fails. + * + * @param path Path of the directory tree to remove + */ +exports.removeTree = function (path) { + if (!exports._removeTree(path)) { + throw "Unable to remove directory tree '" + path + "'"; + } +}; + +exports.touch = function (path) { + exports.write(path, "", 'a'); +}; diff --git a/python/pyphantomjs/modules/webpage.js b/python/pyphantomjs/modules/webpage.js new file mode 100644 index 0000000000..07c3786bf6 --- /dev/null +++ b/python/pyphantomjs/modules/webpage.js @@ -0,0 +1,180 @@ +/*jslint sloppy: true, nomen: true */ +/*global exports:true,phantom:true */ + +/* + This file is part of the PhantomJS project from Ofi Labs. + + Copyright (C) 2011 Ariya Hidayat + Copyright (C) 2011 Ivan De Marino + Copyright (C) 2011 James Roe + Copyright (C) 2011 execjosh, http://execjosh.blogspot.com + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +exports.create = function (opts) { + var page = phantom.createWebPage(), + handlers = {}; + + function checkType(o, type) { + return typeof o === type; + } + + function isObject(o) { + return checkType(o, 'object'); + } + + function isUndefined(o) { + return checkType(o, 'undefined'); + } + + function isUndefinedOrNull(o) { + return isUndefined(o) || null === o; + } + + function copyInto(target, source) { + if (target === source || isUndefinedOrNull(source)) { + return target; + } + + target = target || {}; + + // Copy into objects only + if (isObject(target)) { + // Make sure source exists + source = source || {}; + + if (isObject(source)) { + var i, newTarget, newSource; + for (i in source) { + if (source.hasOwnProperty(i)) { + newTarget = target[i]; + newSource = source[i]; + + if (newTarget && isObject(newSource)) { + // Deep copy + newTarget = copyInto(target[i], newSource); + } else { + newTarget = newSource; + } + + if (!isUndefined(newTarget)) { + target[i] = newTarget; + } + } + } + } else { + target = source; + } + } + + return target; + } + + function defineSetter(handlerName, signalName) { + page.__defineSetter__(handlerName, function (f) { + if (handlers && typeof handlers[signalName] === 'function') { + try { + this[signalName].disconnect(handlers[signalName]); + } catch (e) {} + } + handlers[signalName] = f; + this[signalName].connect(handlers[signalName]); + }); + } + + // deep copy + page.settings = JSON.parse(JSON.stringify(phantom.defaultPageSettings)); + + defineSetter("onInitialized", "initialized"); + + defineSetter("onLoadStarted", "loadStarted"); + + defineSetter("onLoadFinished", "loadFinished"); + + defineSetter("onResourceRequested", "resourceRequested"); + + defineSetter("onResourceReceived", "resourceReceived"); + + defineSetter("onAlert", "javaScriptAlertSent"); + + defineSetter("onConsoleMessage", "javaScriptConsoleMessageSent"); + + page.open = function (url, arg1, arg2, arg3, arg4) { + if (arguments.length === 1) { + this.openUrl(url, 'get', this.settings); + return; + } + if (arguments.length === 2 && typeof arg1 === 'function') { + this.onLoadFinished = arg1; + this.openUrl(url, 'get', this.settings); + return; + } else if (arguments.length === 2) { + this.openUrl(url, arg1, this.settings); + return; + } else if (arguments.length === 3 && typeof arg2 === 'function') { + this.onLoadFinished = arg2; + this.openUrl(url, arg1, this.settings); + return; + } else if (arguments.length === 3) { + this.openUrl(url, { + operation: arg1, + data: arg2 + }, this.settings); + return; + } else if (arguments.length === 4) { + this.onLoadFinished = arg3; + this.openUrl(url, { + operation: arg1, + data: arg2 + }, this.settings); + return; + } + throw "Wrong use of WebPage#open"; + }; + + page.includeJs = function (scriptUrl, onScriptLoaded) { + // Register temporary signal handler for 'alert()' + this.javaScriptAlertSent.connect(function (msgFromAlert) { + if (msgFromAlert === scriptUrl) { + // Resource loaded, time to fire the callback + onScriptLoaded(scriptUrl); + // And disconnect the signal handler + try { + this.javaScriptAlertSent.disconnect(arguments.callee); + } catch (e) {} + } + }); + + // Append the script tag to the body + this._appendScriptElement(scriptUrl); + }; + + // Copy options into page + if (opts) { + page = copyInto(page, opts); + } + + return page; +}; diff --git a/python/pyphantomjs/networkaccessmanager.py b/python/pyphantomjs/networkaccessmanager.py index 7b67552a65..043bbd7e9b 100644 --- a/python/pyphantomjs/networkaccessmanager.py +++ b/python/pyphantomjs/networkaccessmanager.py @@ -31,8 +31,8 @@ class NetworkAccessManager(QNetworkAccessManager): resourceReceived = pyqtSignal('QVariantMap') resourceRequested = pyqtSignal('QVariantMap') - def __init__(self, parent, auth, cookieFile, diskCacheEnabled, ignoreSslErrors): - QNetworkAccessManager.__init__(self, parent) + def __init__(self, parent, auth, cookieFile, diskCacheEnabled, ignoreSslErrors, maxDiskCacheSize): + super(NetworkAccessManager, self).__init__(parent) self.m_ignoreSslErrors = ignoreSslErrors self.m_idCounter = 0 @@ -52,6 +52,8 @@ def __init__(self, parent, auth, cookieFile, diskCacheEnabled, ignoreSslErrors): if diskCacheEnabled: m_networkDiskCache = QNetworkDiskCache() m_networkDiskCache.setCacheDirectory(QDesktopServices.storageLocation(QDesktopServices.CacheLocation)) + if maxDiskCacheSize > 0: + m_networkDiskCache.setMaximumCacheSize(maxDiskCacheSize * 1024) self.setCache(m_networkDiskCache) do_action('NetworkAccessManagerInit') @@ -67,8 +69,8 @@ def createRequest(self, op, req, outgoingData): headers = [] for header in req.rawHeaderList(): header = { - 'name': str(header), - 'value': str(req.rawHeader(header)) + 'name': header.data(), + 'value': req.rawHeader(header).data() } headers.append(header) @@ -94,8 +96,8 @@ def handleFinished(self, reply): headers = [] for header in reply.rawHeaderList(): header = { - 'name': str(header), - 'value': str(reply.rawHeader(header)) + 'name': header.data(), + 'value': reply.rawHeader(header).data() } headers.append(header) @@ -132,8 +134,8 @@ def handleStarted(self): headers = [] for header in reply.rawHeaderList(): header = { - 'name': str(header), - 'value': str(reply.rawHeader(header)) + 'name': header.data(), + 'value': reply.rawHeader(header).data() } headers.append(header) diff --git a/python/pyphantomjs/networkreplyproxy.py b/python/pyphantomjs/networkreplyproxy.py index 088d211015..2ef3fd7e9c 100644 --- a/python/pyphantomjs/networkreplyproxy.py +++ b/python/pyphantomjs/networkreplyproxy.py @@ -22,7 +22,7 @@ class NetworkReplyProxy(QNetworkReply): def __init__(self, parent, reply): - QNetworkReply.__init__(self, parent) + super(NetworkReplyProxy, self).__init__(parent) self.m_reply = reply self.m_buffer = self.m_data = '' @@ -98,7 +98,7 @@ def isSequential(self): def readData(self, maxlen): size = min(maxlen, len(self.m_buffer)) data, self.m_buffer = self.m_buffer[:size], self.m_buffer[size:] - return str(data) + return data.data() def readInternal(self): data = self.m_reply.readAll() diff --git a/python/pyphantomjs/phantom.py b/python/pyphantomjs/phantom.py index 49ed99ea1b..9e12104ba7 100644 --- a/python/pyphantomjs/phantom.py +++ b/python/pyphantomjs/phantom.py @@ -21,13 +21,12 @@ import sys import sip -from PyQt4.QtCore import (pyqtProperty, pyqtSlot, QObject, - QFile) +from PyQt4.QtCore import pyqtProperty, pyqtSlot, QObject from PyQt4.QtGui import QApplication from PyQt4.QtNetwork import QNetworkProxy, QNetworkProxyFactory from __init__ import __version_info__ -from utils import injectJsInFrame +from utils import injectJsInFrame, QPyFile from plugincontroller import do_action from webpage import WebPage from networkaccessmanager import NetworkAccessManager @@ -37,7 +36,7 @@ class Phantom(QObject): def __init__(self, parent, args): - QObject.__init__(self, parent) + super(Phantom, self).__init__(parent) # variable declarations self.m_defaultPageSettings = {} @@ -52,8 +51,6 @@ def __init__(self, parent, args): self.m_scriptEncoding = Encode(args.script_encoding, 'utf-8') self.m_outputEncoding = Encode(args.output_encoding, sys.stdout.encoding_sys) - self.m_filesystem = FileSystem(self) - self.m_pages.append(self.m_page) do_action('PhantomInitPre') @@ -65,7 +62,7 @@ def __init__(self, parent, args): QNetworkProxy.setApplicationProxy(proxy) # Provide WebPage with a non-standard Network Access Manager - self.m_netAccessMan = NetworkAccessManager(self, args.auth, args.cookies, args.disk_cache, args.ignore_ssl_errors) + self.m_netAccessMan = NetworkAccessManager(self, args.auth, args.cookies, args.disk_cache, args.ignore_ssl_errors, args.max_disk_cache_size) self.m_page.setNetworkAccessManager(self.m_netAccessMan) self.m_page.javaScriptConsoleMessageSent.connect(self.printConsoleMessage) @@ -75,28 +72,17 @@ def __init__(self, parent, args): self.m_defaultPageSettings['javascriptEnabled'] = True self.m_defaultPageSettings['XSSAuditingEnabled'] = False self.m_defaultPageSettings['userAgent'] = self.m_page.userAgent() - self.m_defaultPageSettings['localAccessRemote'] = args.local_access_remote + self.m_defaultPageSettings['localToRemoteUrlAccessEnabled'] = args.local_to_remote_url_access self.m_page.applySettings(self.m_defaultPageSettings) self.libraryPath = os.path.dirname(os.path.abspath(self.m_scriptFile)) # inject our properties and slots into javascript self.m_page.mainFrame().addToJavaScriptWindowObject('phantom', self) - self.m_page.mainFrame().addToJavaScriptWindowObject('fs', self.m_filesystem) - - jsShims = ( - ':/filesystem-shim.js', - ':/webpage-shim.js' - ) - for shim in jsShims: - f = QFile(shim) - if not f.open(QFile.ReadOnly): - sys.exit("Failed to load shim '%s'" % shim) - - f = str(f.readAll()) - if not f: - sys.exit("Failed to load shim '%s'" % shim) - self.m_page.mainFrame().evaluateJavaScript(f) + + with QPyFile(':/bootstrap.js') as f: + bootstrap = f.readAll().data() + self.m_page.mainFrame().evaluateJavaScript(bootstrap) do_action('PhantomInitPost') @@ -120,6 +106,10 @@ def returnValue(self): def args(self): return self.m_args + @pyqtSlot(result=FileSystem) + def createFilesystem(self): + return FileSystem(self) + @pyqtSlot(result=WebPage) def createWebPage(self): page = WebPage(self) @@ -153,6 +143,15 @@ def exit(self, code=0): def injectJs(self, filePath): return injectJsInFrame(filePath, self.m_scriptEncoding.encoding, self.libraryPath, self.m_page.mainFrame()) + @pyqtSlot(str, result=str) + def loadModuleSource(self, name): + moduleSourceFilePath = ':/modules/%s.js' % name + + with QPyFile(moduleSourceFilePath) as f: + moduleSource = f.readAll().data() + + return moduleSource + @pyqtProperty(str) def libraryPath(self): return self.m_page.libraryPath diff --git a/python/pyphantomjs/pyphantomjs.py b/python/pyphantomjs/pyphantomjs.py index 287cc02ddf..85c2eafbe3 100644 --- a/python/pyphantomjs/pyphantomjs.py +++ b/python/pyphantomjs/pyphantomjs.py @@ -63,7 +63,8 @@ def parseArgs(app, args): args.ignore_ssl_errors = False if args.ignore_ssl_errors == 'no' else True args.load_images = True if args.load_images == 'yes' else False args.load_plugins = False if args.load_plugins == 'no' else True - args.local_access_remote = False if args.local_access_remote == 'no' else True + args.local_to_remote_url_access = False if args.local_to_remote_url_access == 'no' else True + args.max_disk_cache_size = int(args.max_disk_cache_size) # register an alternative Message Handler messageHandler = MessageHandler(args.verbose) diff --git a/python/pyphantomjs/resources.py b/python/pyphantomjs/resources.py index b84bedca56..5fc15ed85c 100644 --- a/python/pyphantomjs/resources.py +++ b/python/pyphantomjs/resources.py @@ -2,7 +2,7 @@ # Resource object code # -# Created: Sun Sep 4 22:07:57 2011 +# Created: Tue Sep 13 14:48:39 2011 # by: The Resource Compiler for PyQt (Qt v4.7.2) # # WARNING! All changes made in this file will be lost! @@ -10,6 +10,160 @@ from PyQt4 import QtCore qt_resource_data = "\ +\x00\x00\x09\x75\ +\x2f\ +\x2a\x6a\x73\x6c\x69\x6e\x74\x20\x73\x6c\x6f\x70\x70\x79\x3a\x20\ +\x74\x72\x75\x65\x2c\x20\x6e\x6f\x6d\x65\x6e\x3a\x20\x74\x72\x75\ +\x65\x20\x2a\x2f\x0a\x2f\x2a\x67\x6c\x6f\x62\x61\x6c\x20\x77\x69\ +\x6e\x64\x6f\x77\x3a\x74\x72\x75\x65\x2c\x70\x68\x61\x6e\x74\x6f\ +\x6d\x3a\x74\x72\x75\x65\x20\x2a\x2f\x0a\x0a\x2f\x2a\x0a\x20\x20\ +\x54\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x69\x73\x20\x70\x61\x72\ +\x74\x20\x6f\x66\x20\x74\x68\x65\x20\x50\x68\x61\x6e\x74\x6f\x6d\ +\x4a\x53\x20\x70\x72\x6f\x6a\x65\x63\x74\x20\x66\x72\x6f\x6d\x20\ +\x4f\x66\x69\x20\x4c\x61\x62\x73\x2e\x0a\x0a\x20\x20\x43\x6f\x70\ +\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\ +\x41\x72\x69\x79\x61\x20\x48\x69\x64\x61\x79\x61\x74\x20\x3c\x61\ +\x72\x69\x79\x61\x2e\x68\x69\x64\x61\x79\x61\x74\x40\x67\x6d\x61\ +\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\ +\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\x49\x76\x61\ +\x6e\x20\x44\x65\x20\x4d\x61\x72\x69\x6e\x6f\x20\x3c\x69\x76\x61\ +\x6e\x2e\x64\x65\x2e\x6d\x61\x72\x69\x6e\x6f\x40\x67\x6d\x61\x69\ +\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\x67\ +\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\x4a\x61\x6d\x65\ +\x73\x20\x52\x6f\x65\x20\x3c\x72\x6f\x65\x6a\x61\x6d\x65\x73\x31\ +\x32\x40\x68\x6f\x74\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\ +\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\ +\x30\x31\x31\x20\x65\x78\x65\x63\x6a\x6f\x73\x68\x2c\x20\x68\x74\ +\x74\x70\x3a\x2f\x2f\x65\x78\x65\x63\x6a\x6f\x73\x68\x2e\x62\x6c\ +\x6f\x67\x73\x70\x6f\x74\x2e\x63\x6f\x6d\x0a\x0a\x20\x20\x52\x65\ +\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x20\x61\x6e\x64\ +\x20\x75\x73\x65\x20\x69\x6e\x20\x73\x6f\x75\x72\x63\x65\x20\x61\ +\x6e\x64\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\x6d\x73\x2c\ +\x20\x77\x69\x74\x68\x20\x6f\x72\x20\x77\x69\x74\x68\x6f\x75\x74\ +\x0a\x20\x20\x6d\x6f\x64\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x2c\ +\x20\x61\x72\x65\x20\x70\x65\x72\x6d\x69\x74\x74\x65\x64\x20\x70\ +\x72\x6f\x76\x69\x64\x65\x64\x20\x74\x68\x61\x74\x20\x74\x68\x65\ +\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x63\x6f\x6e\x64\x69\ +\x74\x69\x6f\x6e\x73\x20\x61\x72\x65\x20\x6d\x65\x74\x3a\x0a\x0a\ +\x20\x20\x20\x20\x2a\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\ +\x74\x69\x6f\x6e\x73\x20\x6f\x66\x20\x73\x6f\x75\x72\x63\x65\x20\ +\x63\x6f\x64\x65\x20\x6d\x75\x73\x74\x20\x72\x65\x74\x61\x69\x6e\ +\x20\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\x70\x79\x72\ +\x69\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\x74\x69\x63\ +\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\x6f\x66\x20\ +\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\x64\x20\x74\ +\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x64\x69\x73\ +\x63\x6c\x61\x69\x6d\x65\x72\x2e\x0a\x20\x20\x20\x20\x2a\x20\x52\ +\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x73\x20\x69\ +\x6e\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\x6d\x20\x6d\x75\ +\x73\x74\x20\x72\x65\x70\x72\x6f\x64\x75\x63\x65\x20\x74\x68\x65\ +\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\x70\x79\x72\x69\x67\x68\x74\ +\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\x74\x69\x63\x65\x2c\x20\x74\ +\x68\x69\x73\x20\x6c\x69\x73\x74\x20\x6f\x66\x20\x63\x6f\x6e\x64\ +\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\x64\x20\x74\x68\x65\x20\x66\ +\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x64\x69\x73\x63\x6c\x61\x69\ +\x6d\x65\x72\x20\x69\x6e\x20\x74\x68\x65\x0a\x20\x20\x20\x20\x20\ +\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x61\x74\x69\x6f\x6e\x20\x61\ +\x6e\x64\x2f\x6f\x72\x20\x6f\x74\x68\x65\x72\x20\x6d\x61\x74\x65\ +\x72\x69\x61\x6c\x73\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\x77\ +\x69\x74\x68\x20\x74\x68\x65\x20\x64\x69\x73\x74\x72\x69\x62\x75\ +\x74\x69\x6f\x6e\x2e\x0a\x20\x20\x20\x20\x2a\x20\x4e\x65\x69\x74\ +\x68\x65\x72\x20\x74\x68\x65\x20\x6e\x61\x6d\x65\x20\x6f\x66\x20\ +\x74\x68\x65\x20\x3c\x6f\x72\x67\x61\x6e\x69\x7a\x61\x74\x69\x6f\ +\x6e\x3e\x20\x6e\x6f\x72\x20\x74\x68\x65\x0a\x20\x20\x20\x20\x20\ +\x20\x6e\x61\x6d\x65\x73\x20\x6f\x66\x20\x69\x74\x73\x20\x63\x6f\ +\x6e\x74\x72\x69\x62\x75\x74\x6f\x72\x73\x20\x6d\x61\x79\x20\x62\ +\x65\x20\x75\x73\x65\x64\x20\x74\x6f\x20\x65\x6e\x64\x6f\x72\x73\ +\x65\x20\x6f\x72\x20\x70\x72\x6f\x6d\x6f\x74\x65\x20\x70\x72\x6f\ +\x64\x75\x63\x74\x73\x0a\x20\x20\x20\x20\x20\x20\x64\x65\x72\x69\ +\x76\x65\x64\x20\x66\x72\x6f\x6d\x20\x74\x68\x69\x73\x20\x73\x6f\ +\x66\x74\x77\x61\x72\x65\x20\x77\x69\x74\x68\x6f\x75\x74\x20\x73\ +\x70\x65\x63\x69\x66\x69\x63\x20\x70\x72\x69\x6f\x72\x20\x77\x72\ +\x69\x74\x74\x65\x6e\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\x6e\ +\x2e\x0a\x0a\x20\x20\x54\x48\x49\x53\x20\x53\x4f\x46\x54\x57\x41\ +\x52\x45\x20\x49\x53\x20\x50\x52\x4f\x56\x49\x44\x45\x44\x20\x42\ +\x59\x20\x54\x48\x45\x20\x43\x4f\x50\x59\x52\x49\x47\x48\x54\x20\ +\x48\x4f\x4c\x44\x45\x52\x53\x20\x41\x4e\x44\x20\x43\x4f\x4e\x54\ +\x52\x49\x42\x55\x54\x4f\x52\x53\x20\x22\x41\x53\x20\x49\x53\x22\ +\x0a\x20\x20\x41\x4e\x44\x20\x41\x4e\x59\x20\x45\x58\x50\x52\x45\ +\x53\x53\x20\x4f\x52\x20\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\x41\ +\x52\x52\x41\x4e\x54\x49\x45\x53\x2c\x20\x49\x4e\x43\x4c\x55\x44\ +\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\x4d\ +\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\x54\x48\x45\x0a\x20\x20\x49\ +\x4d\x50\x4c\x49\x45\x44\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\ +\x53\x20\x4f\x46\x20\x4d\x45\x52\x43\x48\x41\x4e\x54\x41\x42\x49\ +\x4c\x49\x54\x59\x20\x41\x4e\x44\x20\x46\x49\x54\x4e\x45\x53\x53\ +\x20\x46\x4f\x52\x20\x41\x20\x50\x41\x52\x54\x49\x43\x55\x4c\x41\ +\x52\x20\x50\x55\x52\x50\x4f\x53\x45\x0a\x20\x20\x41\x52\x45\x20\ +\x44\x49\x53\x43\x4c\x41\x49\x4d\x45\x44\x2e\x20\x49\x4e\x20\x4e\ +\x4f\x20\x45\x56\x45\x4e\x54\x20\x53\x48\x41\x4c\x4c\x20\x3c\x43\ +\x4f\x50\x59\x52\x49\x47\x48\x54\x20\x48\x4f\x4c\x44\x45\x52\x3e\ +\x20\x42\x45\x20\x4c\x49\x41\x42\x4c\x45\x20\x46\x4f\x52\x20\x41\ +\x4e\x59\x0a\x20\x20\x44\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\x44\ +\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\x43\x49\x44\x45\x4e\x54\x41\ +\x4c\x2c\x20\x53\x50\x45\x43\x49\x41\x4c\x2c\x20\x45\x58\x45\x4d\ +\x50\x4c\x41\x52\x59\x2c\x20\x4f\x52\x20\x43\x4f\x4e\x53\x45\x51\ +\x55\x45\x4e\x54\x49\x41\x4c\x20\x44\x41\x4d\x41\x47\x45\x53\x0a\ +\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x2c\x20\x42\x55\ +\x54\x20\x4e\x4f\x54\x20\x4c\x49\x4d\x49\x54\x45\x44\x20\x54\x4f\ +\x2c\x20\x50\x52\x4f\x43\x55\x52\x45\x4d\x45\x4e\x54\x20\x4f\x46\ +\x20\x53\x55\x42\x53\x54\x49\x54\x55\x54\x45\x20\x47\x4f\x4f\x44\ +\x53\x20\x4f\x52\x20\x53\x45\x52\x56\x49\x43\x45\x53\x3b\x0a\x20\ +\x20\x4c\x4f\x53\x53\x20\x4f\x46\x20\x55\x53\x45\x2c\x20\x44\x41\ +\x54\x41\x2c\x20\x4f\x52\x20\x50\x52\x4f\x46\x49\x54\x53\x3b\x20\ +\x4f\x52\x20\x42\x55\x53\x49\x4e\x45\x53\x53\x20\x49\x4e\x54\x45\ +\x52\x52\x55\x50\x54\x49\x4f\x4e\x29\x20\x48\x4f\x57\x45\x56\x45\ +\x52\x20\x43\x41\x55\x53\x45\x44\x20\x41\x4e\x44\x0a\x20\x20\x4f\ +\x4e\x20\x41\x4e\x59\x20\x54\x48\x45\x4f\x52\x59\x20\x4f\x46\x20\ +\x4c\x49\x41\x42\x49\x4c\x49\x54\x59\x2c\x20\x57\x48\x45\x54\x48\ +\x45\x52\x20\x49\x4e\x20\x43\x4f\x4e\x54\x52\x41\x43\x54\x2c\x20\ +\x53\x54\x52\x49\x43\x54\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\x59\ +\x2c\x20\x4f\x52\x20\x54\x4f\x52\x54\x0a\x20\x20\x28\x49\x4e\x43\ +\x4c\x55\x44\x49\x4e\x47\x20\x4e\x45\x47\x4c\x49\x47\x45\x4e\x43\ +\x45\x20\x4f\x52\x20\x4f\x54\x48\x45\x52\x57\x49\x53\x45\x29\x20\ +\x41\x52\x49\x53\x49\x4e\x47\x20\x49\x4e\x20\x41\x4e\x59\x20\x57\ +\x41\x59\x20\x4f\x55\x54\x20\x4f\x46\x20\x54\x48\x45\x20\x55\x53\ +\x45\x20\x4f\x46\x0a\x20\x20\x54\x48\x49\x53\x20\x53\x4f\x46\x54\ +\x57\x41\x52\x45\x2c\x20\x45\x56\x45\x4e\x20\x49\x46\x20\x41\x44\ +\x56\x49\x53\x45\x44\x20\x4f\x46\x20\x54\x48\x45\x20\x50\x4f\x53\ +\x53\x49\x42\x49\x4c\x49\x54\x59\x20\x4f\x46\x20\x53\x55\x43\x48\ +\x20\x44\x41\x4d\x41\x47\x45\x2e\x0a\x2a\x2f\x0a\x0a\x66\x75\x6e\ +\x63\x74\x69\x6f\x6e\x20\x72\x65\x71\x75\x69\x72\x65\x28\x6e\x61\ +\x6d\x65\x29\x20\x7b\x0a\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x63\ +\x6f\x64\x65\x2c\x20\x66\x75\x6e\x63\x2c\x20\x65\x78\x70\x6f\x72\ +\x74\x73\x3b\x0a\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x6e\x61\x6d\ +\x65\x20\x3d\x3d\x3d\x20\x27\x77\x65\x62\x70\x61\x67\x65\x27\x20\ +\x7c\x7c\x20\x6e\x61\x6d\x65\x20\x3d\x3d\x3d\x20\x27\x66\x73\x27\ +\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x63\x6f\x64\x65\ +\x20\x3d\x20\x70\x68\x61\x6e\x74\x6f\x6d\x2e\x6c\x6f\x61\x64\x4d\ +\x6f\x64\x75\x6c\x65\x53\x6f\x75\x72\x63\x65\x28\x6e\x61\x6d\x65\ +\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x66\x75\x6e\x63\x20\ +\x3d\x20\x6e\x65\x77\x20\x46\x75\x6e\x63\x74\x69\x6f\x6e\x28\x22\ +\x65\x78\x70\x6f\x72\x74\x73\x22\x2c\x20\x22\x77\x69\x6e\x64\x6f\ +\x77\x22\x2c\x20\x63\x6f\x64\x65\x29\x3b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x65\x78\x70\x6f\x72\x74\x73\x20\x3d\x20\x7b\x7d\x3b\ +\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x6e\x61\x6d\ +\x65\x20\x3d\x3d\x3d\x20\x27\x66\x73\x27\x29\x20\x7b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x65\x78\x70\x6f\x72\x74\ +\x73\x20\x3d\x20\x70\x68\x61\x6e\x74\x6f\x6d\x2e\x63\x72\x65\x61\ +\x74\x65\x46\x69\x6c\x65\x73\x79\x73\x74\x65\x6d\x28\x29\x3b\x0a\ +\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x66\x75\x6e\x63\x2e\x63\x61\x6c\x6c\x28\x7b\x7d\x2c\x20\ +\x65\x78\x70\x6f\x72\x74\x73\x2c\x20\x7b\x7d\x29\x3b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x65\x78\x70\ +\x6f\x72\x74\x73\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\ +\x20\x69\x66\x20\x28\x74\x79\x70\x65\x6f\x66\x20\x65\x78\x70\x6f\ +\x72\x74\x73\x20\x3d\x3d\x3d\x20\x27\x75\x6e\x64\x65\x66\x69\x6e\ +\x65\x64\x27\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x74\ +\x68\x72\x6f\x77\x20\x27\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x6d\x6f\ +\x64\x75\x6c\x65\x20\x27\x20\x2b\x20\x6e\x61\x6d\x65\x20\x2b\x20\ +\x27\x20\x66\x6f\x72\x20\x72\x65\x71\x75\x69\x72\x65\x28\x29\x27\ +\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x7d\x0a\x0a\x2f\x2f\x20\x4c\x65\ +\x67\x61\x63\x79\x20\x77\x61\x79\x20\x74\x6f\x20\x75\x73\x65\x20\ +\x57\x65\x62\x50\x61\x67\x65\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x57\ +\x65\x62\x50\x61\x67\x65\x20\x3d\x20\x72\x65\x71\x75\x69\x72\x65\ +\x28\x27\x77\x65\x62\x70\x61\x67\x65\x27\x29\x2e\x63\x72\x65\x61\ +\x74\x65\x3b\x0a\ \x00\x00\x01\x1a\ \x28\ \x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x6f\x70\x74\x73\x29\x20\ @@ -30,722 +184,6 @@ \x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x7d\x0a\ \x0a\x09\x72\x65\x74\x75\x72\x6e\x20\x6e\x75\x6c\x6c\x3b\x0a\x7d\ \x29\x28\x28\x25\x31\x29\x29\x3b\x0a\ -\x00\x00\x18\xf4\ -\x2f\ -\x2a\x6a\x73\x6c\x69\x6e\x74\x20\x73\x6c\x6f\x70\x70\x79\x3a\x20\ -\x74\x72\x75\x65\x2c\x20\x6e\x6f\x6d\x65\x6e\x3a\x20\x74\x72\x75\ -\x65\x20\x2a\x2f\x0a\x2f\x2a\x67\x6c\x6f\x62\x61\x6c\x20\x77\x69\ -\x6e\x64\x6f\x77\x3a\x74\x72\x75\x65\x2c\x70\x68\x61\x6e\x74\x6f\ -\x6d\x3a\x74\x72\x75\x65\x2c\x66\x73\x3a\x74\x72\x75\x65\x20\x2a\ -\x2f\x0a\x0a\x2f\x2a\x0a\x20\x20\x54\x68\x69\x73\x20\x66\x69\x6c\ -\x65\x20\x69\x73\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x74\x68\x65\ -\x20\x50\x68\x61\x6e\x74\x6f\x6d\x4a\x53\x20\x70\x72\x6f\x6a\x65\ -\x63\x74\x20\x66\x72\x6f\x6d\x20\x4f\x66\x69\x20\x4c\x61\x62\x73\ -\x2e\x0a\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\ -\x43\x29\x20\x32\x30\x31\x31\x20\x41\x72\x69\x79\x61\x20\x48\x69\ -\x64\x61\x79\x61\x74\x20\x3c\x61\x72\x69\x79\x61\x2e\x68\x69\x64\ -\x61\x79\x61\x74\x40\x67\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\ -\x20\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\ -\x32\x30\x31\x31\x20\x49\x76\x61\x6e\x20\x44\x65\x20\x4d\x61\x72\ -\x69\x6e\x6f\x20\x3c\x69\x76\x61\x6e\x2e\x64\x65\x2e\x6d\x61\x72\ -\x69\x6e\x6f\x40\x67\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\ -\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\ -\x30\x31\x31\x20\x4a\x61\x6d\x65\x73\x20\x52\x6f\x65\x20\x3c\x72\ -\x6f\x65\x6a\x61\x6d\x65\x73\x31\x32\x40\x68\x6f\x74\x6d\x61\x69\ -\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\x67\ -\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\x65\x78\x65\x63\ -\x6a\x6f\x73\x68\x2c\x20\x68\x74\x74\x70\x3a\x2f\x2f\x65\x78\x65\ -\x63\x6a\x6f\x73\x68\x2e\x62\x6c\x6f\x67\x73\x70\x6f\x74\x2e\x63\ -\x6f\x6d\x0a\x0a\x20\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\ -\x74\x69\x6f\x6e\x20\x61\x6e\x64\x20\x75\x73\x65\x20\x69\x6e\x20\ -\x73\x6f\x75\x72\x63\x65\x20\x61\x6e\x64\x20\x62\x69\x6e\x61\x72\ -\x79\x20\x66\x6f\x72\x6d\x73\x2c\x20\x77\x69\x74\x68\x20\x6f\x72\ -\x20\x77\x69\x74\x68\x6f\x75\x74\x0a\x20\x20\x6d\x6f\x64\x69\x66\ -\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x61\x72\x65\x20\x70\x65\x72\ -\x6d\x69\x74\x74\x65\x64\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\ -\x74\x68\x61\x74\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\ -\x6e\x67\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x72\ -\x65\x20\x6d\x65\x74\x3a\x0a\x0a\x20\x20\x20\x20\x2a\x20\x52\x65\ -\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x73\x20\x6f\x66\ -\x20\x73\x6f\x75\x72\x63\x65\x20\x63\x6f\x64\x65\x20\x6d\x75\x73\ -\x74\x20\x72\x65\x74\x61\x69\x6e\x20\x74\x68\x65\x20\x61\x62\x6f\ -\x76\x65\x20\x63\x6f\x70\x79\x72\x69\x67\x68\x74\x0a\x20\x20\x20\ -\x20\x20\x20\x6e\x6f\x74\x69\x63\x65\x2c\x20\x74\x68\x69\x73\x20\ -\x6c\x69\x73\x74\x20\x6f\x66\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\ -\x6e\x73\x20\x61\x6e\x64\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\ -\x77\x69\x6e\x67\x20\x64\x69\x73\x63\x6c\x61\x69\x6d\x65\x72\x2e\ -\x0a\x20\x20\x20\x20\x2a\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\ -\x75\x74\x69\x6f\x6e\x73\x20\x69\x6e\x20\x62\x69\x6e\x61\x72\x79\ -\x20\x66\x6f\x72\x6d\x20\x6d\x75\x73\x74\x20\x72\x65\x70\x72\x6f\ -\x64\x75\x63\x65\x20\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\ -\x6f\x70\x79\x72\x69\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\ -\x6f\x74\x69\x63\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\ -\x20\x6f\x66\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\ -\x6e\x64\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\ -\x20\x64\x69\x73\x63\x6c\x61\x69\x6d\x65\x72\x20\x69\x6e\x20\x74\ -\x68\x65\x0a\x20\x20\x20\x20\x20\x20\x64\x6f\x63\x75\x6d\x65\x6e\ -\x74\x61\x74\x69\x6f\x6e\x20\x61\x6e\x64\x2f\x6f\x72\x20\x6f\x74\ -\x68\x65\x72\x20\x6d\x61\x74\x65\x72\x69\x61\x6c\x73\x20\x70\x72\ -\x6f\x76\x69\x64\x65\x64\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\ -\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2e\x0a\x20\x20\ -\x20\x20\x2a\x20\x4e\x65\x69\x74\x68\x65\x72\x20\x74\x68\x65\x20\ -\x6e\x61\x6d\x65\x20\x6f\x66\x20\x74\x68\x65\x20\x3c\x6f\x72\x67\ -\x61\x6e\x69\x7a\x61\x74\x69\x6f\x6e\x3e\x20\x6e\x6f\x72\x20\x74\ -\x68\x65\x0a\x20\x20\x20\x20\x20\x20\x6e\x61\x6d\x65\x73\x20\x6f\ -\x66\x20\x69\x74\x73\x20\x63\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\ -\x72\x73\x20\x6d\x61\x79\x20\x62\x65\x20\x75\x73\x65\x64\x20\x74\ -\x6f\x20\x65\x6e\x64\x6f\x72\x73\x65\x20\x6f\x72\x20\x70\x72\x6f\ -\x6d\x6f\x74\x65\x20\x70\x72\x6f\x64\x75\x63\x74\x73\x0a\x20\x20\ -\x20\x20\x20\x20\x64\x65\x72\x69\x76\x65\x64\x20\x66\x72\x6f\x6d\ -\x20\x74\x68\x69\x73\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x20\x77\ -\x69\x74\x68\x6f\x75\x74\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\ -\x70\x72\x69\x6f\x72\x20\x77\x72\x69\x74\x74\x65\x6e\x20\x70\x65\ -\x72\x6d\x69\x73\x73\x69\x6f\x6e\x2e\x0a\x0a\x20\x20\x54\x48\x49\ -\x53\x20\x53\x4f\x46\x54\x57\x41\x52\x45\x20\x49\x53\x20\x50\x52\ -\x4f\x56\x49\x44\x45\x44\x20\x42\x59\x20\x54\x48\x45\x20\x43\x4f\ -\x50\x59\x52\x49\x47\x48\x54\x20\x48\x4f\x4c\x44\x45\x52\x53\x20\ -\x41\x4e\x44\x20\x43\x4f\x4e\x54\x52\x49\x42\x55\x54\x4f\x52\x53\ -\x20\x22\x41\x53\x20\x49\x53\x22\x0a\x20\x20\x41\x4e\x44\x20\x41\ -\x4e\x59\x20\x45\x58\x50\x52\x45\x53\x53\x20\x4f\x52\x20\x49\x4d\ -\x50\x4c\x49\x45\x44\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\ -\x2c\x20\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x2c\x20\x42\x55\x54\ -\x20\x4e\x4f\x54\x20\x4c\x49\x4d\x49\x54\x45\x44\x20\x54\x4f\x2c\ -\x20\x54\x48\x45\x0a\x20\x20\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\ -\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x46\x20\x4d\x45\x52\ -\x43\x48\x41\x4e\x54\x41\x42\x49\x4c\x49\x54\x59\x20\x41\x4e\x44\ -\x20\x46\x49\x54\x4e\x45\x53\x53\x20\x46\x4f\x52\x20\x41\x20\x50\ -\x41\x52\x54\x49\x43\x55\x4c\x41\x52\x20\x50\x55\x52\x50\x4f\x53\ -\x45\x0a\x20\x20\x41\x52\x45\x20\x44\x49\x53\x43\x4c\x41\x49\x4d\ -\x45\x44\x2e\x20\x49\x4e\x20\x4e\x4f\x20\x45\x56\x45\x4e\x54\x20\ -\x53\x48\x41\x4c\x4c\x20\x3c\x43\x4f\x50\x59\x52\x49\x47\x48\x54\ -\x20\x48\x4f\x4c\x44\x45\x52\x3e\x20\x42\x45\x20\x4c\x49\x41\x42\ -\x4c\x45\x20\x46\x4f\x52\x20\x41\x4e\x59\x0a\x20\x20\x44\x49\x52\ -\x45\x43\x54\x2c\x20\x49\x4e\x44\x49\x52\x45\x43\x54\x2c\x20\x49\ -\x4e\x43\x49\x44\x45\x4e\x54\x41\x4c\x2c\x20\x53\x50\x45\x43\x49\ -\x41\x4c\x2c\x20\x45\x58\x45\x4d\x50\x4c\x41\x52\x59\x2c\x20\x4f\ -\x52\x20\x43\x4f\x4e\x53\x45\x51\x55\x45\x4e\x54\x49\x41\x4c\x20\ -\x44\x41\x4d\x41\x47\x45\x53\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\ -\x44\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\ -\x4d\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\x50\x52\x4f\x43\x55\x52\ -\x45\x4d\x45\x4e\x54\x20\x4f\x46\x20\x53\x55\x42\x53\x54\x49\x54\ -\x55\x54\x45\x20\x47\x4f\x4f\x44\x53\x20\x4f\x52\x20\x53\x45\x52\ -\x56\x49\x43\x45\x53\x3b\x0a\x20\x20\x4c\x4f\x53\x53\x20\x4f\x46\ -\x20\x55\x53\x45\x2c\x20\x44\x41\x54\x41\x2c\x20\x4f\x52\x20\x50\ -\x52\x4f\x46\x49\x54\x53\x3b\x20\x4f\x52\x20\x42\x55\x53\x49\x4e\ -\x45\x53\x53\x20\x49\x4e\x54\x45\x52\x52\x55\x50\x54\x49\x4f\x4e\ -\x29\x20\x48\x4f\x57\x45\x56\x45\x52\x20\x43\x41\x55\x53\x45\x44\ -\x20\x41\x4e\x44\x0a\x20\x20\x4f\x4e\x20\x41\x4e\x59\x20\x54\x48\ -\x45\x4f\x52\x59\x20\x4f\x46\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\ -\x59\x2c\x20\x57\x48\x45\x54\x48\x45\x52\x20\x49\x4e\x20\x43\x4f\ -\x4e\x54\x52\x41\x43\x54\x2c\x20\x53\x54\x52\x49\x43\x54\x20\x4c\ -\x49\x41\x42\x49\x4c\x49\x54\x59\x2c\x20\x4f\x52\x20\x54\x4f\x52\ -\x54\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x20\x4e\ -\x45\x47\x4c\x49\x47\x45\x4e\x43\x45\x20\x4f\x52\x20\x4f\x54\x48\ -\x45\x52\x57\x49\x53\x45\x29\x20\x41\x52\x49\x53\x49\x4e\x47\x20\ -\x49\x4e\x20\x41\x4e\x59\x20\x57\x41\x59\x20\x4f\x55\x54\x20\x4f\ -\x46\x20\x54\x48\x45\x20\x55\x53\x45\x20\x4f\x46\x0a\x20\x20\x54\ -\x48\x49\x53\x20\x53\x4f\x46\x54\x57\x41\x52\x45\x2c\x20\x45\x56\ -\x45\x4e\x20\x49\x46\x20\x41\x44\x56\x49\x53\x45\x44\x20\x4f\x46\ -\x20\x54\x48\x45\x20\x50\x4f\x53\x53\x49\x42\x49\x4c\x49\x54\x59\ -\x20\x4f\x46\x20\x53\x55\x43\x48\x20\x44\x41\x4d\x41\x47\x45\x2e\ -\x0a\x2a\x2f\x0a\x0a\x2f\x2f\x20\x54\x68\x69\x73\x20\x61\x6c\x6c\ -\x6f\x77\x73\x20\x63\x72\x65\x61\x74\x69\x6e\x67\x20\x61\x20\x6e\ -\x65\x77\x20\x77\x65\x62\x20\x70\x61\x67\x65\x20\x75\x73\x69\x6e\ -\x67\x20\x74\x68\x65\x20\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x20\ -\x22\x6e\x65\x77\x20\x57\x65\x62\x50\x61\x67\x65\x22\x2c\x0a\x2f\ -\x2f\x20\x77\x68\x69\x63\x68\x20\x66\x65\x65\x6c\x73\x20\x6d\x6f\ -\x72\x65\x20\x6e\x61\x74\x75\x72\x61\x6c\x20\x74\x68\x61\x6e\x20\ -\x22\x70\x68\x61\x6e\x74\x6f\x6d\x2e\x63\x72\x65\x61\x74\x65\x57\ -\x65\x62\x50\x61\x67\x65\x28\x29\x22\x2e\x0a\x77\x69\x6e\x64\x6f\ -\x77\x2e\x57\x65\x62\x50\x61\x67\x65\x20\x3d\x20\x66\x75\x6e\x63\ -\x74\x69\x6f\x6e\x20\x28\x6f\x70\x74\x73\x29\x20\x7b\x0a\x20\x20\ -\x20\x20\x76\x61\x72\x20\x70\x61\x67\x65\x20\x3d\x20\x70\x68\x61\ -\x6e\x74\x6f\x6d\x2e\x63\x72\x65\x61\x74\x65\x57\x65\x62\x50\x61\ -\x67\x65\x28\x29\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x68\x61\ -\x6e\x64\x6c\x65\x72\x73\x20\x3d\x20\x7b\x7d\x3b\x0a\x0a\x20\x20\ -\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x63\x68\x65\x63\x6b\ -\x54\x79\x70\x65\x28\x6f\x2c\x20\x74\x79\x70\x65\x29\x20\x7b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x74\ -\x79\x70\x65\x6f\x66\x20\x6f\x20\x3d\x3d\x3d\x20\x74\x79\x70\x65\ -\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\ -\x63\x74\x69\x6f\x6e\x20\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x6f\ -\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\ -\x72\x6e\x20\x63\x68\x65\x63\x6b\x54\x79\x70\x65\x28\x6f\x2c\x20\ -\x27\x6f\x62\x6a\x65\x63\x74\x27\x29\x3b\x0a\x20\x20\x20\x20\x7d\ -\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x69\ -\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x28\x6f\x29\x20\x7b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x63\ -\x68\x65\x63\x6b\x54\x79\x70\x65\x28\x6f\x2c\x20\x27\x75\x6e\x64\ -\x65\x66\x69\x6e\x65\x64\x27\x29\x3b\x0a\x20\x20\x20\x20\x7d\x0a\ -\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x69\x73\ -\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x4f\x72\x4e\x75\x6c\x6c\x28\ -\x6f\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\ -\x75\x72\x6e\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x28\ -\x6f\x29\x20\x7c\x7c\x20\x6e\x75\x6c\x6c\x20\x3d\x3d\x3d\x20\x6f\ -\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\ -\x63\x74\x69\x6f\x6e\x20\x63\x6f\x70\x79\x49\x6e\x74\x6f\x28\x74\ -\x61\x72\x67\x65\x74\x2c\x20\x73\x6f\x75\x72\x63\x65\x29\x20\x7b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x74\x61\x72\ -\x67\x65\x74\x20\x3d\x3d\x3d\x20\x73\x6f\x75\x72\x63\x65\x20\x7c\ -\x7c\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x4f\x72\x4e\ -\x75\x6c\x6c\x28\x73\x6f\x75\x72\x63\x65\x29\x29\x20\x7b\x0a\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\ -\x6e\x20\x74\x61\x72\x67\x65\x74\x3b\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x74\x61\x72\ -\x67\x65\x74\x20\x3d\x20\x74\x61\x72\x67\x65\x74\x20\x7c\x7c\x20\ -\x7b\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\ -\x43\x6f\x70\x79\x20\x69\x6e\x74\x6f\x20\x6f\x62\x6a\x65\x63\x74\ -\x73\x20\x6f\x6e\x6c\x79\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\ -\x66\x20\x28\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x74\x61\x72\x67\ -\x65\x74\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x2f\x2f\x20\x4d\x61\x6b\x65\x20\x73\x75\x72\x65\x20\ -\x73\x6f\x75\x72\x63\x65\x20\x65\x78\x69\x73\x74\x73\x0a\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x75\x72\x63\x65\ -\x20\x3d\x20\x73\x6f\x75\x72\x63\x65\x20\x7c\x7c\x20\x7b\x7d\x3b\ -\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\ -\x20\x28\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x73\x6f\x75\x72\x63\ -\x65\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x76\x61\x72\x20\x69\x2c\x20\x6e\x65\x77\ -\x54\x61\x72\x67\x65\x74\x2c\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\ -\x65\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x66\x6f\x72\x20\x28\x69\x20\x69\x6e\x20\x73\x6f\x75\ -\x72\x63\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x73\ -\x6f\x75\x72\x63\x65\x2e\x68\x61\x73\x4f\x77\x6e\x50\x72\x6f\x70\ -\x65\x72\x74\x79\x28\x69\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x20\x3d\x20\x74\ -\x61\x72\x67\x65\x74\x5b\x69\x5d\x3b\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\x65\x20\x3d\x20\x73\x6f\ -\x75\x72\x63\x65\x5b\x69\x5d\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x69\x66\x20\x28\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x20\ -\x26\x26\x20\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x6e\x65\x77\x53\ -\x6f\x75\x72\x63\x65\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x44\x65\x65\x70\x20\x63\x6f\ -\x70\x79\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x6e\ -\x65\x77\x54\x61\x72\x67\x65\x74\x20\x3d\x20\x63\x6f\x70\x79\x49\ -\x6e\x74\x6f\x28\x74\x61\x72\x67\x65\x74\x5b\x69\x5d\x2c\x20\x6e\ -\x65\x77\x53\x6f\x75\x72\x63\x65\x29\x3b\x0a\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x7b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x6e\x65\x77\x54\x61\x72\x67\x65\ -\x74\x20\x3d\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\x65\x3b\x0a\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x69\x66\x20\x28\x21\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\ -\x65\x64\x28\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x29\x29\x20\x7b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x61\x72\ -\x67\x65\x74\x5b\x69\x5d\x20\x3d\x20\x6e\x65\x77\x54\x61\x72\x67\ -\x65\x74\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x7b\x0a\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x61\x72\x67\x65\ -\x74\x20\x3d\x20\x73\x6f\x75\x72\x63\x65\x3b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\ -\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\ -\x75\x72\x6e\x20\x74\x61\x72\x67\x65\x74\x3b\x0a\x20\x20\x20\x20\ -\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\ -\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x68\x61\x6e\ -\x64\x6c\x65\x72\x4e\x61\x6d\x65\x2c\x20\x73\x69\x67\x6e\x61\x6c\ -\x4e\x61\x6d\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ -\x70\x61\x67\x65\x2e\x5f\x5f\x64\x65\x66\x69\x6e\x65\x53\x65\x74\ -\x74\x65\x72\x5f\x5f\x28\x68\x61\x6e\x64\x6c\x65\x72\x4e\x61\x6d\ -\x65\x2c\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x66\x29\x20\ -\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\ -\x20\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x20\x26\x26\x20\x74\x79\ -\x70\x65\x6f\x66\x20\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\ -\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x20\x3d\x3d\x3d\x20\x27\x66\ -\x75\x6e\x63\x74\x69\x6f\x6e\x27\x29\x20\x7b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x72\x79\x20\ -\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x5b\x73\x69\x67\x6e\x61\ -\x6c\x4e\x61\x6d\x65\x5d\x2e\x64\x69\x73\x63\x6f\x6e\x6e\x65\x63\ -\x74\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\x67\x6e\x61\ -\x6c\x4e\x61\x6d\x65\x5d\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x63\x61\x74\x63\x68\ -\x20\x28\x65\x29\x20\x7b\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\x67\x6e\x61\ -\x6c\x4e\x61\x6d\x65\x5d\x20\x3d\x20\x66\x3b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x5b\x73\x69\x67\ -\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x2e\x63\x6f\x6e\x6e\x65\x63\x74\ -\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\x67\x6e\x61\x6c\ -\x4e\x61\x6d\x65\x5d\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ -\x7d\x29\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x2f\ -\x2f\x20\x64\x65\x65\x70\x20\x63\x6f\x70\x79\x0a\x20\x20\x20\x20\ -\x70\x61\x67\x65\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x20\x3d\x20\ -\x4a\x53\x4f\x4e\x2e\x70\x61\x72\x73\x65\x28\x4a\x53\x4f\x4e\x2e\ -\x73\x74\x72\x69\x6e\x67\x69\x66\x79\x28\x70\x68\x61\x6e\x74\x6f\ -\x6d\x2e\x64\x65\x66\x61\x75\x6c\x74\x50\x61\x67\x65\x53\x65\x74\ -\x74\x69\x6e\x67\x73\x29\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\ -\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x49\x6e\ -\x69\x74\x69\x61\x6c\x69\x7a\x65\x64\x22\x2c\x20\x22\x69\x6e\x69\ -\x74\x69\x61\x6c\x69\x7a\x65\x64\x22\x29\x3b\x0a\x0a\x20\x20\x20\ -\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\ -\x6e\x4c\x6f\x61\x64\x53\x74\x61\x72\x74\x65\x64\x22\x2c\x20\x22\ -\x6c\x6f\x61\x64\x53\x74\x61\x72\x74\x65\x64\x22\x29\x3b\x0a\x0a\ -\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\ -\x28\x22\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\x68\x65\x64\ -\x22\x2c\x20\x22\x6c\x6f\x61\x64\x46\x69\x6e\x69\x73\x68\x65\x64\ -\x22\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\ -\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x52\x65\x73\x6f\x75\x72\x63\ -\x65\x52\x65\x71\x75\x65\x73\x74\x65\x64\x22\x2c\x20\x22\x72\x65\ -\x73\x6f\x75\x72\x63\x65\x52\x65\x71\x75\x65\x73\x74\x65\x64\x22\ -\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\ -\x74\x74\x65\x72\x28\x22\x6f\x6e\x52\x65\x73\x6f\x75\x72\x63\x65\ -\x52\x65\x63\x65\x69\x76\x65\x64\x22\x2c\x20\x22\x72\x65\x73\x6f\ -\x75\x72\x63\x65\x52\x65\x63\x65\x69\x76\x65\x64\x22\x29\x3b\x0a\ -\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\ -\x72\x28\x22\x6f\x6e\x41\x6c\x65\x72\x74\x22\x2c\x20\x22\x6a\x61\ -\x76\x61\x53\x63\x72\x69\x70\x74\x41\x6c\x65\x72\x74\x53\x65\x6e\ -\x74\x22\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\ -\x53\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x43\x6f\x6e\x73\x6f\x6c\ -\x65\x4d\x65\x73\x73\x61\x67\x65\x22\x2c\x20\x22\x6a\x61\x76\x61\ -\x53\x63\x72\x69\x70\x74\x43\x6f\x6e\x73\x6f\x6c\x65\x4d\x65\x73\ -\x73\x61\x67\x65\x53\x65\x6e\x74\x22\x29\x3b\x0a\x0a\x20\x20\x20\ -\x20\x70\x61\x67\x65\x2e\x6f\x70\x65\x6e\x20\x3d\x20\x66\x75\x6e\ -\x63\x74\x69\x6f\x6e\x20\x28\x75\x72\x6c\x2c\x20\x61\x72\x67\x31\ -\x2c\x20\x61\x72\x67\x32\x2c\x20\x61\x72\x67\x33\x2c\x20\x61\x72\ -\x67\x34\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\ -\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\x6c\x65\x6e\x67\ -\x74\x68\x20\x3d\x3d\x3d\x20\x31\x29\x20\x7b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x70\x65\ -\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x27\x67\x65\x74\x27\x2c\ -\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\ -\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\ -\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\ -\x65\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\ -\x32\x20\x26\x26\x20\x74\x79\x70\x65\x6f\x66\x20\x61\x72\x67\x31\ -\x20\x3d\x3d\x3d\x20\x27\x66\x75\x6e\x63\x74\x69\x6f\x6e\x27\x29\ -\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\ -\x68\x69\x73\x2e\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\x68\ -\x65\x64\x20\x3d\x20\x61\x72\x67\x31\x3b\x0a\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x70\x65\x6e\ -\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x27\x67\x65\x74\x27\x2c\x20\ -\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\ -\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\ -\x73\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\ -\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x32\x29\x20\x7b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\ -\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x61\ -\x72\x67\x31\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\ -\x67\x73\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x72\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\ -\x20\x7d\x20\x65\x6c\x73\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\ -\x6d\x65\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\ -\x20\x33\x20\x26\x26\x20\x74\x79\x70\x65\x6f\x66\x20\x61\x72\x67\ -\x32\x20\x3d\x3d\x3d\x20\x27\x66\x75\x6e\x63\x74\x69\x6f\x6e\x27\ -\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x74\x68\x69\x73\x2e\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\ -\x68\x65\x64\x20\x3d\x20\x61\x72\x67\x32\x3b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x70\x65\ -\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x61\x72\x67\x31\x2c\x20\ -\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\ -\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\ -\x73\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\ -\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x33\x29\x20\x7b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\ -\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x7b\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x6f\x70\x65\x72\x61\x74\x69\x6f\x6e\x3a\x20\x61\x72\x67\x31\ -\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x64\x61\x74\x61\x3a\x20\x61\x72\x67\x32\x0a\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x2c\x20\x74\x68\x69\x73\ -\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\x0a\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x3b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x69\ -\x66\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\x6c\x65\x6e\ -\x67\x74\x68\x20\x3d\x3d\x3d\x20\x34\x29\x20\x7b\x0a\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x6e\ -\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\x68\x65\x64\x20\x3d\x20\x61\ -\x72\x67\x33\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x74\x68\x69\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\ -\x6c\x2c\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x6f\x70\x65\x72\x61\x74\x69\x6f\x6e\x3a\x20\ -\x61\x72\x67\x31\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x64\x61\x74\x61\x3a\x20\x61\x72\x67\x32\ -\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x2c\x20\ -\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\ -\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\ -\x20\x20\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\x22\x57\x72\x6f\ -\x6e\x67\x20\x75\x73\x65\x20\x6f\x66\x20\x57\x65\x62\x50\x61\x67\ -\x65\x23\x6f\x70\x65\x6e\x22\x3b\x0a\x20\x20\x20\x20\x7d\x3b\x0a\ -\x0a\x20\x20\x20\x20\x70\x61\x67\x65\x2e\x69\x6e\x63\x6c\x75\x64\ -\x65\x4a\x73\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\ -\x73\x63\x72\x69\x70\x74\x55\x72\x6c\x2c\x20\x6f\x6e\x53\x63\x72\ -\x69\x70\x74\x4c\x6f\x61\x64\x65\x64\x29\x20\x7b\x0a\x20\x20\x20\ -\x20\x20\x20\x20\x20\x2f\x2f\x20\x52\x65\x67\x69\x73\x74\x65\x72\ -\x20\x74\x65\x6d\x70\x6f\x72\x61\x72\x79\x20\x73\x69\x67\x6e\x61\ -\x6c\x20\x68\x61\x6e\x64\x6c\x65\x72\x20\x66\x6f\x72\x20\x27\x61\ -\x6c\x65\x72\x74\x28\x29\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ -\x74\x68\x69\x73\x2e\x6a\x61\x76\x61\x53\x63\x72\x69\x70\x74\x41\ -\x6c\x65\x72\x74\x53\x65\x6e\x74\x2e\x63\x6f\x6e\x6e\x65\x63\x74\ -\x28\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x6d\x73\x67\x46\x72\ -\x6f\x6d\x41\x6c\x65\x72\x74\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x6d\x73\x67\x46\x72\ -\x6f\x6d\x41\x6c\x65\x72\x74\x20\x3d\x3d\x3d\x20\x73\x63\x72\x69\ -\x70\x74\x55\x72\x6c\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x52\x65\x73\x6f\ -\x75\x72\x63\x65\x20\x6c\x6f\x61\x64\x65\x64\x2c\x20\x74\x69\x6d\ -\x65\x20\x74\x6f\x20\x66\x69\x72\x65\x20\x74\x68\x65\x20\x63\x61\ -\x6c\x6c\x62\x61\x63\x6b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x6f\x6e\x53\x63\x72\x69\x70\x74\x4c\ -\x6f\x61\x64\x65\x64\x28\x73\x63\x72\x69\x70\x74\x55\x72\x6c\x29\ -\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x2f\x2f\x20\x41\x6e\x64\x20\x64\x69\x73\x63\x6f\x6e\x6e\ -\x65\x63\x74\x20\x74\x68\x65\x20\x73\x69\x67\x6e\x61\x6c\x20\x68\ -\x61\x6e\x64\x6c\x65\x72\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x74\x72\x79\x20\x7b\x0a\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x74\x68\x69\x73\x2e\x6a\x61\x76\x61\x53\x63\x72\x69\x70\x74\ -\x41\x6c\x65\x72\x74\x53\x65\x6e\x74\x2e\x64\x69\x73\x63\x6f\x6e\ -\x6e\x65\x63\x74\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\x63\ -\x61\x6c\x6c\x65\x65\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x63\x61\x74\x63\x68\x20\ -\x28\x65\x29\x20\x7b\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ -\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x29\x3b\ -\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x41\x70\x70\ -\x65\x6e\x64\x20\x74\x68\x65\x20\x73\x63\x72\x69\x70\x74\x20\x74\ -\x61\x67\x20\x74\x6f\x20\x74\x68\x65\x20\x62\x6f\x64\x79\x0a\x20\ -\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x5f\x61\x70\x70\ -\x65\x6e\x64\x53\x63\x72\x69\x70\x74\x45\x6c\x65\x6d\x65\x6e\x74\ -\x28\x73\x63\x72\x69\x70\x74\x55\x72\x6c\x29\x3b\x0a\x20\x20\x20\ -\x20\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x2f\x2f\x20\x43\x6f\x70\x79\ -\x20\x6f\x70\x74\x69\x6f\x6e\x73\x20\x69\x6e\x74\x6f\x20\x70\x61\ -\x67\x65\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x6f\x70\x74\x73\x29\ -\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x70\x61\x67\x65\x20\ -\x3d\x20\x63\x6f\x70\x79\x49\x6e\x74\x6f\x28\x70\x61\x67\x65\x2c\ -\x20\x6f\x70\x74\x73\x29\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\ -\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x70\x61\x67\x65\x3b\x0a\ -\x7d\x3b\x0a\ -\x00\x00\x13\x7d\ -\x2f\ -\x2a\x6a\x73\x6c\x69\x6e\x74\x20\x73\x6c\x6f\x70\x70\x79\x3a\x20\ -\x74\x72\x75\x65\x2c\x20\x6e\x6f\x6d\x65\x6e\x3a\x20\x74\x72\x75\ -\x65\x20\x2a\x2f\x0a\x2f\x2a\x67\x6c\x6f\x62\x61\x6c\x20\x77\x69\ -\x6e\x64\x6f\x77\x3a\x74\x72\x75\x65\x2c\x70\x68\x61\x6e\x74\x6f\ -\x6d\x3a\x74\x72\x75\x65\x2c\x66\x73\x3a\x74\x72\x75\x65\x20\x2a\ -\x2f\x0a\x0a\x2f\x2a\x0a\x20\x20\x54\x68\x69\x73\x20\x66\x69\x6c\ -\x65\x20\x69\x73\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x74\x68\x65\ -\x20\x50\x68\x61\x6e\x74\x6f\x6d\x4a\x53\x20\x70\x72\x6f\x6a\x65\ -\x63\x74\x20\x66\x72\x6f\x6d\x20\x4f\x66\x69\x20\x4c\x61\x62\x73\ -\x2e\x0a\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\ -\x43\x29\x20\x32\x30\x31\x31\x20\x49\x76\x61\x6e\x20\x44\x65\x20\ -\x4d\x61\x72\x69\x6e\x6f\x20\x3c\x69\x76\x61\x6e\x2e\x64\x65\x2e\ -\x6d\x61\x72\x69\x6e\x6f\x40\x67\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\ -\x3e\x0a\x0a\x20\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\ -\x69\x6f\x6e\x20\x61\x6e\x64\x20\x75\x73\x65\x20\x69\x6e\x20\x73\ -\x6f\x75\x72\x63\x65\x20\x61\x6e\x64\x20\x62\x69\x6e\x61\x72\x79\ -\x20\x66\x6f\x72\x6d\x73\x2c\x20\x77\x69\x74\x68\x20\x6f\x72\x20\ -\x77\x69\x74\x68\x6f\x75\x74\x0a\x20\x20\x6d\x6f\x64\x69\x66\x69\ -\x63\x61\x74\x69\x6f\x6e\x2c\x20\x61\x72\x65\x20\x70\x65\x72\x6d\ -\x69\x74\x74\x65\x64\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\x74\ -\x68\x61\x74\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\ -\x67\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x72\x65\ -\x20\x6d\x65\x74\x3a\x0a\x0a\x20\x20\x20\x20\x2a\x20\x52\x65\x64\ -\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x73\x20\x6f\x66\x20\ -\x73\x6f\x75\x72\x63\x65\x20\x63\x6f\x64\x65\x20\x6d\x75\x73\x74\ -\x20\x72\x65\x74\x61\x69\x6e\x20\x74\x68\x65\x20\x61\x62\x6f\x76\ -\x65\x20\x63\x6f\x70\x79\x72\x69\x67\x68\x74\x0a\x20\x20\x20\x20\ -\x20\x20\x6e\x6f\x74\x69\x63\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\ -\x69\x73\x74\x20\x6f\x66\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\ -\x73\x20\x61\x6e\x64\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\ -\x69\x6e\x67\x20\x64\x69\x73\x63\x6c\x61\x69\x6d\x65\x72\x2e\x0a\ -\x20\x20\x20\x20\x2a\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\ -\x74\x69\x6f\x6e\x73\x20\x69\x6e\x20\x62\x69\x6e\x61\x72\x79\x20\ -\x66\x6f\x72\x6d\x20\x6d\x75\x73\x74\x20\x72\x65\x70\x72\x6f\x64\ -\x75\x63\x65\x20\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\ -\x70\x79\x72\x69\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\ -\x74\x69\x63\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\ -\x6f\x66\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\ -\x64\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\ -\x64\x69\x73\x63\x6c\x61\x69\x6d\x65\x72\x20\x69\x6e\x20\x74\x68\ -\x65\x0a\x20\x20\x20\x20\x20\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\ -\x61\x74\x69\x6f\x6e\x20\x61\x6e\x64\x2f\x6f\x72\x20\x6f\x74\x68\ -\x65\x72\x20\x6d\x61\x74\x65\x72\x69\x61\x6c\x73\x20\x70\x72\x6f\ -\x76\x69\x64\x65\x64\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x64\ -\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x2e\x0a\x20\x20\x20\ -\x20\x2a\x20\x4e\x65\x69\x74\x68\x65\x72\x20\x74\x68\x65\x20\x6e\ -\x61\x6d\x65\x20\x6f\x66\x20\x74\x68\x65\x20\x3c\x6f\x72\x67\x61\ -\x6e\x69\x7a\x61\x74\x69\x6f\x6e\x3e\x20\x6e\x6f\x72\x20\x74\x68\ -\x65\x0a\x20\x20\x20\x20\x20\x20\x6e\x61\x6d\x65\x73\x20\x6f\x66\ -\x20\x69\x74\x73\x20\x63\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72\ -\x73\x20\x6d\x61\x79\x20\x62\x65\x20\x75\x73\x65\x64\x20\x74\x6f\ -\x20\x65\x6e\x64\x6f\x72\x73\x65\x20\x6f\x72\x20\x70\x72\x6f\x6d\ -\x6f\x74\x65\x20\x70\x72\x6f\x64\x75\x63\x74\x73\x0a\x20\x20\x20\ -\x20\x20\x20\x64\x65\x72\x69\x76\x65\x64\x20\x66\x72\x6f\x6d\x20\ -\x74\x68\x69\x73\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x20\x77\x69\ -\x74\x68\x6f\x75\x74\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x70\ -\x72\x69\x6f\x72\x20\x77\x72\x69\x74\x74\x65\x6e\x20\x70\x65\x72\ -\x6d\x69\x73\x73\x69\x6f\x6e\x2e\x0a\x0a\x20\x20\x54\x48\x49\x53\ -\x20\x53\x4f\x46\x54\x57\x41\x52\x45\x20\x49\x53\x20\x50\x52\x4f\ -\x56\x49\x44\x45\x44\x20\x42\x59\x20\x54\x48\x45\x20\x43\x4f\x50\ -\x59\x52\x49\x47\x48\x54\x20\x48\x4f\x4c\x44\x45\x52\x53\x20\x41\ -\x4e\x44\x20\x43\x4f\x4e\x54\x52\x49\x42\x55\x54\x4f\x52\x53\x20\ -\x22\x41\x53\x20\x49\x53\x22\x0a\x20\x20\x41\x4e\x44\x20\x41\x4e\ -\x59\x20\x45\x58\x50\x52\x45\x53\x53\x20\x4f\x52\x20\x49\x4d\x50\ -\x4c\x49\x45\x44\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x2c\ -\x20\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\ -\x4e\x4f\x54\x20\x4c\x49\x4d\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\ -\x54\x48\x45\x0a\x20\x20\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\x41\ -\x52\x52\x41\x4e\x54\x49\x45\x53\x20\x4f\x46\x20\x4d\x45\x52\x43\ -\x48\x41\x4e\x54\x41\x42\x49\x4c\x49\x54\x59\x20\x41\x4e\x44\x20\ -\x46\x49\x54\x4e\x45\x53\x53\x20\x46\x4f\x52\x20\x41\x20\x50\x41\ -\x52\x54\x49\x43\x55\x4c\x41\x52\x20\x50\x55\x52\x50\x4f\x53\x45\ -\x0a\x20\x20\x41\x52\x45\x20\x44\x49\x53\x43\x4c\x41\x49\x4d\x45\ -\x44\x2e\x20\x49\x4e\x20\x4e\x4f\x20\x45\x56\x45\x4e\x54\x20\x53\ -\x48\x41\x4c\x4c\x20\x3c\x43\x4f\x50\x59\x52\x49\x47\x48\x54\x20\ -\x48\x4f\x4c\x44\x45\x52\x3e\x20\x42\x45\x20\x4c\x49\x41\x42\x4c\ -\x45\x20\x46\x4f\x52\x20\x41\x4e\x59\x0a\x20\x20\x44\x49\x52\x45\ -\x43\x54\x2c\x20\x49\x4e\x44\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\ -\x43\x49\x44\x45\x4e\x54\x41\x4c\x2c\x20\x53\x50\x45\x43\x49\x41\ -\x4c\x2c\x20\x45\x58\x45\x4d\x50\x4c\x41\x52\x59\x2c\x20\x4f\x52\ -\x20\x43\x4f\x4e\x53\x45\x51\x55\x45\x4e\x54\x49\x41\x4c\x20\x44\ -\x41\x4d\x41\x47\x45\x53\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\ -\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\x4d\ -\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\x50\x52\x4f\x43\x55\x52\x45\ -\x4d\x45\x4e\x54\x20\x4f\x46\x20\x53\x55\x42\x53\x54\x49\x54\x55\ -\x54\x45\x20\x47\x4f\x4f\x44\x53\x20\x4f\x52\x20\x53\x45\x52\x56\ -\x49\x43\x45\x53\x3b\x0a\x20\x20\x4c\x4f\x53\x53\x20\x4f\x46\x20\ -\x55\x53\x45\x2c\x20\x44\x41\x54\x41\x2c\x20\x4f\x52\x20\x50\x52\ -\x4f\x46\x49\x54\x53\x3b\x20\x4f\x52\x20\x42\x55\x53\x49\x4e\x45\ -\x53\x53\x20\x49\x4e\x54\x45\x52\x52\x55\x50\x54\x49\x4f\x4e\x29\ -\x20\x48\x4f\x57\x45\x56\x45\x52\x20\x43\x41\x55\x53\x45\x44\x20\ -\x41\x4e\x44\x0a\x20\x20\x4f\x4e\x20\x41\x4e\x59\x20\x54\x48\x45\ -\x4f\x52\x59\x20\x4f\x46\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\x59\ -\x2c\x20\x57\x48\x45\x54\x48\x45\x52\x20\x49\x4e\x20\x43\x4f\x4e\ -\x54\x52\x41\x43\x54\x2c\x20\x53\x54\x52\x49\x43\x54\x20\x4c\x49\ -\x41\x42\x49\x4c\x49\x54\x59\x2c\x20\x4f\x52\x20\x54\x4f\x52\x54\ -\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x20\x4e\x45\ -\x47\x4c\x49\x47\x45\x4e\x43\x45\x20\x4f\x52\x20\x4f\x54\x48\x45\ -\x52\x57\x49\x53\x45\x29\x20\x41\x52\x49\x53\x49\x4e\x47\x20\x49\ -\x4e\x20\x41\x4e\x59\x20\x57\x41\x59\x20\x4f\x55\x54\x20\x4f\x46\ -\x20\x54\x48\x45\x20\x55\x53\x45\x20\x4f\x46\x0a\x20\x20\x54\x48\ -\x49\x53\x20\x53\x4f\x46\x54\x57\x41\x52\x45\x2c\x20\x45\x56\x45\ -\x4e\x20\x49\x46\x20\x41\x44\x56\x49\x53\x45\x44\x20\x4f\x46\x20\ -\x54\x48\x45\x20\x50\x4f\x53\x53\x49\x42\x49\x4c\x49\x54\x59\x20\ -\x4f\x46\x20\x53\x55\x43\x48\x20\x44\x41\x4d\x41\x47\x45\x2e\x0a\ -\x2a\x2f\x0a\x0a\x2f\x2f\x20\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\ -\x0a\x2f\x2f\x20\x4a\x61\x76\x61\x53\x63\x72\x69\x70\x74\x20\x22\ -\x73\x68\x69\x6d\x22\x20\x74\x6f\x20\x74\x68\x72\x6f\x77\x20\x65\ -\x78\x63\x65\x70\x74\x69\x6f\x6e\x73\x20\x69\x6e\x20\x63\x61\x73\ -\x65\x20\x61\x20\x63\x72\x69\x74\x69\x63\x61\x6c\x20\x6f\x70\x65\ -\x72\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x73\x2e\x0a\x0a\x2f\ -\x2a\x2a\x20\x4f\x70\x65\x6e\x20\x61\x6e\x64\x20\x72\x65\x74\x75\ -\x72\x6e\x20\x61\x20\x22\x66\x69\x6c\x65\x22\x20\x6f\x62\x6a\x65\ -\x63\x74\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\ -\x68\x72\x6f\x77\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\ -\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\ -\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\ -\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\ -\x6f\x20\x6f\x70\x65\x6e\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\ -\x20\x6d\x6f\x64\x65\x20\x4f\x70\x65\x6e\x20\x4d\x6f\x64\x65\x2e\ -\x20\x41\x20\x73\x74\x72\x69\x6e\x67\x20\x6d\x61\x64\x65\x20\x6f\ -\x66\x20\x27\x72\x27\x2c\x20\x27\x77\x27\x2c\x20\x27\x61\x2f\x2b\ -\x27\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x2e\x0a\x20\x2a\ -\x20\x40\x72\x65\x74\x75\x72\x6e\x20\x22\x66\x69\x6c\x65\x22\x20\ -\x6f\x62\x6a\x65\x63\x74\x0a\x20\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\ -\x77\x2e\x66\x73\x2e\x6f\x70\x65\x6e\x20\x3d\x20\x66\x75\x6e\x63\ -\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x2c\x20\x6d\x6f\x64\x65\ -\x29\x20\x7b\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x66\x69\x6c\x65\ -\x20\x3d\x20\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x5f\x6f\x70\ -\x65\x6e\x28\x70\x61\x74\x68\x2c\x20\x6d\x6f\x64\x65\x29\x3b\x0a\ -\x20\x20\x20\x20\x69\x66\x20\x28\x66\x69\x6c\x65\x29\x20\x7b\x0a\ -\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x66\ -\x69\x6c\x65\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x74\ -\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\ -\x6f\x70\x65\x6e\x20\x66\x69\x6c\x65\x20\x27\x22\x20\x2b\x20\x70\ -\x61\x74\x68\x20\x2b\x20\x22\x27\x22\x3b\x0a\x7d\x3b\x0a\x0a\x2f\ -\x2a\x2a\x20\x4f\x70\x65\x6e\x2c\x20\x72\x65\x61\x64\x20\x61\x6e\ -\x64\x20\x72\x65\x74\x75\x72\x6e\x20\x63\x6f\x6e\x74\x65\x6e\x74\ -\x20\x6f\x66\x20\x61\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\ -\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\ -\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\ -\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\ -\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\ -\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\ -\x64\x20\x66\x72\x6f\x6d\x0a\x20\x2a\x20\x40\x72\x65\x74\x75\x72\ -\x6e\x20\x66\x69\x6c\x65\x20\x63\x6f\x6e\x74\x65\x6e\x74\x0a\x20\ -\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x72\x65\x61\ -\x64\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\ -\x74\x68\x29\x20\x7b\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x66\x20\ -\x3d\x20\x66\x73\x2e\x6f\x70\x65\x6e\x28\x70\x61\x74\x68\x2c\x20\ -\x27\x72\x27\x29\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x63\x6f\ -\x6e\x74\x65\x6e\x74\x20\x3d\x20\x66\x2e\x72\x65\x61\x64\x28\x29\ -\x3b\x0a\x0a\x20\x20\x20\x20\x66\x2e\x63\x6c\x6f\x73\x65\x28\x29\ -\x3b\x0a\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x63\x6f\x6e\ -\x74\x65\x6e\x74\x3b\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x4f\x70\ -\x65\x6e\x20\x61\x6e\x64\x20\x77\x72\x69\x74\x65\x20\x63\x6f\x6e\ -\x74\x65\x6e\x74\x20\x74\x6f\x20\x61\x20\x66\x69\x6c\x65\x0a\x20\ -\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\ -\x61\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\ -\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\ -\x40\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\ -\x20\x6f\x66\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\ -\x72\x65\x61\x64\x20\x66\x72\x6f\x6d\x0a\x20\x2a\x20\x40\x70\x61\ -\x72\x61\x6d\x20\x63\x6f\x6e\x74\x65\x6e\x74\x20\x43\x6f\x6e\x74\ -\x65\x6e\x74\x20\x74\x6f\x20\x77\x72\x69\x74\x65\x20\x74\x6f\x20\ -\x74\x68\x65\x20\x66\x69\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\ -\x61\x6d\x20\x6d\x6f\x64\x65\x20\x4f\x70\x65\x6e\x20\x4d\x6f\x64\ -\x65\x2e\x20\x41\x20\x73\x74\x72\x69\x6e\x67\x20\x6d\x61\x64\x65\ -\x20\x6f\x66\x20\x27\x77\x27\x20\x6f\x72\x20\x27\x61\x20\x2f\x20\ -\x2b\x27\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x2e\x0a\x20\ -\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x77\x72\x69\ -\x74\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\ -\x61\x74\x68\x2c\x20\x63\x6f\x6e\x74\x65\x6e\x74\x2c\x20\x6d\x6f\ -\x64\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x66\x20\ -\x3d\x20\x66\x73\x2e\x6f\x70\x65\x6e\x28\x70\x61\x74\x68\x2c\x20\ -\x6d\x6f\x64\x65\x29\x3b\x0a\x0a\x20\x20\x20\x20\x66\x2e\x77\x72\ -\x69\x74\x65\x28\x63\x6f\x6e\x74\x65\x6e\x74\x29\x3b\x0a\x20\x20\ -\x20\x20\x66\x2e\x63\x6c\x6f\x73\x65\x28\x29\x3b\x0a\x7d\x3b\x0a\ -\x0a\x2f\x2a\x2a\x20\x52\x65\x74\x75\x72\x6e\x20\x74\x68\x65\x20\ -\x73\x69\x7a\x65\x20\x6f\x66\x20\x61\x20\x66\x69\x6c\x65\x2c\x20\ -\x69\x6e\x20\x62\x79\x74\x65\x73\x2e\x0a\x20\x2a\x20\x49\x74\x20\ -\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\x65\x78\ -\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\x66\x61\ -\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\ -\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\x20\x74\ -\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\x64\x20\ -\x74\x68\x65\x20\x73\x69\x7a\x65\x20\x6f\x66\x0a\x20\x2a\x20\x40\ -\x72\x65\x74\x75\x72\x6e\x20\x46\x69\x6c\x65\x20\x73\x69\x7a\x65\ -\x20\x69\x6e\x20\x62\x79\x74\x65\x73\x0a\x20\x2a\x2f\x0a\x77\x69\ -\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x73\x69\x7a\x65\x20\x3d\x20\x66\ -\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\ -\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x73\x69\x7a\x65\x20\x3d\x20\ -\x66\x73\x2e\x5f\x73\x69\x7a\x65\x28\x70\x61\x74\x68\x29\x3b\x0a\ -\x20\x20\x20\x20\x69\x66\x20\x28\x73\x69\x7a\x65\x20\x21\x3d\x3d\ -\x20\x2d\x31\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\ -\x65\x74\x75\x72\x6e\x20\x73\x69\x7a\x65\x3b\x0a\x20\x20\x20\x20\ -\x7d\x0a\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\ -\x62\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\x64\x20\x66\x69\x6c\x65\ -\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\x22\x27\x20\ -\x73\x69\x7a\x65\x22\x3b\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x43\ -\x6f\x70\x79\x20\x61\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\ -\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\ -\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\ -\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\ -\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\x50\x61\x74\x68\x20\ -\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\x63\x65\x20\x66\x69\ -\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x64\x65\x73\ -\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x50\x61\x74\x68\x20\x6f\x66\ -\x20\x74\x68\x65\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\ -\x20\x66\x69\x6c\x65\x0a\x20\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\ -\x2e\x66\x73\x2e\x63\x6f\x70\x79\x20\x3d\x20\x66\x75\x6e\x63\x74\ -\x69\x6f\x6e\x20\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\ -\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x20\x7b\x0a\x09\x69\x66\x20\ -\x28\x21\x66\x73\x2e\x5f\x63\x6f\x70\x79\x28\x73\x6f\x75\x72\x63\ -\x65\x2c\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x29\ -\x20\x7b\x0a\x09\x09\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\ -\x6c\x65\x20\x74\x6f\x20\x63\x6f\x70\x79\x20\x66\x69\x6c\x65\x20\ -\x27\x22\x20\x2b\x20\x73\x6f\x75\x72\x63\x65\x20\x2b\x20\x22\x27\ -\x20\x61\x74\x20\x27\x22\x20\x2b\x20\x64\x65\x73\x74\x69\x6e\x61\ -\x74\x69\x6f\x6e\x20\x2b\x20\x22\x27\x22\x3b\x0a\x09\x7d\x0a\x7d\ -\x3b\x0a\x0a\x2f\x2a\x2a\x20\x43\x6f\x70\x79\x20\x61\x20\x64\x69\ -\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x2e\x0a\x20\x2a\ -\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\ -\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\ -\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\ -\x70\x61\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\x50\x61\x74\ -\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\x63\x65\x20\ -\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x0a\x20\ -\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x64\x65\x73\x74\x69\x6e\x61\ -\x74\x69\x6f\x6e\x20\x50\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\ -\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x64\x69\x72\ -\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x0a\x20\x2a\x2f\x0a\ -\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x63\x6f\x70\x79\x54\x72\ -\x65\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x73\ -\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\ -\x6f\x6e\x29\x20\x7b\x0a\x09\x69\x66\x20\x28\x21\x66\x73\x2e\x5f\ -\x63\x6f\x70\x79\x54\x72\x65\x65\x28\x73\x6f\x75\x72\x63\x65\x2c\ -\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x29\x20\x7b\ -\x0a\x09\x09\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\ -\x20\x74\x6f\x20\x63\x6f\x70\x79\x20\x64\x69\x72\x65\x63\x74\x6f\ -\x72\x79\x20\x74\x72\x65\x65\x20\x27\x22\x20\x2b\x20\x73\x6f\x75\ -\x72\x63\x65\x20\x2b\x20\x22\x27\x20\x61\x74\x20\x27\x22\x20\x2b\ -\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x2b\x20\x22\ -\x27\x22\x3b\x0a\x09\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x4d\ -\x6f\x76\x65\x20\x61\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\ -\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\ -\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\ -\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\ -\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\x50\x61\x74\x68\x20\ -\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\x63\x65\x20\x66\x69\ -\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x64\x65\x73\ -\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x50\x61\x74\x68\x20\x6f\x66\ -\x20\x74\x68\x65\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\ -\x20\x66\x69\x6c\x65\x0a\x20\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\ -\x2e\x66\x73\x2e\x6d\x6f\x76\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\ -\x69\x6f\x6e\x20\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\ -\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x20\x7b\x0a\x09\x66\x73\x2e\ -\x63\x6f\x70\x79\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\ -\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x3b\x0a\x09\x66\x73\x2e\x72\ -\x65\x6d\x6f\x76\x65\x28\x73\x6f\x75\x72\x63\x65\x29\x3b\x0a\x7d\ -\x3b\x0a\x0a\x2f\x2a\x2a\x20\x52\x65\x6d\x6f\x76\x65\x73\x20\x61\ -\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\ -\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\ -\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\ -\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\ -\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\ -\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\x20\ -\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x72\x65\x6d\ -\x6f\x76\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\ -\x70\x61\x74\x68\x29\x20\x7b\x0a\x09\x69\x66\x20\x28\x21\x66\x73\ -\x2e\x5f\x72\x65\x6d\x6f\x76\x65\x28\x70\x61\x74\x68\x29\x29\x20\ -\x7b\x0a\x09\x09\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\ -\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x20\x66\x69\x6c\x65\ -\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\x22\x27\x22\ -\x3b\x0a\x09\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x52\x65\x6d\ -\x6f\x76\x65\x73\x20\x61\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\ -\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\ -\x6f\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\ -\x69\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\ -\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\ -\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x64\x69\x72\x65\x63\ -\x74\x6f\x72\x79\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\x20\ -\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x72\x65\x6d\ -\x6f\x76\x65\x44\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x3d\x20\x66\ -\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\ -\x0a\x09\x69\x66\x20\x28\x21\x66\x73\x2e\x5f\x72\x65\x6d\x6f\x76\ -\x65\x44\x69\x72\x65\x63\x74\x6f\x72\x79\x28\x70\x61\x74\x68\x29\ -\x29\x20\x7b\x0a\x09\x09\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\ -\x62\x6c\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x20\x64\x69\ -\x72\x65\x63\x74\x6f\x72\x79\x20\x27\x22\x20\x2b\x20\x70\x61\x74\ -\x68\x20\x2b\x20\x22\x27\x22\x3b\x0a\x09\x7d\x0a\x7d\x3b\x0a\x0a\ -\x2f\x2a\x2a\x20\x52\x65\x6d\x6f\x76\x65\x73\x20\x61\x20\x64\x69\ -\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x2e\x0a\x20\x2a\ -\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\ -\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\ -\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\ -\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\ -\x6f\x66\x20\x74\x68\x65\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\ -\x20\x74\x72\x65\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\ -\x20\x2a\x2f\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x66\x73\x2e\x72\x65\ -\x6d\x6f\x76\x65\x54\x72\x65\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\ -\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\x09\x69\x66\ -\x20\x28\x21\x66\x73\x2e\x5f\x72\x65\x6d\x6f\x76\x65\x54\x72\x65\ -\x65\x28\x70\x61\x74\x68\x29\x29\x20\x7b\x0a\x09\x09\x74\x68\x72\ -\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\x72\x65\ -\x6d\x6f\x76\x65\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\ -\x72\x65\x65\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\ -\x22\x27\x22\x3b\x0a\x09\x7d\x0a\x7d\x3b\x0a\x0a\x77\x69\x6e\x64\ -\x6f\x77\x2e\x66\x73\x2e\x74\x6f\x75\x63\x68\x20\x3d\x20\x66\x75\ -\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\ -\x09\x66\x73\x2e\x77\x72\x69\x74\x65\x28\x70\x61\x74\x68\x2c\x20\ -\x22\x22\x2c\x20\x27\x61\x27\x29\x3b\x0a\x7d\x3b\ \x00\x00\x56\x27\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ @@ -4919,22 +4357,733 @@ \x40\x1a\x41\xe2\x10\xf1\xb9\x99\x34\x59\x2e\x08\x20\xc2\x77\x60\ \xad\x8e\x88\xa1\x8d\x43\x29\x4f\x8b\x89\x01\x6b\xfc\xff\x01\x4e\ \x6c\xf6\xa7\ +\x00\x00\x18\x67\ +\x2f\ +\x2a\x6a\x73\x6c\x69\x6e\x74\x20\x73\x6c\x6f\x70\x70\x79\x3a\x20\ +\x74\x72\x75\x65\x2c\x20\x6e\x6f\x6d\x65\x6e\x3a\x20\x74\x72\x75\ +\x65\x20\x2a\x2f\x0a\x2f\x2a\x67\x6c\x6f\x62\x61\x6c\x20\x65\x78\ +\x70\x6f\x72\x74\x73\x3a\x74\x72\x75\x65\x2c\x70\x68\x61\x6e\x74\ +\x6f\x6d\x3a\x74\x72\x75\x65\x20\x2a\x2f\x0a\x0a\x2f\x2a\x0a\x20\ +\x20\x54\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x69\x73\x20\x70\x61\ +\x72\x74\x20\x6f\x66\x20\x74\x68\x65\x20\x50\x68\x61\x6e\x74\x6f\ +\x6d\x4a\x53\x20\x70\x72\x6f\x6a\x65\x63\x74\x20\x66\x72\x6f\x6d\ +\x20\x4f\x66\x69\x20\x4c\x61\x62\x73\x2e\x0a\x0a\x20\x20\x43\x6f\ +\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\ +\x20\x41\x72\x69\x79\x61\x20\x48\x69\x64\x61\x79\x61\x74\x20\x3c\ +\x61\x72\x69\x79\x61\x2e\x68\x69\x64\x61\x79\x61\x74\x40\x67\x6d\ +\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\x20\x43\x6f\x70\x79\x72\ +\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\x49\x76\ +\x61\x6e\x20\x44\x65\x20\x4d\x61\x72\x69\x6e\x6f\x20\x3c\x69\x76\ +\x61\x6e\x2e\x64\x65\x2e\x6d\x61\x72\x69\x6e\x6f\x40\x67\x6d\x61\ +\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x20\x20\x43\x6f\x70\x79\x72\x69\ +\x67\x68\x74\x20\x28\x43\x29\x20\x32\x30\x31\x31\x20\x4a\x61\x6d\ +\x65\x73\x20\x52\x6f\x65\x20\x3c\x72\x6f\x65\x6a\x61\x6d\x65\x73\ +\x31\x32\x40\x68\x6f\x74\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\ +\x20\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\ +\x32\x30\x31\x31\x20\x65\x78\x65\x63\x6a\x6f\x73\x68\x2c\x20\x68\ +\x74\x74\x70\x3a\x2f\x2f\x65\x78\x65\x63\x6a\x6f\x73\x68\x2e\x62\ +\x6c\x6f\x67\x73\x70\x6f\x74\x2e\x63\x6f\x6d\x0a\x0a\x20\x20\x52\ +\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x20\x61\x6e\ +\x64\x20\x75\x73\x65\x20\x69\x6e\x20\x73\x6f\x75\x72\x63\x65\x20\ +\x61\x6e\x64\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\x6d\x73\ +\x2c\x20\x77\x69\x74\x68\x20\x6f\x72\x20\x77\x69\x74\x68\x6f\x75\ +\x74\x0a\x20\x20\x6d\x6f\x64\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\ +\x2c\x20\x61\x72\x65\x20\x70\x65\x72\x6d\x69\x74\x74\x65\x64\x20\ +\x70\x72\x6f\x76\x69\x64\x65\x64\x20\x74\x68\x61\x74\x20\x74\x68\ +\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x63\x6f\x6e\x64\ +\x69\x74\x69\x6f\x6e\x73\x20\x61\x72\x65\x20\x6d\x65\x74\x3a\x0a\ +\x0a\x20\x20\x20\x20\x2a\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\ +\x75\x74\x69\x6f\x6e\x73\x20\x6f\x66\x20\x73\x6f\x75\x72\x63\x65\ +\x20\x63\x6f\x64\x65\x20\x6d\x75\x73\x74\x20\x72\x65\x74\x61\x69\ +\x6e\x20\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\x70\x79\ +\x72\x69\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\x74\x69\ +\x63\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\x6f\x66\ +\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\x64\x20\ +\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x64\x69\ +\x73\x63\x6c\x61\x69\x6d\x65\x72\x2e\x0a\x20\x20\x20\x20\x2a\x20\ +\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x73\x20\ +\x69\x6e\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\x6d\x20\x6d\ +\x75\x73\x74\x20\x72\x65\x70\x72\x6f\x64\x75\x63\x65\x20\x74\x68\ +\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\x70\x79\x72\x69\x67\x68\ +\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\x74\x69\x63\x65\x2c\x20\ +\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\x6f\x66\x20\x63\x6f\x6e\ +\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\x64\x20\x74\x68\x65\x20\ +\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x64\x69\x73\x63\x6c\x61\ +\x69\x6d\x65\x72\x20\x69\x6e\x20\x74\x68\x65\x0a\x20\x20\x20\x20\ +\x20\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x61\x74\x69\x6f\x6e\x20\ +\x61\x6e\x64\x2f\x6f\x72\x20\x6f\x74\x68\x65\x72\x20\x6d\x61\x74\ +\x65\x72\x69\x61\x6c\x73\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\ +\x77\x69\x74\x68\x20\x74\x68\x65\x20\x64\x69\x73\x74\x72\x69\x62\ +\x75\x74\x69\x6f\x6e\x2e\x0a\x20\x20\x20\x20\x2a\x20\x4e\x65\x69\ +\x74\x68\x65\x72\x20\x74\x68\x65\x20\x6e\x61\x6d\x65\x20\x6f\x66\ +\x20\x74\x68\x65\x20\x3c\x6f\x72\x67\x61\x6e\x69\x7a\x61\x74\x69\ +\x6f\x6e\x3e\x20\x6e\x6f\x72\x20\x74\x68\x65\x0a\x20\x20\x20\x20\ +\x20\x20\x6e\x61\x6d\x65\x73\x20\x6f\x66\x20\x69\x74\x73\x20\x63\ +\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72\x73\x20\x6d\x61\x79\x20\ +\x62\x65\x20\x75\x73\x65\x64\x20\x74\x6f\x20\x65\x6e\x64\x6f\x72\ +\x73\x65\x20\x6f\x72\x20\x70\x72\x6f\x6d\x6f\x74\x65\x20\x70\x72\ +\x6f\x64\x75\x63\x74\x73\x0a\x20\x20\x20\x20\x20\x20\x64\x65\x72\ +\x69\x76\x65\x64\x20\x66\x72\x6f\x6d\x20\x74\x68\x69\x73\x20\x73\ +\x6f\x66\x74\x77\x61\x72\x65\x20\x77\x69\x74\x68\x6f\x75\x74\x20\ +\x73\x70\x65\x63\x69\x66\x69\x63\x20\x70\x72\x69\x6f\x72\x20\x77\ +\x72\x69\x74\x74\x65\x6e\x20\x70\x65\x72\x6d\x69\x73\x73\x69\x6f\ +\x6e\x2e\x0a\x0a\x20\x20\x54\x48\x49\x53\x20\x53\x4f\x46\x54\x57\ +\x41\x52\x45\x20\x49\x53\x20\x50\x52\x4f\x56\x49\x44\x45\x44\x20\ +\x42\x59\x20\x54\x48\x45\x20\x43\x4f\x50\x59\x52\x49\x47\x48\x54\ +\x20\x48\x4f\x4c\x44\x45\x52\x53\x20\x41\x4e\x44\x20\x43\x4f\x4e\ +\x54\x52\x49\x42\x55\x54\x4f\x52\x53\x20\x22\x41\x53\x20\x49\x53\ +\x22\x0a\x20\x20\x41\x4e\x44\x20\x41\x4e\x59\x20\x45\x58\x50\x52\ +\x45\x53\x53\x20\x4f\x52\x20\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\ +\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x2c\x20\x49\x4e\x43\x4c\x55\ +\x44\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\ +\x4d\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\x54\x48\x45\x0a\x20\x20\ +\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\x41\x52\x52\x41\x4e\x54\x49\ +\x45\x53\x20\x4f\x46\x20\x4d\x45\x52\x43\x48\x41\x4e\x54\x41\x42\ +\x49\x4c\x49\x54\x59\x20\x41\x4e\x44\x20\x46\x49\x54\x4e\x45\x53\ +\x53\x20\x46\x4f\x52\x20\x41\x20\x50\x41\x52\x54\x49\x43\x55\x4c\ +\x41\x52\x20\x50\x55\x52\x50\x4f\x53\x45\x0a\x20\x20\x41\x52\x45\ +\x20\x44\x49\x53\x43\x4c\x41\x49\x4d\x45\x44\x2e\x20\x49\x4e\x20\ +\x4e\x4f\x20\x45\x56\x45\x4e\x54\x20\x53\x48\x41\x4c\x4c\x20\x3c\ +\x43\x4f\x50\x59\x52\x49\x47\x48\x54\x20\x48\x4f\x4c\x44\x45\x52\ +\x3e\x20\x42\x45\x20\x4c\x49\x41\x42\x4c\x45\x20\x46\x4f\x52\x20\ +\x41\x4e\x59\x0a\x20\x20\x44\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\ +\x44\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\x43\x49\x44\x45\x4e\x54\ +\x41\x4c\x2c\x20\x53\x50\x45\x43\x49\x41\x4c\x2c\x20\x45\x58\x45\ +\x4d\x50\x4c\x41\x52\x59\x2c\x20\x4f\x52\x20\x43\x4f\x4e\x53\x45\ +\x51\x55\x45\x4e\x54\x49\x41\x4c\x20\x44\x41\x4d\x41\x47\x45\x53\ +\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x2c\x20\x42\ +\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\x4d\x49\x54\x45\x44\x20\x54\ +\x4f\x2c\x20\x50\x52\x4f\x43\x55\x52\x45\x4d\x45\x4e\x54\x20\x4f\ +\x46\x20\x53\x55\x42\x53\x54\x49\x54\x55\x54\x45\x20\x47\x4f\x4f\ +\x44\x53\x20\x4f\x52\x20\x53\x45\x52\x56\x49\x43\x45\x53\x3b\x0a\ +\x20\x20\x4c\x4f\x53\x53\x20\x4f\x46\x20\x55\x53\x45\x2c\x20\x44\ +\x41\x54\x41\x2c\x20\x4f\x52\x20\x50\x52\x4f\x46\x49\x54\x53\x3b\ +\x20\x4f\x52\x20\x42\x55\x53\x49\x4e\x45\x53\x53\x20\x49\x4e\x54\ +\x45\x52\x52\x55\x50\x54\x49\x4f\x4e\x29\x20\x48\x4f\x57\x45\x56\ +\x45\x52\x20\x43\x41\x55\x53\x45\x44\x20\x41\x4e\x44\x0a\x20\x20\ +\x4f\x4e\x20\x41\x4e\x59\x20\x54\x48\x45\x4f\x52\x59\x20\x4f\x46\ +\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\x59\x2c\x20\x57\x48\x45\x54\ +\x48\x45\x52\x20\x49\x4e\x20\x43\x4f\x4e\x54\x52\x41\x43\x54\x2c\ +\x20\x53\x54\x52\x49\x43\x54\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\ +\x59\x2c\x20\x4f\x52\x20\x54\x4f\x52\x54\x0a\x20\x20\x28\x49\x4e\ +\x43\x4c\x55\x44\x49\x4e\x47\x20\x4e\x45\x47\x4c\x49\x47\x45\x4e\ +\x43\x45\x20\x4f\x52\x20\x4f\x54\x48\x45\x52\x57\x49\x53\x45\x29\ +\x20\x41\x52\x49\x53\x49\x4e\x47\x20\x49\x4e\x20\x41\x4e\x59\x20\ +\x57\x41\x59\x20\x4f\x55\x54\x20\x4f\x46\x20\x54\x48\x45\x20\x55\ +\x53\x45\x20\x4f\x46\x0a\x20\x20\x54\x48\x49\x53\x20\x53\x4f\x46\ +\x54\x57\x41\x52\x45\x2c\x20\x45\x56\x45\x4e\x20\x49\x46\x20\x41\ +\x44\x56\x49\x53\x45\x44\x20\x4f\x46\x20\x54\x48\x45\x20\x50\x4f\ +\x53\x53\x49\x42\x49\x4c\x49\x54\x59\x20\x4f\x46\x20\x53\x55\x43\ +\x48\x20\x44\x41\x4d\x41\x47\x45\x2e\x0a\x2a\x2f\x0a\x0a\x65\x78\ +\x70\x6f\x72\x74\x73\x2e\x63\x72\x65\x61\x74\x65\x20\x3d\x20\x66\ +\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x6f\x70\x74\x73\x29\x20\x7b\ +\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x70\x61\x67\x65\x20\x3d\x20\ +\x70\x68\x61\x6e\x74\x6f\x6d\x2e\x63\x72\x65\x61\x74\x65\x57\x65\ +\x62\x50\x61\x67\x65\x28\x29\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x68\x61\x6e\x64\x6c\x65\x72\x73\x20\x3d\x20\x7b\x7d\x3b\x0a\ +\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x63\x68\ +\x65\x63\x6b\x54\x79\x70\x65\x28\x6f\x2c\x20\x74\x79\x70\x65\x29\ +\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\ +\x6e\x20\x74\x79\x70\x65\x6f\x66\x20\x6f\x20\x3d\x3d\x3d\x20\x74\ +\x79\x70\x65\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\ +\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x69\x73\x4f\x62\x6a\x65\x63\ +\x74\x28\x6f\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\ +\x65\x74\x75\x72\x6e\x20\x63\x68\x65\x63\x6b\x54\x79\x70\x65\x28\ +\x6f\x2c\x20\x27\x6f\x62\x6a\x65\x63\x74\x27\x29\x3b\x0a\x20\x20\ +\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\ +\x6e\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x28\x6f\x29\ +\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\ +\x6e\x20\x63\x68\x65\x63\x6b\x54\x79\x70\x65\x28\x6f\x2c\x20\x27\ +\x75\x6e\x64\x65\x66\x69\x6e\x65\x64\x27\x29\x3b\x0a\x20\x20\x20\ +\x20\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\ +\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\x4f\x72\x4e\x75\ +\x6c\x6c\x28\x6f\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x72\x65\x74\x75\x72\x6e\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\ +\x65\x64\x28\x6f\x29\x20\x7c\x7c\x20\x6e\x75\x6c\x6c\x20\x3d\x3d\ +\x3d\x20\x6f\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\ +\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x63\x6f\x70\x79\x49\x6e\x74\ +\x6f\x28\x74\x61\x72\x67\x65\x74\x2c\x20\x73\x6f\x75\x72\x63\x65\ +\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\ +\x74\x61\x72\x67\x65\x74\x20\x3d\x3d\x3d\x20\x73\x6f\x75\x72\x63\ +\x65\x20\x7c\x7c\x20\x69\x73\x55\x6e\x64\x65\x66\x69\x6e\x65\x64\ +\x4f\x72\x4e\x75\x6c\x6c\x28\x73\x6f\x75\x72\x63\x65\x29\x29\x20\ +\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\ +\x74\x75\x72\x6e\x20\x74\x61\x72\x67\x65\x74\x3b\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x74\x61\x72\x67\x65\x74\x20\x3d\x20\x74\x61\x72\x67\x65\x74\x20\ +\x7c\x7c\x20\x7b\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x2f\x2f\x20\x43\x6f\x70\x79\x20\x69\x6e\x74\x6f\x20\x6f\x62\x6a\ +\x65\x63\x74\x73\x20\x6f\x6e\x6c\x79\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x69\x66\x20\x28\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x74\ +\x61\x72\x67\x65\x74\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x4d\x61\x6b\x65\x20\x73\x75\ +\x72\x65\x20\x73\x6f\x75\x72\x63\x65\x20\x65\x78\x69\x73\x74\x73\ +\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x73\x6f\x75\ +\x72\x63\x65\x20\x3d\x20\x73\x6f\x75\x72\x63\x65\x20\x7c\x7c\x20\ +\x7b\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x69\x66\x20\x28\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x73\x6f\ +\x75\x72\x63\x65\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76\x61\x72\x20\x69\x2c\x20\ +\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x2c\x20\x6e\x65\x77\x53\x6f\ +\x75\x72\x63\x65\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x66\x6f\x72\x20\x28\x69\x20\x69\x6e\x20\ +\x73\x6f\x75\x72\x63\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\ +\x20\x28\x73\x6f\x75\x72\x63\x65\x2e\x68\x61\x73\x4f\x77\x6e\x50\ +\x72\x6f\x70\x65\x72\x74\x79\x28\x69\x29\x29\x20\x7b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x20\ +\x3d\x20\x74\x61\x72\x67\x65\x74\x5b\x69\x5d\x3b\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\x65\x20\x3d\ +\x20\x73\x6f\x75\x72\x63\x65\x5b\x69\x5d\x3b\x0a\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x69\x66\x20\x28\x6e\x65\x77\x54\x61\x72\x67\ +\x65\x74\x20\x26\x26\x20\x69\x73\x4f\x62\x6a\x65\x63\x74\x28\x6e\ +\x65\x77\x53\x6f\x75\x72\x63\x65\x29\x29\x20\x7b\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x44\x65\x65\x70\ +\x20\x63\x6f\x70\x79\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x20\x3d\x20\x63\x6f\ +\x70\x79\x49\x6e\x74\x6f\x28\x74\x61\x72\x67\x65\x74\x5b\x69\x5d\ +\x2c\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\x65\x29\x3b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x7b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x6e\x65\x77\x54\x61\ +\x72\x67\x65\x74\x20\x3d\x20\x6e\x65\x77\x53\x6f\x75\x72\x63\x65\ +\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x69\x66\x20\x28\x21\x69\x73\x55\x6e\x64\x65\ +\x66\x69\x6e\x65\x64\x28\x6e\x65\x77\x54\x61\x72\x67\x65\x74\x29\ +\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x74\x61\x72\x67\x65\x74\x5b\x69\x5d\x20\x3d\x20\x6e\x65\x77\x54\ +\x61\x72\x67\x65\x74\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\ +\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x7b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x61\ +\x72\x67\x65\x74\x20\x3d\x20\x73\x6f\x75\x72\x63\x65\x3b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x72\x65\x74\x75\x72\x6e\x20\x74\x61\x72\x67\x65\x74\x3b\x0a\x20\ +\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69\ +\x6f\x6e\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\ +\x68\x61\x6e\x64\x6c\x65\x72\x4e\x61\x6d\x65\x2c\x20\x73\x69\x67\ +\x6e\x61\x6c\x4e\x61\x6d\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x70\x61\x67\x65\x2e\x5f\x5f\x64\x65\x66\x69\x6e\x65\ +\x53\x65\x74\x74\x65\x72\x5f\x5f\x28\x68\x61\x6e\x64\x6c\x65\x72\ +\x4e\x61\x6d\x65\x2c\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\ +\x66\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x69\x66\x20\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x20\x26\x26\ +\x20\x74\x79\x70\x65\x6f\x66\x20\x68\x61\x6e\x64\x6c\x65\x72\x73\ +\x5b\x73\x69\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x20\x3d\x3d\x3d\ +\x20\x27\x66\x75\x6e\x63\x74\x69\x6f\x6e\x27\x29\x20\x7b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\ +\x72\x79\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x5b\x73\x69\ +\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x2e\x64\x69\x73\x63\x6f\x6e\ +\x6e\x65\x63\x74\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\ +\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x29\x3b\x0a\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x63\x61\ +\x74\x63\x68\x20\x28\x65\x29\x20\x7b\x7d\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\ +\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x20\x3d\x20\x66\x3b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x5b\ +\x73\x69\x67\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x2e\x63\x6f\x6e\x6e\ +\x65\x63\x74\x28\x68\x61\x6e\x64\x6c\x65\x72\x73\x5b\x73\x69\x67\ +\x6e\x61\x6c\x4e\x61\x6d\x65\x5d\x29\x3b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x7d\x29\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\ +\x20\x20\x2f\x2f\x20\x64\x65\x65\x70\x20\x63\x6f\x70\x79\x0a\x20\ +\x20\x20\x20\x70\x61\x67\x65\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\ +\x20\x3d\x20\x4a\x53\x4f\x4e\x2e\x70\x61\x72\x73\x65\x28\x4a\x53\ +\x4f\x4e\x2e\x73\x74\x72\x69\x6e\x67\x69\x66\x79\x28\x70\x68\x61\ +\x6e\x74\x6f\x6d\x2e\x64\x65\x66\x61\x75\x6c\x74\x50\x61\x67\x65\ +\x53\x65\x74\x74\x69\x6e\x67\x73\x29\x29\x3b\x0a\x0a\x20\x20\x20\ +\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\ +\x6e\x49\x6e\x69\x74\x69\x61\x6c\x69\x7a\x65\x64\x22\x2c\x20\x22\ +\x69\x6e\x69\x74\x69\x61\x6c\x69\x7a\x65\x64\x22\x29\x3b\x0a\x0a\ +\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\x74\x65\x72\ +\x28\x22\x6f\x6e\x4c\x6f\x61\x64\x53\x74\x61\x72\x74\x65\x64\x22\ +\x2c\x20\x22\x6c\x6f\x61\x64\x53\x74\x61\x72\x74\x65\x64\x22\x29\ +\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\x74\ +\x74\x65\x72\x28\x22\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\ +\x68\x65\x64\x22\x2c\x20\x22\x6c\x6f\x61\x64\x46\x69\x6e\x69\x73\ +\x68\x65\x64\x22\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\ +\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x52\x65\x73\x6f\ +\x75\x72\x63\x65\x52\x65\x71\x75\x65\x73\x74\x65\x64\x22\x2c\x20\ +\x22\x72\x65\x73\x6f\x75\x72\x63\x65\x52\x65\x71\x75\x65\x73\x74\ +\x65\x64\x22\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\ +\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x52\x65\x73\x6f\x75\ +\x72\x63\x65\x52\x65\x63\x65\x69\x76\x65\x64\x22\x2c\x20\x22\x72\ +\x65\x73\x6f\x75\x72\x63\x65\x52\x65\x63\x65\x69\x76\x65\x64\x22\ +\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\x69\x6e\x65\x53\x65\ +\x74\x74\x65\x72\x28\x22\x6f\x6e\x41\x6c\x65\x72\x74\x22\x2c\x20\ +\x22\x6a\x61\x76\x61\x53\x63\x72\x69\x70\x74\x41\x6c\x65\x72\x74\ +\x53\x65\x6e\x74\x22\x29\x3b\x0a\x0a\x20\x20\x20\x20\x64\x65\x66\ +\x69\x6e\x65\x53\x65\x74\x74\x65\x72\x28\x22\x6f\x6e\x43\x6f\x6e\ +\x73\x6f\x6c\x65\x4d\x65\x73\x73\x61\x67\x65\x22\x2c\x20\x22\x6a\ +\x61\x76\x61\x53\x63\x72\x69\x70\x74\x43\x6f\x6e\x73\x6f\x6c\x65\ +\x4d\x65\x73\x73\x61\x67\x65\x53\x65\x6e\x74\x22\x29\x3b\x0a\x0a\ +\x20\x20\x20\x20\x70\x61\x67\x65\x2e\x6f\x70\x65\x6e\x20\x3d\x20\ +\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x75\x72\x6c\x2c\x20\x61\ +\x72\x67\x31\x2c\x20\x61\x72\x67\x32\x2c\x20\x61\x72\x67\x33\x2c\ +\x20\x61\x72\x67\x34\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\x6c\ +\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x31\x29\x20\x7b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\ +\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x27\x67\x65\ +\x74\x27\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\ +\x73\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x72\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x61\x72\ +\x67\x75\x6d\x65\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\ +\x3d\x3d\x20\x32\x20\x26\x26\x20\x74\x79\x70\x65\x6f\x66\x20\x61\ +\x72\x67\x31\x20\x3d\x3d\x3d\x20\x27\x66\x75\x6e\x63\x74\x69\x6f\ +\x6e\x27\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x74\x68\x69\x73\x2e\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\ +\x69\x73\x68\x65\x64\x20\x3d\x20\x61\x72\x67\x31\x3b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\ +\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x27\x67\x65\x74\ +\x27\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\ +\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\ +\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\ +\x20\x65\x6c\x73\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\ +\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x32\ +\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x74\x68\x69\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\ +\x2c\x20\x61\x72\x67\x31\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\ +\x74\x69\x6e\x67\x73\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\ +\x20\x20\x20\x20\x7d\x20\x65\x6c\x73\x65\x20\x69\x66\x20\x28\x61\ +\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\ +\x3d\x3d\x3d\x20\x33\x20\x26\x26\x20\x74\x79\x70\x65\x6f\x66\x20\ +\x61\x72\x67\x32\x20\x3d\x3d\x3d\x20\x27\x66\x75\x6e\x63\x74\x69\ +\x6f\x6e\x27\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x6e\x4c\x6f\x61\x64\x46\x69\ +\x6e\x69\x73\x68\x65\x64\x20\x3d\x20\x61\x72\x67\x32\x3b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\ +\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\x2c\x20\x61\x72\x67\ +\x31\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\ +\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\ +\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\ +\x20\x65\x6c\x73\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\ +\x6e\x74\x73\x2e\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x33\ +\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x74\x68\x69\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\x28\x75\x72\x6c\ +\x2c\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x6f\x70\x65\x72\x61\x74\x69\x6f\x6e\x3a\x20\x61\ +\x72\x67\x31\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x64\x61\x74\x61\x3a\x20\x61\x72\x67\x32\x0a\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x2c\x20\x74\ +\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\x29\x3b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75\x72\ +\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x65\x6c\x73\ +\x65\x20\x69\x66\x20\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\x73\x2e\ +\x6c\x65\x6e\x67\x74\x68\x20\x3d\x3d\x3d\x20\x34\x29\x20\x7b\x0a\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\ +\x2e\x6f\x6e\x4c\x6f\x61\x64\x46\x69\x6e\x69\x73\x68\x65\x64\x20\ +\x3d\x20\x61\x72\x67\x33\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6f\x70\x65\x6e\x55\x72\x6c\ +\x28\x75\x72\x6c\x2c\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x6f\x70\x65\x72\x61\x74\x69\x6f\ +\x6e\x3a\x20\x61\x72\x67\x31\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x64\x61\x74\x61\x3a\x20\x61\ +\x72\x67\x32\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x7d\x2c\x20\x74\x68\x69\x73\x2e\x73\x65\x74\x74\x69\x6e\x67\x73\ +\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\ +\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x7d\ +\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\x22\ +\x57\x72\x6f\x6e\x67\x20\x75\x73\x65\x20\x6f\x66\x20\x57\x65\x62\ +\x50\x61\x67\x65\x23\x6f\x70\x65\x6e\x22\x3b\x0a\x20\x20\x20\x20\ +\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x70\x61\x67\x65\x2e\x69\x6e\x63\ +\x6c\x75\x64\x65\x4a\x73\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\ +\x6e\x20\x28\x73\x63\x72\x69\x70\x74\x55\x72\x6c\x2c\x20\x6f\x6e\ +\x53\x63\x72\x69\x70\x74\x4c\x6f\x61\x64\x65\x64\x29\x20\x7b\x0a\ +\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x52\x65\x67\x69\x73\ +\x74\x65\x72\x20\x74\x65\x6d\x70\x6f\x72\x61\x72\x79\x20\x73\x69\ +\x67\x6e\x61\x6c\x20\x68\x61\x6e\x64\x6c\x65\x72\x20\x66\x6f\x72\ +\x20\x27\x61\x6c\x65\x72\x74\x28\x29\x27\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x74\x68\x69\x73\x2e\x6a\x61\x76\x61\x53\x63\x72\x69\ +\x70\x74\x41\x6c\x65\x72\x74\x53\x65\x6e\x74\x2e\x63\x6f\x6e\x6e\ +\x65\x63\x74\x28\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x6d\x73\ +\x67\x46\x72\x6f\x6d\x41\x6c\x65\x72\x74\x29\x20\x7b\x0a\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x66\x20\x28\x6d\x73\ +\x67\x46\x72\x6f\x6d\x41\x6c\x65\x72\x74\x20\x3d\x3d\x3d\x20\x73\ +\x63\x72\x69\x70\x74\x55\x72\x6c\x29\x20\x7b\x0a\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\x52\ +\x65\x73\x6f\x75\x72\x63\x65\x20\x6c\x6f\x61\x64\x65\x64\x2c\x20\ +\x74\x69\x6d\x65\x20\x74\x6f\x20\x66\x69\x72\x65\x20\x74\x68\x65\ +\x20\x63\x61\x6c\x6c\x62\x61\x63\x6b\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x6f\x6e\x53\x63\x72\x69\ +\x70\x74\x4c\x6f\x61\x64\x65\x64\x28\x73\x63\x72\x69\x70\x74\x55\ +\x72\x6c\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x2f\x2f\x20\x41\x6e\x64\x20\x64\x69\x73\x63\ +\x6f\x6e\x6e\x65\x63\x74\x20\x74\x68\x65\x20\x73\x69\x67\x6e\x61\ +\x6c\x20\x68\x61\x6e\x64\x6c\x65\x72\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x74\x72\x79\x20\x7b\x0a\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x6a\x61\x76\x61\x53\x63\x72\ +\x69\x70\x74\x41\x6c\x65\x72\x74\x53\x65\x6e\x74\x2e\x64\x69\x73\ +\x63\x6f\x6e\x6e\x65\x63\x74\x28\x61\x72\x67\x75\x6d\x65\x6e\x74\ +\x73\x2e\x63\x61\x6c\x6c\x65\x65\x29\x3b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x20\x63\x61\x74\ +\x63\x68\x20\x28\x65\x29\x20\x7b\x7d\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x7d\x29\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x2f\x2f\x20\ +\x41\x70\x70\x65\x6e\x64\x20\x74\x68\x65\x20\x73\x63\x72\x69\x70\ +\x74\x20\x74\x61\x67\x20\x74\x6f\x20\x74\x68\x65\x20\x62\x6f\x64\ +\x79\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x74\x68\x69\x73\x2e\x5f\ +\x61\x70\x70\x65\x6e\x64\x53\x63\x72\x69\x70\x74\x45\x6c\x65\x6d\ +\x65\x6e\x74\x28\x73\x63\x72\x69\x70\x74\x55\x72\x6c\x29\x3b\x0a\ +\x20\x20\x20\x20\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x2f\x2f\x20\x43\ +\x6f\x70\x79\x20\x6f\x70\x74\x69\x6f\x6e\x73\x20\x69\x6e\x74\x6f\ +\x20\x70\x61\x67\x65\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x6f\x70\ +\x74\x73\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x70\x61\ +\x67\x65\x20\x3d\x20\x63\x6f\x70\x79\x49\x6e\x74\x6f\x28\x70\x61\ +\x67\x65\x2c\x20\x6f\x70\x74\x73\x29\x3b\x0a\x20\x20\x20\x20\x7d\ +\x0a\x0a\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x70\x61\x67\ +\x65\x3b\x0a\x7d\x3b\x0a\ +\x00\x00\x13\xc1\ +\x2f\ +\x2a\x6a\x73\x6c\x69\x6e\x74\x20\x73\x6c\x6f\x70\x70\x79\x3a\x20\ +\x74\x72\x75\x65\x2c\x20\x6e\x6f\x6d\x65\x6e\x3a\x20\x74\x72\x75\ +\x65\x20\x2a\x2f\x0a\x2f\x2a\x67\x6c\x6f\x62\x61\x6c\x20\x65\x78\ +\x70\x6f\x72\x74\x73\x3a\x74\x72\x75\x65\x20\x2a\x2f\x0a\x0a\x2f\ +\x2a\x0a\x20\x20\x54\x68\x69\x73\x20\x66\x69\x6c\x65\x20\x69\x73\ +\x20\x70\x61\x72\x74\x20\x6f\x66\x20\x74\x68\x65\x20\x50\x68\x61\ +\x6e\x74\x6f\x6d\x4a\x53\x20\x70\x72\x6f\x6a\x65\x63\x74\x20\x66\ +\x72\x6f\x6d\x20\x4f\x66\x69\x20\x4c\x61\x62\x73\x2e\x0a\x0a\x20\ +\x20\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x32\ +\x30\x31\x31\x20\x49\x76\x61\x6e\x20\x44\x65\x20\x4d\x61\x72\x69\ +\x6e\x6f\x20\x3c\x69\x76\x61\x6e\x2e\x64\x65\x2e\x6d\x61\x72\x69\ +\x6e\x6f\x40\x67\x6d\x61\x69\x6c\x2e\x63\x6f\x6d\x3e\x0a\x0a\x20\ +\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\x20\ +\x61\x6e\x64\x20\x75\x73\x65\x20\x69\x6e\x20\x73\x6f\x75\x72\x63\ +\x65\x20\x61\x6e\x64\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\ +\x6d\x73\x2c\x20\x77\x69\x74\x68\x20\x6f\x72\x20\x77\x69\x74\x68\ +\x6f\x75\x74\x0a\x20\x20\x6d\x6f\x64\x69\x66\x69\x63\x61\x74\x69\ +\x6f\x6e\x2c\x20\x61\x72\x65\x20\x70\x65\x72\x6d\x69\x74\x74\x65\ +\x64\x20\x70\x72\x6f\x76\x69\x64\x65\x64\x20\x74\x68\x61\x74\x20\ +\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x63\x6f\ +\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x72\x65\x20\x6d\x65\x74\ +\x3a\x0a\x0a\x20\x20\x20\x20\x2a\x20\x52\x65\x64\x69\x73\x74\x72\ +\x69\x62\x75\x74\x69\x6f\x6e\x73\x20\x6f\x66\x20\x73\x6f\x75\x72\ +\x63\x65\x20\x63\x6f\x64\x65\x20\x6d\x75\x73\x74\x20\x72\x65\x74\ +\x61\x69\x6e\x20\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\ +\x70\x79\x72\x69\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\ +\x74\x69\x63\x65\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\ +\x6f\x66\x20\x63\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\ +\x64\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\ +\x64\x69\x73\x63\x6c\x61\x69\x6d\x65\x72\x2e\x0a\x20\x20\x20\x20\ +\x2a\x20\x52\x65\x64\x69\x73\x74\x72\x69\x62\x75\x74\x69\x6f\x6e\ +\x73\x20\x69\x6e\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x6f\x72\x6d\ +\x20\x6d\x75\x73\x74\x20\x72\x65\x70\x72\x6f\x64\x75\x63\x65\x20\ +\x74\x68\x65\x20\x61\x62\x6f\x76\x65\x20\x63\x6f\x70\x79\x72\x69\ +\x67\x68\x74\x0a\x20\x20\x20\x20\x20\x20\x6e\x6f\x74\x69\x63\x65\ +\x2c\x20\x74\x68\x69\x73\x20\x6c\x69\x73\x74\x20\x6f\x66\x20\x63\ +\x6f\x6e\x64\x69\x74\x69\x6f\x6e\x73\x20\x61\x6e\x64\x20\x74\x68\ +\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x64\x69\x73\x63\ +\x6c\x61\x69\x6d\x65\x72\x20\x69\x6e\x20\x74\x68\x65\x0a\x20\x20\ +\x20\x20\x20\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x61\x74\x69\x6f\ +\x6e\x20\x61\x6e\x64\x2f\x6f\x72\x20\x6f\x74\x68\x65\x72\x20\x6d\ +\x61\x74\x65\x72\x69\x61\x6c\x73\x20\x70\x72\x6f\x76\x69\x64\x65\ +\x64\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x64\x69\x73\x74\x72\ +\x69\x62\x75\x74\x69\x6f\x6e\x2e\x0a\x20\x20\x20\x20\x2a\x20\x4e\ +\x65\x69\x74\x68\x65\x72\x20\x74\x68\x65\x20\x6e\x61\x6d\x65\x20\ +\x6f\x66\x20\x74\x68\x65\x20\x3c\x6f\x72\x67\x61\x6e\x69\x7a\x61\ +\x74\x69\x6f\x6e\x3e\x20\x6e\x6f\x72\x20\x74\x68\x65\x0a\x20\x20\ +\x20\x20\x20\x20\x6e\x61\x6d\x65\x73\x20\x6f\x66\x20\x69\x74\x73\ +\x20\x63\x6f\x6e\x74\x72\x69\x62\x75\x74\x6f\x72\x73\x20\x6d\x61\ +\x79\x20\x62\x65\x20\x75\x73\x65\x64\x20\x74\x6f\x20\x65\x6e\x64\ +\x6f\x72\x73\x65\x20\x6f\x72\x20\x70\x72\x6f\x6d\x6f\x74\x65\x20\ +\x70\x72\x6f\x64\x75\x63\x74\x73\x0a\x20\x20\x20\x20\x20\x20\x64\ +\x65\x72\x69\x76\x65\x64\x20\x66\x72\x6f\x6d\x20\x74\x68\x69\x73\ +\x20\x73\x6f\x66\x74\x77\x61\x72\x65\x20\x77\x69\x74\x68\x6f\x75\ +\x74\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x70\x72\x69\x6f\x72\ +\x20\x77\x72\x69\x74\x74\x65\x6e\x20\x70\x65\x72\x6d\x69\x73\x73\ +\x69\x6f\x6e\x2e\x0a\x0a\x20\x20\x54\x48\x49\x53\x20\x53\x4f\x46\ +\x54\x57\x41\x52\x45\x20\x49\x53\x20\x50\x52\x4f\x56\x49\x44\x45\ +\x44\x20\x42\x59\x20\x54\x48\x45\x20\x43\x4f\x50\x59\x52\x49\x47\ +\x48\x54\x20\x48\x4f\x4c\x44\x45\x52\x53\x20\x41\x4e\x44\x20\x43\ +\x4f\x4e\x54\x52\x49\x42\x55\x54\x4f\x52\x53\x20\x22\x41\x53\x20\ +\x49\x53\x22\x0a\x20\x20\x41\x4e\x44\x20\x41\x4e\x59\x20\x45\x58\ +\x50\x52\x45\x53\x53\x20\x4f\x52\x20\x49\x4d\x50\x4c\x49\x45\x44\ +\x20\x57\x41\x52\x52\x41\x4e\x54\x49\x45\x53\x2c\x20\x49\x4e\x43\ +\x4c\x55\x44\x49\x4e\x47\x2c\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\ +\x4c\x49\x4d\x49\x54\x45\x44\x20\x54\x4f\x2c\x20\x54\x48\x45\x0a\ +\x20\x20\x49\x4d\x50\x4c\x49\x45\x44\x20\x57\x41\x52\x52\x41\x4e\ +\x54\x49\x45\x53\x20\x4f\x46\x20\x4d\x45\x52\x43\x48\x41\x4e\x54\ +\x41\x42\x49\x4c\x49\x54\x59\x20\x41\x4e\x44\x20\x46\x49\x54\x4e\ +\x45\x53\x53\x20\x46\x4f\x52\x20\x41\x20\x50\x41\x52\x54\x49\x43\ +\x55\x4c\x41\x52\x20\x50\x55\x52\x50\x4f\x53\x45\x0a\x20\x20\x41\ +\x52\x45\x20\x44\x49\x53\x43\x4c\x41\x49\x4d\x45\x44\x2e\x20\x49\ +\x4e\x20\x4e\x4f\x20\x45\x56\x45\x4e\x54\x20\x53\x48\x41\x4c\x4c\ +\x20\x3c\x43\x4f\x50\x59\x52\x49\x47\x48\x54\x20\x48\x4f\x4c\x44\ +\x45\x52\x3e\x20\x42\x45\x20\x4c\x49\x41\x42\x4c\x45\x20\x46\x4f\ +\x52\x20\x41\x4e\x59\x0a\x20\x20\x44\x49\x52\x45\x43\x54\x2c\x20\ +\x49\x4e\x44\x49\x52\x45\x43\x54\x2c\x20\x49\x4e\x43\x49\x44\x45\ +\x4e\x54\x41\x4c\x2c\x20\x53\x50\x45\x43\x49\x41\x4c\x2c\x20\x45\ +\x58\x45\x4d\x50\x4c\x41\x52\x59\x2c\x20\x4f\x52\x20\x43\x4f\x4e\ +\x53\x45\x51\x55\x45\x4e\x54\x49\x41\x4c\x20\x44\x41\x4d\x41\x47\ +\x45\x53\x0a\x20\x20\x28\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x2c\ +\x20\x42\x55\x54\x20\x4e\x4f\x54\x20\x4c\x49\x4d\x49\x54\x45\x44\ +\x20\x54\x4f\x2c\x20\x50\x52\x4f\x43\x55\x52\x45\x4d\x45\x4e\x54\ +\x20\x4f\x46\x20\x53\x55\x42\x53\x54\x49\x54\x55\x54\x45\x20\x47\ +\x4f\x4f\x44\x53\x20\x4f\x52\x20\x53\x45\x52\x56\x49\x43\x45\x53\ +\x3b\x0a\x20\x20\x4c\x4f\x53\x53\x20\x4f\x46\x20\x55\x53\x45\x2c\ +\x20\x44\x41\x54\x41\x2c\x20\x4f\x52\x20\x50\x52\x4f\x46\x49\x54\ +\x53\x3b\x20\x4f\x52\x20\x42\x55\x53\x49\x4e\x45\x53\x53\x20\x49\ +\x4e\x54\x45\x52\x52\x55\x50\x54\x49\x4f\x4e\x29\x20\x48\x4f\x57\ +\x45\x56\x45\x52\x20\x43\x41\x55\x53\x45\x44\x20\x41\x4e\x44\x0a\ +\x20\x20\x4f\x4e\x20\x41\x4e\x59\x20\x54\x48\x45\x4f\x52\x59\x20\ +\x4f\x46\x20\x4c\x49\x41\x42\x49\x4c\x49\x54\x59\x2c\x20\x57\x48\ +\x45\x54\x48\x45\x52\x20\x49\x4e\x20\x43\x4f\x4e\x54\x52\x41\x43\ +\x54\x2c\x20\x53\x54\x52\x49\x43\x54\x20\x4c\x49\x41\x42\x49\x4c\ +\x49\x54\x59\x2c\x20\x4f\x52\x20\x54\x4f\x52\x54\x0a\x20\x20\x28\ +\x49\x4e\x43\x4c\x55\x44\x49\x4e\x47\x20\x4e\x45\x47\x4c\x49\x47\ +\x45\x4e\x43\x45\x20\x4f\x52\x20\x4f\x54\x48\x45\x52\x57\x49\x53\ +\x45\x29\x20\x41\x52\x49\x53\x49\x4e\x47\x20\x49\x4e\x20\x41\x4e\ +\x59\x20\x57\x41\x59\x20\x4f\x55\x54\x20\x4f\x46\x20\x54\x48\x45\ +\x20\x55\x53\x45\x20\x4f\x46\x0a\x20\x20\x54\x48\x49\x53\x20\x53\ +\x4f\x46\x54\x57\x41\x52\x45\x2c\x20\x45\x56\x45\x4e\x20\x49\x46\ +\x20\x41\x44\x56\x49\x53\x45\x44\x20\x4f\x46\x20\x54\x48\x45\x20\ +\x50\x4f\x53\x53\x49\x42\x49\x4c\x49\x54\x59\x20\x4f\x46\x20\x53\ +\x55\x43\x48\x20\x44\x41\x4d\x41\x47\x45\x2e\x0a\x2a\x2f\x0a\x0a\ +\x2f\x2f\x20\x4a\x61\x76\x61\x53\x63\x72\x69\x70\x74\x20\x22\x73\ +\x68\x69\x6d\x22\x20\x74\x6f\x20\x74\x68\x72\x6f\x77\x20\x65\x78\ +\x63\x65\x70\x74\x69\x6f\x6e\x73\x20\x69\x6e\x20\x63\x61\x73\x65\ +\x20\x61\x20\x63\x72\x69\x74\x69\x63\x61\x6c\x20\x6f\x70\x65\x72\ +\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x73\x2e\x0a\x0a\x2f\x2a\ +\x2a\x20\x4f\x70\x65\x6e\x20\x61\x6e\x64\x20\x72\x65\x74\x75\x72\ +\x6e\x20\x61\x20\x22\x66\x69\x6c\x65\x22\x20\x6f\x62\x6a\x65\x63\ +\x74\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\ +\x72\x6f\x77\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\ +\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\ +\x20\x40\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\ +\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\ +\x20\x6f\x70\x65\x6e\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\ +\x6d\x6f\x64\x65\x20\x4f\x70\x65\x6e\x20\x4d\x6f\x64\x65\x2e\x20\ +\x41\x20\x73\x74\x72\x69\x6e\x67\x20\x6d\x61\x64\x65\x20\x6f\x66\ +\x20\x27\x72\x27\x2c\x20\x27\x77\x27\x2c\x20\x27\x61\x2f\x2b\x27\ +\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x2e\x0a\x20\x2a\x20\ +\x40\x72\x65\x74\x75\x72\x6e\x20\x22\x66\x69\x6c\x65\x22\x20\x6f\ +\x62\x6a\x65\x63\x74\x0a\x20\x2a\x2f\x0a\x65\x78\x70\x6f\x72\x74\ +\x73\x2e\x6f\x70\x65\x6e\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\ +\x6e\x20\x28\x70\x61\x74\x68\x2c\x20\x6d\x6f\x64\x65\x29\x20\x7b\ +\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x66\x69\x6c\x65\x20\x3d\x20\ +\x65\x78\x70\x6f\x72\x74\x73\x2e\x5f\x6f\x70\x65\x6e\x28\x70\x61\ +\x74\x68\x2c\x20\x6d\x6f\x64\x65\x29\x3b\x0a\x20\x20\x20\x20\x69\ +\x66\x20\x28\x66\x69\x6c\x65\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x66\x69\x6c\x65\x3b\x0a\ +\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\ +\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\x6f\x70\x65\x6e\x20\ +\x66\x69\x6c\x65\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\ +\x20\x22\x27\x22\x3b\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x4f\x70\ +\x65\x6e\x2c\x20\x72\x65\x61\x64\x20\x61\x6e\x64\x20\x72\x65\x74\ +\x75\x72\x6e\x20\x63\x6f\x6e\x74\x65\x6e\x74\x20\x6f\x66\x20\x61\ +\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\ +\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\ +\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\ +\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\ +\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\ +\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\x64\x20\x66\x72\x6f\ +\x6d\x0a\x20\x2a\x20\x40\x72\x65\x74\x75\x72\x6e\x20\x66\x69\x6c\ +\x65\x20\x63\x6f\x6e\x74\x65\x6e\x74\x0a\x20\x2a\x2f\x0a\x65\x78\ +\x70\x6f\x72\x74\x73\x2e\x72\x65\x61\x64\x20\x3d\x20\x66\x75\x6e\ +\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\x20\ +\x20\x20\x20\x76\x61\x72\x20\x66\x20\x3d\x20\x65\x78\x70\x6f\x72\ +\x74\x73\x2e\x6f\x70\x65\x6e\x28\x70\x61\x74\x68\x2c\x20\x27\x72\ +\x27\x29\x2c\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x63\x6f\x6e\x74\ +\x65\x6e\x74\x20\x3d\x20\x66\x2e\x72\x65\x61\x64\x28\x29\x3b\x0a\ +\x0a\x20\x20\x20\x20\x66\x2e\x63\x6c\x6f\x73\x65\x28\x29\x3b\x0a\ +\x20\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x63\x6f\x6e\x74\x65\ +\x6e\x74\x3b\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x4f\x70\x65\x6e\ +\x20\x61\x6e\x64\x20\x77\x72\x69\x74\x65\x20\x63\x6f\x6e\x74\x65\ +\x6e\x74\x20\x74\x6f\x20\x61\x20\x66\x69\x6c\x65\x0a\x20\x2a\x20\ +\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\ +\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\ +\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\ +\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\ +\x66\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\ +\x61\x64\x20\x66\x72\x6f\x6d\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\ +\x6d\x20\x63\x6f\x6e\x74\x65\x6e\x74\x20\x43\x6f\x6e\x74\x65\x6e\ +\x74\x20\x74\x6f\x20\x77\x72\x69\x74\x65\x20\x74\x6f\x20\x74\x68\ +\x65\x20\x66\x69\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\ +\x20\x6d\x6f\x64\x65\x20\x4f\x70\x65\x6e\x20\x4d\x6f\x64\x65\x2e\ +\x20\x41\x20\x73\x74\x72\x69\x6e\x67\x20\x6d\x61\x64\x65\x20\x6f\ +\x66\x20\x27\x77\x27\x20\x6f\x72\x20\x27\x61\x20\x2f\x20\x2b\x27\ +\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x2e\x0a\x20\x2a\x2f\ +\x0a\x65\x78\x70\x6f\x72\x74\x73\x2e\x77\x72\x69\x74\x65\x20\x3d\ +\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x2c\ +\x20\x63\x6f\x6e\x74\x65\x6e\x74\x2c\x20\x6d\x6f\x64\x65\x29\x20\ +\x7b\x0a\x20\x20\x20\x20\x76\x61\x72\x20\x66\x20\x3d\x20\x65\x78\ +\x70\x6f\x72\x74\x73\x2e\x6f\x70\x65\x6e\x28\x70\x61\x74\x68\x2c\ +\x20\x6d\x6f\x64\x65\x29\x3b\x0a\x0a\x20\x20\x20\x20\x66\x2e\x77\ +\x72\x69\x74\x65\x28\x63\x6f\x6e\x74\x65\x6e\x74\x29\x3b\x0a\x20\ +\x20\x20\x20\x66\x2e\x63\x6c\x6f\x73\x65\x28\x29\x3b\x0a\x7d\x3b\ +\x0a\x0a\x2f\x2a\x2a\x20\x52\x65\x74\x75\x72\x6e\x20\x74\x68\x65\ +\x20\x73\x69\x7a\x65\x20\x6f\x66\x20\x61\x20\x66\x69\x6c\x65\x2c\ +\x20\x69\x6e\x20\x62\x79\x74\x65\x73\x2e\x0a\x20\x2a\x20\x49\x74\ +\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\x65\ +\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\x66\ +\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\x72\ +\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\x20\ +\x74\x68\x65\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\x64\ +\x20\x74\x68\x65\x20\x73\x69\x7a\x65\x20\x6f\x66\x0a\x20\x2a\x20\ +\x40\x72\x65\x74\x75\x72\x6e\x20\x46\x69\x6c\x65\x20\x73\x69\x7a\ +\x65\x20\x69\x6e\x20\x62\x79\x74\x65\x73\x0a\x20\x2a\x2f\x0a\x65\ +\x78\x70\x6f\x72\x74\x73\x2e\x73\x69\x7a\x65\x20\x3d\x20\x66\x75\ +\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\ +\x20\x20\x20\x20\x76\x61\x72\x20\x73\x69\x7a\x65\x20\x3d\x20\x65\ +\x78\x70\x6f\x72\x74\x73\x2e\x5f\x73\x69\x7a\x65\x28\x70\x61\x74\ +\x68\x29\x3b\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x73\x69\x7a\x65\ +\x20\x21\x3d\x3d\x20\x2d\x31\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\ +\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x20\x73\x69\x7a\x65\x3b\x0a\ +\x20\x20\x20\x20\x7d\x0a\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\ +\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\x72\x65\x61\x64\x20\ +\x66\x69\x6c\x65\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\ +\x20\x22\x27\x20\x73\x69\x7a\x65\x22\x3b\x0a\x7d\x3b\x0a\x0a\x2f\ +\x2a\x2a\x20\x43\x6f\x70\x79\x20\x61\x20\x66\x69\x6c\x65\x2e\x0a\ +\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\ +\x20\x61\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\ +\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\ +\x20\x40\x70\x61\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\x50\ +\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\x63\ +\x65\x20\x66\x69\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\ +\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x50\x61\x74\ +\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x64\x65\x73\x74\x69\x6e\x61\ +\x74\x69\x6f\x6e\x20\x66\x69\x6c\x65\x0a\x20\x2a\x2f\x0a\x65\x78\ +\x70\x6f\x72\x74\x73\x2e\x63\x6f\x70\x79\x20\x3d\x20\x66\x75\x6e\ +\x63\x74\x69\x6f\x6e\x20\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\ +\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x20\x7b\x0a\x20\x20\ +\x20\x20\x69\x66\x20\x28\x21\x65\x78\x70\x6f\x72\x74\x73\x2e\x5f\ +\x63\x6f\x70\x79\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\ +\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x29\x20\x7b\x0a\x20\x20\x20\ +\x20\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\ +\x6c\x65\x20\x74\x6f\x20\x63\x6f\x70\x79\x20\x66\x69\x6c\x65\x20\ +\x27\x22\x20\x2b\x20\x73\x6f\x75\x72\x63\x65\x20\x2b\x20\x22\x27\ +\x20\x61\x74\x20\x27\x22\x20\x2b\x20\x64\x65\x73\x74\x69\x6e\x61\ +\x74\x69\x6f\x6e\x20\x2b\x20\x22\x27\x22\x3b\x0a\x20\x20\x20\x20\ +\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x43\x6f\x70\x79\x20\x61\ +\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x2e\ +\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\ +\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\ +\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\ +\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\ +\x50\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\ +\x63\x65\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\ +\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x64\x65\x73\x74\ +\x69\x6e\x61\x74\x69\x6f\x6e\x20\x50\x61\x74\x68\x20\x6f\x66\x20\ +\x74\x68\x65\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\ +\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x0a\x20\ +\x2a\x2f\x0a\x65\x78\x70\x6f\x72\x74\x73\x2e\x63\x6f\x70\x79\x54\ +\x72\x65\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\ +\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\x74\x69\x6e\x61\x74\ +\x69\x6f\x6e\x29\x20\x7b\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x21\ +\x65\x78\x70\x6f\x72\x74\x73\x2e\x5f\x63\x6f\x70\x79\x54\x72\x65\ +\x65\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\x74\x69\x6e\ +\x61\x74\x69\x6f\x6e\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\ +\x20\x20\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\x20\ +\x74\x6f\x20\x63\x6f\x70\x79\x20\x64\x69\x72\x65\x63\x74\x6f\x72\ +\x79\x20\x74\x72\x65\x65\x20\x27\x22\x20\x2b\x20\x73\x6f\x75\x72\ +\x63\x65\x20\x2b\x20\x22\x27\x20\x61\x74\x20\x27\x22\x20\x2b\x20\ +\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x2b\x20\x22\x27\ +\x22\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\ +\x20\x4d\x6f\x76\x65\x20\x61\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\ +\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\ +\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\ +\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\ +\x70\x61\x72\x61\x6d\x20\x73\x6f\x75\x72\x63\x65\x20\x50\x61\x74\ +\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x73\x6f\x75\x72\x63\x65\x20\ +\x66\x69\x6c\x65\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x64\ +\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x50\x61\x74\x68\x20\ +\x6f\x66\x20\x74\x68\x65\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\ +\x6f\x6e\x20\x66\x69\x6c\x65\x0a\x20\x2a\x2f\x0a\x65\x78\x70\x6f\ +\x72\x74\x73\x2e\x6d\x6f\x76\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\ +\x69\x6f\x6e\x20\x28\x73\x6f\x75\x72\x63\x65\x2c\x20\x64\x65\x73\ +\x74\x69\x6e\x61\x74\x69\x6f\x6e\x29\x20\x7b\x0a\x20\x20\x20\x20\ +\x65\x78\x70\x6f\x72\x74\x73\x2e\x63\x6f\x70\x79\x28\x73\x6f\x75\ +\x72\x63\x65\x2c\x20\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\ +\x29\x3b\x0a\x20\x20\x20\x20\x65\x78\x70\x6f\x72\x74\x73\x2e\x72\ +\x65\x6d\x6f\x76\x65\x28\x73\x6f\x75\x72\x63\x65\x29\x3b\x0a\x7d\ +\x3b\x0a\x0a\x2f\x2a\x2a\x20\x52\x65\x6d\x6f\x76\x65\x73\x20\x61\ +\x20\x66\x69\x6c\x65\x2e\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\ +\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\ +\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\ +\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\ +\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\ +\x66\x69\x6c\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\x20\ +\x2a\x2f\x0a\x65\x78\x70\x6f\x72\x74\x73\x2e\x72\x65\x6d\x6f\x76\ +\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x28\x70\x61\ +\x74\x68\x29\x20\x7b\x0a\x20\x20\x20\x20\x69\x66\x20\x28\x21\x65\ +\x78\x70\x6f\x72\x74\x73\x2e\x5f\x72\x65\x6d\x6f\x76\x65\x28\x70\ +\x61\x74\x68\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\ +\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\x6f\ +\x20\x72\x65\x6d\x6f\x76\x65\x20\x66\x69\x6c\x65\x20\x27\x22\x20\ +\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\x22\x27\x22\x3b\x0a\x20\x20\ +\x20\x20\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\x2a\x20\x52\x65\x6d\x6f\ +\x76\x65\x73\x20\x61\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x2e\ +\x0a\x20\x2a\x20\x49\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\ +\x77\x20\x61\x6e\x20\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\ +\x66\x20\x69\x74\x20\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\ +\x2a\x20\x40\x70\x61\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\ +\x74\x68\x20\x6f\x66\x20\x74\x68\x65\x20\x64\x69\x72\x65\x63\x74\ +\x6f\x72\x79\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\x20\x2a\ +\x2f\x0a\x65\x78\x70\x6f\x72\x74\x73\x2e\x72\x65\x6d\x6f\x76\x65\ +\x44\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x3d\x20\x66\x75\x6e\x63\ +\x74\x69\x6f\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\x20\x20\ +\x20\x20\x69\x66\x20\x28\x21\x65\x78\x70\x6f\x72\x74\x73\x2e\x5f\ +\x72\x65\x6d\x6f\x76\x65\x44\x69\x72\x65\x63\x74\x6f\x72\x79\x28\ +\x70\x61\x74\x68\x29\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\ +\x20\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\x61\x62\x6c\x65\x20\x74\ +\x6f\x20\x72\x65\x6d\x6f\x76\x65\x20\x64\x69\x72\x65\x63\x74\x6f\ +\x72\x79\x20\x27\x22\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\x22\ +\x27\x22\x3b\x0a\x20\x20\x20\x20\x7d\x0a\x7d\x3b\x0a\x0a\x2f\x2a\ +\x2a\x20\x52\x65\x6d\x6f\x76\x65\x73\x20\x61\x20\x64\x69\x72\x65\ +\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x2e\x0a\x20\x2a\x20\x49\ +\x74\x20\x77\x69\x6c\x6c\x20\x74\x68\x72\x6f\x77\x20\x61\x6e\x20\ +\x65\x78\x63\x65\x70\x74\x69\x6f\x6e\x20\x69\x66\x20\x69\x74\x20\ +\x66\x61\x69\x6c\x73\x2e\x0a\x20\x2a\x0a\x20\x2a\x20\x40\x70\x61\ +\x72\x61\x6d\x20\x70\x61\x74\x68\x20\x50\x61\x74\x68\x20\x6f\x66\ +\x20\x74\x68\x65\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\ +\x72\x65\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x0a\x20\x2a\ +\x2f\x0a\x65\x78\x70\x6f\x72\x74\x73\x2e\x72\x65\x6d\x6f\x76\x65\ +\x54\x72\x65\x65\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\ +\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\x20\x20\x20\x20\x69\x66\x20\ +\x28\x21\x65\x78\x70\x6f\x72\x74\x73\x2e\x5f\x72\x65\x6d\x6f\x76\ +\x65\x54\x72\x65\x65\x28\x70\x61\x74\x68\x29\x29\x20\x7b\x0a\x20\ +\x20\x20\x20\x20\x20\x20\x20\x74\x68\x72\x6f\x77\x20\x22\x55\x6e\ +\x61\x62\x6c\x65\x20\x74\x6f\x20\x72\x65\x6d\x6f\x76\x65\x20\x64\ +\x69\x72\x65\x63\x74\x6f\x72\x79\x20\x74\x72\x65\x65\x20\x27\x22\ +\x20\x2b\x20\x70\x61\x74\x68\x20\x2b\x20\x22\x27\x22\x3b\x0a\x20\ +\x20\x20\x20\x7d\x0a\x7d\x3b\x0a\x0a\x65\x78\x70\x6f\x72\x74\x73\ +\x2e\x74\x6f\x75\x63\x68\x20\x3d\x20\x66\x75\x6e\x63\x74\x69\x6f\ +\x6e\x20\x28\x70\x61\x74\x68\x29\x20\x7b\x0a\x20\x20\x20\x20\x65\ +\x78\x70\x6f\x72\x74\x73\x2e\x77\x72\x69\x74\x65\x28\x70\x61\x74\ +\x68\x2c\x20\x22\x22\x2c\x20\x27\x61\x27\x29\x3b\x0a\x7d\x3b\x0a\ +\ " qt_resource_name = "\ +\x00\x07\ +\x04\x5b\xc2\x23\ +\x00\x6d\ +\x00\x6f\x00\x64\x00\x75\x00\x6c\x00\x65\x00\x73\ +\x00\x0c\ +\x06\xa4\xe2\x53\ +\x00\x62\ +\x00\x6f\x00\x6f\x00\x74\x00\x73\x00\x74\x00\x72\x00\x61\x00\x70\x00\x2e\x00\x6a\x00\x73\ \x00\x0f\ \x01\x28\x25\x93\ \x00\x63\ \x00\x6f\x00\x6e\x00\x66\x00\x69\x00\x67\x00\x75\x00\x72\x00\x61\x00\x74\x00\x6f\x00\x72\x00\x2e\x00\x6a\x00\x73\ -\x00\x0f\ -\x0b\x21\xdb\x73\ -\x00\x77\ -\x00\x65\x00\x62\x00\x70\x00\x61\x00\x67\x00\x65\x00\x2d\x00\x73\x00\x68\x00\x69\x00\x6d\x00\x2e\x00\x6a\x00\x73\ -\x00\x12\ -\x03\xfa\x57\x73\ -\x00\x66\ -\x00\x69\x00\x6c\x00\x65\x00\x73\x00\x79\x00\x73\x00\x74\x00\x65\x00\x6d\x00\x2d\x00\x73\x00\x68\x00\x69\x00\x6d\x00\x2e\x00\x6a\ -\x00\x73\ \x00\x09\ \x0a\x6c\x78\x43\ \x00\x72\ @@ -4948,16 +5097,26 @@ \x00\x7d\x71\x73\ \x00\x63\ \x00\x6f\x00\x66\x00\x66\x00\x65\x00\x65\x00\x2d\x00\x73\x00\x63\x00\x72\x00\x69\x00\x70\x00\x74\x00\x2e\x00\x6a\x00\x73\ +\x00\x0a\ +\x06\x72\xf2\x33\ +\x00\x77\ +\x00\x65\x00\x62\x00\x70\x00\x61\x00\x67\x00\x65\x00\x2e\x00\x6a\x00\x73\ +\x00\x05\ +\x00\x6d\x65\x13\ +\x00\x66\ +\x00\x73\x00\x2e\x00\x6a\x00\x73\ " qt_resource_struct = "\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x00\x48\x00\x00\x00\x00\x00\x01\x00\x00\x1a\x16\ -\x00\x00\x00\x72\x00\x02\x00\x00\x00\x02\x00\x00\x00\x05\ -\x00\x00\x00\x24\x00\x00\x00\x00\x00\x01\x00\x00\x01\x1e\ -\x00\x00\x00\xb8\x00\x01\x00\x00\x00\x01\x00\x00\x83\xc2\ -\x00\x00\x00\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x2d\x97\ +\x00\x00\x00\x32\x00\x00\x00\x00\x00\x01\x00\x00\x09\x79\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x07\ +\x00\x00\x00\x14\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x56\x00\x02\x00\x00\x00\x02\x00\x00\x00\x05\ +\x00\x00\x00\x9c\x00\x01\x00\x00\x00\x01\x00\x00\x60\xc2\ +\x00\x00\x00\x6e\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x97\ +\x00\x00\x00\xdc\x00\x00\x00\x00\x00\x01\x00\x01\x27\x85\ +\x00\x00\x00\xc2\x00\x00\x00\x00\x00\x01\x00\x01\x0f\x1a\ " def qInitResources(): diff --git a/python/pyphantomjs/resources.qrc b/python/pyphantomjs/resources.qrc index 410e4247c4..0e23785111 100644 --- a/python/pyphantomjs/resources.qrc +++ b/python/pyphantomjs/resources.qrc @@ -1,8 +1,9 @@ + bootstrap.js configurator.js - filesystem-shim.js - webpage-shim.js + modules/fs.js + modules/webpage.js resources/coffee-script.js resources/pyphantomjs-icon.png diff --git a/python/pyphantomjs/tools/build_binary.py b/python/pyphantomjs/tools/build_binary.py index 308a38e7f8..6e29ddaf54 100644 --- a/python/pyphantomjs/tools/build_binary.py +++ b/python/pyphantomjs/tools/build_binary.py @@ -20,11 +20,12 @@ import os import sys + # hack to import parent module(s) parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path = sys.path + [parent_dir] +sys.path = [parent_dir] + sys.path -from utils import version +from __init__ import __version__ try: from cx_Freeze import setup, Executable @@ -70,9 +71,10 @@ def qt4_plugins_dir(): # to make sure images are supported; jpeg, gif, svg, etc. (os.path.join(qt4_plugin_dir, 'imageformats'), 'imageformats'), (os.path.join(parent_dir, 'plugins'), 'plugins'), - (os.path.join(parent_dir, '../examples' if os.path.exists('../examples') else '../../examples'), 'examples'), + (os.path.join(parent_dir, '../../examples'), 'examples'), (os.path.join(parent_dir, '../LICENSE'), 'LICENSE.txt'), - (os.path.join(parent_dir, '../README.md'), 'README.txt') + (os.path.join(parent_dir, '../README.md'), 'README.txt'), + (os.path.join(parent_dir, '../../ChangeLog'), 'ChangeLog.txt') ] @@ -84,7 +86,7 @@ def qt4_plugins_dir(): setup( name = 'PyPhantomJS', - version = version, + version = __version__, description = 'Minimalistic, headless, WebKit-based, JavaScript-driven tool', options = {'build_exe': {'includes': includes, 'include_files': include_files}}, executables = [exe] diff --git a/python/pyphantomjs/utils.py b/python/pyphantomjs/utils.py index 3062cee550..5e9db315c8 100644 --- a/python/pyphantomjs/utils.py +++ b/python/pyphantomjs/utils.py @@ -22,11 +22,10 @@ import codecs import argparse -from PyQt4.QtCore import (QDateTime, Qt, QtDebugMsg, QtWarningMsg, +from PyQt4.QtCore import (QDateTime, QFile, Qt, QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, qDebug) from __init__ import __version__ -from csconverter import CSConverter from plugincontroller import do_action @@ -86,10 +85,13 @@ def argParser(): choices=['yes', 'no'], help='Load all plugins (i.e. Flash, Silverlight, ...) (default: %(default)s)' ) - parser.add_argument('--local-access-remote', default='no', + parser.add_argument('--local-to-remote-url-access', default='no', choices=['yes', 'no'], help='Local content can access remote URL (default: %(default)s)' ) + parser.add_argument('--max-disk-cache-size', default=-1, metavar='size', + help='Limits the size of disk cache (in KB)' + ) parser.add_argument('--output-encoding', default='System', metavar='encoding', help='Sets the encoding used for terminal output (default: %(default)s)' ) @@ -112,7 +114,11 @@ def argParser(): return parser +CSConverter = None def coffee2js(script): + global CSConverter + if not CSConverter: + from csconverter import CSConverter return CSConverter().convert(script) @@ -183,3 +189,14 @@ def flush(self): def encode(self, s): return s.encode(self.encode_to, self.errors) + + +class QPyFile(QFile): + '''Simple subclass of QFile which supports the context manager''' + def __enter__(self): + if not self.open(QFile.ReadOnly): + raise IOError("Failed to open file '%s'" % self.fileName()) + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() diff --git a/python/pyphantomjs/webpage-shim.js b/python/pyphantomjs/webpage-shim.js index d8a5fd266e..c426997479 100644 --- a/python/pyphantomjs/webpage-shim.js +++ b/python/pyphantomjs/webpage-shim.js @@ -33,150 +33,3 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// This allows creating a new web page using the construct "new WebPage", -// which feels more natural than "phantom.createWebPage()". -window.WebPage = function (opts) { - var page = phantom.createWebPage(), - handlers = {}; - - function checkType(o, type) { - return typeof o === type; - } - - function isObject(o) { - return checkType(o, 'object'); - } - - function isUndefined(o) { - return checkType(o, 'undefined'); - } - - function isUndefinedOrNull(o) { - return isUndefined(o) || null === o; - } - - function copyInto(target, source) { - if (target === source || isUndefinedOrNull(source)) { - return target; - } - - target = target || {}; - - // Copy into objects only - if (isObject(target)) { - // Make sure source exists - source = source || {}; - - if (isObject(source)) { - var i, newTarget, newSource; - for (i in source) { - if (source.hasOwnProperty(i)) { - newTarget = target[i]; - newSource = source[i]; - - if (newTarget && isObject(newSource)) { - // Deep copy - newTarget = copyInto(target[i], newSource); - } else { - newTarget = newSource; - } - - if (!isUndefined(newTarget)) { - target[i] = newTarget; - } - } - } - } else { - target = source; - } - } - - return target; - } - - function defineSetter(handlerName, signalName) { - page.__defineSetter__(handlerName, function (f) { - if (handlers && typeof handlers[signalName] === 'function') { - try { - this[signalName].disconnect(handlers[signalName]); - } catch (e) {} - } - handlers[signalName] = f; - this[signalName].connect(handlers[signalName]); - }); - } - - // deep copy - page.settings = JSON.parse(JSON.stringify(phantom.defaultPageSettings)); - - defineSetter("onInitialized", "initialized"); - - defineSetter("onLoadStarted", "loadStarted"); - - defineSetter("onLoadFinished", "loadFinished"); - - defineSetter("onResourceRequested", "resourceRequested"); - - defineSetter("onResourceReceived", "resourceReceived"); - - defineSetter("onAlert", "javaScriptAlertSent"); - - defineSetter("onConsoleMessage", "javaScriptConsoleMessageSent"); - - page.open = function (url, arg1, arg2, arg3, arg4) { - if (arguments.length === 1) { - this.openUrl(url, 'get', this.settings); - return; - } - if (arguments.length === 2 && typeof arg1 === 'function') { - this.onLoadFinished = arg1; - this.openUrl(url, 'get', this.settings); - return; - } else if (arguments.length === 2) { - this.openUrl(url, arg1, this.settings); - return; - } else if (arguments.length === 3 && typeof arg2 === 'function') { - this.onLoadFinished = arg2; - this.openUrl(url, arg1, this.settings); - return; - } else if (arguments.length === 3) { - this.openUrl(url, { - operation: arg1, - data: arg2 - }, this.settings); - return; - } else if (arguments.length === 4) { - this.onLoadFinished = arg3; - this.openUrl(url, { - operation: arg1, - data: arg2 - }, this.settings); - return; - } - throw "Wrong use of WebPage#open"; - }; - - page.includeJs = function (scriptUrl, onScriptLoaded) { - // Register temporary signal handler for 'alert()' - this.javaScriptAlertSent.connect(function (msgFromAlert) { - if (msgFromAlert === scriptUrl) { - // Resource loaded, time to fire the callback - onScriptLoaded(scriptUrl); - // And disconnect the signal handler - try { - this.javaScriptAlertSent.disconnect(arguments.callee); - } catch (e) {} - } - }); - - // Append the script tag to the body - this._appendScriptElement(scriptUrl); - }; - - // Copy options into page - if (opts) { - page = copyInto(page, opts); - } - - return page; -}; diff --git a/python/pyphantomjs/webpage.py b/python/pyphantomjs/webpage.py index 5f9d2eedb1..ed489448ce 100644 --- a/python/pyphantomjs/webpage.py +++ b/python/pyphantomjs/webpage.py @@ -22,7 +22,7 @@ import sip from PyQt4.QtCore import (pyqtProperty, pyqtSlot, pyqtSignal, Qt, QObject, QRect, QPoint, QUrl, QFileInfo, QDir, QSize, - QSizeF, QByteArray, QEventLoop, QEvent, QFile) + QSizeF, QByteArray, QEventLoop, QEvent) from PyQt4.QtGui import (QPalette, QDesktopServices, QPrinter, QImage, QPainter, QRegion, QApplication, QMouseEvent, qRgba) @@ -35,12 +35,11 @@ class CustomPage(QWebPage): def __init__(self, parent): - QWebPage.__init__(self, parent) + super(CustomPage, self).__init__(parent) self.m_parent = parent self.m_userAgent = QWebPage.userAgentForUrl(self, QUrl()) - self.m_scrollPosition = QPoint() self.m_uploadFile = '' @@ -75,7 +74,7 @@ class WebPage(QObject): resourceRequested = pyqtSignal('QVariantMap') def __init__(self, parent): - QObject.__init__(self, parent) + super(WebPage, self).__init__(parent) self.m_parent = parent @@ -83,7 +82,7 @@ def __init__(self, parent): self.m_paperSize = {} self.m_clipRect = QRect() self.m_libraryPath = '' - self.m_mousePos = QPoint() + self.m_mousePos = self.m_scrollPosition = QPoint() self.setObjectName('WebPage') self.m_webPage = CustomPage(self) @@ -125,7 +124,7 @@ def applySettings(self, defaults): opt.setAttribute(QWebSettings.PluginsEnabled, defaults['loadPlugins']) opt.setAttribute(QWebSettings.JavascriptEnabled, defaults['javascriptEnabled']) opt.setAttribute(QWebSettings.XSSAuditingEnabled, defaults['XSSAuditingEnabled']) - opt.setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls, defaults['localAccessRemote']) + opt.setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls, defaults['localToRemoteUrlAccessEnabled']) if 'userAgent' in defaults: self.m_webPage.m_userAgent = defaults['userAgent'] @@ -137,15 +136,14 @@ def mainFrame(self): return self.m_mainFrame def renderImage(self): - viewportSize = self.m_webPage.viewportSize() - frameRect = QRect(QPoint(0, 0), viewportSize) + contentsSize = self.m_mainFrame.contentsSize() + contentsSize -= QSize(self.m_scrollPosition.x(), self.m_scrollPosition.y()) + frameRect = QRect(QPoint(0, 0), contentsSize) if not self.m_clipRect.isEmpty(): frameRect = self.m_clipRect - if self.m_webPage.m_scrollPosition: - self.m_webPage.mainFrame().\ - setScrollPosition(QPoint(self.m_webPage.m_scrollPosition.x(), - self.m_webPage.m_scrollPosition.y() )) + viewportSize = self.m_webPage.viewportSize() + self.m_webPage.setViewportSize(contentsSize) image = QImage(frameRect.size(), QImage.Format_ARGB32) image.fill(qRgba(255, 255, 255, 0)) @@ -431,7 +429,7 @@ def libraryPath(self, dirPath): @pyqtProperty('QVariantMap') def scrollPosition(self): - scroll = self.m_webPage.m_scrollPosition + scroll = self.m_scrollPosition result = { 'left': scroll.x(), 'top': scroll.y() @@ -448,7 +446,8 @@ def scrollPosition(self, size): positions[item] = 0 except (KeyError, ValueError): positions[item] = self.scrollPosition[item] - self.m_webPage.m_scrollPosition = QPoint(positions['left'], positions['top']) + self.m_scrollPosition = QPoint(positions['left'], positions['top']) + self.m_mainFrame.setScrollPosition(self.m_scrollPosition) @pyqtSlot(str, str) def uploadFile(self, selector, fileName):