names

Java, a way to use reserved words

本秂侑毒 提交于 2019-12-24 08:58:31
问题 Is there a method that allows you to use a keyword as a resource name in Java similar to the method used in C# of adding @ to the start of the word? I found some posts asking this a few years ago and it wasn't possible then. Was it possibly added though in Java 7 or may be added in Java 8? Reasons for doing this are very scarce. For me though I've encountered it when deserializing large json objects that use the keywords as variable names. A particular json object I'm working with uses throw.

Batch Script - Create Dynamic Variable Names or Array in For Loop

£可爱£侵袭症+ 提交于 2019-12-24 00:16:45
问题 I would like to ask you if you can advise. I don't know if it is possible to create dynamic variable names in batch or array or something like this. For example set c=0 before for loop and then set c = c+1 inside for loop and use this number to create dynamic variable name inside for loop e.g.: set entry%c% = 'somestring' and afterwards use these numbered variables to print output outside for loop e.g.: echo %entry1% echo %entry2% Example: @echo off set /a c=1 for %%i in (list.txt) do ( set

Replace “names” of columns of a data frame with different (new) names in another file in R

旧城冷巷雨未停 提交于 2019-12-23 23:34:41
问题 I have two data frames: One (dataframe A) is like as follows: S.No A1 A2 A3 A4 A6 1 0 0 0 0 0 2 2 4 7 7 9 3 6 7 9 10 0 and so on. Another (dataframe B) file is like as follows: S.No old_names new_names 1 A1 qq 2 A2 ww 3 A3 gg 4 A4 zz 5 A6 mm Names of A need not be in same sequence as of B$old_names. My new file should look like: S.No qq ww gg zz mm 1 0 0 0 0 0 2 2 4 7 7 9 3 6 7 9 10 0 IS there any simpler way to do this in R without using for loop and comparing both files? Any help would be

You can abbreviate list names? Why?

风格不统一 提交于 2019-12-22 01:39:45
问题 This got me pretty bad. You can abbreviate list names? I never noticed it before and I got totally screwed for like a day. Can someone explain what is happening here and why it could be more useful than it is terrible? And why its inconsistent like that at the bottom? And if I can turn it off? > wtf <- list(whatisthe=1, pointofthis=2) > wtf$whatisthe [1] 1 > wtf$what [1] 1 > wtf <- list(whatisthe=1, whatisthepointofthis=2) > wtf$whatisthepointofthis [1] 2 > wtf$whatisthep [1] 2 > wtf

Prevent variable name getting mangled by read.csv/read.table?

喜你入骨 提交于 2019-12-20 04:58:14
问题 My data set testdata has 2 variables named PWGTP and AGEP The data are in a .csv file. When I do: > head(testdata) The variables show up as ï..PWGTP AGEP 23 55 26 56 24 45 22 51 25 54 23 35 So, for some reason, R is reading PWGTP as ï..PWGTP . No biggie. HOWEVER, when I use some function to refer to the variable ï..PWGTP , I get the message: Error: id variables not found in data: ï..PWGTP Similarly, when I use some function to refer to the variable PWGTP , I get the message: Error: id

MySQL use column names from another table

六眼飞鱼酱① 提交于 2019-12-20 04:22:39
问题 I'm wondering if it is possible to return a result set with column names which are stored in a separate table. Is this possible or do I need a stored_procedure with variables. See link for mysql_dump and description of required resultset: http://pastie.org/584865 回答1: You'd have to use a stored procedure that'd generate SQL dynamically and then run it. Column names aren't really first-class data in SQL, so you can't do much anything with them. They are determined at query parse time, before

At least the first 31 or 63 characters of an internal name are significant? [closed]

*爱你&永不变心* 提交于 2019-12-19 04:59:47
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Here's a direct quote from the Book (K&R, 2nd ed, p. 35): "At least the first 31 characters of an internal name are significant. For

how to assign to the names() attribute of the value of a variable in R

浪子不回头ぞ 提交于 2019-12-18 04:27:22
问题 In R, "assign('x',v)" sets the object whose name is 'x' to v. Replace 'x' by the result of applying a text function to a variable x. Then "assign" shows its worth. Unfortunately, "assign(paste('names(','x',')',sep=''),v)" fails. So if 'x' is a variable x, I can set its value, but I can't give it names for its elements. Can one work around this? a parse-eval trick maybe? Thanks. 回答1: In the form you ask question there is no need to assign names. If you x exists then you do names(x) <- v . This

PHP Regex for human names

狂风中的少年 提交于 2019-12-18 02:47:56
问题 I've run into a bit of a problem with a Regex I'm using for humans names. $rexName = '/^[a-z' -]$/i'; Suppose a user with the name Jürgen wishes to register? Or Böb? That's pretty commonplace in Europe. Is there a special notation for this? EDIT:, just threw the Jürgen name against a regex creator, and it splits the word up at the ü letter... http://www.txt2re.com/index.php3?s=J%FCrgen+Blalock&submit=Show+Matches EDIT2: Allright, since checking for such specific things is hard, why not use a

assign headers based on existing row in dataframe in R

我的梦境 提交于 2019-12-17 21:45:08
问题 After transforming a dataframe, I would like to assign heads/names to the columns based on an existing row . My headers are currently: row.names X2 X3 X4 X5 X6 X7 X8 X9 ... I would like to get rid of that and use the following row as column headers (without having to type them out since I have many). The only solution I have for this is to export and re-load the data (with header=T). 回答1: The key here is to unlist the row first. colnames(DF) <- as.character(unlist(DF[1,])) DF = DF[-1, ] 回答2: