Is it possible to change the default flags in tmux window-format? - customization

I'm trying to customize my tmux environment. I'm now working on window-status-format and window-status-current-format. The default is: #I:#W#F but I'm wondering if these default values could be changed in any way.
For example, instead of arabic numbers in #I I would display roman numerals or, more important, instead of the * (that is the default flag for current window) or - (default flag for last used window), I would display other symbols.

Related

snprintf replace numbers with question marks - TouchGFX

I am currently trying to learn the TouchGFX Gui implementation.
For a simple start, I wanted to create a slider, and a textarea that shows the current value of this slider.
As I have seen in the example projects, changing the text of a textArea you need
a textAreaBuffer type touchgfx::Unicode::UnicodeChar which is in the end an uint16_t array
Unicode::snprintf(textAreaBuffer,BufferSize,"Value: %d",value)
my current Function for changing the text is this:
void MainScreenView::changeTextAreaValue(int slidervalue)
{
Unicode::snprintf(textArea1Buffer, 3, "%d", slidervalue);
textArea1.resizeToCurrentText();
textArea1.invalidate();
}
In the designer I added an event on changing the slider value which calls this virtual function.
This is my settings of the text area
But when I run this program, the label shows ?? instead of the expected value as soon as I move the slider
Some additional information as to why you're seeing "?".
TouchGFX uses an excel sheet that allows you to specify which characters you would like to have generated from a particular font, for a particular size (A "typography").
If you, for instance, are using a TextArea with a Wildcard and the characters you're placing in the associated buffer for rendering are not represented in either ..
Flash memory
Font Cache
... TouchGFX will fall back to the "fall back" character that you've specified for that typography (also in the excel sheet). The default fall back character is "?".
This problem was due to a not defined wildcard range as described here. The software couldn't find any available characters to represent the numbers.

Prevent stata output window from dropping old analysis

As i run more commands in Stata, the earlier output disappears from the window (i.e, if i scroll to the top, the earlier output is no longer there, suggesting that there is a set 'height' or number of rows of the output window).
Is it possible to change this setting, i.e., to increase the amount of output that is displayed?
Thanks to the suggestion in the comments - in case of relevance to anyone else, this can be achieved with the command:
set scrollbufsize 2000000
(or any value up to 2000000) - this takes effect the next time Stata is opened.

Programmatic access to old and new values of a watchpoint in gdb

What I'm really doing is trying to set a watchpoint on the setting or clearing of a single bit. I do that by setting a watchpoint on the word containing the bit, then making it conditional on *word & mask (for setting, or (~*word) & mask for clearing.)
The problem is that some other bit in the same word may be modified, and the condition may happen to already match. If I had the old and new values, I could set a condition of (($old ^ $new) & mask).
I looked at the python gdb.Breakpoint class, but it doesn't seem to receive this information either.
I suppose I could go crazy and set a command list that records the current value whenever the value of *word changes, and use that as $old. But half the time I'm using this, I'm actually using it through rr, so I might be going backwards.
There's no direct way to get these values in gdb; it's been a wish-list bug (with your exact case as the example...) for years.. The information is stored in the old_val field of the struct bpstats object associated with the breakpoint; but this is only used to print the old value and not exposed elsewhere.
One option might be to change gdb to expose this value via a convenience variable or via Python.
I suppose I could go crazy and set a command list that records the current value whenever the value of *word changes, and use that as $old. But half the time I'm using this, I'm actually using it through rr, so I might be going backwards.
This seems doable. Your script could check the current execution direction. The main difficulty is remembering to reset the saved value when making this watchpoint, or after disabling and then re-enabling it.

Getting value using pywinauto from text field

How to get result from ms calculator text field, which displays result of any math operations?
Swapy (v.0.4.3) shows me that this text field has value of 'Static2', after running so simple script i get empty list. Here my code:
from pywinauto import *
n=[]
app=Application()
app.start_("calc.exe")
app.calc.Button11.ClickInput()
app.calc.Button20.ClickInput()
app.calc.Button11.ClickInput()
app.calc.Button21.ClickInput()
n=app.calc.Static2.Texts()#here i expected to get the number
print n
Where i did wrong?
Try
text = app.calc.Static3.window_text()
As I can see in Spy++, Notepad.exe (Win7 version) has 4 static boxes. The third one has non-empty text.
So you need to identify it by "Static3" name, because "Static1" and "Static0" identifies the same static box (that's a bit strange, yes - it's pywinauto feature).
For more detailed investigation use
app.calc.print_control_identifiers() # or .dump_tree()
I may be late to the party but I'm sure this will be handy, Lets say your control textbox is of edit type then you can easily do....
text = app.calc.Static3.get_value()
This is available in - pywinauto 0.6.8

How to print an entire table in visual studio C++?

I created an accountant program that basically lets the user add rows and does some math. My problem is, I need to make it so it prints the table on paper once the user presses a button. How can I accomplish that? Please explain it step-by-step as I'm a beginner.
EDIT: Why was this question voted down. What is wrong with it?
The basic output tool in C++ is std::ostream, but it is very limited.
It's possible (but not always easy) to format tables using it if the
output is using a fixed width font, but this is rarely the case today.
If you can get away with using a fixed width font, the manipulators of
iostream should be sufficient; decide the width of each column, and set
the width (and alignment—left or right) using the appropriate
manipulators when you output the field.
Otherwise, you'll have to determine what markup language the printed
output should use—Postscript is widespread, but far from univeral.
Having done that, you'll have to iterate over lines, and in each line,
over the columns, generating the correct markup for each one. If you're
generating something like Postscript (or most printer markup languages),
you'll have to keep track of absolute positions, and maybe calculate
column width and such, determining the width of each field depending on
the font being used and the width of each character in that font.
More than one program I've seen has output a LaTeX source, and then used
system to invoke LaTeX (or pdflatex, to generate PDF); this supposes
that LaTeX is installed on all of the machines one which the program
will run, but LaTeX will take care of all of the above calculations; you
just output your columns, separated by a '&', with each line
terminated by two '\', with the appropriate surrounding commands, and
LaTeX does the rest. (This is the solution I'd recommend, if you can
possibly impose the presence of LaTeX. As old and as un-user-friendly
as it is, LaTeX still generates the best output of any program I've
tried.)