letters

Finding strings with duplicate letters inside

断了今生、忘了曾经 提交于 2019-12-02 04:56:24
问题 Can somebody help me with this little task? What I need is a stored procedure that can find duplicate letters (in a row) in a string from a table "a" and after that make a new table "b" with just the id of the string that has a duplicate letter. Something like this: Table A ID Name 1 Matt 2 Daave 3 Toom 4 Mike 5 Eddie And from that table I can see that Daave , Toom , Eddie have duplicate letters in a row and I would like to make a new table and list their ID's only. Something like: Table B ID

Finding strings with duplicate letters inside

偶尔善良 提交于 2019-12-02 00:53:23
Can somebody help me with this little task? What I need is a stored procedure that can find duplicate letters (in a row) in a string from a table "a" and after that make a new table "b" with just the id of the string that has a duplicate letter. Something like this: Table A ID Name 1 Matt 2 Daave 3 Toom 4 Mike 5 Eddie And from that table I can see that Daave , Toom , Eddie have duplicate letters in a row and I would like to make a new table and list their ID's only. Something like: Table B ID 2 3 5 Only 2,3,5 because that is the ID of the string that has duplicate letters in their names. I

How do I get the set of all letters in Java/Clojure?

人走茶凉 提交于 2019-11-30 08:55:08
In Python, I can do this: >>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' Is there any way to do something similar in Clojure (apart from copying and pasting the above characters somewhere)? I looked through both the Clojure standard library and the java standard library and couldn't find it. A properly non-ASCII-centric implementation: private static String allLetters(String charsetName) { CharsetEncoder ce = Charset.forName(charsetName).newEncoder(); StringBuilder result = new StringBuilder(); for(char c=0; c<Character.MAX_VALUE; c++) { if(ce

tes..

这一生的挚爱 提交于 2019-11-30 05:48:25
力扣刷题 二分查找法 二分查找法又称折半查找法。 优点:比较次数少,查找速度快,平均性能好; 缺点:要求待查表为有序表,且插入删除困难。 因此,折半查找方法适用于不经常变动而查找频繁的有序列表。 首先,假设表中元素是按升序排列,将表中间位置记录的关键字与查找关键字比较 如果两者相等,则查找成功 否则利用中间位置记录将表分成前、后两个子表如果中间位置记录的关键字大于查找关键字 则进一步查找前一子表 否则进一步查找后一子表 重复以上的过程,直到找到满足条件的记录,使查找成功,或直到子表不存在为止,此时查找不成功 给定一个只包含小写字母的有序数组 letters 和一个目标字母 target ,寻找有序数组里面比目标字母大的最小字母。 数组里字母的顺序是循环的。举个例子,如果目标字母 target = 'z' 并且有序数组为 letters = ['a', 'b'] ,则答案返回 'a' 。 示例: 输入: letters = ["c", "f", "j"] target = "a" 输出: "c" 输入: letters = ["c", "f", "j"] target = "c" 输出: "f" 输入: letters = ["c", "f", "j"] target = "d" 输出: "f" 输入: letters = ["c", "f", "j"] target = "g"

OrderBy with Swedish letters

送分小仙女□ 提交于 2019-11-30 02:56:00
问题 I have a list of my custom class Customer and I want to sort them alphabetically by Title. So I wrote myList = myList.OrderByDescending(x => x.Title).ToList<Customer>(); Now the problem is that this method doesn't support the Swedish way of sorting the letters å, ä, ö. They should appear at the end after the letter z but they don't. So I made a workaround method that replaces the Swedish letters before the ordering and then changes them back afterwords. It looks like this but it is quite slow

Regex - With Space and Special Characters

耗尽温柔 提交于 2019-11-29 16:44:19
I'm using the following Regex ^[a-zA-Z0-9]\s{2,20}$ for input Letters A - Z Letters a - z Numbers 0 - 9 The input length must be a least 2 characters and maximum 20 characters. I also want to enable space in the input, but only space, not new line, etc. Last thing I have problem with is that I want to enable characters such as !@#$%^&*)( add characters to your regex code like this~ ^[a-zA-Z0-9 !@#$%^&*)(]{2,20}$ the \s is not only express space.. Try ^[a-zA-Z0-9 ]{2,20}$ . And are you sure your original expression worked? The quantifier {2,20} is only applied to the \s , and not to your set

How do I get the set of all letters in Java/Clojure?

女生的网名这么多〃 提交于 2019-11-29 12:33:08
问题 In Python, I can do this: >>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' Is there any way to do something similar in Clojure (apart from copying and pasting the above characters somewhere)? I looked through both the Clojure standard library and the java standard library and couldn't find it. 回答1: A properly non-ASCII-centric implementation: private static String allLetters(String charsetName) { CharsetEncoder ce = Charset.forName(charsetName)

How to count the letters in a word? [duplicate]

馋奶兔 提交于 2019-11-28 14:21:47
This question already has an answer here: Letter Count on a string 11 answers I am trying to make a Python script which counts the amount of letters in a randomly chosen word for my Hangman game. I already looked around on the web, but most thing I could find was count specific letters in a word. After more looking around I ended up with this, which does not work for some reason. If someone could point out the errors, that'd be greatly appreciated. wordList = ["Tree", "Fish", "Monkey"] wordChosen = random.choice(wordList) wordCounter = wordChosen.lower().count['a', 'b', 'c', 'd', 'e', 'f', 'g'

Regex - With Space and Special Characters

自闭症网瘾萝莉.ら 提交于 2019-11-28 12:07:37
问题 I'm using the following Regex ^[a-zA-Z0-9]\s{2,20}$ for input Letters A - Z Letters a - z Numbers 0 - 9 The input length must be a least 2 characters and maximum 20 characters. I also want to enable space in the input, but only space, not new line, etc. Last thing I have problem with is that I want to enable characters such as !@#$%^&*)( 回答1: add characters to your regex code like this~ ^[a-zA-Z0-9 !@#$%^&*)(]{2,20}$ the \s is not only express space.. 回答2: Try ^[a-zA-Z0-9 ]{2,20}$ . And are

Capital letters in class name PHP

五迷三道 提交于 2019-11-27 22:47:11
I have two classes in my system. One is called file and second is File. On my localhost when i instantiate file i get file object, but my friend running the same script gets object of File like the capital letters were unrecognized and "file" was equal to "File". Is that some configurable thing? We are both running on Windows. I have WampServer, he has XAMPP. PHP is case insensitive for the class naming. it means you can normally do $file = new file() even if the class is named File and vice-versa. Are you by any chance relying on the auto loading of class files ? If this is the case, it is