mysql,select,unicodeRelated issues-Collection of common programming errors


  • Ali
    mysql ruby-on-rails-3 gem capistrano bundler
    Hi guys I’ve been trying to deploy my application using capistrano. However I’m getting the following error consistently and have no idea on how to resolve it.* executing “cd /var/www/html/mysite.com/releases/20130224075438 && bundle install –gemfile /var/www/html/mysite.com/releases/20130224075438/Gemfile –path /var/www/html/mysite.com/shared/bundle –deployment –quiet –without development test”servers: [“166.78.22.204”][166.78.22.204] executing command** [out :: 166.78.22.204] Gem:

  • Rednaxel
    java mysql hibernate model-view-controller
    I’m creating a project in Java and MySQL with Hibernate, I can get data from the database, but I can’t save data into it because shows error, I’m trying to create this project with MVC and annotations very simple, without Spring or nothing, just Hibernate. This are my classes:Quote.javapackage stock.model;import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Id;import java.io.Serializable; import java.math.BigDecimal; import ja

  • Nick
    mysql hibernate maven jpa junit
    This is my first play with hibernate/JPA2. I am getting “Unable to build EntityManagerFactory”. Can you tell me where is the problem?Here is my persistence.xml:<?xml version=”1.0″ encoding=”UTF-8″?><persistence version=”2.0″ xmlns=”http://java.sun.com/xml/ns/persistence” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd”> <persistence-unit name=”pdfEx” transact

  • Ali
    mysql multithreading spring java-ee scheduledexecutorservice
    Tools: Spring 3.0, Hibernate 2.0, Java 6Most of the similar threads suggested installing missing libs, correcting the configuration files etc but my project is working completely fine. One module is creating problemsWhat I want to do: Create a thread at applicaiton startup. Log the user requests in a web app., put them in a queue. Thread reads the queue after every 60 seconds and calls the transactional method to persist the queue.Data Structure: ConcurrentLinkedQueue – which is initialized onl

  • Mike
    mysql ruby rubygems gem osx-mavericks
    Trying to install mysql2 on 10.9 is a nightmare. Any help would be greatly appreciated.Running Ruby 2.0.0 p247. Xcode, command line tools and mysql client are installed.Heres the terminal output:gem install mysql2 -v 0.3.13Building native extensions. This could take a while… ERROR: Error installing mysql2:ERROR: Failed to build gem native extension./Users/mike.simmonds/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for rb_thread_blocking_region()… yes checking for rb_wait_for_sin

  • oussama.elhadri
    php android mysql json android-asynctask
    i get this error when I try to connect Mysql DataBase using the code below. the objective is to add a new product to database.04-08 14:13:10.440: E/AndroidRuntime(1568): FATAL EXCEPTION: AsyncTask #204-08 14:13:10.440: E/AndroidRuntime(1568): Process: com.example.androidmanifest, PID: 156804-08 14:13:10.440: E/AndroidRuntime(1568): java.lang.RuntimeException: An error occured while executing doInBackground()04-08 14:13:10.440: E/AndroidRuntime(1568): at android.os.AsyncTask$3.done(AsyncTas

  • Muhammad Reda
    mysql node.js
    I am very new to this node.js and ubuntu.Now i am trying to use mysql database in my application.For i have the following code:var mysql = require( “db-mysql” );new mysql.Database({hostname: “localhost”,user: “dave”,password: “asdfa”,.database: “dbNameHere”}).on( “error”, function( error ) {console.log( “ERROR: ” + error );}).on( “ready”, function( server ) {console.log( “Connected to ” + server.hostname + ” (” + server.version + “)” );}).connect( function( error ) {if ( error ) {console.log( “E

  • Lightness Races in Orbit
    php mysql string strlen
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <link rel=”stylesheet” href=”StylesTSL.css” type=”text/css” media=”screen”> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>Terraria Server List</title> </head> <body> <div id=”page”> <div id=”logobase”> <div class=”filler”>&l

  • thad
    mysql ruby-on-rails ruby windows mysql2
    I’m completely new to rails development and have been struggling with installing mysql2 with the past month. I’m have windows 8.1 64 bit, ruby 2.0.0p535 64bit, rails 4.0.2, and I have mysql2 (0.3.14) 64bit. The errors that I am getting from cmd are below.C:\Users\tghol_000>gem install mysql2 –platform=ruby — ‘–with-mysql-dir=”C:\mysql-connector\”‘ –with-mysql lib=”C:\mysql-connector\lib”‘Temporarily enhancing PATH to include DevKit…Building native extensions with: ‘–with-mysql-dir

  • user3006788
    php android mysql json error-handling
    i am creating a simple android application that add user (register) and retrieve user(login)the first action work perfectly but the second force close and crush the application.can anyone help me???logCat04-02 08:24:18.532: E/JSON Parser(2380): Error parsing data org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject 04-02 08:24:18.536: W/dalvikvm(2380): threadid=12: thread exiting with uncaught exception (group=0xa4c06648) 04-02 08:24:18.568: E/AndroidR

  • Sam Skirrow
    jquery select text option
    I’m trying to change the text of a group of select options when a particular option is selected from a previous dropdown.Here is my html:<select class=”select” id=”eventType” name=”eventType” size=”1″><option value=”0″></option><option value=”wedding” name=”wedding”>Wedding</option><option value=”private_party” name=”private_party”>Private Party</option><option value=”corporate” name=”corporate”>Corporate Event</option></select><sele

  • Pavel Janicek
    java select selenium webdriver
    I am trying force the ChromeDriver to select an item from the select box. However its failing on the line Options = select.getOptions(); Strange is, that in below code, the getText(); method prints out all items in the select:productChoooser.getText() = …BASE 2013BASE 2014but still I get exception… Code which is trying to click the item in select box:List<WebElement> Options;WebElement productChoooser = driver.findElement(By.id(“mainForm:aucPanelId:1:product”));System.out.println(“prod

  • Dino
    mysql sql select
    suppose the user inputmysite.com/profile?identity=1 mysite.com/profile?identity=dinodsja mysite.com/profile?identity=1agetting the value$identity = $_GET[‘identity’]; // identity can be user_id or user_nameand i have a simple select query:SELECT * FROM lb_users WHERE (user_id = ‘dinodsja’ OR user_name = ‘dinodsja’) AND user_status = 1and it works fine. but the problem is:SELECT * FROM lb_users WHERE (user_id = ‘1a’ OR user_name = ‘1a’) AND user_status = 1when I execute this query it also returns

  • marc_s
    sql sql-server select triggers sql-server-2012
    So let me first admit that I am a SQL Server newbie.Here’s the deal: I’m trying to create a trigger on a table in SQL Server 2012, and whenever I try any kind of SELECT statement in the trigger, the table quits working (as in NOTHING can be inserted until the trigger is deleted). As soon as I drop the trigger, everything starts working again. If I don’t do any SELECTs, everything is peachy. Is there a permission or something somewhere that I’m missing? Example: CREATE TRIGGER sometrigger ON some

  • soupagain
    mysql select unicode
    I have a UTF8 table in MySQL containing names, with all types of text (numeric, capitals, greek, cycrillic etc).————— ID Name ————— 001 Jane Smith 002 John Doe 003 ????? ???? 004 ????? ???? 005 “Groove” Holme 006 99er DudeHow can I select only the cyrillic names? (records 003 and 004)EDITThanks for the answer below, which looked like it would be correct, but didn’t work. More research turned up this in the documentation:WarningThe REGEXP and RLIKE operators work in by

  • nIx..
    mysql sql hibernate select insert
    This might be basic question, I am trying to execute insert select query using Hibernate, insert into A(col1, col2) select xxx, yyy from (select b.col1 as xxx, c.col1 as yyy from B b,C c where someCondition1UNIONselect b.col1 as xxx, c.col1 as yyy from B b,C c where someCondition2 ) as ZHibernate is giving syntax error: Unexpected Token ( at <br/> xxx, yyy from (…While same query works when executed as SQL.Full stack trace is org.hibernate.hql.ast.QuerySyntaxException: unexpected token:

  • user3371139
    c# select datatable case-sensitive camelcasing
    I am performing a search on a DataTable and am getting unexpected results. The table contains a column called Name. One of the rows contains the value “MustHaveRings” for the Name column. Both the DataSet and DataTable have the CaseSensitive property set to false which should perform a case-insensitive search.When I perform the search with the following, no rows are returned which is unexpected.string input = “musthaverings”; var foundRows = ds.Tables[5].Select(“Name= ‘” + input + “‘”);After exp

  • user1395480
    ajax list cakephp select
    I am trying hard to refresh a list after selecting an option of a second. I have this list<select id=”ArticleShopId”> <option>Some options</option> <option>Some options 2</option> <option>Some options 3</option> </select>I have a seond<select id=”ArticleCategoryId”> <option></option> <option></option> <option></option> <option></option> </select>When I select an option of the first, ajax s

  • Alucard
    php mysql date select sphinx
    The tables have the same structure and are named like (year and month attached):- tb_201302 – tb_201303 – tb_201304Each table has a field date_insert that contains the exact insert time in timestamp.Question: I want to be able to do a selection from those multiple tables, something like (in pseudo code):SELECT * FROM tb_201302, tb_201303 WHERE date_insert > ’02/15′ and date_insert < ’03/25”02/05′ and ’03/25′ would be timestamps normallySo it’s basically selectin a range in multiple tables

  • Salman A
    mysql sql select
    A mysql query is returning unexpected. I’m trying to concatenate a few strings containing date queries like so:mysql> select month(timestamp) +’-‘+ day(timestamp) + ‘-‘ + year(timestamp) as date FROM table ORDER BY timestamp DESC LIMIT 1;and I’m getting a 4 digit result, which I assume is the sum of the expected result:+——+ | date | +——+ | 2035 | +——+I’ve also tried casting each one as CHAR which didn’t work:mysql> select CAST(month(timestamp) as CHAR) +’-‘+ CAST(day(timestamp)

  • karlcow
    python unicode utf-8 cli
    In the process of creating a small CLI notebook application, I decided to go with the cmd Python library (see also cmd on PyMOTW).My shell is UTF-8.? echo $LANG fr_FR.utf-8 ? echo $LC_ALL fr_FR.utf-8And it is working quite well.? echo “??” ??Starting the code of my little app and trying to use utf-8:? python nb.py log> foobar 2013-01-15 foobar log> æ±äº¬ 2013-01-15 æ±äº¬Edited The expected input/output is. When I type utf-8 characters, be accent or Japanese characters in that case, I get

  • Abhishek Mukherjee
    python unicode encoding utf-8
    I have a unicode string list file, saved in encode option utf-8. I have another input file, saved in normal ansi. I read directory path from that ansi file and do os.walk() and try to match if any file present in the list (saved by utf-8). But it is not matching even if it is present.Later I do some normal checking with a single string “40M_Ãz­µ´ú¸ÕÀÉ” and save this particular string (from notepad) in three different files with encoding option ansi, unicode and utf-8. I write a python script to

  • Tomas Lycken
    python django unicode utf-8
    I know similar questions have been asked a million times, but despite reading through many of them I can’t find a solution that applies to my situation.I have a django application, in which I’ve created a management script. This script reads some text files, and outputs them to the terminal (it will do more useful stuff with the contents later, but I’m still testing it out) and the characters come out with escape sequences like \xc3\xa5 instead of the intended å. Since that escape sequence means

  • tkeE2036
    c# c unicode utf-8 string-comparison
    So I am attempting to write a compare function in C which can take a UTF-8 encoded Unicode string and use the Windows CompareStringEx() function and I am expecting it to work just like .NET’s CultureInfo.CompareInfo.Compare().Now the function I have written in C works some of the time, but not in all cases and I’m trying to figure out why. Here is a case that fails (passes in C#, not in C):CultureInfo cultureInfo = new CultureInfo(“en-US”); CompareOptions compareOptions = CompareOptions.IgnoreCa

  • Cody Gray
    c++ winapi unicode utf-8 rc
    I created an RC file which contains a string table, I would like to use some specialcharacters: ö ü ó ú o u á é. so I save the string with UTF-8 encoding.But when I call in my cpp file, something like this:LoadString(“hu.dll”, 12, nn, MAX_PATH);I get a weird result:How do I solve this problem?

  • Nas Banov
    python unicode encoding
    [Update] Appreciate the answers and input all around, but working code would be most welcome. If you can supply code that can read the sample files you are king (or queen).[Update 2] Thanks for the excellent answers and discussion. What I need to do with these is to read them in, parse them, and save parts of them in Django model instances. I believe that means converting them from their native encoding to unicode so Django can deal with them, right?There are several questions on Stackoverflow a

  • ntoskrnl
    java swing unicode crash fatal-error
    A user reported that a certain YouTube video causes our program to fail. Upon investigation it seems that adding a String containing the title of that video to a JTable causes an ArrayIndexOutOfBoundsException somewhere in the rendering code.We have tested and confirmed this on both Java 7u45 and Java 8 (b121) on Windows XP, 7 and 8, and Ubuntu.Here is a test program demonstrating the issue:import javax.swing.*; import java.awt.*;public class TestJTableAIOOBE {private static final String TEXT =

  • rafael
    python unicode utf-8
    I execute following code on windows xp and python 2.6.4But it show IOError.How to open file whose name has utf-8 codec.>>> open( unicode(‘??.txt’, ‘euc-kr’).encode(‘utf-8’) )Traceback (most recent call last):File “<pyshell#0>”, line 1, in <module>open( unicode(‘??.txt’, ‘euc-kr’).encode(‘utf-8’) ) IOError: [Errno 22] invalid mode (‘r’) or filename: ‘\xed\x95\x9c\xea\xb8\x80.txt’But the following code to the normal operation.>>> open( unicode(‘??.txt’, ‘euc-kr’) ) &l

  • user1632979
    python windows unicode encoding utf-8
    My Python script creates a xml file under Windows XP but that file doesn’t get the right encoding with Spanish characters such ‘ñ’ or some accented letters.First of all, the filename is read from an excel shell with the following code, I use to read the Excel file xlrd libraries:filename = excelsheet.cell_value(rowx=first_row, colx=5)Then, I’ve tried some encodings without success to generate the file with the right encode:filename = filename[:-1].encode(“utf-8”) filename = filename[:-1].encode(

  • Roland Bengtsson
    delphi unicode delphi-2010
    I have some code that compiles fine with D7 but fails with D2010. Obviously it is an Unicode issue:The compile error is: E2251 Ambiguous overloaded call to ‘StrPas’Here is the whole procedure:procedure GetVersionInfo; typePLangCharSetInfo = ^TLangCharSetInfo;TLangCharSetInfo = recordLang: Word;CharSet: Word;end; varFileName: array [0..260] of Char;SubBlock: array [0..255] of Char;VerHandle: Cardinal;Size: Word;Buffer: Pointer;Data: Pointer;DataLen: LongWord;LangCharSetInfo: PLangCharSetInfo;Lang

Web site is in building