Does the accuracy of sleep() (Python) worsen with long periods? Ask Programming |
- Does the accuracy of sleep() (Python) worsen with long periods?
- C++ vs Java (details inside)
- OOP and Functional
- I want to code again
- Is there no code or low code software/app/whatever available to create an interactive image similar to this...
- How to really know whether I'm right without test cases? Absolute c++ 6th programming projects
- "new stored procedure" option not found in SSMS
- I need help finding Coordinates on my screen
- What is the name of the concept in programming when you change a variable, this automatically update the screen ? EX: <span>@MyVar</span>
- Why is my Axios data coming back as undefined/NaN when res.render is placed into my express server? The information is undefined despite showing up in the console logs(i've been console logging each step along the way) what is it about res.render that makes everything go wrong?
- What is a good working Instagram endpoint to retrieve the latest photos?
- [C] trying to find GCD of two elements from different arrays
- Are Android Java skills transferrable?
- Password Displays on the Input's Value Attribute | No Big Deal or Cause for Concern?
- Hardware Windows vs iOS (Student)
- Template/cheat sheet ideas?
- SAT-style MCQ correction with Computer Vision
- What is the best tactic for handling non-programmer interviewers?
- [R] Front-end for ggplot within RStudio?
- I am having Septum Nose Piercing , Does it affect my job?
- 4-year old Python script Help
Does the accuracy of sleep() (Python) worsen with long periods? Posted: 07 Mar 2021 05:13 PM PST Hi. I have written a very simple Python script that runs on a Raspberry Pi reading a thermometer chip every minute and logging the reading to a file. Nothing more for now, I'll build more on top of it later. The "every minute" part, for now, is done by a simple sleep(60) in the loop. I wondered how accurate that would be, so I arranged for the time difference between every line and the starting point to be written to file. I noticed that it loses about one second every 1000, more than a minute per day. I know that sleep() is not super accurate because it depends on the scheduler, but there are only about 15 minutes in 1000 seconds, so every sleep() call seems to be late by more that 60 milliseconds. The script is a dozen lines long and it certainly doesn't take 50 ms per iteration... is this to be expected? To make this more stable (I would like it to run for weeks on end) I suppose I could use signal.alarm() and set a new alarm at every cycle? [link] [comments] |
Posted: 07 Mar 2021 05:42 PM PST I have a project in mind and I'm not sure how to do it. Basically, it's a program that has a GUI with basically one text area, one text field and one button. You type something in the text field, click the button, the program does its calculations and show something on the text area. The actual logic isn't a problem for me, but I'm not sure if I should go for C++ or Java. I know this type of question usually boils down to personal preference but I will try to explain from my point of view. So, I actually started already creating the program in C++ and the GUI using win32. I know win32 is old and all that, but I actually didn't mind using it (I mean, I like OpenGL so win32 isn't that scary). But my main problem with win32 started when I tried to see how I could make so the elements of a window automatically adjust to a window resize. After seeing many "can't be done", I found a blog post that apparently had a solution (didn't try but it looked like what I needed). But that was when I started remembering about Java and the Swing library. It has been some time since I've actually done anything in Java but it should be easy enough. I actually really like creating GUIs with Swing, and the layouts solve any problem with window resizing. As a bonus, my program works in both Linux and Windows. The only downside is that, to be honest, Swing GUIs look like trash. So, my options are:
I'm honestly kinda leaning to Java right now, but accept any input. [link] [comments] |
Posted: 07 Mar 2021 08:57 PM PST I am currently learning C# as my first language and while studying about object oriented programming I came across procedural and functional paradigms so I was wondering is it good to know all the families like at least a language in each family or to focus on OOP. My goal is to become a developer of security applications [link] [comments] |
Posted: 07 Mar 2021 08:26 PM PST I graduated on 2010 as a Computer System Engineer, I've been working since then in the IT department of a Bank, but I barely code since 5 years ago. I'd really like to code again but I don't know what would be interesting to code. What would you suggest? [link] [comments] |
Posted: 07 Mar 2021 07:53 PM PST Hey all, I want to create an interactive image similar to the one in the link below. Ie. Information on hover, however when a section of the image is clicked I want to be directed to another interactive image where there is further information etc. This may be very simple or very hard, I really have no clue as this is my first time attempting to create something like this so any information at all is really appreciated. Here is the reference https://www.preethamrn.com/pokemondens/ [link] [comments] |
How to really know whether I'm right without test cases? Absolute c++ 6th programming projects Posted: 07 Mar 2021 06:59 PM PST chapter 1 6
[link] [comments] |
"new stored procedure" option not found in SSMS Posted: 07 Mar 2021 10:03 PM PST I am trying to use the current versions of SQL Server Management Studio. I'm following the https://msdn.microsoft.com/en-us/library/ms345415.aspx guideline. When I get to step 3 and right-click on "Stored Procedures" the popup menu I am presented with does not include the "New Stored Procedure" option. Instead, at the top of the list of options that are presented is the option "Stored procedure…" [link] [comments] |
I need help finding Coordinates on my screen Posted: 07 Mar 2021 09:31 PM PST For my next python project I need to be able to reliability find the coordinates of different objects on my windows screen. I was wondering if there is a way to do this easily. [link] [comments] |
Posted: 07 Mar 2021 03:08 AM PST In the past, to update a text inside a <span> markup, used to be necessary something like document.getElementById("myspan").textContent="hello"; With modern libraries and frameworks, we are capable to put variables inside the html and when you change the variable, this will automatically display a different data. Example: <span>@MyVar</span> //Initial Value ...buttonClick() : MyVar="Not Hello anymore"; So, you will see on the screen the word Hello and a button. When you click on it, Hello will be replaced by Not Hello Anymore. What is the name of this concept where when you change the value of a variable tied to a html templace, this update the view automatically ? I though it was Reactive Programming, but after read about it...Looks like it's not the case. [link] [comments] |
Posted: 07 Mar 2021 10:57 AM PST trivias.get('/:topic/:num', isAuthenticated, (req, res) => { [link] [comments] |
What is a good working Instagram endpoint to retrieve the latest photos? Posted: 07 Mar 2021 05:10 PM PST Before I get answers, I want to say that I have tried using this endpoint to retrieve the account id: 'https://www.instagram.com/web/search/topsearch/?context=blended&query=<insert account name here>' and then use this endpoint to retrieve my data with the id from the previous endpoint: this method was working but I now get this error: I have also tried: https://www.instagram.com/<insert account name here>/?__a=1 I just want to fetch the latest 8 images and display them to the public on my site, what is the best solution for this? I am React to build this. [link] [comments] |
[C] trying to find GCD of two elements from different arrays Posted: 07 Mar 2021 10:56 AM PST Hello reddit, i'm quite new to c programming and yet i have a task which i cannot complete. I have to write a c program which will import data from txt file, put that data into array, split the array in half and then find gcd of between elements in those two arrays and save the results into another txt file. So far i managed to implement almost everything from that list, but still the gcd function spits weird results. Here's the code:
After i run this code gcd function gives just the numbers taken from array 'n2' and i have no idea why. Any ideas? Edit: Forgot to mention that the data set in rng.txt isn't totally random, I generated numbers from 1-10k and then shuffled them, so there aren't any 0 or negative numbers, also numbers don't repeat. [link] [comments] |
Are Android Java skills transferrable? Posted: 07 Mar 2021 10:31 AM PST I'm trying to code Android apps in Java hoping this would also make me easier to land another Java related job. Otherwise maybe I should just do it with Kotlin which they say is less of a hassle than Java [link] [comments] |
Password Displays on the Input's Value Attribute | No Big Deal or Cause for Concern? Posted: 07 Mar 2021 04:31 AM PST I was peeking under the hood at the DOM inspector for different websites for which I have saved my login credentials. I noticed that on the password input for most of the websites, the value attribute is set to an empty string. One website, however, showed the password input's value attribute as my actual password. For example:
I was concerned that this is a security issue with the website -- does this indicate that the webpage is storing passwords in plaintext, or is this a non-issue/related to how my browser is rendering the page on the client side-only? Thanks for any insight! EDIT: Their website uses React. Is there a best practice for a situation like this -- to auto fill the password field without setting the value prop? [link] [comments] |
Hardware Windows vs iOS (Student) Posted: 07 Mar 2021 06:07 AM PST Hey guys, I'm contemplating quite a bit. I'm a computer science student, I need to purchase a laptop purely for educational purpose. Most of the programming is being done in a windows environment. We're mostly programming in C languages. I'm thinking about the new XPS 13 or the M1 MacBook Air both with 16GB ram and a minimum of 512 GB SSD. What's your take on it? Any other propositions? Thanks in advance for your help. [link] [comments] |
Posted: 07 Mar 2021 09:22 AM PST So I've been learning to code lately (html, css, javascript) kind of all at the same time. As an aide to learning, what would you guys think of a "cheat sheet" of sorts? So if I create an html page and want to add css to it, I need help targeting what I need to do. Do you guys do anything like this when learning a new language? I struggle with knowing what I need to do to accomplish what I'm trying for. I'm more comfortable with typing the code than I am making sense of what I need to do. Sorry of this makes no sense I'm struggling to explain. Think of it like not knowing computers and needing to tear it apart and put back together. A list of what you need to do, in order, makes me much more efficient. Anyone else do anything like this or have any ideas of how I could create something like this? [link] [comments] |
SAT-style MCQ correction with Computer Vision Posted: 07 Mar 2021 08:32 AM PST I would like to create a program that can get the selected answers from SAT-style MCQ sheets (every answer or number is a filled circle). I was impressed by how the correction of the SAT can be automated (and probably already is), and I think it'd make a fun project. I'm not familiar at all with Computer Vision. Does this involve ML modules? In what language should I do this (Usually code in TS, I'm ok with Python)? Do you have any resources to recommend? Open source repos that do a similar job? Thank you. [link] [comments] |
What is the best tactic for handling non-programmer interviewers? Posted: 07 Mar 2021 12:07 PM PST When another dev is interviewing me I just act myself and we relate well and he/she can see I know my stuff and am capable of doing the job. That's no problem. When the interviewer is a non-programmer. Holy crap! I get dismissed over nonsense like my previous client wanting ads on his website. I'm just thinking to myself "Seriously? You want to dismiss me over THAT?" [link] [comments] |
[R] Front-end for ggplot within RStudio? Posted: 07 Mar 2021 07:26 AM PST I teach programming in R and a while back I found a package that, when run, would pop out a front-end for visualization using ggplot that made visualization much easier. I stupidly didn't save it and Googling hasn't helped. Any ideas? I'd be super grateful. [link] [comments] |
I am having Septum Nose Piercing , Does it affect my job? Posted: 07 Mar 2021 05:16 AM PST I will hide or remove it while interview , I will only use when i am not on formal. I've found, We can hide that piercing [link] [comments] |
Posted: 07 Mar 2021 02:48 AM PST Hi everyone, As the title hints, I am trying to get a 4 year old Python script working. Unfortunately, I virtually spend all my time with C# so I am unsure of what I am looking at, on top of being an amateur, self-taught programmer. I've tried to make some "brute force" hacks in which I just "added" what I think would make it work, but I am just getting more and more errors (progress!). Long story short, I am kinda at my wit's end, as this was just supposed to be a relatively quick venture into getting this to work. So here is the github : https://github.com/Leo675/twitch-botbuster EDIT : Important : The first issue I encountered was uh, line 21
`Invalid syntax`. I have downloaded Python (3.9 I believe) and have gotten it to "run" - as in encounter run-time errors. The latest of which was a :
Any time or help would be greatly appreciated, but it is understandably a tall order. I really don't know what I'm looking at, haha. But it is motivating me to learn Python, but that is greatly detracted by my lack of time and ongoing - well everything really. Thanks again, stay safe everyone. P.S. Er, for the record, that error I posted was after I added my C# "fixes", so incredibly likely you won't encounter the same issue. [link] [comments] |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment