How to make my bitbucket pipeline slack notify message into bold format - notifications

I want to make the message bold so the person will notice the word
- step:
name: Send Notification to Slack
script:
- pipe: atlassian/slack-notify:2.0.0
variables:
WEBHOOK_URL: 'CLASSIFIED'
MESSAGE: '<#1234>, There's an **ERROR**'

These basic visual styles are very simple to use and can be formatted using a simple markup language called mrkdwn.
https://api.slack.com/reference/surfaces/formatting#visual-styles
_italic_ will produce italicized text
*bold* will produce bold text
~strike~ will produce strikethrough text

Related

TTS Error:utterance lists extracted from utt2spk and text

I'm using telugu Text To Speech (TTS) system I am getting an error like utterance lists extracted from utt2spk and text
I want an help to overcome with this error

Is there a way to force line-breaks in pdf acro fields?

As the title states, I am currently struggling to force line-breaks ("\n" respectively "\r\n") in a pdf-acro-field. I am using OpenPdf and FlyingSaucer (see dependencies for details) and managed to enable multi-line and rich-text of fields by setting the bit-flags 13 and 26 of the "Ff" property.
I was using the PDF-Reference ISO-3200_2008 as a guide (starting on page 442).https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
Issue
I read an existing PDF and fill the acro fields programmatically. Something like this:
acroFields.setField("address", content);
The content is just a simple string with some newline characters. Nothing special.
My text is too long and will have to break at some point. When multiline is enabled, the text will break, but only if it reaches the end of the line. Basically, what I want to display is something like an address and some additional information on top. But not all lines are equal in size and for example I want to have information 1 and 2 on the same line and info 4 and 5 each on separate lines.
What I had in mind
<h2>What I want</h2>
<pre>Company XYZ
A brand here</pre>
<pre>Another Section
With some more info that goes further to the right
phone, email, website</pre>
<br>
<h2>What it looks like</h2>
<p>Company XYZ
A brand here
Another Section
With some more info that goes further to the right
phone, email, website</p>
Questions
Is there a way to implement line-breaks in PDF in general?
Is there a way to implement line-breaks programmatically?
Can I do this in OpenPdf or FlyingSaucer?
If there is no simple way - what would be a viable workaround?
Dependencies
compile group: 'com.github.librepdf', name: 'openpdf', version: '1.3.3'
compile group: 'com.googlecode.juniversalchardet', name: 'juniversalchardet', version: '1.0.3'
compile 'org.xhtmlrenderer:flying-saucer-core:9.1.18'
compile 'org.xhtmlrenderer:flying-saucer-pdf-openpdf:9.1.18'
It did not work, because the content (input coming from parsed html file) had \r\n in it, but somehow it does only work with \n so I did the following:
content.replaceAll("\\\\r\\\\n", Chunk.NEWLINE.getContent()); // 2nd param is just "\n"
This fixed my issue.

Find and Replace script for textWrangler

I'm trying to make a script that will find and replace some xml structure.
I've made it all flat, no spaces, no return.
So far I've made :
tell application "TextWrangler"
replace text "<key>amenity</key><string>drinking_water</string>" using text "<key>ico</key>
<string>NPpotableGPS30</string>"
end tell
The script editor says :
Error in TextWrangler : text "<key>amenity</key><string>drinking_water</string>" don't have the message « replace ».
This is my first script so I'm probably doing something wrong, but what ?
The key "text" seems to be misplaced. The following appears to correctly work (the sequence from searching onwards being optional for defining the document to process, according to actual working situation):
tell application "TextWrangler"
replace "<key>amenity</key><string>drinking_water</string>" using "<key>ico</key><string>NPpotableGPS30</string>" searching in text 1 of text document "..." options {search mode:grep, starting at top:true}
end tell

Intellij - Reformat Code - Insert whitespace between // and the comment-text?

I am working with another human being on project from that the professor expects to have uniform code-style. We have written large separate junks of code on our own, in which one has written single line comments without a white-space between the single-line-comment-token and the other one has inserted a white-space. We are working with IntelliJ and have failed to find an option to enable the Reformat Code function, to insert a white-space.
TLDR:
Can you tell us how to convert comments from that to this in IntelliJ?
// This is a load bearing comment - don't dare to remove it
//This is a load bearing comment - don't dare to remove it!
You can do a global search and replace (ctrl-shift-r on windows with default keyboard layout, or Replace in Path under the Edit/Find menu).
Check the regular expression option and enter //(\S.*) as the text to find and // $1 as the replacement. Check the whole project option, and clear any file masks. You can single step through the replacements, or simply hit the All Files option.

How to get data from a .rtf file or excel file into database(sqlite) in iphone sdk?

I had lots of data in a .rtf file(having usernames and passwords).How can I fetch that data into a table. I'm using sqlite3.
I had created a "userDatabase.sql" in that I had created a table "usersList" having fields "username","password". I want to get the list of data in the "list.rtf" file in to my table "usersList". Please help me .
Thanks in advance.
Praveena.
I would write a little parser. Re-save the .rtf as a txt-file and assume it look like this:
user1:pass1
user2:pass2
user5:pass5
Now do this (in your code):
open the .txt file (NSString -stringWithContentsOfFile:usedEncoding:error:)
read line by line
for each line, fetch user and password (NSArray -componentsSeparatedByString)
store user/password into your DB
Best,
Christian
Edit: for parsing excel-sheets I recommend export as CSV file and then do the same
Parsing RTF files is mostly trivial. They're actually text, not binary (like doc pdf etc).
Last I used it, I remember the file format wasn't too difficult either.
Example:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22 Username Password\par
Username2 Password2\par
UsernameN PasswordN\par
}
Do a regular expression match to get the last { ... } part. By sure to match { not \{.
Next, parse the text as you want, but keep in mind that:
everything starting with a \ is escaped, I would write a little function to unescape the text
the special identifier \par is for a new line
there are other special identifiers, such as \b which toggles bolding text
the color change identifier, \cfN changes the text color according to the color table defined in the file header. You would want to ignore this identifier since we're talking about plain text.