concat

JavaScript function to automatically count consecutive letters in a string

守給你的承諾、 提交于 2019-12-05 00:59:04
问题 I am attempting (unsuccessfully) to write JavaScript function LetterCount to count the consecutive letters in a string (and not the total number). Ideally: LetterCount("eeeeeoooohhoooee") = [["e", 5],["o",3],["h",2],["o",3],["e",2]] The following code attempts to count the number of consecutive letters in a string only when I already know what they are: function LetterCount(str) { for (var i=0; i<str.length;i++) { var arr1=[]; arr2=[]; arr3=[]; arr4=[]; arr5=[]; var e=0; o=0; h=0; o2=0; e2=0;

CONCAT with GROUP_CONCAT in mysql

自闭症网瘾萝莉.ら 提交于 2019-12-04 20:34:53
So I have looked everywhere for an answer to this, but so far no luck. Any help is much appreciated. I am new to mysql (transferring from a filemaker pro background). I have a database where I keep information for prospects for our business. I have a question about listing information for our users to see. The INQUIRY table holds the information for each inquiry (i.e. date inquiry came in, status of the inquiry, etc.). The PROSPECT table holds the information on each prospect (potential client) (i.e. first name, last name, age, etc.). A third table, INQUIRYNOTES , hold information on our

Append Level to Column Index in python pandas

风格不统一 提交于 2019-12-04 19:26:59
问题 I have several Dataframes with the same columns that I'd like to merge on their indices only. print df1 out[]: Value ISO Id 200001 8432000000 USD 200230 22588186000 USD 200247 4633000000 USD 200291 1188880000 USD 200418 1779776000 USD print df2 out[]: Value ISO Id 200001 1.309168e+11 USD 200230 5.444096e+10 USD 200247 9.499602e+09 USD 200291 2.089603e+09 USD 200418 3.827251e+09 USD print df3 out[]: Value Id 200001 3.681908 200230 3.408507 200247 4.531866 200291 0.273029 200418 3.521822 I

How do I pair rows together in MYSQL?

限于喜欢 提交于 2019-12-04 14:07:15
I'm working on a simple time tracking app. I've created a table that logs the IN and OUT times of employees. Here is an example of how my data currently looks: E_ID | In_Out | Date_Time ------------------------------------ 3 | I | 2012-08-19 15:41:52 3 | O | 2012-08-19 17:30:22 1 | I | 2012-08-19 18:51:11 3 | I | 2012-08-19 18:55:52 1 | O | 2012-08-19 20:41:52 3 | O | 2012-08-19 21:50:30 Im trying to create a query that will pair the IN and OUT times of an employee into one row like this: E_ID | In_Time | Out_Time ------------------------------------------------ 3 | 2012-08-19 15:41:52 | 2012

After Pandas Dataframe pd.concat I get NaNs

瘦欲@ 提交于 2019-12-04 14:04:56
问题 I have three pandas df one of them has been 'row'-shifted and the first element is empty. When I concatenate the three df to obtain a single 3-column dataframe I get all NaN in two out of three columns: df1: S 2010-12-31 True 2011-01-01 False 2011-01-02 False df2: P 2010-12-31 2011-01-01 On 2011-01-02 On df3: C 2010-12-31 On 2011-01-01 On 2011-01-02 On res = pd.concat([df1, df2, df3]): P C S 2010-12-31 NaN NaN True 2011-01-01 NaN NaN False 2011-01-02 NaN NaN False The order seems to be

String Concat With Same Reference? [duplicate]

梦想与她 提交于 2019-12-04 11:26:14
This question already has answers here : a confusion about java String literal pool and String's concatenation (4 answers) When should we use intern method of String on String literals (13 answers) Closed 3 years ago . Here is my code and I am now quite confuse about String pool and Heap storage by this output. public class String1 { public static void main(String[] args) { // TODO Auto-generated method stub String str = "abcd"; String str1 = "" ; str1=str1+"abcd"; if(str.equals(str1)) System.out.println("True"); else System.out.println("False"); if(str == str1) System.out.println("True");

MySQL GROUP_CONCAT multiple fields

一曲冷凌霜 提交于 2019-12-04 08:08:59
I'm probably having a no-brain moment. I want to return a series of numbers using GROUP_CONCAT from two fields in my database. I have done this so far using the following: SELECT t_id, CONCAT(GROUP_CONCAT(DISTINCT s_id),',',IFNULL(GROUP_CONCAT(DISTINCT i_id),'')) AS all_ids FROM mytable GROUP BY t_id This works fine but if i_id is NULL then of course I get an unnecessary comma. Is there a better way to do this so I don't end up with a comma at the end if i_id is NULL? You need to use CONCAT_WS to avoid extra comma for NULL values, try this: SELECT t_id, CONCAT_WS(',', GROUP_CONCAT(DISTINCT s

how to concat a variable to a regex in C# [closed]

淺唱寂寞╮ 提交于 2019-12-04 07:37:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I am trying to concat a variable to a regen in c# but it is not working string color_id = "sdsdssd"; Match variations = Regex.Match (data, @""+color_id+"_[^\""]*\""\W\,\""sizes\""\:\s*\W.*?businessCatalogItemId"":\"")", RegexOptions.IgnoreCase);@""+color_id+"_[^\""]*\""\W\,\""sizes\""\:\s*\W.*

error Illegal mix of collations for concat

时光总嘲笑我的痴心妄想 提交于 2019-12-04 06:22:08
问题 Iam trying to execute database SELECT v.id AS id, DATE_FORMAT(v.`date`, '%d %b %y') AS `date`, `getDateDiff`(v.`date`) AS `datediff`, c.`name` AS `clinic`, GROUP_CONCAT(CONCAT(an.anamnese, ', ', an.icd_name, '') SEPARATOR '|') AS anamnese_diagnose, GROUP_CONCAT(tr.name SEPARATOR '|') AS treatment, GROUP_CONCAT(CONCAT(pr.drug_name, ' (', format(pr.dosis1,0), ' x ', format(pr.dosis2,0), ')',' Jml: ',substring_index(pr.qty,'.',1),' ',pr.unit) SEPARATOR '|') AS prescribe, CONCAT_WS('/', ex

FFmpeg filter_complex concat gives only first input on crop

喜欢而已 提交于 2019-12-04 05:49:21
问题 I've encoutered problem when using concat and crop with multiple inputs and multiple outputs. Here's ffmpeg -y \ -i input_1.mp4 \ -i input_2.mp4 \ -i input_3.mp4 \ -i input_4.mp4 \ -filter_complex "[0:v][1:v][2:v][3:v]concat=n=4:v=1:a=0[v];\ [v]crop=3840:1080:960:0[center];\ [v]crop=960:1080:0:0[left];\ [v]crop=960:1080:4800:0[right]" \ -map "[center]" -c:v libx264 -preset faster -b:v 20000k -an -pix_fmt yuv420p -tune zerolatency -tune fastdecode "Output_Center.mp4" \ -map "[left]" -c:v