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
1 answer

What does the sentinel value NULL mean in Android Developer JSONObject reference page

What does the sentinel value NULL mean in Android Developer JSONObject reference page, cited here for convenience: Warning: this class represents null in two incompatible ways: the standard Java null reference, and the sentinel value NULL. In…
George
  • 3,384
  • 5
  • 40
  • 64
1
vote
5 answers

How to output the decimal in average?

I have a problem in showing the decimals on the average. It keeps showing .00 or .1. I tried to put it in double, but I still get the same results.Also, I want to include the first integer that I input to the sum, but I have no idea how.Please help:…
eLg
  • 519
  • 4
  • 11
  • 25
1
vote
2 answers

Loop program issue

For a program I am attempting to write, I must create a program that asks the user to enter a number and calculate the total of all the numbers entered until the user enters a -1 to stop the loop. However, I cannot print the -1 or add it to the…
1
vote
1 answer

A sentinel control loop and how to print out multiple strings. Beginner java programming

I have this code that determines the deductible and payout in case of a earthquake based on the Richter scale value entered by the user. Here is what my code currently looks like. import java.util.Scanner; public class RichterScaleDamage { …
ShiftyMcGrifty
  • 25
  • 1
  • 1
  • 6
1
vote
4 answers

C programming: how do I terminate the program after the user enters a sentinel value?

so I first #define SENTINEL -1 and in a certain function, I set up an if statement void blahblah(blah) { printf("Enter an integer (-1 to quit)"); scanf("%d", &value); if (value == SENTINEL) return; } but for some reason it's not…
iopeia
  • 11
  • 1
  • 2
1
vote
2 answers

Can constant objects with static storage duration and equal, constant initializers be coalesced?

Consider two objects with static storage duration and equal, constant initializers: static const int a = 50; static const int b = 50; Is it valid for a compiler to combine these such that &a == &b? (For context, I was thinking of using static…
icktoofay
  • 126,289
  • 21
  • 250
  • 231
1
vote
2 answers

C++ Linked List - Reading data from a file with a sentinel

So I've done quite a bit of research on this and can't get my output to work correctly. I need to read in data from a file and have it stored into a Linked List. The while loop used should stop once it hits the $$$$$ sentinel. Then I am to…
Nick
  • 662
  • 2
  • 7
  • 21
0
votes
1 answer

Exercise from Visual Studio C# 2010 fourth edition

I've working on a C# application that is supposed to input miles driven and gallons used(integers) for each tankful of gas and then the application should calculate and display the miles per gallon obtained for each tankful and display combined…
Rodney Davis
  • 1
  • 1
  • 3
0
votes
2 answers

How do we break the loop without adding the sentinel to the average?

As the code stands now, the sentinel is being included in the calculation for the average. Any pointers on how to break the loop without including the sentinel? #include using namespace std; int main () { int…
zeheroe
  • 13
  • 4
0
votes
1 answer

What is wrong with this contains(T entry) method? Java. Linked List

I'm making a linked list class and am trying to implement this contains() method. I have head and tail sentinel nodes, so I have the loop start at head.next. length is the size of the list. Bout all I can give you guys :O public boolean…
Tim
  • 284
  • 1
  • 4
  • 20
0
votes
0 answers

Redis cli auth times out for redis sentinel

I'm having a problem with Redis Sentinel. I deployed on my Kubernetes environment the Redis HA mode with Sentinel offered by bitnami. Up until a few days ago everything was working fine and I could connect to both sentinel container and redis. Since…
0
votes
0 answers

KQL for detecting 'add group' and then subsequent ' add member to group'

I am fairly early on in my KQL journey and I have set myself a task. I want to create a query that detects when a new group is created and then a new user is added to said group. I can get the info I want for each operation easily but how to combine…
DB67
  • 1
0
votes
1 answer

Encountered 'failover-abort-slave-timeout' error while using Redis Sentinel

I am currently setting up Redis Sentinel and facing an issue where the slave node is not being promoted to the master node as expected. I am conducting tests on a single server and have structured it as follows, distinguishing them by ports: 7001:…
Joonseo Lee
  • 458
  • 2
  • 6
  • 12
0
votes
0 answers

Darktrace analytics rules on Sentinel

I am trying to customize and to create workbooks for Darktrace on Sentinel. I am using the data type darktrace_model_alerts_CL. For AI Analyst event type I am using the following KQL query. darktrace_model_alerts_CL | where dtProduct_s =="AI…
MKH_Cerbebrus
  • 51
  • 2
  • 10
0
votes
0 answers

NativeSession::startSession taking more time in laravel - Sentinel

As per new relic data NativeSession::startSession taking almost 80% of time ( 6sec) in Laravel some times /** * Starts the session if it does not exist. * * @return void */ protected function startSession() { // Check that the session hasn't…
SteDS
  • 1
  • 2