Need to calculate a very specific number (Don’t know what it would be called!)

Ok so I’m making a short little game, and need to calculate a value. Basically you have x amount of guesses to guess the number the computer chooses. The user gets to define the bounds however, so I would like to make the ‘lives’ so to speak semi-equal and balanced whether you pick the bounds as 0-100, or 0-10000.

I have no clue how to calculate this, but it doesn’t have to be exact, just a rough estimate because this is just a short little project for me and my friend and isn’t going anywhere. If I need to create seperate cases too, I am able to do that, as this is code. For example,

if(bounds > 1000)     -run this calculation if(bounds < 1000)     -run this other calculation 

I tried doing some simple stuff, but like if I have 17, 18 guesses to guess a number between 0-1000, I have 1 guess to guess a number between 0 – 100 thanks guys!

Python program to know who wins a tic-tac-toe game

Given an input where we have two players: “X” and “O”, and empty cells marked with a “.” like:

check_winner([ “X.O”, “XX.”, “XOO”])

the program outputs if there are three “X” or “O” in horizontal, vertical or diagonal. If there is a draw it outputs “D”.

expected results

def check_winner(game_result: List[str]) -> str:      for i, row in enumerate(game_result):         if game_result[i][0] == game_result[i][1] == game_result[i][2]:             if game_result[i][0] != ".":                 return game_result[i][0]         if game_result[0][i] == game_result[1][i] == game_result[2][i]:             if game_result[0][i] != ".":                 return game_result[0][i]      if game_result[0][0] == game_result[1][1] == game_result[2][2]:         if game_result[1][1] != ".":             return game_result[1][1]      if game_result[0][2] == game_result[1][1] == game_result[2][0]:         if game_result[1][1] != ".":             return game_result[1][1]      return "D" 

How could we improve this code?

Oauth2/OIDC: I know the address of a resource server, is there a standard for querying which authorization servers it accepts?

I have a bunch of what are essentially IOT devices that will authenticate connections using oauth 2 tokens and/or openid connect (depending on use-case). Each IOT device is individually configurable with one or more authorization servers (ie. each has a client-id/client-secret with one or more auth servers).

My problem is that, given the URI/address of the IOT device, is there an RFC or standard for determining the address(es) of authorization servers that IOT device trusts?

I am going to build a console-like application that will need to be able to connect to many (thousands) of these devices. I control the code on the IOT device and can build something proprietary in, but I’m trying to follow relevant RFCs, where applicable. I have thus far found no specification for querying a resource server to determine the configured authorization servers.

how to know in which folder my file is

How can i Know, using my item metadatas, the folder it is stored in? For example, I do this Get Request :

https://sharepoint.com/sites/SPSample/_api/web/lists/GetByTitle('Documents')/items(2)/fieldvaluesastext 

Do you know any fields in the result which can lead me to the previous folders? Except the “FileRef’

Thanks by advance,

How do I know if an ability is magical?

There is often confusion when the anti magic field spell is used, armor of invulnerability is worn, or the Beholder’s anti-magic ray is employed, whether a given character’s ability will still function. The spell does give you some guidelines on how to adjudicate the effects of the loss of magic, but says very little about how to determine what is affected. In short, how do I tell if an ability is magical?

I installed ELK on my server, but I do not know used some documentation commands

I installed ELK on my server, but I do not know used some documentation commands.

I installed ELK 7.1 on Ubuntu 18.04 :

$   wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - $   echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list 

In the documentation there are commands to generate the SSL certificate. But it does not work for Ubuntu 18.04 :

https://www.elastic.co/guide/en/elasticsearch/reference/current/certutil.html

bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass "" 

What is the equivalent for my installation ?

I got a Wiko Sunny 3 from my uncle, I don’t have the Google accounts info and don’t know the password pin to unlock it

I have tried to reset it by accessing recovery mode and then hitting the wipe data/factory reset option, but as after rebooting it i found out that it has Factory Reset Protection, so even if I reset it, it still asks for the last password pin to unlock it or the google account synced to it, which I don’t have… What should I do? P.s. My uncle has bought the phone in another country.