matching

compare row values over multiple rows (R)

[亡魂溺海] 提交于 2019-11-29 23:54:52
问题 I don't think this question has asked yet (most similar questions are about extracting data or returning a count). I am new to R, so any help would be appreciated! I have a dataset of multiple runs of an experiment in one file and the data looks like this, where i have all the time steps for each run in rows time [info] id (unique per run) I am attempting to calculate when the system reaches equilibrium, which I am defining as stable values in 3 interdependent parameters. I would like to have

Quickest way to change a pair of parenthesis to brackets in vim

♀尐吖头ヾ 提交于 2019-11-29 17:00:31
问题 I am new to vim and in the process of discovering tons of interesting things that one can using this powerful editor. One particular thing that I need to do very frequently is to change a pair of parenthesis in the text to square-brackets (for example to change ( (a+b+c) ) to [ (a+b+c) ] ) or vice-verso. I now do this by manually changing the two characters ( and ) to [ and ] . However, when there is a lot of text in between the parenthesis, it could be difficult to locate the pair of opening

String searching algorithms in Java

a 夏天 提交于 2019-11-29 15:45:59
问题 I am doing string matching with big amount of data. EDIT: I am matching words contained in a big list with some ontology text files. I take each file from ontology, and search for a match between the third String of each file line and any word from the list. I made a mistake in overseeing the fact that what I need to do is not pure matching (results are poor), but I need some looser matching function that will also return results when the string is contained inside another string. I did this

Hungarian Algorithm and multiple factors

心不动则不痛 提交于 2019-11-29 15:14:50
问题 I have a situation where I need to allocate people to several events. If we just had a price as a factor, it would be fine, but there is a number of factors that come in. First, some background. This is for a non-profit organization that promotes story hours for children that are hospitalized for any reason, so they depend on voluntary work to do so. So, since they rely on people's good will, they give people as much work as people can / want to do, which varies like: Some people can only do

Matching dates with regular expressions in Python?

只愿长相守 提交于 2019-11-29 14:23:45
问题 I know that there are similar questions to mine that have been answered, but after reading through them I still don't have the solution I'm looking for. Using Python 3.2.2, I need to match "Month, Day, Year" with the Month being a string, Day being two digits not over 30, 31, or 28 for February and 29 for February on a leap year. (Basically a REAL and Valid date) This is what I have so far: pattern = "(January|February|March|April|May|June|July|August|September|October|November|December)[,][

Fingerprint matching/recognition algorithms/implementations

两盒软妹~` 提交于 2019-11-29 13:50:03
问题 Throughout this day I've been investing time into fingerprint matching/recognition algorithms/implementations in the world of programming. Though it's a bit of a vague because I can't seem to find anything really related. I'm basically looking for two next things: Fingerprint recognition: verify that the image is actually a fingerprint and so can be matched with another fingerprint Fingerprint matching: match two fingerprint from items to see if the actually are equal All operations will be

“No matching function call” in constructor

大憨熊 提交于 2019-11-29 06:35:11
This is the constructor declaration that I have in my "solver.h" file. Solver(const Board &board_c, int max_moves_c); When trying to compile I get the following error... solver.cpp: In constructor 'Solver::Solver(const Board&, int)': solver.cpp:6:55: error: no matching function for call to 'Board::Board()' Solver::Solver(const Board &board_c, int max_moves_c) And then it lists the candidates which are the Board constructors. I'm not sure what I'm doing wrong as I see no reason why I should be getting this error. I am compiling with g++. error: no matching function for call to 'Board::Board()'

Match elements between 2 collections with Linq in c#

。_饼干妹妹 提交于 2019-11-29 05:50:39
问题 i have a question about how to do a common programming task in linq. lets say we have do different collections or arrays. What i would like to do is match elements between arrays and if there is a match then do something with that element. eg: string[] collection1 = new string[] { "1", "7", "4" }; string[] collection2 = new string[] { "6", "1", "7" }; foreach (string str1 in collection1) { foreach (string str2 in collection2) { if (str1 == str2) { // DO SOMETHING EXCITING/// } } } This can

Recursive listing of all files matching a certain filetype in Groovy

半腔热情 提交于 2019-11-28 23:39:10
问题 I am trying to recursively list all files that match a particular file type in Groovy. This example almost does it. However, it does not list the files in the root folder. Is there a way to modify this to list files in the root folder? Or, is there a different way to do it? 回答1: This should solve your problem: import static groovy.io.FileType.FILES new File('.').eachFileRecurse(FILES) { if(it.name.endsWith('.groovy')) { println it } } eachFileRecurse takes an enum FileType that specifies that

how to match dna sequence pattern

大兔子大兔子 提交于 2019-11-28 19:36:17
I am getting a trouble finding an approach to solve this problem. Input-output sequences are as follows : **input1 :** aaagctgctagag **output1 :** a3gct2ag2 **input2 :** aaaaaaagctaagctaag **output2 :** a6agcta2ag Input nsequence can be of 10^6 characters and largest continuous patterns will be considered. For example for input2 "agctaagcta" output will not be "agcta2gcta" but it will be "agcta2". Any help appreciated. Explanation of the algorithm: Having a sequence S with symbols s(1), s(2),…, s(N). Let B(i) be the best compressed sequence with elements s(1), s(2),…,s(i). So, for example, B(3