Questions tagged [sentinel]

A sentinel is a loop exit value or list delimiter whose value is outside the range of valid input, such as -1 for a zero-based array index, or ~ for alphabetic strings.

410 questions
1
vote
2 answers

Is there an iter which accepts a complex sentinel?

I use iter with two arguments and was wondering if there is an equivalent which would accept a more complex sentinel? As an example, in the code below # returns digits 1 to 10 upon subsequently calling .create(), # then returns 'END' each time…
WoJ
  • 27,165
  • 48
  • 180
  • 345
1
vote
1 answer

Python sentinel in C++ extension

I'm working on a Python extension module written in C++. According to the Python documentation the module method table should be written like this: static PyMethodDef SpamMethods[] = { ... {"system", spam_system, METH_VARARGS, "Execute…
Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240
1
vote
2 answers

Sentinel value at the end of a file?

I read in the contents of my File likewise: List list = new ArrayList(); Scanner scanner = new Scanner(new FileInputStream(file)); while( scanner.hasNextLine()) { list.add(scanner.nextLine()); } At the EOF I want to send the String "@@@"…
Beginner
  • 143
  • 2
  • 4
  • 11
1
vote
2 answers

How do I create an array that consists of elements that I previously input?

I wrote a sentinel-controlled C++ program in which you have to input a set of names. There is no limit to how many names you can input. When you are done inputting the names, you just type "1" to quit. Here is my code: #include #include…
droman07
  • 127
  • 1
  • 8
1
vote
1 answer

ServiceStack.Redis.Sentinel Usage

I'm running a licensed version of ServiceStack and trying to get a sentinel cluster setup on Google Cloud Compute. The cluster is basically GCE's click-to-deploy redis solution - 3 servers. Here is the code i'm using to initialize... var hosts =…
1
vote
0 answers

Static class variable in template class considered template

I have a static variable, nil, which acts as a sentinel for template Tree. I am augmenting my trees by specializing on the Node type. However, I'm having trouble constructing the nils. Nil as static member of Tree Inside…
LemonPi
  • 1,026
  • 9
  • 22
1
vote
1 answer

Cartalyst Sentinel Laravel - How do you create roles?

Im new to Cartalyst Sentinel and this concept of ACL. I've managed to create a user, perform activation and login and logout. I'd like to take my learning to the next level. I would like 2 types of Users on this laravel app. 1 is Administrator…
arkhamDev
  • 1,028
  • 1
  • 15
  • 32
1
vote
1 answer

Class sentinel.groups does not exist

After I made a composer update, I get this error: Class sentinel.groups does not exist Any suggestions? Using: Laravel with Cartalyst Platform and Sentinel. If you need to see some code, let me know. Removing cartalyst/sentinel (dev-master…
Tordy
  • 11
  • 2
1
vote
1 answer

Does Spring Data Redis (1.3.2.RELEASE) support JedisSentinelPool of jedis?

Does Spring Data Redis (1.3.2.RELEASE) support JedisSentinelPool of jedis? Maybe it doesn't support,who will give me an answer? If it doesn't support,how should I do?
Oliver.Liu
  • 33
  • 3
1
vote
1 answer

Gnumake atomic rules using sentinel file failing

I have been trying to use John Graham-Cumming's excellent article about "Atomic Rules in GNU Make" at http://www.cmcrossroads.com/article/atomic-rules-gnu-make?page=0%2C0 However, I sometimes have to specify a dependency between two files using a…
tvarga
  • 11
  • 3
1
vote
1 answer

Acceptable to use custom exceptions as sentinel values?

Consider a case in Python where one uses getattr to either dynamically fetch a method or a value. def message(obj, msg, *args, **kwargs): result = getattr(obj, msg, None) if result is not None: try: return result(*args,…
user890167
1
vote
2 answers

Missing sentinel at method dispatch although nil is present in argument list

I want to create a UIActionSheet but I always get a warning about a "missing sentinel": /Users/....mm:136:173: warning: missing sentinel in method dispatch [-Wsentinel] UIActionSheet* adsl_action_sheet = [[[UIActionSheet alloc] initWithTitle:nil …
manuelwaldner
  • 551
  • 1
  • 5
  • 24
1
vote
4 answers

Sentinel Loop Python

How should I set up a sentinel loop in python where the loop keeps running only if the new inputed number is greater than the old inputed number? This is what I have right now, but I know it's not right. totalScore = 0 loopCounter = 0 …
user3254943
  • 21
  • 1
  • 3
1
vote
2 answers

Pre or Post test loop?

I am trying to figure out whether a pre or post test loop would be the best method so that the user can continue to input values that will be searched for, until a sentinel value is entered to end the program. Also, what would my parameters look…
Allexey
  • 33
  • 1
  • 9
1
vote
3 answers

C++ The data type for a sentinel value is always a boolean? True or false?

just started an introductory C++ course. I have a query as below. The data type for a sentinel value is always a boolean? True or false?
Skippygirl
  • 11
  • 2