phpMyAdmin insists on forcing my utf-8 characters into latin1.  Server Info:  Server: Localhost via UNIX socket Server type: MySQL Server version: 5.0.27 - Source distribution Protocol version: 10 Server charset: UTF-8 Unicode (utf8)   phpMyAdmin Version information: 4.0.10 PHP Version 5.2.11  The server version and PHP version is not under my control, and phpMyAdmin is the latest version that will run under PHP 5.2  Neither Import or straight SQL will work. My own internal PHP tools handle utf8 just fine, and update the database correctly.  DROP TABLE IF EXISTS `tempchar`; SET character_set_client = utf8; CREATE TABLE `tempchar` (   `id` int(11) NOT NULL DEFAULT '0',   `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',   `active` int(1) NOT NULL DEFAULT '0',   `type` int(1) NOT NULL DEFAULT '0',   PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;  INSERT INTO `tempchar` VALUES (382,'Vicenté Marcos de Cervantés',2,0);   The end result (viewed as utf8) is:  382 : Vicent� Marcos de Cervant�s   Same result when switched to 'Western' (latin1 etc)  382 : Vicenté Marcos de Cervantés   Code that produces the above output:  $result=mysql_query("select * from tempchar where active=2 order by name"); while($row=mysql_fetch_array($result)) {   echo "$row[id] : $row[name]&lt;br&gt;\n"; }   It is clearly phpMyAdmin stepping in and doing something unnecessary. Has anyone got any clues as to how to get it to behave?
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.
"Require Installation Of Untrusted Packages" while upgrading with the update manager It didn't fixed the error. So, how do I fix my GUI update?  For every software I have to install it from command line because I got same error when install software from Ubuntu Software Center. I'm using an unsigned repo in Ubuntu 16.04 from Debian multimedia:  deb http://www.deb-multimedia.org jessie main   To install deb-multimedia-keyring, I'm running:  apt-get update &amp;&amp; apt-get install deb-multimedia-keyring -y   This gives an error:  W: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117 E: The repository 'http://www.deb-multimedia.org jessie InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. How do I automatically restart docky after a crash? $K/F$ is a field extension of finite degree $n$. How can I prove that $K$ is isomorphic to a subfield of the ring of $n\times n$ matrices over $F$, so the ring of $n\times n$ matrix over $F$ contains an isomorphic copy of every extension of $F$ of degree $\leq n$? Cloning a Non-Standard Svn Repository with Git-Svn I'm relatively new to Git, but I've found it so easy to work with at home that I'd like to use it at work where our projects are stored in Svn repositories. Unfortunately, the repositories are slightly non-standard and I'm having trouble getting them cloned. Sure, they all have trunk, branches/ and tags/, but branches/ and tags/ have subdirectories before hitting the real project directories:  trunk/ branches/maintenance/release1 branches/maintenance/release2 ... branches/development/feature1 branches/development/feature2 ... tags/build/build1 tags/build/build2 ... tags/release/release1 tags/release/release2   After cloning:  $ git svn clone -s --prefix=svn/ https://mydomain.com/svnproject $ git branch -r   development   development@1340   maintenance   maintenance@1340   tags/build   tags/build@1340   tags/release   tags/release@1340   trunk   trunk@1340    I get none of the actual project branches or tags. I actually need to be able to work on the trunk, one maintenance branch and one development branch. I've tried this approach in addition to several hacks at modifying the config, but nothing is working for me.  Is there any way I can get the key components of my non-standard Svn project into a local git repository so that I can easily move between them?  Many thanks.  UPDATE: I should add that I can't do a wholesale switch to Git (yet). There are other team members involved and an international presence. The logistics of the transition are more than I'm willing to undertake until I'm much more comfortable with Git; as I mentioned, I'm still pretty new. I've barely scratched the surface of its capabilities. HDMI/Displayport audio control for OS X A composition of a periodic function that is somehow not periodic. Can I disown my heir? Everything was perfect. I have a good and young ruler, who has passed on some good genes to his sons. I also had a lot of spare lands, so I could make my heir a duke and doubly count when he came of age.  My mistake was to marry him off to some scheming wench. I knew it would end like this, but her stats were just too great to resist!  Anyway, a few years down the road, and my trusty spy master lets me know that my beloved son is looking to usurp me. Not cool! I demand that he end the plot, and decide to see how this develops.  Shortly thereafter, he suddenly dies (not by my hand — likely the wife is the culprit). My second eldest son becomes my new heir and favourite, however all the titles are inherited by my clubfooted grand daughter aged two. Curses!  Now, what I really wanted, was to imprison and disown my traitorous son followed by swift justice of the axe. Not sure what my other vassals would think of that idea, but I had a just reason for imprisonment at least.  Option number two, is to start plotting for my dearly beloved grand daughters untimely demise, but I'm not sure how that would work out either.  The situation is this. I'm young (40ish) and well-liked. I have a new heir, but I'd prefer to keep my lands for myself and give him the ones of the previous heir — one duchy and two counties currently held by my grand daughter. The duchy can be revoked free of charge, as I hold a claim to it. She has no siblings. I am da King. I have limited crown authority, but can bump it up to medium if it suits me.    So my questions to you are as follows:   Is it possible to disown a son, considering I have just cause for imprisonment? An execution would of course settle the deal, but my other vassals would probably find me "cruel". Is it possible to plot against a character which is not yet of age? What would happen if she suddenly died with no heir? Would all her titles be returned to the king or duke (i.e. me)?   EPILOGUE I had savegames before and after, so I decided to test a few things.   I could imprison my quisling of a son. I could also seize all his titles and banish him from my lands, but he would remain an heir, even if he wasn't officially a prince. I guess I could have let him rot in jail, as it seems prisoners often die in custody, but it would be a risky bet. After the unfortunate death of my old heir, it seems some strange rules apply regarding the remaining titles. The dukal title I could simply revoke for free (although at a opinion penalty from the duchess). Should she die today, one of the counties would be inherited by her younger sister, and the other would be inherited by me.   I found this to be an interesting development: Turns out my new heirs wife suddenly died. Who did he marry, other than the same scheming hag who presumably killed off his brother, and made an attempt at me? By a suspicious coincidence, I died not very long after. Such is the effects of the deceitful and ambitious traits combined with a really dope intrigue stat. ;) What happens when I hover over a link in Chrome? Bash while read loop breaking early I've been banging my head against for wall for a while with this one.  I want to SSH into a set of machines and check whether they are available (accepting connections and not being used). I have created a small script, tssh, which does just that:  #!/bin/bash  host=$1 timeout=${2:-1}  ssh -qo "ConnectTimeout $timeout" $host "[ \`who | cut -f1 | wc -l \` -eq 0 ] &amp;&amp; exit 0 || exit 1"   This script works correctly. Returning 255 if there was a connection problem, 1 if the machine is busy and 0 if everything is good. If anyone knows a better way to do this please let me know.  So next I try and call tssh on my set of machines using a while read loop, and this is where it all goes wrong. The loop exits as soon as tssh returns 0 and never completes the full set.   while read nu ; do tssh "MYBOXES$nu" ; done &lt; &lt;(ruby -e '(0..20).each { |i| puts i }')   At first I thought this was a subshell problem but apparently not. Any help, along with comments on style/content, would be much appreciated! I know I'm going to kick myself when I find out why... Can't change font size for GD imagestring() Ratios in Regression, aka Questions on Kronmal Recently, randomly browsing questions triggered a memory of on off-hand comment from one of my professors a few years back warning about the usage of ratios in regression models. So I started reading up on this, leading eventually to Kronmal 1993.  I want to make sure that I'm correctly interpreting his suggestions on how to model these.   For a model with a ratio with the same denominator on both the dependent and independent side: $ Z^{-1}Y = Z^{-1}1_n\beta_0 + Z^{-1}X\beta_X + \beta_Z + Z^{-1}\epsilon $   Regress dependent ratio on the (inverse) denominator variable in addition to the other ratios Weight by the (inverse) denominator variable  For a model with dependent variable as a ratio: $ Y = \beta_0 + \beta_XX + Z1_n\alpha_0 + ZX\alpha_X + Z^{-1}\epsilon $   Regress numerator by original variables, denominator, and denominator times original variables [what about categorical variables?] Weight by (inverse) denominator  For model with only independent variable ratios: $ Y = \beta_0 + X\beta_X + Z^{-1}1_n\beta_{Z^{-1}} + W\beta_W  + Z^{-1}W\beta_{Z^{-1}W} + \epsilon $   Include numerator and (inverse) denominator as main effects, ratio as interaction term.    Are my interpretations here correct? Can we have a perfect field of characteristic $p$ with a non-archimedean valuation? I'm trying to install Ubuntu 12.10 alongside Windows 7 on my ASUS laptop and I'm new to all of this.   I'm using  the Ubuntu 12.10 64-bit ISO burned onto a CD.  The first time I tried to install it, Ubuntu said it did not detect any other OS, which meant I only had 4 options:   Erase disk and install Ubuntu (I don't want to do this) Encrypt new Ubuntu. Use LVM. Something else.   If I choose the Something else option, it brings me to the partition menu and says that I have 1 disk with free space of 750516Mb (750Gb), but that's not true because I have Windows 7.  I've already read through several questions and people have mentioned that you could only have 4 primary partitions. So I got hold of partition magic and removed my D: and E:, leaving me with primary C: partition and System reserved partition and a lot of unallocated space.  I restarted the laptop several times and booted the CD again and I got exactly the same as I did previously.  How do fix this problem and install Ubuntu alongside Windows 7?  EDIT 1  Here are my results for   sudo fdisk -l; echo; sudo parted -l; echo; mount; echo; df -h   WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.   Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x90050371     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT /dev/sda2          206848   146368214    73080683+   7  HPFS/NTFS/exFAT  Warning: /dev/sda contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT partition table? Yes/No?     After selecting YES  Yes/No? yes                                                                Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used. OK/Cancel? Pushforward of inverse map at the identity? Let $G$ be a Lie group and $i:G \rightarrow G$ denote the inversion map $i(x) = x^{-1}$. (Notation: $f_*$ is the pushforward map $F_*:T_pG \rightarrow T_{i(p)}G$ which takes $(F_{*}X)(f)=X(f\circ F)$ and $X$ is a tangent vector, $X\in T_pG$.) I wish to show that $i_{*}:T_{e}G\rightarrow T_{e}G$  is given by $i_{*}(X)=-X$ As a first step, it is trivial to prove that $i_*$ is an involution as $\mbox{Id}_{*}=(i\circ i)_{*}=i_{*}\circ i_{*}$ but I can't seem to make any further progress. Any help would be appreciated. A student is applying to a PhD program in Computer Sciences at Harvard and MIT. He estimates that he has two out of three chances of being accepted at Harvard and two out of five chances at MIT. He further estimates the probability that he will be accepted by both has probability of one to five. What is the probability that he is accepted by MIT if he is accepted by Harvard? Is the event "accepted by MIT" independent of the event "accepted by Harvard".  I don't understand if these are odds or probabilities How do I create a file and mount it as a filesystem? How do I create a file of size 10M, format it with ext3 filesystem and then mount it in /media/fuse?  I tried with  mkfs -t ext3 file   then to mount it  mount -t ext3 file /media/fuse   It didn't work because it said that file wasn't a block device. Can anybody help me? BitLocker issue. Recovery Key is required on each startup after installing secondary OS I'm using a laptop with TPM module with BitLocker-encrypted internal HDD, running Windows 7. Recently I've installed a Windows 8 on the external, eSATA drive. Windows 8 detected the Windows 7 and correctly replaced the bootloader with dual-boot option.  Unfortunately, I'm now forced to enter BitLocker Recovery Key each time I start the computer. The only workaround I've found was to disable TPM module in BIOS, and suspend BitLocker on the Windows 7 drive.  How to accomplish the following configuration:   Keep the BitLocker running on Windows 7 (internal drive)  Leave the Windows 8 (external, eSATA drive) completely unencrypted  Don't be bugged to enter Recovery Key each time during startup  No matter if the eSATA drive is plugged in, or not   Is it possible? I don't care if TPM is enabled and I just want the Windows 7 drive to be BitLocker-encrypted. Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you the following error:  java.io.IOException: stream length not specified   I managed to get it to work by writing the wav to a temporary file, then reading it back in, as shown below:  AudioInputStream source = AudioSystem.getAudioInputStream(new BufferedInputStream(in, 1024)); AudioInputStream pcm = AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED, source); AudioInputStream ulaw = AudioSystem.getAudioInputStream(AudioFormat.Encoding.ULAW, pcm); File tempFile = File.createTempFile("wav", "tmp"); AudioSystem.write(ulaw, AudioFileFormat.Type.WAVE, tempFile); // The fileToByteArray() method reads the file // into a byte array; omitted for brevity byte[] bytes = fileToByteArray(tempFile); tempFile.delete(); return bytes;   This is obviously less desirable. Is there a better way? Common screen resolution? I'm developing a web application which is quite information heavy. This means that every pixel available in the screen for display helps a lot, to avoid the UI looking too cluttered and to display relevant data.  I was wondering: which is the "common" screen resolution? Years ago it was something like 1024&times;768, but nowadays it must be something much higher. I can't rely on what I use as I'm a developer and I probably have bigger screens and resolution than the average Joe user.  So, where can I find the currently recommended resolution for webapps?