17,665 questions
0
votes
0
answers
41
views
How to keep an add on Python debugger function to stay in scope
After trying Lavi Kumar's example it seems the package import pdbext.debug in ~/.pdbrc goes out of scope when another source file is called.
~/.pdbrc:
!import pdbext.debug
alias pl !pdbext.debug....
0
votes
1
answer
65
views
Which scope does the {$I-} directive have in Pascal?
I disable I/O checking inside a procedure:
procedure RewriteText(
FileName: string;
var TextFile: text;
var ErrMsg: string
);
begin
{$I-}
assign(TextFile, FileName);
rewrite(...
7
votes
6
answers
2k
views
C program: Use an array outside the scope it was defined in
I have some code in which an array of strings is defined in a conditional statement. The array is out of scope where I need it. So I defined another pointer in the outer scope. In the conditional ...
2
votes
2
answers
103
views
how is the ref-safe-context determined in c# when ref assigning to local variables
I am a beginner in C# trying to figure out how ref-safe-context is defined in C#. I declared a function Foo which didn't work since it tries to ref assign a variable with declaration-block to a ref ...
1
vote
1
answer
86
views
In Ansible YAML, how do I pass different variables to an include_tasks to make it reusable?
I have a workflow where I download a file, do some stuff to it, upload it, and then download it again to verify that the changes took place. I want my download logic to be in a reusable YAML file that ...
-3
votes
1
answer
69
views
How to "unset" colors when customizing an overly-specific Sublime Text Color Scheme?
What is being customized
When creating a color scheme for Sublime Text, to find the scope that defines the color for a portion of code, we can press Cmd Opt P (Mac) or Shift Ctrl Alt P (Win), to bring ...
3
votes
3
answers
121
views
Dynamically create .NET buttons, with button pressed return its name, or other unique identifier
I am trying to dynamically add buttons to a list, and have $Button (or another variable) be set to whatever is clicked (No OK/Cancel button needed).
The below code creates the buttons, and resizes the ...
-1
votes
1
answer
154
views
Variable scope when System.IO.FileSystemWatcher event is triggered
variables $relativePath and $x lose their values in the function $createdChanged, however $session retains its value. what am i missing about scope or otherwise with these variables?
windows 11, ...
-5
votes
1
answer
118
views
Python 3 changes variable even after if condition fails [closed]
I have a kaggle notebook(link here). The notebook iterates over a list of number(candidate_max_leaf_nodes) and then gets a mae for each number by massing it as a parameter(ignore the other parameters) ...
3
votes
1
answer
99
views
Can i use the using: scope modifier for a script block executed in a module function
If a have Powershell function, like
function invoke-sb1 ([scriptBlock] $sb) {
invoke-command -computerName abc -credential (get-cred.ps1) -scriptBlock $sb
}
and then invoke the function from ...
2
votes
1
answer
101
views
Pass borrowed ref cell value into function trait
I'm working on an ECS system, but in order to iterate across pairs of queries, I need to be able to fetch components only for a limited scope when executing a system. To do this, I'm trying to make a ...
1
vote
2
answers
95
views
Question about Rust bracket operator plus ampersand
The following snippet is from the (Brown University ver.) Rust book
fn largest<T>(list: &[T]) -> &T {
let mut largest = &list[0];
for item in list {
if item > ...
0
votes
0
answers
56
views
Can Facebook Webhooks notify follower count changes on a Page?
Limite de débit de l’application
We would like to monitor in real time the changes in the number of followers (subscribers) of a Facebook Page.
Is there a Webhook field that allows receiving a ...
0
votes
2
answers
90
views
How to define a new scope?
Currently, I am considering these three methods to define a new scope.
if (1) {
def a = 1
}
({
def a = 1
})()
any {
def a = 1
}
Is there anyone better? It seems the official style guide ...
0
votes
1
answer
82
views
Avalonia UI style scope propagation
I'm having some issues in defining styles of my items. Or actually in the scope of the styles I set. My question is how do I make sure, that a style I'm setting is not propagated for the elements of ...