algorithms – How to close an open polygonal chain in clock- or counterclockwise direction?

I have an algorithmic problem that I am hoping someone can help me out with:

Given: 3D triangle surface mesh, an open polygonal chain (blue).

Wanted: A line that closes the blue line in clockwise direction (green).

The green line provides a correct solution, the red line a wrong solution. Using a shortest path algorithm, the result will be randomly oriented depending on the mesh. How can I guarantuee that the resulting closed polygon is in clockwise direction, i.e. I always get the green line as a result? The direction of the blue line cannot be changed.

Many thanks in advance!

Edit: This is a different question that gave me an idea: https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order. Maybe it is possible to calculate (x2 − x1)(y2 + y1) for each edge and give penalties for edges where this is > 0 or < 0?

Problem description

Clock in sheet time range

Can someone please help with this tried to get time from a range closest 5 minutes:

=IF(NOW()-TODAY()<$J6:$J6,IF(NOW()-TODAY()>$J258,$J258,VLOOKUP(NOW()-TODAY(),IN,1)))

Range is from 06:00 am – 03:00 am, for some reason I can’t get this to work.

ntp – ntpd does not sync clock if it gets internet connection little late

In our production box, I am a facing a problem with ntpd. I am enabling the NTP feature for our production box and observing one isssue.

We start the ntpd daemon in the initialization process of our box. During that time internet connection is not there. Below is my small ntp.conf file

driftfile  /etc/ntp.drift
logconfig =syncstatus
server pool.ntp.org iburst

Our box get internet connectivity little late once the interface comes up. That time I see that ntpd does not sync the clock. When I do ntpq -c as , I get no association id's found. I did wait for almost 30 min but still got no association id's found

I have to restart the ntpd. After restarting it, ntpd syncs the clock and everything works normally.
But again if I reboot my box then same issue happens. Again I have to restart ntpd, once box comes up and internet is reachable.

Did any one faced similar kind of problem?

Should I delay start of ntpd till the time interface comes up?

Update

I did some more experiment and I replaced server pool.ntp.org iburst with pool pool.ntp.org iburst and with this change ntpd sync the clock automatically. I didn’t have to restart the ntpd. So here arises another question to me.

What happened when I replaced server with pool?

Should I always use pool keyword instead of server?

When should I use pool and when should I use server?

I did some research and found that
pool is the same as server, except it resolves one name into several addresses and uses them all
if they are doing same thing then why server pool.ntp.org iburst didn’t worked for me but pool pool.ntp.org iburst worked.

big sur – Can you change the default clock format?

big sur – Can you change the default clock format? – Ask Different

authentication – ntpd -g does not sync the clock

From ntpd man page

If time is more than 1000s from the server time, ntpd assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. This causes ntpd to exit with a panic message to the system log. The -g option overrides this check and the clock will be set to the server time regardless of the chip time.

I have done small experiment to test -g option with ntpd. First I changed the system clock time to some old time with date command.

date -s 2021.06.15-19:10:21

After that I created small /etc/ntp.conf file with below information

driftfile  /etc/ntp.drift
logconfig =syncstatus
server time.google.com minpoll 3 maxpoll 4

After that I ran ntpd with below command

ntpd -g -n -4 -c /etc/ntp.conf &

Please note that my ntp.drift file was empty.

I see no change in the system time , infact ntp status shows that clock is not synchronized.

GW:/# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
  ==============================================================================
    time2.google.co .GOOG.           1 u    -   64    1    0.000   +0.000   0.000


Clock is not synchronized, stratum 16, reference is INIT
frequency is +0.000 Hz, precision is -19
reference time is (no time),
clock offset is +0.000000 msec, root delay is 0.000 msec
root dispersion is N/A

Can someone please help me. Did I missed any configuration or some other data.

Apart from this I have one small question

Does ntp clock need to be synchronised for ntp authentication?
If ntp clock is not synchronised then in that case will ntp server authentication pass.

game design – Turn-based grid movement – each click of the clock you want to move the player

I am working one the movement for a tactical turn-based pygame.
I’m stumped as to how to get a selected object to move one tile at a time up to it’s max movement to the mouse’s pos.
Right now this is what I have. I’m not sure how to proceed.

def move_toward(self, new_location):
def do_calculations():
# ... code ...
return dx, dy
# ----
# you have the current x,y for the player.
# each click of the clock you want to move the player
# closer to the end location.
delta = .01 # or whatever
# get <delta> amount closer to the end corrds. <-- do this each tick of the clock.
new_x, new_y = do_calculations()
self.move(dx=new_x, dy=new_y)

Sprites.py

import pygame as pg
from settings import *

class Player(pg.sprite.Sprite):
    def __init__(self, game, x, y):
        self.groups = game.all_sprites
        pg.sprite.Sprite.__init__(self, self.groups)
        self.game = game
        self.image = pg.Surface((TILESIZE, TILESIZE))
        self.image.fill(YELLOW)
        self.rect = self.image.get_rect()
        self.x = x
        self.y = y

    def move(self, dx=0, dy=0):
        if not self.collide_with_walls(dx, dy):
            self.x = dx
            self.y = dy
            self.rect = self.rect.move(dx * TILESIZE, dy * TILESIZE)

main.py

    def events(self):
    # catch all events here
    for event in pg.event.get():
        if event.type == pg.QUIT:
            self.quit()
        if event.type == pg.KEYDOWN:
            if event.key == pg.K_ESCAPE:
                self.quit()
        if event.type == pg.MOUSEBUTTONDOWN:
            x = pg.mouse.get_pos()(0) // TILESIZE
            y = pg.mouse.get_pos()(1) // TILESIZE
            print(x, y)

            self.player.move(dx=x, dy=y)

tkinter – digital clock python

while learning about python tkinter, I decided to make a digital clock:

from datetime import datetime
import tkinter as tk
from threading import Thread
import time


class clock():
     def __init__(self):
          self.display = tk.Tk()
     def start(self):
          def get():
               self.display.geometry("215x62")
               self.display.title("Clock")
               while True:
                    try:
                         now = datetime.now()
                         current_time = now.strftime("%H:%M %p") 
                         lbl = tk.Label(self.display, text=str(current_time),
                         background = 'black', font = ("Helvetica", 37),
                         foreground = 'red')
                         lbl.place(x=0, y=0)
                         time.sleep(0.1)
                    except:
                         break
          receive_thread = Thread(target=get)
          receive_thread.start()
          self.display.mainloop()
clock = clock()
clock.start()

Is there any way to make this clock better?

Any comments, answers, or steps in the right direction would be appreciated.

clock – Prevent Screen Wake / Activity from Android Timer

I’ve got an android timer running through the base clock in android 11 (oneplus 7t).

Every few minutes it lights up the screen to let me know the progress of the timer. This is the most useless and dumb features I’ve seen in a long time. I cannot find any way to turn it off.

To reproduce, go into clock > timer > set one for say thirty minutes. Lock screen. Watch screen illuminate and wake in a process of infinite stupid.

Please help, this is annoying as all hell. I need to have my screen visible in case I receive an important message etc, but I don’t want this thing stealing my attention every few minutes.

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies