multiline

How do I enter a multi-line comment in Perl? [duplicate]

佐手、 提交于 2019-11-28 15:37:10
Possible Duplicate: What are the common workarounds for multi-line comments in Perl? How do I add a multi-line comment to Perl source code? Nikhil Jain POD is the official way to do multi line comments in Perl, see Multi-line comments in perl code and Better ways to make multi-line comments in Perl for more detail. From faq.perl.org[ perlfaq7 ] How can I comment out a large block of Perl code? The quick-and-dirty way to comment out more than one line of Perl is to surround those lines with Pod directives. You have to put these directives at the beginning of the line and somewhere where Perl

Multiline for WPF TextBox

瘦欲@ 提交于 2019-11-28 15:29:12
I am developing an app for sending some feedback. Basically I'm trying to make a TextBox for comments, but I'm used to the WinForms MultiLine=true . I've set MinLines to 3, which is getting there, but preferably I'd like it if the user is able to type wherever in this block - like press enter and do dot points sort of thing. For example: - Item 1 blah - Item 2 blahlb lahbvl d But at the moment the text all stays on one line. - Item 1 blah - Item 2 blahb blahb blah These comments will then help fill the body of an email which is sent. It may be pointless if I can't easily keep the same

How do I create a multiline Python string with inline variables?

主宰稳场 提交于 2019-11-28 15:19:05
I am looking for a clean way to use variables within a multiline Python string. Say I wanted to do the following: string1 = go string2 = now string3 = great """ I will $string1 there I will go $string2 $string3 """ I'm looking to see if there is something similar to $ in Perl to indicate a variable in the Python syntax. If not - what is the cleanest way to create a multiline string with variables? Simeon Visser The common way is the format() function: >>> s = "This is an {example} with {vars}".format(vars="variables", example="example") >>> s 'This is an example with variables' It works fine

Way to create multiline comments in Bash?

此生再无相见时 提交于 2019-11-28 15:06:24
I have recently started studying shell script and I'd like to be able to comment out a set of lines in a shell script. I mean like it is in case of C/Java : /* comment1 comment2 comment3 */` How could I do that? Use : ' to open and ' to close. For example: : ' This is a very neat comment in bash ' David Okwii Multiline comment in bash : <<'END_COMMENT' This is a heredoc (<<) redirected to a NOP command (:). The single quotes around END_COMMENT are important, because it disables variable resolving and command resolving within these lines. Without the single-quotes around END_COMMENT, the

How to echo multi lined strings in a Bourne shell [duplicate]

怎甘沉沦 提交于 2019-11-28 11:01:57
This question already has an answer here: When to wrap quotes around a shell variable? 5 answers I want to create some scripts for filling some templates and inserting them into my project folder. I want to use a shell script for this, and the templates are very small so I want to embed them in the shell script. The problem is that echo seems to ignore the line breaks in my string. Either that, or the string doesn't contain line breaks to begin with. Here is an example: MY_STRING=" Hello, world! This Is A Multi lined String." echo -e $MY_STRING This outputs: Hello, world! This Is A Multi lined

HTML comments within comments?

百般思念 提交于 2019-11-28 10:41:33
Is there a way to comment multiple lines... which already have some comments in them? i.e. <html> <!-- Multi-line comment begin <head> <!-- This script does abcxyz --> <script>...</script> </head> <body> Hello world! </body> Multi-line comment end --> </html> It seems that even SO's syntax hilighting won't accept this... I think the key point is this: Note that comments are markup. http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4 This is not valid markup: <div <span/> /> ... so neither is the one you mention. Since all my sites are written in PHP I normally comment out code with PHP

Python: '#' Comments after backslash

≡放荡痞女 提交于 2019-11-28 10:39:40
This doesn't work: something = \ line_of_code * \ # Comment another_line_of_code * \ # Comment and_another_one * \ # Comment etc Neither does this: something = \ # Comment \ line_of_code * \ # Comment \ another_line_of_code * ... Neither does this: something = \ ''' Comment ''' \ line_of_code * \ ''' Comment ''' \ another_line_of_code * ... If there a way to make comments in the code broken into multiple lines? Do it like that: a, b, c, d = range(1, 5) result = ( # First is 1 a * # Then goes 2, result is 2 now b * # And then 3, result is 6 c * # And 4, result should be 24 d ) Actually,

Java swing: Multiline labels? [duplicate]

风流意气都作罢 提交于 2019-11-28 09:34:58
Possible Duplicate: Multiline text in JLabel I want to do this: JLabel myLabel = new JLabel(); myLabel.setText("This is\na multi-line string"); Currently this results in a label that displays This isa multi-line string I want it to do this instead: This is a multi-line string Any suggestions? Thank you EDIT: Implemented solution In body of method: myLabel.setText(convertToMultiline("This is\na multi-line string")); Helper method: public static String convertToMultiline(String orig) { return "<html>" + orig.replaceAll("\n", "<br>"); } You can use HTML in JLabels . To use it, your text has to

Getting log message from svnlook via windows batch

独自空忆成欢 提交于 2019-11-28 09:08:44
问题 I try to prepare a post-commit hook for my svn repository. Therefore i need the log message from the last commit which I get with the command svnlook log -r %REV% %REPOS% . Filling the snippet with the appropriate params I get the following multline log message: This is my transaction. This works well so far. Now I put this in a .bat file: @ECHO OFF REM just for testing purpose... SET REPOS=C:\repo SET REV=40 FOR /F %%i in ('svnlook log -r %REV% %REPOS%') do SET VAR=%%i ECHO %VAR% When I

Python multi-line with statement

梦想的初衷 提交于 2019-11-28 07:59:37
What is a clean way to create a multi-line with in python? I want to open up several files inside a single with , but it's far enough to the right that I want it on multiple lines. Like this: class Dummy: def __enter__(self): pass def __exit__(self, type, value, traceback): pass with Dummy() as a, Dummy() as b, Dummy() as c: pass Unfortunately, that is a SyntaxError . So I tried this: with (Dummy() as a, Dummy() as b, Dummy() as c): pass Also a syntax error. However, this worked: with Dummy() as a, Dummy() as b,\ Dummy() as c: pass But what if I wanted to place a comment? This does not work: