VisualStudio - aliases for very long watch variables - c++

I am trying to debug a tree-like structure, so i have made a watch on each level. The lower i go, the watch variable name is getting ridiculusly long. Is there a way to rename them from:
{,,HTM_Projekt.exe}*(Node*){*}(((*((*(((*((*this).htm)).top)._Myptr)).input)))._Myptr)
to
Level1Node

without more details on how you have it structured. i would suggest you make a varriable of that type that equals what is in your tree and just put that varriable on watch. it just means you will have a little bit of duplicate data but can see what it is clearly.
maybe it would look something like.
Node* kpLevel1Node = (Node*){*}(((*((*(((*((*this).htm)).top)._Myptr)).input)))._Myptr);
and then you just add kpLevel1Node to watch.
EDIT 1:
based off comment.
a pointer is only 4bytes and refrences the same data. but if the extra 4 bytes is not an option for you temporarily while you debug.
then i suggest you use typedef's. to make the long rediculas type into something more readable. and like before without more code showing your implementation an exsact answer is not really possible

Related

Is there a way to get scrollstate from Lazyrow

I have made a LazyRow that i now want to be able to get the scrollposition from. What i understand Scrollablerow has been deprecated. (correct me if im wrong) The thing is that i cant make a scrollablerow so i thought lets make a lazy one then. but i have no clue how to get scrollposition from the lazyrow. i know how to get index but not position if that eaven exists. here is what i have tried.
val scrollState = rememberScrollState()
LazyRow(scrollState = scrollstate){
}
For LazyScrollers, there are separate LazyStates.
I think there's just one, in fact, i.e. rememberLazyListState()
Pass that as the scroll state to the row and then you can access all kinds of info. For example, you could get the index of the first visible item, as well as its offset. There are direct properties for this stuff in the object returned by the above initialisation. You can also perform some more complex operations using the lazyListState.layoutInfo property that you get.
Also, ScrollableRow may be deprecated as a #Composable, but it is just refactored, a bit. Now, you can use the horozontalScroll() and verticalScroll() Modifiers, both of which accept a scrollState parameter, which expects the same object as the one you've created in the question.
Usually, you'd use LazyScrollers since they're not tough to implement and also are super-performant, but the general idea is that they are used with large datasets whereas non-lazy scrollers are okay for small sized lists and stuff. This is because the lazy ones cache only a small fraction of the entire list, making your UI peformant, which is not something regular scrollers do, and not a problem for small datasets.
They're like equivalents of RecyclerView from the View System

Hangfire Job Description and Name Customization

I would like, if possible, to have some control on the job description and name. I tried to add the JobDisplayName to the Controller that is activating the job, also to the method that is being called to run in background but no luck.
Also the job description page is very polluted with unnecessary information that i would like to remove, or to format to a readable information.
In the A case, i would like to remove this, or to format it to a more readable format.
In the B case what can i do to output it to a human readable object?
Issue A: there are quite a few bugs that have been opened but most of them suggest there is no way to update the information displayed there, but, you should follow the Best Practices and keep the method and arguments small.
Fix B
Change the return statement of your method that's enqeued to fix the data displayed.

typo3: extension template namespace

In the root template page.10 is already taken. If I put page.10 into my extension template, I override it. How can I make sure (just putting a large number is not "making sure") that I don't override anything? The root template is very complicated and includes many other templates, so I cannot really tell which numbers are already taken. I just want to use the extension template to append some content.
The safest solution would be not adding anything automatically. Instead you could provide your rendering instruction via lib.* or tt_content.list.* in case it is a registered plugin:
lib.yourContent = USER_INT
lib.yourContent { ... }
Then you only need to document how to add something to the page output, e.g.:
page.11 < lib.yourContent
I know it has been a while since you've asked this question.
You're saying "just putting a large number is not making sure" because you have no idea what content is using which number on the page object.
If you want to be 99,9% sure that a number has not been used, why don't you use the current timestamp as a number on this cObject? That's how the TYPO3 Errorhandler also refers to pages, using the timestamp they wrote it.
The simpliest answer if you can make sure which Page object index is already used for something is you cannot.
It might be set somewhere deeper in extensions, in any condition that meets any expression is defined there.
None of standard built in tools in TYPO3 can predict that and check all combinations of conditions to tell you if such number is set somewhere in some case.
But.
If you are an admin of that page, then the best approach is just to know your template.
Analyse the typoscript and know what numbers in Page object are used for something. Make a tidy consistent template, clean it up, check using Template tools -> Typoscript object browser. You have to know what's going on on your site, the elements in indexes of main Page object are the main and basis things which are shown public.
(Or just guess any random big number and try to search it in whole typoscript using Template tools -> Template Analyzer -> View complete TS listing. Let's be honest, probability that you shoot a big number which is already used is rather low)

How to find all PointerIds for CoreWindow

Is there a way to get all of the PointerIDs that might be used in the CoreWindow::PointerPressed??
I know that I can get the ID for the Mouse by using:
// This is wrong, see the comment below.
MouseCursorID = CoreWindow::GetForCurrentThread()->PointerCursor->Id
EDIT:
The above block of code gets the 'Resource Id' for CoreCursor. It IS NOT the same thing as the pointer ID!
So how would one go about finding the different Ids for the various pointers? I am especially interested in this because I want to be able to discern input from two different mice, and being able to identify them before receiving events would be a great help.
They will appear as necessary in the various pointer event arguments -- see PointerEventArgs.
You don't know ahead of time how many theoretical pointers there might be. What's the reason that you want to know?

Creating class of SQLite

I'm sorry, I'm showing too many lines of code but I just have a small problem.
Take a look at the code file, you'll see two areas which I marked via comment [1] and [2] (Maybe you'll need [3]).
When I run the program, because this is a console program so the screen will have something like:
Befor callback: 0
After callback: 0
It should be After callback: 99 that is what I need.
My question is Why doesn't iResult variable change after I modify it?
Update 1
The 1st agrument of callback function points to where (this) pointer (in [3])points to.
Thank you guys.
When you call run_query to execute your query, it assigned the result of the sqlite3_exec call to iResult. This overwrites the 99 with the result of the query, which is 0.
It's just about everything not optimal about this code. If you're doing something simple, sonsider using an available wrapper, such as hiberlite. There are more low level ones as well.
Try to read about clean code first and about SOLID principles and then about patterns in enterprise software
This is also not what "modern" C++ is good for. Do you really want to do it in C++?
Then, you're doing something dangerous as well - you're assembling a query from a string by not using value binding.