I'm working on a web site in which the encoding used is UTF-8. The server side is developed with Java and the database uses Windows-1252 encoding.  How do I encode the characters correctly so they can be displayed correctly both in the database viewer and on the client side?  EDIT  Here is the code:  Class.forName("com.pervasive.jdbc.v2.Driver");  Connection conn = DriverManager.getConnection("jdbc:pervasive://XXX.XXX.XXX.XXX/TEST","xxxx", "xxxxx");  Statement stmt = conn.createStatement();  String sql = "INSERT INTO MyTest (COL1, COL2) VALUES (99999, 'Ó 456789 ñÑ; ° - + ( _ . - / \\ &amp; &lt;' )"; stmt.executeUpdate(sql);   The database viewer shows: ? 456789 ??; ? - + ( _ . - / \\ &amp; &lt; instead of Ó 456789 ñÑ; ° - + ( _ . - / \\ &amp; &lt;   The String ? 456789 ??; ? - + ( _ . - / \\ &amp; &lt; is retrieved when SELECT is excecuted
I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ЦжФ for special cases.  My setup is the following:   Development environment: Windows XP Production environment: Debian   Database used: MySQL 5.x  Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site.  How to achieve this?
How to undelete notes on iPhone "Notes" app? iPhone has a default "Notes" app which allows us to store notes. Stored notes can be deleted by hitting the "Delete Note" button:    How do we recover a note that is accidentally deleted?  Is there anyway to undo the delete? Real Numbers Raised to Imaginary Powers? What is a real number to the power of an imaginary or complex number? e.g. 3i. I have searched through sites about imaginary numbers, but none seem to say anything about imaginary indices. Examples and explanations would be appreciated. How does the Golden Ratio/Spiral Work? Is it useful with Logo Design? Procedural texture for longitudinal lines What should I do when Ubuntu freezes? What makes a field not groupable I'm trying to use an aggregate query, but one of the fields I want to group by is not groupable (saw it in the soql error and then verified groupable=false in the metadata).  It's just a number field that holds an integer (number 2,0 in salesforce field spec-speak).  Is there a trick to make it groupable?  Any way around this problem? I don't want to write hundreds of lines of code just to average a list by this field. Recovering lost text which was copy pasted from a website to MS Word What happens if I activate a product key on Steam for a game I already own? I have a Steam product key for Just Cause 2 I got for free with the purchase of my video card. However, I already have a copy of this game attached to my Steam account. What will happen if I try to activate this other key on my account? Will Steam give me a copy of Just Cause 2 to gift to somebody else? Will it simply refuse to add it? Or will it eat the key rendering it worthless?  I don't want to try this only to have the latter happen, but it would be useful to be able to add it and gift it to somebody else. How to run a background task in a servlet based web application? Is there a specific term for the association of certain verb(s) with certain nouns (as direct objects)? Or vice versa. Or perhaps a name for the pair itself?  For example:   hold an opinion make a complaint offer an apology   Also, where might I find a list of such pairs?    EDIT: I chose my title wording randomly. I have no idea whether 'cognate verb' is the correct term for these things. However, I've just found out that 'cognate objects' are a defined class in linguistics, so perhaps my choice of words was inappropriate. I'm going to leave the title as it is, anyway. "Unable to locate package sudo" when i try to install sudo on new Debian Programmatically, how does "rooting" a device enable access? Let $a,b,m,n$ be positive integers such that g.c.d.$(a,b)=1$ and $a^m+b^m|a^n+b^n$ , then is it true that $m$ divides $n$ ? I have tried using glm::rotate and such. glm::translate works fine, but rotate doesn't work (if I rotate before/after a translation).  Here is my current setup:  glm::vec4 Off = glm::vec4(0, 0, 0, 1); glm::vec4 result = Util::createTransform(offset) * Off;  for (int i = 0; i &lt; Tvertex.size(); i++) {     Tvertex[i] += glm::vec3(result.x, result.y, result.z);     Tcolors[i] = currentColor; }   And here is my Util::createTransform:  glm::mat4 Util::createTransform(glm::vec3 pos) {     glm::mat4 trans = glm::mat4(1.0);     trans = glm::translate(trans, pos);     return trans; }  glm::mat4 Util::createTransform(glm::vec3 pos, glm::vec3 rot) {     glm::mat4 trans = glm::mat4(1.0);     trans = glm::rotate(trans, glm::radians(rot.x), glm::vec3(1, 0, 0));     trans = glm::rotate(trans, glm::radians(rot.y), glm::vec3(0, 1, 0));     trans = glm::rotate(trans, glm::radians(rot.z), glm::vec3(0, 0, 1));     trans = glm::translate(trans, pos);     return trans; } Windows Update not working on Windows 2012 R2 Standard R.Java not generated I'm confused with using single or double brackets. Look at this code:  dir="/home/mazimi/VirtualBox VMs"  if [[ -d ${dir} ]]; then     echo "yep" fi   It works perfectly although the string contains a space. But when I change it to single bracket:  dir="/home/mazimi/VirtualBox VMs"  if [ -d ${dir} ]; then     echo "yep" fi   It says:  ./script.sh: line 5: [: /home/mazimi/VirtualBox: binary operator expected   When I change it to:  dir="/home/mazimi/VirtualBox VMs"  if [ -d "${dir}" ]; then     echo "yep" fi   It works fine. Can someone explain what is happening? When should I assign double quotes around variables like "${var}" to prevent problems caused by spaces? Expected number of rolling a pair of dice to generate all possible sums A pair of dice is rolled repeatedly until each outcome (2 through 12) has occurred at least once. What is the expected number of rolls necessary for this to occur?  Notes: This is not very deep conceptually, but because of the unequal probabilities for the outcomes, it seems that the calculations involved are terribly messy.  It must have been done already (dice have been studied for centuries!) but I can't find a discussion in any book, or on line. Can anybody give a reference? How to convert Wubi install into regular install? I have installed Ubuntu on my D: partition using Wubi. Is there any way in which I can remove my Windows from C: drive and move my existing Ubuntu installation to C: drive and make it a regular install. I have had several business loans and understand that this is not by any means typical.  I noticed that for a year my payments were not decreasing the principal on the loan. When I asked the bank why, I found out that at some point my payments were getting applied to principal only. Now I am paying interest off that was not paid for 6 months or so.  My banker states that he can change all the interest payments to principal payments. I am confused to why this would be. If I make all my principal payments first then would the bank lose a substantial amount of interest?  This has happened on 2 of the 3 loans I have looked at so far.  If they are willing to change all the payments to principal only, would this be beneficial to paying less interest ultimately? I assume there would be an interest account accruing somewhere that would need to be paid off at the end of the loan.  I understand that typically you have a loan balance that would include interest and principal. My balance owed did not change when I continued to make same payment? It gets applied to interest. The balance on the statement must not be a true balance. There must be interest owed above the balance showed but why would they do this to start with? They applied full payments to principle only first in order for interest to get to be more than several payments