case-insensitive

Accent and case insensitive collation in Oracle with LIKE

隐身守侯 提交于 2019-11-29 04:50:41
I have found this answer useful: Accent and case insensitive COLLATE equivalent in Oracle , but my question is regarding LIKE searching with a version 9 Oracle db. I have tried a query like this: SELECT column_name FROM table_name WHERE NLSSORT(column_name, 'NLS_SORT = Latin_AI') LIKE NLSSORT('%somethingInDB%', 'NLS_SORT = Latin_AI') but no results are ever returned. I created a little Java file to test: import org.apache.commons.dbcp.BasicDataSource; import java.sql.Connection; import java.sql.SQLException; import java.sql.PreparedStatement; import java.sql.ResultSet; public class

How to perform case insensitive diff in Git

♀尐吖头ヾ 提交于 2019-11-29 03:02:14
git diff does not support a case-insensitive comparison of files. Google shows a very few people asking for that feature, and that too only in combination with some other git diff switch, like with -G or with --color-words . I don't care for other switches, as long as git diff can show me the case-insensitive diff. Since I didn't see any specific question towards that, and since I found a solution after an hour researching this problem, I am adding this question and the answer. The solution is to use git difftool . With the following config command, I can add a custom diff tool called idiff

Case insensitive argparse choices

此生再无相见时 提交于 2019-11-29 02:47:53
Is it possible to check argparse choices in case-insensitive manner? import argparse choices = ["win64", "win32"] parser = argparse.ArgumentParser() parser.add_argument("-p", choices=choices) print(parser.parse_args(["-p", "Win32"])) results in: usage: choices.py [-h] [-p {win64,win32}] choices.py: error: argument -p: invalid choice: 'Win32' (choose from 'win64','win32') Transform the argument into lowercase by using type = lambda s : s.lower() for the -p switch. As pointed out by chepner in the comments, since str.lower is already an appropriate function, the lambda wrapper is not necessarily

Using InvariantCultureIgnoreCase instead of ToUpper for case-insensitive string comparisons

天大地大妈咪最大 提交于 2019-11-28 23:28:05
On this page , a commenter writes: Do NOT ever use .ToUpper to insure comparing strings is case-insensitive. Instead of this: type.Name.ToUpper() == (controllerName.ToUpper() + "Controller".ToUpper())) Do this: type.Name.Equals(controllerName + "Controller", StringComparison.InvariantCultureIgnoreCase) Why is this way preferred? Here is the answer in details .. The Turkey Test ( read section 3 ) As discussed by lots and lots of people, the "I" in Turkish behaves differently than in most languages. Per the Unicode standard, our lowercase "i" becomes "İ" (U+0130 "Latin Capital Letter I With Dot

SOLR Case Insensitive Search

a 夏天 提交于 2019-11-28 23:20:06
I've a problem in SOLR Search. I have a data like this: I use solr admin to find this data using query like this: address_s:*Nadi* and found those data. But when I use this query: address_s:*nadi* it doesn't found anything. I've googling and I found an answer to create a field with the following script: <fieldType name="c_text" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class="solr

mod_rewrite RewriteCond - is NC flag necessary for just domain part? And some more

。_饼干妹妹 提交于 2019-11-28 22:09:01
问题 I have seen many times in htaccess these type of rules : RewriteCond %{HTTP_REFERER} !^http://www.domain.it$ [NC] or RewriteCond %{HTTP_HOST} !^www\.domain\.it$ [NC] Why is the NC flag necessary, when checking only the domain part? I noticed browsers always converts uppercases in domain names into lower cases , so I don't see what the [NC] flag is usueful for in this case. I mean if we check the remaining part of the url I understand the need for [NC] flag cause on Unix systems www.domain.com

Running a case-insensitive cypher query

人盡茶涼 提交于 2019-11-28 21:06:05
Is it possible to run a case-insensitive cypher query on neo4j? Try that: http://console.neo4j.org/ When I type into this: start n=node(*) match n-[]->m where (m.name="Neo") return m it returns one row. But when I type into this: start n=node(*) match n-[]->m where (m.name="neo") return m it does not return anything; because the name is saved as "Neo". Is there a simple way to run case-insensitive queries? Volker Pacher Yes, by using case insensitive regular expressions: WHERE m.name =~ '(?i)neo' http://neo4j.com/docs/developer-manual/current/cypher/clauses/where/#where-case-insensitive

How to make String.Contains case insensitive? [duplicate]

余生颓废 提交于 2019-11-28 18:05:14
This question already has an answer here: Case insensitive 'Contains(string)' 24 answers How can I make the following case insensitive? myString1.Contains("AbC") You can create your own extension method to do this: public static bool Contains(this string source, string toCheck, StringComparison comp) { return source != null && toCheck != null && source.IndexOf(toCheck, comp) >= 0; } And then call: mystring.Contains(myStringToCheck, StringComparison.OrdinalIgnoreCase); You can use: if (myString1.IndexOf("AbC", StringComparison.OrdinalIgnoreCase) >=0) { //... } This works with any .NET version.

Javascript: highlight substring keeping original case but searching in case insensitive mode

不羁的心 提交于 2019-11-28 17:52:59
I'm trying to write a "suggestion search box" and I cannot find a solution that allows to highlight a substring with javascript keeping the original case. For example if I search for " ca " I search server side in a case insensitive mode and I have the following results: Calculator calendar ESCAPE I would like to view the search string in all the previous words, so the result should be: Ca lculator ca lendar ES CA PE I tried with the following code: var reg = new RegExp(querystr, 'gi'); var final_str = 'foo ' + result.replace(reg, '<b>'+querystr+'</b>'); $('#'+id).html(final_str); But

Ignore case in Python strings [duplicate]

心已入冬 提交于 2019-11-28 16:19:30
This question already has an answer here: How do I do a case-insensitive string comparison? 11 answers What is the easiest way to compare strings in Python, ignoring case? Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads). I guess I'm looking for an equivalent to C's stricmp(). [Some more context requested, so I'll demonstrate with a trivial example:] Suppose you want to sort a looong list of strings. You simply do theList.sort(). This is O(n * log(n)) string comparisons and no memory management