Questions tagged [variable-names]

256 questions
0
votes
1 answer

What are the variable names that are disallowed in cdecl other than the ones that cannot be used in any program?

I've been playing around with cdecl and I've noticed that some names are not allowed as identifiers in it although GCC compiles them perfectly. For example, if I write int ptr; or int pointer; or int array; cdecl gives a "syntax error" but…
Spikatrix
  • 20,225
  • 7
  • 37
  • 83
0
votes
1 answer

Retrieving sets of covarying variables

I have a data frame with a large number of variables represented as columns that vary with time as an index for them. I would like to retrieve sets of highly covarying variables. data <- data.frame(time_series=c(1,2,3), …
puslet88
  • 1,288
  • 15
  • 25
0
votes
1 answer

R : Changing variable names with a for(); grepl() and colnames()

Im trying to make a data panel and in the way i have to rename some columns in order to apply rbind() and then run some statistics. i have multiple objects like this: data22 1. year -- id-----22.Letters.spendingXX -----22.Letters.IncomeXX 2. 1999…
0
votes
2 answers

is there any restriction on variable name so that it should not conflict with package name?

Suppose, I have one Test class in test package: package test; public class Test { private static int clarying=20; public static void main(String[] args) { clarying.Product.display(clarying); // this line is giving error …
Prashant
  • 2,556
  • 2
  • 20
  • 26
0
votes
1 answer

mongoose query only works when changing the name of variable

I'm trying to run this simple code in my node+express code mongoose.model('Package').find(query, function(err, package) {..... and it fails with mongoose.model('Package').find(query, function(err, package) {..... …
FORTRAN
  • 567
  • 1
  • 6
  • 13
0
votes
1 answer

Accessing variables with related names in a for loop

I have three NSRects in separate variables named rect1, rect2, and rect3, and I want to increment each one's origin.x by 10. I thought a for-loop would be good for this, but I don't know how I can do it. This is an example of how I want it to…
user3195648
  • 67
  • 1
  • 1
  • 6
0
votes
1 answer

R: How do you input a new column into a table with the eval(parse()) as table name?

I'm new to R language so I may have missed out something... I'm trying to run it in a for loop. Assuming i<-1, and parti1 is a table.(dataframe) partin<-paste("parti", i, sep = "") eval(parse(text = partin))["Time"] <- "1" However, it gives an…
0
votes
3 answers

Bash script to obtain the newest file X in a folder and create a new variable called X+1

I am trying to create a loop in Bash script for a series of data migrations: At the beginning of every step, the script should get the name of the newest file in a folder called "migrationfiles/ and store it in the variable "migbefore" and create a…
Johan Garzon
  • 103
  • 1
  • 2
  • 9
0
votes
1 answer

Recursively load from cPickle and create variables to store them

I have 26 .pkl files at hand, from dict_a.pkl to dict_z.pkl. I want to load them into the memory, so I can compare elements start with a with variable loaded from dict_a.pkl. The reason I want to do this is that each file is really large, if I put…
Sean
  • 1,161
  • 1
  • 13
  • 24
0
votes
2 answers

How to name a function and a variable with the same name?

The following code cannot be compiled by VC++ and clang. int f() { return 0; } int main() { // error : called object type 'int' is not a function or function pointer int f = f(); } It is necessary in some cases. For example, I have a…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
0
votes
1 answer

How to create a new variable name in each iteration in a nested matlab for loop?

I would like to run my function and to create 3 different output varables. for i=1:3 for j=1:3 Rent_nb = landrent(i,j,Dist); end end And I would like "_nb" to be 1, 2, 3... so I get 3 output arrays. So I looked on the internet and I saw I…
Lay
  • 249
  • 1
  • 3
  • 15
0
votes
2 answers

Objective-C: technical reasons to avoid _ as a local variable name?

Consider this in the (possibly nested) scope of a method (function, block, etc.): int _ = 42; Are there any technical reasons to avoid a local variable named _? Some guidance, for the purpose of this question: I know _ generally prefixes…
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118
0
votes
2 answers

How can i tell php to use a certain variable depending on a counter inside a for loop?

I have a script where I retrieve several values from a database and i store them in the following…
Pathros
  • 10,042
  • 20
  • 90
  • 156
0
votes
2 answers

how to run regression in R when column name includes decimal points

This may be a very simple problem, but I can't seem to get past it. Have column names such as X100.4, X100.-4, X100.-5 so on. I'm trying to run a linear regression but when I do this I get an…
halo09876
  • 2,725
  • 12
  • 51
  • 71
0
votes
5 answers

Make variable name using loop and string in PowerBuilder

I am interested if it is possible to make variable name in PowerBuilder using a loop and a string. For example: long ll_go string lst_new for ll_go = 1 to 8 lst_new = "text" + ll_go lst_new.tag = 5500 next So, it should give me variables text1,…
user
  • 3
  • 1
  • 4