How to format for copy and paste in Octave - format

My question is since Octave sometimes outputs in symbolic like
s a
--- - ---
4 4
I just want it to show like
s/4-a/4
so I can copy and paste it for other scripts.
I am sure this is simple but could not find anywhere both in documentation and site.
Thank you very much for your help

Essentially you want is
sympref display flat
Have a look at the documentation here for more info:
https://octave.sourceforge.io/symbolic/function/sympref.html (look at the display section)
https://octave.sourceforge.io/symbolic/function/#sym/pretty.html

Related

Can Sphinx be set up to automatically create bookmarks based on the heading number (not text)?

I have a large error reference manual which is being converted so as to host on readthedocs using Sphinx. I'd like to be able to refer users using a permanent bookmark based on a section number (not heading text), as this is what is returned in the error code from the software. I have something like:
This has a chapter heading automatically numbered to give 1.
============================================================
This has a section heading automatically numbered to give 1.1
-------------------------------------------------------------
- This has no section heading as it's in a list, but is ideally
where I want to send people using the number 1.1.1. If that's
too tricky, then a link to the number of the section (1.1) is fine.
I'd like to be able to automagically produce bookmarks which are based on the
section's number, not its heading text:
You got error code 1.1.1 so you need to go to:
www.mysite.readthedocs.io/blah/blah.html#bookmark1.1
Does anyone know if/how this can be accomplished without manually creating custom bookmarks for every section? Thanks in advance :)
PS - suggestions that mean that I need to know what the automatically numbered section number will be aren't going to work (eg: Anchor replace with '#id1' , '#id2' , '#id3' ... Sphinx )
Not sure I fully understood the requirements, but to me it sounds like the :numref: role might be helpful in this case.
.. toctree::
:numbered:
.. _ping:
Ping
====
See :numref:`section "{name}" ({number}) <ping>`.
.. _pong:
Pong
====
See :numref:`section "{name}" ({number}) <pong>`.

Can I use \input{file.tex} or similar to efficiently bring content (not a whole document) from a LaTeX file into a Jupyter notebook?

I am new to Jupyter notebooks and Python and have started using these to make materials for a workshop so that I can also produce a handout. I have useful content in various LaTeX files that I would like to include in a notebook.
I would like to know whether there is a command that will allow me to efficiently bring my already modularized content into a notebook. I will be happy to take suggestions on any approach to my problem in case the LaTeX route is the wrong way to proceed.
As a particular case, suppose an external file fig.tex has only a stand-alone tikzpicture (that I have successfully included in another LaTeX document). If I start a notebook code cell with
%%itikz and follow with \input{fig} I obtain error messages.
I can remedy the problem if I add a preamble with \documentclass{}, many necessary \usepackage{} and \usetikzlibrary{} commands (which I have already included at the top of the notebook), and wrap the content with begin/end document commands.
There is more manual handling here than I would like. Is there a more efficient way to include the tikzfigure content?
So it turns out with itikz you have an --implicit-pic option that fills in the preamble for you.
In principle, with this option, your cell would look like the following:
%%itikz --implicit-pic
% my awesome figure
\input{path/to/fig}
This creates a tex file populated like so:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[scale=1.0]
% my awesome figure
\input{path/to/fig}
\end{tikzpicture}
\end{document}
In addition when using an implicit-pic it is usefull to load tikz packages and set options . To quote from the Quickstart guide:
In an --implicit-pic, it's often useful to:
Set the \tikzpicture[scale=X] via --scale=<X> while iterating.
Set the \usepackage{X,Y,Z} via --tex-packages=<X,Y,Z>
Set the \usetizlibrary{X,Y,Z} via --tiz-libraries=<X,Y,Z>
For more info, see items 16-20 in the Quickstart notebook.

MediaInfo CLI (Command Line Interface) Syntax Teaching Me Once & For All

Dear Friends at Stack Overflow,
There is a pattern of questioning here that I noticed in many categories, but for the sake of this topic I'll talk about MediaInfo CLI. The same type of questions keep re-occurring because the source problem is NOT solved, which is to teach people how to fish, rather than feeding them with fish.
Some people ask:
"I do not know how to get BitRate only from MediaInfo". They are respected, and the advanced users who answer them are also respected. Others ask the same question for FrameRate, Duration, & Resolution... I respect them, and also respect those who answer them.
However, I'm truly sorry for this process to be redundant. Unfortunately the MediaInfo website documentation does not clarify how to properly use MediaInfo.exe with the CLI version to extract specific information, and the --Info Parameters just lists a lot of parameters without instructing how to use them.
So in order to extract specific information for a video using MediaInfo.exe CLI, I'll just have to kindly ask here because I am unable to customize the parameters myself, since I don't get the syntax on the documentation. I would have taken the easy way to just ask you what kind of information I need to extract from the video, but then every one who doesn't know the syntax will come back asking for redundant questions.
Instead, I decided to waste a bit more of your time by writing all this, in hopes that you will help me and everyone else who will come searching for this specific question on How to Use the MediaInfo CLI --Info-Parameters Syntax so that the answers aren't repeated for every custom inquiry.
I honestly want to understand how to use it, and not just copy pasting the ready made one-line answers I will receive.
I'll start by mentioning what I know, that any new inquirer may learn from the very little I know, and then I'll kindly ask you to teach me how to write proper MediaInfo --Info-Parameters syntax to extract specific video information.
After you Download MediaInfo the CLI version for Windows, extract the zip file and put it on your Desktop.
RUN + CMD
Navigate to the MediaInfo Folder on the Desktop.
Put some Video files in the MediaInfo folder.
Run the following on the terminal:
MediaInfo.exe --help >Help.txt
MediaInfo.exe --Info-Parameters >Info_Parameters.txt
Now you have some help files to search for your required information. The rest of this simple documentation depends on the generosity of my fellow StackOverflow members.
To be more clear about my question, once and for all: How can I write proper syntax for the MediaInfo.exe CLI to extract specific information such as FrameRate, Duration, & Resolution? I need to understand the syntax more than the ready-made solution to be able to customize it later.
Thank you for your time!
When you run mediainfo --Info-Parameters, you will notice that there are seven sections: General, Video, Audio, Text, Other, Image, and Menu. Each of these sections contains many different parameters that contain various information about the file and get called with the format --Output=SectionName;%Parameter%. You can pick multiple parameters from the same section name, separating them with any text you like (including \n for newlines (but not \t for tabs, interestingly)), like --Output=SectionName;%Parameter1%\n%Parameter2%.
You can also add your own text, which gets displayed as however you wrote it, allowing you to label the output for easier reading later. For example, to get the file name, duration, and file size, you can use the command mediainfo --Output="General;File Name: %FileName%\r\nDuration: %Duration/String3%\r\nSize: %FileSize/String%" video.mkv
If you want to get data from multiple sections (like adding video dimensions to the above information), you will have to use a template, as there is no way to get data from multiple sections in the same --Output command and having multiple instances of --Output cancel each other out until you get left with the last one in the list. In the template, specify one section per line and add the parameters to their respective sections, like this:
General;File Name: %FileName%\r\nOverall Bit Rate: %OverallBitRate/String%\r\nDuration: %Duration/String3%\r\nFormat: .%FileExtension%\r\nSize: %FileSize/String%\r\n
Video;Dimensions: %Width%x%Height%\r\n
These parameters will be displayed in the order that they were written in the template, and you cannot go back and forth between sections (in this example, I couldn't add more General parameters after the Video section). To call a template, use the syntax mediainfo --Output=file://template.txt video.mkv or mediainfo --Output=file://C:\full\path\to\the\template.txt video.mkv.
This is also possible on the command line:
mediainfo --Output=$'General;File Name: %FileName%\\r\\nOverall Bit Rate: %OverallBitRate/String%\\r\\nDuration: %Duration/String3%\\r\\nFormat: .%FileExtension%\\r\\nSize: %FileSize/String%\nVideo;\\r\\nDimensions: %Width%x%Height%\\r\\n' input.file
Note the "\n" between the sections
Tested on Ubuntu 18.04 MediaInfo Command line,
MediaInfoLib - v17.12
These days I came across a command line tool called jq. This tool uses filters to manipulate json data like if you are querying a Database.
It seems to me that this tool could be a perfect companion for mediainfo capability of outputting JSON.
Certainly mediainfo parameters are difficult to use but most of us knows how to handle json. Time will be best spent learning jq's filter language than deciphering cryptic mediainfo parameter options ;)
Workflow is more or less like this.
Know what info you want to extract from media file.
Use jq and its filters to extract it.
Commands
See all info on media file in a pretty formatted json
#> mediainfo --output=JSON myVideo.mp4 | jq .
Customize jq filters to get the desired result.
#> mediainfo myVideo.mp4 --output=JSON | jq '.media.track[1] | {FrameRate: .FrameRate, Duration: .Duration, Width: .Width, Height: .Height}'
Extracted info...
{
"FrameRate": "30.000",
"Duration": "158.334",
"Width": "320",
"Height": "176"
}
Possiibilities are endless once you get familiar with jq's filters.

automatic copy paste from Browser to Microsoft Word

I want to copy some specific texts from internet browser(chrome) and want to paste them in proper fields of Microsoft word.. Let me explain what I want exactly... I have this kind of page structure in chrome-
Name-Deepak,Raju,Jhon,Robert.......
Salary-200,254,673,953...
Phone-987535747,856889479,64688539,357954228....
Etc..
I have a table in MS word as-
Sl. Phone. Name. Salary.
Can I make a auto copy paste program to make my table-
Sl. Phone. Name. Salary
1. 987535747. Deepak. 200
2. .......
Like this? Suggest me the best suitable platform to compile this.. Its best for me, if a bat file can do the job.. I know bit odd question.. And I should not ask the entire program,rather a section of it..Bt still....... actually I don't know from where to start..
Rather than use a wget which will only retrieve the document, what you want is a way of parsing the results of the web content and writing into an output file.
After searching the web, I could only come across
lynx which
is a text based browser and you can parse the -dump parameter to
output the text into file which you can then write a script to do
the final bit.
Also take a look at this
link
for more info on switches you can use most especially if the desired
text has links in it (-nolist)
elinks which is an advanced text based browser

Is there an easy way in java to find out the autor who and/or the computer that produced a certain file ( e.g. image)?

Now that my tool can load and display images as well as their metadata - using metadata extractor - i'd also like to see information about who made the file and what was the name of that person's computer.
Target is: Changing or deleting the original information.
I guess that reading the information is not necessary if i could generate a new image - looking exactly like the source-file but having new - changed - metadata.
Example:
There is an image A onwned by John Smith and was produced at John's Computer.
Now i want to make an image B looking like image A but saying it was made by Cate Smith at Cate's Computer.
Hope some one can help!
Thanks!

Resources