Good day. I wish to ask the community regarding a simple export from OPENEDGE/PROGRESS 4GL to MSWORD. my current version of progress is 9.1E. here is my sample code after a few edits from other sites:
DEFINE VARIABLE chWordApplication AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE AppWordDocs AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cMonthList AS CHARACTER NO-UNDO
INIT "January,February,March,April,May,June,July,August,September,October,November,December".
DEF VAR ch-par AS CHAR FORMAT 'x(500)'.
DEF VAR cc AS CHAR.
ASSIGN cc = 'cc:File'
ch-par = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.".
CREATE "Word.Application" chWordApplication.
chWordApplication:documents:Open("<file path>\<file>.doc",False,False,False,"","",False).
AppWordDocs=chWordApplication:ActiveDocument.
chWordApplication:VISIBLE=TRUE.
chWordApplication:selection:TypeParagraph.
chWordApplication:Selection:typetext(ch-par).
chWordApplication:selection:TypeParagraph.
chWordApplication:selection:TypeParagraph.
chWordApplication:Selection:typetext(cc).
/*chWordApplication:Quit().*/
RELEASE OBJECT chWordApplication.
RELEASE OBJECT AppWordDocs.
What i wish to learn is to set ch-par to JUSTIFY and cc to have a BOLD font format regardless of what font style is used.
Thanks for the answer.
P.S. > in the future will convert this file to PDF. currently searching for that later.
chWordApplication:Selection:ParagraphFormat:Alignment = 3.
Related
I have a 3x12 matrix I'd like to input into my LaTeX (with amsmath) document but LaTeX seems to choke when the matrix gets larger than 3x10:
\begin{equation}
\textbf{e} =
\begin{bmatrix}
1&1&1&1&0&0&0&0&-1&-1&-1&-1\\
1&-1&0&0&1&1&-1&-1&0&0&1&-1\\
0&0&1&-1&1&-1&1&-1&1&-1&0&0
\end{bmatrix}
\end{equation}
The error: Extra alignment tab has been changed to \cr. tells me that I have more & than the bmatrix environment can handle. Is there a proper way to handle this? It also seems that the alignment for 1's and the -1's are different, is that also expected of the bmatrix?
From the amsmath documentation (texdoc amsmath):
The amsmath package provides some
environments for matrices beyond the
basic array environment of LATEX. The
pmatrix, bmatrix, Bmatrix, vmatrix and
Vmatrix have (respectively) ( ), [
], { }, | |, and ∥
∥ delimiters built in. For naming
consistency there is a matrix
environment sans delimiters. This is
not entirely redundant with the array
environment; the matrix environments
all use more economical horizontal
spacing than the rather prodigal
spacing of the array environment.
Also, unlike the array environment,
you don’t have to give column
specifications for any of the matrix
environments; by default you can have
up to 10 centered columns. (If you
need left or right alignment in a
column or other special formats you
must resort to array.)
i.e. bmatrix defaults to a 10 column maximum.
A footnote adds
More precisely: The maximum number of
columns in a matrix is determined by
the counter MaxMatrixCols (normal
value = 10), which you can change if
necessary using LATEX’s \setcounter or
\addtocounter commands.
If you came to this page looking for the exact command (thanks to Scott Wales for the answer), you want this in your preamble:
\setcounter{MaxMatrixCols}{20}
Where you can replace 20 with the maximum number of columns you want.
The answer by Scott is correct, but I've since learned you can override the alignment. Taken from http://texblog.net/latex-archive/maths/matrix-align-left-right/
\makeatletter
\renewcommand*\env#matrix[1][c]{\hskip -\arraycolsep
\let\#ifnextchar\new#ifnextchar
\array{*\c#MaxMatrixCols #1}}
\makeatother
Now allows the command:
\begin{bmatrix}[r] ....
to have right-alignment!
Instead of a bmatrix you can use +bmatrix from the tabularray package:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\begin{document}
\begin{equation}
\textbf{e} =
\begin{+bmatrix}
1&1&1&1&0&0&0&0&-1&-1&-1&-1\\
1&-1&0&0&1&1&-1&-1&0&0&1&-1\\
0&0&1&-1&1&-1&1&-1&1&-1&0&0
\end{+bmatrix}
\end{equation}
\end{document}
I'm working on a script that takes as input a sequence of MIDI notes and outputs a chord symbol for use in Impro-Visor, an open-source jazz improvisation helper. In order to take advantage of Impro-Visor's large vocabulary of chords I've been trying to add to music21's chord vocabulary--music21 itself will handle the MIDI pitches and the interpretation of most common chords--using the harmony.addNewChordSymbol method, but the system doesn't offer the new chords in its chord detection. For example, if I try this chord from the Harmony module's docs:
>>>harmony.addNewChordSymbol('BethChord', '1,3,-6,#9', ['MH', 'beth'])
>>>c = chord.Chord(['C3','D#3','E3','A-3'])
>>>print(harmony.chordSymbolFromChord(c))
'A-+/CaddD#'
Whereas I would hope in this case to get: 'Cbeth'
Music21 consistently suggests slash chords like the above rather than whatever chord I've tried to add to the vocabulary, presumably because the chord type to the left of the slash--'+', in this case--comes earlier in the OrderedDict in harmony.py. Is there any way to make the chord-detection prefer a custom chord type over these slash chords (which I don't have any way of handling)?
I found that just telling music21 you meant for "C" to be the root does the trick. (Otherwise, it will try to stack in thirds and treat "Ab" as the root.) Call .root() like this:
>>> harmony.addNewChordSymbol('BethChord', '1,3,-6,#9', ['MH', 'beth'])
>>> c = chord.Chord(['C3','D#3','E3','A-3'])
>>> c.root(c.bass())
>>> harmony.chordSymbolFromChord(c)
<music21.harmony.ChordSymbol CMH>
I generated data - 1000 rows, used https://www.mockaroo.com
Matthew,Richards,2/2/1992,mrichards0#sbwire.com,86-(493)702-4682,0284 Artisan Avenue
Arthur,Myers,5/30/1959,amyers1#globo.com,56-(105)354-8682,5 Center Hill
Stephanie,Hayes,8/6/1976,shayes2#cdc.gov,62-(945)765-1251,979 Aberg Parkway
Lisa,Reynolds,5/10/1956,lreynolds3#i2i.jp,256-(450)430-9937,8 Aberg Terrace
Kathleen,Gonzales,12/11/1971,kgonzales4#sciencedirect.com,86-(745)695-8094,520 Basil Court
...
...
...
Now I need to add this to an array in C, so I want it to look like this:
{"Matthew","Richards","2/2/1992","mrichards0#sbwire.com","86-(493)702-4682","0284 Artisan Avenue"},
{"Arthur","Myers","5/30/1959","amyers1#globo.com","56-(105)354-8682","5 Center Hill"},
...
...
...
Do you know how to add quotes and braces? Is there and app/program which could do that?
open up your favorite text editor such as MS Word, Notepad++, Sublime Text, Atom, etc... even Notepad that comes with windows can do this
look for a find and replace option. (usual Ctrl + F does it), it's also usually under "Edit" on the menu bar.
replace all , with ","
All:
Right now, I am using SOLR highlight feature, but one thing I want to ask is:
Suppose I want to search keyword fund and value:
fund AND value
And the return highlight part is like:
"highlighting": {
"blk_0019": {
"content": [
"philosophy of the <em>fund</em> – <em>value</em> and turning point. \n \n MUSA was an orphaned"
]
},
"blk_0006": {
"content": [
"Global Equities <em>Fund</em> Ltd. \n \n CONFIDENTIAL enclosed"
]
}
}
The problem is I am sure blk_0019 and blk_0006 have both fund and value(obviously I use fund AND report), because the I set hl.fragsize=100, if the fund and value located not close enough in one document, they can not be shown both in same snippet. In blk_0019, solr highlights both fund and value, but in blk_0006, only fund shown.
How can I show both matched in single snippet and just ignore text between them as ..... like in Google
Also some small questions are:
[1] How to specify to search capitalized only word like Hello HELLO
in Solr?
[2] How to search All-capital AND(All-capital "AND" will be consider as logical operator)
Thanks
It depends on the highlighter you are using. For the Standard Highlighter you can set hl.snippets=5 for instance (default is 1). Then you'll get 5 snippets/fragments (at most), each with a maximum length of hl.fragsize.
They're returned as multiple values, so you'll need to join them yourself (using "..." for instance).
if I use the following code...
message = TTF_RenderText_Solid( font, "Lorem Ipsum", textColor );
Do I need to free message before I can do this
message = TTF_RenderText_Solid( font, "Lorem Ipsum part 2", textColor );
i.e. does it give me a new surface (and so I have to clean up the old one) or does it just blit over the old one?
Yes, you should free message with SDL_FreeSurface when you're done with it. The returned SDL_Surface is allocated with SDL_AllocSurface() , and is not reused, so you'll leak if you don't free it in this case.