Questions tagged [variable-names]

256 questions
0
votes
0 answers

what is the most accurate type for this variable?

here is a part of my code. I managed to get the result I wanted to but only by declaring Elements as a as Variant since it didn't work as a HTMLElementCollection. Can someone explain me why ? And what's the most accurate variable then ? Thanks '…
Seb
  • 508
  • 8
  • 25
0
votes
1 answer

class name suggestions for a class full of containers

I have a class as follows class Package { list targetList; list excludedList; map mapping; }; I will be using data structures of type, Package, contained within several other classes which might require…
rranjik
  • 690
  • 9
  • 21
0
votes
1 answer

May I use variables and concatenate in Puppet resource names?

I'm wondering if one can put variables in resource names, for example: $c6release = $::operatingsystemmajrelease ## [EPEL(5, 6, or 7)-x86_64] yumrepo { 'EPEL' + $c6release + '-x86_64': ## This is the part I'm asking about. baseurl =>…
Nathan Basanese
  • 8,475
  • 10
  • 37
  • 66
0
votes
1 answer

Java Swing, 100 TextFields have similar task, So I want to write the one function to do so

I am working on a small project (with NetBeans' Java GUI Builder) in which I have 100 TextFields which does exact same thing on different data. They are arranged in 10 rows and 10 columns, there (Variable) names are like: txt11, txt12, ...…
Abhishek Kashyap
  • 3,332
  • 2
  • 18
  • 20
0
votes
0 answers

How to use variable for a variable name?

my $myvar = "foo"; my $x = "my"; my $y = "var"; print ${$x$y}; # output is foo? How can I use a variable to make up a variable name?
CJ7
  • 22,579
  • 65
  • 193
  • 321
0
votes
3 answers

Set a variable to a random element from an array and not the elements value. ---python---

This is for a text-based card game. I have been trying to get python to randomly select a variable from a array and store the name of the variable in Fa. However it only stores the value of the variable Fa and not the name of the variable. My code: …
0
votes
1 answer

variable in variable name for javascript

The command "alert(numOne);" shows f_name. Thus, I want the the last line of the function to become document.f_name.submit(); but my current idea doesn't work. Is there a way to make this happen? function submitform(e) { var numOne = e.id; …
user5095266
  • 119
  • 2
  • 7
0
votes
3 answers

Swift: Interpolation of Property Names?

Is it possible in Swift to have interpolation of property (variable) names from the content of other properties? In the code segment below, In the first for loop I would like to set the property eachItem to the item name contained in the rotation…
Michael Sheaver
  • 2,059
  • 5
  • 25
  • 38
0
votes
1 answer

Naming veriable according to The index of The loop

for i=1:1:4 T=[(cos(x(i)))^2 (sin(x(i)))^2 2*(cos(x(i)))*(sin(x(i)));(sin(x(i)))^2 (cos(x(i)))^2 -2*(cos(x(i)))*(sin(x(i))) ;-(cos(x(i)))*(sin(x(i))) (cos(x(i)))*(sin(x(i))) (cos(x(i)))^2-(sin(x(i)))^2 ;]; XXXXX=inv(T)*Qq*R*T*inv(R); end I…
Guy Balas
  • 98
  • 3
  • 10
0
votes
2 answers

What is good naming form for variables in loops JS?

Hi so as I mentioned in the title I have a bunch of loops within loops in my code and most of them use a variable to loop through stuff. I call my variables ia, then ib then ic and so on. What is good form for the naming of these variables? Here is…
Nimajik
  • 95
  • 1
  • 1
  • 10
0
votes
2 answers

How to access the string stored in the variable? (Python)

Since my last question was rather poorly worded, here is a different question that will provide me the same benefits! First of all, I want to accomplish one thing: create a new Set and set that Set's name to the value of a variable (a string I would…
0
votes
1 answer

Wordpress transients with dynamically generated name as parameter in function

hopefully you can help me with this scenario: I have several queries of different post types inside shortcode function. Now I´m trying to store those queries with transients. But those transients need to have a unique name for each page from where…
Funkateer
  • 11
  • 5
0
votes
2 answers

Function arguments names JavaScript

I wonder why pepole use letters for names of arguments of function (i see that mostly in JS). For example that function: function showMessage(e, t, i) { var n = e.find(".admin-message"); n.empty().removeClass("error success").addClass(i ?…
0
votes
2 answers

Create ArrayList from Existing ArrayList

I've got an ArrayList that looks like this: ArrayList item; item [0] --> boom item [1] --> pow item [2] --> bang item [3] --> zing Now what I'm trying to do is take each item and create an empty ArrayList of strings with that item's name.…
REAL O G
  • 693
  • 7
  • 23
0
votes
2 answers

Can a variable named as `$something` be referred to by `someting`, that is without the dollar sign?

I am examining some PHP code written by somebody else, and they have basically named a variable $text: protected $text = null; And then later in the same file, they are referring to it without the $ sign: $this->text[$name] = new Text($age,…
Solace
  • 8,612
  • 22
  • 95
  • 183