# Buggy code
def retranslateUi(self, MainWindow):
    MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None))
    self.inboxSearchLineEdit.setPlaceholderText(
        _translate("MainWindow", "Search", None)
    )
    self.inboxSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None))
    self.inboxSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None))
    self.inboxSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None))
    self.inboxSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None))
    self.inboxSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None))
    self.tableWidgetInbox.setSortingEnabled(True)
    item = self.tableWidgetInbox.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "To", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "From", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Subject", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(3)
    item.setText(_translate("MainWindow", "Received", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Inbox", None)
    )
    self.pushButtonLoadFromAddressBook.setText(
        _translate("MainWindow", "Load from Address book", None)
    )
    self.pushButtonFetchNamecoinID.setText(
        _translate("MainWindow", "Fetch Namecoin ID", None)
    )
    self.label_4.setText(_translate("MainWindow", "Message:", None))
    self.label_3.setText(_translate("MainWindow", "Subject:", None))
    self.radioButtonSpecific.setText(
        _translate("MainWindow", "Send to one or more specific people", None)
    )
    self.textEditMessage.setHtml(
        _translate(
            "MainWindow",
            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
            '<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
            "p, li { white-space: pre-wrap; }\n"
            "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
            '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
            None,
        )
    )
    self.label.setText(_translate("MainWindow", "To:", None))
    self.label_2.setText(_translate("MainWindow", "From:", None))
    self.radioButtonBroadcast.setText(
        _translate(
            "MainWindow",
            "Broadcast to everyone who is subscribed to your address",
            None,
        )
    )
    self.pushButtonSend.setText(_translate("MainWindow", "Send", None))
    self.labelSendBroadcastWarning.setText(
        _translate(
            "MainWindow",
            "Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.",
            None,
        )
    )
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)
    )
    self.sentSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None))
    self.sentSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None))
    self.sentSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None))
    self.sentSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None))
    self.sentSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None))
    self.sentSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None))
    self.tableWidgetSent.setSortingEnabled(True)
    item = self.tableWidgetSent.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "To", None))
    item = self.tableWidgetSent.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "From", None))
    item = self.tableWidgetSent.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Subject", None))
    item = self.tableWidgetSent.horizontalHeaderItem(3)
    item.setText(_translate("MainWindow", "Status", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.sent), _translate("MainWindow", "Sent", None)
    )
    self.pushButtonNewAddress.setText(_translate("MainWindow", "New", None))
    self.tableWidgetYourIdentities.setSortingEnabled(True)
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Label (not shown to anyone)", None))
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Stream", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.youridentities),
        _translate("MainWindow", "Your Identities", None),
    )
    self.label_5.setText(
        _translate(
            "MainWindow",
            "Here you can subscribe to 'broadcast messages' that are sent by other users. Messages will appear in your Inbox. Addresses here override those on the Blacklist tab.",
            None,
        )
    )
    self.pushButtonAddSubscription.setText(
        _translate("MainWindow", "Add new Subscription", None)
    )
    self.tableWidgetSubscriptions.setSortingEnabled(True)
    item = self.tableWidgetSubscriptions.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Label", None))
    item = self.tableWidgetSubscriptions.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.subscriptions),
        _translate("MainWindow", "Subscriptions", None),
    )
    self.label_6.setText(
        _translate(
            "MainWindow",
            "The Address book is useful for adding names or labels to other people's Bitmessage addresses so that you can recognize them more easily in your inbox. You can add entries here using the 'Add' button, or from your inbox by right-clicking on a message.",
            None,
        )
    )
    self.pushButtonAddAddressBook.setText(
        _translate("MainWindow", "Add new entry", None)
    )
    self.tableWidgetAddressBook.setSortingEnabled(True)
    item = self.tableWidgetAddressBook.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Name or Label", None))
    item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.addressbook),
        _translate("MainWindow", "Address Book", None),
    )
    self.radioButtonBlacklist.setText(
        _translate(
            "MainWindow",
            "Use a Blacklist (Allow all incoming messages except those on the Blacklist)",
            None,
        )
    )
    self.radioButtonWhitelist.setText(
        _translate(
            "MainWindow",
            "Use a Whitelist (Block all incoming messages except those on the Whitelist)",
            None,
        )
    )
    self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry", None))
    self.tableWidgetBlacklist.setSortingEnabled(True)
    item = self.tableWidgetBlacklist.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Name or Label", None))
    item = self.tableWidgetBlacklist.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.blackwhitelist),
        _translate("MainWindow", "Blacklist", None),
    )
    item = self.tableWidgetConnectionCount.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Stream #", None))
    item = self.tableWidgetConnectionCount.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Connections", None))
    self.labelTotalConnections.setText(
        _translate("MainWindow", "Total connections: 0", None)
    )
    self.labelStartupTime.setText(
        _translate("MainWindow", "Since startup at asdf:", None)
    )
    self.labelMessageCount.setText(
        _translate("MainWindow", "Processed 0 person-to-person message.", None)
    )
    self.labelPubkeyCount.setText(
        _translate("MainWindow", "Processed 0 public key.", None)
    )
    self.labelBroadcastCount.setText(
        _translate("MainWindow", "Processed 0 broadcast.", None)
    )
    self.labelLookupsPerSecond.setText(
        _translate("MainWindow", "Inventory lookups per second: 0", None)
    )
    self.labelBytesRecvCount.setText(_translate("MainWindow", "Down: 0 KB/s", None))
    self.labelBytesSentCount.setText(_translate("MainWindow", "Up: 0 KB/s", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.networkstatus),
        _translate("MainWindow", "Network Status", None),
    )
    self.menuFile.setTitle(_translate("MainWindow", "File", None))
    self.menuSettings.setTitle(_translate("MainWindow", "Settings", None))
    self.menuHelp.setTitle(_translate("MainWindow", "Help", None))
    self.actionImport_keys.setText(_translate("MainWindow", "Import keys", None))
    self.actionManageKeys.setText(_translate("MainWindow", "Manage keys", None))
    self.actionExit.setText(_translate("MainWindow", "Quit", None))
    self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q", None))
    self.actionHelp.setText(_translate("MainWindow", "Help", None))
    self.actionHelp.setShortcut(_translate("MainWindow", "F1", None))
    self.actionAbout.setText(_translate("MainWindow", "About", None))
    self.actionSettings.setText(_translate("MainWindow", "Settings", None))
    self.actionRegenerateDeterministicAddresses.setText(
        _translate("MainWindow", "Regenerate deterministic addresses", None)
    )
    self.actionDeleteAllTrashedMessages.setText(
        _translate("MainWindow", "Delete all trashed messages", None)
    )
    self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None))


# Traceback (ZeroDivisionError)
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\AdminRoot\TBM\PyBitmessage\src\class_addressGenerator.py", line 101,in run
print 'Address generator calculated', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix, 'addresses at', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix / (time.time() - startTime), 'addresses per second before finding one with the correct ripe-prefix.'
ZeroDivisionError: float division by zero

# Fixed code
def retranslateUi(self, MainWindow):
    MainWindow.setWindowTitle(_translate("MainWindow", "Bitmessage", None))
    self.inboxSearchLineEdit.setPlaceholderText(
        _translate("MainWindow", "Search", None)
    )
    self.inboxSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None))
    self.inboxSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None))
    self.inboxSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None))
    self.inboxSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None))
    self.inboxSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None))
    self.tableWidgetInbox.setSortingEnabled(True)
    item = self.tableWidgetInbox.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "To", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "From", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Subject", None))
    item = self.tableWidgetInbox.horizontalHeaderItem(3)
    item.setText(_translate("MainWindow", "Received", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.inbox), _translate("MainWindow", "Inbox", None)
    )
    self.pushButtonLoadFromAddressBook.setText(
        _translate("MainWindow", "Load from Address book", None)
    )
    self.pushButtonFetchNamecoinID.setText(
        _translate("MainWindow", "Fetch Namecoin ID", None)
    )
    self.label_4.setText(_translate("MainWindow", "Message:", None))
    self.label_3.setText(_translate("MainWindow", "Subject:", None))
    self.radioButtonSpecific.setText(
        _translate("MainWindow", "Send to one or more specific people", None)
    )
    self.textEditMessage.setHtml(
        _translate(
            "MainWindow",
            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
            '<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
            "p, li { white-space: pre-wrap; }\n"
            "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
            '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
            None,
        )
    )
    self.label.setText(_translate("MainWindow", "To:", None))
    self.label_2.setText(_translate("MainWindow", "From:", None))
    self.radioButtonBroadcast.setText(
        _translate(
            "MainWindow",
            "Broadcast to everyone who is subscribed to your address",
            None,
        )
    )
    self.pushButtonSend.setText(_translate("MainWindow", "Send", None))
    self.labelSendBroadcastWarning.setText(
        _translate(
            "MainWindow",
            "Be aware that broadcasts are only encrypted with your address. Anyone who knows your address can read them.",
            None,
        )
    )
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.send), _translate("MainWindow", "Send", None)
    )
    self.sentSearchLineEdit.setPlaceholderText(_translate("MainWindow", "Search", None))
    self.sentSearchOptionCB.setItemText(0, _translate("MainWindow", "All", None))
    self.sentSearchOptionCB.setItemText(1, _translate("MainWindow", "To", None))
    self.sentSearchOptionCB.setItemText(2, _translate("MainWindow", "From", None))
    self.sentSearchOptionCB.setItemText(3, _translate("MainWindow", "Subject", None))
    self.sentSearchOptionCB.setItemText(4, _translate("MainWindow", "Message", None))
    self.tableWidgetSent.setSortingEnabled(True)
    item = self.tableWidgetSent.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "To", None))
    item = self.tableWidgetSent.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "From", None))
    item = self.tableWidgetSent.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Subject", None))
    item = self.tableWidgetSent.horizontalHeaderItem(3)
    item.setText(_translate("MainWindow", "Status", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.sent), _translate("MainWindow", "Sent", None)
    )
    self.pushButtonNewAddress.setText(_translate("MainWindow", "New", None))
    self.tableWidgetYourIdentities.setSortingEnabled(True)
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Label (not shown to anyone)", None))
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    item = self.tableWidgetYourIdentities.horizontalHeaderItem(2)
    item.setText(_translate("MainWindow", "Stream", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.youridentities),
        _translate("MainWindow", "Your Identities", None),
    )
    self.label_5.setText(
        _translate(
            "MainWindow",
            "Here you can subscribe to 'broadcast messages' that are sent by other users. Messages will appear in your Inbox. Addresses here override those on the Blacklist tab.",
            None,
        )
    )
    self.pushButtonAddSubscription.setText(
        _translate("MainWindow", "Add new Subscription", None)
    )
    self.tableWidgetSubscriptions.setSortingEnabled(True)
    item = self.tableWidgetSubscriptions.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Label", None))
    item = self.tableWidgetSubscriptions.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.subscriptions),
        _translate("MainWindow", "Subscriptions", None),
    )
    self.label_6.setText(
        _translate(
            "MainWindow",
            "The Address book is useful for adding names or labels to other people's Bitmessage addresses so that you can recognize them more easily in your inbox. You can add entries here using the 'Add' button, or from your inbox by right-clicking on a message.",
            None,
        )
    )
    self.pushButtonAddAddressBook.setText(
        _translate("MainWindow", "Add new entry", None)
    )
    self.tableWidgetAddressBook.setSortingEnabled(True)
    item = self.tableWidgetAddressBook.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Name or Label", None))
    item = self.tableWidgetAddressBook.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.addressbook),
        _translate("MainWindow", "Address Book", None),
    )
    self.radioButtonBlacklist.setText(
        _translate(
            "MainWindow",
            "Use a Blacklist (Allow all incoming messages except those on the Blacklist)",
            None,
        )
    )
    self.radioButtonWhitelist.setText(
        _translate(
            "MainWindow",
            "Use a Whitelist (Block all incoming messages except those on the Whitelist)",
            None,
        )
    )
    self.pushButtonAddBlacklist.setText(_translate("MainWindow", "Add new entry", None))
    self.tableWidgetBlacklist.setSortingEnabled(True)
    item = self.tableWidgetBlacklist.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Name or Label", None))
    item = self.tableWidgetBlacklist.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Address", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.blackwhitelist),
        _translate("MainWindow", "Blacklist", None),
    )
    item = self.tableWidgetConnectionCount.horizontalHeaderItem(0)
    item.setText(_translate("MainWindow", "Stream #", None))
    item = self.tableWidgetConnectionCount.horizontalHeaderItem(1)
    item.setText(_translate("MainWindow", "Connections", None))
    self.labelTotalConnections.setText(
        _translate("MainWindow", "Total connections:", None)
    )
    self.labelStartupTime.setText(_translate("MainWindow", "Since startup:", None))
    self.labelMessageCount.setText(
        _translate("MainWindow", "Processed 0 person-to-person messages.", None)
    )
    self.labelPubkeyCount.setText(
        _translate("MainWindow", "Processed 0 public keys.", None)
    )
    self.labelBroadcastCount.setText(
        _translate("MainWindow", "Processed 0 broadcasts.", None)
    )
    self.labelLookupsPerSecond.setText(
        _translate("MainWindow", "Inventory lookups per second: 0", None)
    )
    self.labelBytesRecvCount.setText(_translate("MainWindow", "Down: 0 KB/s", None))
    self.labelBytesSentCount.setText(_translate("MainWindow", "Up: 0 KB/s", None))
    self.tabWidget.setTabText(
        self.tabWidget.indexOf(self.networkstatus),
        _translate("MainWindow", "Network Status", None),
    )
    self.menuFile.setTitle(_translate("MainWindow", "File", None))
    self.menuSettings.setTitle(_translate("MainWindow", "Settings", None))
    self.menuHelp.setTitle(_translate("MainWindow", "Help", None))
    self.actionImport_keys.setText(_translate("MainWindow", "Import keys", None))
    self.actionManageKeys.setText(_translate("MainWindow", "Manage keys", None))
    self.actionExit.setText(_translate("MainWindow", "Quit", None))
    self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q", None))
    self.actionHelp.setText(_translate("MainWindow", "Help", None))
    self.actionHelp.setShortcut(_translate("MainWindow", "F1", None))
    self.actionAbout.setText(_translate("MainWindow", "About", None))
    self.actionSettings.setText(_translate("MainWindow", "Settings", None))
    self.actionRegenerateDeterministicAddresses.setText(
        _translate("MainWindow", "Regenerate deterministic addresses", None)
    )
    self.actionDeleteAllTrashedMessages.setText(
        _translate("MainWindow", "Delete all trashed messages", None)
    )
    self.actionJoinChan.setText(_translate("MainWindow", "Join / Create chan", None))