Questions tagged [variable-names]

256 questions
0
votes
2 answers

Which name is more correct in my case: manager or factory (or something else)?

I have next code: PhotoFactory factory = PhotoFactory.getFactory (PhotoResource.PICASA); PhotoSession session = factory.openSession (login, password); PhotoAlbum album = factory.createAlbum (); Photo photo = factory.createPhoto (); album.addPhoto…
Roman
  • 64,384
  • 92
  • 238
  • 332
0
votes
1 answer

rails rake task - access to command line arguments variable names

Ok, I have the following task, namespace :test do task :a do |t,args| p ENV.keys end end $ rake test:a ARG1 = "me" ARG2 = "my wife" The above command displays a big array i.e ENV.keys ENV.keys looks like this, ["MANPATH",…
0
votes
2 answers

Change a variable name with a raw_input

Here is a beginners question: I made a function that reads a txt file (selected by the user) and makes a list of many numbers contained in the file, called A. I called this function open_file. Then I want to change the name of that list with the…
0
votes
1 answer

R colnames: A few character variable name changed to number

I have a data frame called VarChange containing 1005 variables such as: row.name SamplingEvent Year Zenaida_macroura . . . 1005 variables 1 12367 S41 2005 0 2 12369 S42 2005 X 3 12370 S43 …
JoeBird
  • 65
  • 1
  • 10
-1
votes
5 answers

Dynamic variable names in C#?

(There's not an actual function where I need this, but I was just wondering.) Imagine this function where I pass a bool[,]. This bool[,] is named grid1 or grid2, depending on the situation. I was wondering if I can do anything like the…
Simon Verbeke
  • 2,905
  • 8
  • 36
  • 55
-1
votes
4 answers

JavaScript: Get variable name in method defined in prototype

How can I get the variable name in a method, which I defined in the prototype of String()? String.prototype.foobar = function() {alert(/*something here...*/);}; var s="I'm just a stupid string!"; s.foobar(); Should return an alert which contains…
ninov
  • 629
  • 1
  • 6
  • 17
-1
votes
1 answer

What is a good name for a buffer for buffer overflow?

I'm not sure if this is this right place to ask this question, so please migrate this post to a correct place if it suits better. I was really wondering what is a correct name for this. char buf[SIZE + XX] buf will contain meaningful data up to SIZE…
xiver77
  • 2,162
  • 1
  • 2
  • 12
-1
votes
1 answer

Is there a Python function for creating variables?

I am doing a python project in which I want to create several variables that all hold the same information; however, I cannot figure this out on my own. Instead of writing: a = 1 b = 1 c = 1 and so on, I want to automate this process. Here are some…
-1
votes
4 answers

Use of variable '$name' in a function

I like to think I'm quite knowledgeable on php, but this has baffled me. Keeping it basic I have: function req_new($pname, $use=null, $depID=null, $manID=null, $manName=null, $suppID=null, $suppName=null, $cat=null, $brand=null, $name, $email,…
Abe Petrillo
  • 2,368
  • 23
  • 34
-1
votes
1 answer

Explainig How this MACRO works ?? [printing VAR name in c++]

I'm using this MACRO for debugging in C++ . Printing the variable name and value. Can anyone explain its working ? #define watch(x) cout << (#x) << " is " << (x) << endl; int t = 90; watch(t); // output is t is 90
pankaj pundir
  • 377
  • 3
  • 6
-1
votes
2 answers

How do I find out the name of a variable in python 2.7.9?

I often need to print variables for debugging purposes, and I found out that it helps a lot to also know what those variables are. So I would like to have a function that does sort of the following: from __future__ import print_function def…
scapiskipi
  • 63
  • 7
-1
votes
2 answers

R, creating variables on the fly in a list using assign statement

I want to create variable names on the fly inside a list and assign them values in R, but I am unable to get the desired result. Here is the logic of my code: Upon the function call: dat_in <- readf(1,2), an input file is read based on a product…
jkp
  • 155
  • 2
  • 7
-1
votes
3 answers

Python: How to create a variable of the file name?

I have thousands of text files containing very long block of text(around 200kb - 600kb each file). I want to store contents of each file in a separate variable and to make it easier to identify it I want to store them in a variable that is the same…
sP_
  • 1,738
  • 2
  • 15
  • 29
-1
votes
1 answer

Using variable value as variable name in bash

I've seen this question asked before but I can't seem to get the grasp of it. I have this variable that I get from user input read column_number and then I join it with the "col" prefix to form the name of my…
-1
votes
1 answer

PHP - Define a constant and use it in a variable name

please can you help me in this problem? If in PHP I have a defined constant, can I use that constant name within a variable name? For example how can I do something like the following in valid php syntax? define ("HELLO", "hello-you"); $var_HELLO =…
JB-Franco
  • 256
  • 1
  • 3
  • 17