concatenation

How do I concatenate two string macros in C?

不打扰是莪最后的温柔 提交于 2021-01-28 01:06:47
问题 I am trying to implement VERSION macro for my program, that is to be changed under certain circumstances. macro VERSION is defined via Makefile (git info is put there) and is a string. Now I have a set of #define'd switches and I want VERSION to reflect which of them are on. This looks now like the follows (main.h): #define COMPLEX_DEPOSITION // This is switch. later in code it is used in #ifdef...#endif construction. #ifdef COMPLEX_DEPOSITION #define CD "_COMP_DEP" // this is the string I

Concatenate certain rows into a cell ignoring duplicates

梦想的初衷 提交于 2021-01-28 00:30:10
问题 I have a google form and I would like to sort it's responses in a separate sheet on google sheets. The results of the form look sort of like this. Id Job 1 Shelving, Sorting 2 Sorting 1 Cleaning, Shelving 3 Customer Service 2 Shelving, Sorting which I would like to format into Id Jobs 1 Cleaning, Shelving, Sorting 2 Shelving, Sorting 3 Customer Service Is there a formula I can use to accomplish this, noting that it ignores duplicates and groups the different ids? Ordering of the jobs does not

How do I insert a separator when concatenating a string in C#?

て烟熏妆下的殇ゞ 提交于 2021-01-27 17:54:16
问题 I have a list of strings and I am concatenating it to flatten out the list by using the method seen here on DotNetPerls, http://www.dotnetperls.com/string-concat My question is...in their List example where their output is "catdogperls" (see toward the bottom of the webpage, just before the Summary) how do I insert a # sign as a separator between "catdogperls" such that it becomes "cat#dog#perls"? 回答1: In this case you don't want to use string.Concat() , you want to use string.Join(). This

Concatenate string to the end of all elements of a list in python

拈花ヽ惹草 提交于 2021-01-27 14:23:45
问题 I would like to know how to concatenate a string to the end of all elements in a list. For example: List1 = [ 1 , 2 , 3 ] string = "a" output = ['1a' , '2a' , '3a'] 回答1: rebuild the list in a list comprehension and use str.format on both parameters >>> string="a" >>> List1 = [ 1 , 2 , 3 ] >>> output = ["{}{}".format(i,string) for i in List1] >>> output ['1a', '2a', '3a'] 回答2: In one line: >>> lst = [1 , 2 , 3] >>> my_string = 'a' >>> [str(x) + my_string for x in lst] ['1a', '2a', '3a'] You

String Concatenation and Autoboxing in Java

痞子三分冷 提交于 2021-01-27 05:25:48
问题 When you concatenate a String with a primitive such as int, does it autobox the value first. ex. String string = "Four" + 4; How does it convert the value to a string in Java ? 回答1: To see what the Java compiler produces it is always useful to use javap -c to show the actual bytecode produced: For example the following Java code: String s1 = "Four" + 4; int i = 4; String s2 = "Four" + i; would produce the following bytecode: 0: ldc #2; //String Four4 2: astore_1 3: iconst_4 4: istore_2 5: new

String Concatenation and Autoboxing in Java

浪子不回头ぞ 提交于 2021-01-27 05:24:36
问题 When you concatenate a String with a primitive such as int, does it autobox the value first. ex. String string = "Four" + 4; How does it convert the value to a string in Java ? 回答1: To see what the Java compiler produces it is always useful to use javap -c to show the actual bytecode produced: For example the following Java code: String s1 = "Four" + 4; int i = 4; String s2 = "Four" + i; would produce the following bytecode: 0: ldc #2; //String Four4 2: astore_1 3: iconst_4 4: istore_2 5: new

Are concatenated Delphi strings held in a hidden temporary variable that retains a reference to the string?

主宰稳场 提交于 2021-01-27 00:38:29
问题 I'm trying to understand memory issues in a Delphi server application: originally I suspected an outright leak, but now believe we're seeing memory hanging around longer than it should due to the compiler's use of a hidden temporary when dynamically concatenating strings with +, causing painful free-space memory fragmentation. Background: This is a suite of 32-bit server applications on Windows, Delphi version is quite old, I think it's 7 but is for sure pre-Unicode, and uses the Nexus 3

Are concatenated Delphi strings held in a hidden temporary variable that retains a reference to the string?

南楼画角 提交于 2021-01-27 00:36:52
问题 I'm trying to understand memory issues in a Delphi server application: originally I suspected an outright leak, but now believe we're seeing memory hanging around longer than it should due to the compiler's use of a hidden temporary when dynamically concatenating strings with +, causing painful free-space memory fragmentation. Background: This is a suite of 32-bit server applications on Windows, Delphi version is quite old, I think it's 7 but is for sure pre-Unicode, and uses the Nexus 3

Pandas: how to concatenate a MultiIndex DataFrame with a single index DataFrame, and custom ordering

允我心安 提交于 2021-01-05 10:46:44
问题 I have a MultiIndex pandas DataFrame df_multi like: import pandas as pd df_multi = pd.DataFrame([['A', 'A1', 0,234,2002],['A', 'A1', 1,324,2550], ['A', 'A1', 2,345,3207],['A', 'A1', 3,458,4560],['A', 'A2', 0,569,1980], ['A', 'A2', 1,657,2314],['A', 'A2', 2,768,4568],['A', 'A2', 3,823,5761]], columns=['Product','Scenario','Time','Quantity','Price']).set_index( ['Product', 'Scenario']) and a single index DataFrame df_single like: df_single = pd.DataFrame([['A', -3,100],['A', -2,100], ['A', -1

Merging multiple video files with ffmpeg and xfade filter

五迷三道 提交于 2021-01-01 07:00:30
问题 I need to merge multiple video files (with included audio) into a single video. I've noticed xfade has been recently released and used it but I am running into an audio sync issue. All videos are in the same format / resolution / fame and bitrate / etc both for video and audio. Here is what I am using to merge 5 videos of various durations with 0.5 crossfade transitions: ffmpeg \ -i v0.mp4 \ -i v1.mp4 \ -i v2.mp4 \ -i v3.mp4 \ -i v4.mp4 \ -filter_complex \ "[0][1]xfade=transition=fade