31,529 questions
2 votes
1 answer
39 views
Storing store time of day ranges where timezone matters
I need to store some store hours that exist in different time zones and may be interacted with in different timezones through an admin portal where it will display store time and local time. I know ...
Advice
0 votes
4 replies
148 views
Why is my O(nlogn) solution faster than the O(n) solution
here is my solution to the leetcode "longest consecutive sequence" problem: class Solution: def longestConsecutive(self, nums: List[int]) -> int: if len(nums) == 0: ...
-1 votes
0 answers
49 views
How to set up time in a table on SQL [duplicate]
This one is a bit of a double question, I am creating a database for an assignment on SQL. I'm making some tables, the code for the two I need help with listed below. For my bookings table, I need the ...
9 votes
2 answers
679 views
Using Chrono, how can I get millisecond precision?
C++, using <chrono>, I would like to get a value formatted as <seconds>.<milliseconds>. I am using system_clock and get the current seconds as: auto secs = duration_cast<seconds&...
1 vote
1 answer
186 views
How can I create a `onClick` event for the timer in the events section?
The program I am using has a small section for programming which is almost similar to the Delphi programming language. In the components section, there is no timer and I want to create it myself. {$...
1 vote
1 answer
65 views
modpost GPL error using ktime_* - what to use instead?
I'm building a non-GPL kernel module (non-negotiable) and in order to get timing information everywhere I look here and elsewhere tells me to use the new ktime_* API, but when I build I get this error:...
0 votes
1 answer
127 views
Import timestamp from Rstudio to Snowflake changes timezone
I'm exporting some data from Snowflake to Rstudio and do some data processing. After that I write the data back to Snowflake. The problem is that somehow the timestamp initiale from Snowflake is ...
0 votes
0 answers
37 views
Engine.update not advancing simulation ( having trouble with deltaTime )
so i am trying to run a matter instance in a worker thread. Im running it with my own loop as shown below. However I'm experiencing trouble with game pacing. Before getting to the explanation here is ...
1 vote
1 answer
55 views
Identifying and summing time values across a row in Google Sheets
I am creating an activity tracker in Google Sheets: In column B, I want to be able to track the total time doing activity ("Ac.") B. So I want to be able to sum the difference between (in ...
-3 votes
1 answer
66 views
Pause loop to make a certain action then continue where you left off inside of it
import pyautogui import time def RunD(Down, Up): #Up is the parameter that creates the delay pyautogui.keyDown('d') pyautogui.mouseDown(button='left') time.sleep(Down) pyautogui.keyUp('...
1 vote
3 answers
195 views
Reducing Latency in Pixel Scanning for Input Simulation
I am developing a Python script to pass a challenging minigame in a single-player title. My goal is to unlock a specific achievement within this game, a task I've spent over 10 hours attempting ...
0 votes
0 answers
64 views
What is the fastest way to compute a filter in Fourier space?
I am currently working on a beam propagation code. The code basically consists of a transversal profile (a 2000x2000 array) which is propagated a small distance, then has its borders filtered, then ...
0 votes
1 answer
64 views
How in python can I transform negative secs into struct time? [duplicate]
I'd like to transform -238204800 seconds to "1962:06:15 00:00:00", using python 3.8. My code is : from time import strftime, localtime secs = -238204800 print(strftime("%Y:%m:%d %H:%M:%...
0 votes
1 answer
182 views
Why can consecutive calls to perf_counter_ns on windows return the same number?
Using the below code I would have assumed so see cnt be close to 0, but on Windows I see only values above 500,000. from time import * def test_time(f, c): cnt = 0 for i in range(c): ...
1 vote
2 answers
451 views
How to make a mock for time.Now() in Go unit test
I have been reading various ways of making a mock for time.Now() and try to make the unit test. Let's say we have a Customer struct. type Customer struct { Name string CreatedDate sql....