53,895 questions
4
votes
2
answers
132
views
Error with creating an array of named/predefined string constants in c
For background, I am working to create a version of minesweeper that runs in the terminal to become more familiar with coding bigger projects in c.
I am coding in VScode, to run on a Linux server (...
4
votes
2
answers
173
views
Illegal coercion operation producing inconsistent error/exception behavior depending on scope
Consider this example, a script named test.ps1
function MyTestFunction
{
[CmdletBinding()]
param ()
try
{
[bool]$functionBool= $null
}
catch {throw $_}
Get-...
2
votes
2
answers
99
views
powershell compress-archive verbose output to text file
I have a powershell command that I want to execute and direct the verbose output to a text file.
Compress-Archive -Path $currentLogDir_TempPathString -DestinationPath $currentLogDir_ArchiveFileName -...
1
vote
1
answer
65
views
How to assign int input value as column name in pandas [duplicate]
I need to take an integer input value, assign it to a variable, and then use that variable as a column name to get data from a pandas DataFrame.
Data:
1 10 20 30
2 40 50 60
Steps:
Assign input to ...
1
vote
0
answers
52
views
Why doesn't my GD script with autoloads post its variables?
When I use (Morton.morton_statetest) in another script, It gives me 0, and even if I put a print in Morton script and If I put an print in the other script, it gives me two values different, wit out ...
-2
votes
1
answer
62
views
Timedelta Unit Argument as a Variable [duplicate]
Is it possible to have the units argument for the timedelta function be defined by a variable?
To elaborate, is this possible?
Time_Unit = "days"
Time_Increment = 1
Time2 = Time1 + ...
3
votes
0
answers
148
views
Problem with multi-dimensional session variable in PHP [closed]
I have been trying to build a shopping cart with PHP and MySQL as a learning experiment. I am stuck at passing the ordered items from catalogue to the shopping cart.
After many experiments I figured ...
3
votes
1
answer
148
views
How to convert a string in an array to variable using the array index in PHP [duplicate]
Let's say I have an array_1 containing a string which is a name of another array_2. And now I would like to convert the array index into a variable containing the array_2.
I have the following working ...
-2
votes
2
answers
80
views
If I want a string of text to print if a variable is less than a number how can I do this? [closed]
I'm trying to understand how functions work, I defined my function with length and area parameters.
Here is the problem: I want to write if area is less than a # then print a string of text.
def ...
0
votes
1
answer
78
views
timefold mixed model, how to define CH
How to define CH, if both basic and list variables are included in the model, there is an error as below:
The entity (class com.app.planner.domain.Machine) has both basic and list variables and cannot ...
0
votes
1
answer
146
views
Make array of variables with osclass custom category values
How can I make an array of variables generated using the values passed through a while loop ?
I am using osclass for a uni project and I find no way whatsoever to make a list os usable variables from ...
1
vote
2
answers
123
views
How to read multiple bash variables containing spaces in values with the read builtin?
I'm trying to read 2 lines into two bash variables but those lines contain spaces.
Here is how those two lines are generated :
$ url=https://www.youtube.com/watch?v=c5U4D-Hn5Vg
$ yt-dlp --no-config --...
1
vote
1
answer
90
views
Bash variable string substitution to '*'
I tried to figure out how to replace a string variable to '*'
a="bamtools/*/*bam_metric.summary.tsv"
## not working
echo ${a/*\*/}
I would like to see bam_metric.summary.tsv after ...
1
vote
2
answers
127
views
How to remember change of values in between for-each loops
I am writing a program, that will divide my students into groups. Lets say the groups are A, B, C and D. In each group there can be only so many students. Those numbers I have in a global variable:
&...
0
votes
0
answers
93
views
in coldfusion how do I get query metadata in the variables scope?
When I cfdump the variables scope, I want to know the query metadata in all queries while debugging a huge project.
This snip seems to be working, but is there a more direct call or attribute in ...
1
vote
1
answer
144
views
Why do the field variables not change?
I've debugged in a lot of ways, but lastFocusedWindow has always been 0.
Even if "no changes" doesn't appear on the console, "change to {0}" should appear on the console, but it's ...
-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, ...
-1
votes
1
answer
133
views
How do I reference controls with a variable in visual basic 2025?
I am trying to do the same sort of thing as the OP this question, but can't get the suggested code in the answer to work.
I'm using Visual Studio 2022, but doubt that's the reason it doesn't work for ...
2
votes
3
answers
177
views
Powershell multiline output into Batch variable
How can I put the entire Powershell output into a Batch variable?
Another post has suggested
@for /f "delims=" %%a in ('Powershell -C Get-Content myFile.txt -Raw') do Set "myVar=%%a&...
1
vote
1
answer
56
views
Variable interpolation
I am trying to interpolate variables within an Ansible play. I have the following variables:
target_hostname
user_account
account_password
user_account_password is in a vault, and the variable is ...
1
vote
1
answer
95
views
The until function never exits
I am writing a lisp interpreter with rust. I already have a lot of functions, but the loop does not seem to work. The loop is until, which is the opposite of while. It loops until the value is t.
use ...
0
votes
1
answer
88
views
SAS: unique values of variables/vtable
I'm looking for a way to extract unique values of char variables in my datasets.
I came across this paper
https://pharmasug.org/proceedings/2015/IB/PharmaSUG-2015-IB07.pdf
This is an example from the ...
0
votes
0
answers
21
views
How to dynamically call function in class [duplicate]
I am trying to call a particular class object's report() method based on user input (choice). How can I can do that, like choice.report()?
class Ship:
def __init__(self, name):
self.name = ...
1
vote
1
answer
55
views
Custom widget for visualizing dynamic table data
While creating a custom widget for visualizing dynamic table data, I encountered some issues and would like to share a minimal working example to illustrate the problem.
JS:
self.ctx.$scope.showAlert =...
0
votes
0
answers
31
views
Javascript: Pass an existing variable to a redirected url via Form submit(); [duplicate]
I need to swap out old html files to new asp files, these old files are currently live and in use.
Old URL: www.mysite.com/page1.html?variable1
New URL: www.mysite.com/page1.asp?variable1
I have this ...
4
votes
1
answer
117
views
Why doesn't Perl warn about using `$a` outside of sort block anymore?
I wrote some program for Perl 5.26.1, using strict and warnings.
So after some tests without a message I thought it's OK.
But when I ran the program wth older Perl 5.18.2, I suddenly got a warning ...
1
vote
0
answers
36
views
Use Object.groupBy function to group by a variable [duplicate]
How can I use the Object.groupBy function with a variable?
For example:
const inventory = [
{ Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5" },
...
0
votes
1
answer
51
views
How can I track a variable across different sessions/users?
I'm making a NeoCities site using HTML/CSS/Javascript. PHP doesn't seem to be supported without add-ons, so for the time being, i'm not considering that.
I want to see if I can have a button that ...
0
votes
6
answers
478
views
Why are the values of expressions independent of variable changes?
For example, there is a code:
#include <stdio.h>
int main(void)
{
int n = 54;
int index = 2 * n;
printf("%d\n",index);
n++;
printf("%d\n",index);
...
-2
votes
1
answer
137
views
C++ include file with variables in multiple files
i have code:
main.cpp
#include <iostream>
#include "add.h"
#include "var.h"
using namespace std;
int main() {
std::cout << width << height << std::...
1
vote
0
answers
89
views
How to print a variable and set its value without casting its type
been using gas assembler and here is code below that moves a data between register and memory
3 .section .data
4 constant:
5 .int 10
6
7 .section .text
8 .globl _start
9 ...
0
votes
0
answers
30
views
Run a script across multiple servers that needs the server name changed [duplicate]
Declare @ServerName sysname
select @ServerName = @@servername
Print @ServerName
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Backup',
@command=N'"C:\Program Files\...
2
votes
2
answers
117
views
How can I transport variable data throughout different classes/voids?
I'm trying to figure out how to transport the last segment of my code to another void (bottom void to top void).
I'm kind of new to C# and can use support
if (key == 'B')
{
BuyX (bstr, bstrCost, ...
1
vote
1
answer
56
views
How to substitute variable value within another string variable in Python
I have HTML template in database column that is shared with another platform. The HTML template has placeholder variables. This value is pulled from DB in my Python script but for some reason, it is ...
-1
votes
1
answer
86
views
How can I pass the variable value to this string in python? [closed]
I want to assign a variable to the stop loss and take profit in the following phrase. According to the exchange documentation, these values are constants as follows(for example: 102217.88):
...
-1
votes
1
answer
41
views
gitlab variable not picked up in feature branch cicd
I am trying to run gitlab cicd using a feature branch but the variables which I have defined in the variable section is not picked up on the cicd
variables:
IMAGE_NAME: $AWS_ACCOUNT_ID.dkr.ecr.$...
0
votes
1
answer
71
views
Check if there is a specific value in a temp table, and assign to temp variable
I have a query that joins multiple tables. The result of the query is something similar to this two samples of temptables:
DROP TABLE IF EXISTS #table1
CREATE TABLE #table1
(
[aRowNum] bigint,
...
0
votes
0
answers
38
views
Exiting properly from multiple if/then statements, AND comparing the length of a variable
Good day everyone. I am writing a script which will parse a flat file with all the information I need, and if a certain variable is too long, or greater than some length, I need to break out of that ...
2
votes
1
answer
92
views
why is transforming a string to octal value \ooo isnt working when i use an f-string and a variable inside {}?
When using a backslash followed by three integers, Python interprets them as an octal value:
# A backslash followed by three integers will result in an octal value:
txt = "\110\145\154\154\157&...
0
votes
1
answer
140
views
Why does 'set /a counter=counter+1' work without using %% in a batch script?
in this code I think I have to write set /a counter=%counter%+1 but I just tried write it without %% and interestingly it works I don't how?! can anyone explain it
@echo off
setlocal ...
0
votes
1
answer
98
views
Read from an Excel Source with a dynamic file name from variable
There are similar questions in this forum and elsewhere. however, none of the answers helped me.
I'm trying to read data from an Excel file with SSIS. The filename is dynamic based on a date. the date ...
1
vote
2
answers
76
views
I am looking for how to pull the Post ID from a currently active page in Wordpress using Shortcode to apply in a dynamic filter
I am using Shortcode in Wordpress also using Ninja Tables. The code is pulling from a Google Spreadsheet managed by a non-developer admin person. Generally easy. I am looking to embed this in a ...
0
votes
0
answers
61
views
Make.com not pulling value from previous module (returning empty)
I am pulling a checkout session from Stripe, where I have a custom field (dropdown) for language.
The Watch and HTTP modules retrieve and return the correct value, but I cannot use it anywhere in the ...
1
vote
2
answers
64
views
How can I serve different html files depending on value of upstream header with nginx
I'm struggling to configure (or actually even understand if it is at all possible) nginx for the following task:
Upstream server returns a custom header VERSION with one of the following values: ver1, ...
2
votes
1
answer
87
views
How do I fix a Powershell problem with button selection?
I used ChatGPT to generate the code to understand how to do it myself, and it mostly works. The script is to check my TV & Movie folders for missing files to make Plex work better (folder.jpg, ...
-2
votes
2
answers
110
views
Is it possible to create parameter using class constructor(C++)? [closed]
We know that we can initialize defined parameters in class constructor. But i want to create an parameter in it.
Like this:
class Database{
public:
Database(int tableCount = 100){
/* Here should ...
0
votes
2
answers
144
views
How can I change my variable my_color if the function on_button_click is triggered
Im couple of days into python and I cant find the propper solution for my problem.
I read global variable is not the best choice so I want to figure out the propper way.
I want to change the variable ...
9
votes
2
answers
349
views
Are variables formally a compile-time concept?
Note that this is a language-lawyer question. I know the common meaning of "variable", but I'm trying to understand what exactly the standard calls "variables". I'm writing some ...
0
votes
1
answer
45
views
Increasing a Batch Routine Number by Timestamp in SAS
I have a routine in SAS that runs intraday, periodically updating data in table A. I would like to identify the batch of data by the timestamp column and increment it with each data update throughout ...
0
votes
0
answers
35
views
How to make a Content-type text/css PHP file cachable and easily force-reloadable? [duplicate]
Let's say, in style.css, I need to append a query string ?version=2 after the url of a background image for force-reloading:
background-image: url(sprite.svg?version=2#icon-pencil);
Because the ...