formatting

convert eclipse formating to .clang-format or use eclipse formatter in vscode

风流意气都作罢 提交于 2021-02-19 03:19:58
问题 In my project (C/C++) I use slightly modified formatting from eclipse default formatter (bsd/allman + spaces over tabs). I would like to switch the editor, and to do so, I have to have correct formatter. Is there a way to convert .xml file with formatting exported from eclipse, to .clang-format file ? I aim to have exactly the same formatting, and I do not want to reformat the project, just because I switched the editor Optionally, is there a way to use eclipse formatter in vscode for C/C++

How can I align every word from this list?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-17 07:11:50
问题 I have a list of lists in a file: [ [ 'aaaaa', 'bbb','ccccccccc' ], [ 'aaaaa', 'bbbbbb','cccccc' ], [ 'aaa', 'bbb','ccccccccc' ] ] aaaaa bbb ccccccccc aaaaa bbbbbb cccccc aaa bbb ccccccccc I use it for some analysis but because of the lengths of the words, it is hard to read, I want to format it to look something like this: aaaaa bbb ccccccccc aaaaa bbbbbb cccccc aaa bbb ccccccccc Maybe with some generous spaces between columns. I guess I can use .format function but I tried and I found no

How to prevent Eclipse formatter from messing up text-bulleted comments?

廉价感情. 提交于 2021-02-15 10:18:21
问题 I have (Java) comments such as: /* * The quick brown fox jumped over the lazy dog. * * * Notes: * - The quick brown fox jumped over the lazy dog. The quick brown fox * jumped over the lazy dog. The quick brown fox jumped over the lazy * dog. * - The second quick brown fox jumped over the lazy dog. The quick brown * jumped over the lazy dog. The quick brown fox jumped over the lazy * dog. */ The Eclipse auto-formatter sets the comment line width properly, but makes it: /* * The quick brown fox

How do I include a timezone in my d3 time formatted data?

我是研究僧i 提交于 2021-02-13 17:26:49
问题 I"m using d3 v4. My x-axis data consists of time in milliseconds (since 1970). I would like to display this as eastern standard time, for example 08/09/17 5:20 PM EDT so I tried focus.select("text").text(d.value).append("tspan") .attr("x", 10).attr("dy", "1.5em").text(d3.timeFormat("%m/%d/%Y %H:%M %p %Z+5")(d.index_date)); but unfortunately it is instead displaying as 08/09/17 5:20 PM -0500 +% What's the proper way to format the date/time as EDT (US Eastern standard time)? 回答1: D3 v4 time

Time formatting: how to write a While loop that operates for a whole minute?

北城以北 提交于 2021-02-11 14:40:50
问题 I have written the following function: iterations_per_minute = function() { Sys.setenv(TZ='GMT+5') ## This line is optional; it just sets my timezone final_instant = as.numeric(format(Sys.time(), "%H.%M")) + 0.01 counter = 0 while(as.numeric(format(Sys.time(), "%H.%M")) < final_instant) { counter = counter + 1 } return(counter) } You can infer from the code what the function does, but allow me to explain in lay words anyway: what number can you reach by counting as fast as possible during one

Formatting numbers with prohibited characters

一曲冷凌霜 提交于 2021-02-11 13:27:34
问题 Formatting a value to display units adds clarity while retaining the numerical value in the cell. This can be done using: =TEXT(1000,"#,### kW") or via the formatting dialog: Format Cells > Number > Category Custom But some characters are not allowed by either method. How can this be done for units like "kWh" or "kWh/yr" without converting the value to a text type and thereby preventing the value from being used in a calculation? 回答1: Either enclose your string within quotes, or "escape" each

Formatting numbers with prohibited characters

旧城冷巷雨未停 提交于 2021-02-11 13:25:49
问题 Formatting a value to display units adds clarity while retaining the numerical value in the cell. This can be done using: =TEXT(1000,"#,### kW") or via the formatting dialog: Format Cells > Number > Category Custom But some characters are not allowed by either method. How can this be done for units like "kWh" or "kWh/yr" without converting the value to a text type and thereby preventing the value from being used in a calculation? 回答1: Either enclose your string within quotes, or "escape" each

Formatting numbers with prohibited characters

被刻印的时光 ゝ 提交于 2021-02-11 13:25:16
问题 Formatting a value to display units adds clarity while retaining the numerical value in the cell. This can be done using: =TEXT(1000,"#,### kW") or via the formatting dialog: Format Cells > Number > Category Custom But some characters are not allowed by either method. How can this be done for units like "kWh" or "kWh/yr" without converting the value to a text type and thereby preventing the value from being used in a calculation? 回答1: Either enclose your string within quotes, or "escape" each

Formatting dataGridView

五迷三道 提交于 2021-02-11 12:35:50
问题 I have a data in dataGridView like this: codetrans | datetrans | codeitem ----------+-----------+---------- CDTRS1 | 2015/9/14 | BR01 CDTRS2 | 2015/9/15 | BR02 CDTRS2 | 2015/9/15 | BR03 My question is how to change forecolor when codetrans and datetrans is the same, but codetrans and datetrans index won't change? private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.DataGridView.Equals

Create string with trailing spaces in Bash

僤鯓⒐⒋嵵緔 提交于 2021-02-10 19:50:41
问题 I'd like to loop over an associative array and print out the key / value pairs in a nice way. Therefore I'd like to indent the values in such a way, that they all start at the same position behind their respective keys. Here's an example: declare -A my_array my_array["k 1"]="value one" my_array["key two"]="value two" for key in "${!my_array[@]}"; do echo "$key: ${my_array[$key]}" done The output is k 1: value one key two: value two The output I'd like to have would be (for arbitrary key