Questions tagged [variables]

THIS IS AMBIGUOUS; USE SPECIFIC-LANGUAGE TAGS WHENEVER APPLICABLE. A variable is a named data storage location in memory. Using variables, a computer program can store numbers, text, binary data, or a combination of any of these data types. They can be passed around in the program.

-5
votes
0answers
19 views

Variables inside event handler function gets resolved before the event [on hold]

I'm having a list html element. I want to check the offsetheight of a child element which hides/toggles alternatively when clicked. The offsetheight is zero when its hidden and 76 when revealed. So, ...
0
votes
2answers
15 views

How can I get my script to read a subscript output as a preset variable name

I want the output of my string to be read as a variable and not printed as text I have tried to research the problem, but as an introductory student I can't really find what i'm looking for } ...
0
votes
0answers
20 views

Trying to see how much of a level of a variable is in another level of another variable

I am trying to figure out how to see how much of a certain variable is in another variable. What I mean is that I have two variables in R, and they both have two levels. I want to see how much of ...
0
votes
0answers
10 views

Insert result of multiple Select statements into one Table in their respective columns

I'm working on gathering some SQL Server Stats for upgrade planning. I found some good queries and modified it to fit my requirements. I would like to add the result from each query into a table (...
0
votes
1answer
29 views

Why is this constant not printing to console? its just blank

Here is a snipet of code from a bigger app. This function (is called when a button is clicked)just evaluates which selection from a picker was chosen and assigns a string to it and also get the input ...
0
votes
1answer
22 views

powershell export variable to txt file

I need to extract a variable on a single line in a txt file like so; Write-Host "Select RDS Collection to migrate" $AllCollections.Keys | Sort-Object | ForEach-Object { Write-Verbose "[$_] - $($...
0
votes
0answers
32 views

VB.Net | Is there a way to reference a dynamic amount of variables as arguments to function/sub?

I'm trying to pass a dynamic amount of variables to a Sub by using ByRef; Essentially I'm trying to create a module that I can easily import into my projects and make handling the file saving/loading ...
0
votes
0answers
9 views

Get variable scope in tensorflow 2.0

I am using the new version of tensorflow (2.0.0 alpha) and I dont know why it does not allow me to run: tf.get_variable_scope().reuse_variables() I am getting the following error: AttributeError: ...
0
votes
1answer
41 views

How to get all variables including constants

I have been trying to find a way to find all constants in javascript. I have found I can get all global variables with for (let i in window) { console.log(i); }; I do not get constants ...
0
votes
3answers
32 views

How to make a variable from json using XMLHttpRequest?

I would like to get an array with objects from json using XMLHttpRequest() and assign it to a variable. If i log it in a console it shows the array. function getData() { let myJson = []; var ...
0
votes
0answers
21 views

using compress-archieve -path $Variable\*.csv (Not working)

I am unable to figure out how to describe my problem, and therefore unable to find my answers. So hopefully someone in here can help me. I'm trying to use a vaiable as a -path, and reusing that ...
0
votes
1answer
14 views

Mongoose model.find(filteredQuery) returns empty array

I have a Node.js back-end that communicates with my MongoDB, and I need to filter out some results from the database. The problem is, when I send the query, I just receive an empty array in return. ...
0
votes
3answers
33 views

Python loop to call different variables

I am trying to create loop in Python to call different variables. example0="result1" example1="result2" example2="result3" example3="result4" example4="result5" for i in range(5): print(example+...
0
votes
0answers
4 views

bootstrapping for selection variable

I'm working on Simar and Wilson (2001) technique on variable selection in data envelopment analysis, and i need codes. I have tried to code by myself but in vain. I have worked on statistical ...
0
votes
0answers
36 views

Assign value to variables inside an array [duplicate]

I have variables which I put inside an array. When I loop through the array I assign values to the variables. When I console.log(variable) it returns undefined. Example: var test1, test2; var tests[...
0
votes
0answers
14 views

Variable parameters in invoke?(php)

I have to call a Bapi with SAP. (I use a sapnwrfc) In order to do this i have to use invoke to call these bapi , but I don't know the number of parameters. I can send 2 parameters , like I can send 55 ...
-1
votes
0answers
20 views

Store Source URL to Database

I want to store a URL that was used to access a specific page to a MySQL database. The page can be accessed via two methods, a shortened bitly link, or a direct html link. I'm not sure if this can be ...
0
votes
0answers
7 views

Calling a variable with space in a function

As part of my nightwatchjs test script, I have the following variable defined; var makeUpperCase ="Land Rover"; This variable is then referenced in a separate script; exports....
1
vote
2answers
26 views

Bash, need to count variables, round to 2 and store to variable

I need to count variables, round to 2 and store to variable. Example: I have variable from array ${array[5]} and vat variable defined, I need to calculate simple ( $vat * ${array[5]} + ${array[5]} )...
-1
votes
2answers
27 views

How to include a PHP variable inside MySQL query

I wanna add an extra column to my database and give it the name price_23-05-2019. How do I put this into a working query? I have this right now, which is clearly not working: $date = date("d-m-Y"...
1
vote
1answer
25 views

Applescript with do Javascript and passed Applescript Variable

I have written a script that has automated the creation of products on a website I administer. In my process I upload JPEG images of the products and pull the Keywords that are tagged in the JPEG to ...
2
votes
2answers
28 views

JavaScript local scope variable available in event after host function returns. Why?

So... I come from c++ background and I don't understand few things about JS. For example: function a() { var x = 0; // Local variable $(document).on('mousedown', function(){console.log('down: '...
-1
votes
1answer
54 views

I need a clue how to begin with this query

Picture shows how part of my DB looks like. I want to have a ranking of players, that shows for example ten best players from last week or so with sum of their points and nicknames which are stored ...
1
vote
0answers
3 views

How to recover environment variable to its previous value?

I have changed the path variable by mistake how can I recover this ? I have been try to recover that path environment variable by checking in registry editor but I have already changed over there also ...
0
votes
1answer
43 views

Is it always possible to transform multiple selects with while loop and variables into a single query without using temp tables in sql?

This problem can be solved with temp table, however, I don't want to use Temp table or var table, this question is mostly for my personal educational purposes. I inherited the following SQL: DECLARE ...
0
votes
1answer
28 views

Running variables

I am quite new with TensorFlow, I am trying to use variables, but I do not get what I expect When I declare a constant into tensorflow, and then I run into a session it works. but when I try to do ...
0
votes
1answer
52 views

Javascript recursion - Variables not closing

I am trying to do a depth-first search (DFS) of a generic tree. The goal for each node is to know its level AND the maximum number of levels beneath it. An example tree looks like: The DFS order ...
-2
votes
4answers
62 views

Why do we use `i` as the variable to control a Javascript loop? [duplicate]

I always wondered why we use i in Javascript loops couldn't it be any letter? Just wondering why i seems to be the default one. for (i = 0; i < 5; i++) { text +="The number is " + i + "<br&...
-3
votes
2answers
22 views

How to assign value using another variables string data

I want to assign value to new variable to use string value. In code, I want to input list data to tem_data but this code input str data. ex) tem_data = set_tem_data Then how can I input set_tem_data ...
-3
votes
2answers
37 views

How to change variable value based on condition

In the event the firstvariable =="1", and secondvariable =="example", I want to change the value of firstvariable to =="0", else firstvariable stays =="1" In below code, I've commented out what I ...
1
vote
1answer
24 views

Variable within XPath Expression

I am having difficulties placing a variable within my XPath expression. I want to make a search term that I can modify from an input, and use it in the XPath expression, but the second example below ...
2
votes
5answers
67 views

Assign a value to a variable in the template - Angular7

There are toggle two button (edit and submit), which button should work like toggle show/hide style on click <button (click)="showEditBtn = false;" *ngIf="showEditBtn;"> Edit</button> <...
0
votes
0answers
27 views

Trying to have 3 variables that get randomly assigned numbers that add up to 100 [duplicate]

So I'm trying to make a program that has 3 variables a, b, and c (these stand for contestants on a made up talent show) I don't know how to make it randomly assign values but have it that together the ...
0
votes
1answer
22 views

Language R: Variable doesn't change inside a 'for()' cycle?

I am trying to analyze the value of "edoActual", but it doesn't seem to change its value after the for cycle. When running it in RGui, it doesn't point any errors or warnings. When running it on ...
0
votes
0answers
27 views

scipy fsolve fails for higher range of values whilst finding roots of equations

I am using scipy.optimize fsolve for finding roots of two equations. fsolve works well for some range of b values (0.1 to 0.6), but fails for values like 0.9 or 0.99. I have tried moving to ...
0
votes
0answers
22 views

Why new line is added to variable at end? [duplicate]

file.sh #!/bin/bash fileName="Screenshot_$(TZ=GMT-3 date +%Y%m%d_%H%M%S).png" echo "|$fileName|" Terminal at Ubuntu 19.04: > bash file.sh |Screenshot_20190521_104141.png | I want to understand ...
0
votes
1answer
42 views

React Hook setState not set on promise

I'm using the Contentful CMS JS SDK and the code below does not update my React Hook state. It's more of a promises combined with react hooks combined with React render issue - I believe. I understand ...
0
votes
2answers
30 views

Extern function output not as expected in c++

I have been trying a few things out with 'extern' keyword. I wrote this basic function and I am not sure why my print function is not working. Kindly help me in understanding it. test1.h #pragma ...
-1
votes
0answers
26 views

How can undefined variable 'num' work properly? [duplicate]

I wrote code for a 'hangman' game to practice JS coding (in very simple form for now). I forgot to initialize variable 'num' ... I just wrote num = 2 and ... it works, but I can't understand HOW ?? ...
0
votes
1answer
29 views

Trying to toggle a boolean variable with a button

I am trying to toggle a variable with a button. The code doesn't toggle, it only outputs what the variable initially was. <button id="lock" onclick="togle()"> <img id="img1" src="images/lock....
0
votes
0answers
32 views

Why would a string variable later be returned as [object HTMLInputElement]?

I define 2 variables as empty strings: var userName = ""; var initials = ""; The user then inputs their name and initials into an input element: function setUserName() { var inputUserName = ...
1
vote
1answer
32 views

Is there a way to import a R variable into a linux script?

I have a Rscript which generates several variables. I would like to import one of these variables into a bash loop? Is it possible? My variable is variable and I want to import it like this : for i ...
0
votes
0answers
11 views

How to change a part of a code after execution? [duplicate]

I wanted to know that is it possible to change part of a code after it executed? To understand it better let me give you an example Lets assume we got a javascript file (lets Call it example. js) ...
0
votes
0answers
7 views

How to call a R variable in a loop with Slurm?

I have a R (RHO_COR.R) script and I would like to create a loop in order to split the jobs on several nodes. I show the part of the script where I would like to create the loop. res <- foreach(i =...
2
votes
2answers
37 views

How can I define a variable inside a function only the first time its called?

I need to define a variable into a function's scope, but only the first time its called. The function will be called multiple times because it's inside a for loop, so defining a variable every time ...
0
votes
2answers
26 views

Unexpected 'NameError' while assignment of an input variable to be a value in a dictionary

I have a variable with an input, and it´s all ok, i made the variable global with the 'global [variable]' statement, and later, i made a dictionary with a key called 'Nome:' and the value the variable ...
0
votes
1answer
27 views

Make a radio button add 1 only one time instead of adding 1 per clicks

I made a quiz in Tkinter for school. To anwser a question you select a radibutton, but when you click 3 times on the good radiobutton it will add 3 points instead of 1... Can anyone help me? ...
0
votes
2answers
78 views

Is it possible to define a variable only once without using final

I was wondering if there is a way, in Java, to assign a variable only once. I know there is the final keyword but I would like to achieve same result without having to set the value in the constructor....
1
vote
2answers
79 views

Why I can't use vars() inside my function for a variable that is outside my function?

I made a function named translate(x). Outside this function, I made a variable named korean. I want to call my korean by using vars()[] function. But, instead of a successful compile, an error occured....
0
votes
0answers
21 views

How to pass a variable to all components and their childs [closed]

I am currently developing an UI framework for my projects and would like to implement a dark-mode. Unfortunately I'm not sure how to implement such an undertaking. I want to specify an attribute (e....

http://mssss.yulina-kosm.ru