concatenation

Removing duplicate values within a comma separated list in PHP

做~自己de王妃 提交于 2019-12-01 13:50:30
How can I remove duplicate values within a comma separated list in PHP? I have 2 versions of a customer questionnaire - one is more detailed than the other - and in one they are asked the items they like and in the other they are asked to specify the items they like in ranked order. In this particular example, one of the columns ('items_like') may contain several values in a comma separated list. There are two other scenarios where each of the columns may contain several values in a comma separated list. In order to display a list of all the items a customer likes, I am concatenating the 4

Use variable in jQuery selector [duplicate]

一个人想着一个人 提交于 2019-12-01 13:47:50
问题 This question already has answers here : jQuery attribute selector variable (3 answers) jQuery selectors with variables (5 answers) Closed 5 years ago . In the function below, I'd like the idurl be the word apple with a suffix. The suffix is number containing a number. Example would be apple12 . But in the function below, I have trouble concatenating the variable number with the word apple. function apple(number) { if (something === "0") { $('.onchange :checkbox[idurl="apple" + number]').prop

Play WAV files one after the other in Java

拥有回忆 提交于 2019-12-01 13:44:05
I'm trying to play a few WAV files after each other. I tried this method: for (String file : audioFiles) { new AePlayWave(file).start(); } But that plays them all at the same time. So I need a function that looks like this: public void play(Vector<String> audioFiles); The vector contains the files, for example: "test1.wav" , "test2.wav" I have been looking for over four hours, but I can't seem to find a working solution :( I also tried concatenating the WAV files to one AudioInputStream. It doesn't give any compiler errors, but the sound is totally messed up. Code: public static

How to concatenate corresponding lines in two text files

别说谁变了你拦得住时间么 提交于 2019-12-01 13:23:00
问题 I have two text files that I need to combine by concatenating line n from file #2 to line n of file #1 to make line n of file #3. They will always have the same number of lines and will always match up (i.e. line 1 in one file is a match to line 1 in the second file). I have to concatenate these two files into a new, third file. No spaces added between the fields. I am running Windows 7 and using a batch file but I could use powershell if that’s a better choice here. Here's an example of the

Changing size of array in extension method does not work?

与世无争的帅哥 提交于 2019-12-01 12:28:04
So basically I wrote my little Add extension method for array types. using System; using System.Linq; public static class Extensions { public static void Add<T>(this T[] _self, T item) { _self = _self.Concat(new T[] { item }).ToArray(); } } public class Program { public static void Main() { string[] test = { "Hello" }; test = test.Concat(new string[] { "cruel" }).ToArray(); test.Add("but funny"); Console.WriteLine(String.Join(" ", test) + " world"); } } The output should be Hello cruel but funny world , but the but funny will never be concatenated within the extension method. Editing the same

Sybase: How do I concatenate rows in sybase column

▼魔方 西西 提交于 2019-12-01 12:13:04
I have a table with ID and Dept. Table is id dept salary date 1 30 2000 8/25/2015 12:06:54.870 PM 2 20 5500 7/12/2015 12:06:54.870 PM 3 30 6700 11/21/2013 12:06:54.870 PM 4 30 8900 4/16/2009 12:06:54.870 PM 5 30 9900 6/29/2014 12:06:54.870 PM 6 10 1120 7/3/2015 12:06:54.870 PM 7 20 8900 4/13/2013 12:06:54.870 PM 8 10 2400 7/23/2015 12:06:54.870 PM 9 30 2600 8/21/2015 12:06:54.870 PM 10 10 2999 8/3/2015 12:06:54.870 PM Just need the output like this Dept ID 30 1,3,4,5,9 This is the best way I know. Please do post if anyone knows a better solution: I have named your table sal DECLARE @id INT ,

How Can I concatenate a parameter string in javascript function on string in appended html?

核能气质少年 提交于 2019-12-01 12:10:00
问题 This is my code for html <div id="content"></div> Then I append an inpunt to #content: $( document ).ready(function() { // Handler for .ready() called. var parameter = "<p>Hola</p>"; $("#content").append('<div><p>click the button</p>'+ '<input type="submit" name="submit_answers" value="Submit" onclick="getValue();" >'+ '<input type="submit" name="submit_answers" value="Submit" onclick="'+getValue2(parameter)+'" >'+ '</div>'); }); function getValue2(parameter){ alert(parameter); } function

how to use ffmpeg to apply 1:1 SAR before concat on large complex filter

一笑奈何 提交于 2019-12-01 11:23:51
I use ffmpeg to concat videos in a fashion similar to this: I ran into a weird error with my inputs [Parsed_concat_0 @ 000000002a05bb80] Input link in10:v0 parameters (size 1280x720, SAR 2049:2048) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1) From what I've researched I need to use setsar to force all the videos to be 1:1 before I concat, but I'm not sure how to do that in my filter. Add the setsar filter: ffmpeg -i 0.mp4 -i 1.mp4 -i 2.mp4 -filter_complex "[0:v]setsar=1[v0];[v0][1:v][2:v]concat=n=3:v=1:a=0[v]" -map "[v]" out.mp4 This example is assuming that

How to concatenate identifier specified on two rows?

雨燕双飞 提交于 2019-12-01 11:13:35
问题 Input where identifier specified by two rows 1-2 L1_I L1_I C-14 <---| unique idenfier WWPTH WWPT WWPTH <---| on two rows 1 2 3 Goal: how to concatenate the rows? L1_IWWPTH L1_IWWPT C-14WWPTH <--- unique identifier 1 2 3 P.s. I will accept the simplest and most elegant solution. 回答1: Assuming that the input is in a file called file : $ awk 'NR==1{for (i=1;i<=NF;i++) a[i]=$i;next} NR==2{for (i=1;i<=NF;i++) printf "%-20s",a[i] $i;print"";next} 1' file L1_IWWPTH L1_IWWPT C-14WWPTH 1 2 3 How it

Can I concatenate environment variables in apache config?

筅森魡賤 提交于 2019-12-01 10:41:39
I have two environment variables in apache config, I want to concatenate them into one new environment variable. Is this possible? I realise this doesn't work, but it demonstrates the sort of thing I'm after: SetEnv one foo SetEnv two bar SetEnv three one+two ...and then 'three' would have the value "foobar" Use a mod_rewrite regular expression with two wildcard backreferences to access the environment variables and concatenate the strings: #This will be true for any user agent RewriteCond %{HTTP_USER_AGENT} ^.* #Replace / with / and set the new environment variable RewriteRule /(%{ENV:one})*(