How can i uncomment a XML tag in eggplant - eggplant

typetext controlkey,a
typetext controlkey,c
put remoteclipboard(5) as a tree into myTree
put item 4 of myTree into a
delete every occurrence of "<!--" from a
log a
My variable a will have a XML tag(commented) value, i am trying to uncomment the XMl tag.

It's probably easier to do treat the XML as text when you remove the comments, rather than turning it into a tree. Use a pattern with the delete command as follows:
delete every occurrence of <"<!--" then some characters then "-->"> in myXml

Related

How do I specify tab(\t) as a separator for text in a Dataflow Template?

There are some Dataflow templates that support Column delimiter of the data files as an optional parameter (for instance, the template loading Text Files into Spanner), but I am unable to pass tabulator (i.e. \t) as a column delimiter. How do I do this?
There was a bug in the Dataflow UI that made it impossible to pass escaped characters to a Dataflow template.
Gladly, this is no longer the case. To specify tab as a delimiter, you can simply pass \\t, and the template will work as expected.
For passing any other parameter, note that you can escape any character. (e.g. \\n, \\t, etc).

How to Find & Remove instead of replace

I'm using Atom as my editor for projects. When i get existing projects and want to remove elements from several files, i want to make a "Search and Replace" throughout my project.
But instead of replacing the element, i want to remove it.
Is there a string or symbol which i can put into the replace field to
"remove" my searched element?
I'm not familiar with Atom, but with a typical editor you would remove the found item by replacing it with an empty string.

How to add a string to a pot file with .php?

A lot of my website content is stored in a database for this reason I created a script that goes through the content stored in the database and extracts strings that must be added to my .pot file. (which already contains other strings).
I created a function called "add_string($s)" that should add one string to the .pot file but I'm not sure how to do it.
function add_string($s)
{
// Add string to .pot file?
}
How can this be done?
Thanks
A pot file is just a text file in certain format.
You can use file_put_contents with the FILE_APPEND flag to add text to a file.
With regards to the format of the data argument of the file_put_contents call, you will have
lines referencing files starting with #:, lines referencing instructions to translators starting with #. and then lines starting with msgid with the message id and msgstr the message value. You will want to include the newline \n after each line.
See here for an example of the pot file format.
You will probably want to keep track of your strings in PHP data structure as you write them to file or before you write them to file, to avoid duplicating message values in the template.

Change format of inline code evaluation in org-mode's LaTeX-export

I have a code block in an org document
#+NAME: result_whatever
#+BEGIN_SRC python :session data :results value :exports none
return(8.1 - 5)
#+END_SRC
which I evaluate inline:
Now, does this work? Let's see: call_result_whatever(). I'd be surprised ...
When exporting to LaTeX, this generates the following:
Now, does this work? Let's see: \texttt{3.1}. I'd be surprised \ldots{}
However, I don't want the results to be displayed in monospace. I want it to be formatted in "normal" upright font, without any special markup.
How can I achieve this?
You should be able to get it work using the optional header arguments which can be added to call_function().
I don't have LaTeX installed on this system so can't fully test the outputs to ensure they come out exactly as desired, I'm using the plain text output to compare instead. However you can use the following syntax as part of your call to modify the results.
Now, does this work? Let's see call_results_whatever()[:results raw].
I'd be surprised ...
Without the [:results raw] the output to Plain Text (Ascii buffer) is Let's see `3.0999999999999996'.. With the added results it becomes Let's see 3.0999999999999996.
For full details of the available results keywords as well as other optional header arguments for the inline blocks please see Evaluation Code Blocks and Results arguments.
this is 5 years later. apparently in org-mode 8.2 or so, a new variable was introduced (documenting in "Evaluating Code Blocks" in the org-mode manual, but this from etc/ORG-NEWS in the source tree):
*** New option: org-babel-inline-result-wrap
If you set this to the following
: (setq org-babel-inline-result-wrap "$%s$")
then inline code snippets will be wrapped into the formatting string.
so, to eliminate \texttt{}
(setq org-babel-inline-result-wrap "%s")
The problem of this type can be solved in two ways:
1: Easy does it:
A plain query-replace on the exported buffer.
Once you're in the LaTeX buffer,
beginning-of-buffer or M-<
query-replace or M-%
enter \texttt as the string that you want to replace
enter nothing as the replacement
continue to replace each match interactively
with y/n or just replace everything with !
2: But I wanna!
The second way is to nag the org-mode mailing list into
implementing a switch or an option for your specific case.
While it's necessary sometimes, it also produces a system
with thousands of switches, which can become unwieldy.
You can try, but I don't recommend.

How to reset lstset settings for listings?

At the top of my tex document, I set my sourcecode listing format by
\lstset{language=java}
\lstset{numbers=left, numberstyle=\tiny, numbersep=5pt, breaklines=true}
\lstset{emph={square}, emphstyle=\color{red}, emph={[2]root,base}, emphstyle {[2]\color{blue}}}
because I merely list Java source code.
At one point in my document, I had to reformat for a single listing by
\lstset{commentstyle=\footnotesize\textit}
\lstset{basicstyle=\ttfamily\fontsize{11}{12}\selectfont}
\lstset{literate={!=} {$\neq$}{2}}
Now I have the problem that my previous Java formatting for listings is destroyed, and I dont know how to reset the lst settings to default.
How can this be avoided?
If you need to modify only one listing, you can pass the options as an optional argument:
\begin{lstlisting}[commentstyle=\footnotesize\textit]
...
\end{lstlisting}
will only affect that particular listing.

Resources