variable-names Questions

5

So this seems like I should have been wondering about this when I first started programming, but I suppose back then I wasn't as concerned with 'perfect' variable naming. So I have the variables ...
Zane asked 21/2, 2017 at 5:15

4

Solved

#check if the name is valid function myfunc() { #check "${1}" #echo "valid/invalid" } #these should return valid myfunc "my_number" myfunc "my_number1" #these should return ivalid myfunc "1my_...
Underlayer asked 8/11, 2012 at 17:16

9

Solved

When you save a variable in an R data file using save, it is saved under whatever name it had in the session that saved it. When I later go to load it from another session, it is loaded with the sa...
Hair asked 7/4, 2011 at 7:4

3

Solved

In this code: typedef int foo; struct S { foo foo; }; int main() {} all versions of clang -std=c++14 accept this code, however all versions of g++ -std=c++14 report: 5 : error: declaration o...
Universe asked 24/12, 2015 at 9:5

4

Solved

I stumble upon some C++ code like this: int $T$S; First I thought that it was some sort of PHP code or something wrongly pasted in there, but it compiles and runs nicely (on MSVC 2008). What kind ...
Buoyage asked 28/10, 2011 at 7:38

1

Solved

I was writing some Perl code in vim and accidentally typed a single quote character in a variable name and noticed that it highlighted it in a different color than normal single quoted strings. I ...
Evadnee asked 6/4, 2021 at 16:1

6

Solved

With gcc 4.7.2 this compiles just fine for me: int main() { int _ = 1; return 0; } Can I expect this to compile in general? I've read the answers about underscores as prefixes. But what if the...
Elapse asked 5/9, 2013 at 22:28

10

Solved

I am trying to execute this query: declare @tablename varchar(50) set @tablename = 'test' select * from @tablename This produces the following error: Msg 1087, Level 16, State 1, Line 5 Must decl...
Meakem asked 15/5, 2010 at 1:7

1

Solved

I wrote some code recently where I unintentionally reused a variable name as a parameter of an action declared within a function that already has a variable of the same name. For example: var x = ...
Homophonous asked 29/1, 2020 at 17:58

3

Solved

I have a Kotlin class in my application with a lot of attributes, what I want to build is a method that stores the variable name in a dictionary. The dictionary looks like this: HashMap<String...
Photoflash asked 7/11, 2018 at 11:4

1

Solved

I want to add a new column in a dataframe with values from some other dataframe. My new column name is a variable and I cannot hardcode it. new_column = "my_new_column_name" df = df.assign(new_co...
Bona asked 16/9, 2019 at 5:40

10

Solved

I am developing a tool to dump data from variables. I need to dump the variable name, and also the values. My solution: Store variable name as a string, and print the "variable name", followed by ...
Scope asked 26/10, 2009 at 4:42

24

Solved

I was working with a new C++ developer a while back when he asked the question: "Why can't variable names start with numbers?" I couldn't come up with an answer except that some numbers can have t...

1

Solved

I have learnt from PEP 3131 that non-ASCII identifiers were supported in Python, though it's not considered best practice. However, I get this strange behaviour, where my 𝜏 identifier (U+1D...
Ortego asked 2/1, 2018 at 14:51

2

Solved

This is somewhat academic, but nevertheless. Python syntax forbids starting a variable name with a number, but this can be sidestepped like so: >>> globals()['1a'] = 1 >>> globals...
Stemware asked 31/1, 2017 at 16:21

2

Solved

Thanks ahead of time, to anyone who helps. :) This may seem a simple answer to those who are experienced, but I have scoured the internet as well as a couple of reference books, and not found a st...

2

Solved

I am writing a function in R to extract some air quality modelling data from netCDF files. I have the Package "ncdf" installed. In order to allow other users or myself to choose what variables to ...
Marcus asked 29/1, 2013 at 15:33

2

Solved

I'm currently trying to remove all errors and warnings I have in my project the Inspection tool from my PHPStorm give to me. I encounter a snippet PHPStorm says "Unused private method _xxx" while ...
Appendicitis asked 12/9, 2014 at 17:13

2

Solved

I heard that it is possible to use Unicode variable names using the -fextended-identifiers flag in GCC. So I made a test program in C++, but it does not compile. #include <iostream> #in...
Lotte asked 26/9, 2015 at 16:2

1

**So, I've worked with Erlang, before, and am pretty comfortable with it. I am just trying to learn Elixir. I was recently trying to translate a 'lazy caterers' example into elixir and am be...
Brittani asked 12/6, 2015 at 22:26

2

Solved

I have following simple function but its ggplot command does not work. The command works all right when given from command line: > testfn <- function(gdf, first, second){ library(ggplot2)...
Tolentino asked 30/4, 2014 at 8:7

6

Solved

Let's assume that I want to create 10 variables which would look like this: x1 = 1; x2 = 2; x3 = 3; x4 = 4; . . xi = i; This is a simplified version of what I'm intending to do. Basically I just...
Handcart asked 19/4, 2013 at 7:24

3

Solved

Related: Why can't variable names start with numbers? Is there a technical reason why spaces aren't allowed in variable names or is it down to convention? For example, what's stopping u...

1

Solved

I have a simple question about component IDs and dialog (or other components) widget variable name. Is there a problem of using the component ID as widget variable name of the same component? E.g...
Liber asked 30/9, 2013 at 13:41

3

Solved

I tried running the sample code which appears on the documentation page for the System.Reflection.Emit.LocalBuilder class but it appears that the calls to LocalBuilder.SetLocalSymInfo(string, int, ...
Herriot asked 12/2, 2012 at 22:56

© 2022 - 2024 — McMap. All rights reserved.