Is there a syntax to specify multiline code snippets in Google (Hangouts) Chat? - hangouts-chat

I would like something like the Markdown options (of SO?), where
four leading spaces makes it look like code
blocks have been written

Google (Hangouts) Chat only supports basic (not rich nor full Markdown) formatting. For your specific inquiry, use pairs of triple backticks, i.e.,
```
Hello
World
```
For this and other formatting directives, see either the consumer help page (for end-users), or the simple messages page (for developers) in Google's documentation.

If it's a single line, you can use it between single back quote.
`Hello World`

Related

Intellij Live Template Dynamic Text

I'm trying to create a "dynamic" Live Template for PyCharm and am hitting a road block (I'm able to create simple templates with variable insertion, no problem). I'm beginning to believe that what I'm trying to accomplish may not be possible. I'm not tied to Groovy Script, but it looks to be the most promising alternative to what I'm trying to accomplish. I'm not able to provide a minimal, reproducible example beyond a simple description. Here's what I'm trying to accomplish:
Whatever is typed after hitting TAB and before hitting Enter is passed to the template, formatted and written back to the Editor. My goal is to have the resulting string be a specified length, but that's less important for the time being. It's really more about how to get keyboard input to the template and back out again.
For example:
"blk" TAB "Hello world" Enter becomes # ==================== Hello world ====================
Is this possible with Live Templates?
EDIT: To be clear, the question here is on how to reformat the typed input and return the formatted input to the output of the template. For example, using the above -- have the resulting "Hello world" line always be 80 characters long.
EDIT2: converting previous comment to an answer to close the loop on this question. Happy to reopen if new information comes to light.
Yes, it should be possible with such a template:
# ==================== $MY_TEXT$ ====================
Where $MY_TEXT$ is just an empty custom user template variable.
I have confirmed with Jet Brains that the thing I'm specifically trying to accomplish--dynamically formatting typed input to a live template--is not possible within the current IDE (as of version 2020.3).
Instead, they suggest it will require a custom plugin with specific features related to com.intellij.codeInsight.template.postfix.templates.PostfixTemplate.

QnA Markdown formatting gets lost on using Transalation API

I have been using Microsoft Translator API v3.0 which does not seem to work in my case.
The Translation actually appends spaces and the markdown gets scrambled. How to fix this?
Thanks,
deeepss
The ! indicates a sentence end, which is not what you want in this case.
You can escape the exclamation point to a tag like <exclamation>. Then it will be handled as a word in the context of the sentence.

custom soft wrap in intellij?

it bothers me:
why can't i "soft return" in intellij (or any IDE actually)?
is there a way i don't know of to "X + return key"?
situation: i want to copy&paste long paragraphs into a translation.json.
Afterwards, i want to format them with html tags.
So why can't i have
"translation": {
Hi!/
this is/
the text./
maybe there is a/
LINK too?/
/
Second Paragraph/
/
This is the second paragraph./
}
with /being soft wrap markers
instead of
"translation": {
Hi! this is the text. maybe there is a LINK too? Second Paragraph This is the /
second paragraph.
}
(it makes inserting the html tags a PITA)
why can't i "soft return" in intellij (or any IDE actually)?
Most likely because it is not a highly desired feature. Secondly, from a practical standpoint, the implementation would be cumbersome because most file formats an IDE uses are ultimately plain text. As such the file does not have a concept of a soft return. For an IDE to support arbitrary soft returns, it would need to maintain a data store containing the metadata of where in each and every file you've ever edited you want soft returns.
Or alternatively, the soft returns would need to be stored in the file. But the only way to do that and not "effect" the actual code in the file is via comments. Such as how an IDE uses comments to suppress warnings, create an arbitrary folded block, or turn off auto formatting. (And of course, with your example, JSON does not have comments, further complicating things.) Using comments for soft returns would, I think, result in a lot of clutter in the file. For example, for HTML, even using a one character comment of a paragraph symbol "¶" results in a lot of clutter:
"translation": {
Hi!<!--¶-->
this is<!--¶-->
the text.<!--¶-->
maybe there is a<!--¶-->
LINK too?<!--¶-->
<!--¶-->
Second Paragraph<!--¶-->
<!--¶-->
This is the second paragraph.<!--¶-->
}
You could always request a new feature to add support for something like this to IDEA, but I'm fairly sure it would unlikely gain any traction (based on 13+ years of IDEA usage and very active community membership).
I agree with #Peter's comment that more detail about the workflow you have might help. Ultimately, the Paste as plain text action he mentions is likely the solution. Or you can turn off reformatting on paste in Settings > Editor > General > Smart Keys > "Reformat on paste". See the following help page for more information: https://www.jetbrains.com/help/idea/2016.2/smart-keys.html

Vimperator: Follow link with number in the text

I use Vimperator, but one thing I struggle with is being able to efficiently select and navigate a link that has (or is) just a number. This happens quite a lot in various generated web pages use where the links are numerical or are dates.
Using just f to enter hints mode doesn't work, as typing a number will naturally send you to that hint.
I’m not very familiar with Vimperator, but in its fork and further development – Pentadactyl, you can use backslash to make following digits be treated as link inner text, not number. I. e. use f\21 to narrow the search to the links with text starting from / contains¹ 21.
¹ Depending on your preferences, 'hintmatching' option to be precise.

Is there any interactive console for some strong language for everyday work of processing strings?

starting to work as an IT man lately
with some programing background,
there are so many occasions where there's a need for processing large amount of data.
mainly strings i guess..
for example:
there's 2 large sets of lines, and we need all the lines in both of the sets
replacing one or more white characters in a row, to one line break...
taking the 4th to 7th character of each line and print them in one line with comma as a delimiter
these are not the best examples, but generally any kind of parsing, manipulating and query of texts.
it's very often that the task is extremely easy in any programing language, but it is just to frustrating to open the IDE of such language....
i'm looking to some way to write code (with intelisence/autocomplete), in an easy fast window...... with simple input and output textboxes....
do you understand my need? can you think of anything that can help?
i know some of the problems can be solved using excel.. but i really prefer some good old programing.... unless someone is strongly believe i'm wrong.
if i will build something myself, there will be an option to add any amount of unlimited multiline textboxes. they'll be automatically named, although the name is changeable (the names will be the the name of the variables).
you can as well add any number of output textboxes that have names...
and you have the editor window, in which you write the procedure..... and it will have some interactive intelisence like interface...
can you see what i'm saying? do you know anything similar?
Seems like Python would be fine for this.
Has an interactive keyboard interface, quite nice abstraction facilities,
and strings as objects with good libraries for processing such strings.
It sounds like a lot of what you want can be handled with regular expressions using sed, awk, or perl in a standard console. Autocomplete will be pretty limited, but your scripts will be short anyway - to deal with your third case above, for example:
sed 's/^...\(....\).*/\1/g' < input.txt | tr "\n" ',' > output.csv
What you can do is use an interactive regex tester. There's many online like this one.
You could also look into tools like Data Wrangler from Stanford, which are designed to be more accesible but as powerful as traditional shell tools.
(Note that your first issue - intersecting sets of lines - is a bit different, and would be solved in the shell with comm. This page has a good explanation of how to use comm to perform set operations like "all the files in this file not in this file" or "only the files in this file also in this other file".)