case-sensitive

SQL unique varchar case sensitivity question

你说的曾经没有我的故事 提交于 2019-11-27 03:47:32
I'm trying to populate a SQL table with a list of words. The table itself it pretty simple: CREATE TABLE WORDS( ID BIGINT AUTO_INCREMENT, WORD VARCHAR(128) NOT NULL UNIQUE, PRIMARY KEY(ID) ); The problem I'm running into is this: when I do the following inserts back to back INSERT INTO WORDS(WORD) VALUES('Seth'); INSERT INTO WORDS(WORD) VALUES('seth'); The second insert fails with a constraint violation ("Duplicate entry 'seth' for key 'WORD'"). How can I get the UNIQUE constraint on WORD to be case sensitive? Bill Brasky Looks like mysql is case insensitive by default : You probably need to

How can I convert Unicode to uppercase to print it?

房东的猫 提交于 2019-11-27 03:43:09
问题 I have this: >>> print 'example' example >>> print 'exámple' exámple >>> print 'exámple'.upper() EXáMPLE What I need to do to print: EXÁMPLE (Where the 'a' gets its accute accent, but in uppercase.) I'm using Python 2.6. 回答1: I think it's as simple as not converting to ASCII first. >>> print u'exámple'.upper() EXÁMPLE 回答2: In python 2.x, just convert the string to unicode before calling upper(). Using your code, which is in utf-8 format on this webpage: >>> s = 'exámple' >>> s 'ex\xc3\xa1mple

How do I use jQuery to ignore case when selecting?

大兔子大兔子 提交于 2019-11-27 02:16:37
问题 I'm currently attempting to disable a link using the following jQuery selector: $("a[href$=/sites/abcd/sectors]").removeAttr("href"); The problem is that sometimes the href might not always be lower case on the page. When this happens the selector no longer matches. Does anyone know how to get around this? Can I change the behaviour this once to ignore case? 回答1: I ran into this myself. I switched the logic a bit to allow me to compare it without case. It requires a little more work, but at

How to compare character ignoring case in primitive types

China☆狼群 提交于 2019-11-27 01:49:39
I am writing these lines of code: String name1 = fname.getText().toString(); String name2 = sname.getText().toString(); aru = 0; count1 = name1.length(); count2 = name2.length(); for (i = 0; i < count1; i++) { for (j = 0; j < count2; j++) { if (name1.charAt(i)==name2.charAt(j)) aru++; } if(aru!=0) aru++; } I want to compare the Character s of two String s ignoring the case. Simply using IgnoreCase doesn't work. Adding '65' ASCII value doesn't work either. How do I do this? Shehzad The Character class of Java API has various functions you can use. You can convert your char to lowercase at both

Like Case Sensitive in MySQL

你。 提交于 2019-11-27 01:33:07
I have a MySQL query: SELECT concat_ws(title,description) as concatenated HAVING concatenated LIKE '%SearchTerm%'; And my table is encoded utf8_general_ci with MyISAM. Searches seem to be case sensitive. I can't figure out how to fix it. What's going wrong and/or how do I fix it? Try this: SELECT LOWER(CONCAT_WS(title,description)) AS concatenated WHERE concatenated LIKE '%searchterm%' or (to let you see the difference) SELECT LOWER(CONCAT_WS(title,description)) AS concatenated WHERE concatenated LIKE LOWER('%SearchTerm%') A much better solution in terms of performance: SELECT .... FROM ....

Are property values in CSS case-sensitive?

核能气质少年 提交于 2019-11-26 23:06:58
问题 I have observed that some CSS properties, like font-family declared with quotation marks, perhaps are case-sensitive, but all other are not... But how web-browsers and "HTML renderers" MUST interpret? Is the same in any CSS context (XML, SVG, etc.) and all other applications? What the standards say about? Example: Adobe InDesign exported both, font-family:'Optima Bold' and font-family:'optima bold' . Can I "normalize to lower case" (ex. to merge similar classes)? NOTES References are

Case sensitive and insensitive like in SQLite

与世无争的帅哥 提交于 2019-11-26 22:18:18
问题 In SQLite it is possible to change the case sensitive behaviour of 'LIKE' by using the commands: PRAGMA case_sensitive_like=ON; PRAGMA case_sensitive_like=OFF; However in my situation I would like to execute a query, part of which is case sensitive and part of which isn't. For example: SELECT * FROM mytable WHERE caseSensitiveField like 'test%' AND caseInsensitiveField like 'g2%' Is this possible? 回答1: You can use the UPPER keyword on your case insensitive field then upper-case your like

Is Java RegEx case-insensitive?

限于喜欢 提交于 2019-11-26 22:03:05
In Java, when doing a replaceAll to look for a regex pattern like: replaceAll("\\?i\\b(\\w+)\\b(\\s+\\1)+\\b", "$1"); (to remove duplicate consecutive case-insensitive words, e.g. Test test), I'm not sure where I put the ?i . I read that it is supposed to be at the beginning, but if I take it out then i catch duplicate consecutive words (e.g. test test), but not case-insensitive words (e.g. Test test). So I thought I could add the ?i in the beginning but that does not seem to get the job done. Any thoughts? Thanks! RegexBuddy is telling me if you want to include it at the beginning, this is

Case insensitive matching in Java switch-case statement

跟風遠走 提交于 2019-11-26 21:47:12
问题 I was wondering if there is a way to perform case insensitive match in java switch case statement. the default implementation is case sensitive . Please see the example below. public class SwitchCaseTest { /** * @param args */ public static void main(String[] args) { switch ("UPPER") { case "upper" : System.out.println("true"); break; default: System.out.println("false"); break; } } } So above statement returns false as output. And i am trying make it work for case-insensitive match like

DatabaseException: Found two getters or fields with conflicting case sensitivity

♀尐吖头ヾ 提交于 2019-11-26 21:21:25
问题 Every time I try to retrieve data from my database, I get com.google.firebase.database.DatabaseException: Found two getters or fields with conflicting case sensitivity for property: n for any of my fields that are a single letter. Googling this issue gives 0 results and I can find no case incongruities in my code. I don't know if this is a bug in Firebase or if I have to do something special for any fields with names 1 character long. Here is the rest of the error report if it makes a