I've tried inserting and reading from my MySQL database, but it doesn't seem to work. Here's what I've read, and tried:  Other SO posts:  http://stackoverflow.com/questions/742205/mysql-alter-table-collation/5468980#5468980  http://stackoverflow.com/questions/5906585/change-database-collation   Tried changing collation to utf-unicode-ci and character set to UTF-8, didn't work  http://stackoverflow.com/questions/9401567/php-chinese-characters-cant-insert-to-mysql   This is more for insertion, but reading is equally as problematic.   Here are screenshots of what happened:  Insertion error  http://i.stack.imgur.com/2ot0L.png   Display error  http://i.stack.imgur.com/Bndz1.png   Table structure  http://i.stack.imgur.com/XO3K5.png   Code snippets for writing Chinese to database (registering a new user):  registration.js  var postData = {     full_name   :   $("#full-name").val(),     email       :   $("#email").val(),     password    :   $("#password").val(),     username    :   $("#username").val() };  $.ajax({     type        :   'POST',     url         :   '../php/register.php',      data        :   postData,     dataType    :   'JSON',     success     :   function(data) {         if (data.result == -1)             alert('Registration unsuccessful!');         else if (data.result == 0) {                // redirect to page             alert('Registration successful!');             window.location = '../home.php';         }     } });   registration.php  $query = "  INSERT INTO `users`(`Username`, `Display_name`, `Password`, `Email`, `Date created`)              VALUES ('{$username}', '{$display_name}', '{$password}', '{$email}', '{$date}')";  if ( ($result = mysqli_query($link, $query)) == false )      return -1; else     return 0;   Code for reading Chinese from database (displaying user name):  functions.php  $query = "SELECT display_name, followers FROM users ORDER BY followers DESC LIMIT 10"; $result = mysqli_query($link, $query);  while ($row = mysqli_fetch_array($result)) {     $html = "&lt;li&gt;{$row['display_name']}&lt;span id = 'popular-user-followers'&gt;{$row['followers']}&lt;/span&gt;&lt;/li&gt;";     echo $html; }   Would appreciate any advice on how to proceed, I'm not entirely familiar with databases yet. Thanks!
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
Bounded sequence which is not convergent, but differences of consecutive terms converge to zero I have a question that says "Show that there is a bounded sequence $x_n$ which is not convergent but has the property that $x_n - x_{n+1} \to 0$ as $n \to 0$.  What does this mean? Do I need to come up with an example or does the problem actually want me to prove such proposition?  By the way, I see that this sequence looks like Cauchy because of $x_n - x_{n+1} \to 0$ as $n \to 0$, but it is obviously not. Edit Mode Transparent Objects I changed my Blender Units to Metric System, but when I'm building things, my meshes are transparent, i.e. I can see through faces like in wireframe even though my wireframe is turned off. All faces have a light white in non-wireframe mode, but I can still see through them.   How do I reverse this?  Another issue I get is this    Looks like clipping is not working properly. Run a GUI program at startup I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows:   #!/bin/sh SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin      sh -c firefox   I copied the script to /etc/init.d, modified permission using chmod +x trial and used update-rc.d trial defaults. The file made link but when I rebooted the machine. It did not run firefox. I tried cron @reboot but with no success. I tried rc.local too again failure. Delete questions/answers in iOS app There is currently no way to delete questions or answers in the iOS app, even with the required Trusted User privilege. We can edit and vote, but not delete.  Can this option please be added to the app? Unusual placing of a second impression of a USA visa immigration stamp. Does it mean anything? My parents traveled to the USA a couple of weeks ago (Caracas - Miami). It wasn't their first time; they've probably come and gone a dozen times by now, and they've never had a single issue. This time, the immigration guy was kind of pompous and, once they told him they weren't staying at a hotel but with some friends, he began looking at them somewhat funny. Finally, he stamped their passports (normally, with entry date and a 6-month term of stay) but he put an additional stamp, one that no one they asked had seen before:    It seems to be the same usual entry stamp, but cut in half. What does it mean? Should we be concerned? How do I get the Glare node to output transparent instead of Black background Should you use a plural verb if you refer to a fraction?     Nine tenths of the pillar have rotted away.   I think has should be used here, but I'm not sure. Understanding how references and labels work I'm trying to understand why I cannot effectively reference figures or equations that I have defined with labels.  For example:  \begin{figure}   \label{fig:area_Treasuries}   \caption{Treasuries as a portion of total financial flows.}   \centering   \includegraphics[width=0.75\textwidth]{graphs/Area_Treasuries.png} \end{figure}  \paragraph{} Figure~\ref{fig:area_Treasuries} presents Treasuries (both flowing into and out of the United States) as a share of total financial flows.  From 1985 to 2010, Treasuries account for, on average, 53.2\% of total financial flows.   With the above code, I get this warning:      LaTeX Warning: Reference `fig:area_Treasuries' on page 37 undefined on   input line 477.   The result is "Figure ?? presents Treasuries..."  Why is this happening?  Related, I don't understand why I can't reference, say, an equation before (I mean physically above in the text) the actual equation.  Isn't this what compiling multiple times and cross references is supposed to take care of? General theorems for consistency and asymptotic normality of maximum likelihood I'm interested in a good reference for results concerning asymptotic properties of maximum likelihood estimators. Consider a model $\{f_n(\cdot \mid \theta): \theta \in \Theta, n \in \mathbb N\}$ where $f_n(\mathbf x \mid \theta)$ is an $n$-dimensional density, and $\hat \theta_n$ is the MLE based on a sample $X_1, \ldots, X_n$ from $f_n(\cdot \mid \theta_0)$ where $\theta_0$ is the "true" value of $\theta$. There are two irregularities I'm interested in.    The data $X_1, \ldots, X_n$ are not iid and, as a result, the Fisher information about $\theta$ accrues at a rate slower than $n$.  $\Theta$ is a bounded set, and with positive probability $\hat \theta_n$ lies on the boundary. The boundary corresponds to a "simpler" model, and so there is particular interest in whether or not $\theta_0$ lies on the boundary.    My particular questions are   Letting $J_n(\theta)$ denote the observed Fisher information corresponding to $\theta$, and suppose $\theta_0$ lies in the interior of $\Theta$. Under what conditions is $$\left[J_n(\hat \theta_n)\right]^{1/2}(\hat \theta_n - \theta_0)$$ asymptotically normal as $n \to \infty$? In particular, are the regularity conditions similar to the usual ones, with the relevant modification being $J_n(\hat \theta_n) \to \infty$ in some sense? Suppose instead that $\theta_0$ is on the boundary, and again recall that $\hat \theta_n = \theta_0$ happens with positive probability - for concreteness, in a mixed effects model $Y_{ij} = \mu + \beta_i + \epsilon_{ij}$ we can have $\hat \sigma_{\beta}^2 = 0$. Under what conditions does $\hat \theta_n \to \theta_0$ (almost surely or in probability) and under what conditions will $\hat \theta_n = \theta_0$ eventually (this probably fails for the mixed effects model, but corresponds to "oracle" properties for the LASSO and related estimators, so perhaps it is too much to ask for general results)?   Again, just a pointer to a text with results at this level of generality would be greatly appreciated. This code always works, even in different browsers:  function fooCheck() {   alert(internalFoo()); // We are using internalFoo() here...    return internalFoo(); // And here, even though it has not been defined...    function internalFoo() { return true; } //...until here! }  fooCheck();   I could not find a single reference to why it should work, though. I first saw this in John Resig's presentation note, but it was only mentioned. There's no explanation there or anywhere for that matter.  Could someone please enlighten me? Free way to clone HDD to SSD? SQL Server 2012 Page Life Expectancy resets to 0 after about 50 days I've noticed an odd behavior on a 2-server HA cluster and I was hoping someone could confirm my suspicion, or maybe offer some other explanation... Here is my setup:   A 2-server SQL 2012 SP1 installation SQL AlwaysOn HA has been enabled for a few databases CPUs are 2.4GHz, 4 cores RAM is 34 GB (it is an AWS instance, hence the odd number) Resource utilization is relatively low - each server has 14+ GB memory free, and SQL is not capped on how much memory to use Disk access time is fine - rarely going over 15ms/Read or Write Databases are not big - 1 GB, 1.5 GB, 7.5 GB SQL server process is using 16 GB Private Bytes, 15 GB Working Set   Overall, no resource issues are noted. Now for the odd part. SQL is not restarted (process has been running for almost 6 months) but it seems that every ~50 days, the Page Life Expectancy counter drops to (almost) 0. Up until that point it climbs steadily, no drops. Here is a perf graph:    When I look at the counter data (I don't have the exact number, just an hourly aggregation) it seems the PLE counter value reached about 4,295,000 sec (roughly 50 days) every time (at least every time I have data for).   My crazy theory is that the PLE number is held as milliseconds as an unsigned long int (which has a limit of 4,294,967,295) and at 49.71 days it resets, either by design, or because of a bug. This would explain the behavior of the two servers and the identical pattern they have. Or it could be something totally different and I am just not making any sense. :)  Has anyone seen anything like that, or can explain this behavior?  P.S. I saw  post, but my case seems slightly different.  P.P.S. This is a repost - I originally posted it , but was advised the audience here is more appropriate.  Thanks! Improve the user self-deletion process The current process for self-deletion of a user account has several problematic aspects, both in the process itself and in the end result. Some of these issues are:   The process requires manual intervention of a mod or SE employee, leading to delays and sometimes mistakes. It is more complicated than it has to be, which can lead to the impression that SE is imposing some rather arbitrary-looking restrictions and steps one has to take. This can give the impression that the user isn't really in control of his private data at SE. It is irreversible once the account is deleted, although an account can be partially reconstructed with a lot of manual effort from an SE developer. There is no real protection against mod/SE employee errors, if an account is deleted in error, there is no easy way to undo the damage. Because it is manual, it consumes the time of SE employees that have to deal with it  (unless  is used), removing useful voting information and annoying users that lose reputation that way.   I'm proposing an alternative way of handling self-deletion that would be automated, and also reversible to some extent, while still being pretty much a hard-delete (and not a soft-delete that would be problematic with respect to user privacy). The process would work roughly like this:   The user clicks a "delete profile" button in his profile. There should be a way to indicate if you want to delete all profiles on all SE sites, only on this site and a way to select multiple sites from a list where the profile should be deleted. It is verified that the user has true access to the account in some way (confirmation mail?) and not just someone that found the unlocked computer of the user. A countdown until deletion is started (I'd go with 48h, but that could be different). The timer shouldn't be too long, but long enough to correct mistakes and leave users a bit of time to reconsider. Alternative options would be to enable users to override the countdown if they really want to nuke their account immediately. Another option would be to soft-delete the account immediately, and make the countdown only for hard-deletion of the user data. Upon deletion, the posts of the user and his votes are transferred to a newly created blank account, the original account itself is hard-deleted with all the remaining data it contains. The dummy account that holds the user's data should be flagged in some way as deleted, so that the profile links will be disabled, the profile won't be accessible and it won't appear in any user lists.  The user receives a private code that can be used to claim ownership of the account. Other ways are not possible as all private information is removed about the account. This allows for an automatic way of reclaiming most of the important parts of a deleted account. The ability to restore a deleted account might have to be somewhat restricted to avoid misusing it to get rid of the account history. It is more meant as an additional safeguard so that account reconstruction is more easily possible in rare cases. Such additional safeguards might be necessary as the deletion itself would be automatic and without oversight from SE or moderators.   I personally think that the information which posts and votes were connected to a (now anonymized) account is not sensitive enough that it would have to be removed on account deletion. My idea is that this would be close enough to a hard-delete that it satisfies any privacy concerns, but still allow reassociation of posts with a recovered account. The partial reversibility would alleviate concerns about removing the manual oversight by mods and SE employees over the account deletion process. With powershell get exactly the same application list as in Add/Remove programms If the universe is 3D, how is space-time like a "fabric"? Cross platform Hard Disk encryption? What is a subnet mask, and the difference between a subnet mask of 255.255.255.0 and 255.0.0.0? My DSL/WiFi router provided by my ISP has an internal IP address of 10.0.0.138, the addresses provided by DHCP are in the format of 10.0.0.xxx.  Now, I want to start using static IP addresses on my local network, and I don't know what to provide for the subnet mask.  What is a subnet mask?  Should I be using 255.255.255.0 or 255.0.0.0 as my subnet mask? What is the difference? Python multiprocessing: restrict number of cores used I have a Dell Inspiron 1525 laptop and I am planning on purchasing a mac mini, new version , I am tight on money for a while and want to use my current laptop screen as monitor for mac mini, I just want to know if it is at all possible to do, I have windows 7 and ubuntu 11.04 installed in my laptop, and I don't really care if need to wipe them out, or purchasing a monitos is the only option left, also I am planning to use it for coding and stuff, so VNC is probably not a good choice. Let $$f(x)=\begin{cases} \sin \tfrac 1 x &amp;\text{if $x\ne 0$}\\ 0 &amp; \text{if $x = 0$.}\end{cases}$$ I have to show that $f$ has the intermediate value property. That is, for any $a &lt; b$, if $y$ is any real number such that $f(a) &lt; y&lt; f(b)$ or $f(a)&gt;y&gt; f(b)$, then there exists a $c \in (a,b)$ such that $f(c)=y$.  I feel like I kind of know how to go about completing this. I just am curious as to if I have to create a bound such as letting $a = -1$ and $b = 1$, or keep $a$ and $b$ both arbitrary.