Shorten a text into one word in Jira - jira-plugin

I summarize a lot of data in Jira often, and need to provide a CML (command line) to each line in the table I create.
The CML is long, meaningless, has spaces in it and is only used to copy-paste into a Linux shell for running a script.
What I do today is write up a table in the description and then open a comment and repeat every line with a CML below it. Primitive....
I would like to add to the table in the description a one word link that when clicked on, copies the text to the clipboard.
I converted the CML into a link by doing this: [OneWord|#CML]] and indeed the long CML was replaced with OneWord.
I hoped that when I right-clicked on it and selected "Copy link address" it would copy the CML to the clipboard.
What actually happend is that it copied to the clipboard also the Jira URL and replaces every space with %20.
So for example if the CML is:
abc -j xyz -c efg.jp
What i get is:
https://jira.blabla/blabla/bla#abc%20-j%20xyz%20-c%20efg.jp
I would appreciate any help possible.

Related

How to paste multiline text in pycharm?

Everytime i try to copy and paste something on my Pycharm editor it all paste it in single line. How to automatically paste in multiline?[1]
This is what i copied.....
[{"DateObserved":"2020-06-12 ","HourObserved":23,"LocalTimeZone":"EST","ReportingArea":"Central New York Region","StateCode":"NY","Latitude":42.8049,"Longitude":-76.3589,"ParameterName":"O3","AQI":35,"Category":{"Number":1,"Name":"Good"}},{"DateObserved":"2020-06-12 ","HourObserved":23,"LocalTimeZone":"EST","ReportingArea":"Central New York Region","StateCode":"NY","Latitude":42.8049,"Longitude":-76.3589,"ParameterName":"PM2.5","AQI":0,"Category":{"Number":1,"Name":"Good"}}]
and this all got pasted in a single line on my Pycharm editor. can anybody help with that, its pretty hard to read all this info on a single line?
It seems like you didn't copy anything containing newlines as you can see better after my edit (See the side-by-side-markdown diff so you can see that I didn't remove any line breaks).
If you just copy everything as a single line, PyCharm won't be able to split it into multiple lines (except with auto-format maybe).
As you haven't said how you copied the input, I can't say what exactly is wrong.
However, it seems like you copied something from a program that didn't display the text correctly so that you couldn't copy it correctly.
Another possibility is that the IDE interprets line breaks differently.
For example, windows uses CRLF(carriage return+line feed) as a line seperator while linux uses LF only.
If your file contains only LF line breaks and PyCharm is configured to use CRLF like breaks, it is possible that it ignores them because of that.
You can change that behaviour at the bottom of your file in PyCharm (button with CR/CRLF/LF).

How can I create 600+ copies of a word doc, using a naming convention from a spreadsheet?

I have a list of 600 names in a spreadsheet, and I want to quickly create a Word Doc for each with the name in the filename.
I work on a Mac.
Create a formula for the required commands.
The result of the formula should be:
cp "/path/to/original.docx" "/path/to/copy-filename.docx"
So for example, if you want the copy to be called "copy-" then the contents of the A column, the formula might be:
="cp ""/path/to/original.docx"" ""/path/to/copy-" & A1 & ".docx"""
Then fill down the formula down the spreadsheet to create the commands.
Then you can copy the formula result and paste it into a text editor to check it is correct. Once you are satisfied it is correct, you can paste it into a terminal window and the commands will be executed.
If this is a one-off task, this is what I suggest. If you need to do this hourly then you should probably do something different involving a VBA macro.

Excel VBA Password via Hex Editor

I have used the "Hex Editor to modify DPB to DPx" many times in the past to bypass VBA project security on my old Excel VBA projects (.xls), so I definitely know how to do it and know that I can do it.
However I have just tried to do it yesterday and found that it no longer seems to work. I tried using both Excel 2011 (Mac) and Excel 2003 (Windows) and in both cases, I got the same behaviour;
Opening the VBA editor gave a message saying that the project is corrupted and that the project will be removed. The VBA editor then opens and, sure enough, all VBA is stripped out from modules and worksheets.
I have tried this method:
Is there a way to crack the password on an Excel VBA Project? (ie. creating a spreadsheet with a known password and then copying across the relevant fields)
But find that the length of the "GC" key created on my 'dummy' spreadsheet is shorter than the "GC" key on the spreadsheet that I am wishing to access (the "target"). I had read elsewhere that in cases where the "target" keys were longer, you could pad the "dummy" keys to the same length but there is nothing i can find to say what to do in the reverse case.
So - my questions (s);
Is anyone aware if a patch has been applied that makes the "hex editor" approach invalid?
Can anyone help with what to do when the dummy keys are longer than the target keys?
Can anyone else provide any updated onsite into this issue?
EDIT
Having now solved this (to some degree) i thought i'd add a summary here.
I HAVE NOT been able to get this to work on Mac Excel 2011. Something about changing the file from filname.xlsm to fielname.zip and back again results in a corrupted excel file which Excel 2011 refuses to recognise.
I DID manage to get this to work on an old windows machine (XP/Excel 2007) by modifying the .xlsm file name to .zip, editing the DPB= AND GC= values in the vbaproject.bin file with a hex editor then saving this in the .zip file before renaming the .zip back to xlsm. I used the "test" example given by Ricko at the bottom and it worked with ONE CAVEAT - i had to 'pad' out my GC value to make it that same length as the original one in my file.
ORIGINAL: GC="0F0DA36FAF938494849484"
NEW: (TEST) GC="BAB816BBF4BCF4BCF4" (from Ricko below)
NEW: (TEST) GC="BAB816BBF4BCF4BCF40000" (what i used and what worked)
I have your answer, as I just had the same problem today:
Someone made a working vba code that changes the vba protection password to "macro", for all excel files, including .xlsm (2007+ versions). You can see how it works by browsing his code.
This is the guy's blog: http://lbeliarl.blogspot.com/2014/03/excel-removing-password-from-vba.html
Here's the file that does the work: https://docs.google.com/file/d/0B6sFi5sSqEKbLUIwUTVhY3lWZE0/edit
Pasted from a previous post from his blog:
For Excel 2007/2010 (.xlsm) files do following steps:
Create a new .xlsm file.
In the VBA part, set a simple password (for instance 'macro').
Save the file and exit.
Change file extention to '.zip', open it by any archiver program.
Find the file: 'vbaProject.bin' (in 'xl' folder).
Extract it from archive.
Open the file you just extracted with a hex editor.
Find and copy the value from parameter DPB (value in quotation mark), example:
DPB="282A84CBA1CBA1345FCCB154E20721DE77F7D2378D0EAC90427A22021A46E9CE6F17188A". (This value generated for 'macro' password. You can use this DPB value to skip steps 1-8)
Do steps 4-7 for file with unknown password (file you want to unlock).
Change DBP value in this file on value that you have copied in step 8.
If copied value is shorter than in encrypted file you should populate missing characters with 0 (zero). If value is longer - that is not a problem (paste it as is).
Save the 'vbaProject.bin' file and exit from hex editor.
Replace existing 'vbaProject.bin' file with modified one.
Change extention from '.zip' back to '.xlsm'
Now, open the excel file you need to see the VBA code in. The password for the VBA code
will simply be macro (as in the example I'm showing here).
New version, now you also have the GC=
try to replace both DPB and GC with those
DPB="DBD9775A4B774B77B4894C77DFE8FE6D2CCEB951E8045C2AB7CA507D8F3AC7E3A7F59012A2"
GC="BAB816BBF4BCF4BCF4"
password will be "test"
Open xls file with a hex editor.
Search for DPB
Replace DPB to DPx
Save file.
Open file in Excel.
Click "Yes" if you get any message box.
Set new password from VBA Project Properties.
Close and open again file, then type your new password to unprotect.
Check http://blog.getspool.com/396/best-vba-password-recovery-cracker-tool-remove/
If you deal with .xlsm file instead of .xls you can use the old method. I was trying to modify vbaProject.bin in .xlsm several times using DBP->DBx method by it didn't work, also changing value of DBP didn't. So I was very suprised that following worked :
1. Save .xlsm as .xls.
2. Use DBP->DBx method on .xls.
3. Unfortunately some erros may occur when using modified .xls file, I had to save .xls as .xlsx and add modules, then save as .xlsm.

document migration name extraction

I have a scenario and would like to see if anyone has any suggestions on how I should tackle it. Basically I have a directory full of files, document names consist of [Code]-[number]-[text]
CODE - A generic 3 letter code.
NUMBER - a number generally 4 - 5 digits in size.
TEXT - original document name (Before it was dumped).
CODE, NUMBER and TEXT are separated by a colon (-). Number always starts at the 5 character.
I would like to somehow scan that directory and extract the number from the filename, I would then like to compare that number to a field in a database (SQL query fairly straight forward, could also extract as raw text) If the number matches the number in the database I would like to separate those files.
If I need to clarify anything please ask. I wasn't sure if this site is appropriate for my query.
Open the root folder, click in the file explorer path (in open space off to the side so the whole path gets highlighted), type cmd and hit enter to open a command prompt from that folder location.
Type: dir /b /s > filelist.txt to get a list of all file names. You can exclude /s if you don't need/want to dig down into subfolders.
I'd paste that into excel, if you have 2013 you can just start typing the part you want to extract, after you type the full first line when you start typing the next line it will recognize the pattern and you can just hit enter to fill down.
Otherwise, use Data > Text to Columns and specify - as a delimiter.
Likewise you could just import the filelist, separate them in SQL using SUBSTRING() or similar. When you have your matching filenames you can just use some concatenation to build a COPY or MOVE .bat file, pretty easy in SQL or Excel.

How to preserve formatting from rstudio when copy/pasting to Word?

I want to reproduce my code in Word 2010. The scripts were written in rstudio, and I would like to preserve rstudio's formatting when pasting into Word. Principally, I like the font colors and spacing that rstudio uses. I find that when I paste from SAS to Word, the formatting is preserved, but no dice here.
I would usually look for copy special / paste special options to do this, but I can't find any. When I try to paste special into word, only unformatted text options are presented. I would rather not reformat the text line-by-line, because I think it looks pretty nice in rstudio.
I thought of trying to save the script in rstudio to some format that would preserve its formatting, but I couldn't find any way to do this. How can it be done?
It's not totally clear whether you are pasting from RStudio's script editor (which has some 4 or 5 colors) or from the R console (script + output) within RStudio (which only has 2 colors).
If you are pasting from the console--please check "Paste special" again. There should be an option for "HTML Format" that will do what you need (though you may need to resize the font to make everything fit properly depending on your page margins).
If you are pasting from the script editor, then you're out of luck with a direct copy-and-paste solution. But there is a copy-and-paste-and-copy-and-paste solution...
One solution could be to use Notepad++. From RStudio, save your script (with a ".R" extension) then open the script in Notepad++. (Or copy and paste from RStudio to Notepad++, but make sure you set the file's language--from the "Language" menu--to R). When your script is correctly highlighted in Notepad++ go to the "Plugins > NppExport > Copy HTML to clipboard" menu to copy the open file. This can then be pasted into MS Word with HTML format.
Just in case someone else looks for this question...
Another way to have all the source code in a word document with a good-looking format using RStudio is to use the File/Compile Notebook option, choosing MS Word as the output format.
Using this option, a .docx document will be generated with the output of your script as well as the original source code. The script will be executed, though.
If you don't want your code to be evaluated (you just want a simple copy-paste), you can add #+eval=FALSE at the beginning of your script and then the source code will be reproduced in the word document without being evaluated.
This approach relies on knitr. Here is an example if anyone wants to start playing with this.
#' ---
#' title: "My homework"
#' author: John Doe
#' date: June 15, 2015
#' output: word_document
#' ---
# The header above sets some metadata used in the knitr output
# Conventional comments are formatted as regular comments
# Comments starting with "#+" control different knitr options.
#+echo=FALSE,message=FALSE,warning=FALSE
library(ggplot2)
#+echo=TRUE
#' Comments with a "+" sign are used to tell knitr what should be
#' done with the chunk of code:
#'
#' - echo: Show the original code or not
#' - eval: Run the original code or not
#' - message: Print messages
#' - warning: Print warnings
#' - error: Print errors
#' ...
#' Comments with an apostrophe "'" will be printed as regular text.
#' This is very useful to explain what you are actually doing!
# Regular comments can be used to document the code as usual
# Figures are printed:
ggplot(mpg, aes(x=cty, y=hwy)) + geom_point(aes(color=class))
#' Formatting **options** are possible.
#' Even [links](http://stackoverflow.com/questions/10128702/how-to-preserve-formatting-from-rstudio-when-copy-pasting-to-word)
#'
#' This will show all the packages and versions used to generate this document.
#' It can be used to make sure that your teacher has all he needs to run your script
#' if he/she wants to.
sessionInfo()
Assuming you have internet access
Copy and paste to gist.gisthub.com
Select 'R' as the language - this should provide colours
Hit create (secret or public) gist
Copy and paste from the gist to your word processor.
Compared with the notepad++ solution:
An online backup to your code, with a recording of the time when you clipped it.
You don't have to install any other software, useful if you're a student using a public computer.
If you just need the code as formatted:
Step1: Just add #+eval=FALSE at the beginning of your code.
Step2: Then go to File -> Knit Document. Compile the file in msword/PDF/Html.
OR
Just add #+eval=FALSE at the beginning of your code.
Press CTRL+SHIFT+K and then compile the file in msword/PDF/Html.
If you need the code with output do not enter add #+eval=FALSE at the beginning of your code and perform step 2 directly.
I agree with zeehio that using Knitr is probably the best option. But another way is to use the Pretty R tool and the "open document text" steps here. Basically just copy and paste your code into pretty R, and copy and paste the output (not the html) into the open document.
After you copy from the Rstudio Console window and paste into a Word document, you need to highlight all the the just copied text and change the font into Courier New. This will give you the same spacing and lineup as you had in the Rstudio Console window.
Copy paste the code from Rstudio editor to 'visual studio code' & then again copy from there into a word processor.
For this to happen you must first install R extension in visual studio code.
'Visual studio code' is itself an IDE which can potentially be used for R language as well, but right now I'm emphasizing on using it to answer the above question.
In R I use the Monaco editor font. To copy paste the output of the R consol in Microsoft Word, I select the output of the consol, right click and copy and paste in my Word document. Once I have pasted the output in word, I select it and put it in Word's Monaco font and reduce the size of the font if necessary.
This does the job very nicely and perfectly preserves the output style from the R consol, as well as written chunks of code.
If you want to retain the formatting when coping a selection from the R Console you will need to install an older version of R Studio. Version 1.2.5042. it will not work in the newer versions