Questions tagged [named]

Anything named - objects, variables, classes... Naming is a primary tool of reuse.

Anything named - objects, variables, classes...

Naming is a primary tool of reuse.

392 questions
7
votes
2 answers

Powershell: Replacing regex named groups with variables

Say I have a regular expression like the following, but I loaded it from a file into a variable $regex, and so have no idea at design time what its contents are, but at runtime I can discover that it includes the "version1", "version2", "version3"…
Hoobajoob
  • 2,748
  • 3
  • 28
  • 33
6
votes
2 answers

name character vectors with same name of list

I have a list that looks like this. my_list <- list(Y = c("p", "q"), K = c("s", "t", "u")) I want to name each list element (the character vectors) with the name of the list they are in. All element of the same vector must have the same name I was…
6
votes
1 answer

return value from child process c

I need help returning a "status code" from my child program back to the parent, where it will check the status code, print code, and exit the parent. This is for a class project, so I will put some relevant code here, but I don't to post the entire…
user7904063
  • 63
  • 1
  • 3
6
votes
4 answers

Constructor chaining or use named/optional parameters

I'm a very new programmer and understand we want to minimize code redundancy so when we update we can make as few changes as possible and also minimize errors. So I have a Student class that I want overloaded constructor so If I do back chaining…
6
votes
4 answers

Are Hibernate named HQL queries (in annotations) optimised?

A new colleague has just suggested using named HQL queries in Hibernate with annotations (i.e. @NamedQuery) instead of embedding HQL in our XxxxRepository classes. What I'd like to know is whether using the annotation provides any advantage except…
Graham Lea
  • 5,797
  • 3
  • 40
  • 55
6
votes
2 answers

Open-source rule-based pattern matching / information extraction frameworks?

I'm shopping for an open-source framework for writing natural language grammar rules for pattern matching over annotations. You could think of it like regexps but matching at the token rather than character level. Such a framework should enable the…
John Lehmann
  • 7,975
  • 4
  • 58
  • 71
6
votes
4 answers

C# How to create special instances of a class?

For some classes, ideally, I'd like to create special named instances, similar to "null." As far as I know, that's not possible, so instead, I create static instances of the class, with a static constructor, similar to this: public class Person { …
Edward Ned Harvey
  • 6,525
  • 5
  • 36
  • 45
6
votes
2 answers

How to use `assign()` or `get()` on specific named column of a dataframe?

Is there a way to assign a value to a specific column within a data frame? e.g., dat2 = data.frame(c1 = 101:149, VAR1 = 151:200) j = "dat2[,"VAR1"]" ## or, j = "dat2[,2]" assign(j,1:50) The approach above doesn't work. Neither does this: j =…
baha-kev
  • 3,029
  • 9
  • 33
  • 31
5
votes
1 answer

R: Named lists and description lists

R has two classes not so commonly used: "Dlist" and "namedList". As regard the first, it is mentioned with respect to Sys.getenv(), which returns a result of class "Dlist" if its argument is missing, for nice printing. There is in fact a print.Dlist…
antonio
  • 10,629
  • 13
  • 68
  • 136
5
votes
2 answers

Names combined by dot automatically when assign value of a named array with a named variable

A simple example: a <- quantile(1:10, 0.1) a output: 10% 1.9 Use a to assign value of a named array: b = c(index=0, value=a) b output: index value.10% 0.0 1.9 Why the 'value' and '10%' are combined by dot automatically? How to avoid this,…
Code Learner
  • 191
  • 11
5
votes
3 answers

perl6 Grammar action class method seems not inherited, named capture seems not made

I am trying to parse a csv file to do simple things: extract last name, ID, and birthday, and change format of birthday from m/d/yyyy to yyyymmdd. (1) I used named capture for birthdays, but it seems that named captures method are not called to make…
lisprogtor
  • 5,677
  • 11
  • 17
5
votes
2 answers

How do I access the captures within a match?

I am trying to parse a csv file, and I am trying to access names regex in proto regex in Perl6. It turns out to be Nil. What is the proper way to do it? grammar rsCSV { regex TOP { ( \s* \s* \, \s* )* } proto regex oneCSV {*} …
lisprogtor
  • 5,677
  • 11
  • 17
5
votes
3 answers

Is there a downside to this Mercurial workflow: named branch "dead" head?

I love the flexibility of named branches but I have some concerns about the prolifieration of heads. Even when the branch is closed, it still shows up in the heads. I have an idea for how to clean up the output from "hg heads" My question to the…
Mark Borgerding
  • 8,117
  • 4
  • 30
  • 51
5
votes
1 answer

Removing multiple named list components in within()

I am trying to remove a named component from a list, using within and rm. This works for a single component, but not for two or more. I am completely befuddled. For example - this works aa = list(a = 1:3, b = 2:5, cc = 1:5) within(aa, {rm(a)}) the…
martin
  • 51
  • 1
5
votes
1 answer

Routes configuration for named arguments in CakePHP

In my Cake application I have a controller "completed_projects". Its index action takes no arguments and lists some projects. Different pages can be accessed by example.com/completed_projects/index/page:23 etc. I want to make the url's like…
Muhammad Yasir
  • 646
  • 1
  • 4
  • 18
1 2
3
26 27