newline

Rationale of choosing difference new line representation by Unix, Mac, DOS/Windows?

无人久伴 提交于 2019-12-10 12:58:09
问题 Does anyone know the original rationale, or story, of the different platforms each choosing a different, yet similar to some degree, new line representation? There must be some design decisions made originally. (I don't believe this is all random choice ...) Unix/Mac OS X: LF (\n) Mac OS 9 and before: CR (\r) DOS/Windows: CRLF (\r\n) 回答1: Jeff Atwood posted on this very topic in "The Great Newline Schism" Wikipedia covers the history of newline. In short, CR+LF is a reference to the electric

VBA: Debug.Print without newline?

不问归期 提交于 2019-12-10 12:53:23
问题 For debugging in VBA, I have several Debug.Print statements throughout my code. For a line-parsing block, I'd like to print the line, and output any flags inline with the line, without having multiple Debug.Print sFlag & sLine statements throughout the many if/elseif/else blocks. Is there a way, within VBA, to suppress the newline at the end of a Debug.Print statement? 回答1: It turns out you can easily do this by simply adding a semicolon to the end of your Debug.Print statement. Like so:

C++ Standards (newline ending of source files)

别等时光非礼了梦想. 提交于 2019-12-10 12:36:56
问题 I am referring to: Why should text files end with a newline? One of the answers quotes the C89 standard. Which in brief dictates that a file must end with a new line, which is not immediately preceded by a backslash. Does that apply to the most recent C++ standard? #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } //\ Is the above valid? (Assuming there is a newline after //\, which I've been unable to display) 回答1: The given code is legal in

ByteArrayOutputStream/InputStream losing newline characters on S3 Import

感情迁移 提交于 2019-12-10 12:18:06
问题 I have the following code (pseudo code-ish)... ByteArrayOutputStream output = new ByteArrayOutputStream(); output.write("something\n".getBytes()); output.write("something\n".getBytes()); ByteArrayOutputStream input = new ByteArrayInputStream(output.getBytes()); s3.putStream(input); Then when I get the file from s3 it looks like this: somethingsomething. The newlines are gone!! I can't figure out why that is happening and internet searches have not been helpful. Does anyone have any ideas? 回答1

PhpStorm new line in HTML replace

不羁岁月 提交于 2019-12-10 12:07:13
问题 For over a year I have been trying to do the simplest thing - do an HTLM/PHP search and replace in several files. For exapmle if I want to replace <!DOCTYPE html> with <!DOCTYPE html> <!-- TODO UNIVERSAL Favicon Page title Active page --> I get <!DOCTYPE html> <!-- TODO UNIVERSAL Favicon Page title Active page --> I realize search and replace is probably considered old fashioned but I have found it an incredibly useful tool for 30 years. I have scoured JetBrains web site with no avail and

Python - Print Each Sentence On New Line

不问归期 提交于 2019-12-10 11:56:45
问题 Per the subject, I'm trying to print each sentence in a string on a new line. With the current code and output shown below, what's the syntax to return "Correct Output" shown below? Code sentence = 'I am sorry Dave. I cannot let you do that.' def format_sentence(sentence): sentenceSplit = sentence.split(".") for s in sentenceSplit: print s + "." Output I am sorry Dave. I cannot let you do that. . None Correct Output I am sorry Dave. I cannot let you do that. 回答1: You can do this : def format

What's with the line break variations in C# and ASP.NET? (\r\n vs.\n)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 11:35:49
问题 I've been writing code for ASP.NET since the start, and today I encountered something I've never seen before. Typically I've looked for line breaks in C# (when posted in ASP.NET from a textarea, for example) by expecting "\r\n". Now I'm using the MVC framework, and the text coming over the wire from a textarea simply has "\n" for line breaks. Is there something going on in old school TextBox controls that normalizes the line breaks? Since MVC just uses the form data as-is, is this normal?

Why do multiline cells in my CSV file appear with a question mark at the end of each line in Excel?

点点圈 提交于 2019-12-10 11:25:45
问题 I'm currently working on a project where we'd like to allow a user to export their data to CSV. Some of the data we present has multiple values for a single cell, and so we use the standard CSV method of putting each value on its own line: Column A, Column B, Column C Value A, "Value B1 Value B2", Value C Most of the time this works fine, but some people are reporting seeing a small question mark in a box character appear at the end of each line when they load the file in Excel. Why is this

`git` shows changed files after cloning, without any other actions

守給你的承諾、 提交于 2019-12-10 10:58:06
问题 git clone git@github.com:erocarrera/pydot (35a8d858b) in a Debian with git config core.autocrlf input shows: modified: test/graphs/b545.dot modified: test/graphs/b993.dot modified: test/graphs/cairo.dot These files have CRLF line endings, for example: $ file test/graphs/cairo.dot test/graphs/cairo.dot: UTF-8 Unicode text, with CRLF line terminators The .gitattributes file contains: *.py eol=lf *.dot eol=lf *.txt eol=lf *.md eol=lf *.yml eol=lf *.png binary *.ps binary Changing core.autocrlf

What is the difference between “\r” and “\n”? [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-10 10:46:22
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: What is the difference between \r and \n? I understand that it's different for each operating System, for example, "\r\n" may be expected in Windows, "\n" may be expected in Unix snd "\r" may be expected in Macs. What are the differences between these two (or three, if you want to include "\r\n") escape sequences? Why isn't it consistent across all systems? I'm curious about this. 回答1: Because it just isn't. \r