I want to input :) as text in slack.
slack changes it to :slightly_smiling_face: automatically.
I tried using code block, (I can't show code block itself, so I use `` `)
`` `
:)
`` `
But I see only :. ) was dropped.
You can follow this approach but you have to edit the message once.
Steps
First type in ::):
Then edit the message and remove extra colons : and you will only get :) in the message.
Other alternative can be just use : ) instead of :) as suggested in another answer.
Another way:
Place your text in single tick (`)
`:)`
you can do `:)` and it wont screw up anything.
Related
I'm honestly a novice on scilab.
I'm using print function to create .txt file with my character matrix in it.
But , when I open txt file, double quote appeared. I just want words without "".
This is how I'm using print
Compterendu(1,1)= "Medecin demandeur: "
fileresname= fullfile(RES_PATH, "compterendu.txt")
print(fileresname,Compterendu)
And, compterendu.txt was printed out like this.
Would be so grateful for any help!!
Thanks
Why do you use "print" ? After looking into the doc, yes, it is used to produce the same text as when you type the expression or the variable name on the command line. Hence it does print double quotes for strings. If you need something more basic use lower level i/o commands, like mputl.
S.
I've created a script file reader, nothing more than a glorified text reader that changes loop cases in my program, but I need it to be able to ignore comments on a line, execute that command, and go to the next line and process the new command after it finds the comment denoted with a semicolon. For the life of me, I can't figure out how to do this.
Currently, the commands are read in like this:
DO THIS FUNCTION
DO THAT FUNCTION
I'd like to comment it with a semicolon like this:
DO THIS FUNCTION ;this is a comment to be ignored
Below is my text file read code, should be able to drag and drop it in to test. The command indicator just echoes the command being read. I've removed the rest of my program, sorry, can't send that part.
Can someone shed some light?
Is a semicolon used anywhere else in your file? Or is it just used to indicate a comment?
If it is only used to indicate a comment then as you read each line in, call the Split String primitive and split at the ";". Just use the top output regardless of whether or not the line contains a semicolon:
You can use the "Match Regular Expression Function" to split up the string, as #Moray already suggested.
Sadly I can't give you an example vi right now.
The main idea is:
find the "Match Regular Expression Function"
give it a ; as char to search for
there are three outputs of the function (before match, match, after match)
use the 'before match' instead of the whole line and give it to the rest of your program
This only works if your commands don't contain any ; except for the comments.
Note: I not quite sure what happens if you give the function a string that doesn't contain ; but you can figure that out by yourself by using the detailed help to this function :)
I need to place two blockquotes in sequence, however markdown combines them into a single blockquote. The only way I can get them to separate is placing some junk text between them. As this textfield allows me to use Markdown I can demonstrate:
> First Quote
> Second Quote
Results in:
First Quote
Second Quote
While using junk text:
> First Quote
.
> Second Quote
Results in:
First Quote
.
Second Quote
I cannot use HTML tags or HTML entities. Only Markdown.
You can separate blockquotes without html elements by using comment markup <!-- --> with an extra whiteline between the blocks:
> Imagination is more important than knowledge.
<!-- -->
> Never think of the future. It comes soon enough.
<!-- -->
> Anyone who has never made a mistake has never tried anything new.
Of course you can use any HTML elements you like as well (as noted by #pepoloan):
> Imagination is more important than knowledge.
<div></div>
> Never think of the future. It comes soon enough.
<div></div>
> Anyone who has never made a mistake has never tried anything new.
An empty header, #, followed by a space also works.
> Hello World
#
> Goodbye world
Unfortunately it isn't much better than <!-- --> But I kind of like it more, and use it.
>If I try a non breaking space
>it line breaks; don't ask me how
Result:
If I try a non breaking space
it line breaks; don't ask me how
Try this:
Use a U+200B character in-between the quotes, which is defined as a zero-length space to break up the quotes.
> Quote
> Quote
It looks like this:
> Quote
> Quote
You could use pandoc, which parses your original input as two consecutive blockquotes.
From experimenting, I found these to work also. Note they are not legal HTML or Markdown, but they seem do to the job:
<!
<$
</
<a
One way to do so is by just adding </> after first blockquote followed by a newline. And by this way nothing gets printed as well.
First quote
Second Quote
You have something like your first block quote, then 2 enters and on the second enter give a # symbol for Heading but leave the heading blank and then you next quote in next line.
This is one quote
This is another quote
Notepad++ obviously recognizes all comments as such. Is there a way to simply delete all?
Edit: Stat-R's bookmark method has helped greatly, not only for removing comments but for conditionally removing lines in general.
For a general file, first of all you need to know the comment operator of the language you are writing the file in. For example, in java script the comment operator is //.
For the following code...
In NP++, you need to
Mark the lines that contains '//'. Make sure the bookmark option is enabled.
Then, choose from NP++ menu Search>Bookmark>Remove Bookmarked lines
EDIT:
Another solution after #Chris Mirno 's suggestion is as follows:
Use regular expression. See the image below. It is self explanatory
To understand it better, refer to these
In the Find & Replace Dialog, put the following regex and adjust the search options as depicted.
/\*.*?\*/
Replace with: (empty)
Select Mode: Regular Expression AND .(dot) matches newline
This should remove all your C style comments spanned across lines.
Star-R and Chris Mirno Answer are also Correct and Good.
But For Line Comment:
//.*?(?=\r?$)
Explanation:
// will be the Starting Position
.*? Will be any character
(?=\r?$) will search to the end of the line (as it is required in line comment)
Note:
But Still check each of the line because for example if your code contains soap format like
//www.w3.org/2001/XMLSchema-instance\x2......");
it will capture this line because the starting is // and it goes to end of the line so watch out for this :)
Warning to all using Stat-R's solution:
This method will remove lines of code if formatted like this:
echo "hello"; //This comment will be detected
Following his method, the entire line will be removed.
Therefore make sure to go through and make these comments, their own line before doing this method.
I have had some luck running a macro for the above. Basically:
search for // (F3)
select to end of line (shift+end)
delete (delete)
Put // into the search dialog by just searching for it once. Then record the three steps in a macro, then play it back until EOF.
The first time I did it I had a problem, but then it worked, not sure what I did differently.
Anton Largiader's answer was the most reliable one, including complex inline comments.
However, it will leave many empty lines, including ones with empty characters (space, tabs...) so I would just add another step to make it almost perfect:
After running the macro, just do:
Edit > Line Operations > Remove Empty Lines
OR
Edit > Line Operations > Remove Empty Lines (Containing Blank Characters)
1st option is good if you wish to remove only really empty lines
2nd options will remove every empty line even containing space etc. so there will be no more actual spacing left between code blocks. 1st option might be the safest with some manual cleanup afterwards.
As someone suggested in another post, the simplest and most reliable is maybe to export the all text in .RTF format using Menu Plugin-->NppExport-->Export to RTF and then:
-Open the newly created file in Word
-Select any part of any comment
-On the top-right side of Word clic Select--> Select all texts with similar formatting
-Remove the selected comments all at once (del or cut if doesn't work)
To remove Powershell comments if someone find it handy:
Removing Comment in a Powershell using Notepad ++
To find just lines beginning with # (and not with # elsewhere in the line).
Notepad++ SEARCH Menu > Find
‘Mark‘ Tab – fill in as below.
Select ‘Mark All’ (clear all marks if used previously).
Regex ^[#}
enter image description here
SEARCH Menu > bookmark > Remove (or do anything on the list with
them)
Clear all marks to reset
You can select no comments just code by doing the following:
Regex ^[^#}
enter image description here
Enter ctrl+shift+K to remove comment
I've got an internationalised app that uses spring and freemarker. I'm getting content from localised property files using.
${rc.getMessage("help.headings.frequently_asked_questions")}
For some of the content there are carriage returns in the property values. Because I'm displaying in a web page I'd like to replace these with .
What is the best way to do this?
Edit: looking closer it seems that I don't actually have carriage returns in the property files. The properties are coming back as single line strings.
Is there a better way to declare the properties so they know they are multi-line?
help.faq.answer.new_users=If you have not yet set a PIN, please enter your username and passcode (from your token) in the boxes provided and leave the PIN field blank.\
You will be taken through the steps to create a PIN the first time you log in.
Cheers,
Pete
${springMacroRequestContext.getMessage("help.headings.frequently_asked_questions", [], "", false)?html?replace("\n", "<br>")}
To handle CR + LF (carriage return + line feed) line endings, as well as just LF do this:
<#escape x as x?html?replace("\\r?\\n","<br />",'r')>...</#escape>
<#escape x as x?html?replace('\n', '<br>')>...</#escape>
works just fine.
If you want this to be the default behaviour, consider writing a custom TemplateLoader as suggested in this blog: http://watchitlater.com/blog/2011/10/default-html-escape-using-freemarker/.
As to the
Is there a better way to declare the properties so they know they are multi-line?
part of your question, maybe this helps: you can include line terminator characters in your property values by using the \r and \n escape sequences, like it is explained in the API documentation of java.util.Properties#load(java.io.Reader).
I would recommend writing a custom directive for it (see freemarker.template.TemplateDirectiveModel), so in your templates you can write something like <#my.textAsHtml springMacroRequestContext.getMessage(...) />. It's important that this is a directive, not function, so it works properly inside <#escape x as x?html>...</#escape>. Otherwise it would be double-escaped. Using a directive can also give the highest performance, as you can directly send the output to the output Writer, rather than building a String first.