Sample details: 48e465c1cc9a0a6162ecdefb8a370fdc --

Hashes
MD5: 48e465c1cc9a0a6162ecdefb8a370fdc
SHA1: ea796140dfd1646614fd366220b4720e6253668e
SHA256: 5e66f1e798814477848bac855a4381bee4843957fc8118efbb192607ba1dd474
SSDEEP: 3072:ynEOlACIzymfBn7ipFrnCusFPronHPUqK4:wNmft7iTneEMD4
Details
File Type: PE32
Yara Hits
YRP/Microsoft_Visual_Basic_v50 | YRP/PureBasic_4x_Neil_Hodgson_additional | YRP/PureBasic_4x_Neil_Hodgson | YRP/PureBasic4xNeilHodgson | YRP/IsPE32 | YRP/IsWindowsGUI | YRP/HasOverlay | YRP/PureBasic | YRP/domain | YRP/IP | YRP/url | YRP/contentis_base64 | YRP/maldoc_OLE_file_magic_number | YRP/win_files_operation | YRP/android_meterpreter |
Strings
		!This program cannot be run in DOS mode.
`.rdata
@.data
@.NewSec
Ex t3S
j(hdW@
9]tu4W
Etj<^V
j(hdW@
Information
Couldn't open the file! 
C:/exp/
 [File] 
 [Sub-Dir] 
memset
MSVCRT.dll
GetModuleHandleA
HeapCreate
HeapDestroy
ExitProcess
KERNEL32.dll
memcpy
_stricmp
strncmp
_strnicmp
strcmp
memmove
strlen
strcpy
strcat
strncpy
GetCurrentThreadId
GetTickCount
HeapAlloc
HeapFree
WriteFile
CloseHandle
CreateFileA
GetFileSize
ReadFile
SetFilePointer
InitializeCriticalSection
GetModuleFileNameA
GetCurrentProcess
DuplicateHandle
CreatePipe
GetStdHandle
CreateProcessA
WaitForSingleObject
EnterCriticalSection
LeaveCriticalSection
GetCurrentProcessId
GetDriveTypeA
FindFirstFileA
FindClose
GetFileAttributesA
CreateDirectoryA
GetLastError
FindNextFileA
SetFileAttributesA
HeapReAlloc
InitCommonControls
COMCTL32.DLL
MessageBoxA
GetWindowThreadProcessId
IsWindowVisible
IsWindowEnabled
GetForegroundWindow
EnableWindow
EnumWindows
USER32.DLL
ShellExecuteExA
SHELL32.DLL
CoInitialize
OLE32.DLL
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="X86"
    name="CompanyName.ProductName.YourApp"
    type="win32" />
  <description></description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="X86"
        publicKeyToken="6595b64144ccf1df"
        language="*" />
    </dependentAssembly>
  </dependency>
</assembly>
visua//@line 39 "e:\fx19rel\WINNT_5.2_Depend\mozilla\browser\components\feeds\src\WebContentConverter.js"
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
function LOG(str) {
  dump("*** " + str + "\n");
const WCCR_CONTRACTID = "@mozilla.org/embeddor.implemented/web-content-handler-registrar;1";
const WCCR_CLASSID = Components.ID("{792a7e82-06a0-437c-af63-b2d12e808acc}");
const WCCR_CLASSNAME = "Web Content Handler Registrar";
const WCC_CLASSID = Components.ID("{db7ebf28-cc40-415f-8a51-1b111851df1e}");
const WCC_CLASSNAME = "Web Service Handler";
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
const TYPE_ANY = "*/*";
const PREF_CONTENTHANDLERS_AUTO = "browser.contentHandlers.auto.";
const PREF_CONTENTHANDLERS_BRANCH = "browser.contentHandlers.types.";
const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice";
const PREF_SELECTED_ACTION = "browser.feeds.handler";
const PREF_SELECTED_READER = "browser.feeds.handler.default";
const PREF_HANDLER_EXTERNAL_PREFIX = "network.protocol-handler.external";
const PREF_ALLOW_DIFFERENT_HOST = "gecko.handlerService.allowRegisterFromDifferentHost";
const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties";
const NS_ERROR_MODULE_DOM = 2152923136;
const NS_ERROR_DOM_SYNTAX_ERR = NS_ERROR_MODULE_DOM + 12;
function WebContentConverter() {
WebContentConverter.prototype = {
  convert: function WCC_convert() { },
  asyncConvertData: function WCC_asyncConvertData() { },
  onDataAvailable: function WCC_onDataAvailable() { },
  onStopRequest: function WCC_onStopRequest() { },
  onStartRequest: function WCC_onStartRequest(request, context) {
    var wccr = 
        Cc[WCCR_CONTRACTID].
        getService(Ci.nsIWebContentConverterService);
    wccr.loadPreferredHandler(request);
  QueryInterface: function WCC_QueryInterface(iid) {
    if (iid.equals(Ci.nsIStreamConverter) ||
        iid.equals(Ci.nsIStreamListener) ||
        iid.equals(Ci.nsISupports))
      return this;
    throw Cr.NS_ERROR_NO_INTERFACE;
var WebContentConverterFactory = {
  createInstance: function WCCF_createInstance(outer, iid) {
    if (outer != null)
      throw Cr.NS_ERROR_NO_AGGREGATION;
    return new WebContentConverter().QueryInterface(iid);
  QueryInterface: function WCC_QueryInterface(iid) {
    if (iid.equals(Ci.nsIFactory) ||
        iid.equals(Ci.nsISupports))
      return this;
    throw Cr.NS_ERROR_NO_INTERFACE;
function ServiceInfo(contentType, uri, name) {
  this._contentType = contentType;
  this._uri = uri;
  this._name = name;
ServiceInfo.prototype = {
   * See nsIHandlerApp
  get name() {
    return this._name;
   * See nsIHandlerApp
  equals: function SI_equals(aHandlerApp) {
    if (!aHandlerApp)
      throw Cr.NS_ERROR_NULL_POINTER;
    if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo &&
        aHandlerApp.contentType == this.contentType &&
        aHandlerApp.uri == this.uri)
      return true;
    return false;
   * See nsIWebContentHandlerInfo
  get contentType() {
    return this._contentType;
   * See nsIWebContentHandlerInfo
  get uri() {
    return this._uri;
   * See nsIWebContentHandlerInfo
  getHandlerURI: function SI_getHandlerURI(uri) {
    return this._uri.replace(/%s/gi, encodeURIComponent(uri));
  QueryInterface: function SI_QueryInterface(iid) {
    if (iid.equals(Ci.nsIWebContentHandlerInfo) ||
        iid.equals(Ci.nsISupports))
      return this;
    throw Cr.NS_ERROR_NO_INTERFACE;
function WebContentConverterRegistrar() {}
WebContentConverterRegistrar.prototype = {
  get stringBundle() {
    var sb = Cc["@mozilla.org/intl/stringbundle;1"].
              getService(Ci.nsIStringBundleService).
              createBundle(STRING_BUNDLE_URI);
    delete WebContentConverterRegistrar.prototype.stringBundle;
    return WebContentConverterRegistrar.prototype.stringBundle = sb;
  _getFormattedString: function WCCR__getFormattedString(key, params) {
    return this.stringBundle.formatStringFromName(key, params, params.length);
  _getString: function WCCR_getString(key) {
    return this.stringBundle.GetStringFromName(key);
  _contentTypes: { },
   * Track auto handlers for various content types using a content-type to 
   * handler map.
  _autoHandleContentTypes: { },
   * See nsIWebContentConverterService
  getAutoHandler: 
  function WCCR_getAutoHandler(contentType) {
    contentType = this._resolveContentType(contentType);
    if (contentType in this._autoHandleContentTypes)
      return this._autoHandleContentTypes[contentType];
    return null;
   * See nsIWebContentConverterService
  setAutoHandler:
  function WCCR_setAutoHandler(contentType, handler) {
    if (handler && !this._typeIsRegistered(contentType, handler.uri))
      throw Cr.NS_ERROR_NOT_AVAILABLE;
      
    contentType = this._resolveContentType(contentType);
    this._setAutoHandler(contentType, handler);
    var ps = 
        Cc["@mozilla.org/preferences-service;1"].
        getService(Ci.nsIPrefService);
    var autoBranch = ps.getBranch(PREF_CONTENTHANDLERS_AUTO);
    if (handler)
      autoBranch.setCharPref(contentType, handler.uri);
    else if (autoBranch.prefHasUserValue(contentType))
      autoBranch.clearUserPref(contentType);
    ps.savePrefFile(null);
   * Update the internal data structure (not persistent)
  _setAutoHandler:
  function WCCR__setAutoHandler(contentType, handler) {
    if (handler) 
      this._autoHandleContentTypes[contentType] = handler;
    else if (contentType in this._autoHandleContentTypes)
      delete this._autoHandleContentTypes[contentType];
   * See nsIWebContentConverterService
  getWebContentHandlerByURI:
  function WCCR_getWebContentHandlerByURI(contentType, uri) {
    var handlers = this.getContentHandlers(contentType, { });
    for (var i = 0; i < handlers.length; ++i) {
      if (handlers[i].uri == uri) 
        return handlers[i];
    return null;
   * See nsIWebContentConverterService
  loadPreferredHandler: 
  function WCCR_loadPreferredHandler(request) {
    var channel = request.QueryInterface(Ci.nsIChannel);
    var contentType = this._resolveContentType(channel.contentType);
    var handler = this.getAutoHandler(contentType);
    if (handler) {
      request.cancel(Cr.NS_ERROR_FAILURE);
      
      var webNavigation = 
          channel.notificationCallbacks.getInterface(Ci.nsIWebNavigation);
      webNavigation.loadURI(handler.getHandlerURI(channel.URI.spec), 
                            Ci.nsIWebNavigation.LOAD_FLAGS_NONE, 
                            null, null, null);
    }      
   * See nsIWebContentConverterService
  removeProtocolHandler: 
  function WCCR_removeProtocolHandler(aProtocol, aURITemplate) {
    var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
              getService(Ci.nsIExternalProtocolService);
    var handlerInfo = eps.getProtocolHandlerInfo(aProtocol);
    var handlers =  handlerInfo.possibleApplicationHandlers;
    for (let i = 0; i < handlers.length; i++) {
      try { // We only want to test web handlers
        let handler = handlers.queryElementAt(i, Ci.nsIWebHandlerApp);
        if (handler.uriTemplate == aURITemplate) {
          handlers.removeElementAt(i);
          var hs = Cc["@mozilla.org/uriloader/handler-service;1"].
                   getService(Ci.nsIHandlerService);
          hs.store(handlerInfo);
          return;
        }
      } catch (e) { /* it wasn't a web handler */ }
   * See nsIWebContentConverterService
  removeContentHandler: 
  function WCCR_removeContentHandler(contentType, uri) {
    function notURI(serviceInfo) {
      return serviceInfo.uri != uri;
    if (contentType in this._contentTypes) {
      this._contentTypes[contentType] = 
        this._contentTypes[contentType].filter(notURI);
  _mappings: { 
    "application/rss+xml": TYPE_MAYBE_FEED,
    "application/atom+xml": TYPE_MAYBE_FEED,
   * These are types for which there is a separate content converter aside 
   * from our built in generic one. We should not automatically register
   * a factory for creating a converter for these types.
  _blockedTypes: {
    "application/vnd.mozilla.maybe.feed": true,
   * Determines the "internal" content type based on the _mappings.
   * @param   contentType
   * @returns The resolved contentType value. 
  _resolveContentType: 
  function WCCR__resolveContentType(contentType) {
    if (contentType in this._mappings)
      return this._mappings[contentType];
    return contentType;
  _makeURI: function(aURL, aOriginCharset, aBaseURI) {
    var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                              .getService(Components.interfaces.nsIIOService);
    return ioService.newURI(aURL, aOriginCharset, aBaseURI);
  _checkAndGetURI:
  function WCCR_checkAndGetURI(aURIString, aContentWindow)
    try {
      var uri = this._makeURI(aURIString);
    } catch (ex) {
      // not supposed to throw according to spec
      return; 
    // For security reasons we reject non-http(s) urls (see bug 354316),
    // we may need to revise this once we support more content types
    // XXX this should be a "security exception" according to spec, but that
    // isn't defined yet.
    if (uri.scheme != "http" && uri.scheme != "https")
      throw("Permission denied to add " + uri.spec + " as a content or protocol handler");
    // We also reject handlers registered from a different host (see bug 402287)
    // The pref allows us to test the feature
    var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
    if ((!pb.prefHasUserValue(PREF_ALLOW_DIFFERENT_HOST) ||
         !pb.getBoolPref(PREF_ALLOW_DIFFERENT_HOST)) &&
        aContentWindow.location.hostname != uri.host)
      throw("Permission denied to add " + uri.spec + " as a content or protocol handler");
    // If the uri doesn't contain '%s', it won't be a good handler
    if (uri.spec.indexOf("%s") < 0)
      throw NS_ERROR_DOM_SYNTAX_ERR; 
    return uri;
   * Determines if a web handler is already registered.
   * @param aProtocol
   *        The scheme of the web handler we are checking for.
   * @param aURITemplate
   *        The URI template that the handler uses to handle the protocol.
   * @return true if it is already registered, false otherwise.
  _protocolHandlerRegistered:
  function WCCR_protocolHandlerRegistered(aProtocol, aURITemplate) {
    var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
              getService(Ci.nsIExternalProtocolService);
    var handlerInfo = eps.getProtocolHandlerInfo(aProtocol);
    var handlers =  handlerInfo.possibleApplicationHandlers;
    for (let i = 0; i < handlers.length; i++) {
      try { // We only want to test web handlers
        let handler = handlers.queryElementAt(i, Ci.nsIWebHandlerApp);
        if (handler.uriTemplate == aURITemplate)
          return true;
      } catch (e) { /* it wasn't a web handler */ }
    return false;
   * See nsIWebContentHandlerRegistrar
  registerProtocolHandler: 
  function WCCR_registerProtocolHandler(aProtocol, aURIString, aTitle, aContentWindow) {
    LOG("registerProtocolHandler(" + aProtocol + "," + aURIString + "," + aTitle + ")");
    // First, check to make sure this isn't already handled internally (we don't
    // want to let them take over, say "chrome").
    var ios = Cc["@mozilla.org/network/io-service;1"].
              getService(Ci.nsIIOService);
    var handler = ios.getProtocolHandler(aProtocol);
    if (!(handler instanceof Ci.nsIExternalProtocolHandler)) {
      // This is handled internally, so we don't want them to register
      // XXX this should be a "security exception" according to spec, but that
      // isn't defined yet.
      throw("Permission denied to add " + aURIString + "as a protocol handler");
    // check if it is in the black list
    var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
    var allowed;
    try {
      allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
    catch (e) {
      allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
    if (!allowed) {
      // XXX this should be a "security exception" according to spec
      throw("Not allowed to register a protocol handler for " + aProtocol);
    var uri = this._checkAndGetURI(aURIString, aContentWindow);
    var buttons, message;
    if (this._protocolHandlerRegistered(aProtocol, uri.spec))
      message = this._getFormattedString("protocolHandlerRegistered",
                                         [aTitle, aProtocol]);
    else {
      // Now Ask the user and provide the proper callback
      message = this._getFormattedString("addProtocolHandler",
                                         [aTitle, uri.host, aProtocol]);
      var fis = Cc["@mozilla.org/browser/favicon-service;1"].
                getService(Ci.nsIFaviconService);
      var notificationIcon = fis.getFaviconLinkForIcon(uri);
      var notificationValue = "Protocol Registration: " + aProtocol;
      var addButton = {
        label: this._getString("addProtocolHandlerAddButton"),
        accessKey: this._getString("addHandlerAddButtonAccesskey"),
        protocolInfo: { protocol: aProtocol, uri: uri.spec, name: aTitle },
        callback:
        function WCCR_addProtocolHandlerButtonCallback(aNotification, aButtonInfo) {
          var protocol = aButtonInfo.protocolInfo.protocol;
          var uri      = aButtonInfo.protocolInfo.uri;
          var name     = aButtonInfo.protocolInfo.name;
          var handler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
                        createInstance(Ci.nsIWebHandlerApp);
          handler.name = name;
          handler.uriTemplate = uri;
          var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
                    getService(Ci.nsIExternalProtocolService);
          var handlerInfo = eps.getProtocolHandlerInfo(protocol);
          handlerInfo.possibleApplicationHandlers.appendElement(handler, false);
          // Since the user has agreed to add a new handler, chances are good
          // that the next time they see a handler of this type, they're going
          // to want to use it.  Reset the handlerInfo to ask before the next
          // use.
          handlerInfo.alwaysAskBeforeHandling = true;
          var hs = Cc["@mozilla.org/uriloader/handler-service;1"].
                   getService(Ci.nsIHandlerService);
          hs.store(handlerInfo);
        }
      };
      buttons = [addButton];
    var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
    var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow);
    var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement);
    notificationBox.appendNotification(message,
                                       notificationValue,
                                       notificationIcon,
                                       notificationBox.PRIORITY_INFO_LOW,
                                       buttons);
   * See nsIWebContentHandlerRegistrar
   * If a DOM window is provided, then the request came from content, so we
   * prompt the user to confirm the registration.
  registerContentHandler: 
  function WCCR_registerContentHandler(aContentType, aURIString, aTitle, aContentWindow) {
    LOG("registerContentHandler(" + aContentType + "," + aURIString + "," + aTitle + ")");
    // We only support feed types at present.
    // XXX this should be a "security exception" according to spec, but that
    // isn't defined yet.
    var contentType = this._resolveContentType(aContentType);
    if (contentType != TYPE_MAYBE_FEED)
      return;
    if (aContentWindow) {
      var uri = this._checkAndGetURI(aURIString, aContentWindow);
      var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow);
      var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow);
      var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement);
      this._appendFeedReaderNotification(uri, aTitle, notificationBox);
    else
      this._registerContentHandler(contentType, aURIString, aTitle);
   * Returns the browser chrome window in which the content window is in
  _getBrowserWindowForContentWindow:
  function WCCR__getBrowserWindowForContentWindow(aContentWindow) {
    return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIWebNavigation)
                         .QueryInterface(Ci.nsIDocShellTreeItem)
                         .rootTreeItem
                         .QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIDOMWindow)
                         .wrappedJSObject;
   * Returns the <xul:browser> element associated with the given content
   * window.
   * @param aBrowserWindow
   *        The browser window in which the content window is in.
   * @param aContentWindow
   *        The content window. It's possible to pass a child content window
   *        (i.e. the content window of a frame/iframe).
  _getBrowserForContentWindow:
  function WCCR__getBrowserForContentWindow(aBrowserWindow, aContentWindow) {
    // This depends on pseudo APIs of browser.js and tabbrowser.xml
    aContentWindow = aContentWindow.top;
    var browsers = aBrowserWindow.getBrowser().browsers;
    for (var i = 0; i < browsers.length; ++i) {
      if (browsers[i].contentWindow == aContentWindow)
        return browsers[i];
   * Appends a notifcation for the given feed reader details.
   * The notification could be either a pseudo-dialog which lets
   * the user to add the feed reader:
   * [ [icon] Add %feed-reader-name% (%feed-reader-host%) as a Feed Reader?  (Add) [x] ]
   * or a simple message for the case where the feed reader is already registered:
   * [ [icon] %feed-reader-name% is already registered as a Feed Reader             [x] ]
   * A new notification isn't appended if the given notificationbox has a
   * notification for the same feed reader.
   * @param aURI
   *        The url of the feed reader as a nsIURI object
   * @param aName
   *        The feed reader name as it was passed to registerContentHandler
   * @param aNotificationBox
   *        The notification box to which a notification might be appended
   * @return true if a notification has been appended, false otherwise.
  _appendFeedReaderNotification:
  function WCCR__appendFeedReaderNotification(aURI, aName, aNotificationBox) {
    var uriSpec = aURI.spec;
    var notificationValue = "feed reader notification: " + uriSpec;
    var notificationIcon = aURI.prePath + "/favicon.ico";
    // Don't append a new notification if the notificationbox
    // has a notification for the given feed reader already
    if (aNotificationBox.getNotificationWithValue(notificationValue))
      return false;
    var buttons, message;
    if (this.getWebContentHandlerByURI(TYPE_MAYBE_FEED, uriSpec))
      message = this._getFormattedString("handlerRegistered", [aName]);
    else {
      message = this._getFormattedString("addHandler", [aName, aURI.host]);
      var self = this;
      var addButton = {
        _outer: self,
        label: self._getString("addHandlerAddButton"),
        accessKey: self._getString("addHandlerAddButtonAccesskey"),
        feedReaderInfo: { uri: uriSpec, name: aName },
        /* static */
        callback:
        function WCCR__addFeedReaderButtonCallback(aNotification, aButtonInfo) {
          var uri = aButtonInfo.feedReaderInfo.uri;
          var name = aButtonInfo.feedReaderInfo.name;
          var outer = aButtonInfo._outer;
          // The reader could have been added from another window mean while
          if (!outer.getWebContentHandlerByURI(TYPE_MAYBE_FEED, uri))
            outer._registerContentHandler(TYPE_MAYBE_FEED, uri, name);
          // avoid reference cycles
          aButtonInfo._outer = null;
          return false;
        }
      };
      buttons = [addButton];
    aNotificationBox.appendNotification(message,
                                        notificationValue,
                                        notificationIcon,
                                        aNotificationBox.PRIORITY_INFO_LOW,
                                        buttons);
    return true;
   * Save Web Content Handler metadata to persistent preferences. 
   * @param   contentType
   *          The content Type being handled
   * @param   uri
   *          The uri of the web service
   * @param   title
   *          The human readable name of the web service
   * This data is stored under:
   *    browser.contentHandlers.type0 = content/type
   *    browser.contentHandlers.uri0 = http://www.foo.com/q=%s
   *    browser.contentHandlers.title0 = Foo 2.0alphr
  _saveContentHandlerToPrefs: 
  function WCCR__saveContentHandlerToPrefs(contentType, uri, title) {
    var ps = 
        Cc["@mozilla.org/preferences-service;1"].
        getService(Ci.nsIPrefService);
    var i = 0;
    var typeBranch = null;
    while (true) {
      typeBranch = 
        ps.getBranch(PREF_CONTENTHANDLERS_BRANCH + i + ".");
      try {
        typeBranch.getCharPref("type");
        ++i;
      }
      catch (e) {
        // No more handlers
        break;
      }
    if (typeBranch) {
      typeBranch.setCharPref("type", contentType);
      var pls = 
          Cc["@mozilla.org/pref-localizedstring;1"].
          createInstance(Ci.nsIPrefLocalizedString);
      pls.data = uri;
      typeBranch.setComplexValue("uri", Ci.nsIPrefLocalizedString, pls);
      pls.data = title;
      typeBranch.setComplexValue("title", Ci.nsIPrefLocalizedString, pls);
      ps.savePrefFile(null);
   * Determines if there is a type with a particular uri registered for the 
   * specified content type already.
   * @param   contentType
   *          The content type that the uri handles
   * @param   uri
   *          The uri of the 
  _typeIsRegistered: function WCCR__typeIsRegistered(contentType, uri) {
    if (!(contentType in this._contentTypes))
      return false;
      
    var services = this._contentTypes[contentType];
    for (var i = 0; i < services.length; ++i) {
      // This uri has already been registered
      if (services[i].uri == uri)
        return true;
    return false;
   * Gets a stream converter contract id for the specified content type.
   * @param   contentType
   *          The source content type for the conversion.
   * @returns A contract id to construct a converter to convert between the 
   *          contentType and *\/*.
  _getConverterContractID: function WCCR__getConverterContractID(contentType) {
    const template = "@mozilla.org/streamconv;1?from=%s&to=*/*";
    return template.replace(/%s/, contentType);
   * Register a web service handler for a content type.
   * @param   contentType
   *          the content type being handled
   * @param   uri
   *          the URI of the web service
   * @param   title
   *          the human readable name of the web service
  _registerContentHandler:
  function WCCR__registerContentHandler(contentType, uri, title) {
    this._updateContentTypeHandlerMap(contentType, uri, title);
    this._saveContentHandlerToPrefs(contentType, uri, title);
    if (contentType == TYPE_MAYBE_FEED) {
      // Make the new handler the last-selected reader in the preview page
      // and make sure the preview page is shown the next time a feed is visited
      var pb = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefService).getBranch(null);
      pb.setCharPref(PREF_SELECTED_READER, "web");
      var supportsString = 
        Cc["@mozilla.org/supports-string;1"].
        createInstance(Ci.nsISupportsString);
        supportsString.data = uri;
      pb.setComplexValue(PREF_SELECTED_WEB, Ci.nsISupportsString,
                         supportsString);
      pb.setCharPref(PREF_SELECTED_ACTION, "ask");
      this._setAutoHandler(TYPE_MAYBE_FEED, null);
   * Update the content type -> handler map. This mapping is not persisted, use
   * registerContentHandler or _saveContentHandlerToPrefs for that purpose.
   * @param   contentType
   *          The content Type being handled
   * @param   uri
   *          The uri of the web service
   * @param   title
   *          The human readable name of the web service
  _updateContentTypeHandlerMap: 
  function WCCR__updateContentTypeHandlerMap(contentType, uri, title) {
    if (!(contentType in this._contentTypes))
      this._contentTypes[contentType] = [];
    // Avoid adding duplicates
    if (this._typeIsRegistered(contentType, uri)) 
      return;
    this._contentTypes[contentType].push(new ServiceInfo(contentType, uri, title));
    if (!(contentType in this._blockedTypes)) {
      var converterContractID = this._getConverterContractID(contentType);
      var cr = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
      cr.registerFactory(WCC_CLASSID, WCC_CLASSNAME, converterContractID, 
                         WebContentConverterFactory);
   * See nsIWebContentConverterService
  getContentHandlers: 
  function WCCR_getContentHandlers(contentType, countRef) {
    countRef.value = 0;
    if (!(contentType in this._contentTypes))
      return [];
    var handlers = this._contentTypes[contentType];
    countRef.value = handlers.length;
    return handlers;
   * See nsIWebContentConverterService
  resetHandlersForType: 
  function WCCR_resetHandlersForType(contentType) {
    // currently unused within the tree, so only useful for extensions; previous
    // impl. was buggy (and even infinite-looped!), so I argue that this is a
    // definite improvement
    throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   * Registers a handler from the settings on a preferences branch.
   * @param branch
   *        an nsIPrefBranch containing "type", "uri", and "title" preferences
   *        corresponding to the content handler to be registered
  _registerContentHandlerWithBranch: function(branch) {
    /**
     * Since we support up to six predefined readers, we need to handle gaps 
     * better, since the first branch with user-added values will be .6
     * 
     * How we deal with that is to check to see if there's no prefs in the 
     * branch and stop cycling once that's true.  This doesn't fix the case
     * where a user manually removes a reader, but that's not supported yet!
     */
    var vals = branch.getChildList("", {});
    if (vals.length == 0)
      return;
    try {
      var type = branch.getCharPref("type");
      var uri = branch.getComplexValue("uri", Ci.nsIPrefLocalizedString).data;
      var title = branch.getComplexValue("title",
                                         Ci.nsIPrefLocalizedString).data;
      this._updateContentTypeHandlerMap(type, uri, title);
    catch(ex) {
      // do nothing, the next branch might have values
   * Load the auto handler, content handler and protocol tables from 
   * preferences.
  _init: function WCCR__init() {
    var ps = 
        Cc["@mozilla.org/preferences-service;1"].
        getService(Ci.nsIPrefService);
    var kids = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH)
                 .getChildList("", {});
    // first get the numbers of the providers by getting all ###.uri prefs
    var nums = [];
    for (var i = 0; i < kids.length; i++) {
      var match = /^(\d+)\.uri$/.exec(kids[i]);
      if (!match)
        continue;
      else
        nums.push(match[1]);
    // sort them, to get them back in order
    nums.sort(function(a, b) {return a - b;});
    // now register them
    for (var i = 0; i < nums.length; i++) {
      var branch = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH + nums[i] + ".");
      this._registerContentHandlerWithBranch(branch);
    // We need to do this _after_ registering all of the available handlers, 
    // so that getWebContentHandlerByURI can return successfully.
    try {
      var autoBranch = ps.getBranch(PREF_CONTENTHANDLERS_AUTO);
      var childPrefs = autoBranch.getChildList("", { });
      for (var i = 0; i < childPrefs.length; ++i) {
        var type = childPrefs[i];
        var uri = autoBranch.getCharPref(type);
        if (uri) {
          var handler = this.getWebContentHandlerByURI(type, uri);
          this._setAutoHandler(type, handler);
        }
      }
    catch (e) {
      // No auto branch yet, that's fine
      //LOG("WCCR.init: There is no auto branch, benign");
   * See nsIObserver
  observe: function WCCR_observe(subject, topic, data) {
    var os = 
        Cc["@mozilla.org/observer-service;1"].
        getService(Ci.nsIObserverService);
    switch (topic) {
    case "app-startup":
      os.addObserver(this, "profile-after-change", false);
      break;
    case "profile-after-change":
      os.removeObserver(this, "profile-after-change");
      this._init();
      break;
   * See nsIFactory
  createInstance: function WCCR_createInstance(outer, iid) {
    if (outer != null)
      throw Cr.NS_ERROR_NO_AGGREGATION;
    return this.QueryInterface(iid);
   * See nsIClassInfo
  getInterfaces: function WCCR_getInterfaces(countRef) {
    var interfaces = 
        [Ci.nsIWebContentConverterService, Ci.nsIWebContentHandlerRegistrar,
         Ci.nsIObserver, Ci.nsIClassInfo, Ci.nsIFactory, Ci.nsISupports];
    countRef.value = interfaces.length;
    return interfaces;
  getHelperForLanguage: function WCCR_getHelperForLanguage(language) {
    return null;
  contractID: WCCR_CONTRACTID,
  classDescription: WCCR_CLASSNAME,
  classID: WCCR_CLASSID,
  implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
  flags: Ci.nsIClassInfo.DOM_OBJECT,
   * See nsISupports
  QueryInterface: XPCOMUtils.generateQI(
     [Ci.nsIWebContentConverterService, 
      Ci.nsIWebContentHandlerRegistrar,
      Ci.nsIObserver,
      Ci.nsIClassInfo,
      Ci.nsIFactory,
      Ci.nsISupports]),
  _xpcom_categories: [{
    category: "app-startup",
    service: true
function NSGetModule(cm, file) {
  return XPCOMUtils.generateModule([WebContentConverterRegistrar]);
//@line 44 "e:\fx19rel\WINNT_5.2_Depend\mozilla\toolkit\content\debug.js"
var EXPORTED_SYMBOLS = ["NS_ASSERT"];
var gTraceOnAssert = true;
 * This function provides a simple assertion function for JavaScript.
 * If the condition is true, this function will do nothing.  If the
 * condition is false, then the message will be printed to the console
 * and an alert will appear showing a stack trace, so that the (alpha
 * or nightly) user can file a bug containing it.  For future enhancements, 
 * see bugs 330077 and 330078.
 * To suppress the dialogs, you can run with the environment variable
 * XUL_ASSERT_PROMPT set to 0 (if unset, this defaults to 1).
 * @param condition represents the condition that we're asserting to be
 *                  true when we call this function--should be
 *                  something that can be evaluated as a boolean.
 * @param message   a string to be displayed upon failure of the assertion
function NS_ASSERT(condition, message) {
  if (condition)
    return;
  var releaseBuild = true;
  var defB = Components.classes["@mozilla.org/preferences-service;1"]
                       .getService(Components.interfaces.nsIPrefService)
                       .getDefaultBranch(null);
  try {
    switch (defB.getCharPref("app.update.channel")) {
      case "nightly":
      case "beta":
      case "default":
        releaseBuild = false;
  } catch(ex) {}
  var caller = arguments.callee.caller;
  var assertionText = "ASSERT: " + message + "\n";
  if (releaseBuild) {
    // Just report the error to the console
    Components.utils.reportError(assertionText);
    return;
  // Otherwise, dump to stdout and launch an assertion failure dialog
  dump(assertionText);
  var stackText = "";
  if (gTraceOnAssert) {
    stackText = "Stack Trace: \n";
    var count = 0;
    while (caller) {
      stackText += count++ + ":" + caller.name + "(";
      for (var i = 0; i < caller.arguments.length; ++i) {
        var arg = caller.arguments[i];
        stackText += arg;
        if (i < caller.arguments.length - 1)
          stackText += ",";
      }
      stackText += ")\n";
      caller = caller.arguments.callee.caller;
  var environment = Components.classes["@mozilla.org/process/environment;1"].
                    getService(Components.interfaces.nsIEnvironment);
  if (environment.exists("XUL_ASSERT_PROMPT") &&
      !parseInt(environment.get("XUL_ASSERT_PROMPT")))
    return;
  var source = null;
  if (this.window)
    source = this.window;
  var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
           getService(Components.interfaces.nsIPromptService);
  ps.alert(source, "Assertion Failed", assertionText + stackText);
//@line 949 "e:\fx19rel\WINNT_5.2_Depend\mozilla\browser\components\feeds\src\WebContentConverter.js"
visuavar DISQUS=function(a){"use strict";var b=a.DISQUS||{},c=[];return b.define=function(d,e){"function"==typeof d&&(e=d,d="");for(var f=d.split("."),g=f.shift(),h=b,i=(e||function(){return{}}).call({overwrites:function(a){return a.__overwrites__=!0,a}},a);g;)h=h[g]?h[g]:h[g]={},g=f.shift();for(var j in i)i.hasOwnProperty(j)&&(!i.__overwrites__&&null!==h[j]&&h.hasOwnProperty(j)&&b.logError&&b.logError("Unsafe attempt to redefine existing module: "+j),h[j]=i[j],c.push(function(a,b){return function(){delete a[b]}}(h,j)));return h},b.use=function(a){return b.define(a)},b.define("next"),b}(window);DISQUS.define(function(a,b){"use strict";var c=a.DISQUS,d=a.document,e=d.head||d.getElementsByTagName("head")[0]||d.body,f=0;c.getUid=function(a){var b=++f+"";return a?a+b:b},c.isOwn=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},c.each=function(a,b){var d=a.length,e=Array.prototype.forEach;if(isNaN(d))for(var f in a)c.isOwn(a,f)&&b(a[f],f,a);else if(e)e.call(a,b);else for(var g=0;d>g;g++)b(a[g],g,a)},c.extend=function(a){return c.each(Array.prototype.slice.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},c.serializeArgs=function(a){var d=[];return c.each(a,function(a,c){a!==b&&d.push(c+(null!==a?"="+encodeURIComponent(a):""))}),d.join("&")},c.serialize=function(a,b,d){if(b&&(a+=~a.indexOf("?")?"&"==a.charAt(a.length-1)?"":"&":"?",a+=c.serializeArgs(b)),d){var e={};return e[(new Date).getTime()]=null,c.serialize(a,e)}var f=a.length;return"&"==a.charAt(f-1)?a.slice(0,f-1):a};var g,h,i=2e4;"addEventListener"in a?(g=function(a,b,c){a.addEventListener(b,c,!1)},h=function(a,b,c){a.removeEventListener(b,c,!1)}):(g=function(a,b,c){a.attachEvent("on"+b,c)},h=function(a,b,c){a.detachEvent("on"+b,c)}),c.require=function(b,f,j,k,l){function m(b){b=b||a.event,b.target||(b.target=b.srcElement),("load"==b.type||/^(complete|loaded)$/.test(b.target.readyState))&&(k&&k(),p&&clearTimeout(p),h(b.target,o,m))}var n=d.createElement("script"),o=n.addEventListener?"load":"readystatechange",p=null;return n.src=c.serialize(b,f,j),n.async=!0,n.charset="UTF-8",(k||l)&&g(n,o,m),l&&(p=setTimeout(function(){l()},i)),e.appendChild(n),c}}),DISQUS.define(function(){"use strict";var a=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1},b={},c=function(c){var d=DISQUS.config&&DISQUS.config.switches;if(!d)return null;if(DISQUS.isOwn(b,c))return b[c];var e=b[c]=a(d,c);return e},d=function(){window.console&&c("next_logging")!==!1&&(window.console.log.apply?window.console.log.apply(window.console,arguments):window.console.log(Array.prototype.slice.call(arguments,0).join(" ")))};return{log:d,logError:d}}),DISQUS.define("Events",function(){"use strict";var a=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},b=DISQUS.isOwn,c=Object.keys||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b(a,d)&&(c[c.length]=d);return c},d=[].slice,e={on:function(a,b,c){if(!g(this,"on",a,[b,c])||!b)return this;this._events=this._events||{};var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(b,c,d){if(!g(this,"once",b,[c,d])||!c)return this;var e=this,f=a(function(){e.off(b,f),c.apply(this,arguments)});return f._callback=c,this.on(b,f,d)},off:function(a,b,d){var e,f,h,i,j,k,l,m;if(!this._events||!g(this,"off",a,[b,d]))return this;if(!a&&!b&&!d)return this._events={},this;for(i=a?[a]:c(this._events),j=0,k=i.length;k>j;j++)if(a=i[j],h=this._events[a]){if(this._events[a]=e=[],b||d)for(l=0,m=h.length;m>l;l++)f=h[l],(b&&b!==f.callback&&b!==f.callback._callback||d&&d!==f.context)&&e.push(f);e.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=d.call(arguments,1);if(!g(this,"trigger",a,b))return this;var c=this._events[a],e=this._events.all;return c&&h(c,b),e&&h(e,arguments),this},stopListening:function(a,b,c){var d=this._listeners;if(!d)return this;var e=!b&&!c;"object"==typeof b&&(c=this),a&&((d={})[a._listenerId]=a);for(var f in d)d[f].off(b,c,this),e&&delete this._listeners[f];return this}},f=/\s+/,g=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(f.test(c)){for(var g=c.split(f),h=0,i=g.length;i>h;h++)a[b].apply(a,[g[h]].concat(d));return!1}return!0},h=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++d<e;)(c=a[d]).callback.call(c.ctx);return;case 1:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f);return;case 2:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g);return;case 3:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g,h);return;default:for(;++d<e;)(c=a[d]).callback.apply(c.ctx,b)}},i={listenTo:"on",listenToOnce:"once"};return DISQUS.each(i,function(a,b){e[b]=function(b,c,d){var e=this._listeners||(this._listeners={}),f=b._listenerId||(b._listenerId=DISQUS.getUid("l"));return e[f]=b,"object"==typeof c&&(d=this),b[a](c,d,this),this}}),e.bind=e.on,e.unbind=e.off,e}),DISQUS.define(function(a){"use strict";function b(){throw new Error(Array.prototype.join.call(arguments," "))}function c(a){return g.getElementById(a)||g.body||g.documentElement}function d(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else{if(!a.attachEvent)throw new Error("No event support.");a.attachEvent("on"+b,c)}}function e(a,b,c){a.postMessage(b,c)}function f(a,b,c){c||(c=0);var d,e,f,g,h=0,i=function(){h=new Date,f=null,g=a.apply(d,e)};return function(){var j=new Date,k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(f),f=null,h=j,g=a.apply(d,e)):f||(f=setTimeout(i,k+c)),g}}var g=a.document,h="2",i={},j=DISQUS.use("JSON");if(!DISQUS.version||DISQUS.version()!==h){var k=DISQUS.isOwn;d(a,"message",function(a){var c;for(var d in i)if(k(i,d)&&a.origin==i[d].origin){c=!0;break}if(c){var e=j.parse(a.data),f=i[e.sender];switch(f||b("Message from our server but with invalid sender UID:",e.sender),e.scope){case"host":f.trigger(e.name,e.data);break;default:b("Message",e.scope,"not supported. Sender:",a.origin)}}},!1),d(a,"hashchange",function(){DISQUS.trigger("window.hashchange",{hash:a.location.hash})},!1),d(a,"resize",function(){DISQUS.trigger("window.resize")},!1);var l=function(){DISQUS.trigger("window.scroll")};d(a,"scroll",f(l,250,50)),d(g,"click",function(){DISQUS.trigger("window.click")});var m=function(a){a=a||{},this.state=m.INIT,this.uid=a.uid||DISQUS.getUid(),this.origin=a.origin,this.target=a.target,this.window=null,i[this.uid]=this,this.on("ready",function(){this.state=m.READY},this),this.on("die",function(){this.state=m.KILLED},this)};DISQUS.extend(m,{INIT:0,READY:1,KILLED:2}),DISQUS.extend(m.prototype,DISQUS.Events),m.prototype.sendMessage=function(a,b){var c=j.stringify({scope:"client",name:a,data:b}),d=function(a,b,c){return function(){DISQUS.postMessage(c.window,a,b)}}(c,this.origin,this);this.isReady()?d():this.on("ready",d)},m.prototype.hide=function(){},m.prototype.show=function(){},m.prototype.url=function(){return DISQUS.serialize(this.target,{disqus_version:"1383167695",base:"default"})+"#"+this.uid},m.prototype.destroy=function(){this.state=m.KILLED,this.off()},m.prototype.isReady=function(){return this.state===m.READY},m.prototype.isKilled=function(){return this.state===m.KILLED};var n=function(a){m.call(this,a),this.windowName=a.windowName};DISQUS.extend(n.prototype,m.prototype),n.prototype.load=function(){this.window=a.open("",this.windowName||"_blank"),this.window.location=this.url()},n.prototype.isKilled=function(){return m.prototype.isKilled()||this.window.closed};var o=function(a){m.call(this,a),this.styles=a.styles||{},this.role=a.role||"application",this.container=a.container,this.elem=null};DISQUS.extend(o.prototype,m.prototype),o.prototype.load=function(){var a=this.elem=g.createElement("iframe");a.setAttribute("id","dsq-"+this.uid),a.setAttribute("data-disqus-uid",this.uid),a.setAttribute("allowTransparency","true"),a.setAttribute("frameBorder","0"),this.role&&a.setAttribute("role",this.role),this.setInlineStyle(this.styles)},o.prototype.getOffset=function(a){a=a||g.documentElement;for(var b=this.elem,c=b,d=0,e=0;c&&c!==a;)d+=c.offsetLeft,e+=c.offsetTop,c=c.offsetParent;return{top:e,left:d,height:b.offsetHeight,width:b.offsetWidth}},o.prototype.setInlineStyle=function(a,b){var c={};DISQUS.isString(a)?c[a]=b:c=a;var d=this.elem.style;return"setProperty"in d?void DISQUS.each(c,function(a,b){d.setProperty(b,a,"important")}):this._setInlineStyleCompat(c)},o.prototype._setInlineStyleCompat=function(a){this._stylesCache=this._stylesCache||{},DISQUS.extend(this._stylesCache,a);var b=[];DISQUS.each(this._stylesCache,function(a,c){b.push(c+":"+a+" !important")}),this.elem.style.cssText=b.join(";")},o.prototype.removeInlineStyle=function(a){var b=this.elem.style;return"removeProperty"in b?void b.removeProperty(a):this._removeInlineStyleCompat(a)},o.prototype._removeInlineStyleCompat=function(a){this._stylesCache&&(delete this._stylesCache[a],this._setInlineStyleCompat({}))},o.prototype.hide=function(){this.setInlineStyle("display","none")},o.prototype.show=function(){this.removeInlineStyle("display")},o.prototype.destroy=function(){m.prototype.destroy.call(this),this.elem&&this.elem.parentNode&&this.elem.parentNode.removeChild(this.elem)};var p=function(a){var b=this;o.call(b,a),b.styles=DISQUS.extend({width:"100%",border:"none",overflow:"hidden",height:"0"},a.styles||{})};DISQUS.extend(p.prototype,o.prototype),p.prototype.load=function(a){var b=this;o.prototype.load.call(b);var e=b.elem;e.setAttribute("width","100%"),e.setAttribute("src",this.url()),d(e,"load",function(){b.window=e.contentWindow,a&&a()});var f=DISQUS.isString(this.container)?c(this.container):this.container;f.appendChild(e)};var q=function(a){o.call(this,a),this.contents=a.contents||"",this.styles=DISQUS.extend({width:"100%",border:"none",overflow:"hidden"},a.styles||{})};DISQUS.extend(q.prototype,o.prototype),q.prototype.load=function(){o.prototype.load.call(this);var a=this.elem;a.setAttribute("scrolling","no");var b=DISQUS.isString(this.container)?c(this.container):this.container;b.appendChild(a),this.window=a.contentWindow;try{this.window.document.open()}catch(d){a.src="javascript:var d=document.open();d.domain='"+g.domain+"';void(0);"}this.document=this.window.document,this.document.write(this.contents),this.document.close();var e,f=this.document.body;return f&&(e=f.offsetHeight+"px",this.setInlineStyle({height:e,minHeight:e,maxHeight:e})),this},q.prototype.show=function(){this.setInlineStyle("display","block")},q.prototype.click=function(a){var b=this,c=b.document.body;d(c,"click",function(c){a.call(b,c)})};var r=DISQUS.extend({},DISQUS.Events);return{version:function(){return h},on:r.on,off:r.off,trigger:r.trigger,throttle:f,addEvent:d,postMessage:e,WindowBase:m,Popup:n,Iframe:o,Channel:p,Sandbox:q}}}),DISQUS.define("JSON",function(){"use strict";var a=new DISQUS.Sandbox({container:"disqus_thread",contents:"<!doctype html><html><head><script>window.JSON=JSON</script></head></html>",styles:{display:"none"}}).load().window,b=a.JSON;if(!b)throw new Error("Cannot get JSON namespace from sandbox.");return{stringify:b.stringify,parse:b.parse}}),DISQUS.define("next.host.utils",function(a,b){"use strict";function c(a){if(!a||"embed.js"!==a.substring(a.length-8))return null;for(var b,c=[/(https?:)?\/\/(www\.)?disqus\.com\/forums\/([\w_\-]+)/i,/(https?:)?\/\/(www\.)?([\w_\-]+)\.disqus\.com/i,/(https?:)?\/\/(www\.)?dev\.disqus\.org\/forums\/([\w_\-]+)/i,/(https?:)?\/\/(www\.)?([\w_\-]+)\.dev\.disqus\.org/i],d=c.length,e=0;d>e;e++)if(b=a.match(c[e]),b&&b.length&&4===b.length)return b[3];return null}function d(a,b){var d,e,f,g=a.getElementsByTagName("script"),h=g.length;b=b||c;for(var i=h-1;i>=0;i--)if(d=g[i],e=d.getAttribute?d.getAttribute("src"):d.src,f=b(e),null!==f)return f.toLowerCase();return null}function e(a){return"https:"===a.toLowerCase()}function f(a,b){for(var c=0,d=new Array(a.length),e=0;e<=a.length;e++){d[e]=new Array(b.length);for(var f=0;f<=b.length;f++)d[e][f]=0}for(var g=0;g<a.length;g++)for(var h=0;h<b.length;h++)a[g]==b[h]&&(d[g+1][h+1]=d[g][h]+1,d[g+1][h+1]>c&&(c=d[g+1][h+1]));return c}function g(){for(var a=w.getElementsByTagName("h1"),c=w.title,d=c.length,e=c,g=.6,h=0;h<a.length;h++)!function(a){var h,i=a.textContent||a.innerText;null!==i&&i!==b&&(h=f(c,i)/d,h>g&&(g=h,e=i))}(a[h]);return e}function h(b,c,d){var e;return d=d||c,b===w?"":(a.getComputedStyle?e=w.defaultView.getComputedStyle(b,null).getPropertyValue(c):b.currentStyle&&(e=b.currentStyle[c]?b.currentStyle[c]:b.currentStyle[d]),"transparent"==e||""===e||"rgba(0, 0, 0, 0)"==e?h(b.parentNode,c,d):e||null)}function i(a){a.match("^rgb")&&(a=j(a).substr(1));var b=parseInt(a.substr(0,2),16),c=parseInt(a.substr(2,2),16),d=parseInt(a.substr(4,2),16),e=(299*b+587*c+114*d)/1e3;return e}function j(a){function b(a){return a=Number(a).toString(16),1==a.length?"0"+a:a}if("#"===a.substr(0,1))return a;var c=/.*?rgb\((\d+),\s*(\d+),\s*(\d+)\)/.exec(a);if(!c||4!==c.length)return"";var d=b(c[1]),e=b(c[2]),f=b(c[3]);return"#"+d+e+f}function k(a,b,c,d){DISQUS.isString(b)&&(b=w.createElement(b));var e=null;return b.style.visibility="hidden",a.appendChild(b),e=h(b,c,d),a.removeChild(b),e}function l(a){var b=w.createElement("a");return b.href=+new Date,k(a,b,"color")}function m(a){return a.toLowerCase().replace(/^\s+|\s+$/g,"").replace(/['"]/g,"")}function n(a){for(var b,c=k(a,"span","font-family","fontFamily"),d=c.split(","),e={courier:1,times:1,"times new roman":1,georgia:1,palatino:1,serif:1},f=0;f<d.length;f++)if(b=m(d[f]),e.hasOwnProperty(b))return!0;return!1}function o(a){return a.postMessage?a.JSON?0:"Microsoft Internet Explorer"===a.navigator.appName?2:1:1}function p(){var b=a.location.hash,c=b&&b.match(/comment\-([0-9]+)/);return c&&c[1]}function q(a){var b=a.navigator.userAgent;return-1!==b.indexOf("Mobi")&&-1===b.indexOf("iPad")}function r(a){(new Image).src=DISQUS.serialize(v+"/stat.gif",{event:a})}function s(b,c,d){return a.getComputedStyle?w.defaultView.getComputedStyle(b,null).getPropertyValue(c):b.currentStyle?b.currentStyle[c]?b.currentStyle[c]:b.currentStyle[d]:void 0}function t(a,b){for(var c=0,d=a.length;d>c;c++)b^=b<<5,b^=a.charCodeAt(c);return b&~(1<<31)}function u(a,b){return t(a,87049)%100<b}var v="//juggler.services.disqus.com",w=a.document;return{getShortnameFromUrl:c,getForum:d,isSSL:e,guessThreadTitle:g,getContrastYIQ:i,colorToHex:j,getElementStyle:k,getAnchorColor:l,normalizeFontValue:m,isSerif:n,getBrowserSupport:o,getPermalink:p,isMobile:q,logStat:r,getComputedStyle:s,djb2Hash:t,isInPercentile:u}}),DISQUS.define("next.host.app",function(a){"use strict";var b=DISQUS.isOwn,c=DISQUS.extend,d=DISQUS.use("next.host"),e=document.documentElement,f={getRegistry:function(){var a=this._registry;return a?a:this._registry={}},register:function(a){var b=this.getRegistry();b[a.uid]=a},unregister:function(a){var b=this.getRegistry();delete b[a.uid]},listByKey:function(){return this.getRegistry()},list:function(){var a=this.getRegistry(),c=[];for(var d in a)b(a,d)&&c.push(a[d]);revisuadoctests = """
Test simple loop with conditional
    >>> sum(i*i for i in range(100) if i&1 == 1)
    166650
Test simple nesting
    >>> list((i,j) for i in range(3) for j in range(4) )
    [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Test nesting with the inner expression dependent on the outer
    >>> list((i,j) for i in range(4) for j in range(i) )
    [(1, 0), (2, 0), (2, 1), (3, 0), (3, 1), (3, 2)]
Make sure the induction variable is not exposed
    >>> i = 20
    >>> sum(i*i for i in range(100))
    328350
    >>> i
    20
Test first class
    >>> g = (i*i for i in range(4))
    >>> type(g)
    <type 'generator'>
    >>> list(g)
    [0, 1, 4, 9]
Test direct calls to next()
    >>> g = (i*i for i in range(3))
    >>> g.next()
    >>> g.next()
    >>> g.next()
    >>> g.next()
    Traceback (most recent call last):
      File "<pyshell#21>", line 1, in -toplevel-
        g.next()
    StopIteration
Does it stay stopped?
    >>> g.next()
    Traceback (most recent call last):
      File "<pyshell#21>", line 1, in -toplevel-
        g.next()
    StopIteration
    >>> list(g)
    []
Test running gen when defining function is out of scope
    >>> def f(n):
    ...     return (i*i for i in xrange(n))
    >>> list(f(10))
    [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
    >>> def f(n):
    ...     return ((i,j) for i in xrange(3) for j in xrange(n))
    >>> list(f(4))
    [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
    >>> def f(n):
    ...     return ((i,j) for i in xrange(3) for j in xrange(4) if j in xrange(n))
    >>> list(f(4))
    [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
    >>> list(f(2))
    [(0, 0), (0, 1), (1, 0), (1, 1), (2, 0), (2, 1)]
Verify that parenthesis are required in a statement
    >>> def f(n):
    ...     return i*i for i in xrange(n)
    Traceback (most recent call last):
       ...
    SyntaxError: invalid syntax
Verify that parenthesis are required when used as a keyword argument value
    >>> dict(a = i for i in xrange(10))
    Traceback (most recent call last):
       ...
    SyntaxError: invalid syntax
Verify that parenthesis are required when used as a keyword argument value
    >>> dict(a = (i for i in xrange(10))) #doctest: +ELLIPSIS
    {'a': <generator object <genexpr> at ...>}
Verify early binding for the outermost for-expression
    >>> x=10
    >>> g = (i*i for i in range(x))
    >>> x = 5
    >>> list(g)
    [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Verify that the outermost for-expression makes an immediate check
for iterability
    >>> (i for i in 6)
    Traceback (most recent call last):
      File "<pyshell#4>", line 1, in -toplevel-
        (i for i in 6)
    TypeError: 'int' object is not iterable
Verify late binding for the outermost if-expression
    >>> include = (2,4,6,8)
    >>> g = (i*i for i in range(10) if i in include)
    >>> include = (1,3,5,7,9)
    >>> list(g)
    [1, 9, 25, 49, 81]
Verify late binding for the innermost for-expression
    >>> g = ((i,j) for i in range(3) for j in range(x))
    >>> x = 4
    >>> list(g)
    [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Verify re-use of tuples (a side benefit of using genexps over listcomps)
    >>> tupleids = map(id, ((i,i) for i in xrange(10)))
    >>> int(max(tupleids) - min(tupleids))
Verify that syntax error's are raised for genexps used as lvalues
    >>> (y for y in (1,2)) = 10
    Traceback (most recent call last):
       ...
      File "<doctest test.test_genexps.__test__.doctests[40]>", line 1
    SyntaxError: can't assign to generator expression
    >>> (y for y in (1,2)) += 10
    Traceback (most recent call last):
       ...
      File "<doctest test.test_genexps.__test__.doctests[41]>", line 1
    SyntaxError: can't assign to generator expression
########### Tests borrowed from or inspired by test_generators.py ############
Make a generator that acts like range()
    >>> yrange = lambda n:  (i for i in xrange(n))
    >>> list(yrange(10))
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Generators always return to the most recent caller:
    >>> def creator():
    ...     r = yrange(5)
    ...     print "creator", r.next()
    ...     return r
    >>> def caller():
    ...     r = creator()
    ...     for i in r:
    ...             print "caller", i
    >>> caller()
    creator 0
    caller 1
    caller 2
    caller 3
    caller 4
Generators can call other generators:
    >>> def zrange(n):
    ...     for i in yrange(n):
    ...         yield i
    >>> list(zrange(5))
    [0, 1, 2, 3, 4]
Verify that a gen exp cannot be resumed while it is actively running:
    >>> g = (me.next() for i in xrange(10))
    >>> me = g
    >>> me.next()
    Traceback (most recent call last):
      File "<pyshell#30>", line 1, in -toplevel-
        me.next()
      File "<pyshell#28>", line 1, in <generator expression>
        g = (me.next() for i in xrange(10))
    ValueError: generator already executing
Verify exception propagation
    >>> g = (10 // i for i in (5, 0, 2))
    >>> g.next()
    >>> g.next()
    Traceback (most recent call last):
      File "<pyshell#37>", line 1, in -toplevel-
        g.next()
      File "<pyshell#35>", line 1, in <generator expression>
        g = (10 // i for i in (5, 0, 2))
    ZeroDivisionError: integer division or modulo by zero
    >>> g.next()
    Traceback (most recent call last):
      File "<pyshell#38>", line 1, in -toplevel-
        g.next()
    StopIteration
Make sure that None is a valid return value
    >>> list(None for i in xrange(10))
    [None, None, None, None, None, None, None, None, None, None]
Check that generator attributes are present
    >>> g = (i*i for i in range(3))
    >>> expected = set(['gi_frame', 'gi_running', 'next'])
    >>> set(attr for attr in dir(g) if not attr.startswith('__')) >= expected
    True
    >>> from test.test_support import HAVE_DOCSTRINGS
    >>> print(g.next.__doc__ if HAVE_DOCSTRINGS else 'x.next() -> the next value, or raise StopIteration')
    x.next() -> the next value, or raise StopIteration
    >>> import types
    >>> isinstance(g, types.GeneratorType)
    True
Check the __iter__ slot is defined to return self
    >>> iter(g) is g
    True
Verify that the running flag is set properly
    >>> g = (me.gi_running for i in (0,1))
    >>> me = g
    >>> me.gi_running
    >>> me.next()
    >>> me.gi_running
Verify that genexps are weakly referencable
    >>> import weakref
    >>> g = (i*i for i in range(4))
    >>> wr = weakref.ref(g)
    >>> wr() is g
    True
    >>> p = weakref.proxy(g)
    >>> list(p)
    [0, 1, 4, 9]
__test__ = {'doctests' : doctests}
def test_main(verbose=None):
    import sys
    from test import test_support
    from test import test_genexps
    test_support.run_doctest(test_genexps, verbose)
    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_doctest(test_genexps, verbose)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts
if __name__ == "__main__":
    test_main(verbose=True)
visua# Tests universal newline support for both reading and parsing files.
# NOTE: this file tests the new `io` library backported from Python 3.x.
# Similar tests for the builtin file object can be found in test_univnewlines2k.py.
from __future__ import print_function
from __future__ import unicode_literals
import io
import _pyio as pyio
import unittest
import os
import sys
from test import test_support as support
if not hasattr(sys.stdin, 'newlines'):
    raise unittest.SkipTest(
        "This Python does not have universal newline support")
FATX = 'x' * (2**14)
DATA_TEMPLATE = [
    "line1=1",
    "line2='this is a very long line designed to go past any default " +
        "buffer limits that exist in io.py but we also want to test " +
        "the uncommon case, naturally.'",
    "def line3():pass",
    "line4 = '%s'" % FATX,
DATA_LF = "\n".join(DATA_TEMPLATE) + "\n"
DATA_CR = "\r".join(DATA_TEMPLATE) + "\r"
DATA_CRLF = "\r\n".join(DATA_TEMPLATE) + "\r\n"
# Note that DATA_MIXED also tests the ability to recognize a lone \r
# before end-of-file.
DATA_MIXED = "\n".join(DATA_TEMPLATE) + "\r"
DATA_SPLIT = [x + "\n" for x in DATA_TEMPLATE]
class TestGenericUnivNewlines(unittest.TestCase):
    # use a class variable DATA to define the data to write to the file
    # and a class variable NEWLINE to set the expected newlines value
    READMODE = 'r'
    WRITEMODE = 'wb'
    def setUp(self):
        data = self.DATA
        if "b" in self.WRITEMODE:
            data = data.encode("ascii")
        with self.open(support.TESTFN, self.WRITEMODE) as fp:
            fp.write(data)
    def tearDown(self):
        try:
            os.unlink(support.TESTFN)
        except:
            pass
    def test_read(self):
        with self.open(support.TESTFN, self.READMODE) as fp:
            data = fp.read()
        self.assertEqual(data, DATA_LF)
        self.assertEqual(set(fp.newlines), set(self.NEWLINE))
    def test_readlines(self):
        with self.open(support.TESTFN, self.READMODE) as fp:
            data = fp.readlines()
        self.assertEqual(data, DATA_SPLIT)
        self.assertEqual(set(fp.newlines), set(self.NEWLINE))
    def test_readline(self):
        with self.open(support.TESTFN, self.READMODE) as fp:
            data = []
            d = fp.readline()
            while d:
                data.append(d)
                d = fp.readline()
        self.assertEqual(data, DATA_SPLIT)
        self.assertEqual(set(fp.newlines), set(self.NEWLINE))
    def test_seek(self):
        with self.open(support.TESTFN, self.READMODE) as fp:
            fp.readline()
            pos = fp.tell()
            data = fp.readlines()
            self.assertEqual(data, DATA_SPLIT[1:])
            fp.seek(pos)
            data = fp.readlines()
        self.assertEqual(data, DATA_SPLIT[1:])
class TestCRNewlines(TestGenericUnivNewlines):
    NEWLINE = '\r'
    DATA = DATA_CR
class TestLFNewlines(TestGenericUnivNewlines):
    NEWLINE = '\n'
    DATA = DATA_LF
class TestCRLFNewlines(TestGenericUnivNewlines):
    NEWLINE = '\r\n'
    DATA = DATA_CRLF
    def test_tell(self):
        with self.open(support.TESTFN, self.READMODE) as fp:
            self.assertEqual(repr(fp.newlines), repr(None))
            data = fp.readline()
            pos = fp.tell()
        self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
class TestMixedNewlines(TestGenericUnivNewlines):
    NEWLINE = ('\r', '\n')
    DATA = DATA_MIXED
def test_main():
    base_tests = (TestCRNewlines,
                  TestLFNewlines,
                  TestCRLFNewlines,
                  TestMixedNewlines)
    tests = []
    # Test the C and Python implementations.
    for test in base_tests:
        class CTest(test):
            open = io.open
        CTest.__name__ = str("C" + test.__name__)
        class PyTest(test):
            open = staticmethod(pyio.open)
        PyTest.__name__ = str("Py" + test.__name__)
        tests.append(CTest)
        tests.append(PyTest)
    support.run_unittest(*tests)
if __name__ == '__main__':
    test_main()
visua#!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
import sys
import collections
__all__ = ["UserString","MutableString"]
class UserString(collections.Sequence):
    def __init__(self, seq):
        if isinstance(seq, basestring):
            self.data = seq
        elif isinstance(seq, UserString):
            self.data = seq.data[:]
        else:
            self.data = str(seq)
    def __str__(self): return str(self.data)
    def __repr__(self): return repr(self.data)
    def __int__(self): return int(self.data)
    def __long__(self): return long(self.data)
    def __float__(self): return float(self.data)
    def __complex__(self): return complex(self.data)
    def __hash__(self): return hash(self.data)
    def __cmp__(self, string):
        if isinstance(string, UserString):
            return cmp(self.data, string.data)
        else:
            return cmp(self.data, string)
    def __contains__(self, char):
        return char in self.data
    def __len__(self): return len(self.data)
    def __getitem__(self, index): return self.__class__(self.data[index])
    def __getslice__(self, start, end):
        start = max(start, 0); end = max(end, 0)
        return self.__class__(self.data[start:end])
    def __add__(self, other):
        if isinstance(other, UserString):
            return self.__class__(self.data + other.data)
        elif isinstance(other, basestring):
            return self.__class__(self.data + other)
        else:
            return self.__class__(self.data + str(other))
    def __radd__(self, other):
        if isinstance(other, basestring):
            return self.__class__(other + self.data)
        else:
            return self.__class__(str(other) + self.data)
    def __mul__(self, n):
        return self.__class__(self.data*n)
    __rmul__ = __mul__
    def __mod__(self, args):
        return self.__class__(self.data % args)
    # the following methods are defined in alphabetical order:
    def capitalize(self): return self.__class__(self.data.capitalize())
    def center(self, width, *args):
        return self.__class__(self.data.center(width, *args))
    def count(self, sub, start=0, end=sys.maxint):
        return self.data.count(sub, start, end)
    def decode(self, encoding=None, errors=None): # XXX improve this?
        if encoding:
            if errors:
                return self.__class__(self.data.decode(encoding, errors))
            else:
                return self.__class__(self.data.decode(encoding))
        else:
            return self.__class__(self.data.decode())
    def encode(self, encoding=None, errors=None): # XXX improve this?
        if encoding:
            if errors:
                return self.__class__(self.data.encode(encoding, errors))
            else:
                return self.__class__(self.data.encode(encoding))
        else:
            return self.__class__(self.data.encode())
    def endswith(self, suffix, start=0, end=sys.maxint):
        return self.data.endswith(suffix, start, end)
    def expandtabs(self, tabsize=8):
        return self.__class__(self.data.expandtabs(tabsize))
    def find(self, sub, start=0, end=sys.maxint):
        return self.data.find(sub, start, end)
    def index(self, sub, start=0, end=sys.maxint):
        return self.data.index(sub, start, end)
    def isalpha(self): return self.data.isalpha()
    def isalnum(self): return self.data.isalnum()
    def isdecimal(self): return self.data.isdecimal()
    def isdigit(self): return self.data.isdigit()
    def islower(self): return self.data.islower()
    def isnumeric(self): return self.data.isnumeric()
    def isspace(self): return self.data.isspace()
    def istitle(self): return self.data.istitle()
    def isupper(self): return self.data.isupper()
    def join(self, seq): return self.data.join(seq)
    def ljust(self, width, *args):
        return self.__class__(self.data.ljust(width, *args))
    def lower(self): return self.__class__(self.data.lower())
    def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars))
    def partition(self, sep):
        return self.data.partition(sep)
    def replace(self, old, new, maxsplit=-1):
        return self.__class__(self.data.replace(old, new, maxsplit))
    def rfind(self, sub, start=0, end=sys.maxint):
        return self.data.rfind(sub, start, end)
    def rindex(self, sub, start=0, end=sys.maxint):
        return self.data.rindex(sub, start, end)
    def rjust(self, width, *args):
        return self.__class__(self.data.rjust(width, *args))
    def rpartition(self, sep):
        return self.data.rpartition(sep)
    def rstrip(self, chars=None): return self.__class__(self.data.rstrip(chars))
    def split(self, sep=None, maxsplit=-1):
        return self.data.split(sep, maxsplit)
    def rsplit(self, sep=None, maxsplit=-1):
        return self.data.rsplit(sep, maxsplit)
    def splitlines(self, keepends=0): return self.data.splitlines(keepends)
    def startswith(self, prefix, start=0, end=sys.maxint):
        return self.data.startswith(prefix, start, end)
    def strip(self, chars=None): return self.__class__(self.data.strip(chars))
    def swapcase(self): return self.__class__(self.data.swapcase())
    def title(self): return self.__class__(self.data.title())
    def translate(self, *args):
        return self.__class__(self.data.translate(*args))
    def upper(self): return self.__class__(self.data.upper())
    def zfill(self, width): return self.__class__(self.data.zfill(width))
class MutableString(UserString, collections.MutableSequence):
    """mutable string objects
    Python strings are immutable objects.  This has the advantage, that
    strings may be used as dictionary keys.  If this property isn't needed
    and you insist on changing string values in place instead, you may cheat
    and use MutableString.
    But the purpose of this class is an educational one: to prevent
    people from inventing their own mutable string class derived
    from UserString and than forget thereby to remove (override) the
    __hash__ method inherited from UserString.  This would lead to
    errors that would be very hard to track down.
    A faster and better solution is to rewrite your program using lists."""
    def __init__(self, string=""):
        from warnings import warnpy3k
        warnpy3k('the class UserString.MutableString has been removed in '
                    'Python 3.0', stacklevel=2)
        self.data = string
    # We inherit object.__hash__, so we must deny this explicitly
    __hash__ = None
    def __setitem__(self, index, sub):
        if isinstance(index, slice):
            if isinstance(sub, UserString):
                sub = sub.data
            elif not isinstance(sub, basestring):
                sub = str(sub)
            start, stop, step = index.indices(len(self.data))
            if step == -1:
                start, stop = stop+1, start+1
                sub = sub[::-1]
            elif step != 1:
                # XXX(twouters): I guess we should be reimplementing
                # the extended slice assignment/deletion algorithm here...
                raise TypeError, "invalid step in slicing assignment"
            start = min(start, stop)
            self.data = self.data[:start] + sub + self.data[stop:]
        else:
            if index < 0:
                index += len(self.data)
            if index < 0 or index >= len(self.data): raise IndexError
            self.data = self.data[:index] + sub + self.data[index+1:]
    def __delitem__(self, index):
        if isinstance(index, slice):
            start, stop, step = index.indices(len(self.data))
            if step == -1:
                start, stop = stop+1, start+1
            elif step != 1:
                # XXX(twouters): see same block in __setitem__
                raise TypeError, "invalid step in slicing deletion"
            start = min(start, stop)
            self.data = self.data[:start] + self.data[stop:]
        else:
            if index < 0:
                index += len(self.data)
            if index < 0 or index >= len(self.data): raise IndexError
            self.data = self.data[:index] + self.data[index+1:]
    def __setslice__(self, start, end, sub):
        start = max(start, 0); end = max(end, 0)
        if isinstance(sub, UserString):
            self.data = self.data[:start]+sub.data+self.data[end:]
        elif isinstance(sub, basestring):
            self.data = self.data[:start]+sub+self.data[end:]
        else:
            self.data =  self.data[:start]+str(sub)+self.data[end:]
    def __delslice__(self, start, end):
        start = max(start, 0); end = max(end, 0)
        self.data = self.data[:start] + self.data[end:]
    def immutable(self):
        return UserString(self.data)
    def __iadd__(self, other):
        if isinstance(other, UserString):
            self.data += other.data
        elif isinstance(other, basestring):
            self.data += other
        else:
            self.data += str(other)
        return self
    def __imul__(self, n):
        self.data *= n
        return self
    def insert(self, index, value):
        self[index:index] = value
if __name__ == "__main__":
    # execute the regression test to stdout, if called as a script:
    import os
    called_in_dir, called_as = os.path.split(sys.argv[0])
    called_as, py = os.path.splitext(called_as)
    if '-q' in sys.argv:
        from test import test_support
        test_support.verbose = 0
    __import__('test.test_' + called_as.lower())
visuaThis is example 64-bit setup file: mso_example\x64\ship\x-none\msoexamplea.txtvisua
[Content_Types].xml
_rels/.rels
theme/theme/themeManager.xml
theme/theme/theme1.xml
w toc'v
3Vq%'#q
:\TZaG
IqbJ#x
T[XF64
theme/theme/_rels/themeManager.xml.rels
K(M&$R(.1
[Content_Types].xmlPK
_rels/.relsPK
theme/theme/themeManager.xmlPK
theme/theme/theme1.xmlPK
theme/theme/_rels/themeManager.xml.relsPK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>
Normal.dotm
Microsoft Office Word
Microsoft Office Word 97-2003 Document
MSWordDoc
Word.Document.8
visuaGIF89a
=fPHS.