Disable messages upon loading a package

Just use suppressMessages() around your library() call: edd@max:~$ R R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) […] R> suppressMessages(library(ROCR)) R> # silently loaded R> search() [1] “.GlobalEnv” “package:ROCR” # it’s really there [3] “package:gplots” “package:KernSmooth” [5] “package:grid” “package:caTools” [7] “package:bitops” “package:gdata” [9] “package:gtools” “package:stats” … Read more

How can I add FacesMessage during page load? Using @PostConstruct does not seem to work

That can happen when the message component is rendered before the message is added. In your specific example, the bean is referenced for the first time by the <h:outputText> component and thus constructed for the first time at that moment. But the <h:outputText> component appears in your specific example after the <p:messages> component, so the … Read more

How to show faces message in the redirected page

Keep the message in the flash scope. It’ll survive the redirect. context.addMessage(clientId, message); externalContext.getFlash().setKeepMessages(true); return “users.xhtml?faces-redirect=true”; Note that older Mojarra versions have some peculiar Flash scope related bugs: issue 1755 – Flash scoped messages lives longer than next request – fixed in 2.0.7 / 2.1.4 issue 2130 – Flash cookie enables data exploits – fixed … Read more

Php mail: how to send html?

use this header for the mail: $header = “MIME-Version: 1.0\r\n”; $header .= “Content-type: text/html; charset: utf8\r\n”; and for the content/body: <html> <head> <meta http-equiv=”content-type” content=”text/html; charset=utf-8″ /> … … … it’s important to use inline css commands and recommanded to use tables for the interface. … In your Mail-Body you than have to put HTML … Read more

How to send email to multiple recipients using python smtplib?

This really works, I spent a lot of time trying multiple variants. import smtplib from email.mime.text import MIMEText s = smtplib.SMTP(‘smtp.uk.xensource.com’) s.set_debuglevel(1) msg = MIMEText(“””body”””) sender=”[email protected]” recipients = [‘[email protected]’, ‘[email protected]’] msg[‘Subject’] = “subject line” msg[‘From’] = sender msg[‘To’] = “, “.join(recipients) s.sendmail(sender, recipients, msg.as_string())

How to show the “Are you sure you want to navigate away from this page?” when changes committed?

Update (2017) Modern browsers now consider displaying a custom message to be a security hazard and it has therefore been removed from all of them. Browsers now only display generic messages. Since we no longer have to worry about setting the message, it is as simple as: // Enable navigation prompt window.onbeforeunload = function() { … Read more