How to show content of variables in Xcode? [duplicate] - xcode

This question already has answers here:
Xcode Debugger: view value of variable
(8 answers)
Closed 9 years ago.
In many cases xCode does not show the content of the variables when I move the mouse over them.
Is there an alternative way to show the content?
For example of simple bytes, arrays of bytes, ...
Is there a way to specify the output format somehow?

There is now much improved variable formatting via the lldb debugger, where you can specify the formatting for your own types. Read the docs on how to specify these, then put them in a python script and in ~/.lldbinit add the line:
command script import path/to/my/formatters.py
For more information on LLDB data formatters see:
http://lldb.llvm.org/python-reference.html
http://llvm.org/svn/llvm-project/lldb/trunk/examples/synthetic/ - has examples for STL formatters
look at the bundled scripts in Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/formatters

Some times Xcode doesn't show the content when place mouse over the variable.for getting the value you can write like po (variable name ) in console.
once check this one

Related

How to use escape sequences [duplicate]

This question already has answers here:
Ansi colours on Windows 10, sort of not working
(2 answers)
Closed 3 years ago.
I am trying to get escape sequences to work in a Go application. Specifically the code to move the cursor. fmt.Printf("\033[3;5H")
What should I be printing / writing to in order to make this work? Or am I approaching this the wrong way entirely? Every time I run the code I just get some funky looking characters in the terminal or nothing happens. I am running windows 10.
I have tried using multiple different fmt.Print functions but I get the same results.
// Move the cursor
fmt.Printf("\033[3;5H")
// Print at new position
fmt.Printf("Print this text at the new cursor position")
Turns out you need to enable Virtual Terminal Processing in Windows 10 to use ANSII escape codes
https://github.com/konsorten/go-windows-terminal-sequences

Is the file name of DELPHI's tImage.picture.loadFromFile stored somewhere? [duplicate]

This question already has answers here:
Can I retrieve Filename for TPicture directly?
(3 answers)
Closed 5 years ago.
I load a picture using
myImage.picture.LoadFromFile('myimage.jpg');
It can contain either an "empty avatar" or a "real picture", so it is always "full", I cannot test for NIL and/or .empty
I would like to know if there is a way to do something like
if (myImage.picture.filename = 'empty.jpg') then
DO SOMETHING
else
DO SOMETHING ELSE
Sure, I can create a global variable and/or (wow) derive a new tImage class adding that property but I guess it's a bit too much.
Thank you
No record is kept of where the image originated. You would need to track this.
You certainly don't need to use a global variable to track this. You would typically use a variable at the same scope as the image control.
This is no property that keeps track of the image filename. If you simply need to know whether it's an avatar image or a specified image, you could use the Tag property. myImage.Tag = 0 for empty, myImage.Tag = 1 for specified.
If the project requires the filename, you could store that as a variable, or if it's a Firemonkey project, use the TagString property.
If the project is VCL, you could use the Hint property to store the filename if you're not using the Hint property for an actual hint (set ShowHint to false so the user doesn't see it).

What is the quickest / easiest way to create a new file in the command line? [duplicate]

This question already has answers here:
How to create a file in Linux from terminal window? [closed]
(17 answers)
Closed 5 years ago.
I'm sure that there are many ways to do this (cat > foo.txt, vim, etc) a la https://www.cyberciti.biz/faq/create-files-in-linux-unix-from-bash/ but I'm not advanced enough to understand if there's anything else that's being done by using these different commands to create my file (e.g., perhaps a file created in vim has different properties than one created with the cat command above).
Looking to maximize ease, speed and purity (no additional properties) of the file created. Thanks!
Very easy is to use touch :
touch myfile

What does wc do? And how do you use it to count words in a file? [duplicate]

This question already has answers here:
Whats is the behaviour of the "wc" command?
(2 answers)
Closed 6 years ago.
I'm new to the Linux/Unix world but found this decent online resource https://linuxjourney.com that's sort of explains some general command line code. I'm running an Oracle VM with Ubuntu based variant. I'm away from my computer now so I don't know which version but I'm fairly certain it's bash4
WC (Word Count) is a simple command line utility that displays the number of words in a file. It is especially useful for text files. Word documents, Libre office documents etc are a different matter.
Simply type 'wc ' and it will output the number of words in the file. If you need more information, type 'man wc' in a terminal and it will show you the full list of options.

Change text colour in WINDOWS command line [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
how to have multiple colors in a batch file?
Colorizing Windows command line output from PHP
Let me just make this very clear: I am on WINDOWS, so \033[0;35mText WILL NOT WORK.
Sorry to have to emphasize like that, but every possible duplicate I have seen has people saying to use the above code regardless of what OS the question is about.
Now, I know it's possible without too much trouble - ffmpeg does exactly the kind of thing I want to do:
(source: adamhaskell.net)
So how hard can it be?
Use SetConsoleTextAttribute to set the text colour.

Resources