How can I tell (in php) if a site is visited through a mobile device?  I can't use get_browser() because I'm not able to edit php.ini (to set the path of browscap.ini).
We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based).  Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly.  Is there a standard way to make this determination (quickly) based on the http request, and ideally glean more information about the given browser and device making the request (screen size, html capabilities, etc?).  I would also appreciate any supplemental information that would be of use from someone who has gone down this path of taking an existing large scale enterprise webapp and architect-ing out mobile browser support from the development side.  [edit] I certainly understand the request header and the information about a database of standard user agents is a great help.  For those talking about 'other' request header properties, if you could include similar standardized name / resource of values that would be a big help.  [edit] Several users have proposed solutions that involve a call over the wire to some web service that will do the detection.  While I'm sure this works, it is not a good solution for an enterprise e-commerce site for two reasons: 1) speed.  A call over the wire for every page request to a third party would have huge performance implications.  2) dependency/legal.  We'd tie our website response time and key functionality to their service, which is horrible for legal and risk reasons.
Maximum and minimum of of $f(x)=|x-1|+|x-2|+|x-3|$ Fundamental Theorem of Algebra - an elementary complex analysis proof? We begin by assuming that a non-constant complex polynomial $$p(z)=a_n z^n+a_{n-1}z^{n-1}+...+a_1 z+a_0,$$ where $a_0 \neq 0$, doesn't vanish in $\mathbb{C}$. Therefore $1/p$ is also an analytical function everywhere. Note that $(p(z)-a_0)/z$ is a polynomial and therefore, due to Cauchy's theorem, the following integral must be zero.  $$\int_{S_r^1}\frac{(p(z)-a_0)/z}{p(z)}dz=\int_{S_r^1}\frac{a_nz^{n-1}+a_{n-1}z^{n-2}+...+a_1}{a_nz^n+a_{n-1}z^{n-1}+...+a_1 z+a_0}dz=0.$$  On the other hand  $$\int_{S_r^1}\frac{a_nz^{n-1}+a_{n-1}z^{n-2}+...+a_1}{a_nz^n+a_{n-1}z^{n-1}+...+a_1 z+a_0}dz$$  $$=\int_{0}^{2\pi}\frac{a_n(re^{i\theta})^{n-1}+a_{n-1}(re^{i\theta})^{n-2}+...+a_1}{a_n(re^{\theta})^n+a_{n-1}(re^{i\theta})^{n-1}+...+a_1 (re^{i\theta})+a_0}(ire^{i\theta})d\theta$$  $$=\int_{0}^{2\pi}i d\theta - \int_{0}^{2\pi}\frac{a_0 i}{a_n(re^{i\theta})^n+a_{n-1}(re^{i\theta})^{n-1}+...+a_1 (re^{i\theta})+a_0}d\theta$$ $$=2\pi i -\int_{0}^{2\pi}\frac{a_0i}{p(re^{i\theta})}d\theta.$$  Let $r \rightarrow \infty$ and the integral approaches value $2\pi i$ - a contradiction. Therefore $1/p$ can't be entire and $p$ must vanish somewhere in the complex plane.  EDIT: I have changed this post and deleted the idea that the integral $\int_{\partial D_r}\frac{(p(z)-a_0)/z}{p(z)}dz=0$ could be evaluated with the fundamental theorem of calculus. Now, as it stands, this proof is essentially the same as the one that Mr. José Carlos Santos points out in his comment. Overriding some DNS entries in BIND for internal networks Few site and meta site names are ending with Stack Exchange and not all the sites in the data explorer main page Is there a reason I would not add /usr/local/sbin, /usr/sbin, /sbin to my path on Debian? How can I find the product key of Office 2011 after restoring from backup? I had to restore my iMac from a Time Machine backup.  Everything seemed fine until I tried to start Office 2011 and it is asking me to re-enter my product key. I am trying to locate my key (I believe I downloaded this version originally and it should be in my email but I can't find it)  I tried a program that is supposed to "find the keys for products installed on your computer" (Mac Product Key Finder) and it found my very old Office 2008 key, but not 2011.  I am surprised that if I had a totally working install before recovering from back-up that this wasn't restored as well - do I have any options to find it hiding somewhere on my drive?  Note: The recovery was after a hard drive was replaced by the Apple store - if that makes a difference, so this is a new internal drive. My computer is loud: How do I tell which fan is the issue? On my new computer, my fan(s) is/are plain LOUD! Using SpeedFan, I find that my temps are all under 32 degrees C under my normal use (IDK how accurate that is but the CPU itself says 27 C).  The fan doesn't sound unbalanced and it isn't making sounds in rhythm (Not the usual rrrrrrrRRRRRR... rrrrrrrRRRRRR... rrrrrrrRRRRRR... rrrrrrrRRRRRR), just a constant fan. I am thinking about oiling the fans, but I can't decide if it is the PSU fan or a case fan or the CPU fan. If it's the CPU fan I will most likely just replace that with a quiet fan. How can I tell which fan is making the noise (if not multiple)?  One thing that I am thinking may be the problem is my CPU fan isn't PWM so would swapping that out help? There is no "linear voltage" or etc thing in BIOS so I think it may be running at full speed. Also, I could have too much airflow because it is also making a whistling noise that you can hear close to it that sounds like when I accedentially put part of the side cover over my floor vent to get it out of the way. I get      every few minutes on Kubuntu (KDE), and the panels disappear.  It restarts itself automatically, so it's not a real problem, just an annoyance, but it is a big annoyance.  I've tried sudo apt install --reinstall plasmashell plasma-desktop, but that made no difference.  When I try a backtrace from the error message, it says it's unable to produce a useful backtrace. Backup and restore settings in Texstudio Does someone know, how to save all the settings of Texstudio and restore them in a simple way?  Thank you in advance! PCA on correlation or covariance? What happens to waves when they hit smaller apertures than their wavelenghts? What is the difference between \par, \newline, \\ and blank lines? When should I use which one? Using natural deduction to prove that $p \implies q \vdash \lnot p \lor q$ Using only rules of natural deduction, I am trying to prove that $$p \implies q \vdash \lnot p \lor q$$ but am having a lot of difficulty. I was able to prove the other direction.   Could anyone show me or point me to the right direction? I want to use a Java file SaveProp which is written in a package user. The class file has been placed in WEBINF/classes. Below are the two lines which cause the issue.  jsp:useBean id="user" class="user.SaveProp" scope="session"  jsp:setProperty name="user" property="*"   It throws:  The value for the useBean class attribute user.SaveProp is invalid   I'm using Tomcat 6.0. We currently have some indexes where ALLOW_PAGELOCKS is set to off. This presumably was done in order to reduce deadlocks. However I doubt that it would really had an effect back then.   Now I am trying to understand WHEN SQL Server actually chooses to start locking pages rather than keys in a clustered index. I asked Jonathan Keyhaisas recently and he told me that this could happen if I am touching rows on several subsequent pages. However I didn't manage to get any exclusive page locks by updating rows in a clustered index with a sample query.   Could you help me understand page locks better with a sample query and table? I am running SQL Server 2008 SP4.  Thanks in advance  Martin Is the W statistic output by wilcox.test() in R the same as the U statistic? I've recently been reading about the Mann-Whitney U test. It turns out that to carry out this test in R you actually need to run a Wilcoxon test!  My question: is the W statistic of wilcox.test in R identical to the U statistic? How do I monitor the computer's CPU, memory, and disk usage in Java? I would like to monitor the following system information in Java:   Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total)  *Note that I mean overall memory available to the whole system, not just the JVM.   I'm looking for a cross-platform solution (Linux, Mac, and Windows) that doesn't rely on my own code calling external programs or using JNI. Although these are viable options, I would prefer not to maintain OS-specific code myself if someone already has a better solution.  If there's a free library out there that does this in a reliable, cross-platform manner, that would be great (even if it makes external calls or uses native code itself).  Any suggestions are much appreciated.  To clarify, I would like to get the current CPU usage for the whole system, not just the Java process(es).  The SIGAR API provides all the functionality I'm looking for in one package, so it's the best answer to my question so far. However, due it being licensed under the GPL, I cannot use it for my original purpose (a closed source, commercial product). It's possible that Hyperic may license SIGAR for commercial use, but I haven't looked into it. For my GPL projects, I will definitely consider SIGAR in the future.  For my current needs, I'm leaning towards the following:   For CPU usage, OperatingSystemMXBean.getSystemLoadAverage() / OperatingSystemMXBean.getAvailableProcessors() (load average per cpu) For memory, OperatingSystemMXBean.getTotalPhysicalMemorySize() and OperatingSystemMXBean.getFreePhysicalMemorySize() For disk space, File.getTotalSpace() and File.getUsableSpace()   Limitations:  The getSystemLoadAverage() and disk space querying methods are only available under Java 6. Also, some JMX functionality may not be available to all platforms (i.e. it's been reported that getSystemLoadAverage() returns -1 on Windows).  Although originally licensed under GPL, it  to , which can generally be used for closed source, commercial products. Sudo comes up with an error, cannot run anything as root For some reason, when I try to run any programs (I am trying to run a rootkit hunter: rkhunter) as root on the command line with sudo like this:  sudo rkhunter   Then I get this message:  You must be the root user to run this program   and then I get these lines:  sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy' sudo: /usr/lib/sudo/sudoers.so must only be writable by owner sudo: fatal error, unable to load plugins   I try typing in just sudo but that comes up with the same three errors as above. Also in /etc/ sudo.conf does not exist.  I cannot run any other programs as root through sudo. It was also strange because I could run as root a day ago. I would like it to work.  Just so you know, I am the only user of this computer, and the administrator, running Lubuntu 14.04.1. What Happens When A Gravitational Wave Interacts With Another One? If two gravitational waves came in contact with each other what would happen? In another question entirely, what happens when a higher gravitational field interacts with a weaker one. In the movies, the Death Eaters leave a smoky trail behind them as they fly. As the Order arrive in the Ministry of Magic in Order of the Phoenix, they leave a silvery trail behind them. In the books, there’s no mention of how they’re doing this. And J.K. Rowling said in the books that only Voldemort and Snape could fly like this; first seen in the Battle of the Seven Potters.  Please can somebody explain how the Death Eaters are able to fly like this?