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
99
votes
9 answers

Return a "NULL" object if search result not found

I'm pretty new to C++ so I tend to design with a lot of Java-isms while I'm learning. Anyway, in Java, if I had class with a 'search' method that would return an object T from a Collection< T > that matched a specific parameter, I would return that…
aduric
  • 2,812
  • 3
  • 22
  • 16
23
votes
3 answers

What's the difference between a sentinel and an end iterator?

While reading Eric Niebler's range proposal, I've come across the term sentinel as replacement for the end iterator. I'm having a difficult time understanding the benefits of sentinel over an end iterator. Could someone provide a clear example of…
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
18
votes
3 answers

How can I set up a connection to Redis Sentinel using Jedis library?

How do I set up a connection to a Redis Sentinel server/cluster using the Jedis library?
ERNESTO ARROYO RON
  • 992
  • 1
  • 9
  • 22
12
votes
1 answer

How can you disable protected mode in Redis 3.2.6 Sentinel?

I have attempted everything recommended by the following error message: (error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this…
pestilence669
  • 5,698
  • 1
  • 23
  • 35
12
votes
4 answers

Redis failover with StackExchange / Sentinel from C#

We're currently using Redis 2.8.4 and StackExchange.Redis (and loving it) but don't have any sort of protection against hardware failures etc at the moment. I'm trying to get the solution working whereby we have master/slaves and sentinel monitoring…
Paul
  • 243
  • 1
  • 2
  • 10
10
votes
3 answers

Sentinel object and its applications?

I know in python the builtin object() returns a sentinel object. I'm curious to what it is, but mainly its applications.
AhToyMaker
  • 119
  • 1
  • 6
10
votes
1 answer

How to tell a Client where the new Redis master is using Sentinel

Ok, I feel like I'm missing some crucial piece of information. Locally I have 1 master and 1 slave redis server running on different ports http://redis.io/topics/sentinel I also have 3 sentinels and they all appear to be aware of each other and…
Derek Organ
  • 8,323
  • 17
  • 56
  • 75
9
votes
2 answers

How to create a variadic function with custom sentinel value?

The documentation on gnu's C states that if function has __attribute__((sentinel)) it must have NULL as a last argument to the function. Is it possible to have any other value as marker for ending the argument list?
Eimantas
  • 48,927
  • 17
  • 132
  • 168
9
votes
1 answer

Why aren't bound instance methods in python reference equal?

>>> class foo(object): ... def test(s): ... pass ... >>> a=foo() >>> a.test is a.test False >>> print a.test > >>> print a.test
Alex Roper
  • 91
  • 1
8
votes
6 answers

How to log exceptions with network targets in NLog

I am using the NLog logging framework and am trying to get exception and stacktrace information showing up in any UDP logger appliaction, such as Sentinel and Log2Console, but can only get the log message part displayed. Outputting to a file works…
angularsen
  • 8,160
  • 1
  • 69
  • 83
8
votes
3 answers

What are sentinel in C language? I was learning Merge sort and came across using sentinel as infinity in the merge step

I was learning Merge sort and came across using sentinel as infinity in the merge step. Here is the algorithm from the Cormen's book. Why we have used infinity in step 8 and 9??? MERGE(A, p, q, r) 1 n1 ← q − p + 1 2 n2 ← r − q 3 create arrays L[1…
zedai
  • 523
  • 2
  • 6
  • 11
8
votes
5 answers

Add numbers and exit with a sentinel

My assignment is to add up a series of numbers using a loop, and that loop requires the sentinel value of 0 for it to stop. It should then display the total numbers added. So far, my code is: total = 0 print("Enter a number or 0 to quit: ") while…
Baroness Sledjoys
  • 121
  • 1
  • 4
  • 9
8
votes
2 answers

How to do a redis FLUSHALL without initiating a sentinel failover?

We have a redis configuration with two redis servers. We also have 3 sentinels to monitor the two instances and initiate a fail over when needed. We currently have a process where we periodically have to do a FLUSHALL on the redis server. This is a…
jakejgordon
  • 4,008
  • 7
  • 36
  • 45
8
votes
2 answers

Create dummy object of non-default-constructible class

tl;dr: I want to construct a class ListEntry containing a member of a generic type Value, but Value is not default constructible and ListEntry doesn't know how to construct it. I will never access this Value member, so it doesn't matter that it…
Heinzi
  • 5,793
  • 4
  • 40
  • 69
6
votes
2 answers

How to get chunks of elements from a queue?

I have a queue from which I need to get chunks of 10 entries and put them in a list, which is then processed further. The code below works (the "processed further" is, in the example, just print the list out). import multiprocessing # this is an…
WoJ
  • 27,165
  • 48
  • 180
  • 345
1
2 3
27 28